@kasperpeulen/vitest-plugin-nextjs 0.0.0-stage → 0.1.0-alpha.1

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 (256) hide show
  1. package/README.md +249 -2
  2. package/dist/_virtual/_rolldown/runtime.js +14 -0
  3. package/dist/action-ids.d.ts +18 -0
  4. package/dist/action-ids.js +44 -0
  5. package/dist/adapter.d.ts +8 -0
  6. package/dist/adapter.js +12 -0
  7. package/dist/app-requests.d.ts +63 -0
  8. package/dist/app-requests.js +253 -0
  9. package/dist/browser-context.d.ts +24 -0
  10. package/dist/browser-context.js +157 -0
  11. package/dist/build-output.d.ts +68 -0
  12. package/dist/build-output.js +216 -0
  13. package/dist/build.d.ts +26 -0
  14. package/dist/build.js +39 -0
  15. package/dist/built-files.d.ts +9 -0
  16. package/dist/built-files.js +22 -0
  17. package/dist/cache.d.ts +44 -0
  18. package/dist/cache.js +99 -0
  19. package/dist/client-components.d.ts +3 -0
  20. package/dist/client-components.js +4 -0
  21. package/dist/client-file-key.d.ts +5 -0
  22. package/dist/client-file-key.js +5 -0
  23. package/dist/client-files.d.ts +83 -0
  24. package/dist/client-files.js +186 -0
  25. package/dist/client-graph.d.ts +94 -0
  26. package/dist/client-graph.js +266 -0
  27. package/dist/client-modules.d.ts +10 -0
  28. package/dist/client-modules.js +43 -0
  29. package/dist/client.d.ts +42 -0
  30. package/dist/client.js +263 -0
  31. package/dist/commonjs.d.ts +44 -0
  32. package/dist/commonjs.js +111 -0
  33. package/dist/compat/browser/client.d.ts +19 -0
  34. package/dist/compat/browser/client.js +13 -0
  35. package/dist/compat/build.d.ts +145 -0
  36. package/dist/compat/build.js +149 -0
  37. package/dist/compat/checks.d.ts +16 -0
  38. package/dist/compat/checks.js +148 -0
  39. package/dist/compat/patches.d.ts +13 -0
  40. package/dist/compat/patches.js +30 -0
  41. package/dist/compat/paths.d.ts +74 -0
  42. package/dist/compat/paths.js +160 -0
  43. package/dist/compat/rsc/handlers.d.ts +2 -0
  44. package/dist/compat/rsc/handlers.js +2 -0
  45. package/dist/compat/rsc/prerender.d.ts +10 -0
  46. package/dist/compat/rsc/prerender.js +9 -0
  47. package/dist/compat/server/headers.d.ts +3 -0
  48. package/dist/compat/server/headers.js +3 -0
  49. package/dist/compat/ssr/build-output.d.ts +4 -0
  50. package/dist/compat/ssr/build-output.js +3 -0
  51. package/dist/compat/ssr/cache.d.ts +6 -0
  52. package/dist/compat/ssr/cache.js +6 -0
  53. package/dist/compat/ssr/handler.d.ts +8 -0
  54. package/dist/compat/ssr/handler.js +8 -0
  55. package/dist/compat/ssr/node-server.d.ts +5 -0
  56. package/dist/compat/ssr/node-server.js +4 -0
  57. package/dist/compat/ssr/render-errors.d.ts +4 -0
  58. package/dist/compat/ssr/render-errors.js +4 -0
  59. package/dist/compat/ssr/senders.d.ts +6 -0
  60. package/dist/compat/ssr/senders.js +6 -0
  61. package/dist/compat/types.d.ts +8 -0
  62. package/dist/compat/types.js +1 -0
  63. package/dist/compile.d.ts +39 -0
  64. package/dist/compile.js +175 -0
  65. package/dist/disk.d.ts +16 -0
  66. package/dist/disk.js +13 -0
  67. package/dist/document-loads.d.ts +15 -0
  68. package/dist/document-loads.js +53 -0
  69. package/dist/document.d.ts +79 -0
  70. package/dist/document.js +330 -0
  71. package/dist/downloads.d.ts +15 -0
  72. package/dist/downloads.js +71 -0
  73. package/dist/esm-require.d.ts +11 -0
  74. package/dist/esm-require.js +32 -0
  75. package/dist/fast-crypto/index.js +1093 -0
  76. package/dist/fast-crypto.d.ts +20 -0
  77. package/dist/fast-crypto.js +151 -0
  78. package/dist/flight.d.ts +19 -0
  79. package/dist/flight.js +42 -0
  80. package/dist/form-submission.d.ts +15 -0
  81. package/dist/form-submission.js +27 -0
  82. package/dist/from-page.d.ts +5 -0
  83. package/dist/from-page.js +44 -0
  84. package/dist/globals.d.ts +1 -0
  85. package/dist/globals.js +197 -0
  86. package/dist/host-document.d.ts +26 -0
  87. package/dist/host-document.js +34 -0
  88. package/dist/host-return-shared.d.ts +5 -0
  89. package/dist/host-return-shared.js +5 -0
  90. package/dist/host-return.d.ts +5 -0
  91. package/dist/host-return.js +16 -0
  92. package/dist/index.d.ts +280 -0
  93. package/dist/index.js +281 -0
  94. package/dist/internal.d.ts +2 -0
  95. package/dist/internal.js +3 -0
  96. package/dist/leftovers.d.ts +11 -0
  97. package/dist/leftovers.js +55 -0
  98. package/dist/mode.d.ts +169 -0
  99. package/dist/mode.js +31 -0
  100. package/dist/node/LICENSES.md +3540 -0
  101. package/dist/node/assert/strict.js +29 -0
  102. package/dist/node/assert.js +3044 -0
  103. package/dist/node/buffer.js +1499 -0
  104. package/dist/node/child_process.js +45 -0
  105. package/dist/node/cluster.js +85 -0
  106. package/dist/node/console.js +96 -0
  107. package/dist/node/constants.js +495 -0
  108. package/dist/node/crypto.js +1388 -0
  109. package/dist/node/dgram.js +78 -0
  110. package/dist/node/diagnostics_channel.js +122 -0
  111. package/dist/node/dns/promises.js +129 -0
  112. package/dist/node/dns.js +137 -0
  113. package/dist/node/domain.js +43 -0
  114. package/dist/node/events.js +1155 -0
  115. package/dist/node/fs/promises.js +40 -0
  116. package/dist/node/fs.js +10375 -0
  117. package/dist/node/http.js +326 -0
  118. package/dist/node/http2.js +305 -0
  119. package/dist/node/https.js +57 -0
  120. package/dist/node/inspector/promises.js +66 -0
  121. package/dist/node/inspector.js +76 -0
  122. package/dist/node/module.js +205 -0
  123. package/dist/node/net.js +392 -0
  124. package/dist/node/os.js +259 -0
  125. package/dist/node/path/posix.js +25 -0
  126. package/dist/node/path/win32.js +25 -0
  127. package/dist/node/path.js +384 -0
  128. package/dist/node/perf_hooks.js +313 -0
  129. package/dist/node/process.js +452 -0
  130. package/dist/node/punycode.js +178 -0
  131. package/dist/node/querystring.js +934 -0
  132. package/dist/node/readline/promises.js +71 -0
  133. package/dist/node/readline.js +56 -0
  134. package/dist/node/repl.js +44 -0
  135. package/dist/node/sqlite.js +22 -0
  136. package/dist/node/stream/consumers.js +47 -0
  137. package/dist/node/stream/promises.js +6 -0
  138. package/dist/node/stream/web.js +52 -0
  139. package/dist/node/stream.js +4323 -0
  140. package/dist/node/string_decoder.js +276 -0
  141. package/dist/node/sys.js +6 -0
  142. package/dist/node/timers/promises.js +71 -0
  143. package/dist/node/timers.js +133 -0
  144. package/dist/node/tls.js +122 -0
  145. package/dist/node/trace_events.js +23 -0
  146. package/dist/node/tty.js +69 -0
  147. package/dist/node/url.js +1426 -0
  148. package/dist/node/util/types.js +1456 -0
  149. package/dist/node/util.js +4807 -0
  150. package/dist/node/v8.js +160 -0
  151. package/dist/node/vm.js +88 -0
  152. package/dist/node/wasi.js +16 -0
  153. package/dist/node/worker_threads.js +123 -0
  154. package/dist/node/zlib.js +1396 -0
  155. package/dist/node-builtins.d.ts +40 -0
  156. package/dist/node-builtins.js +74 -0
  157. package/dist/node-on-page.d.ts +46 -0
  158. package/dist/node-on-page.js +101 -0
  159. package/dist/node-platform.d.ts +36 -0
  160. package/dist/node-platform.js +152 -0
  161. package/dist/node-rendered.d.ts +21 -0
  162. package/dist/node-rendered.js +26 -0
  163. package/dist/node-server.d.ts +46 -0
  164. package/dist/node-server.js +193 -0
  165. package/dist/not-found-page.d.ts +19 -0
  166. package/dist/not-found-page.js +74 -0
  167. package/dist/optimizer-cache-key.d.ts +26 -0
  168. package/dist/optimizer-cache-key.js +73 -0
  169. package/dist/own-package.d.ts +1 -0
  170. package/dist/own-package.js +6 -0
  171. package/dist/page-store.d.ts +33 -0
  172. package/dist/page-store.js +80 -0
  173. package/dist/page-timers.d.ts +22 -0
  174. package/dist/page-timers.js +47 -0
  175. package/dist/page.d.ts +112 -0
  176. package/dist/page.js +549 -0
  177. package/dist/paths.d.ts +13 -0
  178. package/dist/paths.js +47 -0
  179. package/dist/plugin.d.ts +23 -0
  180. package/dist/plugin.js +1006 -0
  181. package/dist/prerender-verdict.d.ts +8 -0
  182. package/dist/prerender-verdict.js +67 -0
  183. package/dist/project/context.d.ts +546 -0
  184. package/dist/project/context.js +111 -0
  185. package/dist/project/entries.d.ts +42 -0
  186. package/dist/project/entries.js +189 -0
  187. package/dist/project/env-worker.d.ts +1 -0
  188. package/dist/project/env-worker.js +9 -0
  189. package/dist/project/env.d.ts +36 -0
  190. package/dist/project/env.js +82 -0
  191. package/dist/project/layers.d.ts +31 -0
  192. package/dist/project/layers.js +150 -0
  193. package/dist/project/loaders.d.ts +71 -0
  194. package/dist/project/loaders.js +300 -0
  195. package/dist/project/metadata.d.ts +8 -0
  196. package/dist/project/metadata.js +34 -0
  197. package/dist/project/module-exports.d.ts +29 -0
  198. package/dist/project/module-exports.js +77 -0
  199. package/dist/project/routes.d.ts +19 -0
  200. package/dist/project/routes.js +92 -0
  201. package/dist/project/routing.d.ts +46 -0
  202. package/dist/project/routing.js +280 -0
  203. package/dist/project/transform.d.ts +8 -0
  204. package/dist/project/transform.js +110 -0
  205. package/dist/project/webpack.d.ts +65 -0
  206. package/dist/project/webpack.js +191 -0
  207. package/dist/project.d.ts +269 -0
  208. package/dist/project.js +58 -0
  209. package/dist/registry-global.d.ts +5 -0
  210. package/dist/registry-global.js +5 -0
  211. package/dist/registry.d.ts +241 -0
  212. package/dist/registry.js +30 -0
  213. package/dist/route-chunks.d.ts +13 -0
  214. package/dist/route-chunks.js +32 -0
  215. package/dist/route-lookup.d.ts +34 -0
  216. package/dist/route-lookup.js +207 -0
  217. package/dist/routes-ahead-shared.d.ts +17 -0
  218. package/dist/routes-ahead-shared.js +9 -0
  219. package/dist/routes-ahead.d.ts +10 -0
  220. package/dist/routes-ahead.js +54 -0
  221. package/dist/rsc.d.ts +19 -0
  222. package/dist/rsc.js +171 -0
  223. package/dist/server-action.d.ts +9 -0
  224. package/dist/server-action.js +15 -0
  225. package/dist/server-code.d.ts +176 -0
  226. package/dist/server-code.js +357 -0
  227. package/dist/server-in-front.d.ts +37 -0
  228. package/dist/server-in-front.js +90 -0
  229. package/dist/server-layers.d.ts +22 -0
  230. package/dist/server-layers.js +33 -0
  231. package/dist/setup-browser.d.ts +1 -0
  232. package/dist/setup-browser.js +8 -0
  233. package/dist/setup-node.d.ts +1 -0
  234. package/dist/setup-node.js +6 -0
  235. package/dist/setup.d.ts +8 -0
  236. package/dist/setup.js +62 -0
  237. package/dist/speed-features.d.ts +13 -0
  238. package/dist/speed-features.js +95 -0
  239. package/dist/ssr.d.ts +70 -0
  240. package/dist/ssr.js +480 -0
  241. package/dist/static-build.d.ts +36 -0
  242. package/dist/static-build.js +92 -0
  243. package/dist/storage.d.ts +31 -0
  244. package/dist/storage.js +94 -0
  245. package/dist/styles-shared.d.ts +137 -0
  246. package/dist/styles-shared.js +124 -0
  247. package/dist/styles.d.ts +102 -0
  248. package/dist/styles.js +730 -0
  249. package/dist/stylesheet-versions.d.ts +17 -0
  250. package/dist/stylesheet-versions.js +43 -0
  251. package/dist/tester.html +10 -0
  252. package/dist/use-cache.d.ts +15 -0
  253. package/dist/use-cache.js +93 -0
  254. package/dist/vitest-version.d.ts +6 -0
  255. package/dist/vitest-version.js +12 -0
  256. package/package.json +125 -3
