@rsdoctor/utils 1.2.2 → 1.2.4-beta.0

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.
Files changed (211) hide show
  1. package/compiled/connect/index.d.ts +90 -0
  2. package/compiled/connect/index.js +2427 -0
  3. package/compiled/connect/license +25 -0
  4. package/compiled/connect/package.json +1 -0
  5. package/compiled/filesize/index.d.ts +58 -0
  6. package/compiled/filesize/index.js +255 -0
  7. package/compiled/filesize/license +28 -0
  8. package/compiled/filesize/package.json +1 -0
  9. package/dist/{type/build → build}/envinfo.d.ts +0 -1
  10. package/dist/{type/build → build}/file/cache.d.ts +0 -1
  11. package/dist/build/file/index.d.ts +3 -0
  12. package/dist/{type/build → build}/file/sharding.d.ts +0 -1
  13. package/dist/{type/build → build}/index.d.ts +0 -1
  14. package/dist/{type/build → build}/json.d.ts +0 -1
  15. package/dist/{type/build → build}/process.d.ts +0 -1
  16. package/dist/{type/build → build}/server.d.ts +0 -1
  17. package/dist/build.cjs +1310 -0
  18. package/dist/build.js +343 -0
  19. package/dist/{type/common → common}/alerts.d.ts +0 -1
  20. package/dist/{type/common → common}/algorithm.d.ts +0 -1
  21. package/dist/{type/common → common}/bundle.d.ts +0 -1
  22. package/dist/{type/common → common}/crypto.d.ts +0 -1
  23. package/dist/{type/common → common}/data/index.d.ts +0 -1
  24. package/dist/{type/common → common}/file.d.ts +0 -1
  25. package/dist/{type/common → common}/global-config.d.ts +0 -1
  26. package/dist/{type/common → common}/graph/assets.d.ts +0 -1
  27. package/dist/{type/common → common}/graph/chunk.d.ts +0 -1
  28. package/dist/{type/common → common}/graph/dependency.d.ts +0 -1
  29. package/dist/{type/common → common}/graph/entrypoints.d.ts +0 -1
  30. package/dist/{type/common → common}/graph/index.d.ts +0 -1
  31. package/dist/{type/common → common}/graph/modules.d.ts +0 -1
  32. package/dist/{type/common → common}/index.d.ts +0 -1
  33. package/dist/{type/common → common}/loader.d.ts +0 -1
  34. package/dist/{type/common → common}/lodash.d.ts +0 -1
  35. package/dist/{type/common → common}/manifest.d.ts +0 -1
  36. package/dist/{type/common → common}/package.d.ts +0 -1
  37. package/dist/{type/common → common}/plugin.d.ts +0 -1
  38. package/dist/{type/common → common}/resolver.d.ts +0 -1
  39. package/dist/{type/common → common}/rspack.d.ts +0 -1
  40. package/dist/{type/common → common}/summary.d.ts +0 -1
  41. package/dist/{type/common → common}/time.d.ts +0 -1
  42. package/dist/{type/common → common}/url.d.ts +0 -1
  43. package/dist/common.cjs +1328 -0
  44. package/dist/common.js +1255 -0
  45. package/dist/{type/error → error}/error.d.ts +0 -1
  46. package/dist/{type/error → error}/index.d.ts +0 -1
  47. package/dist/{type/error → error}/transform.d.ts +0 -1
  48. package/dist/{type/error → error}/utils.d.ts +0 -1
  49. package/dist/error.cjs +310 -0
  50. package/dist/error.js +232 -0
  51. package/dist/logger.cjs +82 -0
  52. package/dist/{type/logger.d.ts → logger.d.ts} +0 -1
  53. package/dist/{esm/logger.mjs → logger.js} +8 -13
  54. package/dist/{type/rule-utils → rule-utils}/document/document.d.ts +0 -1
  55. package/dist/{type/rule-utils → rule-utils}/document/index.d.ts +0 -1
  56. package/dist/{type/rule-utils → rule-utils}/document/server.d.ts +0 -1
  57. package/dist/{type/rule-utils → rule-utils}/document/types.d.ts +0 -1
  58. package/dist/{type/rule-utils → rule-utils}/index.d.ts +0 -1
  59. package/dist/{type/rule-utils → rule-utils}/parser/asserts.d.ts +0 -1
  60. package/dist/{type/rule-utils → rule-utils}/parser/index.d.ts +0 -1
  61. package/dist/{type/rule-utils → rule-utils}/parser/parser.d.ts +0 -1
  62. package/dist/{type/rule-utils → rule-utils}/parser/types.d.ts +0 -1
  63. package/dist/{type/rule-utils → rule-utils}/parser/utils.d.ts +0 -1
  64. package/dist/ruleUtils.cjs +320 -0
  65. package/dist/ruleUtils.js +256 -0
  66. package/package.json +35 -39
  67. package/dist/cjs/build/envinfo.js +0 -121
  68. package/dist/cjs/build/file/cache.js +0 -76
  69. package/dist/cjs/build/file/index.js +0 -81
  70. package/dist/cjs/build/file/sharding.js +0 -96
  71. package/dist/cjs/build/index.js +0 -52
  72. package/dist/cjs/build/json.js +0 -103
  73. package/dist/cjs/build/process.js +0 -54
  74. package/dist/cjs/build/server.js +0 -158
  75. package/dist/cjs/common/alerts.js +0 -51
  76. package/dist/cjs/common/algorithm.js +0 -75
  77. package/dist/cjs/common/bundle.js +0 -62
  78. package/dist/cjs/common/crypto.js +0 -54
  79. package/dist/cjs/common/data/index.js +0 -396
  80. package/dist/cjs/common/file.js +0 -44
  81. package/dist/cjs/common/global-config.js +0 -81
  82. package/dist/cjs/common/graph/assets.js +0 -314
  83. package/dist/cjs/common/graph/chunk.js +0 -81
  84. package/dist/cjs/common/graph/dependency.js +0 -50
  85. package/dist/cjs/common/graph/entrypoints.js +0 -38
  86. package/dist/cjs/common/graph/index.js +0 -96
  87. package/dist/cjs/common/graph/modules.js +0 -133
  88. package/dist/cjs/common/index.js +0 -104
  89. package/dist/cjs/common/loader.js +0 -320
  90. package/dist/cjs/common/lodash.js +0 -93
  91. package/dist/cjs/common/manifest.js +0 -70
  92. package/dist/cjs/common/package.js +0 -96
  93. package/dist/cjs/common/plugin.js +0 -91
  94. package/dist/cjs/common/resolver.js +0 -92
  95. package/dist/cjs/common/rspack.js +0 -65
  96. package/dist/cjs/common/summary.js +0 -42
  97. package/dist/cjs/common/time.js +0 -86
  98. package/dist/cjs/common/url.js +0 -54
  99. package/dist/cjs/error/error.js +0 -199
  100. package/dist/cjs/error/index.js +0 -73
  101. package/dist/cjs/error/transform.js +0 -182
  102. package/dist/cjs/error/utils.js +0 -62
  103. package/dist/cjs/index.js +0 -40
  104. package/dist/cjs/logger.js +0 -106
  105. package/dist/cjs/rule-utils/document/document.js +0 -92
  106. package/dist/cjs/rule-utils/document/index.js +0 -78
  107. package/dist/cjs/rule-utils/document/server.js +0 -49
  108. package/dist/cjs/rule-utils/document/types.js +0 -18
  109. package/dist/cjs/rule-utils/index.js +0 -69
  110. package/dist/cjs/rule-utils/parser/asserts.js +0 -138
  111. package/dist/cjs/rule-utils/parser/index.js +0 -87
  112. package/dist/cjs/rule-utils/parser/parser.js +0 -57
  113. package/dist/cjs/rule-utils/parser/types.js +0 -41
  114. package/dist/cjs/rule-utils/parser/utils.js +0 -170
  115. package/dist/esm/build/envinfo.mjs +0 -57
  116. package/dist/esm/build/file/cache.mjs +0 -23
  117. package/dist/esm/build/file/index.mjs +0 -4
  118. package/dist/esm/build/file/sharding.mjs +0 -50
  119. package/dist/esm/build/index.mjs +0 -6
  120. package/dist/esm/build/json.mjs +0 -66
  121. package/dist/esm/build/process.mjs +0 -17
  122. package/dist/esm/build/server.mjs +0 -96
  123. package/dist/esm/common/alerts.mjs +0 -17
  124. package/dist/esm/common/algorithm.mjs +0 -32
  125. package/dist/esm/common/bundle.mjs +0 -22
  126. package/dist/esm/common/crypto.mjs +0 -17
  127. package/dist/esm/common/data/index.mjs +0 -362
  128. package/dist/esm/common/file.mjs +0 -7
  129. package/dist/esm/common/global-config.mjs +0 -32
  130. package/dist/esm/common/graph/assets.mjs +0 -238
  131. package/dist/esm/common/graph/chunk.mjs +0 -32
  132. package/dist/esm/common/graph/dependency.mjs +0 -10
  133. package/dist/esm/common/graph/entrypoints.mjs +0 -4
  134. package/dist/esm/common/graph/index.mjs +0 -5
  135. package/dist/esm/common/graph/modules.mjs +0 -78
  136. package/dist/esm/common/index.mjs +0 -19
  137. package/dist/esm/common/loader.mjs +0 -247
  138. package/dist/esm/common/lodash.mjs +0 -32
  139. package/dist/esm/common/manifest.mjs +0 -30
  140. package/dist/esm/common/package.mjs +0 -56
  141. package/dist/esm/common/plugin.mjs +0 -48
  142. package/dist/esm/common/resolver.mjs +0 -46
  143. package/dist/esm/common/rspack.mjs +0 -25
  144. package/dist/esm/common/summary.mjs +0 -8
  145. package/dist/esm/common/time.mjs +0 -43
  146. package/dist/esm/common/url.mjs +0 -14
  147. package/dist/esm/error/error.mjs +0 -154
  148. package/dist/esm/error/index.mjs +0 -3
  149. package/dist/esm/error/transform.mjs +0 -138
  150. package/dist/esm/error/utils.mjs +0 -22
  151. package/dist/esm/index.mjs +0 -3
  152. package/dist/esm/rule-utils/document/document.mjs +0 -58
  153. package/dist/esm/rule-utils/document/index.mjs +0 -3
  154. package/dist/esm/rule-utils/document/server.mjs +0 -12
  155. package/dist/esm/rule-utils/document/types.mjs +0 -0
  156. package/dist/esm/rule-utils/index.mjs +0 -2
  157. package/dist/esm/rule-utils/parser/asserts.mjs +0 -104
  158. package/dist/esm/rule-utils/parser/index.mjs +0 -4
  159. package/dist/esm/rule-utils/parser/parser.mjs +0 -23
  160. package/dist/esm/rule-utils/parser/types.mjs +0 -7
  161. package/dist/esm/rule-utils/parser/utils.mjs +0 -109
  162. package/dist/type/build/envinfo.d.ts.map +0 -1
  163. package/dist/type/build/file/cache.d.ts.map +0 -1
  164. package/dist/type/build/file/index.d.ts +0 -4
  165. package/dist/type/build/file/index.d.ts.map +0 -1
  166. package/dist/type/build/file/sharding.d.ts.map +0 -1
  167. package/dist/type/build/index.d.ts.map +0 -1
  168. package/dist/type/build/json.d.ts.map +0 -1
  169. package/dist/type/build/process.d.ts.map +0 -1
  170. package/dist/type/build/server.d.ts.map +0 -1
  171. package/dist/type/common/alerts.d.ts.map +0 -1
  172. package/dist/type/common/algorithm.d.ts.map +0 -1
  173. package/dist/type/common/bundle.d.ts.map +0 -1
  174. package/dist/type/common/crypto.d.ts.map +0 -1
  175. package/dist/type/common/data/index.d.ts.map +0 -1
  176. package/dist/type/common/file.d.ts.map +0 -1
  177. package/dist/type/common/global-config.d.ts.map +0 -1
  178. package/dist/type/common/graph/assets.d.ts.map +0 -1
  179. package/dist/type/common/graph/chunk.d.ts.map +0 -1
  180. package/dist/type/common/graph/dependency.d.ts.map +0 -1
  181. package/dist/type/common/graph/entrypoints.d.ts.map +0 -1
  182. package/dist/type/common/graph/index.d.ts.map +0 -1
  183. package/dist/type/common/graph/modules.d.ts.map +0 -1
  184. package/dist/type/common/index.d.ts.map +0 -1
  185. package/dist/type/common/loader.d.ts.map +0 -1
  186. package/dist/type/common/lodash.d.ts.map +0 -1
  187. package/dist/type/common/manifest.d.ts.map +0 -1
  188. package/dist/type/common/package.d.ts.map +0 -1
  189. package/dist/type/common/plugin.d.ts.map +0 -1
  190. package/dist/type/common/resolver.d.ts.map +0 -1
  191. package/dist/type/common/rspack.d.ts.map +0 -1
  192. package/dist/type/common/summary.d.ts.map +0 -1
  193. package/dist/type/common/time.d.ts.map +0 -1
  194. package/dist/type/common/url.d.ts.map +0 -1
  195. package/dist/type/error/error.d.ts.map +0 -1
  196. package/dist/type/error/index.d.ts.map +0 -1
  197. package/dist/type/error/transform.d.ts.map +0 -1
  198. package/dist/type/error/utils.d.ts.map +0 -1
  199. package/dist/type/index.d.ts +0 -3
  200. package/dist/type/index.d.ts.map +0 -1
  201. package/dist/type/logger.d.ts.map +0 -1
  202. package/dist/type/rule-utils/document/document.d.ts.map +0 -1
  203. package/dist/type/rule-utils/document/index.d.ts.map +0 -1
  204. package/dist/type/rule-utils/document/server.d.ts.map +0 -1
  205. package/dist/type/rule-utils/document/types.d.ts.map +0 -1
  206. package/dist/type/rule-utils/index.d.ts.map +0 -1
  207. package/dist/type/rule-utils/parser/asserts.d.ts.map +0 -1
  208. package/dist/type/rule-utils/parser/index.d.ts.map +0 -1
  209. package/dist/type/rule-utils/parser/parser.d.ts.map +0 -1
  210. package/dist/type/rule-utils/parser/types.d.ts.map +0 -1
  211. package/dist/type/rule-utils/parser/utils.d.ts.map +0 -1
