nitro-nightly 4.0.0-20251010-091516-7cafddba → 4.0.0-20251030-091344-d4418b98

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 (195) hide show
  1. package/dist/{_chunks/build2.mjs → _build/build.mjs} +108 -58
  2. package/dist/_build/build2.mjs +556 -0
  3. package/dist/_build/info.mjs +1002 -0
  4. package/dist/_build/prepare.mjs +1511 -0
  5. package/dist/_build/snapshot.mjs +185 -0
  6. package/dist/{_chunks/plugin.mjs → _build/vite.mjs} +295 -296
  7. package/dist/_build/vite2.mjs +149 -0
  8. package/dist/_chunks/_deps/@jridgewell/gen-mapping.mjs +189 -0
  9. package/dist/_chunks/_deps/@jridgewell/remapping.mjs +137 -0
  10. package/dist/_chunks/_deps/@jridgewell/resolve-uri.mjs +231 -0
  11. package/dist/_chunks/_deps/@jridgewell/sourcemap-codec.mjs +173 -0
  12. package/dist/_chunks/_deps/@jridgewell/trace-mapping.mjs +170 -0
  13. package/dist/_chunks/_deps/@pi0/vite-plugin-fullstack.mjs +575 -0
  14. package/dist/_chunks/_deps/@rollup/plugin-alias.mjs +89 -0
  15. package/dist/_chunks/_deps/@rollup/plugin-commonjs.mjs +2376 -0
  16. package/dist/_chunks/{index2.mjs → _deps/@rollup/plugin-inject.mjs} +5 -90
  17. package/dist/_chunks/_deps/@rollup/plugin-json.mjs +37 -0
  18. package/dist/_chunks/_deps/@rollup/plugin-node-resolve.mjs +1386 -0
  19. package/dist/_chunks/_deps/@rollup/plugin-replace.mjs +133 -0
  20. package/dist/_chunks/_deps/@rollup/pluginutils.mjs +346 -0
  21. package/dist/_chunks/_deps/acorn.mjs +6225 -0
  22. package/dist/_chunks/_deps/c12.mjs +510 -0
  23. package/dist/_chunks/_deps/chokidar.mjs +1428 -0
  24. package/dist/_chunks/_deps/citty.mjs +460 -0
  25. package/dist/_chunks/_deps/commondir.mjs +77 -0
  26. package/dist/_chunks/_deps/compatx.mjs +76 -0
  27. package/dist/_chunks/_deps/confbox.mjs +300 -0
  28. package/dist/_chunks/_deps/debug.mjs +885 -0
  29. package/dist/_chunks/_deps/deepmerge.mjs +147 -0
  30. package/dist/_chunks/_deps/depd.mjs +550 -0
  31. package/dist/_chunks/_deps/dot-prop.mjs +282 -0
  32. package/dist/_chunks/_deps/dotenv.mjs +555 -0
  33. package/dist/_chunks/_deps/duplexer.mjs +1 -0
  34. package/dist/_chunks/_deps/ee-first.mjs +104 -0
  35. package/dist/_chunks/_deps/encodeurl.mjs +69 -0
  36. package/dist/_chunks/_deps/escape-html.mjs +87 -0
  37. package/dist/_chunks/_deps/escape-string-regexp.mjs +13 -0
  38. package/dist/_chunks/_deps/estree-walker.mjs +433 -0
  39. package/dist/_chunks/_deps/etag.mjs +147 -0
  40. package/dist/_chunks/_deps/exsolve.mjs +1416 -0
  41. package/dist/_chunks/_deps/fdir.mjs +569 -0
  42. package/dist/_chunks/_deps/fresh.mjs +145 -0
  43. package/dist/_chunks/_deps/function-bind.mjs +106 -0
  44. package/dist/_chunks/{index4.mjs → _deps/giget.mjs} +21 -776
  45. package/dist/_chunks/_deps/gzip-size.mjs +19 -0
  46. package/dist/_chunks/_deps/hasown.mjs +19 -0
  47. package/dist/_chunks/_deps/http-errors.mjs +307 -0
  48. package/dist/_chunks/_deps/httpxy.mjs +580 -0
  49. package/dist/_chunks/_deps/inherits.mjs +57 -0
  50. package/dist/_chunks/_deps/is-core-module.mjs +596 -0
  51. package/dist/_chunks/_deps/is-module.mjs +25 -0
  52. package/dist/_chunks/_deps/is-reference.mjs +31 -0
  53. package/dist/_chunks/_deps/js-tokens.mjs +411 -0
  54. package/dist/_chunks/_deps/klona.mjs +137 -0
  55. package/dist/_chunks/_deps/knitwork.mjs +172 -0
  56. package/dist/_chunks/_deps/local-pkg.mjs +163 -0
  57. package/dist/_chunks/_deps/magic-string.mjs +1296 -0
  58. package/dist/_chunks/_deps/mime-db.mjs +11685 -0
  59. package/dist/_chunks/_deps/mime-types.mjs +287 -0
  60. package/dist/_chunks/_deps/mime.mjs +1172 -0
  61. package/dist/_chunks/_deps/mlly.mjs +2413 -0
  62. package/dist/_chunks/_deps/ms.mjs +172 -0
  63. package/dist/_chunks/_deps/node-fetch-native.mjs +3 -0
  64. package/dist/_chunks/_deps/nypm.mjs +219 -0
  65. package/dist/_chunks/_deps/on-finished.mjs +246 -0
  66. package/dist/_chunks/_deps/parseurl.mjs +168 -0
  67. package/dist/_chunks/_deps/path-parse.mjs +85 -0
  68. package/dist/_chunks/{pathe.M-eThtNZ.mjs → _deps/pathe.mjs} +48 -1
  69. package/dist/_chunks/_deps/perfect-debounce.mjs +88 -0
  70. package/dist/_chunks/_deps/picomatch.mjs +2144 -0
  71. package/dist/_chunks/_deps/pkg-types.mjs +247 -0
  72. package/dist/_chunks/{snapshot.mjs → _deps/pretty-bytes.mjs} +1 -105
  73. package/dist/_chunks/_deps/quansync.mjs +99 -0
  74. package/dist/_chunks/_deps/range-parser.mjs +171 -0
  75. package/dist/_chunks/_deps/rc9.mjs +219 -0
  76. package/dist/_chunks/_deps/readdirp.mjs +245 -0
  77. package/dist/_chunks/_deps/resolve.mjs +1260 -0
  78. package/dist/_chunks/_deps/rou3.mjs +326 -0
  79. package/dist/_chunks/_deps/send.mjs +1022 -0
  80. package/dist/_chunks/_deps/serve-static.mjs +228 -0
  81. package/dist/_chunks/_deps/setprototypeof.mjs +26 -0
  82. package/dist/_chunks/_deps/statuses.mjs +457 -0
  83. package/dist/_chunks/_deps/std-env.mjs +3 -0
  84. package/dist/_chunks/_deps/strip-literal.mjs +67 -0
  85. package/dist/_chunks/_deps/supports-color.mjs +44 -0
  86. package/dist/_chunks/_deps/tinyexec.mjs +552 -0
  87. package/dist/_chunks/_deps/tinyglobby.mjs +293 -0
  88. package/dist/_chunks/_deps/toidentifier.mjs +41 -0
  89. package/dist/_chunks/_deps/ultrahtml.mjs +3 -0
  90. package/dist/_chunks/_deps/unimport.mjs +2267 -0
  91. package/dist/_chunks/_deps/unplugin-utils.mjs +65 -0
  92. package/dist/_chunks/_deps/unplugin.mjs +1294 -0
  93. package/dist/_chunks/_deps/untyped.mjs +375 -0
  94. package/dist/_chunks/{info.mjs → _deps/unwasm.mjs} +8 -4206
  95. package/dist/_chunks/_deps/webpack-virtual-modules.mjs +360 -0
  96. package/dist/_chunks/_presets/_all.mjs +59 -0
  97. package/dist/_chunks/_presets/_nitro.mjs +74 -0
  98. package/dist/_chunks/_presets/_resolve.mjs +64 -0
  99. package/dist/_chunks/_presets/_static.mjs +69 -0
  100. package/dist/_chunks/_presets/_types.mjs +3 -0
  101. package/dist/_chunks/_presets/_utils.mjs +31 -0
  102. package/dist/_chunks/_presets/alwaysdata.mjs +17 -0
  103. package/dist/_chunks/_presets/aws-amplify.mjs +111 -0
  104. package/dist/_chunks/_presets/aws-lambda.mjs +23 -0
  105. package/dist/_chunks/_presets/azure.mjs +162 -0
  106. package/dist/_chunks/_presets/bun.mjs +19 -0
  107. package/dist/_chunks/_presets/cleavr.mjs +15 -0
  108. package/dist/_chunks/_presets/cloudflare.mjs +608 -0
  109. package/dist/_chunks/_presets/deno.mjs +196 -0
  110. package/dist/_chunks/_presets/digitalocean.mjs +14 -0
  111. package/dist/_chunks/_presets/firebase.mjs +47 -0
  112. package/dist/_chunks/_presets/flightcontrol.mjs +14 -0
  113. package/dist/_chunks/_presets/genezio.mjs +13 -0
  114. package/dist/_chunks/_presets/heroku.mjs +14 -0
  115. package/dist/_chunks/_presets/iis.mjs +194 -0
  116. package/dist/_chunks/_presets/index.mjs +62 -0
  117. package/dist/_chunks/_presets/koyeb.mjs +14 -0
  118. package/dist/_chunks/_presets/netlify.mjs +241 -0
  119. package/dist/_chunks/_presets/node.mjs +54 -0
  120. package/dist/_chunks/_presets/platform.mjs +14 -0
  121. package/dist/_chunks/_presets/render.mjs +14 -0
  122. package/dist/_chunks/_presets/standard.mjs +23 -0
  123. package/dist/_chunks/_presets/stormkit.mjs +18 -0
  124. package/dist/_chunks/_presets/vercel.mjs +375 -0
  125. package/dist/_chunks/_presets/winterjs.mjs +22 -0
  126. package/dist/_chunks/_presets/zeabur.mjs +69 -0
  127. package/dist/_chunks/_presets/zerops.mjs +27 -0
  128. package/dist/_chunks/app.mjs +9 -19206
  129. package/dist/_chunks/{index3.mjs → builder.mjs} +560 -970
  130. package/dist/_chunks/server.mjs +6 -4
  131. package/dist/{cli → _cli}/build.mjs +3 -8
  132. package/dist/{cli → _cli}/dev.mjs +38 -12
  133. package/dist/{cli/index2.mjs → _cli/index.mjs} +1 -2
  134. package/dist/{cli → _cli}/list.mjs +3 -4
  135. package/dist/{cli → _cli}/prepare.mjs +3 -4
  136. package/dist/{cli → _cli}/run.mjs +3 -4
  137. package/dist/{index.d.mts → builder.d.mts} +11 -11
  138. package/dist/builder.mjs +117 -0
  139. package/dist/cli/index.mjs +7 -464
  140. package/dist/node_modules/@speed-highlight/core/dist/index.js +1 -1
  141. package/dist/node_modules/@speed-highlight/core/dist/terminal.js +1 -1
  142. package/dist/node_modules/@speed-highlight/core/package.json +7 -3
  143. package/dist/node_modules/cookie-es/dist/index.mjs +262 -0
  144. package/dist/node_modules/cookie-es/package.json +37 -0
  145. package/dist/node_modules/hookable/dist/index.mjs +243 -266
  146. package/dist/node_modules/hookable/package.json +29 -26
  147. package/dist/node_modules/rendu/dist/index.mjs +380 -0
  148. package/dist/node_modules/rendu/package.json +47 -0
  149. package/dist/presets/_nitro/runtime/nitro-dev.mjs +4 -7
  150. package/dist/presets/_nitro/runtime/nitro-prerenderer.mjs +5 -4
  151. package/dist/presets/azure/runtime/azure-swa.mjs +1 -1
  152. package/dist/presets/cloudflare/runtime/_module-handler.mjs +7 -6
  153. package/dist/presets/cloudflare/runtime/cloudflare-durable.mjs +4 -5
  154. package/dist/presets/cloudflare/runtime/plugin.dev.mjs +7 -10
  155. package/dist/presets/cloudflare/runtime/shims/workers.dev.d.mts +21 -0
  156. package/dist/presets/cloudflare/runtime/shims/workers.dev.mjs +27 -0
  157. package/dist/presets/node/runtime/node-server.mjs +1 -1
  158. package/dist/runtime/index.d.mts +1 -1
  159. package/dist/runtime/index.mjs +1 -1
  160. package/dist/runtime/internal/app.d.mts +3 -1
  161. package/dist/runtime/internal/app.mjs +90 -64
  162. package/dist/runtime/internal/error/prod.d.mts +3 -2
  163. package/dist/runtime/internal/error/prod.mjs +9 -13
  164. package/dist/runtime/internal/renderer.mjs +4 -4
  165. package/dist/runtime/internal/routes/dev-tasks.d.mts +30 -2
  166. package/dist/runtime/internal/shutdown.d.mts +1 -2
  167. package/dist/runtime/internal/shutdown.mjs +3 -2
  168. package/dist/runtime/internal/task.mjs +1 -2
  169. package/dist/types/index.d.mts +1603 -10
  170. package/dist/vite.d.mts +5 -0
  171. package/dist/vite.mjs +94 -30
  172. package/lib/index.mjs +1 -0
  173. package/lib/indexd.mts +1 -0
  174. package/lib/runtime/meta.mjs +35 -0
  175. package/package.json +40 -41
  176. package/dist/_chunks/build.mjs +0 -84
  177. package/dist/_chunks/build3.mjs +0 -6452
  178. package/dist/_chunks/detect-acorn.mjs +0 -503
  179. package/dist/_chunks/index.mjs +0 -22242
  180. package/dist/_chunks/json5.mjs +0 -68
  181. package/dist/_chunks/jsonc.mjs +0 -51
  182. package/dist/_chunks/toml.mjs +0 -259
  183. package/dist/_chunks/yaml.mjs +0 -86
  184. package/dist/index.mjs +0 -55
  185. package/dist/node_modules/klona/dist/index.mjs +0 -81
  186. package/dist/node_modules/klona/full/index.mjs +0 -53
  187. package/dist/node_modules/klona/package.json +0 -74
  188. package/dist/node_modules/std-env/dist/index.mjs +0 -1
  189. package/dist/node_modules/std-env/package.json +0 -46
  190. package/dist/presets.mjs +0 -2460
  191. package/dist/runtime/internal/debug.d.mts +0 -2
  192. package/dist/runtime/internal/debug.mjs +0 -5
  193. package/lib/runtime-meta.mjs +0 -38
  194. /package/dist/{cli → _cli}/common.mjs +0 -0
  195. /package/lib/{runtime-meta.d.mts → runtime/meta.d.mts} +0 -0