@@ -0,0 +1,934 @@
1
+ //#region ../../node_modules/.pnpm/unenv@2.0.0-rc.24/node_modules/unenv/dist/runtime/node/internal/querystring/querystring.mjs
2
+ var ERR_INVALID_URI = class extends URIError {
3
+ code = "ERR_INVALID_URI";
4
+ constructor() {
5
+ super("URI malformed");
6
+ }
7
+ };
8
+ const hexTable = Array.from({ length: 256 });
9
+ for (let i = 0; i < 256; ++i) hexTable[i] = "%" + String.prototype.toUpperCase.call((i < 16 ? "0" : "") + Number.prototype.toString.call(i, 16));
10
+ const isHexTable = new Int8Array([
11
+ 0,
12
+ 0,
13
+ 0,
14
+ 0,
15
+ 0,
16
+ 0,
17
+ 0,
18
+ 0,
19
+ 0,
20
+ 0,
21
+ 0,
22
+ 0,
23
+ 0,
24
+ 0,
25
+ 0,
26
+ 0,
27
+ 0,
28
+ 0,
29
+ 0,
30
+ 0,
31
+ 0,
32
+ 0,
33
+ 0,
34
+ 0,
35
+ 0,
36
+ 0,
37
+ 0,
38
+ 0,
39
+ 0,
40
+ 0,
41
+ 0,
42
+ 0,
43
+ 0,
44
+ 0,
45
+ 0,
46
+ 0,
47
+ 0,
48
+ 0,
49
+ 0,
50
+ 0,
51
+ 0,
52
+ 0,
53
+ 0,
54
+ 0,
55
+ 0,
56
+ 0,
57
+ 0,
58
+ 0,
59
+ 1,
60
+ 1,
61
+ 1,
62
+ 1,
63
+ 1,
64
+ 1,
65
+ 1,
66
+ 1,
67
+ 1,
68
+ 1,
69
+ 0,
70
+ 0,
71
+ 0,
72
+ 0,
73
+ 0,
74
+ 0,
75
+ 0,
76
+ 1,
77
+ 1,
78
+ 1,
79
+ 1,
80
+ 1,
81
+ 1,
82
+ 0,
83
+ 0,
84
+ 0,
85
+ 0,
86
+ 0,
87
+ 0,
88
+ 0,
89
+ 0,
90
+ 0,
91
+ 0,
92
+ 0,
93
+ 0,
94
+ 0,
95
+ 0,
96
+ 0,
97
+ 0,
98
+ 0,
99
+ 0,
100
+ 0,
101
+ 0,
102
+ 0,
103
+ 0,
104
+ 0,
105
+ 0,
106
+ 0,
107
+ 0,
108
+ 1,
109
+ 1,
110
+ 1,
111
+ 1,
112
+ 1,
113
+ 1,
114
+ 0,
115
+ 0,
116
+ 0,
117
+ 0,
118
+ 0,
119
+ 0,
120
+ 0,
121
+ 0,
122
+ 0,
123
+ 0,
124
+ 0,
125
+ 0,
126
+ 0,
127
+ 0,
128
+ 0,
129
+ 0,
130
+ 0,
131
+ 0,
132
+ 0,
133
+ 0,
134
+ 0,
135
+ 0,
136
+ 0,
137
+ 0,
138
+ 0,
139
+ 0,
140
+ 0,
141
+ 0,
142
+ 0,
143
+ 0,
144
+ 0,
145
+ 0,
146
+ 0,
147
+ 0,
148
+ 0,
149
+ 0,
150
+ 0,
151
+ 0,
152
+ 0,
153
+ 0,
154
+ 0,
155
+ 0,
156
+ 0,
157
+ 0,
158
+ 0,
159
+ 0,
160
+ 0,
161
+ 0,
162
+ 0,
163
+ 0,
164
+ 0,
165
+ 0,
166
+ 0,
167
+ 0,
168
+ 0,
169
+ 0,
170
+ 0,
171
+ 0,
172
+ 0,
173
+ 0,
174
+ 0,
175
+ 0,
176
+ 0,
177
+ 0,
178
+ 0,
179
+ 0,
180
+ 0,
181
+ 0,
182
+ 0,
183
+ 0,
184
+ 0,
185
+ 0,
186
+ 0,
187
+ 0,
188
+ 0,
189
+ 0,
190
+ 0,
191
+ 0,
192
+ 0,
193
+ 0,
194
+ 0,
195
+ 0,
196
+ 0,
197
+ 0,
198
+ 0,
199
+ 0,
200
+ 0,
201
+ 0,
202
+ 0,
203
+ 0,
204
+ 0,
205
+ 0,
206
+ 0,
207
+ 0,
208
+ 0,
209
+ 0,
210
+ 0,
211
+ 0,
212
+ 0,
213
+ 0,
214
+ 0,
215
+ 0,
216
+ 0,
217
+ 0,
218
+ 0,
219
+ 0,
220
+ 0,
221
+ 0,
222
+ 0,
223
+ 0,
224
+ 0,
225
+ 0,
226
+ 0,
227
+ 0,
228
+ 0,
229
+ 0,
230
+ 0,
231
+ 0,
232
+ 0,
233
+ 0,
234
+ 0,
235
+ 0,
236
+ 0,
237
+ 0,
238
+ 0,
239
+ 0,
240
+ 0,
241
+ 0,
242
+ 0,
243
+ 0,
244
+ 0,
245
+ 0,
246
+ 0,
247
+ 0,
248
+ 0,
249
+ 0,
250
+ 0,
251
+ 0,
252
+ 0,
253
+ 0,
254
+ 0,
255
+ 0,
256
+ 0,
257
+ 0,
258
+ 0,
259
+ 0,
260
+ 0,
261
+ 0,
262
+ 0,
263
+ 0,
264
+ 0,
265
+ 0,
266
+ 0
267
+ ]);
268
+ function encodeStr(str, noEscapeTable, hexTable) {
269
+ const len = str.length;
270
+ if (len === 0) return "";
271
+ let out = "";
272
+ let lastPos = 0;
273
+ let i = 0;
274
+ outer: for (; i < len; i++) {
275
+ let c = String.prototype.charCodeAt.call(str, i);
276
+ while (c < 128) {
277
+ if (noEscapeTable[c] !== 1) {
278
+ if (lastPos < i) out += String.prototype.slice.call(str, lastPos, i);
279
+ lastPos = i + 1;
280
+ out += hexTable[c];
281
+ }
282
+ if (++i === len) break outer;
283
+ c = String.prototype.charCodeAt.call(str, i);
284
+ }
285
+ if (lastPos < i) out += String.prototype.slice.call(str, lastPos, i);
286
+ if (c < 2048) {
287
+ lastPos = i + 1;
288
+ out += hexTable[192 | c >> 6] + hexTable[128 | c & 63];
289
+ continue;
290
+ }
291
+ if (c < 55296 || c >= 57344) {
292
+ lastPos = i + 1;
293
+ out += hexTable[224 | c >> 12] + hexTable[128 | c >> 6 & 63] + hexTable[128 | c & 63];
294
+ continue;
295
+ }
296
+ ++i;
297
+ if (i >= len) throw new ERR_INVALID_URI();
298
+ const c2 = String.prototype.charCodeAt.call(str, i) & 1023;
299
+ lastPos = i + 1;
300
+ c = 65536 + ((c & 1023) << 10 | c2);
301
+ out += hexTable[240 | c >> 18] + hexTable[128 | c >> 12 & 63] + hexTable[128 | c >> 6 & 63] + hexTable[128 | c & 63];
302
+ }
303
+ if (lastPos === 0) return str;
304
+ if (lastPos < len) return out + String.prototype.slice.call(str, lastPos);
305
+ return out;
306
+ }
307
+ //#endregion
308
+ //#region ../../node_modules/.pnpm/unenv@2.0.0-rc.24/node_modules/unenv/dist/runtime/node/querystring.mjs
309
+ const unhexTable = new Int8Array([
310
+ -1,
311
+ -1,
312
+ -1,
313
+ -1,
314
+ -1,
315
+ -1,
316
+ -1,
317
+ -1,
318
+ -1,
319
+ -1,
320
+ -1,
321
+ -1,
322
+ -1,
323
+ -1,
324
+ -1,
325
+ -1,
326
+ -1,
327
+ -1,
328
+ -1,
329
+ -1,
330
+ -1,
331
+ -1,
332
+ -1,
333
+ -1,
334
+ -1,
335
+ -1,
336
+ -1,
337
+ -1,
338
+ -1,
339
+ -1,
340
+ -1,
341
+ -1,
342
+ -1,
343
+ -1,
344
+ -1,
345
+ -1,
346
+ -1,
347
+ -1,
348
+ -1,
349
+ -1,
350
+ -1,
351
+ -1,
352
+ -1,
353
+ -1,
354
+ -1,
355
+ -1,
356
+ -1,
357
+ -1,
358
+ 0,
359
+ 1,
360
+ 2,
361
+ 3,
362
+ 4,
363
+ 5,
364
+ 6,
365
+ 7,
366
+ 8,
367
+ 9,
368
+ -1,
369
+ -1,
370
+ -1,
371
+ -1,
372
+ -1,
373
+ -1,
374
+ -1,
375
+ 10,
376
+ 11,
377
+ 12,
378
+ 13,
379
+ 14,
380
+ 15,
381
+ -1,
382
+ -1,
383
+ -1,
384
+ -1,
385
+ -1,
386
+ -1,
387
+ -1,
388
+ -1,
389
+ -1,
390
+ -1,
391
+ -1,
392
+ -1,
393
+ -1,
394
+ -1,
395
+ -1,
396
+ -1,
397
+ -1,
398
+ -1,
399
+ -1,
400
+ -1,
401
+ -1,
402
+ -1,
403
+ -1,
404
+ -1,
405
+ -1,
406
+ -1,
407
+ 10,
408
+ 11,
409
+ 12,
410
+ 13,
411
+ 14,
412
+ 15,
413
+ -1,
414
+ -1,
415
+ -1,
416
+ -1,
417
+ -1,
418
+ -1,
419
+ -1,
420
+ -1,
421
+ -1,
422
+ -1,
423
+ -1,
424
+ -1,
425
+ -1,
426
+ -1,
427
+ -1,
428
+ -1,
429
+ -1,
430
+ -1,
431
+ -1,
432
+ -1,
433
+ -1,
434
+ -1,
435
+ -1,
436
+ -1,
437
+ -1,
438
+ -1,
439
+ -1,
440
+ -1,
441
+ -1,
442
+ -1,
443
+ -1,
444
+ -1,
445
+ -1,
446
+ -1,
447
+ -1,
448
+ -1,
449
+ -1,
450
+ -1,
451
+ -1,
452
+ -1,
453
+ -1,
454
+ -1,
455
+ -1,
456
+ -1,
457
+ -1,
458
+ -1,
459
+ -1,
460
+ -1,
461
+ -1,
462
+ -1,
463
+ -1,
464
+ -1,
465
+ -1,
466
+ -1,
467
+ -1,
468
+ -1,
469
+ -1,
470
+ -1,
471
+ -1,
472
+ -1,
473
+ -1,
474
+ -1,
475
+ -1,
476
+ -1,
477
+ -1,
478
+ -1,
479
+ -1,
480
+ -1,
481
+ -1,
482
+ -1,
483
+ -1,
484
+ -1,
485
+ -1,
486
+ -1,
487
+ -1,
488
+ -1,
489
+ -1,
490
+ -1,
491
+ -1,
492
+ -1,
493
+ -1,
494
+ -1,
495
+ -1,
496
+ -1,
497
+ -1,
498
+ -1,
499
+ -1,
500
+ -1,
501
+ -1,
502
+ -1,
503
+ -1,
504
+ -1,
505
+ -1,
506
+ -1,
507
+ -1,
508
+ -1,
509
+ -1,
510
+ -1,
511
+ -1,
512
+ -1,
513
+ -1,
514
+ -1,
515
+ -1,
516
+ -1,
517
+ -1,
518
+ -1,
519
+ -1,
520
+ -1,
521
+ -1,
522
+ -1,
523
+ -1,
524
+ -1,
525
+ -1,
526
+ -1,
527
+ -1,
528
+ -1,
529
+ -1,
530
+ -1,
531
+ -1,
532
+ -1,
533
+ -1,
534
+ -1,
535
+ -1,
536
+ -1,
537
+ -1,
538
+ -1,
539
+ -1,
540
+ -1,
541
+ -1,
542
+ -1,
543
+ -1,
544
+ -1,
545
+ -1,
546
+ -1,
547
+ -1,
548
+ -1,
549
+ -1,
550
+ -1,
551
+ -1,
552
+ -1,
553
+ -1,
554
+ -1,
555
+ -1,
556
+ -1,
557
+ -1,
558
+ -1,
559
+ -1,
560
+ -1,
561
+ -1,
562
+ -1,
563
+ -1,
564
+ -1,
565
+ -1
566
+ ]);
567
+ function unescapeBuffer(s, decodeSpaces) {
568
+ const out = globalThis.Buffer.allocUnsafe(s.length);
569
+ let index = 0;
570
+ let outIndex = 0;
571
+ let currentChar;
572
+ let nextChar;
573
+ let hexHigh;
574
+ let hexLow;
575
+ const maxLength = s.length - 2;
576
+ let hasHex = false;
577
+ while (index < s.length) {
578
+ currentChar = String.prototype.charCodeAt.call(s, index);
579
+ if (currentChar === 43 && decodeSpaces) {
580
+ out[outIndex++] = 32;
581
+ index++;
582
+ continue;
583
+ }
584
+ if (currentChar === 37 && index < maxLength) {
585
+ currentChar = String.prototype.charCodeAt.call(s, ++index);
586
+ hexHigh = unhexTable[currentChar];
587
+ if (hexHigh >= 0) {
588
+ nextChar = String.prototype.charCodeAt.call(s, ++index);
589
+ hexLow = unhexTable[nextChar];
590
+ if (hexLow >= 0) {
591
+ hasHex = true;
592
+ currentChar = hexHigh * 16 + hexLow;
593
+ } else {
594
+ out[outIndex++] = 37;
595
+ index--;
596
+ }
597
+ } else {
598
+ out[outIndex++] = 37;
599
+ continue;
600
+ }
601
+ }
602
+ out[outIndex++] = currentChar;
603
+ index++;
604
+ }
605
+ return hasHex ? out.slice(0, outIndex) : out;
606
+ }
607
+ function qsUnescape(s, decodeSpaces) {
608
+ try {
609
+ return decodeURIComponent(s);
610
+ } catch {
611
+ return unescapeBuffer(s, decodeSpaces).toString();
612
+ }
613
+ }
614
+ const noEscape = new Int8Array([
615
+ 0,
616
+ 0,
617
+ 0,
618
+ 0,
619
+ 0,
620
+ 0,
621
+ 0,
622
+ 0,
623
+ 0,
624
+ 0,
625
+ 0,
626
+ 0,
627
+ 0,
628
+ 0,
629
+ 0,
630
+ 0,
631
+ 0,
632
+ 0,
633
+ 0,
634
+ 0,
635
+ 0,
636
+ 0,
637
+ 0,
638
+ 0,
639
+ 0,
640
+ 0,
641
+ 0,
642
+ 0,
643
+ 0,
644
+ 0,
645
+ 0,
646
+ 0,
647
+ 0,
648
+ 1,
649
+ 0,
650
+ 0,
651
+ 0,
652
+ 0,
653
+ 0,
654
+ 1,
655
+ 1,
656
+ 1,
657
+ 1,
658
+ 0,
659
+ 0,
660
+ 1,
661
+ 1,
662
+ 0,
663
+ 1,
664
+ 1,
665
+ 1,
666
+ 1,
667
+ 1,
668
+ 1,
669
+ 1,
670
+ 1,
671
+ 1,
672
+ 1,
673
+ 0,
674
+ 0,
675
+ 0,
676
+ 0,
677
+ 0,
678
+ 0,
679
+ 0,
680
+ 1,
681
+ 1,
682
+ 1,
683
+ 1,
684
+ 1,
685
+ 1,
686
+ 1,
687
+ 1,
688
+ 1,
689
+ 1,
690
+ 1,
691
+ 1,
692
+ 1,
693
+ 1,
694
+ 1,
695
+ 1,
696
+ 1,
697
+ 1,
698
+ 1,
699
+ 1,
700
+ 1,
701
+ 1,
702
+ 1,
703
+ 1,
704
+ 1,
705
+ 1,
706
+ 0,
707
+ 0,
708
+ 0,
709
+ 0,
710
+ 1,
711
+ 0,
712
+ 1,
713
+ 1,
714
+ 1,
715
+ 1,
716
+ 1,
717
+ 1,
718
+ 1,
719
+ 1,
720
+ 1,
721
+ 1,
722
+ 1,
723
+ 1,
724
+ 1,
725
+ 1,
726
+ 1,
727
+ 1,
728
+ 1,
729
+ 1,
730
+ 1,
731
+ 1,
732
+ 1,
733
+ 1,
734
+ 1,
735
+ 1,
736
+ 1,
737
+ 1,
738
+ 0,
739
+ 0,
740
+ 0,
741
+ 1,
742
+ 0
743
+ ]);
744
+ function qsEscape(str) {
745
+ if (typeof str !== "string") {
746
+ if (typeof str === "object") str = String(str);
747
+ else str += "";
748
+ }
749
+ return encodeStr(str, noEscape, hexTable);
750
+ }
751
+ function stringifyPrimitive(v) {
752
+ if (typeof v === "string") return v;
753
+ if (typeof v === "number" && Number.isFinite(v)) return "" + v;
754
+ if (typeof v === "bigint") return "" + v;
755
+ if (typeof v === "boolean") return v ? "true" : "false";
756
+ return "";
757
+ }
758
+ function encodeStringified(v, encode) {
759
+ if (typeof v === "string") return v.length > 0 ? encode(v) : "";
760
+ if (typeof v === "number" && Number.isFinite(v)) return Math.abs(v) < 1e21 ? "" + v : encode("" + v);
761
+ if (typeof v === "bigint") return "" + v;
762
+ if (typeof v === "boolean") return v ? "true" : "false";
763
+ return "";
764
+ }
765
+ function encodeStringifiedCustom(v, encode) {
766
+ return encode(stringifyPrimitive(v));
767
+ }
768
+ function stringify(obj, sep, eq, options) {
769
+ sep = sep || "&";
770
+ eq = eq || "=";
771
+ let encode = qsEscape;
772
+ if (options && typeof options.encodeURIComponent === "function") encode = options.encodeURIComponent;
773
+ const convert = encode === qsEscape ? encodeStringified : encodeStringifiedCustom;
774
+ if (obj !== null && typeof obj === "object") {
775
+ const keys = Object.keys(obj);
776
+ const len = keys.length;
777
+ let fields = "";
778
+ for (let i = 0; i < len; ++i) {
779
+ const k = keys[i];
780
+ const v = obj[k];
781
+ let ks = convert(k, encode);
782
+ ks += eq;
783
+ if (Array.isArray(v)) {
784
+ const vlen = v.length;
785
+ if (vlen === 0) continue;
786
+ if (fields) fields += sep;
787
+ for (let j = 0; j < vlen; ++j) {
788
+ if (j) fields += sep;
789
+ fields += ks;
790
+ fields += convert(v[j], encode);
791
+ }
792
+ } else {
793
+ if (fields) fields += sep;
794
+ fields += ks;
795
+ fields += convert(v, encode);
796
+ }
797
+ }
798
+ return fields;
799
+ }
800
+ return "";
801
+ }
802
+ function charCodes(str) {
803
+ if (str.length === 0) return [];
804
+ if (str.length === 1) return [String.prototype.charCodeAt.call(str, 0)];
805
+ const ret = Array.from({ length: str.length });
806
+ for (let i = 0; i < str.length; ++i) ret[i] = String.prototype.charCodeAt.call(str, i);
807
+ return ret;
808
+ }
809
+ const defSepCodes = [38];
810
+ const defEqCodes = [61];
811
+ function addKeyVal(obj, key, value, keyEncoded, valEncoded, decode) {
812
+ if (key.length > 0 && keyEncoded) key = decodeStr(key, decode);
813
+ if (value.length > 0 && valEncoded) value = decodeStr(value, decode);
814
+ if (obj[key] === void 0) obj[key] = value;
815
+ else {
816
+ const curValue = obj[key];
817
+ if (curValue.pop) curValue[curValue.length] = value;
818
+ else obj[key] = [curValue, value];
819
+ }
820
+ }
821
+ function parse(qs, sep, eq, options) {
822
+ const obj = { __proto__: null };
823
+ if (typeof qs !== "string" || qs.length === 0) return obj;
824
+ const sepCodes = sep ? charCodes(String(sep)) : defSepCodes;
825
+ const eqCodes = eq ? charCodes(String(eq)) : defEqCodes;
826
+ const sepLen = sepCodes.length;
827
+ const eqLen = eqCodes.length;
828
+ let pairs = 1e3;
829
+ if (options && typeof options.maxKeys === "number") pairs = options.maxKeys > 0 ? options.maxKeys : -1;
830
+ let decode = qsUnescape;
831
+ if (options && typeof options.decodeURIComponent === "function") decode = options.decodeURIComponent;
832
+ const customDecode = decode !== qsUnescape;
833
+ let lastPos = 0;
834
+ let sepIdx = 0;
835
+ let eqIdx = 0;
836
+ let key = "";
837
+ let value = "";
838
+ let keyEncoded = customDecode;
839
+ let valEncoded = customDecode;
840
+ const plusChar = customDecode ? "%20" : " ";
841
+ let encodeCheck = 0;
842
+ for (let i = 0; i < qs.length; ++i) {
843
+ const code = String.prototype.charCodeAt.call(qs, i);
844
+ if (code === sepCodes[sepIdx]) {
845
+ if (++sepIdx === sepLen) {
846
+ const end = i - sepIdx + 1;
847
+ if (eqIdx < eqLen) {
848
+ if (lastPos < end) key += String.prototype.slice.call(qs, lastPos, end);
849
+ else if (key.length === 0) {
850
+ if (--pairs === 0) return obj;
851
+ lastPos = i + 1;
852
+ sepIdx = eqIdx = 0;
853
+ continue;
854
+ }
855
+ } else if (lastPos < end) value += String.prototype.slice.call(qs, lastPos, end);
856
+ addKeyVal(obj, key, value, keyEncoded, valEncoded, decode);
857
+ if (--pairs === 0) return obj;
858
+ keyEncoded = valEncoded = customDecode;
859
+ key = value = "";
860
+ encodeCheck = 0;
861
+ lastPos = i + 1;
862
+ sepIdx = eqIdx = 0;
863
+ }
864
+ } else {
865
+ sepIdx = 0;
866
+ if (eqIdx < eqLen) {
867
+ if (code === eqCodes[eqIdx]) {
868
+ if (++eqIdx === eqLen) {
869
+ const end = i - eqIdx + 1;
870
+ if (lastPos < end) key += String.prototype.slice.call(qs, lastPos, end);
871
+ encodeCheck = 0;
872
+ lastPos = i + 1;
873
+ }
874
+ continue;
875
+ } else {
876
+ eqIdx = 0;
877
+ if (!keyEncoded) {
878
+ if (code === 37) {
879
+ encodeCheck = 1;
880
+ continue;
881
+ } else if (encodeCheck > 0) {
882
+ if (isHexTable[code] === 1) {
883
+ if (++encodeCheck === 3) keyEncoded = true;
884
+ continue;
885
+ } else encodeCheck = 0;
886
+ }
887
+ }
888
+ }
889
+ if (code === 43) {
890
+ if (lastPos < i) key += String.prototype.slice.call(qs, lastPos, i);
891
+ key += plusChar;
892
+ lastPos = i + 1;
893
+ continue;
894
+ }
895
+ }
896
+ if (code === 43) {
897
+ if (lastPos < i) value += String.prototype.slice.call(qs, lastPos, i);
898
+ value += plusChar;
899
+ lastPos = i + 1;
900
+ } else if (!valEncoded) {
901
+ if (code === 37) encodeCheck = 1;
902
+ else if (encodeCheck > 0) {
903
+ if (isHexTable[code] === 1) {
904
+ if (++encodeCheck === 3) valEncoded = true;
905
+ } else encodeCheck = 0;
906
+ }
907
+ }
908
+ }
909
+ }
910
+ if (lastPos < qs.length) {
911
+ if (eqIdx < eqLen) key += String.prototype.slice.call(qs, lastPos);
912
+ else if (sepIdx < sepLen) value += String.prototype.slice.call(qs, lastPos);
913
+ } else if (eqIdx === 0 && key.length === 0) return obj;
914
+ addKeyVal(obj, key, value, keyEncoded, valEncoded, decode);
915
+ return obj;
916
+ }
917
+ function decodeStr(s, decoder) {
918
+ try {
919
+ return decoder(s);
920
+ } catch {
921
+ return qsUnescape(s, true);
922
+ }
923
+ }
924
+ var querystring_default = {
925
+ unescapeBuffer,
926
+ unescape: qsUnescape,
927
+ escape: qsEscape,
928
+ stringify,
929
+ encode: stringify,
930
+ parse,
931
+ decode: parse
932
+ };
933
+ //#endregion
934
+ export { parse as decode, parse, querystring_default as default, stringify as encode, stringify, qsEscape as escape, qsUnescape as unescape, unescapeBuffer };