@@ -0,0 +1,2427 @@
1
+ /******/ (() => { // webpackBootstrap
2
+ /******/ var __webpack_modules__ = ({
3
+
4
+ /***/ 718:
5
+ /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
6
+
7
+ "use strict";
8
+ /*!
9
+ * connect
10
+ * Copyright(c) 2010 Sencha Inc.
11
+ * Copyright(c) 2011 TJ Holowaychuk
12
+ * Copyright(c) 2015 Douglas Christopher Wilson
13
+ * MIT Licensed
14
+ */
15
+
16
+
17
+
18
+ /**
19
+ * Module dependencies.
20
+ * @private
21
+ */
22
+
23
+ var debug = __nccwpck_require__(408)('connect:dispatcher');
24
+ var EventEmitter = (__nccwpck_require__(434).EventEmitter);
25
+ var finalhandler = __nccwpck_require__(260);
26
+ var http = __nccwpck_require__(611);
27
+ var merge = __nccwpck_require__(670);
28
+ var parseUrl = __nccwpck_require__(405);
29
+
30
+ /**
31
+ * Module exports.
32
+ * @public
33
+ */
34
+
35
+ module.exports = createServer;
36
+
37
+ /**
38
+ * Module variables.
39
+ * @private
40
+ */
41
+
42
+ var env = process.env.NODE_ENV || 'development';
43
+ var proto = {};
44
+
45
+ /* istanbul ignore next */
46
+ var defer = typeof setImmediate === 'function'
47
+ ? setImmediate
48
+ : function(fn){ process.nextTick(fn.bind.apply(fn, arguments)) }
49
+
50
+ /**
51
+ * Create a new connect server.
52
+ *
53
+ * @return {function}
54
+ * @public
55
+ */
56
+
57
+ function createServer() {
58
+ function app(req, res, next){ app.handle(req, res, next); }
59
+ merge(app, proto);
60
+ merge(app, EventEmitter.prototype);
61
+ app.route = '/';
62
+ app.stack = [];
63
+ return app;
64
+ }
65
+
66
+ /**
67
+ * Utilize the given middleware `handle` to the given `route`,
68
+ * defaulting to _/_. This "route" is the mount-point for the
69
+ * middleware, when given a value other than _/_ the middleware
70
+ * is only effective when that segment is present in the request's
71
+ * pathname.
72
+ *
73
+ * For example if we were to mount a function at _/admin_, it would
74
+ * be invoked on _/admin_, and _/admin/settings_, however it would
75
+ * not be invoked for _/_, or _/posts_.
76
+ *
77
+ * @param {String|Function|Server} route, callback or server
78
+ * @param {Function|Server} callback or server
79
+ * @return {Server} for chaining
80
+ * @public
81
+ */
82
+
83
+ proto.use = function use(route, fn) {
84
+ var handle = fn;
85
+ var path = route;
86
+
87
+ // default route to '/'
88
+ if (typeof route !== 'string') {
89
+ handle = route;
90
+ path = '/';
91
+ }
92
+
93
+ // wrap sub-apps
94
+ if (typeof handle.handle === 'function') {
95
+ var server = handle;
96
+ server.route = path;
97
+ handle = function (req, res, next) {
98
+ server.handle(req, res, next);
99
+ };
100
+ }
101
+
102
+ // wrap vanilla http.Servers
103
+ if (handle instanceof http.Server) {
104
+ handle = handle.listeners('request')[0];
105
+ }
106
+
107
+ // strip trailing slash
108
+ if (path[path.length - 1] === '/') {
109
+ path = path.slice(0, -1);
110
+ }
111
+
112
+ // add the middleware
113
+ debug('use %s %s', path || '/', handle.name || 'anonymous');
114
+ this.stack.push({ route: path, handle: handle });
115
+
116
+ return this;
117
+ };
118
+
119
+ /**
120
+ * Handle server requests, punting them down
121
+ * the middleware stack.
122
+ *
123
+ * @private
124
+ */
125
+
126
+ proto.handle = function handle(req, res, out) {
127
+ var index = 0;
128
+ var protohost = getProtohost(req.url) || '';
129
+ var removed = '';
130
+ var slashAdded = false;
131
+ var stack = this.stack;
132
+
133
+ // final function handler
134
+ var done = out || finalhandler(req, res, {
135
+ env: env,
136
+ onerror: logerror
137
+ });
138
+
139
+ // store the original URL
140
+ req.originalUrl = req.originalUrl || req.url;
141
+
142
+ function next(err) {
143
+ if (slashAdded) {
144
+ req.url = req.url.substr(1);
145
+ slashAdded = false;
146
+ }
147
+
148
+ if (removed.length !== 0) {
149
+ req.url = protohost + removed + req.url.substr(protohost.length);
150
+ removed = '';
151
+ }
152
+
153
+ // next callback
154
+ var layer = stack[index++];
155
+
156
+ // all done
157
+ if (!layer) {
158
+ defer(done, err);
159
+ return;
160
+ }
161
+
162
+ // route data
163
+ var path = parseUrl(req).pathname || '/';
164
+ var route = layer.route;
165
+
166
+ // skip this layer if the route doesn't match
167
+ if (path.toLowerCase().substr(0, route.length) !== route.toLowerCase()) {
168
+ return next(err);
169
+ }
170
+
171
+ // skip if route match does not border "/", ".", or end
172
+ var c = path.length > route.length && path[route.length];
173
+ if (c && c !== '/' && c !== '.') {
174
+ return next(err);
175
+ }
176
+
177
+ // trim off the part of the url that matches the route
178
+ if (route.length !== 0 && route !== '/') {
179
+ removed = route;
180
+ req.url = protohost + req.url.substr(protohost.length + removed.length);
181
+
182
+ // ensure leading slash
183
+ if (!protohost && req.url[0] !== '/') {
184
+ req.url = '/' + req.url;
185
+ slashAdded = true;
186
+ }
187
+ }
188
+
189
+ // call the layer handle
190
+ call(layer.handle, route, err, req, res, next);
191
+ }
192
+
193
+ next();
194
+ };
195
+
196
+ /**
197
+ * Listen for connections.
198
+ *
199
+ * This method takes the same arguments
200
+ * as node's `http.Server#listen()`.
201
+ *
202
+ * HTTP and HTTPS:
203
+ *
204
+ * If you run your application both as HTTP
205
+ * and HTTPS you may wrap them individually,
206
+ * since your Connect "server" is really just
207
+ * a JavaScript `Function`.
208
+ *
209
+ * var connect = require('connect')
210
+ * , http = require('http')
211
+ * , https = require('https');
212
+ *
213
+ * var app = connect();
214
+ *
215
+ * http.createServer(app).listen(80);
216
+ * https.createServer(options, app).listen(443);
217
+ *
218
+ * @return {http.Server}
219
+ * @api public
220
+ */
221
+
222
+ proto.listen = function listen() {
223
+ var server = http.createServer(this);
224
+ return server.listen.apply(server, arguments);
225
+ };
226
+
227
+ /**
228
+ * Invoke a route handle.
229
+ * @private
230
+ */
231
+
232
+ function call(handle, route, err, req, res, next) {
233
+ var arity = handle.length;
234
+ var error = err;
235
+ var hasError = Boolean(err);
236
+
237
+ debug('%s %s : %s', handle.name || '<anonymous>', route, req.originalUrl);
238
+
239
+ try {
240
+ if (hasError && arity === 4) {
241
+ // error-handling middleware
242
+ handle(err, req, res, next);
243
+ return;
244
+ } else if (!hasError && arity < 4) {
245
+ // request-handling middleware
246
+ handle(req, res, next);
247
+ return;
248
+ }
249
+ } catch (e) {
250
+ // replace the error
251
+ error = e;
252
+ }
253
+
254
+ // continue
255
+ next(error);
256
+ }
257
+
258
+ /**
259
+ * Log error using console.error.
260
+ *
261
+ * @param {Error} err
262
+ * @private
263
+ */
264
+
265
+ function logerror(err) {
266
+ if (env !== 'test') console.error(err.stack || err.toString());
267
+ }
268
+
269
+ /**
270
+ * Get get protocol + host for a URL.
271
+ *
272
+ * @param {string} url
273
+ * @private
274
+ */
275
+
276
+ function getProtohost(url) {
277
+ if (url.length === 0 || url[0] === '/') {
278
+ return undefined;
279
+ }
280
+
281
+ var fqdnIndex = url.indexOf('://')
282
+
283
+ return fqdnIndex !== -1 && url.lastIndexOf('?', fqdnIndex) === -1
284
+ ? url.substr(0, url.indexOf('/', 3 + fqdnIndex))
285
+ : undefined;
286
+ }
287
+
288
+
289
+ /***/ }),
290
+
291
+ /***/ 932:
292
+ /***/ ((module, exports, __nccwpck_require__) => {
293
+
294
+ /**
295
+ * This is the web browser implementation of `debug()`.
296
+ *
297
+ * Expose `debug()` as the module.
298
+ */
299
+
300
+ exports = module.exports = __nccwpck_require__(55);
301
+ exports.log = log;
302
+ exports.formatArgs = formatArgs;
303
+ exports.save = save;
304
+ exports.load = load;
305
+ exports.useColors = useColors;
306
+ exports.storage = 'undefined' != typeof chrome
307
+ && 'undefined' != typeof chrome.storage
308
+ ? chrome.storage.local
309
+ : localstorage();
310
+
311
+ /**
312
+ * Colors.
313
+ */
314
+
315
+ exports.colors = [
316
+ 'lightseagreen',
317
+ 'forestgreen',
318
+ 'goldenrod',
319
+ 'dodgerblue',
320
+ 'darkorchid',
321
+ 'crimson'
322
+ ];
323
+
324
+ /**
325
+ * Currently only WebKit-based Web Inspectors, Firefox >= v31,
326
+ * and the Firebug extension (any Firefox version) are known
327
+ * to support "%c" CSS customizations.
328
+ *
329
+ * TODO: add a `localStorage` variable to explicitly enable/disable colors
330
+ */
331
+
332
+ function useColors() {
333
+ // NB: In an Electron preload script, document will be defined but not fully
334
+ // initialized. Since we know we're in Chrome, we'll just detect this case
335
+ // explicitly
336
+ if (typeof window !== 'undefined' && window.process && window.process.type === 'renderer') {
337
+ return true;
338
+ }
339
+
340
+ // is webkit? http://stackoverflow.com/a/16459606/376773
341
+ // document is undefined in react-native: https://github.com/facebook/react-native/pull/1632
342
+ return (typeof document !== 'undefined' && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance) ||
343
+ // is firebug? http://stackoverflow.com/a/398120/376773
344
+ (typeof window !== 'undefined' && window.console && (window.console.firebug || (window.console.exception && window.console.table))) ||
345
+ // is firefox >= v31?
346
+ // https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages
347
+ (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/) && parseInt(RegExp.$1, 10) >= 31) ||
348
+ // double check webkit in userAgent just in case we are in a worker
349
+ (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/));
350
+ }
351
+
352
+ /**
353
+ * Map %j to `JSON.stringify()`, since no Web Inspectors do that by default.
354
+ */
355
+
356
+ exports.formatters.j = function(v) {
357
+ try {
358
+ return JSON.stringify(v);
359
+ } catch (err) {
360
+ return '[UnexpectedJSONParseError]: ' + err.message;
361
+ }
362
+ };
363
+
364
+
365
+ /**
366
+ * Colorize log arguments if enabled.
367
+ *
368
+ * @api public
369
+ */
370
+
371
+ function formatArgs(args) {
372
+ var useColors = this.useColors;
373
+
374
+ args[0] = (useColors ? '%c' : '')
375
+ + this.namespace
376
+ + (useColors ? ' %c' : ' ')
377
+ + args[0]
378
+ + (useColors ? '%c ' : ' ')
379
+ + '+' + exports.humanize(this.diff);
380
+
381
+ if (!useColors) return;
382
+
383
+ var c = 'color: ' + this.color;
384
+ args.splice(1, 0, c, 'color: inherit')
385
+
386
+ // the final "%c" is somewhat tricky, because there could be other
387
+ // arguments passed either before or after the %c, so we need to
388
+ // figure out the correct index to insert the CSS into
389
+ var index = 0;
390
+ var lastC = 0;
391
+ args[0].replace(/%[a-zA-Z%]/g, function(match) {
392
+ if ('%%' === match) return;
393
+ index++;
394
+ if ('%c' === match) {
395
+ // we only are interested in the *last* %c
396
+ // (the user may have provided their own)
397
+ lastC = index;
398
+ }
399
+ });
400
+
401
+ args.splice(lastC, 0, c);
402
+ }
403
+
404
+ /**
405
+ * Invokes `console.log()` when available.
406
+ * No-op when `console.log` is not a "function".
407
+ *
408
+ * @api public
409
+ */
410
+
411
+ function log() {
412
+ // this hackery is required for IE8/9, where
413
+ // the `console.log` function doesn't have 'apply'
414
+ return 'object' === typeof console
415
+ && console.log
416
+ && Function.prototype.apply.call(console.log, console, arguments);
417
+ }
418
+
419
+ /**
420
+ * Save `namespaces`.
421
+ *
422
+ * @param {String} namespaces
423
+ * @api private
424
+ */
425
+
426
+ function save(namespaces) {
427
+ try {
428
+ if (null == namespaces) {
429
+ exports.storage.removeItem('debug');
430
+ } else {
431
+ exports.storage.debug = namespaces;
432
+ }
433
+ } catch(e) {}
434
+ }
435
+
436
+ /**
437
+ * Load `namespaces`.
438
+ *
439
+ * @return {String} returns the previously persisted debug modes
440
+ * @api private
441
+ */
442
+
443
+ function load() {
444
+ var r;
445
+ try {
446
+ r = exports.storage.debug;
447
+ } catch(e) {}
448
+
449
+ // If debug isn't set in LS, and we're in Electron, try to load $DEBUG
450
+ if (!r && typeof process !== 'undefined' && 'env' in process) {
451
+ r = process.env.DEBUG;
452
+ }
453
+
454
+ return r;
455
+ }
456
+
457
+ /**
458
+ * Enable namespaces listed in `localStorage.debug` initially.
459
+ */
460
+
461
+ exports.enable(load());
462
+
463
+ /**
464
+ * Localstorage attempts to return the localstorage.
465
+ *
466
+ * This is necessary because safari throws
467
+ * when a user disables cookies/localstorage
468
+ * and you attempt to access it.
469
+ *
470
+ * @return {LocalStorage}
471
+ * @api private
472
+ */
473
+
474
+ function localstorage() {
475
+ try {
476
+ return window.localStorage;
477
+ } catch (e) {}
478
+ }
479
+
480
+
481
+ /***/ }),
482
+
483
+ /***/ 55:
484
+ /***/ ((module, exports, __nccwpck_require__) => {
485
+
486
+
487
+ /**
488
+ * This is the common logic for both the Node.js and web browser
489
+ * implementations of `debug()`.
490
+ *
491
+ * Expose `debug()` as the module.
492
+ */
493
+
494
+ exports = module.exports = createDebug.debug = createDebug['default'] = createDebug;
495
+ exports.coerce = coerce;
496
+ exports.disable = disable;
497
+ exports.enable = enable;
498
+ exports.enabled = enabled;
499
+ exports.humanize = __nccwpck_require__(916);
500
+
501
+ /**
502
+ * The currently active debug mode names, and names to skip.
503
+ */
504
+
505
+ exports.names = [];
506
+ exports.skips = [];
507
+
508
+ /**
509
+ * Map of special "%n" handling functions, for the debug "format" argument.
510
+ *
511
+ * Valid key names are a single, lower or upper-case letter, i.e. "n" and "N".
512
+ */
513
+
514
+ exports.formatters = {};
515
+
516
+ /**
517
+ * Previous log timestamp.
518
+ */
519
+
520
+ var prevTime;
521
+
522
+ /**
523
+ * Select a color.
524
+ * @param {String} namespace
525
+ * @return {Number}
526
+ * @api private
527
+ */
528
+
529
+ function selectColor(namespace) {
530
+ var hash = 0, i;
531
+
532
+ for (i in namespace) {
533
+ hash = ((hash << 5) - hash) + namespace.charCodeAt(i);
534
+ hash |= 0; // Convert to 32bit integer
535
+ }
536
+
537
+ return exports.colors[Math.abs(hash) % exports.colors.length];
538
+ }
539
+
540
+ /**
541
+ * Create a debugger with the given `namespace`.
542
+ *
543
+ * @param {String} namespace
544
+ * @return {Function}
545
+ * @api public
546
+ */
547
+
548
+ function createDebug(namespace) {
549
+
550
+ function debug() {
551
+ // disabled?
552
+ if (!debug.enabled) return;
553
+
554
+ var self = debug;
555
+
556
+ // set `diff` timestamp
557
+ var curr = +new Date();
558
+ var ms = curr - (prevTime || curr);
559
+ self.diff = ms;
560
+ self.prev = prevTime;
561
+ self.curr = curr;
562
+ prevTime = curr;
563
+
564
+ // turn the `arguments` into a proper Array
565
+ var args = new Array(arguments.length);
566
+ for (var i = 0; i < args.length; i++) {
567
+ args[i] = arguments[i];
568
+ }
569
+
570
+ args[0] = exports.coerce(args[0]);
571
+
572
+ if ('string' !== typeof args[0]) {
573
+ // anything else let's inspect with %O
574
+ args.unshift('%O');
575
+ }
576
+
577
+ // apply any `formatters` transformations
578
+ var index = 0;
579
+ args[0] = args[0].replace(/%([a-zA-Z%])/g, function(match, format) {
580
+ // if we encounter an escaped % then don't increase the array index
581
+ if (match === '%%') return match;
582
+ index++;
583
+ var formatter = exports.formatters[format];
584
+ if ('function' === typeof formatter) {
585
+ var val = args[index];
586
+ match = formatter.call(self, val);
587
+
588
+ // now we need to remove `args[index]` since it's inlined in the `format`
589
+ args.splice(index, 1);
590
+ index--;
591
+ }
592
+ return match;
593
+ });
594
+
595
+ // apply env-specific formatting (colors, etc.)
596
+ exports.formatArgs.call(self, args);
597
+
598
+ var logFn = debug.log || exports.log || console.log.bind(console);
599
+ logFn.apply(self, args);
600
+ }
601
+
602
+ debug.namespace = namespace;
603
+ debug.enabled = exports.enabled(namespace);
604
+ debug.useColors = exports.useColors();
605
+ debug.color = selectColor(namespace);
606
+
607
+ // env-specific initialization logic for debug instances
608
+ if ('function' === typeof exports.init) {
609
+ exports.init(debug);
610
+ }
611
+
612
+ return debug;
613
+ }
614
+
615
+ /**
616
+ * Enables a debug mode by namespaces. This can include modes
617
+ * separated by a colon and wildcards.
618
+ *
619
+ * @param {String} namespaces
620
+ * @api public
621
+ */
622
+
623
+ function enable(namespaces) {
624
+ exports.save(namespaces);
625
+
626
+ exports.names = [];
627
+ exports.skips = [];
628
+
629
+ var split = (typeof namespaces === 'string' ? namespaces : '').split(/[\s,]+/);
630
+ var len = split.length;
631
+
632
+ for (var i = 0; i < len; i++) {
633
+ if (!split[i]) continue; // ignore empty strings
634
+ namespaces = split[i].replace(/\*/g, '.*?');
635
+ if (namespaces[0] === '-') {
636
+ exports.skips.push(new RegExp('^' + namespaces.substr(1) + '$'));
637
+ } else {
638
+ exports.names.push(new RegExp('^' + namespaces + '$'));
639
+ }
640
+ }
641
+ }
642
+
643
+ /**
644
+ * Disable debug output.
645
+ *
646
+ * @api public
647
+ */
648
+
649
+ function disable() {
650
+ exports.enable('');
651
+ }
652
+
653
+ /**
654
+ * Returns true if the given mode name is enabled, false otherwise.
655
+ *
656
+ * @param {String} name
657
+ * @return {Boolean}
658
+ * @api public
659
+ */
660
+
661
+ function enabled(name) {
662
+ var i, len;
663
+ for (i = 0, len = exports.skips.length; i < len; i++) {
664
+ if (exports.skips[i].test(name)) {
665
+ return false;
666
+ }
667
+ }
668
+ for (i = 0, len = exports.names.length; i < len; i++) {
669
+ if (exports.names[i].test(name)) {
670
+ return true;
671
+ }
672
+ }
673
+ return false;
674
+ }
675
+
676
+ /**
677
+ * Coerce `val`.
678
+ *
679
+ * @param {Mixed} val
680
+ * @return {Mixed}
681
+ * @api private
682
+ */
683
+
684
+ function coerce(val) {
685
+ if (val instanceof Error) return val.stack || val.message;
686
+ return val;
687
+ }
688
+
689
+
690
+ /***/ }),
691
+
692
+ /***/ 408:
693
+ /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
694
+
695
+ /**
696
+ * Detect Electron renderer process, which is node, but we should
697
+ * treat as a browser.
698
+ */
699
+
700
+ if (typeof process !== 'undefined' && process.type === 'renderer') {
701
+ module.exports = __nccwpck_require__(932);
702
+ } else {
703
+ module.exports = __nccwpck_require__(190);
704
+ }
705
+
706
+
707
+ /***/ }),
708
+
709
+ /***/ 190:
710
+ /***/ ((module, exports, __nccwpck_require__) => {
711
+
712
+ /**
713
+ * Module dependencies.
714
+ */
715
+
716
+ var tty = __nccwpck_require__(18);
717
+ var util = __nccwpck_require__(23);
718
+
719
+ /**
720
+ * This is the Node.js implementation of `debug()`.
721
+ *
722
+ * Expose `debug()` as the module.
723
+ */
724
+
725
+ exports = module.exports = __nccwpck_require__(55);
726
+ exports.init = init;
727
+ exports.log = log;
728
+ exports.formatArgs = formatArgs;
729
+ exports.save = save;
730
+ exports.load = load;
731
+ exports.useColors = useColors;
732
+
733
+ /**
734
+ * Colors.
735
+ */
736
+
737
+ exports.colors = [6, 2, 3, 4, 5, 1];
738
+
739
+ /**
740
+ * Build up the default `inspectOpts` object from the environment variables.
741
+ *
742
+ * $ DEBUG_COLORS=no DEBUG_DEPTH=10 DEBUG_SHOW_HIDDEN=enabled node script.js
743
+ */
744
+
745
+ exports.inspectOpts = Object.keys(process.env).filter(function (key) {
746
+ return /^debug_/i.test(key);
747
+ }).reduce(function (obj, key) {
748
+ // camel-case
749
+ var prop = key
750
+ .substring(6)
751
+ .toLowerCase()
752
+ .replace(/_([a-z])/g, function (_, k) { return k.toUpperCase() });
753
+
754
+ // coerce string value into JS value
755
+ var val = process.env[key];
756
+ if (/^(yes|on|true|enabled)$/i.test(val)) val = true;
757
+ else if (/^(no|off|false|disabled)$/i.test(val)) val = false;
758
+ else if (val === 'null') val = null;
759
+ else val = Number(val);
760
+
761
+ obj[prop] = val;
762
+ return obj;
763
+ }, {});
764
+
765
+ /**
766
+ * The file descriptor to write the `debug()` calls to.
767
+ * Set the `DEBUG_FD` env variable to override with another value. i.e.:
768
+ *
769
+ * $ DEBUG_FD=3 node script.js 3>debug.log
770
+ */
771
+
772
+ var fd = parseInt(process.env.DEBUG_FD, 10) || 2;
773
+
774
+ if (1 !== fd && 2 !== fd) {
775
+ util.deprecate(function(){}, 'except for stderr(2) and stdout(1), any other usage of DEBUG_FD is deprecated. Override debug.log if you want to use a different log function (https://git.io/debug_fd)')()
776
+ }
777
+
778
+ var stream = 1 === fd ? process.stdout :
779
+ 2 === fd ? process.stderr :
780
+ createWritableStdioStream(fd);
781
+
782
+ /**
783
+ * Is stdout a TTY? Colored output is enabled when `true`.
784
+ */
785
+
786
+ function useColors() {
787
+ return 'colors' in exports.inspectOpts
788
+ ? Boolean(exports.inspectOpts.colors)
789
+ : tty.isatty(fd);
790
+ }
791
+
792
+ /**
793
+ * Map %o to `util.inspect()`, all on a single line.
794
+ */
795
+
796
+ exports.formatters.o = function(v) {
797
+ this.inspectOpts.colors = this.useColors;
798
+ return util.inspect(v, this.inspectOpts)
799
+ .split('\n').map(function(str) {
800
+ return str.trim()
801
+ }).join(' ');
802
+ };
803
+
804
+ /**
805
+ * Map %o to `util.inspect()`, allowing multiple lines if needed.
806
+ */
807
+
808
+ exports.formatters.O = function(v) {
809
+ this.inspectOpts.colors = this.useColors;
810
+ return util.inspect(v, this.inspectOpts);
811
+ };
812
+
813
+ /**
814
+ * Adds ANSI color escape codes if enabled.
815
+ *
816
+ * @api public
817
+ */
818
+
819
+ function formatArgs(args) {
820
+ var name = this.namespace;
821
+ var useColors = this.useColors;
822
+
823
+ if (useColors) {
824
+ var c = this.color;
825
+ var prefix = ' \u001b[3' + c + ';1m' + name + ' ' + '\u001b[0m';
826
+
827
+ args[0] = prefix + args[0].split('\n').join('\n' + prefix);
828
+ args.push('\u001b[3' + c + 'm+' + exports.humanize(this.diff) + '\u001b[0m');
829
+ } else {
830
+ args[0] = new Date().toUTCString()
831
+ + ' ' + name + ' ' + args[0];
832
+ }
833
+ }
834
+
835
+ /**
836
+ * Invokes `util.format()` with the specified arguments and writes to `stream`.
837
+ */
838
+
839
+ function log() {
840
+ return stream.write(util.format.apply(util, arguments) + '\n');
841
+ }
842
+
843
+ /**
844
+ * Save `namespaces`.
845
+ *
846
+ * @param {String} namespaces
847
+ * @api private
848
+ */
849
+
850
+ function save(namespaces) {
851
+ if (null == namespaces) {
852
+ // If you set a process.env field to null or undefined, it gets cast to the
853
+ // string 'null' or 'undefined'. Just delete instead.
854
+ delete process.env.DEBUG;
855
+ } else {
856
+ process.env.DEBUG = namespaces;
857
+ }
858
+ }
859
+
860
+ /**
861
+ * Load `namespaces`.
862
+ *
863
+ * @return {String} returns the previously persisted debug modes
864
+ * @api private
865
+ */
866
+
867
+ function load() {
868
+ return process.env.DEBUG;
869
+ }
870
+
871
+ /**
872
+ * Copied from `node/src/node.js`.
873
+ *
874
+ * XXX: It's lame that node doesn't expose this API out-of-the-box. It also
875
+ * relies on the undocumented `tty_wrap.guessHandleType()` which is also lame.
876
+ */
877
+
878
+ function createWritableStdioStream (fd) {
879
+ var stream;
880
+ var tty_wrap = process.binding('tty_wrap');
881
+
882
+ // Note stream._type is used for test-module-load-list.js
883
+
884
+ switch (tty_wrap.guessHandleType(fd)) {
885
+ case 'TTY':
886
+ stream = new tty.WriteStream(fd);
887
+ stream._type = 'tty';
888
+
889
+ // Hack to have stream not keep the event loop alive.
890
+ // See https://github.com/joyent/node/issues/1726
891
+ if (stream._handle && stream._handle.unref) {
892
+ stream._handle.unref();
893
+ }
894
+ break;
895
+
896
+ case 'FILE':
897
+ var fs = __nccwpck_require__(896);
898
+ stream = new fs.SyncWriteStream(fd, { autoClose: false });
899
+ stream._type = 'fs';
900
+ break;
901
+
902
+ case 'PIPE':
903
+ case 'TCP':
904
+ var net = __nccwpck_require__(278);
905
+ stream = new net.Socket({
906
+ fd: fd,
907
+ readable: false,
908
+ writable: true
909
+ });
910
+
911
+ // FIXME Should probably have an option in net.Socket to create a
912
+ // stream from an existing fd which is writable only. But for now
913
+ // we'll just add this hack and set the `readable` member to false.
914
+ // Test: ./node test/fixtures/echo.js < /etc/passwd
915
+ stream.readable = false;
916
+ stream.read = null;
917
+ stream._type = 'pipe';
918
+
919
+ // FIXME Hack to have stream not keep the event loop alive.
920
+ // See https://github.com/joyent/node/issues/1726
921
+ if (stream._handle && stream._handle.unref) {
922
+ stream._handle.unref();
923
+ }
924
+ break;
925
+
926
+ default:
927
+ // Probably an error on in uv_guess_handle()
928
+ throw new Error('Implement me. Unknown stream file type!');
929
+ }
930
+
931
+ // For supporting legacy API we put the FD here.
932
+ stream.fd = fd;
933
+
934
+ stream._isStdio = true;
935
+
936
+ return stream;
937
+ }
938
+
939
+ /**
940
+ * Init logic for `debug` instances.
941
+ *
942
+ * Create a new `inspectOpts` object in case `useColors` is set
943
+ * differently for a particular `debug` instance.
944
+ */
945
+
946
+ function init (debug) {
947
+ debug.inspectOpts = {};
948
+
949
+ var keys = Object.keys(exports.inspectOpts);
950
+ for (var i = 0; i < keys.length; i++) {
951
+ debug.inspectOpts[keys[i]] = exports.inspectOpts[keys[i]];
952
+ }
953
+ }
954
+
955
+ /**
956
+ * Enable namespaces listed in `process.env.DEBUG` initially.
957
+ */
958
+
959
+ exports.enable(load());
960
+
961
+
962
+ /***/ }),
963
+
964
+ /***/ 997:
965
+ /***/ ((module) => {
966
+
967
+ "use strict";
968
+ /*!
969
+ * ee-first
970
+ * Copyright(c) 2014 Jonathan Ong
971
+ * MIT Licensed
972
+ */
973
+
974
+
975
+
976
+ /**
977
+ * Module exports.
978
+ * @public
979
+ */
980
+
981
+ module.exports = first
982
+
983
+ /**
984
+ * Get the first event in a set of event emitters and event pairs.
985
+ *
986
+ * @param {array} stuff
987
+ * @param {function} done
988
+ * @public
989
+ */
990
+
991
+ function first(stuff, done) {
992
+ if (!Array.isArray(stuff))
993
+ throw new TypeError('arg must be an array of [ee, events...] arrays')
994
+
995
+ var cleanups = []
996
+
997
+ for (var i = 0; i < stuff.length; i++) {
998
+ var arr = stuff[i]
999
+
1000
+ if (!Array.isArray(arr) || arr.length < 2)
1001
+ throw new TypeError('each array member must be [ee, events...]')
1002
+
1003
+ var ee = arr[0]
1004
+
1005
+ for (var j = 1; j < arr.length; j++) {
1006
+ var event = arr[j]
1007
+ var fn = listener(event, callback)
1008
+
1009
+ // listen to the event
1010
+ ee.on(event, fn)
1011
+ // push this listener to the list of cleanups
1012
+ cleanups.push({
1013
+ ee: ee,
1014
+ event: event,
1015
+ fn: fn,
1016
+ })
1017
+ }
1018
+ }
1019
+
1020
+ function callback() {
1021
+ cleanup()
1022
+ done.apply(null, arguments)
1023
+ }
1024
+
1025
+ function cleanup() {
1026
+ var x
1027
+ for (var i = 0; i < cleanups.length; i++) {
1028
+ x = cleanups[i]
1029
+ x.ee.removeListener(x.event, x.fn)
1030
+ }
1031
+ }
1032
+
1033
+ function thunk(fn) {
1034
+ done = fn
1035
+ }
1036
+
1037
+ thunk.cancel = cleanup
1038
+
1039
+ return thunk
1040
+ }
1041
+
1042
+ /**
1043
+ * Create the event listener.
1044
+ * @private
1045
+ */
1046
+
1047
+ function listener(event, done) {
1048
+ return function onevent(arg1) {
1049
+ var args = new Array(arguments.length)
1050
+ var ee = this
1051
+ var err = event === 'error'
1052
+ ? arg1
1053
+ : null
1054
+
1055
+ // copy args to prevent arguments escaping scope
1056
+ for (var i = 0; i < args.length; i++) {
1057
+ args[i] = arguments[i]
1058
+ }
1059
+
1060
+ done(err, ee, event, args)
1061
+ }
1062
+ }
1063
+
1064
+
1065
+ /***/ }),
1066
+
1067
+ /***/ 131:
1068
+ /***/ ((module) => {
1069
+
1070
+ "use strict";
1071
+ /*!
1072
+ * encodeurl
1073
+ * Copyright(c) 2016 Douglas Christopher Wilson
1074
+ * MIT Licensed
1075
+ */
1076
+
1077
+
1078
+
1079
+ /**
1080
+ * Module exports.
1081
+ * @public
1082
+ */
1083
+
1084
+ module.exports = encodeUrl
1085
+
1086
+ /**
1087
+ * RegExp to match non-URL code points, *after* encoding (i.e. not including "%")
1088
+ * and including invalid escape sequences.
1089
+ * @private
1090
+ */
1091
+
1092
+ var ENCODE_CHARS_REGEXP = /(?:[^\x21\x25\x26-\x3B\x3D\x3F-\x5B\x5D\x5F\x61-\x7A\x7E]|%(?:[^0-9A-Fa-f]|[0-9A-Fa-f][^0-9A-Fa-f]|$))+/g
1093
+
1094
+ /**
1095
+ * RegExp to match unmatched surrogate pair.
1096
+ * @private
1097
+ */
1098
+
1099
+ var UNMATCHED_SURROGATE_PAIR_REGEXP = /(^|[^\uD800-\uDBFF])[\uDC00-\uDFFF]|[\uD800-\uDBFF]([^\uDC00-\uDFFF]|$)/g
1100
+
1101
+ /**
1102
+ * String to replace unmatched surrogate pair with.
1103
+ * @private
1104
+ */
1105
+
1106
+ var UNMATCHED_SURROGATE_PAIR_REPLACE = '$1\uFFFD$2'
1107
+
1108
+ /**
1109
+ * Encode a URL to a percent-encoded form, excluding already-encoded sequences.
1110
+ *
1111
+ * This function will take an already-encoded URL and encode all the non-URL
1112
+ * code points. This function will not encode the "%" character unless it is
1113
+ * not part of a valid sequence (`%20` will be left as-is, but `%foo` will
1114
+ * be encoded as `%25foo`).
1115
+ *
1116
+ * This encode is meant to be "safe" and does not throw errors. It will try as
1117
+ * hard as it can to properly encode the given URL, including replacing any raw,
1118
+ * unpaired surrogate pairs with the Unicode replacement character prior to
1119
+ * encoding.
1120
+ *
1121
+ * @param {string} url
1122
+ * @return {string}
1123
+ * @public
1124
+ */
1125
+
1126
+ function encodeUrl (url) {
1127
+ return String(url)
1128
+ .replace(UNMATCHED_SURROGATE_PAIR_REGEXP, UNMATCHED_SURROGATE_PAIR_REPLACE)
1129
+ .replace(ENCODE_CHARS_REGEXP, encodeURI)
1130
+ }
1131
+
1132
+
1133
+ /***/ }),
1134
+
1135
+ /***/ 754:
1136
+ /***/ ((module) => {
1137
+
1138
+ "use strict";
1139
+ /*!
1140
+ * escape-html
1141
+ * Copyright(c) 2012-2013 TJ Holowaychuk
1142
+ * Copyright(c) 2015 Andreas Lubbe
1143
+ * Copyright(c) 2015 Tiancheng "Timothy" Gu
1144
+ * MIT Licensed
1145
+ */
1146
+
1147
+
1148
+
1149
+ /**
1150
+ * Module variables.
1151
+ * @private
1152
+ */
1153
+
1154
+ var matchHtmlRegExp = /["'&<>]/;
1155
+
1156
+ /**
1157
+ * Module exports.
1158
+ * @public
1159
+ */
1160
+
1161
+ module.exports = escapeHtml;
1162
+
1163
+ /**
1164
+ * Escape special characters in the given string of html.
1165
+ *
1166
+ * @param {string} string The string to escape for inserting into HTML
1167
+ * @return {string}
1168
+ * @public
1169
+ */
1170
+
1171
+ function escapeHtml(string) {
1172
+ var str = '' + string;
1173
+ var match = matchHtmlRegExp.exec(str);
1174
+
1175
+ if (!match) {
1176
+ return str;
1177
+ }
1178
+
1179
+ var escape;
1180
+ var html = '';
1181
+ var index = 0;
1182
+ var lastIndex = 0;
1183
+
1184
+ for (index = match.index; index < str.length; index++) {
1185
+ switch (str.charCodeAt(index)) {
1186
+ case 34: // "
1187
+ escape = '&quot;';
1188
+ break;
1189
+ case 38: // &
1190
+ escape = '&amp;';
1191
+ break;
1192
+ case 39: // '
1193
+ escape = '&#39;';
1194
+ break;
1195
+ case 60: // <
1196
+ escape = '&lt;';
1197
+ break;
1198
+ case 62: // >
1199
+ escape = '&gt;';
1200
+ break;
1201
+ default:
1202
+ continue;
1203
+ }
1204
+
1205
+ if (lastIndex !== index) {
1206
+ html += str.substring(lastIndex, index);
1207
+ }
1208
+
1209
+ lastIndex = index + 1;
1210
+ html += escape;
1211
+ }
1212
+
1213
+ return lastIndex !== index
1214
+ ? html + str.substring(lastIndex, index)
1215
+ : html;
1216
+ }
1217
+
1218
+
1219
+ /***/ }),
1220
+
1221
+ /***/ 260:
1222
+ /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
1223
+
1224
+ "use strict";
1225
+ /*!
1226
+ * finalhandler
1227
+ * Copyright(c) 2014-2017 Douglas Christopher Wilson
1228
+ * MIT Licensed
1229
+ */
1230
+
1231
+
1232
+
1233
+ /**
1234
+ * Module dependencies.
1235
+ * @private
1236
+ */
1237
+
1238
+ var debug = __nccwpck_require__(408)('finalhandler')
1239
+ var encodeUrl = __nccwpck_require__(131)
1240
+ var escapeHtml = __nccwpck_require__(754)
1241
+ var onFinished = __nccwpck_require__(551)
1242
+ var parseUrl = __nccwpck_require__(405)
1243
+ var statuses = __nccwpck_require__(874)
1244
+ var unpipe = __nccwpck_require__(853)
1245
+
1246
+ /**
1247
+ * Module variables.
1248
+ * @private
1249
+ */
1250
+
1251
+ var DOUBLE_SPACE_REGEXP = /\x20{2}/g
1252
+ var NEWLINE_REGEXP = /\n/g
1253
+
1254
+ /* istanbul ignore next */
1255
+ var defer = typeof setImmediate === 'function'
1256
+ ? setImmediate
1257
+ : function (fn) { process.nextTick(fn.bind.apply(fn, arguments)) }
1258
+ var isFinished = onFinished.isFinished
1259
+
1260
+ /**
1261
+ * Create a minimal HTML document.
1262
+ *
1263
+ * @param {string} message
1264
+ * @private
1265
+ */
1266
+
1267
+ function createHtmlDocument (message) {
1268
+ var body = escapeHtml(message)
1269
+ .replace(NEWLINE_REGEXP, '<br>')
1270
+ .replace(DOUBLE_SPACE_REGEXP, ' &nbsp;')
1271
+
1272
+ return '<!DOCTYPE html>\n' +
1273
+ '<html lang="en">\n' +
1274
+ '<head>\n' +
1275
+ '<meta charset="utf-8">\n' +
1276
+ '<title>Error</title>\n' +
1277
+ '</head>\n' +
1278
+ '<body>\n' +
1279
+ '<pre>' + body + '</pre>\n' +
1280
+ '</body>\n' +
1281
+ '</html>\n'
1282
+ }
1283
+
1284
+ /**
1285
+ * Module exports.
1286
+ * @public
1287
+ */
1288
+
1289
+ module.exports = finalhandler
1290
+
1291
+ /**
1292
+ * Create a function to handle the final response.
1293
+ *
1294
+ * @param {Request} req
1295
+ * @param {Response} res
1296
+ * @param {Object} [options]
1297
+ * @return {Function}
1298
+ * @public
1299
+ */
1300
+
1301
+ function finalhandler (req, res, options) {
1302
+ var opts = options || {}
1303
+
1304
+ // get environment
1305
+ var env = opts.env || process.env.NODE_ENV || 'development'
1306
+
1307
+ // get error callback
1308
+ var onerror = opts.onerror
1309
+
1310
+ return function (err) {
1311
+ var headers
1312
+ var msg
1313
+ var status
1314
+
1315
+ // ignore 404 on in-flight response
1316
+ if (!err && headersSent(res)) {
1317
+ debug('cannot 404 after headers sent')
1318
+ return
1319
+ }
1320
+
1321
+ // unhandled error
1322
+ if (err) {
1323
+ // respect status code from error
1324
+ status = getErrorStatusCode(err)
1325
+
1326
+ if (status === undefined) {
1327
+ // fallback to status code on response
1328
+ status = getResponseStatusCode(res)
1329
+ } else {
1330
+ // respect headers from error
1331
+ headers = getErrorHeaders(err)
1332
+ }
1333
+
1334
+ // get error message
1335
+ msg = getErrorMessage(err, status, env)
1336
+ } else {
1337
+ // not found
1338
+ status = 404
1339
+ msg = 'Cannot ' + req.method + ' ' + encodeUrl(getResourceName(req))
1340
+ }
1341
+
1342
+ debug('default %s', status)
1343
+
1344
+ // schedule onerror callback
1345
+ if (err && onerror) {
1346
+ defer(onerror, err, req, res)
1347
+ }
1348
+
1349
+ // cannot actually respond
1350
+ if (headersSent(res)) {
1351
+ debug('cannot %d after headers sent', status)
1352
+ req.socket.destroy()
1353
+ return
1354
+ }
1355
+
1356
+ // send response
1357
+ send(req, res, status, headers, msg)
1358
+ }
1359
+ }
1360
+
1361
+ /**
1362
+ * Get headers from Error object.
1363
+ *
1364
+ * @param {Error} err
1365
+ * @return {object}
1366
+ * @private
1367
+ */
1368
+
1369
+ function getErrorHeaders (err) {
1370
+ if (!err.headers || typeof err.headers !== 'object') {
1371
+ return undefined
1372
+ }
1373
+
1374
+ var headers = Object.create(null)
1375
+ var keys = Object.keys(err.headers)
1376
+
1377
+ for (var i = 0; i < keys.length; i++) {
1378
+ var key = keys[i]
1379
+ headers[key] = err.headers[key]
1380
+ }
1381
+
1382
+ return headers
1383
+ }
1384
+
1385
+ /**
1386
+ * Get message from Error object, fallback to status message.
1387
+ *
1388
+ * @param {Error} err
1389
+ * @param {number} status
1390
+ * @param {string} env
1391
+ * @return {string}
1392
+ * @private
1393
+ */
1394
+
1395
+ function getErrorMessage (err, status, env) {
1396
+ var msg
1397
+
1398
+ if (env !== 'production') {
1399
+ // use err.stack, which typically includes err.message
1400
+ msg = err.stack
1401
+
1402
+ // fallback to err.toString() when possible
1403
+ if (!msg && typeof err.toString === 'function') {
1404
+ msg = err.toString()
1405
+ }
1406
+ }
1407
+
1408
+ return msg || statuses[status]
1409
+ }
1410
+
1411
+ /**
1412
+ * Get status code from Error object.
1413
+ *
1414
+ * @param {Error} err
1415
+ * @return {number}
1416
+ * @private
1417
+ */
1418
+
1419
+ function getErrorStatusCode (err) {
1420
+ // check err.status
1421
+ if (typeof err.status === 'number' && err.status >= 400 && err.status < 600) {
1422
+ return err.status
1423
+ }
1424
+
1425
+ // check err.statusCode
1426
+ if (typeof err.statusCode === 'number' && err.statusCode >= 400 && err.statusCode < 600) {
1427
+ return err.statusCode
1428
+ }
1429
+
1430
+ return undefined
1431
+ }
1432
+
1433
+ /**
1434
+ * Get resource name for the request.
1435
+ *
1436
+ * This is typically just the original pathname of the request
1437
+ * but will fallback to "resource" is that cannot be determined.
1438
+ *
1439
+ * @param {IncomingMessage} req
1440
+ * @return {string}
1441
+ * @private
1442
+ */
1443
+
1444
+ function getResourceName (req) {
1445
+ try {
1446
+ return parseUrl.original(req).pathname
1447
+ } catch (e) {
1448
+ return 'resource'
1449
+ }
1450
+ }
1451
+
1452
+ /**
1453
+ * Get status code from response.
1454
+ *
1455
+ * @param {OutgoingMessage} res
1456
+ * @return {number}
1457
+ * @private
1458
+ */
1459
+
1460
+ function getResponseStatusCode (res) {
1461
+ var status = res.statusCode
1462
+
1463
+ // default status code to 500 if outside valid range
1464
+ if (typeof status !== 'number' || status < 400 || status > 599) {
1465
+ status = 500
1466
+ }
1467
+
1468
+ return status
1469
+ }
1470
+
1471
+ /**
1472
+ * Determine if the response headers have been sent.
1473
+ *
1474
+ * @param {object} res
1475
+ * @returns {boolean}
1476
+ * @private
1477
+ */
1478
+
1479
+ function headersSent (res) {
1480
+ return typeof res.headersSent !== 'boolean'
1481
+ ? Boolean(res._header)
1482
+ : res.headersSent
1483
+ }
1484
+
1485
+ /**
1486
+ * Send response.
1487
+ *
1488
+ * @param {IncomingMessage} req
1489
+ * @param {OutgoingMessage} res
1490
+ * @param {number} status
1491
+ * @param {object} headers
1492
+ * @param {string} message
1493
+ * @private
1494
+ */
1495
+
1496
+ function send (req, res, status, headers, message) {
1497
+ function write () {
1498
+ // response body
1499
+ var body = createHtmlDocument(message)
1500
+
1501
+ // response status
1502
+ res.statusCode = status
1503
+ res.statusMessage = statuses[status]
1504
+
1505
+ // response headers
1506
+ setHeaders(res, headers)
1507
+
1508
+ // security headers
1509
+ res.setHeader('Content-Security-Policy', "default-src 'none'")
1510
+ res.setHeader('X-Content-Type-Options', 'nosniff')
1511
+
1512
+ // standard headers
1513
+ res.setHeader('Content-Type', 'text/html; charset=utf-8')
1514
+ res.setHeader('Content-Length', Buffer.byteLength(body, 'utf8'))
1515
+
1516
+ if (req.method === 'HEAD') {
1517
+ res.end()
1518
+ return
1519
+ }
1520
+
1521
+ res.end(body, 'utf8')
1522
+ }
1523
+
1524
+ if (isFinished(req)) {
1525
+ write()
1526
+ return
1527
+ }
1528
+
1529
+ // unpipe everything from the request
1530
+ unpipe(req)
1531
+
1532
+ // flush the request
1533
+ onFinished(req, write)
1534
+ req.resume()
1535
+ }
1536
+
1537
+ /**
1538
+ * Set response headers from an object.
1539
+ *
1540
+ * @param {OutgoingMessage} res
1541
+ * @param {object} headers
1542
+ * @private
1543
+ */
1544
+
1545
+ function setHeaders (res, headers) {
1546
+ if (!headers) {
1547
+ return
1548
+ }
1549
+
1550
+ var keys = Object.keys(headers)
1551
+ for (var i = 0; i < keys.length; i++) {
1552
+ var key = keys[i]
1553
+ res.setHeader(key, headers[key])
1554
+ }
1555
+ }
1556
+
1557
+
1558
+ /***/ }),
1559
+
1560
+ /***/ 916:
1561
+ /***/ ((module) => {
1562
+
1563
+ /**
1564
+ * Helpers.
1565
+ */
1566
+
1567
+ var s = 1000;
1568
+ var m = s * 60;
1569
+ var h = m * 60;
1570
+ var d = h * 24;
1571
+ var y = d * 365.25;
1572
+
1573
+ /**
1574
+ * Parse or format the given `val`.
1575
+ *
1576
+ * Options:
1577
+ *
1578
+ * - `long` verbose formatting [false]
1579
+ *
1580
+ * @param {String|Number} val
1581
+ * @param {Object} [options]
1582
+ * @throws {Error} throw an error if val is not a non-empty string or a number
1583
+ * @return {String|Number}
1584
+ * @api public
1585
+ */
1586
+
1587
+ module.exports = function(val, options) {
1588
+ options = options || {};
1589
+ var type = typeof val;
1590
+ if (type === 'string' && val.length > 0) {
1591
+ return parse(val);
1592
+ } else if (type === 'number' && isNaN(val) === false) {
1593
+ return options.long ? fmtLong(val) : fmtShort(val);
1594
+ }
1595
+ throw new Error(
1596
+ 'val is not a non-empty string or a valid number. val=' +
1597
+ JSON.stringify(val)
1598
+ );
1599
+ };
1600
+
1601
+ /**
1602
+ * Parse the given `str` and return milliseconds.
1603
+ *
1604
+ * @param {String} str
1605
+ * @return {Number}
1606
+ * @api private
1607
+ */
1608
+
1609
+ function parse(str) {
1610
+ str = String(str);
1611
+ if (str.length > 100) {
1612
+ return;
1613
+ }
1614
+ var match = /^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(
1615
+ str
1616
+ );
1617
+ if (!match) {
1618
+ return;
1619
+ }
1620
+ var n = parseFloat(match[1]);
1621
+ var type = (match[2] || 'ms').toLowerCase();
1622
+ switch (type) {
1623
+ case 'years':
1624
+ case 'year':
1625
+ case 'yrs':
1626
+ case 'yr':
1627
+ case 'y':
1628
+ return n * y;
1629
+ case 'days':
1630
+ case 'day':
1631
+ case 'd':
1632
+ return n * d;
1633
+ case 'hours':
1634
+ case 'hour':
1635
+ case 'hrs':
1636
+ case 'hr':
1637
+ case 'h':
1638
+ return n * h;
1639
+ case 'minutes':
1640
+ case 'minute':
1641
+ case 'mins':
1642
+ case 'min':
1643
+ case 'm':
1644
+ return n * m;
1645
+ case 'seconds':
1646
+ case 'second':
1647
+ case 'secs':
1648
+ case 'sec':
1649
+ case 's':
1650
+ return n * s;
1651
+ case 'milliseconds':
1652
+ case 'millisecond':
1653
+ case 'msecs':
1654
+ case 'msec':
1655
+ case 'ms':
1656
+ return n;
1657
+ default:
1658
+ return undefined;
1659
+ }
1660
+ }
1661
+
1662
+ /**
1663
+ * Short format for `ms`.
1664
+ *
1665
+ * @param {Number} ms
1666
+ * @return {String}
1667
+ * @api private
1668
+ */
1669
+
1670
+ function fmtShort(ms) {
1671
+ if (ms >= d) {
1672
+ return Math.round(ms / d) + 'd';
1673
+ }
1674
+ if (ms >= h) {
1675
+ return Math.round(ms / h) + 'h';
1676
+ }
1677
+ if (ms >= m) {
1678
+ return Math.round(ms / m) + 'm';
1679
+ }
1680
+ if (ms >= s) {
1681
+ return Math.round(ms / s) + 's';
1682
+ }
1683
+ return ms + 'ms';
1684
+ }
1685
+
1686
+ /**
1687
+ * Long format for `ms`.
1688
+ *
1689
+ * @param {Number} ms
1690
+ * @return {String}
1691
+ * @api private
1692
+ */
1693
+
1694
+ function fmtLong(ms) {
1695
+ return plural(ms, d, 'day') ||
1696
+ plural(ms, h, 'hour') ||
1697
+ plural(ms, m, 'minute') ||
1698
+ plural(ms, s, 'second') ||
1699
+ ms + ' ms';
1700
+ }
1701
+
1702
+ /**
1703
+ * Pluralization helper.
1704
+ */
1705
+
1706
+ function plural(ms, n, name) {
1707
+ if (ms < n) {
1708
+ return;
1709
+ }
1710
+ if (ms < n * 1.5) {
1711
+ return Math.floor(ms / n) + ' ' + name;
1712
+ }
1713
+ return Math.ceil(ms / n) + ' ' + name + 's';
1714
+ }
1715
+
1716
+
1717
+ /***/ }),
1718
+
1719
+ /***/ 551:
1720
+ /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
1721
+
1722
+ "use strict";
1723
+ /*!
1724
+ * on-finished
1725
+ * Copyright(c) 2013 Jonathan Ong
1726
+ * Copyright(c) 2014 Douglas Christopher Wilson
1727
+ * MIT Licensed
1728
+ */
1729
+
1730
+
1731
+
1732
+ /**
1733
+ * Module exports.
1734
+ * @public
1735
+ */
1736
+
1737
+ module.exports = onFinished
1738
+ module.exports.isFinished = isFinished
1739
+
1740
+ /**
1741
+ * Module dependencies.
1742
+ * @private
1743
+ */
1744
+
1745
+ var first = __nccwpck_require__(997)
1746
+
1747
+ /**
1748
+ * Variables.
1749
+ * @private
1750
+ */
1751
+
1752
+ /* istanbul ignore next */
1753
+ var defer = typeof setImmediate === 'function'
1754
+ ? setImmediate
1755
+ : function(fn){ process.nextTick(fn.bind.apply(fn, arguments)) }
1756
+
1757
+ /**
1758
+ * Invoke callback when the response has finished, useful for
1759
+ * cleaning up resources afterwards.
1760
+ *
1761
+ * @param {object} msg
1762
+ * @param {function} listener
1763
+ * @return {object}
1764
+ * @public
1765
+ */
1766
+
1767
+ function onFinished(msg, listener) {
1768
+ if (isFinished(msg) !== false) {
1769
+ defer(listener, null, msg)
1770
+ return msg
1771
+ }
1772
+
1773
+ // attach the listener to the message
1774
+ attachListener(msg, listener)
1775
+
1776
+ return msg
1777
+ }
1778
+
1779
+ /**
1780
+ * Determine if message is already finished.
1781
+ *
1782
+ * @param {object} msg
1783
+ * @return {boolean}
1784
+ * @public
1785
+ */
1786
+
1787
+ function isFinished(msg) {
1788
+ var socket = msg.socket
1789
+
1790
+ if (typeof msg.finished === 'boolean') {
1791
+ // OutgoingMessage
1792
+ return Boolean(msg.finished || (socket && !socket.writable))
1793
+ }
1794
+
1795
+ if (typeof msg.complete === 'boolean') {
1796
+ // IncomingMessage
1797
+ return Boolean(msg.upgrade || !socket || !socket.readable || (msg.complete && !msg.readable))
1798
+ }
1799
+
1800
+ // don't know
1801
+ return undefined
1802
+ }
1803
+
1804
+ /**
1805
+ * Attach a finished listener to the message.
1806
+ *
1807
+ * @param {object} msg
1808
+ * @param {function} callback
1809
+ * @private
1810
+ */
1811
+
1812
+ function attachFinishedListener(msg, callback) {
1813
+ var eeMsg
1814
+ var eeSocket
1815
+ var finished = false
1816
+
1817
+ function onFinish(error) {
1818
+ eeMsg.cancel()
1819
+ eeSocket.cancel()
1820
+
1821
+ finished = true
1822
+ callback(error)
1823
+ }
1824
+
1825
+ // finished on first message event
1826
+ eeMsg = eeSocket = first([[msg, 'end', 'finish']], onFinish)
1827
+
1828
+ function onSocket(socket) {
1829
+ // remove listener
1830
+ msg.removeListener('socket', onSocket)
1831
+
1832
+ if (finished) return
1833
+ if (eeMsg !== eeSocket) return
1834
+
1835
+ // finished on first socket event
1836
+ eeSocket = first([[socket, 'error', 'close']], onFinish)
1837
+ }
1838
+
1839
+ if (msg.socket) {
1840
+ // socket already assigned
1841
+ onSocket(msg.socket)
1842
+ return
1843
+ }
1844
+
1845
+ // wait for socket to be assigned
1846
+ msg.on('socket', onSocket)
1847
+
1848
+ if (msg.socket === undefined) {
1849
+ // node.js 0.8 patch
1850
+ patchAssignSocket(msg, onSocket)
1851
+ }
1852
+ }
1853
+
1854
+ /**
1855
+ * Attach the listener to the message.
1856
+ *
1857
+ * @param {object} msg
1858
+ * @return {function}
1859
+ * @private
1860
+ */
1861
+
1862
+ function attachListener(msg, listener) {
1863
+ var attached = msg.__onFinished
1864
+
1865
+ // create a private single listener with queue
1866
+ if (!attached || !attached.queue) {
1867
+ attached = msg.__onFinished = createListener(msg)
1868
+ attachFinishedListener(msg, attached)
1869
+ }
1870
+
1871
+ attached.queue.push(listener)
1872
+ }
1873
+
1874
+ /**
1875
+ * Create listener on message.
1876
+ *
1877
+ * @param {object} msg
1878
+ * @return {function}
1879
+ * @private
1880
+ */
1881
+
1882
+ function createListener(msg) {
1883
+ function listener(err) {
1884
+ if (msg.__onFinished === listener) msg.__onFinished = null
1885
+ if (!listener.queue) return
1886
+
1887
+ var queue = listener.queue
1888
+ listener.queue = null
1889
+
1890
+ for (var i = 0; i < queue.length; i++) {
1891
+ queue[i](err, msg)
1892
+ }
1893
+ }
1894
+
1895
+ listener.queue = []
1896
+
1897
+ return listener
1898
+ }
1899
+
1900
+ /**
1901
+ * Patch ServerResponse.prototype.assignSocket for node.js 0.8.
1902
+ *
1903
+ * @param {ServerResponse} res
1904
+ * @param {function} callback
1905
+ * @private
1906
+ */
1907
+
1908
+ function patchAssignSocket(res, callback) {
1909
+ var assignSocket = res.assignSocket
1910
+
1911
+ if (typeof assignSocket !== 'function') return
1912
+
1913
+ // res.on('socket', callback) is broken in 0.8
1914
+ res.assignSocket = function _assignSocket(socket) {
1915
+ assignSocket.call(this, socket)
1916
+ callback(socket)
1917
+ }
1918
+ }
1919
+
1920
+
1921
+ /***/ }),
1922
+
1923
+ /***/ 405:
1924
+ /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
1925
+
1926
+ "use strict";
1927
+ /*!
1928
+ * parseurl
1929
+ * Copyright(c) 2014 Jonathan Ong
1930
+ * Copyright(c) 2014-2017 Douglas Christopher Wilson
1931
+ * MIT Licensed
1932
+ */
1933
+
1934
+
1935
+
1936
+ /**
1937
+ * Module dependencies.
1938
+ * @private
1939
+ */
1940
+
1941
+ var url = __nccwpck_require__(16)
1942
+ var parse = url.parse
1943
+ var Url = url.Url
1944
+
1945
+ /**
1946
+ * Module exports.
1947
+ * @public
1948
+ */
1949
+
1950
+ module.exports = parseurl
1951
+ module.exports.original = originalurl
1952
+
1953
+ /**
1954
+ * Parse the `req` url with memoization.
1955
+ *
1956
+ * @param {ServerRequest} req
1957
+ * @return {Object}
1958
+ * @public
1959
+ */
1960
+
1961
+ function parseurl (req) {
1962
+ var url = req.url
1963
+
1964
+ if (url === undefined) {
1965
+ // URL is undefined
1966
+ return undefined
1967
+ }
1968
+
1969
+ var parsed = req._parsedUrl
1970
+
1971
+ if (fresh(url, parsed)) {
1972
+ // Return cached URL parse
1973
+ return parsed
1974
+ }
1975
+
1976
+ // Parse the URL
1977
+ parsed = fastparse(url)
1978
+ parsed._raw = url
1979
+
1980
+ return (req._parsedUrl = parsed)
1981
+ };
1982
+
1983
+ /**
1984
+ * Parse the `req` original url with fallback and memoization.
1985
+ *
1986
+ * @param {ServerRequest} req
1987
+ * @return {Object}
1988
+ * @public
1989
+ */
1990
+
1991
+ function originalurl (req) {
1992
+ var url = req.originalUrl
1993
+
1994
+ if (typeof url !== 'string') {
1995
+ // Fallback
1996
+ return parseurl(req)
1997
+ }
1998
+
1999
+ var parsed = req._parsedOriginalUrl
2000
+
2001
+ if (fresh(url, parsed)) {
2002
+ // Return cached URL parse
2003
+ return parsed
2004
+ }
2005
+
2006
+ // Parse the URL
2007
+ parsed = fastparse(url)
2008
+ parsed._raw = url
2009
+
2010
+ return (req._parsedOriginalUrl = parsed)
2011
+ };
2012
+
2013
+ /**
2014
+ * Parse the `str` url with fast-path short-cut.
2015
+ *
2016
+ * @param {string} str
2017
+ * @return {Object}
2018
+ * @private
2019
+ */
2020
+
2021
+ function fastparse (str) {
2022
+ if (typeof str !== 'string' || str.charCodeAt(0) !== 0x2f /* / */) {
2023
+ return parse(str)
2024
+ }
2025
+
2026
+ var pathname = str
2027
+ var query = null
2028
+ var search = null
2029
+
2030
+ // This takes the regexp from https://github.com/joyent/node/pull/7878
2031
+ // Which is /^(\/[^?#\s]*)(\?[^#\s]*)?$/
2032
+ // And unrolls it into a for loop
2033
+ for (var i = 1; i < str.length; i++) {
2034
+ switch (str.charCodeAt(i)) {
2035
+ case 0x3f: /* ? */
2036
+ if (search === null) {
2037
+ pathname = str.substring(0, i)
2038
+ query = str.substring(i + 1)
2039
+ search = str.substring(i)
2040
+ }
2041
+ break
2042
+ case 0x09: /* \t */
2043
+ case 0x0a: /* \n */
2044
+ case 0x0c: /* \f */
2045
+ case 0x0d: /* \r */
2046
+ case 0x20: /* */
2047
+ case 0x23: /* # */
2048
+ case 0xa0:
2049
+ case 0xfeff:
2050
+ return parse(str)
2051
+ }
2052
+ }
2053
+
2054
+ var url = Url !== undefined
2055
+ ? new Url()
2056
+ : {}
2057
+
2058
+ url.path = str
2059
+ url.href = str
2060
+ url.pathname = pathname
2061
+
2062
+ if (search !== null) {
2063
+ url.query = query
2064
+ url.search = search
2065
+ }
2066
+
2067
+ return url
2068
+ }
2069
+
2070
+ /**
2071
+ * Determine if parsed is still fresh for url.
2072
+ *
2073
+ * @param {string} url
2074
+ * @param {object} parsedUrl
2075
+ * @return {boolean}
2076
+ * @private
2077
+ */
2078
+
2079
+ function fresh (url, parsedUrl) {
2080
+ return typeof parsedUrl === 'object' &&
2081
+ parsedUrl !== null &&
2082
+ (Url === undefined || parsedUrl instanceof Url) &&
2083
+ parsedUrl._raw === url
2084
+ }
2085
+
2086
+
2087
+ /***/ }),
2088
+
2089
+ /***/ 874:
2090
+ /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
2091
+
2092
+ "use strict";
2093
+ /*!
2094
+ * statuses
2095
+ * Copyright(c) 2014 Jonathan Ong
2096
+ * Copyright(c) 2016 Douglas Christopher Wilson
2097
+ * MIT Licensed
2098
+ */
2099
+
2100
+
2101
+
2102
+ /**
2103
+ * Module dependencies.
2104
+ * @private
2105
+ */
2106
+
2107
+ var codes = __nccwpck_require__(595)
2108
+
2109
+ /**
2110
+ * Module exports.
2111
+ * @public
2112
+ */
2113
+
2114
+ module.exports = status
2115
+
2116
+ // status code to message map
2117
+ status.STATUS_CODES = codes
2118
+
2119
+ // array of status codes
2120
+ status.codes = populateStatusesMap(status, codes)
2121
+
2122
+ // status codes for redirects
2123
+ status.redirect = {
2124
+ 300: true,
2125
+ 301: true,
2126
+ 302: true,
2127
+ 303: true,
2128
+ 305: true,
2129
+ 307: true,
2130
+ 308: true
2131
+ }
2132
+
2133
+ // status codes for empty bodies
2134
+ status.empty = {
2135
+ 204: true,
2136
+ 205: true,
2137
+ 304: true
2138
+ }
2139
+
2140
+ // status codes for when you should retry the request
2141
+ status.retry = {
2142
+ 502: true,
2143
+ 503: true,
2144
+ 504: true
2145
+ }
2146
+
2147
+ /**
2148
+ * Populate the statuses map for given codes.
2149
+ * @private
2150
+ */
2151
+
2152
+ function populateStatusesMap (statuses, codes) {
2153
+ var arr = []
2154
+
2155
+ Object.keys(codes).forEach(function forEachCode (code) {
2156
+ var message = codes[code]
2157
+ var status = Number(code)
2158
+
2159
+ // Populate properties
2160
+ statuses[status] = message
2161
+ statuses[message] = status
2162
+ statuses[message.toLowerCase()] = status
2163
+
2164
+ // Add to array
2165
+ arr.push(status)
2166
+ })
2167
+
2168
+ return arr
2169
+ }
2170
+
2171
+ /**
2172
+ * Get the status code.
2173
+ *
2174
+ * Given a number, this will throw if it is not a known status
2175
+ * code, otherwise the code will be returned. Given a string,
2176
+ * the string will be parsed for a number and return the code
2177
+ * if valid, otherwise will lookup the code assuming this is
2178
+ * the status message.
2179
+ *
2180
+ * @param {string|number} code
2181
+ * @returns {number}
2182
+ * @public
2183
+ */
2184
+
2185
+ function status (code) {
2186
+ if (typeof code === 'number') {
2187
+ if (!status[code]) throw new Error('invalid status code: ' + code)
2188
+ return code
2189
+ }
2190
+
2191
+ if (typeof code !== 'string') {
2192
+ throw new TypeError('code must be a number or string')
2193
+ }
2194
+
2195
+ // '403'
2196
+ var n = parseInt(code, 10)
2197
+ if (!isNaN(n)) {
2198
+ if (!status[n]) throw new Error('invalid status code: ' + n)
2199
+ return n
2200
+ }
2201
+
2202
+ n = status[code.toLowerCase()]
2203
+ if (!n) throw new Error('invalid status message: "' + code + '"')
2204
+ return n
2205
+ }
2206
+
2207
+
2208
+ /***/ }),
2209
+
2210
+ /***/ 853:
2211
+ /***/ ((module) => {
2212
+
2213
+ "use strict";
2214
+ /*!
2215
+ * unpipe
2216
+ * Copyright(c) 2015 Douglas Christopher Wilson
2217
+ * MIT Licensed
2218
+ */
2219
+
2220
+
2221
+
2222
+ /**
2223
+ * Module exports.
2224
+ * @public
2225
+ */
2226
+
2227
+ module.exports = unpipe
2228
+
2229
+ /**
2230
+ * Determine if there are Node.js pipe-like data listeners.
2231
+ * @private
2232
+ */
2233
+
2234
+ function hasPipeDataListeners(stream) {
2235
+ var listeners = stream.listeners('data')
2236
+
2237
+ for (var i = 0; i < listeners.length; i++) {
2238
+ if (listeners[i].name === 'ondata') {
2239
+ return true
2240
+ }
2241
+ }
2242
+
2243
+ return false
2244
+ }
2245
+
2246
+ /**
2247
+ * Unpipe a stream from all destinations.
2248
+ *
2249
+ * @param {object} stream
2250
+ * @public
2251
+ */
2252
+
2253
+ function unpipe(stream) {
2254
+ if (!stream) {
2255
+ throw new TypeError('argument stream is required')
2256
+ }
2257
+
2258
+ if (typeof stream.unpipe === 'function') {
2259
+ // new-style
2260
+ stream.unpipe()
2261
+ return
2262
+ }
2263
+
2264
+ // Node.js 0.8 hack
2265
+ if (!hasPipeDataListeners(stream)) {
2266
+ return
2267
+ }
2268
+
2269
+ var listener
2270
+ var listeners = stream.listeners('close')
2271
+
2272
+ for (var i = 0; i < listeners.length; i++) {
2273
+ listener = listeners[i]
2274
+
2275
+ if (listener.name !== 'cleanup' && listener.name !== 'onclose') {
2276
+ continue
2277
+ }
2278
+
2279
+ // invoke the listener
2280
+ listener.call(stream)
2281
+ }
2282
+ }
2283
+
2284
+
2285
+ /***/ }),
2286
+
2287
+ /***/ 670:
2288
+ /***/ ((module, exports) => {
2289
+
2290
+ /**
2291
+ * Merge object b with object a.
2292
+ *
2293
+ * var a = { foo: 'bar' }
2294
+ * , b = { bar: 'baz' };
2295
+ *
2296
+ * merge(a, b);
2297
+ * // => { foo: 'bar', bar: 'baz' }
2298
+ *
2299
+ * @param {Object} a
2300
+ * @param {Object} b
2301
+ * @return {Object}
2302
+ * @api public
2303
+ */
2304
+
2305
+ exports = module.exports = function(a, b){
2306
+ if (a && b) {
2307
+ for (var key in b) {
2308
+ a[key] = b[key];
2309
+ }
2310
+ }
2311
+ return a;
2312
+ };
2313
+
2314
+
2315
+ /***/ }),
2316
+
2317
+ /***/ 434:
2318
+ /***/ ((module) => {
2319
+
2320
+ "use strict";
2321
+ module.exports = require("events");
2322
+
2323
+ /***/ }),
2324
+
2325
+ /***/ 896:
2326
+ /***/ ((module) => {
2327
+
2328
+ "use strict";
2329
+ module.exports = require("fs");
2330
+
2331
+ /***/ }),
2332
+
2333
+ /***/ 611:
2334
+ /***/ ((module) => {
2335
+
2336
+ "use strict";
2337
+ module.exports = require("http");
2338
+
2339
+ /***/ }),
2340
+
2341
+ /***/ 278:
2342
+ /***/ ((module) => {
2343
+
2344
+ "use strict";
2345
+ module.exports = require("net");
2346
+
2347
+ /***/ }),
2348
+
2349
+ /***/ 18:
2350
+ /***/ ((module) => {
2351
+
2352
+ "use strict";
2353
+ module.exports = require("tty");
2354
+
2355
+ /***/ }),
2356
+
2357
+ /***/ 16:
2358
+ /***/ ((module) => {
2359
+
2360
+ "use strict";
2361
+ module.exports = require("url");
2362
+
2363
+ /***/ }),
2364
+
2365
+ /***/ 23:
2366
+ /***/ ((module) => {
2367
+
2368
+ "use strict";
2369
+ module.exports = require("util");
2370
+
2371
+ /***/ }),
2372
+
2373
+ /***/ 595:
2374
+ /***/ ((module) => {
2375
+
2376
+ "use strict";
2377
+ module.exports = /*#__PURE__*/JSON.parse('{"100":"Continue","101":"Switching Protocols","102":"Processing","103":"Early Hints","200":"OK","201":"Created","202":"Accepted","203":"Non-Authoritative Information","204":"No Content","205":"Reset Content","206":"Partial Content","207":"Multi-Status","208":"Already Reported","226":"IM Used","300":"Multiple Choices","301":"Moved Permanently","302":"Found","303":"See Other","304":"Not Modified","305":"Use Proxy","306":"(Unused)","307":"Temporary Redirect","308":"Permanent Redirect","400":"Bad Request","401":"Unauthorized","402":"Payment Required","403":"Forbidden","404":"Not Found","405":"Method Not Allowed","406":"Not Acceptable","407":"Proxy Authentication Required","408":"Request Timeout","409":"Conflict","410":"Gone","411":"Length Required","412":"Precondition Failed","413":"Payload Too Large","414":"URI Too Long","415":"Unsupported Media Type","416":"Range Not Satisfiable","417":"Expectation Failed","418":"I\'m a teapot","421":"Misdirected Request","422":"Unprocessable Entity","423":"Locked","424":"Failed Dependency","425":"Unordered Collection","426":"Upgrade Required","428":"Precondition Required","429":"Too Many Requests","431":"Request Header Fields Too Large","451":"Unavailable For Legal Reasons","500":"Internal Server Error","501":"Not Implemented","502":"Bad Gateway","503":"Service Unavailable","504":"Gateway Timeout","505":"HTTP Version Not Supported","506":"Variant Also Negotiates","507":"Insufficient Storage","508":"Loop Detected","509":"Bandwidth Limit Exceeded","510":"Not Extended","511":"Network Authentication Required"}');
2378
+
2379
+ /***/ })
2380
+
2381
+ /******/ });
2382
+ /************************************************************************/
2383
+ /******/ // The module cache
2384
+ /******/ var __webpack_module_cache__ = {};
2385
+ /******/
2386
+ /******/ // The require function
2387
+ /******/ function __nccwpck_require__(moduleId) {
2388
+ /******/ // Check if module is in cache
2389
+ /******/ var cachedModule = __webpack_module_cache__[moduleId];
2390
+ /******/ if (cachedModule !== undefined) {
2391
+ /******/ return cachedModule.exports;
2392
+ /******/ }
2393
+ /******/ // Create a new module (and put it into the cache)
2394
+ /******/ var module = __webpack_module_cache__[moduleId] = {
2395
+ /******/ // no module.id needed
2396
+ /******/ // no module.loaded needed
2397
+ /******/ exports: {}
2398
+ /******/ };
2399
+ /******/
2400
+ /******/ // Execute the module function
2401
+ /******/ var threw = true;
2402
+ /******/ try {
2403
+ /******/ __webpack_modules__[moduleId](module, module.exports, __nccwpck_require__);
2404
+ /******/ threw = false;
2405
+ /******/ } finally {
2406
+ /******/ if(threw) delete __webpack_module_cache__[moduleId];
2407
+ /******/ }
2408
+ /******/
2409
+ /******/ // Return the exports of the module
2410
+ /******/ return module.exports;
2411
+ /******/ }
2412
+ /******/
2413
+ /************************************************************************/
2414
+ /******/ /* webpack/runtime/compat */
2415
+ /******/
2416
+ /******/ if (typeof __nccwpck_require__ !== 'undefined') __nccwpck_require__.ab = __dirname + "/";
2417
+ /******/
2418
+ /************************************************************************/
2419
+ /******/
2420
+ /******/ // startup
2421
+ /******/ // Load entry module and return exports
2422
+ /******/ // This entry module is referenced by other modules so it can't be inlined
2423
+ /******/ var __webpack_exports__ = __nccwpck_require__(718);
2424
+ /******/ module.exports = __webpack_exports__;
2425
+ /******/
2426
+ /******/ })()
2427
+ ;