@@ -0,0 +1,885 @@
1
+ import require$$0 from 'tty';
2
+ import require$$1 from 'util';
3
+ import { r as requireMs } from './ms.mjs';
4
+ import { r as require$$2 } from './supports-color.mjs';
5
+
6
+ var src = {exports: {}};
7
+
8
+ var browser = {exports: {}};
9
+
10
+ var common;
11
+ var hasRequiredCommon;
12
+
13
+ function requireCommon () {
14
+ if (hasRequiredCommon) return common;
15
+ hasRequiredCommon = 1;
16
+ /**
17
+ * This is the common logic for both the Node.js and web browser
18
+ * implementations of `debug()`.
19
+ */
20
+
21
+ function setup(env) {
22
+ createDebug.debug = createDebug;
23
+ createDebug.default = createDebug;
24
+ createDebug.coerce = coerce;
25
+ createDebug.disable = disable;
26
+ createDebug.enable = enable;
27
+ createDebug.enabled = enabled;
28
+ createDebug.humanize = requireMs();
29
+ createDebug.destroy = destroy;
30
+
31
+ Object.keys(env).forEach(key => {
32
+ createDebug[key] = env[key];
33
+ });
34
+
35
+ /**
36
+ * The currently active debug mode names, and names to skip.
37
+ */
38
+
39
+ createDebug.names = [];
40
+ createDebug.skips = [];
41
+
42
+ /**
43
+ * Map of special "%n" handling functions, for the debug "format" argument.
44
+ *
45
+ * Valid key names are a single, lower or upper-case letter, i.e. "n" and "N".
46
+ */
47
+ createDebug.formatters = {};
48
+
49
+ /**
50
+ * Selects a color for a debug namespace
51
+ * @param {String} namespace The namespace string for the debug instance to be colored
52
+ * @return {Number|String} An ANSI color code for the given namespace
53
+ * @api private
54
+ */
55
+ function selectColor(namespace) {
56
+ let hash = 0;
57
+
58
+ for (let i = 0; i < namespace.length; i++) {
59
+ hash = ((hash << 5) - hash) + namespace.charCodeAt(i);
60
+ hash |= 0; // Convert to 32bit integer
61
+ }
62
+
63
+ return createDebug.colors[Math.abs(hash) % createDebug.colors.length];
64
+ }
65
+ createDebug.selectColor = selectColor;
66
+
67
+ /**
68
+ * Create a debugger with the given `namespace`.
69
+ *
70
+ * @param {String} namespace
71
+ * @return {Function}
72
+ * @api public
73
+ */
74
+ function createDebug(namespace) {
75
+ let prevTime;
76
+ let enableOverride = null;
77
+ let namespacesCache;
78
+ let enabledCache;
79
+
80
+ function debug(...args) {
81
+ // Disabled?
82
+ if (!debug.enabled) {
83
+ return;
84
+ }
85
+
86
+ const self = debug;
87
+
88
+ // Set `diff` timestamp
89
+ const curr = Number(new Date());
90
+ const ms = curr - (prevTime || curr);
91
+ self.diff = ms;
92
+ self.prev = prevTime;
93
+ self.curr = curr;
94
+ prevTime = curr;
95
+
96
+ args[0] = createDebug.coerce(args[0]);
97
+
98
+ if (typeof args[0] !== 'string') {
99
+ // Anything else let's inspect with %O
100
+ args.unshift('%O');
101
+ }
102
+
103
+ // Apply any `formatters` transformations
104
+ let index = 0;
105
+ args[0] = args[0].replace(/%([a-zA-Z%])/g, (match, format) => {
106
+ // If we encounter an escaped % then don't increase the array index
107
+ if (match === '%%') {
108
+ return '%';
109
+ }
110
+ index++;
111
+ const formatter = createDebug.formatters[format];
112
+ if (typeof formatter === 'function') {
113
+ const val = args[index];
114
+ match = formatter.call(self, val);
115
+
116
+ // Now we need to remove `args[index]` since it's inlined in the `format`
117
+ args.splice(index, 1);
118
+ index--;
119
+ }
120
+ return match;
121
+ });
122
+
123
+ // Apply env-specific formatting (colors, etc.)
124
+ createDebug.formatArgs.call(self, args);
125
+
126
+ const logFn = self.log || createDebug.log;
127
+ logFn.apply(self, args);
128
+ }
129
+
130
+ debug.namespace = namespace;
131
+ debug.useColors = createDebug.useColors();
132
+ debug.color = createDebug.selectColor(namespace);
133
+ debug.extend = extend;
134
+ debug.destroy = createDebug.destroy; // XXX Temporary. Will be removed in the next major release.
135
+
136
+ Object.defineProperty(debug, 'enabled', {
137
+ enumerable: true,
138
+ configurable: false,
139
+ get: () => {
140
+ if (enableOverride !== null) {
141
+ return enableOverride;
142
+ }
143
+ if (namespacesCache !== createDebug.namespaces) {
144
+ namespacesCache = createDebug.namespaces;
145
+ enabledCache = createDebug.enabled(namespace);
146
+ }
147
+
148
+ return enabledCache;
149
+ },
150
+ set: v => {
151
+ enableOverride = v;
152
+ }
153
+ });
154
+
155
+ // Env-specific initialization logic for debug instances
156
+ if (typeof createDebug.init === 'function') {
157
+ createDebug.init(debug);
158
+ }
159
+
160
+ return debug;
161
+ }
162
+
163
+ function extend(namespace, delimiter) {
164
+ const newDebug = createDebug(this.namespace + (typeof delimiter === 'undefined' ? ':' : delimiter) + namespace);
165
+ newDebug.log = this.log;
166
+ return newDebug;
167
+ }
168
+
169
+ /**
170
+ * Enables a debug mode by namespaces. This can include modes
171
+ * separated by a colon and wildcards.
172
+ *
173
+ * @param {String} namespaces
174
+ * @api public
175
+ */
176
+ function enable(namespaces) {
177
+ createDebug.save(namespaces);
178
+ createDebug.namespaces = namespaces;
179
+
180
+ createDebug.names = [];
181
+ createDebug.skips = [];
182
+
183
+ const split = (typeof namespaces === 'string' ? namespaces : '')
184
+ .trim()
185
+ .replace(/\s+/g, ',')
186
+ .split(',')
187
+ .filter(Boolean);
188
+
189
+ for (const ns of split) {
190
+ if (ns[0] === '-') {
191
+ createDebug.skips.push(ns.slice(1));
192
+ } else {
193
+ createDebug.names.push(ns);
194
+ }
195
+ }
196
+ }
197
+
198
+ /**
199
+ * Checks if the given string matches a namespace template, honoring
200
+ * asterisks as wildcards.
201
+ *
202
+ * @param {String} search
203
+ * @param {String} template
204
+ * @return {Boolean}
205
+ */
206
+ function matchesTemplate(search, template) {
207
+ let searchIndex = 0;
208
+ let templateIndex = 0;
209
+ let starIndex = -1;
210
+ let matchIndex = 0;
211
+
212
+ while (searchIndex < search.length) {
213
+ if (templateIndex < template.length && (template[templateIndex] === search[searchIndex] || template[templateIndex] === '*')) {
214
+ // Match character or proceed with wildcard
215
+ if (template[templateIndex] === '*') {
216
+ starIndex = templateIndex;
217
+ matchIndex = searchIndex;
218
+ templateIndex++; // Skip the '*'
219
+ } else {
220
+ searchIndex++;
221
+ templateIndex++;
222
+ }
223
+ } else if (starIndex !== -1) { // eslint-disable-line no-negated-condition
224
+ // Backtrack to the last '*' and try to match more characters
225
+ templateIndex = starIndex + 1;
226
+ matchIndex++;
227
+ searchIndex = matchIndex;
228
+ } else {
229
+ return false; // No match
230
+ }
231
+ }
232
+
233
+ // Handle trailing '*' in template
234
+ while (templateIndex < template.length && template[templateIndex] === '*') {
235
+ templateIndex++;
236
+ }
237
+
238
+ return templateIndex === template.length;
239
+ }
240
+
241
+ /**
242
+ * Disable debug output.
243
+ *
244
+ * @return {String} namespaces
245
+ * @api public
246
+ */
247
+ function disable() {
248
+ const namespaces = [
249
+ ...createDebug.names,
250
+ ...createDebug.skips.map(namespace => '-' + namespace)
251
+ ].join(',');
252
+ createDebug.enable('');
253
+ return namespaces;
254
+ }
255
+
256
+ /**
257
+ * Returns true if the given mode name is enabled, false otherwise.
258
+ *
259
+ * @param {String} name
260
+ * @return {Boolean}
261
+ * @api public
262
+ */
263
+ function enabled(name) {
264
+ for (const skip of createDebug.skips) {
265
+ if (matchesTemplate(name, skip)) {
266
+ return false;
267
+ }
268
+ }
269
+
270
+ for (const ns of createDebug.names) {
271
+ if (matchesTemplate(name, ns)) {
272
+ return true;
273
+ }
274
+ }
275
+
276
+ return false;
277
+ }
278
+
279
+ /**
280
+ * Coerce `val`.
281
+ *
282
+ * @param {Mixed} val
283
+ * @return {Mixed}
284
+ * @api private
285
+ */
286
+ function coerce(val) {
287
+ if (val instanceof Error) {
288
+ return val.stack || val.message;
289
+ }
290
+ return val;
291
+ }
292
+
293
+ /**
294
+ * XXX DO NOT USE. This is a temporary stub function.
295
+ * XXX It WILL be removed in the next major release.
296
+ */
297
+ function destroy() {
298
+ console.warn('Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.');
299
+ }
300
+
301
+ createDebug.enable(createDebug.load());
302
+
303
+ return createDebug;
304
+ }
305
+
306
+ common = setup;
307
+ return common;
308
+ }
309
+
310
+ /* eslint-env browser */
311
+
312
+ var hasRequiredBrowser;
313
+
314
+ function requireBrowser () {
315
+ if (hasRequiredBrowser) return browser.exports;
316
+ hasRequiredBrowser = 1;
317
+ (function (module, exports) {
318
+ /**
319
+ * This is the web browser implementation of `debug()`.
320
+ */
321
+
322
+ exports.formatArgs = formatArgs;
323
+ exports.save = save;
324
+ exports.load = load;
325
+ exports.useColors = useColors;
326
+ exports.storage = localstorage();
327
+ exports.destroy = (() => {
328
+ let warned = false;
329
+
330
+ return () => {
331
+ if (!warned) {
332
+ warned = true;
333
+ console.warn('Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.');
334
+ }
335
+ };
336
+ })();
337
+
338
+ /**
339
+ * Colors.
340
+ */
341
+
342
+ exports.colors = [
343
+ '#0000CC',
344
+ '#0000FF',
345
+ '#0033CC',
346
+ '#0033FF',
347
+ '#0066CC',
348
+ '#0066FF',
349
+ '#0099CC',
350
+ '#0099FF',
351
+ '#00CC00',
352
+ '#00CC33',
353
+ '#00CC66',
354
+ '#00CC99',
355
+ '#00CCCC',
356
+ '#00CCFF',
357
+ '#3300CC',
358
+ '#3300FF',
359
+ '#3333CC',
360
+ '#3333FF',
361
+ '#3366CC',
362
+ '#3366FF',
363
+ '#3399CC',
364
+ '#3399FF',
365
+ '#33CC00',
366
+ '#33CC33',
367
+ '#33CC66',
368
+ '#33CC99',
369
+ '#33CCCC',
370
+ '#33CCFF',
371
+ '#6600CC',
372
+ '#6600FF',
373
+ '#6633CC',
374
+ '#6633FF',
375
+ '#66CC00',
376
+ '#66CC33',
377
+ '#9900CC',
378
+ '#9900FF',
379
+ '#9933CC',
380
+ '#9933FF',
381
+ '#99CC00',
382
+ '#99CC33',
383
+ '#CC0000',
384
+ '#CC0033',
385
+ '#CC0066',
386
+ '#CC0099',
387
+ '#CC00CC',
388
+ '#CC00FF',
389
+ '#CC3300',
390
+ '#CC3333',
391
+ '#CC3366',
392
+ '#CC3399',
393
+ '#CC33CC',
394
+ '#CC33FF',
395
+ '#CC6600',
396
+ '#CC6633',
397
+ '#CC9900',
398
+ '#CC9933',
399
+ '#CCCC00',
400
+ '#CCCC33',
401
+ '#FF0000',
402
+ '#FF0033',
403
+ '#FF0066',
404
+ '#FF0099',
405
+ '#FF00CC',
406
+ '#FF00FF',
407
+ '#FF3300',
408
+ '#FF3333',
409
+ '#FF3366',
410
+ '#FF3399',
411
+ '#FF33CC',
412
+ '#FF33FF',
413
+ '#FF6600',
414
+ '#FF6633',
415
+ '#FF9900',
416
+ '#FF9933',
417
+ '#FFCC00',
418
+ '#FFCC33'
419
+ ];
420
+
421
+ /**
422
+ * Currently only WebKit-based Web Inspectors, Firefox >= v31,
423
+ * and the Firebug extension (any Firefox version) are known
424
+ * to support "%c" CSS customizations.
425
+ *
426
+ * TODO: add a `localStorage` variable to explicitly enable/disable colors
427
+ */
428
+
429
+ // eslint-disable-next-line complexity
430
+ function useColors() {
431
+ // NB: In an Electron preload script, document will be defined but not fully
432
+ // initialized. Since we know we're in Chrome, we'll just detect this case
433
+ // explicitly
434
+ if (typeof window !== 'undefined' && window.process && (window.process.type === 'renderer' || window.process.__nwjs)) {
435
+ return true;
436
+ }
437
+
438
+ // Internet Explorer and Edge do not support colors.
439
+ if (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)) {
440
+ return false;
441
+ }
442
+
443
+ let m;
444
+
445
+ // Is webkit? http://stackoverflow.com/a/16459606/376773
446
+ // document is undefined in react-native: https://github.com/facebook/react-native/pull/1632
447
+ // eslint-disable-next-line no-return-assign
448
+ return (typeof document !== 'undefined' && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance) ||
449
+ // Is firebug? http://stackoverflow.com/a/398120/376773
450
+ (typeof window !== 'undefined' && window.console && (window.console.firebug || (window.console.exception && window.console.table))) ||
451
+ // Is firefox >= v31?
452
+ // https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages
453
+ (typeof navigator !== 'undefined' && navigator.userAgent && (m = navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)) && parseInt(m[1], 10) >= 31) ||
454
+ // Double check webkit in userAgent just in case we are in a worker
455
+ (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/));
456
+ }
457
+
458
+ /**
459
+ * Colorize log arguments if enabled.
460
+ *
461
+ * @api public
462
+ */
463
+
464
+ function formatArgs(args) {
465
+ args[0] = (this.useColors ? '%c' : '') +
466
+ this.namespace +
467
+ (this.useColors ? ' %c' : ' ') +
468
+ args[0] +
469
+ (this.useColors ? '%c ' : ' ') +
470
+ '+' + module.exports.humanize(this.diff);
471
+
472
+ if (!this.useColors) {
473
+ return;
474
+ }
475
+
476
+ const c = 'color: ' + this.color;
477
+ args.splice(1, 0, c, 'color: inherit');
478
+
479
+ // The final "%c" is somewhat tricky, because there could be other
480
+ // arguments passed either before or after the %c, so we need to
481
+ // figure out the correct index to insert the CSS into
482
+ let index = 0;
483
+ let lastC = 0;
484
+ args[0].replace(/%[a-zA-Z%]/g, match => {
485
+ if (match === '%%') {
486
+ return;
487
+ }
488
+ index++;
489
+ if (match === '%c') {
490
+ // We only are interested in the *last* %c
491
+ // (the user may have provided their own)
492
+ lastC = index;
493
+ }
494
+ });
495
+
496
+ args.splice(lastC, 0, c);
497
+ }
498
+
499
+ /**
500
+ * Invokes `console.debug()` when available.
501
+ * No-op when `console.debug` is not a "function".
502
+ * If `console.debug` is not available, falls back
503
+ * to `console.log`.
504
+ *
505
+ * @api public
506
+ */
507
+ exports.log = console.debug || console.log || (() => {});
508
+
509
+ /**
510
+ * Save `namespaces`.
511
+ *
512
+ * @param {String} namespaces
513
+ * @api private
514
+ */
515
+ function save(namespaces) {
516
+ try {
517
+ if (namespaces) {
518
+ exports.storage.setItem('debug', namespaces);
519
+ } else {
520
+ exports.storage.removeItem('debug');
521
+ }
522
+ } catch (error) {
523
+ // Swallow
524
+ // XXX (@Qix-) should we be logging these?
525
+ }
526
+ }
527
+
528
+ /**
529
+ * Load `namespaces`.
530
+ *
531
+ * @return {String} returns the previously persisted debug modes
532
+ * @api private
533
+ */
534
+ function load() {
535
+ let r;
536
+ try {
537
+ r = exports.storage.getItem('debug') || exports.storage.getItem('DEBUG') ;
538
+ } catch (error) {
539
+ // Swallow
540
+ // XXX (@Qix-) should we be logging these?
541
+ }
542
+
543
+ // If debug isn't set in LS, and we're in Electron, try to load $DEBUG
544
+ if (!r && typeof process !== 'undefined' && 'env' in process) {
545
+ r = process.env.DEBUG;
546
+ }
547
+
548
+ return r;
549
+ }
550
+
551
+ /**
552
+ * Localstorage attempts to return the localstorage.
553
+ *
554
+ * This is necessary because safari throws
555
+ * when a user disables cookies/localstorage
556
+ * and you attempt to access it.
557
+ *
558
+ * @return {LocalStorage}
559
+ * @api private
560
+ */
561
+
562
+ function localstorage() {
563
+ try {
564
+ // TVMLKit (Apple TV JS Runtime) does not have a window object, just localStorage in the global context
565
+ // The Browser also has localStorage in the global context.
566
+ return localStorage;
567
+ } catch (error) {
568
+ // Swallow
569
+ // XXX (@Qix-) should we be logging these?
570
+ }
571
+ }
572
+
573
+ module.exports = requireCommon()(exports);
574
+
575
+ const {formatters} = module.exports;
576
+
577
+ /**
578
+ * Map %j to `JSON.stringify()`, since no Web Inspectors do that by default.
579
+ */
580
+
581
+ formatters.j = function (v) {
582
+ try {
583
+ return JSON.stringify(v);
584
+ } catch (error) {
585
+ return '[UnexpectedJSONParseError]: ' + error.message;
586
+ }
587
+ };
588
+ } (browser, browser.exports));
589
+ return browser.exports;
590
+ }
591
+
592
+ var node = {exports: {}};
593
+
594
+ /**
595
+ * Module dependencies.
596
+ */
597
+
598
+ var hasRequiredNode;
599
+
600
+ function requireNode () {
601
+ if (hasRequiredNode) return node.exports;
602
+ hasRequiredNode = 1;
603
+ (function (module, exports) {
604
+ const tty = require$$0;
605
+ const util = require$$1;
606
+
607
+ /**
608
+ * This is the Node.js implementation of `debug()`.
609
+ */
610
+
611
+ exports.init = init;
612
+ exports.log = log;
613
+ exports.formatArgs = formatArgs;
614
+ exports.save = save;
615
+ exports.load = load;
616
+ exports.useColors = useColors;
617
+ exports.destroy = util.deprecate(
618
+ () => {},
619
+ 'Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.'
620
+ );
621
+
622
+ /**
623
+ * Colors.
624
+ */
625
+
626
+ exports.colors = [6, 2, 3, 4, 5, 1];
627
+
628
+ try {
629
+ // Optional dependency (as in, doesn't need to be installed, NOT like optionalDependencies in package.json)
630
+ // eslint-disable-next-line import/no-extraneous-dependencies
631
+ const supportsColor = require$$2;
632
+
633
+ if (supportsColor && (supportsColor.stderr || supportsColor).level >= 2) {
634
+ exports.colors = [
635
+ 20,
636
+ 21,
637
+ 26,
638
+ 27,
639
+ 32,
640
+ 33,
641
+ 38,
642
+ 39,
643
+ 40,
644
+ 41,
645
+ 42,
646
+ 43,
647
+ 44,
648
+ 45,
649
+ 56,
650
+ 57,
651
+ 62,
652
+ 63,
653
+ 68,
654
+ 69,
655
+ 74,
656
+ 75,
657
+ 76,
658
+ 77,
659
+ 78,
660
+ 79,
661
+ 80,
662
+ 81,
663
+ 92,
664
+ 93,
665
+ 98,
666
+ 99,
667
+ 112,
668
+ 113,
669
+ 128,
670
+ 129,
671
+ 134,
672
+ 135,
673
+ 148,
674
+ 149,
675
+ 160,
676
+ 161,
677
+ 162,
678
+ 163,
679
+ 164,
680
+ 165,
681
+ 166,
682
+ 167,
683
+ 168,
684
+ 169,
685
+ 170,
686
+ 171,
687
+ 172,
688
+ 173,
689
+ 178,
690
+ 179,
691
+ 184,
692
+ 185,
693
+ 196,
694
+ 197,
695
+ 198,
696
+ 199,
697
+ 200,
698
+ 201,
699
+ 202,
700
+ 203,
701
+ 204,
702
+ 205,
703
+ 206,
704
+ 207,
705
+ 208,
706
+ 209,
707
+ 214,
708
+ 215,
709
+ 220,
710
+ 221
711
+ ];
712
+ }
713
+ } catch (error) {
714
+ // Swallow - we only care if `supports-color` is available; it doesn't have to be.
715
+ }
716
+
717
+ /**
718
+ * Build up the default `inspectOpts` object from the environment variables.
719
+ *
720
+ * $ DEBUG_COLORS=no DEBUG_DEPTH=10 DEBUG_SHOW_HIDDEN=enabled node script.js
721
+ */
722
+
723
+ exports.inspectOpts = Object.keys(process.env).filter(key => {
724
+ return /^debug_/i.test(key);
725
+ }).reduce((obj, key) => {
726
+ // Camel-case
727
+ const prop = key
728
+ .substring(6)
729
+ .toLowerCase()
730
+ .replace(/_([a-z])/g, (_, k) => {
731
+ return k.toUpperCase();
732
+ });
733
+
734
+ // Coerce string value into JS value
735
+ let val = process.env[key];
736
+ if (/^(yes|on|true|enabled)$/i.test(val)) {
737
+ val = true;
738
+ } else if (/^(no|off|false|disabled)$/i.test(val)) {
739
+ val = false;
740
+ } else if (val === 'null') {
741
+ val = null;
742
+ } else {
743
+ val = Number(val);
744
+ }
745
+
746
+ obj[prop] = val;
747
+ return obj;
748
+ }, {});
749
+
750
+ /**
751
+ * Is stdout a TTY? Colored output is enabled when `true`.
752
+ */
753
+
754
+ function useColors() {
755
+ return 'colors' in exports.inspectOpts ?
756
+ Boolean(exports.inspectOpts.colors) :
757
+ tty.isatty(process.stderr.fd);
758
+ }
759
+
760
+ /**
761
+ * Adds ANSI color escape codes if enabled.
762
+ *
763
+ * @api public
764
+ */
765
+
766
+ function formatArgs(args) {
767
+ const {namespace: name, useColors} = this;
768
+
769
+ if (useColors) {
770
+ const c = this.color;
771
+ const colorCode = '\u001B[3' + (c < 8 ? c : '8;5;' + c);
772
+ const prefix = ` ${colorCode};1m${name} \u001B[0m`;
773
+
774
+ args[0] = prefix + args[0].split('\n').join('\n' + prefix);
775
+ args.push(colorCode + 'm+' + module.exports.humanize(this.diff) + '\u001B[0m');
776
+ } else {
777
+ args[0] = getDate() + name + ' ' + args[0];
778
+ }
779
+ }
780
+
781
+ function getDate() {
782
+ if (exports.inspectOpts.hideDate) {
783
+ return '';
784
+ }
785
+ return new Date().toISOString() + ' ';
786
+ }
787
+
788
+ /**
789
+ * Invokes `util.formatWithOptions()` with the specified arguments and writes to stderr.
790
+ */
791
+
792
+ function log(...args) {
793
+ return process.stderr.write(util.formatWithOptions(exports.inspectOpts, ...args) + '\n');
794
+ }
795
+
796
+ /**
797
+ * Save `namespaces`.
798
+ *
799
+ * @param {String} namespaces
800
+ * @api private
801
+ */
802
+ function save(namespaces) {
803
+ if (namespaces) {
804
+ process.env.DEBUG = namespaces;
805
+ } else {
806
+ // If you set a process.env field to null or undefined, it gets cast to the
807
+ // string 'null' or 'undefined'. Just delete instead.
808
+ delete process.env.DEBUG;
809
+ }
810
+ }
811
+
812
+ /**
813
+ * Load `namespaces`.
814
+ *
815
+ * @return {String} returns the previously persisted debug modes
816
+ * @api private
817
+ */
818
+
819
+ function load() {
820
+ return process.env.DEBUG;
821
+ }
822
+
823
+ /**
824
+ * Init logic for `debug` instances.
825
+ *
826
+ * Create a new `inspectOpts` object in case `useColors` is set
827
+ * differently for a particular `debug` instance.
828
+ */
829
+
830
+ function init(debug) {
831
+ debug.inspectOpts = {};
832
+
833
+ const keys = Object.keys(exports.inspectOpts);
834
+ for (let i = 0; i < keys.length; i++) {
835
+ debug.inspectOpts[keys[i]] = exports.inspectOpts[keys[i]];
836
+ }
837
+ }
838
+
839
+ module.exports = requireCommon()(exports);
840
+
841
+ const {formatters} = module.exports;
842
+
843
+ /**
844
+ * Map %o to `util.inspect()`, all on a single line.
845
+ */
846
+
847
+ formatters.o = function (v) {
848
+ this.inspectOpts.colors = this.useColors;
849
+ return util.inspect(v, this.inspectOpts)
850
+ .split('\n')
851
+ .map(str => str.trim())
852
+ .join(' ');
853
+ };
854
+
855
+ /**
856
+ * Map %O to `util.inspect()`, allowing multiple lines if needed.
857
+ */
858
+
859
+ formatters.O = function (v) {
860
+ this.inspectOpts.colors = this.useColors;
861
+ return util.inspect(v, this.inspectOpts);
862
+ };
863
+ } (node, node.exports));
864
+ return node.exports;
865
+ }
866
+
867
+ /**
868
+ * Detect Electron renderer / nwjs process, which is node, but we should
869
+ * treat as a browser.
870
+ */
871
+
872
+ var hasRequiredSrc;
873
+
874
+ function requireSrc () {
875
+ if (hasRequiredSrc) return src.exports;
876
+ hasRequiredSrc = 1;
877
+ if (typeof process === 'undefined' || process.type === 'renderer' || process.browser === true || process.__nwjs) {
878
+ src.exports = requireBrowser();
879
+ } else {
880
+ src.exports = requireNode();
881
+ }
882
+ return src.exports;
883
+ }
884
+
885
+ export { requireSrc as r };