@storybook/nextjs-vite 10.1.0-alpha.1 → 10.1.0-alpha.10
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.
- package/dist/_node-chunks/{chunk-K4HZXX3V.js → chunk-VXFWYCJU.js} +6 -6
- package/dist/_node-chunks/{dist-RH7SJCP6.js → dist-NDKGFVGJ.js} +7 -7
- package/dist/_node-chunks/jiti-DPL4HCVO.js +3150 -0
- package/dist/index.d.ts +4 -0
- package/dist/node/index.d.ts +4 -0
- package/dist/node/index.js +7 -7
- package/dist/preset.js +15 -11
- package/dist/vite-plugin/index.js +7 -7
- package/package.json +7 -7
- package/dist/_node-chunks/jiti-UIA265P2.js +0 -32417
|
@@ -0,0 +1,3150 @@
|
|
|
1
|
+
import CJS_COMPAT_NODE_URL_2xdgntyp72e from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_2xdgntyp72e from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_2xdgntyp72e from "node:module";
|
|
4
|
+
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_2xdgntyp72e.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_2xdgntyp72e.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_2xdgntyp72e.createRequire(import.meta.url);
|
|
8
|
+
|
|
9
|
+
// ------------------------------------------------------------
|
|
10
|
+
// end of CJS compatibility banner, injected by Storybook's esbuild configuration
|
|
11
|
+
// ------------------------------------------------------------
|
|
12
|
+
import {
|
|
13
|
+
__commonJS,
|
|
14
|
+
__esm,
|
|
15
|
+
__name,
|
|
16
|
+
__require,
|
|
17
|
+
__toESM
|
|
18
|
+
} from "./chunk-VXFWYCJU.js";
|
|
19
|
+
|
|
20
|
+
// ../../node_modules/jiti/dist/jiti.cjs
|
|
21
|
+
var require_jiti = __commonJS({
|
|
22
|
+
"../../node_modules/jiti/dist/jiti.cjs"(exports, module) {
|
|
23
|
+
(() => {
|
|
24
|
+
var e = { "./node_modules/.pnpm/mlly@1.8.0/node_modules/mlly/dist lazy recursive": /* @__PURE__ */ __name(function(e2) {
|
|
25
|
+
function webpackEmptyAsyncContext(e3) {
|
|
26
|
+
return Promise.resolve().then(function() {
|
|
27
|
+
var t2 = Error("Cannot find module '" + e3 + "'");
|
|
28
|
+
throw t2.code = "MODULE_NOT_FOUND", t2;
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
__name(webpackEmptyAsyncContext, "webpackEmptyAsyncContext");
|
|
32
|
+
webpackEmptyAsyncContext.keys = () => [], webpackEmptyAsyncContext.resolve = webpackEmptyAsyncContext, webpackEmptyAsyncContext.id = "./node_modules/.pnpm/mlly@1.8.0/node_modules/mlly/dist lazy recursive", e2.exports = webpackEmptyAsyncContext;
|
|
33
|
+
}, "./node_modules/.pnpm/mlly@1.8.0/node_modules/mlly/dist lazy recursive") }, t = {};
|
|
34
|
+
function __webpack_require__(i2) {
|
|
35
|
+
var s = t[i2];
|
|
36
|
+
if (void 0 !== s) return s.exports;
|
|
37
|
+
var r = t[i2] = { exports: {} };
|
|
38
|
+
return e[i2](r, r.exports, __webpack_require__), r.exports;
|
|
39
|
+
}
|
|
40
|
+
__name(__webpack_require__, "__webpack_require__");
|
|
41
|
+
__webpack_require__.n = (e2) => {
|
|
42
|
+
var t2 = e2 && e2.__esModule ? () => e2.default : () => e2;
|
|
43
|
+
return __webpack_require__.d(t2, { a: t2 }), t2;
|
|
44
|
+
}, __webpack_require__.d = (e2, t2) => {
|
|
45
|
+
for (var i2 in t2) __webpack_require__.o(t2, i2) && !__webpack_require__.o(e2, i2) && Object.defineProperty(e2, i2, { enumerable: true, get: t2[i2] });
|
|
46
|
+
}, __webpack_require__.o = (e2, t2) => Object.prototype.hasOwnProperty.call(e2, t2);
|
|
47
|
+
var i = {};
|
|
48
|
+
(() => {
|
|
49
|
+
"use strict";
|
|
50
|
+
let e2, t2, s;
|
|
51
|
+
__webpack_require__.d(i, { default: /* @__PURE__ */ __name(() => createJiti2, "default") });
|
|
52
|
+
let r = __require("node:os");
|
|
53
|
+
var n, a = [509, 0, 227, 0, 150, 4, 294, 9, 1368, 2, 2, 1, 6, 3, 41, 2, 5, 0, 166, 1, 574, 3, 9, 9, 7, 9, 32, 4, 318, 1, 80, 3, 71, 10, 50, 3, 123, 2, 54, 14, 32, 10, 3, 1, 11, 3, 46, 10, 8, 0, 46, 9, 7, 2, 37, 13, 2, 9, 6, 1, 45, 0, 13, 2, 49, 13, 9, 3, 2, 11, 83, 11, 7, 0, 3, 0, 158, 11, 6, 9, 7, 3, 56, 1, 2, 6, 3, 1, 3, 2, 10, 0, 11, 1, 3, 6, 4, 4, 68, 8, 2, 0, 3, 0, 2, 3, 2, 4, 2, 0, 15, 1, 83, 17, 10, 9, 5, 0, 82, 19, 13, 9, 214, 6, 3, 8, 28, 1, 83, 16, 16, 9, 82, 12, 9, 9, 7, 19, 58, 14, 5, 9, 243, 14, 166, 9, 71, 5, 2, 1, 3, 3, 2, 0, 2, 1, 13, 9, 120, 6, 3, 6, 4, 0, 29, 9, 41, 6, 2, 3, 9, 0, 10, 10, 47, 15, 343, 9, 54, 7, 2, 7, 17, 9, 57, 21, 2, 13, 123, 5, 4, 0, 2, 1, 2, 6, 2, 0, 9, 9, 49, 4, 2, 1, 2, 4, 9, 9, 330, 3, 10, 1, 2, 0, 49, 6, 4, 4, 14, 10, 5350, 0, 7, 14, 11465, 27, 2343, 9, 87, 9, 39, 4, 60, 6, 26, 9, 535, 9, 470, 0, 2, 54, 8, 3, 82, 0, 12, 1, 19628, 1, 4178, 9, 519, 45, 3, 22, 543, 4, 4, 5, 9, 7, 3, 6, 31, 3, 149, 2, 1418, 49, 513, 54, 5, 49, 9, 0, 15, 0, 23, 4, 2, 14, 1361, 6, 2, 16, 3, 6, 2, 1, 2, 4, 101, 0, 161, 6, 10, 9, 357, 0, 62, 13, 499, 13, 245, 1, 2, 9, 726, 6, 110, 6, 6, 9, 4759, 9, 787719, 239], o = [0, 11, 2, 25, 2, 18, 2, 1, 2, 14, 3, 13, 35, 122, 70, 52, 268, 28, 4, 48, 48, 31, 14, 29, 6, 37, 11, 29, 3, 35, 5, 7, 2, 4, 43, 157, 19, 35, 5, 35, 5, 39, 9, 51, 13, 10, 2, 14, 2, 6, 2, 1, 2, 10, 2, 14, 2, 6, 2, 1, 4, 51, 13, 310, 10, 21, 11, 7, 25, 5, 2, 41, 2, 8, 70, 5, 3, 0, 2, 43, 2, 1, 4, 0, 3, 22, 11, 22, 10, 30, 66, 18, 2, 1, 11, 21, 11, 25, 71, 55, 7, 1, 65, 0, 16, 3, 2, 2, 2, 28, 43, 28, 4, 28, 36, 7, 2, 27, 28, 53, 11, 21, 11, 18, 14, 17, 111, 72, 56, 50, 14, 50, 14, 35, 39, 27, 10, 22, 251, 41, 7, 1, 17, 2, 60, 28, 11, 0, 9, 21, 43, 17, 47, 20, 28, 22, 13, 52, 58, 1, 3, 0, 14, 44, 33, 24, 27, 35, 30, 0, 3, 0, 9, 34, 4, 0, 13, 47, 15, 3, 22, 0, 2, 0, 36, 17, 2, 24, 20, 1, 64, 6, 2, 0, 2, 3, 2, 14, 2, 9, 8, 46, 39, 7, 3, 1, 3, 21, 2, 6, 2, 1, 2, 4, 4, 0, 19, 0, 13, 4, 31, 9, 2, 0, 3, 0, 2, 37, 2, 0, 26, 0, 2, 0, 45, 52, 19, 3, 21, 2, 31, 47, 21, 1, 2, 0, 185, 46, 42, 3, 37, 47, 21, 0, 60, 42, 14, 0, 72, 26, 38, 6, 186, 43, 117, 63, 32, 7, 3, 0, 3, 7, 2, 1, 2, 23, 16, 0, 2, 0, 95, 7, 3, 38, 17, 0, 2, 0, 29, 0, 11, 39, 8, 0, 22, 0, 12, 45, 20, 0, 19, 72, 200, 32, 32, 8, 2, 36, 18, 0, 50, 29, 113, 6, 2, 1, 2, 37, 22, 0, 26, 5, 2, 1, 2, 31, 15, 0, 328, 18, 16, 0, 2, 12, 2, 33, 125, 0, 80, 921, 103, 110, 18, 195, 2637, 96, 16, 1071, 18, 5, 26, 3994, 6, 582, 6842, 29, 1763, 568, 8, 30, 18, 78, 18, 29, 19, 47, 17, 3, 32, 20, 6, 18, 433, 44, 212, 63, 129, 74, 6, 0, 67, 12, 65, 1, 2, 0, 29, 6135, 9, 1237, 42, 9, 8936, 3, 2, 6, 2, 1, 2, 290, 16, 0, 30, 2, 3, 0, 15, 3, 9, 395, 2309, 106, 6, 12, 4, 8, 8, 9, 5991, 84, 2, 70, 2, 1, 3, 0, 3, 1, 3, 3, 2, 11, 2, 0, 2, 6, 2, 64, 2, 3, 3, 7, 2, 6, 2, 27, 2, 3, 2, 4, 2, 0, 4, 6, 2, 339, 3, 24, 2, 24, 2, 30, 2, 24, 2, 30, 2, 24, 2, 30, 2, 24, 2, 30, 2, 24, 2, 7, 1845, 30, 7, 5, 262, 61, 147, 44, 11, 6, 17, 0, 322, 29, 19, 43, 485, 27, 229, 29, 3, 0, 496, 6, 2, 3, 2, 1, 2, 14, 2, 196, 60, 67, 8, 0, 1205, 3, 2, 26, 2, 1, 2, 0, 3, 0, 2, 9, 2, 3, 2, 0, 2, 0, 7, 0, 5, 0, 2, 0, 2, 0, 2, 2, 2, 1, 2, 0, 3, 0, 2, 0, 2, 0, 2, 0, 2, 0, 2, 1, 2, 0, 3, 3, 2, 6, 2, 3, 2, 3, 2, 0, 2, 9, 2, 16, 6, 2, 2, 4, 2, 16, 4421, 42719, 33, 4153, 7, 221, 3, 5761, 15, 7472, 16, 621, 2467, 541, 1507, 4938, 6, 4191], h = "\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u05D0-\u05EA\u05EF-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u0870-\u0887\u0889-\u088E\u08A0-\u08C9\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C5D\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D04-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u1711\u171F-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1878\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4C\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C8A\u1C90-\u1CBA\u1CBD-\u1CBF\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5\u1CF6\u1CFA\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2118-\u211D\u2124\u2126\u2128\u212A-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309B-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u31A0-\u31BF\u31F0-\u31FF\u3400-\u4DBF\u4E00-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7CD\uA7D0\uA7D1\uA7D3\uA7D5-\uA7DC\uA7F2-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB69\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC", c = { 3: "abstract boolean byte char class double enum export extends final float goto implements import int interface long native package private protected public short static super synchronized throws transient volatile", 5: "class enum extends super const export import", 6: "enum", strict: "implements interface let package private protected public static yield", strictBind: "eval arguments" }, p = "break case catch continue debugger default do else finally for function if return switch throw try var while with null true false instanceof typeof void delete new in this", l = { 5: p, "5module": p + " export import", 6: p + " const class extends export import super" }, u = /^in(stanceof)?$/, d = RegExp("[" + h + "]"), f = RegExp("[" + h + "\u200C\u200D\xB7\u0300-\u036F\u0387\u0483-\u0487\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u0669\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u06F0-\u06F9\u0711\u0730-\u074A\u07A6-\u07B0\u07C0-\u07C9\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u0897-\u089F\u08CA-\u08E1\u08E3-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962\u0963\u0966-\u096F\u0981-\u0983\u09BC\u09BE-\u09C4\u09C7\u09C8\u09CB-\u09CD\u09D7\u09E2\u09E3\u09E6-\u09EF\u09FE\u0A01-\u0A03\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A66-\u0A71\u0A75\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AE2\u0AE3\u0AE6-\u0AEF\u0AFA-\u0AFF\u0B01-\u0B03\u0B3C\u0B3E-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B55-\u0B57\u0B62\u0B63\u0B66-\u0B6F\u0B82\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0BE6-\u0BEF\u0C00-\u0C04\u0C3C\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C66-\u0C6F\u0C81-\u0C83\u0CBC\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0CE6-\u0CEF\u0CF3\u0D00-\u0D03\u0D3B\u0D3C\u0D3E-\u0D44\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D62\u0D63\u0D66-\u0D6F\u0D81-\u0D83\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0E50-\u0E59\u0EB1\u0EB4-\u0EBC\u0EC8-\u0ECE\u0ED0-\u0ED9\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102B-\u103E\u1040-\u1049\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F-\u109D\u135D-\u135F\u1369-\u1371\u1712-\u1715\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4-\u17D3\u17DD\u17E0-\u17E9\u180B-\u180D\u180F-\u1819\u18A9\u1920-\u192B\u1930-\u193B\u1946-\u194F\u19D0-\u19DA\u1A17-\u1A1B\u1A55-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AB0-\u1ABD\u1ABF-\u1ACE\u1B00-\u1B04\u1B34-\u1B44\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1B82\u1BA1-\u1BAD\u1BB0-\u1BB9\u1BE6-\u1BF3\u1C24-\u1C37\u1C40-\u1C49\u1C50-\u1C59\u1CD0-\u1CD2\u1CD4-\u1CE8\u1CED\u1CF4\u1CF7-\u1CF9\u1DC0-\u1DFF\u200C\u200D\u203F\u2040\u2054\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\u30FB\uA620-\uA629\uA66F\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA823-\uA827\uA82C\uA880\uA881\uA8B4-\uA8C5\uA8D0-\uA8D9\uA8E0-\uA8F1\uA8FF-\uA909\uA926-\uA92D\uA947-\uA953\uA980-\uA983\uA9B3-\uA9C0\uA9D0-\uA9D9\uA9E5\uA9F0-\uA9F9\uAA29-\uAA36\uAA43\uAA4C\uAA4D\uAA50-\uAA59\uAA7B-\uAA7D\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEB-\uAAEF\uAAF5\uAAF6\uABE3-\uABEA\uABEC\uABED\uABF0-\uABF9\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F\uFE33\uFE34\uFE4D-\uFE4F\uFF10-\uFF19\uFF3F\uFF65]");
|
|
54
|
+
function isInAstralSet(e10, t3) {
|
|
55
|
+
for (var i2 = 65536, s2 = 0; s2 < t3.length && !((i2 += t3[s2]) > e10); s2 += 2) if ((i2 += t3[s2 + 1]) >= e10) return true;
|
|
56
|
+
return false;
|
|
57
|
+
}
|
|
58
|
+
__name(isInAstralSet, "isInAstralSet");
|
|
59
|
+
function isIdentifierStart(e10, t3) {
|
|
60
|
+
return e10 < 65 ? 36 === e10 : e10 < 91 || (e10 < 97 ? 95 === e10 : e10 < 123 || (e10 <= 65535 ? e10 >= 170 && d.test(String.fromCharCode(e10)) : false !== t3 && isInAstralSet(e10, o)));
|
|
61
|
+
}
|
|
62
|
+
__name(isIdentifierStart, "isIdentifierStart");
|
|
63
|
+
function isIdentifierChar(e10, t3) {
|
|
64
|
+
return e10 < 48 ? 36 === e10 : e10 < 58 || !(e10 < 65) && (e10 < 91 || (e10 < 97 ? 95 === e10 : e10 < 123 || (e10 <= 65535 ? e10 >= 170 && f.test(String.fromCharCode(e10)) : false !== t3 && (isInAstralSet(e10, o) || isInAstralSet(e10, a)))));
|
|
65
|
+
}
|
|
66
|
+
__name(isIdentifierChar, "isIdentifierChar");
|
|
67
|
+
var acorn_TokenType = /* @__PURE__ */ __name(function(e10, t3) {
|
|
68
|
+
void 0 === t3 && (t3 = {}), this.label = e10, this.keyword = t3.keyword, this.beforeExpr = !!t3.beforeExpr, this.startsExpr = !!t3.startsExpr, this.isLoop = !!t3.isLoop, this.isAssign = !!t3.isAssign, this.prefix = !!t3.prefix, this.postfix = !!t3.postfix, this.binop = t3.binop || null, this.updateContext = null;
|
|
69
|
+
}, "acorn_TokenType");
|
|
70
|
+
function binop(e10, t3) {
|
|
71
|
+
return new acorn_TokenType(e10, { beforeExpr: true, binop: t3 });
|
|
72
|
+
}
|
|
73
|
+
__name(binop, "binop");
|
|
74
|
+
var m = { beforeExpr: true }, g = { startsExpr: true }, _ = {};
|
|
75
|
+
function kw(e10, t3) {
|
|
76
|
+
return void 0 === t3 && (t3 = {}), t3.keyword = e10, _[e10] = new acorn_TokenType(e10, t3);
|
|
77
|
+
}
|
|
78
|
+
__name(kw, "kw");
|
|
79
|
+
var x = { num: new acorn_TokenType("num", g), regexp: new acorn_TokenType("regexp", g), string: new acorn_TokenType("string", g), name: new acorn_TokenType("name", g), privateId: new acorn_TokenType("privateId", g), eof: new acorn_TokenType("eof"), bracketL: new acorn_TokenType("[", { beforeExpr: true, startsExpr: true }), bracketR: new acorn_TokenType("]"), braceL: new acorn_TokenType("{", { beforeExpr: true, startsExpr: true }), braceR: new acorn_TokenType("}"), parenL: new acorn_TokenType("(", { beforeExpr: true, startsExpr: true }), parenR: new acorn_TokenType(")"), comma: new acorn_TokenType(",", m), semi: new acorn_TokenType(";", m), colon: new acorn_TokenType(":", m), dot: new acorn_TokenType("."), question: new acorn_TokenType("?", m), questionDot: new acorn_TokenType("?."), arrow: new acorn_TokenType("=>", m), template: new acorn_TokenType("template"), invalidTemplate: new acorn_TokenType("invalidTemplate"), ellipsis: new acorn_TokenType("...", m), backQuote: new acorn_TokenType("`", g), dollarBraceL: new acorn_TokenType("${", { beforeExpr: true, startsExpr: true }), eq: new acorn_TokenType("=", { beforeExpr: true, isAssign: true }), assign: new acorn_TokenType("_=", { beforeExpr: true, isAssign: true }), incDec: new acorn_TokenType("++/--", { prefix: true, postfix: true, startsExpr: true }), prefix: new acorn_TokenType("!/~", { beforeExpr: true, prefix: true, startsExpr: true }), logicalOR: binop("||", 1), logicalAND: binop("&&", 2), bitwiseOR: binop("|", 3), bitwiseXOR: binop("^", 4), bitwiseAND: binop("&", 5), equality: binop("==/!=/===/!==", 6), relational: binop("</>/<=/>=", 7), bitShift: binop("<</>>/>>>", 8), plusMin: new acorn_TokenType("+/-", { beforeExpr: true, binop: 9, prefix: true, startsExpr: true }), modulo: binop("%", 10), star: binop("*", 10), slash: binop("/", 10), starstar: new acorn_TokenType("**", { beforeExpr: true }), coalesce: binop("??", 1), _break: kw("break"), _case: kw("case", m), _catch: kw("catch"), _continue: kw("continue"), _debugger: kw("debugger"), _default: kw("default", m), _do: kw("do", { isLoop: true, beforeExpr: true }), _else: kw("else", m), _finally: kw("finally"), _for: kw("for", { isLoop: true }), _function: kw("function", g), _if: kw("if"), _return: kw("return", m), _switch: kw("switch"), _throw: kw("throw", m), _try: kw("try"), _var: kw("var"), _const: kw("const"), _while: kw("while", { isLoop: true }), _with: kw("with"), _new: kw("new", { beforeExpr: true, startsExpr: true }), _this: kw("this", g), _super: kw("super", g), _class: kw("class", g), _extends: kw("extends", m), _export: kw("export"), _import: kw("import", g), _null: kw("null", g), _true: kw("true", g), _false: kw("false", g), _in: kw("in", { beforeExpr: true, binop: 7 }), _instanceof: kw("instanceof", { beforeExpr: true, binop: 7 }), _typeof: kw("typeof", { beforeExpr: true, prefix: true, startsExpr: true }), _void: kw("void", { beforeExpr: true, prefix: true, startsExpr: true }), _delete: kw("delete", { beforeExpr: true, prefix: true, startsExpr: true }) }, v = /\r\n?|\n|\u2028|\u2029/, y = RegExp(v.source, "g");
|
|
80
|
+
function isNewLine(e10) {
|
|
81
|
+
return 10 === e10 || 13 === e10 || 8232 === e10 || 8233 === e10;
|
|
82
|
+
}
|
|
83
|
+
__name(isNewLine, "isNewLine");
|
|
84
|
+
function nextLineBreak(e10, t3, i2) {
|
|
85
|
+
void 0 === i2 && (i2 = e10.length);
|
|
86
|
+
for (var s2 = t3; s2 < i2; s2++) {
|
|
87
|
+
var r2 = e10.charCodeAt(s2);
|
|
88
|
+
if (isNewLine(r2)) return s2 < i2 - 1 && 13 === r2 && 10 === e10.charCodeAt(s2 + 1) ? s2 + 2 : s2 + 1;
|
|
89
|
+
}
|
|
90
|
+
return -1;
|
|
91
|
+
}
|
|
92
|
+
__name(nextLineBreak, "nextLineBreak");
|
|
93
|
+
var b = /[\u1680\u2000-\u200a\u202f\u205f\u3000\ufeff]/, E = /(?:\s|\/\/.*|\/\*[^]*?\*\/)*/g, k = Object.prototype, S = k.hasOwnProperty, C = k.toString, w = Object.hasOwn || function(e10, t3) {
|
|
94
|
+
return S.call(e10, t3);
|
|
95
|
+
}, T = Array.isArray || function(e10) {
|
|
96
|
+
return "[object Array]" === C.call(e10);
|
|
97
|
+
}, I = /* @__PURE__ */ Object.create(null);
|
|
98
|
+
function wordsRegexp(e10) {
|
|
99
|
+
return I[e10] || (I[e10] = RegExp("^(?:" + e10.replace(/ /g, "|") + ")$"));
|
|
100
|
+
}
|
|
101
|
+
__name(wordsRegexp, "wordsRegexp");
|
|
102
|
+
function codePointToString(e10) {
|
|
103
|
+
return e10 <= 65535 ? String.fromCharCode(e10) : String.fromCharCode(((e10 -= 65536) >> 10) + 55296, (1023 & e10) + 56320);
|
|
104
|
+
}
|
|
105
|
+
__name(codePointToString, "codePointToString");
|
|
106
|
+
var R = /(?:[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])/, acorn_Position = /* @__PURE__ */ __name(function(e10, t3) {
|
|
107
|
+
this.line = e10, this.column = t3;
|
|
108
|
+
}, "acorn_Position");
|
|
109
|
+
acorn_Position.prototype.offset = function(e10) {
|
|
110
|
+
return new acorn_Position(this.line, this.column + e10);
|
|
111
|
+
};
|
|
112
|
+
var acorn_SourceLocation = /* @__PURE__ */ __name(function(e10, t3, i2) {
|
|
113
|
+
this.start = t3, this.end = i2, null !== e10.sourceFile && (this.source = e10.sourceFile);
|
|
114
|
+
}, "acorn_SourceLocation");
|
|
115
|
+
function getLineInfo(e10, t3) {
|
|
116
|
+
for (var i2 = 1, s2 = 0; ; ) {
|
|
117
|
+
var r2 = nextLineBreak(e10, s2, t3);
|
|
118
|
+
if (r2 < 0) return new acorn_Position(i2, t3 - s2);
|
|
119
|
+
++i2, s2 = r2;
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
__name(getLineInfo, "getLineInfo");
|
|
123
|
+
var P = { ecmaVersion: null, sourceType: "script", onInsertedSemicolon: null, onTrailingComma: null, allowReserved: null, allowReturnOutsideFunction: false, allowImportExportEverywhere: false, allowAwaitOutsideFunction: null, allowSuperOutsideMethod: null, allowHashBang: false, checkPrivateFields: true, locations: false, onToken: null, onComment: null, ranges: false, program: null, sourceFile: null, directSourceFile: null, preserveParens: false }, A = false;
|
|
124
|
+
function getOptions(e10) {
|
|
125
|
+
var t3 = {};
|
|
126
|
+
for (var i2 in P) t3[i2] = e10 && w(e10, i2) ? e10[i2] : P[i2];
|
|
127
|
+
if ("latest" === t3.ecmaVersion ? t3.ecmaVersion = 1e8 : null == t3.ecmaVersion ? (!A && "object" == typeof console && console.warn && (A = true, console.warn("Since Acorn 8.0.0, options.ecmaVersion is required.\nDefaulting to 2020, but this will stop working in the future.")), t3.ecmaVersion = 11) : t3.ecmaVersion >= 2015 && (t3.ecmaVersion -= 2009), null == t3.allowReserved && (t3.allowReserved = t3.ecmaVersion < 5), e10 && null != e10.allowHashBang || (t3.allowHashBang = t3.ecmaVersion >= 14), T(t3.onToken)) {
|
|
128
|
+
var s2 = t3.onToken;
|
|
129
|
+
t3.onToken = function(e11) {
|
|
130
|
+
return s2.push(e11);
|
|
131
|
+
};
|
|
132
|
+
}
|
|
133
|
+
return T(t3.onComment) && (t3.onComment = pushComment(t3, t3.onComment)), t3;
|
|
134
|
+
}
|
|
135
|
+
__name(getOptions, "getOptions");
|
|
136
|
+
function pushComment(e10, t3) {
|
|
137
|
+
return function(i2, s2, r2, n2, a2, o2) {
|
|
138
|
+
var h2 = { type: i2 ? "Block" : "Line", value: s2, start: r2, end: n2 };
|
|
139
|
+
e10.locations && (h2.loc = new acorn_SourceLocation(this, a2, o2)), e10.ranges && (h2.range = [r2, n2]), t3.push(h2);
|
|
140
|
+
};
|
|
141
|
+
}
|
|
142
|
+
__name(pushComment, "pushComment");
|
|
143
|
+
function functionFlags(e10, t3) {
|
|
144
|
+
return 2 | 4 * !!e10 | 8 * !!t3;
|
|
145
|
+
}
|
|
146
|
+
__name(functionFlags, "functionFlags");
|
|
147
|
+
var acorn_Parser = /* @__PURE__ */ __name(function(e10, t3, i2) {
|
|
148
|
+
this.options = e10 = getOptions(e10), this.sourceFile = e10.sourceFile, this.keywords = wordsRegexp(l[e10.ecmaVersion >= 6 ? 6 : "module" === e10.sourceType ? "5module" : 5]);
|
|
149
|
+
var s2 = "";
|
|
150
|
+
true !== e10.allowReserved && (s2 = c[e10.ecmaVersion >= 6 ? 6 : 5 === e10.ecmaVersion ? 5 : 3], "module" === e10.sourceType && (s2 += " await")), this.reservedWords = wordsRegexp(s2);
|
|
151
|
+
var r2 = (s2 ? s2 + " " : "") + c.strict;
|
|
152
|
+
this.reservedWordsStrict = wordsRegexp(r2), this.reservedWordsStrictBind = wordsRegexp(r2 + " " + c.strictBind), this.input = String(t3), this.containsEsc = false, i2 ? (this.pos = i2, this.lineStart = this.input.lastIndexOf("\n", i2 - 1) + 1, this.curLine = this.input.slice(0, this.lineStart).split(v).length) : (this.pos = this.lineStart = 0, this.curLine = 1), this.type = x.eof, this.value = null, this.start = this.end = this.pos, this.startLoc = this.endLoc = this.curPosition(), this.lastTokEndLoc = this.lastTokStartLoc = null, this.lastTokStart = this.lastTokEnd = this.pos, this.context = this.initialContext(), this.exprAllowed = true, this.inModule = "module" === e10.sourceType, this.strict = this.inModule || this.strictDirective(this.pos), this.potentialArrowAt = -1, this.potentialArrowInForAwait = false, this.yieldPos = this.awaitPos = this.awaitIdentPos = 0, this.labels = [], this.undefinedExports = /* @__PURE__ */ Object.create(null), 0 === this.pos && e10.allowHashBang && "#!" === this.input.slice(0, 2) && this.skipLineComment(2), this.scopeStack = [], this.enterScope(1), this.regexpState = null, this.privateNameStack = [];
|
|
153
|
+
}, "acorn_Parser"), N = { inFunction: { configurable: true }, inGenerator: { configurable: true }, inAsync: { configurable: true }, canAwait: { configurable: true }, allowSuper: { configurable: true }, allowDirectSuper: { configurable: true }, treatFunctionsAsVar: { configurable: true }, allowNewDotTarget: { configurable: true }, inClassStaticBlock: { configurable: true } };
|
|
154
|
+
acorn_Parser.prototype.parse = function() {
|
|
155
|
+
var e10 = this.options.program || this.startNode();
|
|
156
|
+
return this.nextToken(), this.parseTopLevel(e10);
|
|
157
|
+
}, N.inFunction.get = function() {
|
|
158
|
+
return (2 & this.currentVarScope().flags) > 0;
|
|
159
|
+
}, N.inGenerator.get = function() {
|
|
160
|
+
return (8 & this.currentVarScope().flags) > 0;
|
|
161
|
+
}, N.inAsync.get = function() {
|
|
162
|
+
return (4 & this.currentVarScope().flags) > 0;
|
|
163
|
+
}, N.canAwait.get = function() {
|
|
164
|
+
for (var e10 = this.scopeStack.length - 1; e10 >= 0; e10--) {
|
|
165
|
+
var t3 = this.scopeStack[e10].flags;
|
|
166
|
+
if (768 & t3) return false;
|
|
167
|
+
if (2 & t3) return (4 & t3) > 0;
|
|
168
|
+
}
|
|
169
|
+
return this.inModule && this.options.ecmaVersion >= 13 || this.options.allowAwaitOutsideFunction;
|
|
170
|
+
}, N.allowSuper.get = function() {
|
|
171
|
+
return (64 & this.currentThisScope().flags) > 0 || this.options.allowSuperOutsideMethod;
|
|
172
|
+
}, N.allowDirectSuper.get = function() {
|
|
173
|
+
return (128 & this.currentThisScope().flags) > 0;
|
|
174
|
+
}, N.treatFunctionsAsVar.get = function() {
|
|
175
|
+
return this.treatFunctionsAsVarInScope(this.currentScope());
|
|
176
|
+
}, N.allowNewDotTarget.get = function() {
|
|
177
|
+
for (var e10 = this.scopeStack.length - 1; e10 >= 0; e10--) {
|
|
178
|
+
var t3 = this.scopeStack[e10].flags;
|
|
179
|
+
if (768 & t3 || 2 & t3 && !(16 & t3)) return true;
|
|
180
|
+
}
|
|
181
|
+
return false;
|
|
182
|
+
}, N.inClassStaticBlock.get = function() {
|
|
183
|
+
return (256 & this.currentVarScope().flags) > 0;
|
|
184
|
+
}, acorn_Parser.extend = function() {
|
|
185
|
+
for (var e10 = [], t3 = arguments.length; t3--; ) e10[t3] = arguments[t3];
|
|
186
|
+
for (var i2 = this, s2 = 0; s2 < e10.length; s2++) i2 = e10[s2](i2);
|
|
187
|
+
return i2;
|
|
188
|
+
}, acorn_Parser.parse = function(e10, t3) {
|
|
189
|
+
return new this(t3, e10).parse();
|
|
190
|
+
}, acorn_Parser.parseExpressionAt = function(e10, t3, i2) {
|
|
191
|
+
var s2 = new this(i2, e10, t3);
|
|
192
|
+
return s2.nextToken(), s2.parseExpression();
|
|
193
|
+
}, acorn_Parser.tokenizer = function(e10, t3) {
|
|
194
|
+
return new this(t3, e10);
|
|
195
|
+
}, Object.defineProperties(acorn_Parser.prototype, N);
|
|
196
|
+
var L = acorn_Parser.prototype, D = /^(?:'((?:\\[^]|[^'\\])*?)'|"((?:\\[^]|[^"\\])*?)")/;
|
|
197
|
+
L.strictDirective = function(e10) {
|
|
198
|
+
if (this.options.ecmaVersion < 5) return false;
|
|
199
|
+
for (; ; ) {
|
|
200
|
+
E.lastIndex = e10, e10 += E.exec(this.input)[0].length;
|
|
201
|
+
var t3 = D.exec(this.input.slice(e10));
|
|
202
|
+
if (!t3) return false;
|
|
203
|
+
if ("use strict" === (t3[1] || t3[2])) {
|
|
204
|
+
E.lastIndex = e10 + t3[0].length;
|
|
205
|
+
var i2 = E.exec(this.input), s2 = i2.index + i2[0].length, r2 = this.input.charAt(s2);
|
|
206
|
+
return ";" === r2 || "}" === r2 || v.test(i2[0]) && !(/[(`.[+\-/*%<>=,?^&]/.test(r2) || "!" === r2 && "=" === this.input.charAt(s2 + 1));
|
|
207
|
+
}
|
|
208
|
+
E.lastIndex = e10 += t3[0].length, e10 += E.exec(this.input)[0].length, ";" === this.input[e10] && e10++;
|
|
209
|
+
}
|
|
210
|
+
}, L.eat = function(e10) {
|
|
211
|
+
return this.type === e10 && (this.next(), true);
|
|
212
|
+
}, L.isContextual = function(e10) {
|
|
213
|
+
return this.type === x.name && this.value === e10 && !this.containsEsc;
|
|
214
|
+
}, L.eatContextual = function(e10) {
|
|
215
|
+
return !!this.isContextual(e10) && (this.next(), true);
|
|
216
|
+
}, L.expectContextual = function(e10) {
|
|
217
|
+
this.eatContextual(e10) || this.unexpected();
|
|
218
|
+
}, L.canInsertSemicolon = function() {
|
|
219
|
+
return this.type === x.eof || this.type === x.braceR || v.test(this.input.slice(this.lastTokEnd, this.start));
|
|
220
|
+
}, L.insertSemicolon = function() {
|
|
221
|
+
if (this.canInsertSemicolon()) return this.options.onInsertedSemicolon && this.options.onInsertedSemicolon(this.lastTokEnd, this.lastTokEndLoc), true;
|
|
222
|
+
}, L.semicolon = function() {
|
|
223
|
+
this.eat(x.semi) || this.insertSemicolon() || this.unexpected();
|
|
224
|
+
}, L.afterTrailingComma = function(e10, t3) {
|
|
225
|
+
if (this.type === e10) return this.options.onTrailingComma && this.options.onTrailingComma(this.lastTokStart, this.lastTokStartLoc), t3 || this.next(), true;
|
|
226
|
+
}, L.expect = function(e10) {
|
|
227
|
+
this.eat(e10) || this.unexpected();
|
|
228
|
+
}, L.unexpected = function(e10) {
|
|
229
|
+
this.raise(null != e10 ? e10 : this.start, "Unexpected token");
|
|
230
|
+
};
|
|
231
|
+
var acorn_DestructuringErrors = /* @__PURE__ */ __name(function() {
|
|
232
|
+
this.shorthandAssign = this.trailingComma = this.parenthesizedAssign = this.parenthesizedBind = this.doubleProto = -1;
|
|
233
|
+
}, "acorn_DestructuringErrors");
|
|
234
|
+
L.checkPatternErrors = function(e10, t3) {
|
|
235
|
+
if (e10) {
|
|
236
|
+
e10.trailingComma > -1 && this.raiseRecoverable(e10.trailingComma, "Comma is not permitted after the rest element");
|
|
237
|
+
var i2 = t3 ? e10.parenthesizedAssign : e10.parenthesizedBind;
|
|
238
|
+
i2 > -1 && this.raiseRecoverable(i2, t3 ? "Assigning to rvalue" : "Parenthesized pattern");
|
|
239
|
+
}
|
|
240
|
+
}, L.checkExpressionErrors = function(e10, t3) {
|
|
241
|
+
if (!e10) return false;
|
|
242
|
+
var i2 = e10.shorthandAssign, s2 = e10.doubleProto;
|
|
243
|
+
if (!t3) return i2 >= 0 || s2 >= 0;
|
|
244
|
+
i2 >= 0 && this.raise(i2, "Shorthand property assignments are valid only in destructuring patterns"), s2 >= 0 && this.raiseRecoverable(s2, "Redefinition of __proto__ property");
|
|
245
|
+
}, L.checkYieldAwaitInDefaultParams = function() {
|
|
246
|
+
this.yieldPos && (!this.awaitPos || this.yieldPos < this.awaitPos) && this.raise(this.yieldPos, "Yield expression cannot be a default value"), this.awaitPos && this.raise(this.awaitPos, "Await expression cannot be a default value");
|
|
247
|
+
}, L.isSimpleAssignTarget = function(e10) {
|
|
248
|
+
return "ParenthesizedExpression" === e10.type ? this.isSimpleAssignTarget(e10.expression) : "Identifier" === e10.type || "MemberExpression" === e10.type;
|
|
249
|
+
};
|
|
250
|
+
var O = acorn_Parser.prototype;
|
|
251
|
+
O.parseTopLevel = function(e10) {
|
|
252
|
+
var t3 = /* @__PURE__ */ Object.create(null);
|
|
253
|
+
for (e10.body || (e10.body = []); this.type !== x.eof; ) {
|
|
254
|
+
var i2 = this.parseStatement(null, true, t3);
|
|
255
|
+
e10.body.push(i2);
|
|
256
|
+
}
|
|
257
|
+
if (this.inModule) for (var s2 = 0, r2 = Object.keys(this.undefinedExports); s2 < r2.length; s2 += 1) {
|
|
258
|
+
var n2 = r2[s2];
|
|
259
|
+
this.raiseRecoverable(this.undefinedExports[n2].start, "Export '" + n2 + "' is not defined");
|
|
260
|
+
}
|
|
261
|
+
return this.adaptDirectivePrologue(e10.body), this.next(), e10.sourceType = this.options.sourceType, this.finishNode(e10, "Program");
|
|
262
|
+
};
|
|
263
|
+
var V = { kind: "loop" }, U = { kind: "switch" };
|
|
264
|
+
O.isLet = function(e10) {
|
|
265
|
+
if (this.options.ecmaVersion < 6 || !this.isContextual("let")) return false;
|
|
266
|
+
E.lastIndex = this.pos;
|
|
267
|
+
var t3 = E.exec(this.input), i2 = this.pos + t3[0].length, s2 = this.input.charCodeAt(i2);
|
|
268
|
+
if (91 === s2 || 92 === s2) return true;
|
|
269
|
+
if (e10) return false;
|
|
270
|
+
if (123 === s2 || s2 > 55295 && s2 < 56320) return true;
|
|
271
|
+
if (isIdentifierStart(s2, true)) {
|
|
272
|
+
for (var r2 = i2 + 1; isIdentifierChar(s2 = this.input.charCodeAt(r2), true); ) ++r2;
|
|
273
|
+
if (92 === s2 || s2 > 55295 && s2 < 56320) return true;
|
|
274
|
+
var n2 = this.input.slice(i2, r2);
|
|
275
|
+
if (!u.test(n2)) return true;
|
|
276
|
+
}
|
|
277
|
+
return false;
|
|
278
|
+
}, O.isAsyncFunction = function() {
|
|
279
|
+
if (this.options.ecmaVersion < 8 || !this.isContextual("async")) return false;
|
|
280
|
+
E.lastIndex = this.pos;
|
|
281
|
+
var e10, t3 = E.exec(this.input), i2 = this.pos + t3[0].length;
|
|
282
|
+
return !v.test(this.input.slice(this.pos, i2)) && "function" === this.input.slice(i2, i2 + 8) && (i2 + 8 === this.input.length || !(isIdentifierChar(e10 = this.input.charCodeAt(i2 + 8)) || e10 > 55295 && e10 < 56320));
|
|
283
|
+
}, O.isUsingKeyword = function(e10, t3) {
|
|
284
|
+
if (this.options.ecmaVersion < 17 || !this.isContextual(e10 ? "await" : "using")) return false;
|
|
285
|
+
E.lastIndex = this.pos;
|
|
286
|
+
var i2 = E.exec(this.input), s2 = this.pos + i2[0].length;
|
|
287
|
+
if (v.test(this.input.slice(this.pos, s2))) return false;
|
|
288
|
+
if (e10) {
|
|
289
|
+
var r2, n2 = s2 + 5;
|
|
290
|
+
if ("using" !== this.input.slice(s2, n2) || n2 === this.input.length || isIdentifierChar(r2 = this.input.charCodeAt(n2)) || r2 > 55295 && r2 < 56320) return false;
|
|
291
|
+
E.lastIndex = n2;
|
|
292
|
+
var a2 = E.exec(this.input);
|
|
293
|
+
if (a2 && v.test(this.input.slice(n2, n2 + a2[0].length))) return false;
|
|
294
|
+
}
|
|
295
|
+
if (t3) {
|
|
296
|
+
var o2, h2 = s2 + 2;
|
|
297
|
+
if ("of" === this.input.slice(s2, h2) && (h2 === this.input.length || !isIdentifierChar(o2 = this.input.charCodeAt(h2)) && !(o2 > 55295 && o2 < 56320))) return false;
|
|
298
|
+
}
|
|
299
|
+
var c2 = this.input.charCodeAt(s2);
|
|
300
|
+
return isIdentifierStart(c2, true) || 92 === c2;
|
|
301
|
+
}, O.isAwaitUsing = function(e10) {
|
|
302
|
+
return this.isUsingKeyword(true, e10);
|
|
303
|
+
}, O.isUsing = function(e10) {
|
|
304
|
+
return this.isUsingKeyword(false, e10);
|
|
305
|
+
}, O.parseStatement = function(e10, t3, i2) {
|
|
306
|
+
var s2, r2 = this.type, n2 = this.startNode();
|
|
307
|
+
switch (this.isLet(e10) && (r2 = x._var, s2 = "let"), r2) {
|
|
308
|
+
case x._break:
|
|
309
|
+
case x._continue:
|
|
310
|
+
return this.parseBreakContinueStatement(n2, r2.keyword);
|
|
311
|
+
case x._debugger:
|
|
312
|
+
return this.parseDebuggerStatement(n2);
|
|
313
|
+
case x._do:
|
|
314
|
+
return this.parseDoStatement(n2);
|
|
315
|
+
case x._for:
|
|
316
|
+
return this.parseForStatement(n2);
|
|
317
|
+
case x._function:
|
|
318
|
+
return e10 && (this.strict || "if" !== e10 && "label" !== e10) && this.options.ecmaVersion >= 6 && this.unexpected(), this.parseFunctionStatement(n2, false, !e10);
|
|
319
|
+
case x._class:
|
|
320
|
+
return e10 && this.unexpected(), this.parseClass(n2, true);
|
|
321
|
+
case x._if:
|
|
322
|
+
return this.parseIfStatement(n2);
|
|
323
|
+
case x._return:
|
|
324
|
+
return this.parseReturnStatement(n2);
|
|
325
|
+
case x._switch:
|
|
326
|
+
return this.parseSwitchStatement(n2);
|
|
327
|
+
case x._throw:
|
|
328
|
+
return this.parseThrowStatement(n2);
|
|
329
|
+
case x._try:
|
|
330
|
+
return this.parseTryStatement(n2);
|
|
331
|
+
case x._const:
|
|
332
|
+
case x._var:
|
|
333
|
+
return s2 = s2 || this.value, e10 && "var" !== s2 && this.unexpected(), this.parseVarStatement(n2, s2);
|
|
334
|
+
case x._while:
|
|
335
|
+
return this.parseWhileStatement(n2);
|
|
336
|
+
case x._with:
|
|
337
|
+
return this.parseWithStatement(n2);
|
|
338
|
+
case x.braceL:
|
|
339
|
+
return this.parseBlock(true, n2);
|
|
340
|
+
case x.semi:
|
|
341
|
+
return this.parseEmptyStatement(n2);
|
|
342
|
+
case x._export:
|
|
343
|
+
case x._import:
|
|
344
|
+
if (this.options.ecmaVersion > 10 && r2 === x._import) {
|
|
345
|
+
E.lastIndex = this.pos;
|
|
346
|
+
var a2 = E.exec(this.input), o2 = this.pos + a2[0].length, h2 = this.input.charCodeAt(o2);
|
|
347
|
+
if (40 === h2 || 46 === h2) return this.parseExpressionStatement(n2, this.parseExpression());
|
|
348
|
+
}
|
|
349
|
+
return !this.options.allowImportExportEverywhere && (t3 || this.raise(this.start, "'import' and 'export' may only appear at the top level"), this.inModule || this.raise(this.start, "'import' and 'export' may appear only with 'sourceType: module'")), r2 === x._import ? this.parseImport(n2) : this.parseExport(n2, i2);
|
|
350
|
+
default:
|
|
351
|
+
if (this.isAsyncFunction()) return e10 && this.unexpected(), this.next(), this.parseFunctionStatement(n2, true, !e10);
|
|
352
|
+
var c2 = this.isAwaitUsing(false) ? "await using" : this.isUsing(false) ? "using" : null;
|
|
353
|
+
if (c2) return t3 && "script" === this.options.sourceType && this.raise(this.start, "Using declaration cannot appear in the top level when source type is `script`"), "await using" === c2 && (this.canAwait || this.raise(this.start, "Await using cannot appear outside of async function"), this.next()), this.next(), this.parseVar(n2, false, c2), this.semicolon(), this.finishNode(n2, "VariableDeclaration");
|
|
354
|
+
var p2 = this.value, l2 = this.parseExpression();
|
|
355
|
+
if (r2 === x.name && "Identifier" === l2.type && this.eat(x.colon)) return this.parseLabeledStatement(n2, p2, l2, e10);
|
|
356
|
+
return this.parseExpressionStatement(n2, l2);
|
|
357
|
+
}
|
|
358
|
+
}, O.parseBreakContinueStatement = function(e10, t3) {
|
|
359
|
+
var i2 = "break" === t3;
|
|
360
|
+
this.next(), this.eat(x.semi) || this.insertSemicolon() ? e10.label = null : this.type !== x.name ? this.unexpected() : (e10.label = this.parseIdent(), this.semicolon());
|
|
361
|
+
for (var s2 = 0; s2 < this.labels.length; ++s2) {
|
|
362
|
+
var r2 = this.labels[s2];
|
|
363
|
+
if ((null == e10.label || r2.name === e10.label.name) && (null != r2.kind && (i2 || "loop" === r2.kind) || e10.label && i2)) break;
|
|
364
|
+
}
|
|
365
|
+
return s2 === this.labels.length && this.raise(e10.start, "Unsyntactic " + t3), this.finishNode(e10, i2 ? "BreakStatement" : "ContinueStatement");
|
|
366
|
+
}, O.parseDebuggerStatement = function(e10) {
|
|
367
|
+
return this.next(), this.semicolon(), this.finishNode(e10, "DebuggerStatement");
|
|
368
|
+
}, O.parseDoStatement = function(e10) {
|
|
369
|
+
return this.next(), this.labels.push(V), e10.body = this.parseStatement("do"), this.labels.pop(), this.expect(x._while), e10.test = this.parseParenExpression(), this.options.ecmaVersion >= 6 ? this.eat(x.semi) : this.semicolon(), this.finishNode(e10, "DoWhileStatement");
|
|
370
|
+
}, O.parseForStatement = function(e10) {
|
|
371
|
+
this.next();
|
|
372
|
+
var t3 = this.options.ecmaVersion >= 9 && this.canAwait && this.eatContextual("await") ? this.lastTokStart : -1;
|
|
373
|
+
if (this.labels.push(V), this.enterScope(0), this.expect(x.parenL), this.type === x.semi) return t3 > -1 && this.unexpected(t3), this.parseFor(e10, null);
|
|
374
|
+
var i2 = this.isLet();
|
|
375
|
+
if (this.type === x._var || this.type === x._const || i2) {
|
|
376
|
+
var s2 = this.startNode(), r2 = i2 ? "let" : this.value;
|
|
377
|
+
return this.next(), this.parseVar(s2, true, r2), this.finishNode(s2, "VariableDeclaration"), this.parseForAfterInit(e10, s2, t3);
|
|
378
|
+
}
|
|
379
|
+
var n2 = this.isContextual("let"), a2 = false, o2 = this.isUsing(true) ? "using" : this.isAwaitUsing(true) ? "await using" : null;
|
|
380
|
+
if (o2) {
|
|
381
|
+
var h2 = this.startNode();
|
|
382
|
+
return this.next(), "await using" === o2 && this.next(), this.parseVar(h2, true, o2), this.finishNode(h2, "VariableDeclaration"), this.parseForAfterInit(e10, h2, t3);
|
|
383
|
+
}
|
|
384
|
+
var c2 = this.containsEsc, p2 = new acorn_DestructuringErrors(), l2 = this.start, u2 = t3 > -1 ? this.parseExprSubscripts(p2, "await") : this.parseExpression(true, p2);
|
|
385
|
+
return this.type === x._in || (a2 = this.options.ecmaVersion >= 6 && this.isContextual("of")) ? (t3 > -1 ? (this.type === x._in && this.unexpected(t3), e10.await = true) : a2 && this.options.ecmaVersion >= 8 && (u2.start !== l2 || c2 || "Identifier" !== u2.type || "async" !== u2.name ? this.options.ecmaVersion >= 9 && (e10.await = false) : this.unexpected()), n2 && a2 && this.raise(u2.start, "The left-hand side of a for-of loop may not start with 'let'."), this.toAssignable(u2, false, p2), this.checkLValPattern(u2), this.parseForIn(e10, u2)) : (this.checkExpressionErrors(p2, true), t3 > -1 && this.unexpected(t3), this.parseFor(e10, u2));
|
|
386
|
+
}, O.parseForAfterInit = function(e10, t3, i2) {
|
|
387
|
+
return (this.type === x._in || this.options.ecmaVersion >= 6 && this.isContextual("of")) && 1 === t3.declarations.length ? (this.options.ecmaVersion >= 9 && (this.type === x._in ? i2 > -1 && this.unexpected(i2) : e10.await = i2 > -1), this.parseForIn(e10, t3)) : (i2 > -1 && this.unexpected(i2), this.parseFor(e10, t3));
|
|
388
|
+
}, O.parseFunctionStatement = function(e10, t3, i2) {
|
|
389
|
+
return this.next(), this.parseFunction(e10, j | (i2 ? 0 : B), false, t3);
|
|
390
|
+
}, O.parseIfStatement = function(e10) {
|
|
391
|
+
return this.next(), e10.test = this.parseParenExpression(), e10.consequent = this.parseStatement("if"), e10.alternate = this.eat(x._else) ? this.parseStatement("if") : null, this.finishNode(e10, "IfStatement");
|
|
392
|
+
}, O.parseReturnStatement = function(e10) {
|
|
393
|
+
return this.inFunction || this.options.allowReturnOutsideFunction || this.raise(this.start, "'return' outside of function"), this.next(), this.eat(x.semi) || this.insertSemicolon() ? e10.argument = null : (e10.argument = this.parseExpression(), this.semicolon()), this.finishNode(e10, "ReturnStatement");
|
|
394
|
+
}, O.parseSwitchStatement = function(e10) {
|
|
395
|
+
this.next(), e10.discriminant = this.parseParenExpression(), e10.cases = [], this.expect(x.braceL), this.labels.push(U), this.enterScope(0);
|
|
396
|
+
for (var t3, i2 = false; this.type !== x.braceR; ) if (this.type === x._case || this.type === x._default) {
|
|
397
|
+
var s2 = this.type === x._case;
|
|
398
|
+
t3 && this.finishNode(t3, "SwitchCase"), e10.cases.push(t3 = this.startNode()), t3.consequent = [], this.next(), s2 ? t3.test = this.parseExpression() : (i2 && this.raiseRecoverable(this.lastTokStart, "Multiple default clauses"), i2 = true, t3.test = null), this.expect(x.colon);
|
|
399
|
+
} else t3 || this.unexpected(), t3.consequent.push(this.parseStatement(null));
|
|
400
|
+
return this.exitScope(), t3 && this.finishNode(t3, "SwitchCase"), this.next(), this.labels.pop(), this.finishNode(e10, "SwitchStatement");
|
|
401
|
+
}, O.parseThrowStatement = function(e10) {
|
|
402
|
+
return this.next(), v.test(this.input.slice(this.lastTokEnd, this.start)) && this.raise(this.lastTokEnd, "Illegal newline after throw"), e10.argument = this.parseExpression(), this.semicolon(), this.finishNode(e10, "ThrowStatement");
|
|
403
|
+
};
|
|
404
|
+
var M = [];
|
|
405
|
+
O.parseCatchClauseParam = function() {
|
|
406
|
+
var e10 = this.parseBindingAtom(), t3 = "Identifier" === e10.type;
|
|
407
|
+
return this.enterScope(32 * !!t3), this.checkLValPattern(e10, t3 ? 4 : 2), this.expect(x.parenR), e10;
|
|
408
|
+
}, O.parseTryStatement = function(e10) {
|
|
409
|
+
if (this.next(), e10.block = this.parseBlock(), e10.handler = null, this.type === x._catch) {
|
|
410
|
+
var t3 = this.startNode();
|
|
411
|
+
this.next(), this.eat(x.parenL) ? t3.param = this.parseCatchClauseParam() : (this.options.ecmaVersion < 10 && this.unexpected(), t3.param = null, this.enterScope(0)), t3.body = this.parseBlock(false), this.exitScope(), e10.handler = this.finishNode(t3, "CatchClause");
|
|
412
|
+
}
|
|
413
|
+
return e10.finalizer = this.eat(x._finally) ? this.parseBlock() : null, e10.handler || e10.finalizer || this.raise(e10.start, "Missing catch or finally clause"), this.finishNode(e10, "TryStatement");
|
|
414
|
+
}, O.parseVarStatement = function(e10, t3, i2) {
|
|
415
|
+
return this.next(), this.parseVar(e10, false, t3, i2), this.semicolon(), this.finishNode(e10, "VariableDeclaration");
|
|
416
|
+
}, O.parseWhileStatement = function(e10) {
|
|
417
|
+
return this.next(), e10.test = this.parseParenExpression(), this.labels.push(V), e10.body = this.parseStatement("while"), this.labels.pop(), this.finishNode(e10, "WhileStatement");
|
|
418
|
+
}, O.parseWithStatement = function(e10) {
|
|
419
|
+
return this.strict && this.raise(this.start, "'with' in strict mode"), this.next(), e10.object = this.parseParenExpression(), e10.body = this.parseStatement("with"), this.finishNode(e10, "WithStatement");
|
|
420
|
+
}, O.parseEmptyStatement = function(e10) {
|
|
421
|
+
return this.next(), this.finishNode(e10, "EmptyStatement");
|
|
422
|
+
}, O.parseLabeledStatement = function(e10, t3, i2, s2) {
|
|
423
|
+
for (var r2 = 0, n2 = this.labels; r2 < n2.length; r2 += 1) n2[r2].name === t3 && this.raise(i2.start, "Label '" + t3 + "' is already declared");
|
|
424
|
+
for (var a2 = this.type.isLoop ? "loop" : this.type === x._switch ? "switch" : null, o2 = this.labels.length - 1; o2 >= 0; o2--) {
|
|
425
|
+
var h2 = this.labels[o2];
|
|
426
|
+
if (h2.statementStart === e10.start) h2.statementStart = this.start, h2.kind = a2;
|
|
427
|
+
else break;
|
|
428
|
+
}
|
|
429
|
+
return this.labels.push({ name: t3, kind: a2, statementStart: this.start }), e10.body = this.parseStatement(s2 ? -1 === s2.indexOf("label") ? s2 + "label" : s2 : "label"), this.labels.pop(), e10.label = i2, this.finishNode(e10, "LabeledStatement");
|
|
430
|
+
}, O.parseExpressionStatement = function(e10, t3) {
|
|
431
|
+
return e10.expression = t3, this.semicolon(), this.finishNode(e10, "ExpressionStatement");
|
|
432
|
+
}, O.parseBlock = function(e10, t3, i2) {
|
|
433
|
+
for (void 0 === e10 && (e10 = true), void 0 === t3 && (t3 = this.startNode()), t3.body = [], this.expect(x.braceL), e10 && this.enterScope(0); this.type !== x.braceR; ) {
|
|
434
|
+
var s2 = this.parseStatement(null);
|
|
435
|
+
t3.body.push(s2);
|
|
436
|
+
}
|
|
437
|
+
return i2 && (this.strict = false), this.next(), e10 && this.exitScope(), this.finishNode(t3, "BlockStatement");
|
|
438
|
+
}, O.parseFor = function(e10, t3) {
|
|
439
|
+
return e10.init = t3, this.expect(x.semi), e10.test = this.type === x.semi ? null : this.parseExpression(), this.expect(x.semi), e10.update = this.type === x.parenR ? null : this.parseExpression(), this.expect(x.parenR), e10.body = this.parseStatement("for"), this.exitScope(), this.labels.pop(), this.finishNode(e10, "ForStatement");
|
|
440
|
+
}, O.parseForIn = function(e10, t3) {
|
|
441
|
+
var i2 = this.type === x._in;
|
|
442
|
+
return this.next(), "VariableDeclaration" === t3.type && null != t3.declarations[0].init && (!i2 || this.options.ecmaVersion < 8 || this.strict || "var" !== t3.kind || "Identifier" !== t3.declarations[0].id.type) && this.raise(t3.start, (i2 ? "for-in" : "for-of") + " loop variable declaration may not have an initializer"), e10.left = t3, e10.right = i2 ? this.parseExpression() : this.parseMaybeAssign(), this.expect(x.parenR), e10.body = this.parseStatement("for"), this.exitScope(), this.labels.pop(), this.finishNode(e10, i2 ? "ForInStatement" : "ForOfStatement");
|
|
443
|
+
}, O.parseVar = function(e10, t3, i2, s2) {
|
|
444
|
+
for (e10.declarations = [], e10.kind = i2; ; ) {
|
|
445
|
+
var r2 = this.startNode();
|
|
446
|
+
if (this.parseVarId(r2, i2), this.eat(x.eq) ? r2.init = this.parseMaybeAssign(t3) : s2 || "const" !== i2 || this.type === x._in || this.options.ecmaVersion >= 6 && this.isContextual("of") ? s2 || "using" !== i2 && "await using" !== i2 || !(this.options.ecmaVersion >= 17) || this.type === x._in || this.isContextual("of") ? s2 || "Identifier" === r2.id.type || t3 && (this.type === x._in || this.isContextual("of")) ? r2.init = null : this.raise(this.lastTokEnd, "Complex binding patterns require an initialization value") : this.raise(this.lastTokEnd, "Missing initializer in " + i2 + " declaration") : this.unexpected(), e10.declarations.push(this.finishNode(r2, "VariableDeclarator")), !this.eat(x.comma)) break;
|
|
447
|
+
}
|
|
448
|
+
return e10;
|
|
449
|
+
}, O.parseVarId = function(e10, t3) {
|
|
450
|
+
e10.id = "using" === t3 || "await using" === t3 ? this.parseIdent() : this.parseBindingAtom(), this.checkLValPattern(e10.id, "var" === t3 ? 1 : 2, false);
|
|
451
|
+
};
|
|
452
|
+
var j = 1, B = 2;
|
|
453
|
+
function isPrivateNameConflicted(e10, t3) {
|
|
454
|
+
var i2 = t3.key.name, s2 = e10[i2], r2 = "true";
|
|
455
|
+
return ("MethodDefinition" === t3.type && ("get" === t3.kind || "set" === t3.kind) && (r2 = (t3.static ? "s" : "i") + t3.kind), "iget" === s2 && "iset" === r2 || "iset" === s2 && "iget" === r2 || "sget" === s2 && "sset" === r2 || "sset" === s2 && "sget" === r2) ? (e10[i2] = "true", false) : !!s2 || (e10[i2] = r2, false);
|
|
456
|
+
}
|
|
457
|
+
__name(isPrivateNameConflicted, "isPrivateNameConflicted");
|
|
458
|
+
function checkKeyName(e10, t3) {
|
|
459
|
+
var i2 = e10.computed, s2 = e10.key;
|
|
460
|
+
return !i2 && ("Identifier" === s2.type && s2.name === t3 || "Literal" === s2.type && s2.value === t3);
|
|
461
|
+
}
|
|
462
|
+
__name(checkKeyName, "checkKeyName");
|
|
463
|
+
O.parseFunction = function(e10, t3, i2, s2, r2) {
|
|
464
|
+
this.initFunction(e10), (this.options.ecmaVersion >= 9 || this.options.ecmaVersion >= 6 && !s2) && (this.type === x.star && t3 & B && this.unexpected(), e10.generator = this.eat(x.star)), this.options.ecmaVersion >= 8 && (e10.async = !!s2), t3 & j && (e10.id = 4 & t3 && this.type !== x.name ? null : this.parseIdent(), e10.id && !(t3 & B) && this.checkLValSimple(e10.id, this.strict || e10.generator || e10.async ? this.treatFunctionsAsVar ? 1 : 2 : 3));
|
|
465
|
+
var n2 = this.yieldPos, a2 = this.awaitPos, o2 = this.awaitIdentPos;
|
|
466
|
+
return this.yieldPos = 0, this.awaitPos = 0, this.awaitIdentPos = 0, this.enterScope(functionFlags(e10.async, e10.generator)), t3 & j || (e10.id = this.type === x.name ? this.parseIdent() : null), this.parseFunctionParams(e10), this.parseFunctionBody(e10, i2, false, r2), this.yieldPos = n2, this.awaitPos = a2, this.awaitIdentPos = o2, this.finishNode(e10, t3 & j ? "FunctionDeclaration" : "FunctionExpression");
|
|
467
|
+
}, O.parseFunctionParams = function(e10) {
|
|
468
|
+
this.expect(x.parenL), e10.params = this.parseBindingList(x.parenR, false, this.options.ecmaVersion >= 8), this.checkYieldAwaitInDefaultParams();
|
|
469
|
+
}, O.parseClass = function(e10, t3) {
|
|
470
|
+
this.next();
|
|
471
|
+
var i2 = this.strict;
|
|
472
|
+
this.strict = true, this.parseClassId(e10, t3), this.parseClassSuper(e10);
|
|
473
|
+
var s2 = this.enterClassBody(), r2 = this.startNode(), n2 = false;
|
|
474
|
+
for (r2.body = [], this.expect(x.braceL); this.type !== x.braceR; ) {
|
|
475
|
+
var a2 = this.parseClassElement(null !== e10.superClass);
|
|
476
|
+
a2 && (r2.body.push(a2), "MethodDefinition" === a2.type && "constructor" === a2.kind ? (n2 && this.raiseRecoverable(a2.start, "Duplicate constructor in the same class"), n2 = true) : a2.key && "PrivateIdentifier" === a2.key.type && isPrivateNameConflicted(s2, a2) && this.raiseRecoverable(a2.key.start, "Identifier '#" + a2.key.name + "' has already been declared"));
|
|
477
|
+
}
|
|
478
|
+
return this.strict = i2, this.next(), e10.body = this.finishNode(r2, "ClassBody"), this.exitClassBody(), this.finishNode(e10, t3 ? "ClassDeclaration" : "ClassExpression");
|
|
479
|
+
}, O.parseClassElement = function(e10) {
|
|
480
|
+
if (this.eat(x.semi)) return null;
|
|
481
|
+
var t3 = this.options.ecmaVersion, i2 = this.startNode(), s2 = "", r2 = false, n2 = false, a2 = "method", o2 = false;
|
|
482
|
+
if (this.eatContextual("static")) {
|
|
483
|
+
if (t3 >= 13 && this.eat(x.braceL)) return this.parseClassStaticBlock(i2), i2;
|
|
484
|
+
this.isClassElementNameStart() || this.type === x.star ? o2 = true : s2 = "static";
|
|
485
|
+
}
|
|
486
|
+
if (i2.static = o2, !s2 && t3 >= 8 && this.eatContextual("async") && ((this.isClassElementNameStart() || this.type === x.star) && !this.canInsertSemicolon() ? n2 = true : s2 = "async"), !s2 && (t3 >= 9 || !n2) && this.eat(x.star) && (r2 = true), !s2 && !n2 && !r2) {
|
|
487
|
+
var h2 = this.value;
|
|
488
|
+
(this.eatContextual("get") || this.eatContextual("set")) && (this.isClassElementNameStart() ? a2 = h2 : s2 = h2);
|
|
489
|
+
}
|
|
490
|
+
if (s2 ? (i2.computed = false, i2.key = this.startNodeAt(this.lastTokStart, this.lastTokStartLoc), i2.key.name = s2, this.finishNode(i2.key, "Identifier")) : this.parseClassElementName(i2), t3 < 13 || this.type === x.parenL || "method" !== a2 || r2 || n2) {
|
|
491
|
+
var c2 = !i2.static && checkKeyName(i2, "constructor");
|
|
492
|
+
c2 && "method" !== a2 && this.raise(i2.key.start, "Constructor can't have get/set modifier"), i2.kind = c2 ? "constructor" : a2, this.parseClassMethod(i2, r2, n2, c2 && e10);
|
|
493
|
+
} else this.parseClassField(i2);
|
|
494
|
+
return i2;
|
|
495
|
+
}, O.isClassElementNameStart = function() {
|
|
496
|
+
return this.type === x.name || this.type === x.privateId || this.type === x.num || this.type === x.string || this.type === x.bracketL || this.type.keyword;
|
|
497
|
+
}, O.parseClassElementName = function(e10) {
|
|
498
|
+
this.type === x.privateId ? ("constructor" === this.value && this.raise(this.start, "Classes can't have an element named '#constructor'"), e10.computed = false, e10.key = this.parsePrivateIdent()) : this.parsePropertyName(e10);
|
|
499
|
+
}, O.parseClassMethod = function(e10, t3, i2, s2) {
|
|
500
|
+
var r2 = e10.key;
|
|
501
|
+
"constructor" === e10.kind ? (t3 && this.raise(r2.start, "Constructor can't be a generator"), i2 && this.raise(r2.start, "Constructor can't be an async method")) : e10.static && checkKeyName(e10, "prototype") && this.raise(r2.start, "Classes may not have a static property named prototype");
|
|
502
|
+
var n2 = e10.value = this.parseMethod(t3, i2, s2);
|
|
503
|
+
return "get" === e10.kind && 0 !== n2.params.length && this.raiseRecoverable(n2.start, "getter should have no params"), "set" === e10.kind && 1 !== n2.params.length && this.raiseRecoverable(n2.start, "setter should have exactly one param"), "set" === e10.kind && "RestElement" === n2.params[0].type && this.raiseRecoverable(n2.params[0].start, "Setter cannot use rest params"), this.finishNode(e10, "MethodDefinition");
|
|
504
|
+
}, O.parseClassField = function(e10) {
|
|
505
|
+
return checkKeyName(e10, "constructor") ? this.raise(e10.key.start, "Classes can't have a field named 'constructor'") : e10.static && checkKeyName(e10, "prototype") && this.raise(e10.key.start, "Classes can't have a static field named 'prototype'"), this.eat(x.eq) ? (this.enterScope(576), e10.value = this.parseMaybeAssign(), this.exitScope()) : e10.value = null, this.semicolon(), this.finishNode(e10, "PropertyDefinition");
|
|
506
|
+
}, O.parseClassStaticBlock = function(e10) {
|
|
507
|
+
e10.body = [];
|
|
508
|
+
var t3 = this.labels;
|
|
509
|
+
for (this.labels = [], this.enterScope(320); this.type !== x.braceR; ) {
|
|
510
|
+
var i2 = this.parseStatement(null);
|
|
511
|
+
e10.body.push(i2);
|
|
512
|
+
}
|
|
513
|
+
return this.next(), this.exitScope(), this.labels = t3, this.finishNode(e10, "StaticBlock");
|
|
514
|
+
}, O.parseClassId = function(e10, t3) {
|
|
515
|
+
this.type === x.name ? (e10.id = this.parseIdent(), t3 && this.checkLValSimple(e10.id, 2, false)) : (true === t3 && this.unexpected(), e10.id = null);
|
|
516
|
+
}, O.parseClassSuper = function(e10) {
|
|
517
|
+
e10.superClass = this.eat(x._extends) ? this.parseExprSubscripts(null, false) : null;
|
|
518
|
+
}, O.enterClassBody = function() {
|
|
519
|
+
var e10 = { declared: /* @__PURE__ */ Object.create(null), used: [] };
|
|
520
|
+
return this.privateNameStack.push(e10), e10.declared;
|
|
521
|
+
}, O.exitClassBody = function() {
|
|
522
|
+
var e10 = this.privateNameStack.pop(), t3 = e10.declared, i2 = e10.used;
|
|
523
|
+
if (this.options.checkPrivateFields) for (var s2 = this.privateNameStack.length, r2 = 0 === s2 ? null : this.privateNameStack[s2 - 1], n2 = 0; n2 < i2.length; ++n2) {
|
|
524
|
+
var a2 = i2[n2];
|
|
525
|
+
w(t3, a2.name) || (r2 ? r2.used.push(a2) : this.raiseRecoverable(a2.start, "Private field '#" + a2.name + "' must be declared in an enclosing class"));
|
|
526
|
+
}
|
|
527
|
+
}, O.parseExportAllDeclaration = function(e10, t3) {
|
|
528
|
+
return this.options.ecmaVersion >= 11 && (this.eatContextual("as") ? (e10.exported = this.parseModuleExportName(), this.checkExport(t3, e10.exported, this.lastTokStart)) : e10.exported = null), this.expectContextual("from"), this.type !== x.string && this.unexpected(), e10.source = this.parseExprAtom(), this.options.ecmaVersion >= 16 && (e10.attributes = this.parseWithClause()), this.semicolon(), this.finishNode(e10, "ExportAllDeclaration");
|
|
529
|
+
}, O.parseExport = function(e10, t3) {
|
|
530
|
+
if (this.next(), this.eat(x.star)) return this.parseExportAllDeclaration(e10, t3);
|
|
531
|
+
if (this.eat(x._default)) return this.checkExport(t3, "default", this.lastTokStart), e10.declaration = this.parseExportDefaultDeclaration(), this.finishNode(e10, "ExportDefaultDeclaration");
|
|
532
|
+
if (this.shouldParseExportStatement()) e10.declaration = this.parseExportDeclaration(e10), "VariableDeclaration" === e10.declaration.type ? this.checkVariableExport(t3, e10.declaration.declarations) : this.checkExport(t3, e10.declaration.id, e10.declaration.id.start), e10.specifiers = [], e10.source = null, this.options.ecmaVersion >= 16 && (e10.attributes = []);
|
|
533
|
+
else {
|
|
534
|
+
if (e10.declaration = null, e10.specifiers = this.parseExportSpecifiers(t3), this.eatContextual("from")) this.type !== x.string && this.unexpected(), e10.source = this.parseExprAtom(), this.options.ecmaVersion >= 16 && (e10.attributes = this.parseWithClause());
|
|
535
|
+
else {
|
|
536
|
+
for (var i2 = 0, s2 = e10.specifiers; i2 < s2.length; i2 += 1) {
|
|
537
|
+
var r2 = s2[i2];
|
|
538
|
+
this.checkUnreserved(r2.local), this.checkLocalExport(r2.local), "Literal" === r2.local.type && this.raise(r2.local.start, "A string literal cannot be used as an exported binding without `from`.");
|
|
539
|
+
}
|
|
540
|
+
e10.source = null, this.options.ecmaVersion >= 16 && (e10.attributes = []);
|
|
541
|
+
}
|
|
542
|
+
this.semicolon();
|
|
543
|
+
}
|
|
544
|
+
return this.finishNode(e10, "ExportNamedDeclaration");
|
|
545
|
+
}, O.parseExportDeclaration = function(e10) {
|
|
546
|
+
return this.parseStatement(null);
|
|
547
|
+
}, O.parseExportDefaultDeclaration = function() {
|
|
548
|
+
if (this.type === x._function || (e10 = this.isAsyncFunction())) {
|
|
549
|
+
var e10, t3 = this.startNode();
|
|
550
|
+
return this.next(), e10 && this.next(), this.parseFunction(t3, 4 | j, false, e10);
|
|
551
|
+
}
|
|
552
|
+
if (this.type === x._class) {
|
|
553
|
+
var i2 = this.startNode();
|
|
554
|
+
return this.parseClass(i2, "nullableID");
|
|
555
|
+
}
|
|
556
|
+
var s2 = this.parseMaybeAssign();
|
|
557
|
+
return this.semicolon(), s2;
|
|
558
|
+
}, O.checkExport = function(e10, t3, i2) {
|
|
559
|
+
e10 && ("string" != typeof t3 && (t3 = "Identifier" === t3.type ? t3.name : t3.value), w(e10, t3) && this.raiseRecoverable(i2, "Duplicate export '" + t3 + "'"), e10[t3] = true);
|
|
560
|
+
}, O.checkPatternExport = function(e10, t3) {
|
|
561
|
+
var i2 = t3.type;
|
|
562
|
+
if ("Identifier" === i2) this.checkExport(e10, t3, t3.start);
|
|
563
|
+
else if ("ObjectPattern" === i2) for (var s2 = 0, r2 = t3.properties; s2 < r2.length; s2 += 1) {
|
|
564
|
+
var n2 = r2[s2];
|
|
565
|
+
this.checkPatternExport(e10, n2);
|
|
566
|
+
}
|
|
567
|
+
else if ("ArrayPattern" === i2) for (var a2 = 0, o2 = t3.elements; a2 < o2.length; a2 += 1) {
|
|
568
|
+
var h2 = o2[a2];
|
|
569
|
+
h2 && this.checkPatternExport(e10, h2);
|
|
570
|
+
}
|
|
571
|
+
else "Property" === i2 ? this.checkPatternExport(e10, t3.value) : "AssignmentPattern" === i2 ? this.checkPatternExport(e10, t3.left) : "RestElement" === i2 && this.checkPatternExport(e10, t3.argument);
|
|
572
|
+
}, O.checkVariableExport = function(e10, t3) {
|
|
573
|
+
if (e10) for (var i2 = 0; i2 < t3.length; i2 += 1) {
|
|
574
|
+
var s2 = t3[i2];
|
|
575
|
+
this.checkPatternExport(e10, s2.id);
|
|
576
|
+
}
|
|
577
|
+
}, O.shouldParseExportStatement = function() {
|
|
578
|
+
return "var" === this.type.keyword || "const" === this.type.keyword || "class" === this.type.keyword || "function" === this.type.keyword || this.isLet() || this.isAsyncFunction();
|
|
579
|
+
}, O.parseExportSpecifier = function(e10) {
|
|
580
|
+
var t3 = this.startNode();
|
|
581
|
+
return t3.local = this.parseModuleExportName(), t3.exported = this.eatContextual("as") ? this.parseModuleExportName() : t3.local, this.checkExport(e10, t3.exported, t3.exported.start), this.finishNode(t3, "ExportSpecifier");
|
|
582
|
+
}, O.parseExportSpecifiers = function(e10) {
|
|
583
|
+
var t3 = [], i2 = true;
|
|
584
|
+
for (this.expect(x.braceL); !this.eat(x.braceR); ) {
|
|
585
|
+
if (i2) i2 = false;
|
|
586
|
+
else if (this.expect(x.comma), this.afterTrailingComma(x.braceR)) break;
|
|
587
|
+
t3.push(this.parseExportSpecifier(e10));
|
|
588
|
+
}
|
|
589
|
+
return t3;
|
|
590
|
+
}, O.parseImport = function(e10) {
|
|
591
|
+
return this.next(), this.type === x.string ? (e10.specifiers = M, e10.source = this.parseExprAtom()) : (e10.specifiers = this.parseImportSpecifiers(), this.expectContextual("from"), e10.source = this.type === x.string ? this.parseExprAtom() : this.unexpected()), this.options.ecmaVersion >= 16 && (e10.attributes = this.parseWithClause()), this.semicolon(), this.finishNode(e10, "ImportDeclaration");
|
|
592
|
+
}, O.parseImportSpecifier = function() {
|
|
593
|
+
var e10 = this.startNode();
|
|
594
|
+
return e10.imported = this.parseModuleExportName(), this.eatContextual("as") ? e10.local = this.parseIdent() : (this.checkUnreserved(e10.imported), e10.local = e10.imported), this.checkLValSimple(e10.local, 2), this.finishNode(e10, "ImportSpecifier");
|
|
595
|
+
}, O.parseImportDefaultSpecifier = function() {
|
|
596
|
+
var e10 = this.startNode();
|
|
597
|
+
return e10.local = this.parseIdent(), this.checkLValSimple(e10.local, 2), this.finishNode(e10, "ImportDefaultSpecifier");
|
|
598
|
+
}, O.parseImportNamespaceSpecifier = function() {
|
|
599
|
+
var e10 = this.startNode();
|
|
600
|
+
return this.next(), this.expectContextual("as"), e10.local = this.parseIdent(), this.checkLValSimple(e10.local, 2), this.finishNode(e10, "ImportNamespaceSpecifier");
|
|
601
|
+
}, O.parseImportSpecifiers = function() {
|
|
602
|
+
var e10 = [], t3 = true;
|
|
603
|
+
if (this.type === x.name && (e10.push(this.parseImportDefaultSpecifier()), !this.eat(x.comma))) return e10;
|
|
604
|
+
if (this.type === x.star) return e10.push(this.parseImportNamespaceSpecifier()), e10;
|
|
605
|
+
for (this.expect(x.braceL); !this.eat(x.braceR); ) {
|
|
606
|
+
if (t3) t3 = false;
|
|
607
|
+
else if (this.expect(x.comma), this.afterTrailingComma(x.braceR)) break;
|
|
608
|
+
e10.push(this.parseImportSpecifier());
|
|
609
|
+
}
|
|
610
|
+
return e10;
|
|
611
|
+
}, O.parseWithClause = function() {
|
|
612
|
+
var e10 = [];
|
|
613
|
+
if (!this.eat(x._with)) return e10;
|
|
614
|
+
this.expect(x.braceL);
|
|
615
|
+
for (var t3 = {}, i2 = true; !this.eat(x.braceR); ) {
|
|
616
|
+
if (i2) i2 = false;
|
|
617
|
+
else if (this.expect(x.comma), this.afterTrailingComma(x.braceR)) break;
|
|
618
|
+
var s2 = this.parseImportAttribute(), r2 = "Identifier" === s2.key.type ? s2.key.name : s2.key.value;
|
|
619
|
+
w(t3, r2) && this.raiseRecoverable(s2.key.start, "Duplicate attribute key '" + r2 + "'"), t3[r2] = true, e10.push(s2);
|
|
620
|
+
}
|
|
621
|
+
return e10;
|
|
622
|
+
}, O.parseImportAttribute = function() {
|
|
623
|
+
var e10 = this.startNode();
|
|
624
|
+
return e10.key = this.type === x.string ? this.parseExprAtom() : this.parseIdent("never" !== this.options.allowReserved), this.expect(x.colon), this.type !== x.string && this.unexpected(), e10.value = this.parseExprAtom(), this.finishNode(e10, "ImportAttribute");
|
|
625
|
+
}, O.parseModuleExportName = function() {
|
|
626
|
+
if (this.options.ecmaVersion >= 13 && this.type === x.string) {
|
|
627
|
+
var e10 = this.parseLiteral(this.value);
|
|
628
|
+
return R.test(e10.value) && this.raise(e10.start, "An export name cannot include a lone surrogate."), e10;
|
|
629
|
+
}
|
|
630
|
+
return this.parseIdent(true);
|
|
631
|
+
}, O.adaptDirectivePrologue = function(e10) {
|
|
632
|
+
for (var t3 = 0; t3 < e10.length && this.isDirectiveCandidate(e10[t3]); ++t3) e10[t3].directive = e10[t3].expression.raw.slice(1, -1);
|
|
633
|
+
}, O.isDirectiveCandidate = function(e10) {
|
|
634
|
+
return this.options.ecmaVersion >= 5 && "ExpressionStatement" === e10.type && "Literal" === e10.expression.type && "string" == typeof e10.expression.value && ('"' === this.input[e10.start] || "'" === this.input[e10.start]);
|
|
635
|
+
};
|
|
636
|
+
var F = acorn_Parser.prototype;
|
|
637
|
+
F.toAssignable = function(e10, t3, i2) {
|
|
638
|
+
if (this.options.ecmaVersion >= 6 && e10) switch (e10.type) {
|
|
639
|
+
case "Identifier":
|
|
640
|
+
this.inAsync && "await" === e10.name && this.raise(e10.start, "Cannot use 'await' as identifier inside an async function");
|
|
641
|
+
break;
|
|
642
|
+
case "ObjectPattern":
|
|
643
|
+
case "ArrayPattern":
|
|
644
|
+
case "AssignmentPattern":
|
|
645
|
+
case "RestElement":
|
|
646
|
+
break;
|
|
647
|
+
case "ObjectExpression":
|
|
648
|
+
e10.type = "ObjectPattern", i2 && this.checkPatternErrors(i2, true);
|
|
649
|
+
for (var s2 = 0, r2 = e10.properties; s2 < r2.length; s2 += 1) {
|
|
650
|
+
var n2 = r2[s2];
|
|
651
|
+
this.toAssignable(n2, t3), "RestElement" === n2.type && ("ArrayPattern" === n2.argument.type || "ObjectPattern" === n2.argument.type) && this.raise(n2.argument.start, "Unexpected token");
|
|
652
|
+
}
|
|
653
|
+
break;
|
|
654
|
+
case "Property":
|
|
655
|
+
"init" !== e10.kind && this.raise(e10.key.start, "Object pattern can't contain getter or setter"), this.toAssignable(e10.value, t3);
|
|
656
|
+
break;
|
|
657
|
+
case "ArrayExpression":
|
|
658
|
+
e10.type = "ArrayPattern", i2 && this.checkPatternErrors(i2, true), this.toAssignableList(e10.elements, t3);
|
|
659
|
+
break;
|
|
660
|
+
case "SpreadElement":
|
|
661
|
+
e10.type = "RestElement", this.toAssignable(e10.argument, t3), "AssignmentPattern" === e10.argument.type && this.raise(e10.argument.start, "Rest elements cannot have a default value");
|
|
662
|
+
break;
|
|
663
|
+
case "AssignmentExpression":
|
|
664
|
+
"=" !== e10.operator && this.raise(e10.left.end, "Only '=' operator can be used for specifying default value."), e10.type = "AssignmentPattern", delete e10.operator, this.toAssignable(e10.left, t3);
|
|
665
|
+
break;
|
|
666
|
+
case "ParenthesizedExpression":
|
|
667
|
+
this.toAssignable(e10.expression, t3, i2);
|
|
668
|
+
break;
|
|
669
|
+
case "ChainExpression":
|
|
670
|
+
this.raiseRecoverable(e10.start, "Optional chaining cannot appear in left-hand side");
|
|
671
|
+
break;
|
|
672
|
+
case "MemberExpression":
|
|
673
|
+
if (!t3) break;
|
|
674
|
+
default:
|
|
675
|
+
this.raise(e10.start, "Assigning to rvalue");
|
|
676
|
+
}
|
|
677
|
+
else i2 && this.checkPatternErrors(i2, true);
|
|
678
|
+
return e10;
|
|
679
|
+
}, F.toAssignableList = function(e10, t3) {
|
|
680
|
+
for (var i2 = e10.length, s2 = 0; s2 < i2; s2++) {
|
|
681
|
+
var r2 = e10[s2];
|
|
682
|
+
r2 && this.toAssignable(r2, t3);
|
|
683
|
+
}
|
|
684
|
+
if (i2) {
|
|
685
|
+
var n2 = e10[i2 - 1];
|
|
686
|
+
6 === this.options.ecmaVersion && t3 && n2 && "RestElement" === n2.type && "Identifier" !== n2.argument.type && this.unexpected(n2.argument.start);
|
|
687
|
+
}
|
|
688
|
+
return e10;
|
|
689
|
+
}, F.parseSpread = function(e10) {
|
|
690
|
+
var t3 = this.startNode();
|
|
691
|
+
return this.next(), t3.argument = this.parseMaybeAssign(false, e10), this.finishNode(t3, "SpreadElement");
|
|
692
|
+
}, F.parseRestBinding = function() {
|
|
693
|
+
var e10 = this.startNode();
|
|
694
|
+
return this.next(), 6 === this.options.ecmaVersion && this.type !== x.name && this.unexpected(), e10.argument = this.parseBindingAtom(), this.finishNode(e10, "RestElement");
|
|
695
|
+
}, F.parseBindingAtom = function() {
|
|
696
|
+
if (this.options.ecmaVersion >= 6) switch (this.type) {
|
|
697
|
+
case x.bracketL:
|
|
698
|
+
var e10 = this.startNode();
|
|
699
|
+
return this.next(), e10.elements = this.parseBindingList(x.bracketR, true, true), this.finishNode(e10, "ArrayPattern");
|
|
700
|
+
case x.braceL:
|
|
701
|
+
return this.parseObj(true);
|
|
702
|
+
}
|
|
703
|
+
return this.parseIdent();
|
|
704
|
+
}, F.parseBindingList = function(e10, t3, i2, s2) {
|
|
705
|
+
for (var r2 = [], n2 = true; !this.eat(e10); ) if (n2 ? n2 = false : this.expect(x.comma), t3 && this.type === x.comma) r2.push(null);
|
|
706
|
+
else if (i2 && this.afterTrailingComma(e10)) break;
|
|
707
|
+
else if (this.type === x.ellipsis) {
|
|
708
|
+
var a2 = this.parseRestBinding();
|
|
709
|
+
this.parseBindingListItem(a2), r2.push(a2), this.type === x.comma && this.raiseRecoverable(this.start, "Comma is not permitted after the rest element"), this.expect(e10);
|
|
710
|
+
break;
|
|
711
|
+
} else r2.push(this.parseAssignableListItem(s2));
|
|
712
|
+
return r2;
|
|
713
|
+
}, F.parseAssignableListItem = function(e10) {
|
|
714
|
+
var t3 = this.parseMaybeDefault(this.start, this.startLoc);
|
|
715
|
+
return this.parseBindingListItem(t3), t3;
|
|
716
|
+
}, F.parseBindingListItem = function(e10) {
|
|
717
|
+
return e10;
|
|
718
|
+
}, F.parseMaybeDefault = function(e10, t3, i2) {
|
|
719
|
+
if (i2 = i2 || this.parseBindingAtom(), this.options.ecmaVersion < 6 || !this.eat(x.eq)) return i2;
|
|
720
|
+
var s2 = this.startNodeAt(e10, t3);
|
|
721
|
+
return s2.left = i2, s2.right = this.parseMaybeAssign(), this.finishNode(s2, "AssignmentPattern");
|
|
722
|
+
}, F.checkLValSimple = function(e10, t3, i2) {
|
|
723
|
+
void 0 === t3 && (t3 = 0);
|
|
724
|
+
var s2 = 0 !== t3;
|
|
725
|
+
switch (e10.type) {
|
|
726
|
+
case "Identifier":
|
|
727
|
+
this.strict && this.reservedWordsStrictBind.test(e10.name) && this.raiseRecoverable(e10.start, (s2 ? "Binding " : "Assigning to ") + e10.name + " in strict mode"), s2 && (2 === t3 && "let" === e10.name && this.raiseRecoverable(e10.start, "let is disallowed as a lexically bound name"), i2 && (w(i2, e10.name) && this.raiseRecoverable(e10.start, "Argument name clash"), i2[e10.name] = true), 5 !== t3 && this.declareName(e10.name, t3, e10.start));
|
|
728
|
+
break;
|
|
729
|
+
case "ChainExpression":
|
|
730
|
+
this.raiseRecoverable(e10.start, "Optional chaining cannot appear in left-hand side");
|
|
731
|
+
break;
|
|
732
|
+
case "MemberExpression":
|
|
733
|
+
s2 && this.raiseRecoverable(e10.start, "Binding member expression");
|
|
734
|
+
break;
|
|
735
|
+
case "ParenthesizedExpression":
|
|
736
|
+
return s2 && this.raiseRecoverable(e10.start, "Binding parenthesized expression"), this.checkLValSimple(e10.expression, t3, i2);
|
|
737
|
+
default:
|
|
738
|
+
this.raise(e10.start, (s2 ? "Binding" : "Assigning to") + " rvalue");
|
|
739
|
+
}
|
|
740
|
+
}, F.checkLValPattern = function(e10, t3, i2) {
|
|
741
|
+
switch (void 0 === t3 && (t3 = 0), e10.type) {
|
|
742
|
+
case "ObjectPattern":
|
|
743
|
+
for (var s2 = 0, r2 = e10.properties; s2 < r2.length; s2 += 1) {
|
|
744
|
+
var n2 = r2[s2];
|
|
745
|
+
this.checkLValInnerPattern(n2, t3, i2);
|
|
746
|
+
}
|
|
747
|
+
break;
|
|
748
|
+
case "ArrayPattern":
|
|
749
|
+
for (var a2 = 0, o2 = e10.elements; a2 < o2.length; a2 += 1) {
|
|
750
|
+
var h2 = o2[a2];
|
|
751
|
+
h2 && this.checkLValInnerPattern(h2, t3, i2);
|
|
752
|
+
}
|
|
753
|
+
break;
|
|
754
|
+
default:
|
|
755
|
+
this.checkLValSimple(e10, t3, i2);
|
|
756
|
+
}
|
|
757
|
+
}, F.checkLValInnerPattern = function(e10, t3, i2) {
|
|
758
|
+
switch (void 0 === t3 && (t3 = 0), e10.type) {
|
|
759
|
+
case "Property":
|
|
760
|
+
this.checkLValInnerPattern(e10.value, t3, i2);
|
|
761
|
+
break;
|
|
762
|
+
case "AssignmentPattern":
|
|
763
|
+
this.checkLValPattern(e10.left, t3, i2);
|
|
764
|
+
break;
|
|
765
|
+
case "RestElement":
|
|
766
|
+
this.checkLValPattern(e10.argument, t3, i2);
|
|
767
|
+
break;
|
|
768
|
+
default:
|
|
769
|
+
this.checkLValPattern(e10, t3, i2);
|
|
770
|
+
}
|
|
771
|
+
};
|
|
772
|
+
var acorn_TokContext = /* @__PURE__ */ __name(function(e10, t3, i2, s2, r2) {
|
|
773
|
+
this.token = e10, this.isExpr = !!t3, this.preserveSpace = !!i2, this.override = s2, this.generator = !!r2;
|
|
774
|
+
}, "acorn_TokContext"), $ = { b_stat: new acorn_TokContext("{", false), b_expr: new acorn_TokContext("{", true), b_tmpl: new acorn_TokContext("${", false), p_stat: new acorn_TokContext("(", false), p_expr: new acorn_TokContext("(", true), q_tmpl: new acorn_TokContext("`", true, true, function(e10) {
|
|
775
|
+
return e10.tryReadTemplateToken();
|
|
776
|
+
}), f_stat: new acorn_TokContext("function", false), f_expr: new acorn_TokContext("function", true), f_expr_gen: new acorn_TokContext("function", true, false, null, true), f_gen: new acorn_TokContext("function", false, false, null, true) }, q = acorn_Parser.prototype;
|
|
777
|
+
q.initialContext = function() {
|
|
778
|
+
return [$.b_stat];
|
|
779
|
+
}, q.curContext = function() {
|
|
780
|
+
return this.context[this.context.length - 1];
|
|
781
|
+
}, q.braceIsBlock = function(e10) {
|
|
782
|
+
var t3 = this.curContext();
|
|
783
|
+
return t3 === $.f_expr || t3 === $.f_stat || (e10 === x.colon && (t3 === $.b_stat || t3 === $.b_expr) ? !t3.isExpr : e10 === x._return || e10 === x.name && this.exprAllowed ? v.test(this.input.slice(this.lastTokEnd, this.start)) : e10 === x._else || e10 === x.semi || e10 === x.eof || e10 === x.parenR || e10 === x.arrow || (e10 === x.braceL ? t3 === $.b_stat : e10 !== x._var && e10 !== x._const && e10 !== x.name && !this.exprAllowed));
|
|
784
|
+
}, q.inGeneratorContext = function() {
|
|
785
|
+
for (var e10 = this.context.length - 1; e10 >= 1; e10--) {
|
|
786
|
+
var t3 = this.context[e10];
|
|
787
|
+
if ("function" === t3.token) return t3.generator;
|
|
788
|
+
}
|
|
789
|
+
return false;
|
|
790
|
+
}, q.updateContext = function(e10) {
|
|
791
|
+
var t3, i2 = this.type;
|
|
792
|
+
i2.keyword && e10 === x.dot ? this.exprAllowed = false : (t3 = i2.updateContext) ? t3.call(this, e10) : this.exprAllowed = i2.beforeExpr;
|
|
793
|
+
}, q.overrideContext = function(e10) {
|
|
794
|
+
this.curContext() !== e10 && (this.context[this.context.length - 1] = e10);
|
|
795
|
+
}, x.parenR.updateContext = x.braceR.updateContext = function() {
|
|
796
|
+
if (1 === this.context.length) {
|
|
797
|
+
this.exprAllowed = true;
|
|
798
|
+
return;
|
|
799
|
+
}
|
|
800
|
+
var e10 = this.context.pop();
|
|
801
|
+
e10 === $.b_stat && "function" === this.curContext().token && (e10 = this.context.pop()), this.exprAllowed = !e10.isExpr;
|
|
802
|
+
}, x.braceL.updateContext = function(e10) {
|
|
803
|
+
this.context.push(this.braceIsBlock(e10) ? $.b_stat : $.b_expr), this.exprAllowed = true;
|
|
804
|
+
}, x.dollarBraceL.updateContext = function() {
|
|
805
|
+
this.context.push($.b_tmpl), this.exprAllowed = true;
|
|
806
|
+
}, x.parenL.updateContext = function(e10) {
|
|
807
|
+
var t3 = e10 === x._if || e10 === x._for || e10 === x._with || e10 === x._while;
|
|
808
|
+
this.context.push(t3 ? $.p_stat : $.p_expr), this.exprAllowed = true;
|
|
809
|
+
}, x.incDec.updateContext = function() {
|
|
810
|
+
}, x._function.updateContext = x._class.updateContext = function(e10) {
|
|
811
|
+
e10.beforeExpr && e10 !== x._else && (e10 !== x.semi || this.curContext() === $.p_stat) && !(e10 === x._return && v.test(this.input.slice(this.lastTokEnd, this.start))) && (e10 !== x.colon && e10 !== x.braceL || this.curContext() !== $.b_stat) ? this.context.push($.f_expr) : this.context.push($.f_stat), this.exprAllowed = false;
|
|
812
|
+
}, x.colon.updateContext = function() {
|
|
813
|
+
"function" === this.curContext().token && this.context.pop(), this.exprAllowed = true;
|
|
814
|
+
}, x.backQuote.updateContext = function() {
|
|
815
|
+
this.curContext() === $.q_tmpl ? this.context.pop() : this.context.push($.q_tmpl), this.exprAllowed = false;
|
|
816
|
+
}, x.star.updateContext = function(e10) {
|
|
817
|
+
if (e10 === x._function) {
|
|
818
|
+
var t3 = this.context.length - 1;
|
|
819
|
+
this.context[t3] === $.f_expr ? this.context[t3] = $.f_expr_gen : this.context[t3] = $.f_gen;
|
|
820
|
+
}
|
|
821
|
+
this.exprAllowed = true;
|
|
822
|
+
}, x.name.updateContext = function(e10) {
|
|
823
|
+
var t3 = false;
|
|
824
|
+
this.options.ecmaVersion >= 6 && e10 !== x.dot && ("of" === this.value && !this.exprAllowed || "yield" === this.value && this.inGeneratorContext()) && (t3 = true), this.exprAllowed = t3;
|
|
825
|
+
};
|
|
826
|
+
var W = acorn_Parser.prototype;
|
|
827
|
+
function isLocalVariableAccess(e10) {
|
|
828
|
+
return "Identifier" === e10.type || "ParenthesizedExpression" === e10.type && isLocalVariableAccess(e10.expression);
|
|
829
|
+
}
|
|
830
|
+
__name(isLocalVariableAccess, "isLocalVariableAccess");
|
|
831
|
+
function isPrivateFieldAccess(e10) {
|
|
832
|
+
return "MemberExpression" === e10.type && "PrivateIdentifier" === e10.property.type || "ChainExpression" === e10.type && isPrivateFieldAccess(e10.expression) || "ParenthesizedExpression" === e10.type && isPrivateFieldAccess(e10.expression);
|
|
833
|
+
}
|
|
834
|
+
__name(isPrivateFieldAccess, "isPrivateFieldAccess");
|
|
835
|
+
W.checkPropClash = function(e10, t3, i2) {
|
|
836
|
+
if ((!(this.options.ecmaVersion >= 9) || "SpreadElement" !== e10.type) && (!(this.options.ecmaVersion >= 6) || !e10.computed && !e10.method && !e10.shorthand)) {
|
|
837
|
+
var s2, r2 = e10.key;
|
|
838
|
+
switch (r2.type) {
|
|
839
|
+
case "Identifier":
|
|
840
|
+
s2 = r2.name;
|
|
841
|
+
break;
|
|
842
|
+
case "Literal":
|
|
843
|
+
s2 = String(r2.value);
|
|
844
|
+
break;
|
|
845
|
+
default:
|
|
846
|
+
return;
|
|
847
|
+
}
|
|
848
|
+
var n2 = e10.kind;
|
|
849
|
+
if (this.options.ecmaVersion >= 6) {
|
|
850
|
+
"__proto__" === s2 && "init" === n2 && (t3.proto && (i2 ? i2.doubleProto < 0 && (i2.doubleProto = r2.start) : this.raiseRecoverable(r2.start, "Redefinition of __proto__ property")), t3.proto = true);
|
|
851
|
+
return;
|
|
852
|
+
}
|
|
853
|
+
var a2 = t3[s2 = "$" + s2];
|
|
854
|
+
a2 ? ("init" === n2 ? this.strict && a2.init || a2.get || a2.set : a2.init || a2[n2]) && this.raiseRecoverable(r2.start, "Redefinition of property") : a2 = t3[s2] = { init: false, get: false, set: false }, a2[n2] = true;
|
|
855
|
+
}
|
|
856
|
+
}, W.parseExpression = function(e10, t3) {
|
|
857
|
+
var i2 = this.start, s2 = this.startLoc, r2 = this.parseMaybeAssign(e10, t3);
|
|
858
|
+
if (this.type === x.comma) {
|
|
859
|
+
var n2 = this.startNodeAt(i2, s2);
|
|
860
|
+
for (n2.expressions = [r2]; this.eat(x.comma); ) n2.expressions.push(this.parseMaybeAssign(e10, t3));
|
|
861
|
+
return this.finishNode(n2, "SequenceExpression");
|
|
862
|
+
}
|
|
863
|
+
return r2;
|
|
864
|
+
}, W.parseMaybeAssign = function(e10, t3, i2) {
|
|
865
|
+
if (this.isContextual("yield")) if (this.inGenerator) return this.parseYield(e10);
|
|
866
|
+
else this.exprAllowed = false;
|
|
867
|
+
var s2 = false, r2 = -1, n2 = -1, a2 = -1;
|
|
868
|
+
t3 ? (r2 = t3.parenthesizedAssign, n2 = t3.trailingComma, a2 = t3.doubleProto, t3.parenthesizedAssign = t3.trailingComma = -1) : (t3 = new acorn_DestructuringErrors(), s2 = true);
|
|
869
|
+
var o2 = this.start, h2 = this.startLoc;
|
|
870
|
+
(this.type === x.parenL || this.type === x.name) && (this.potentialArrowAt = this.start, this.potentialArrowInForAwait = "await" === e10);
|
|
871
|
+
var c2 = this.parseMaybeConditional(e10, t3);
|
|
872
|
+
if (i2 && (c2 = i2.call(this, c2, o2, h2)), this.type.isAssign) {
|
|
873
|
+
var p2 = this.startNodeAt(o2, h2);
|
|
874
|
+
return p2.operator = this.value, this.type === x.eq && (c2 = this.toAssignable(c2, false, t3)), s2 || (t3.parenthesizedAssign = t3.trailingComma = t3.doubleProto = -1), t3.shorthandAssign >= c2.start && (t3.shorthandAssign = -1), this.type === x.eq ? this.checkLValPattern(c2) : this.checkLValSimple(c2), p2.left = c2, this.next(), p2.right = this.parseMaybeAssign(e10), a2 > -1 && (t3.doubleProto = a2), this.finishNode(p2, "AssignmentExpression");
|
|
875
|
+
}
|
|
876
|
+
return s2 && this.checkExpressionErrors(t3, true), r2 > -1 && (t3.parenthesizedAssign = r2), n2 > -1 && (t3.trailingComma = n2), c2;
|
|
877
|
+
}, W.parseMaybeConditional = function(e10, t3) {
|
|
878
|
+
var i2 = this.start, s2 = this.startLoc, r2 = this.parseExprOps(e10, t3);
|
|
879
|
+
if (this.checkExpressionErrors(t3)) return r2;
|
|
880
|
+
if (this.eat(x.question)) {
|
|
881
|
+
var n2 = this.startNodeAt(i2, s2);
|
|
882
|
+
return n2.test = r2, n2.consequent = this.parseMaybeAssign(), this.expect(x.colon), n2.alternate = this.parseMaybeAssign(e10), this.finishNode(n2, "ConditionalExpression");
|
|
883
|
+
}
|
|
884
|
+
return r2;
|
|
885
|
+
}, W.parseExprOps = function(e10, t3) {
|
|
886
|
+
var i2 = this.start, s2 = this.startLoc, r2 = this.parseMaybeUnary(t3, false, false, e10);
|
|
887
|
+
return this.checkExpressionErrors(t3) || r2.start === i2 && "ArrowFunctionExpression" === r2.type ? r2 : this.parseExprOp(r2, i2, s2, -1, e10);
|
|
888
|
+
}, W.parseExprOp = function(e10, t3, i2, s2, r2) {
|
|
889
|
+
var n2 = this.type.binop;
|
|
890
|
+
if (null != n2 && (!r2 || this.type !== x._in) && n2 > s2) {
|
|
891
|
+
var a2 = this.type === x.logicalOR || this.type === x.logicalAND, o2 = this.type === x.coalesce;
|
|
892
|
+
o2 && (n2 = x.logicalAND.binop);
|
|
893
|
+
var h2 = this.value;
|
|
894
|
+
this.next();
|
|
895
|
+
var c2 = this.start, p2 = this.startLoc, l2 = this.parseExprOp(this.parseMaybeUnary(null, false, false, r2), c2, p2, n2, r2), u2 = this.buildBinary(t3, i2, e10, l2, h2, a2 || o2);
|
|
896
|
+
return (a2 && this.type === x.coalesce || o2 && (this.type === x.logicalOR || this.type === x.logicalAND)) && this.raiseRecoverable(this.start, "Logical expressions and coalesce expressions cannot be mixed. Wrap either by parentheses"), this.parseExprOp(u2, t3, i2, s2, r2);
|
|
897
|
+
}
|
|
898
|
+
return e10;
|
|
899
|
+
}, W.buildBinary = function(e10, t3, i2, s2, r2, n2) {
|
|
900
|
+
"PrivateIdentifier" === s2.type && this.raise(s2.start, "Private identifier can only be left side of binary expression");
|
|
901
|
+
var a2 = this.startNodeAt(e10, t3);
|
|
902
|
+
return a2.left = i2, a2.operator = r2, a2.right = s2, this.finishNode(a2, n2 ? "LogicalExpression" : "BinaryExpression");
|
|
903
|
+
}, W.parseMaybeUnary = function(e10, t3, i2, s2) {
|
|
904
|
+
var r2, n2 = this.start, a2 = this.startLoc;
|
|
905
|
+
if (this.isContextual("await") && this.canAwait) r2 = this.parseAwait(s2), t3 = true;
|
|
906
|
+
else if (this.type.prefix) {
|
|
907
|
+
var o2 = this.startNode(), h2 = this.type === x.incDec;
|
|
908
|
+
o2.operator = this.value, o2.prefix = true, this.next(), o2.argument = this.parseMaybeUnary(null, true, h2, s2), this.checkExpressionErrors(e10, true), h2 ? this.checkLValSimple(o2.argument) : this.strict && "delete" === o2.operator && isLocalVariableAccess(o2.argument) ? this.raiseRecoverable(o2.start, "Deleting local variable in strict mode") : "delete" === o2.operator && isPrivateFieldAccess(o2.argument) ? this.raiseRecoverable(o2.start, "Private fields can not be deleted") : t3 = true, r2 = this.finishNode(o2, h2 ? "UpdateExpression" : "UnaryExpression");
|
|
909
|
+
} else if (t3 || this.type !== x.privateId) {
|
|
910
|
+
if (r2 = this.parseExprSubscripts(e10, s2), this.checkExpressionErrors(e10)) return r2;
|
|
911
|
+
for (; this.type.postfix && !this.canInsertSemicolon(); ) {
|
|
912
|
+
var c2 = this.startNodeAt(n2, a2);
|
|
913
|
+
c2.operator = this.value, c2.prefix = false, c2.argument = r2, this.checkLValSimple(r2), this.next(), r2 = this.finishNode(c2, "UpdateExpression");
|
|
914
|
+
}
|
|
915
|
+
} else (s2 || 0 === this.privateNameStack.length) && this.options.checkPrivateFields && this.unexpected(), r2 = this.parsePrivateIdent(), this.type !== x._in && this.unexpected();
|
|
916
|
+
return !i2 && this.eat(x.starstar) ? t3 ? void this.unexpected(this.lastTokStart) : this.buildBinary(n2, a2, r2, this.parseMaybeUnary(null, false, false, s2), "**", false) : r2;
|
|
917
|
+
}, W.parseExprSubscripts = function(e10, t3) {
|
|
918
|
+
var i2 = this.start, s2 = this.startLoc, r2 = this.parseExprAtom(e10, t3);
|
|
919
|
+
if ("ArrowFunctionExpression" === r2.type && ")" !== this.input.slice(this.lastTokStart, this.lastTokEnd)) return r2;
|
|
920
|
+
var n2 = this.parseSubscripts(r2, i2, s2, false, t3);
|
|
921
|
+
return e10 && "MemberExpression" === n2.type && (e10.parenthesizedAssign >= n2.start && (e10.parenthesizedAssign = -1), e10.parenthesizedBind >= n2.start && (e10.parenthesizedBind = -1), e10.trailingComma >= n2.start && (e10.trailingComma = -1)), n2;
|
|
922
|
+
}, W.parseSubscripts = function(e10, t3, i2, s2, r2) {
|
|
923
|
+
for (var n2 = this.options.ecmaVersion >= 8 && "Identifier" === e10.type && "async" === e10.name && this.lastTokEnd === e10.end && !this.canInsertSemicolon() && e10.end - e10.start == 5 && this.potentialArrowAt === e10.start, a2 = false; ; ) {
|
|
924
|
+
var o2 = this.parseSubscript(e10, t3, i2, s2, n2, a2, r2);
|
|
925
|
+
if (o2.optional && (a2 = true), o2 === e10 || "ArrowFunctionExpression" === o2.type) {
|
|
926
|
+
if (a2) {
|
|
927
|
+
var h2 = this.startNodeAt(t3, i2);
|
|
928
|
+
h2.expression = o2, o2 = this.finishNode(h2, "ChainExpression");
|
|
929
|
+
}
|
|
930
|
+
return o2;
|
|
931
|
+
}
|
|
932
|
+
e10 = o2;
|
|
933
|
+
}
|
|
934
|
+
}, W.shouldParseAsyncArrow = function() {
|
|
935
|
+
return !this.canInsertSemicolon() && this.eat(x.arrow);
|
|
936
|
+
}, W.parseSubscriptAsyncArrow = function(e10, t3, i2, s2) {
|
|
937
|
+
return this.parseArrowExpression(this.startNodeAt(e10, t3), i2, true, s2);
|
|
938
|
+
}, W.parseSubscript = function(e10, t3, i2, s2, r2, n2, a2) {
|
|
939
|
+
var o2 = this.options.ecmaVersion >= 11, h2 = o2 && this.eat(x.questionDot);
|
|
940
|
+
s2 && h2 && this.raise(this.lastTokStart, "Optional chaining cannot appear in the callee of new expressions");
|
|
941
|
+
var c2 = this.eat(x.bracketL);
|
|
942
|
+
if (c2 || h2 && this.type !== x.parenL && this.type !== x.backQuote || this.eat(x.dot)) {
|
|
943
|
+
var p2 = this.startNodeAt(t3, i2);
|
|
944
|
+
p2.object = e10, c2 ? (p2.property = this.parseExpression(), this.expect(x.bracketR)) : this.type === x.privateId && "Super" !== e10.type ? p2.property = this.parsePrivateIdent() : p2.property = this.parseIdent("never" !== this.options.allowReserved), p2.computed = !!c2, o2 && (p2.optional = h2), e10 = this.finishNode(p2, "MemberExpression");
|
|
945
|
+
} else if (!s2 && this.eat(x.parenL)) {
|
|
946
|
+
var l2 = new acorn_DestructuringErrors(), u2 = this.yieldPos, d2 = this.awaitPos, f2 = this.awaitIdentPos;
|
|
947
|
+
this.yieldPos = 0, this.awaitPos = 0, this.awaitIdentPos = 0;
|
|
948
|
+
var m2 = this.parseExprList(x.parenR, this.options.ecmaVersion >= 8, false, l2);
|
|
949
|
+
if (r2 && !h2 && this.shouldParseAsyncArrow()) return this.checkPatternErrors(l2, false), this.checkYieldAwaitInDefaultParams(), this.awaitIdentPos > 0 && this.raise(this.awaitIdentPos, "Cannot use 'await' as identifier inside an async function"), this.yieldPos = u2, this.awaitPos = d2, this.awaitIdentPos = f2, this.parseSubscriptAsyncArrow(t3, i2, m2, a2);
|
|
950
|
+
this.checkExpressionErrors(l2, true), this.yieldPos = u2 || this.yieldPos, this.awaitPos = d2 || this.awaitPos, this.awaitIdentPos = f2 || this.awaitIdentPos;
|
|
951
|
+
var g2 = this.startNodeAt(t3, i2);
|
|
952
|
+
g2.callee = e10, g2.arguments = m2, o2 && (g2.optional = h2), e10 = this.finishNode(g2, "CallExpression");
|
|
953
|
+
} else if (this.type === x.backQuote) {
|
|
954
|
+
(h2 || n2) && this.raise(this.start, "Optional chaining cannot appear in the tag of tagged template expressions");
|
|
955
|
+
var _2 = this.startNodeAt(t3, i2);
|
|
956
|
+
_2.tag = e10, _2.quasi = this.parseTemplate({ isTagged: true }), e10 = this.finishNode(_2, "TaggedTemplateExpression");
|
|
957
|
+
}
|
|
958
|
+
return e10;
|
|
959
|
+
}, W.parseExprAtom = function(e10, t3, i2) {
|
|
960
|
+
this.type === x.slash && this.readRegexp();
|
|
961
|
+
var s2, r2 = this.potentialArrowAt === this.start;
|
|
962
|
+
switch (this.type) {
|
|
963
|
+
case x._super:
|
|
964
|
+
return this.allowSuper || this.raise(this.start, "'super' keyword outside a method"), s2 = this.startNode(), this.next(), this.type !== x.parenL || this.allowDirectSuper || this.raise(s2.start, "super() call outside constructor of a subclass"), this.type !== x.dot && this.type !== x.bracketL && this.type !== x.parenL && this.unexpected(), this.finishNode(s2, "Super");
|
|
965
|
+
case x._this:
|
|
966
|
+
return s2 = this.startNode(), this.next(), this.finishNode(s2, "ThisExpression");
|
|
967
|
+
case x.name:
|
|
968
|
+
var n2 = this.start, a2 = this.startLoc, o2 = this.containsEsc, h2 = this.parseIdent(false);
|
|
969
|
+
if (this.options.ecmaVersion >= 8 && !o2 && "async" === h2.name && !this.canInsertSemicolon() && this.eat(x._function)) return this.overrideContext($.f_expr), this.parseFunction(this.startNodeAt(n2, a2), 0, false, true, t3);
|
|
970
|
+
if (r2 && !this.canInsertSemicolon()) {
|
|
971
|
+
if (this.eat(x.arrow)) return this.parseArrowExpression(this.startNodeAt(n2, a2), [h2], false, t3);
|
|
972
|
+
if (this.options.ecmaVersion >= 8 && "async" === h2.name && this.type === x.name && !o2 && (!this.potentialArrowInForAwait || "of" !== this.value || this.containsEsc)) return h2 = this.parseIdent(false), (this.canInsertSemicolon() || !this.eat(x.arrow)) && this.unexpected(), this.parseArrowExpression(this.startNodeAt(n2, a2), [h2], true, t3);
|
|
973
|
+
}
|
|
974
|
+
return h2;
|
|
975
|
+
case x.regexp:
|
|
976
|
+
var c2 = this.value;
|
|
977
|
+
return (s2 = this.parseLiteral(c2.value)).regex = { pattern: c2.pattern, flags: c2.flags }, s2;
|
|
978
|
+
case x.num:
|
|
979
|
+
case x.string:
|
|
980
|
+
return this.parseLiteral(this.value);
|
|
981
|
+
case x._null:
|
|
982
|
+
case x._true:
|
|
983
|
+
case x._false:
|
|
984
|
+
return (s2 = this.startNode()).value = this.type === x._null ? null : this.type === x._true, s2.raw = this.type.keyword, this.next(), this.finishNode(s2, "Literal");
|
|
985
|
+
case x.parenL:
|
|
986
|
+
var p2 = this.start, l2 = this.parseParenAndDistinguishExpression(r2, t3);
|
|
987
|
+
return e10 && (e10.parenthesizedAssign < 0 && !this.isSimpleAssignTarget(l2) && (e10.parenthesizedAssign = p2), e10.parenthesizedBind < 0 && (e10.parenthesizedBind = p2)), l2;
|
|
988
|
+
case x.bracketL:
|
|
989
|
+
return s2 = this.startNode(), this.next(), s2.elements = this.parseExprList(x.bracketR, true, true, e10), this.finishNode(s2, "ArrayExpression");
|
|
990
|
+
case x.braceL:
|
|
991
|
+
return this.overrideContext($.b_expr), this.parseObj(false, e10);
|
|
992
|
+
case x._function:
|
|
993
|
+
return s2 = this.startNode(), this.next(), this.parseFunction(s2, 0);
|
|
994
|
+
case x._class:
|
|
995
|
+
return this.parseClass(this.startNode(), false);
|
|
996
|
+
case x._new:
|
|
997
|
+
return this.parseNew();
|
|
998
|
+
case x.backQuote:
|
|
999
|
+
return this.parseTemplate();
|
|
1000
|
+
case x._import:
|
|
1001
|
+
if (this.options.ecmaVersion >= 11) return this.parseExprImport(i2);
|
|
1002
|
+
return this.unexpected();
|
|
1003
|
+
default:
|
|
1004
|
+
return this.parseExprAtomDefault();
|
|
1005
|
+
}
|
|
1006
|
+
}, W.parseExprAtomDefault = function() {
|
|
1007
|
+
this.unexpected();
|
|
1008
|
+
}, W.parseExprImport = function(e10) {
|
|
1009
|
+
var t3 = this.startNode();
|
|
1010
|
+
if (this.containsEsc && this.raiseRecoverable(this.start, "Escape sequence in keyword import"), this.next(), this.type === x.parenL && !e10) return this.parseDynamicImport(t3);
|
|
1011
|
+
if (this.type === x.dot) {
|
|
1012
|
+
var i2 = this.startNodeAt(t3.start, t3.loc && t3.loc.start);
|
|
1013
|
+
return i2.name = "import", t3.meta = this.finishNode(i2, "Identifier"), this.parseImportMeta(t3);
|
|
1014
|
+
}
|
|
1015
|
+
this.unexpected();
|
|
1016
|
+
}, W.parseDynamicImport = function(e10) {
|
|
1017
|
+
if (this.next(), e10.source = this.parseMaybeAssign(), this.options.ecmaVersion >= 16) this.eat(x.parenR) ? e10.options = null : (this.expect(x.comma), this.afterTrailingComma(x.parenR) ? e10.options = null : (e10.options = this.parseMaybeAssign(), !this.eat(x.parenR) && (this.expect(x.comma), this.afterTrailingComma(x.parenR) || this.unexpected())));
|
|
1018
|
+
else if (!this.eat(x.parenR)) {
|
|
1019
|
+
var t3 = this.start;
|
|
1020
|
+
this.eat(x.comma) && this.eat(x.parenR) ? this.raiseRecoverable(t3, "Trailing comma is not allowed in import()") : this.unexpected(t3);
|
|
1021
|
+
}
|
|
1022
|
+
return this.finishNode(e10, "ImportExpression");
|
|
1023
|
+
}, W.parseImportMeta = function(e10) {
|
|
1024
|
+
this.next();
|
|
1025
|
+
var t3 = this.containsEsc;
|
|
1026
|
+
return e10.property = this.parseIdent(true), "meta" !== e10.property.name && this.raiseRecoverable(e10.property.start, "The only valid meta property for import is 'import.meta'"), t3 && this.raiseRecoverable(e10.start, "'import.meta' must not contain escaped characters"), "module" === this.options.sourceType || this.options.allowImportExportEverywhere || this.raiseRecoverable(e10.start, "Cannot use 'import.meta' outside a module"), this.finishNode(e10, "MetaProperty");
|
|
1027
|
+
}, W.parseLiteral = function(e10) {
|
|
1028
|
+
var t3 = this.startNode();
|
|
1029
|
+
return t3.value = e10, t3.raw = this.input.slice(this.start, this.end), 110 === t3.raw.charCodeAt(t3.raw.length - 1) && (t3.bigint = null != t3.value ? t3.value.toString() : t3.raw.slice(0, -1).replace(/_/g, "")), this.next(), this.finishNode(t3, "Literal");
|
|
1030
|
+
}, W.parseParenExpression = function() {
|
|
1031
|
+
this.expect(x.parenL);
|
|
1032
|
+
var e10 = this.parseExpression();
|
|
1033
|
+
return this.expect(x.parenR), e10;
|
|
1034
|
+
}, W.shouldParseArrow = function(e10) {
|
|
1035
|
+
return !this.canInsertSemicolon();
|
|
1036
|
+
}, W.parseParenAndDistinguishExpression = function(e10, t3) {
|
|
1037
|
+
var i2, s2 = this.start, r2 = this.startLoc, n2 = this.options.ecmaVersion >= 8;
|
|
1038
|
+
if (this.options.ecmaVersion >= 6) {
|
|
1039
|
+
this.next();
|
|
1040
|
+
var a2, o2 = this.start, h2 = this.startLoc, c2 = [], p2 = true, l2 = false, u2 = new acorn_DestructuringErrors(), d2 = this.yieldPos, f2 = this.awaitPos;
|
|
1041
|
+
for (this.yieldPos = 0, this.awaitPos = 0; this.type !== x.parenR; ) {
|
|
1042
|
+
if (p2 ? p2 = false : this.expect(x.comma), n2 && this.afterTrailingComma(x.parenR, true)) {
|
|
1043
|
+
l2 = true;
|
|
1044
|
+
break;
|
|
1045
|
+
}
|
|
1046
|
+
if (this.type === x.ellipsis) {
|
|
1047
|
+
a2 = this.start, c2.push(this.parseParenItem(this.parseRestBinding())), this.type === x.comma && this.raiseRecoverable(this.start, "Comma is not permitted after the rest element");
|
|
1048
|
+
break;
|
|
1049
|
+
}
|
|
1050
|
+
c2.push(this.parseMaybeAssign(false, u2, this.parseParenItem));
|
|
1051
|
+
}
|
|
1052
|
+
var m2 = this.lastTokEnd, g2 = this.lastTokEndLoc;
|
|
1053
|
+
if (this.expect(x.parenR), e10 && this.shouldParseArrow(c2) && this.eat(x.arrow)) return this.checkPatternErrors(u2, false), this.checkYieldAwaitInDefaultParams(), this.yieldPos = d2, this.awaitPos = f2, this.parseParenArrowList(s2, r2, c2, t3);
|
|
1054
|
+
(!c2.length || l2) && this.unexpected(this.lastTokStart), a2 && this.unexpected(a2), this.checkExpressionErrors(u2, true), this.yieldPos = d2 || this.yieldPos, this.awaitPos = f2 || this.awaitPos, c2.length > 1 ? ((i2 = this.startNodeAt(o2, h2)).expressions = c2, this.finishNodeAt(i2, "SequenceExpression", m2, g2)) : i2 = c2[0];
|
|
1055
|
+
} else i2 = this.parseParenExpression();
|
|
1056
|
+
if (!this.options.preserveParens) return i2;
|
|
1057
|
+
var _2 = this.startNodeAt(s2, r2);
|
|
1058
|
+
return _2.expression = i2, this.finishNode(_2, "ParenthesizedExpression");
|
|
1059
|
+
}, W.parseParenItem = function(e10) {
|
|
1060
|
+
return e10;
|
|
1061
|
+
}, W.parseParenArrowList = function(e10, t3, i2, s2) {
|
|
1062
|
+
return this.parseArrowExpression(this.startNodeAt(e10, t3), i2, false, s2);
|
|
1063
|
+
};
|
|
1064
|
+
var G = [];
|
|
1065
|
+
W.parseNew = function() {
|
|
1066
|
+
this.containsEsc && this.raiseRecoverable(this.start, "Escape sequence in keyword new");
|
|
1067
|
+
var e10 = this.startNode();
|
|
1068
|
+
if (this.next(), this.options.ecmaVersion >= 6 && this.type === x.dot) {
|
|
1069
|
+
var t3 = this.startNodeAt(e10.start, e10.loc && e10.loc.start);
|
|
1070
|
+
t3.name = "new", e10.meta = this.finishNode(t3, "Identifier"), this.next();
|
|
1071
|
+
var i2 = this.containsEsc;
|
|
1072
|
+
return e10.property = this.parseIdent(true), "target" !== e10.property.name && this.raiseRecoverable(e10.property.start, "The only valid meta property for new is 'new.target'"), i2 && this.raiseRecoverable(e10.start, "'new.target' must not contain escaped characters"), this.allowNewDotTarget || this.raiseRecoverable(e10.start, "'new.target' can only be used in functions and class static block"), this.finishNode(e10, "MetaProperty");
|
|
1073
|
+
}
|
|
1074
|
+
var s2 = this.start, r2 = this.startLoc;
|
|
1075
|
+
return e10.callee = this.parseSubscripts(this.parseExprAtom(null, false, true), s2, r2, true, false), this.eat(x.parenL) ? e10.arguments = this.parseExprList(x.parenR, this.options.ecmaVersion >= 8, false) : e10.arguments = G, this.finishNode(e10, "NewExpression");
|
|
1076
|
+
}, W.parseTemplateElement = function(e10) {
|
|
1077
|
+
var t3 = e10.isTagged, i2 = this.startNode();
|
|
1078
|
+
return this.type === x.invalidTemplate ? (t3 || this.raiseRecoverable(this.start, "Bad escape sequence in untagged template literal"), i2.value = { raw: this.value.replace(/\r\n?/g, "\n"), cooked: null }) : i2.value = { raw: this.input.slice(this.start, this.end).replace(/\r\n?/g, "\n"), cooked: this.value }, this.next(), i2.tail = this.type === x.backQuote, this.finishNode(i2, "TemplateElement");
|
|
1079
|
+
}, W.parseTemplate = function(e10) {
|
|
1080
|
+
void 0 === e10 && (e10 = {});
|
|
1081
|
+
var t3 = e10.isTagged;
|
|
1082
|
+
void 0 === t3 && (t3 = false);
|
|
1083
|
+
var i2 = this.startNode();
|
|
1084
|
+
this.next(), i2.expressions = [];
|
|
1085
|
+
var s2 = this.parseTemplateElement({ isTagged: t3 });
|
|
1086
|
+
for (i2.quasis = [s2]; !s2.tail; ) this.type === x.eof && this.raise(this.pos, "Unterminated template literal"), this.expect(x.dollarBraceL), i2.expressions.push(this.parseExpression()), this.expect(x.braceR), i2.quasis.push(s2 = this.parseTemplateElement({ isTagged: t3 }));
|
|
1087
|
+
return this.next(), this.finishNode(i2, "TemplateLiteral");
|
|
1088
|
+
}, W.isAsyncProp = function(e10) {
|
|
1089
|
+
return !e10.computed && "Identifier" === e10.key.type && "async" === e10.key.name && (this.type === x.name || this.type === x.num || this.type === x.string || this.type === x.bracketL || this.type.keyword || this.options.ecmaVersion >= 9 && this.type === x.star) && !v.test(this.input.slice(this.lastTokEnd, this.start));
|
|
1090
|
+
}, W.parseObj = function(e10, t3) {
|
|
1091
|
+
var i2 = this.startNode(), s2 = true, r2 = {};
|
|
1092
|
+
for (i2.properties = [], this.next(); !this.eat(x.braceR); ) {
|
|
1093
|
+
if (s2) s2 = false;
|
|
1094
|
+
else if (this.expect(x.comma), this.options.ecmaVersion >= 5 && this.afterTrailingComma(x.braceR)) break;
|
|
1095
|
+
var n2 = this.parseProperty(e10, t3);
|
|
1096
|
+
e10 || this.checkPropClash(n2, r2, t3), i2.properties.push(n2);
|
|
1097
|
+
}
|
|
1098
|
+
return this.finishNode(i2, e10 ? "ObjectPattern" : "ObjectExpression");
|
|
1099
|
+
}, W.parseProperty = function(e10, t3) {
|
|
1100
|
+
var i2, s2, r2, n2, a2 = this.startNode();
|
|
1101
|
+
if (this.options.ecmaVersion >= 9 && this.eat(x.ellipsis)) return e10 ? (a2.argument = this.parseIdent(false), this.type === x.comma && this.raiseRecoverable(this.start, "Comma is not permitted after the rest element"), this.finishNode(a2, "RestElement")) : (a2.argument = this.parseMaybeAssign(false, t3), this.type === x.comma && t3 && t3.trailingComma < 0 && (t3.trailingComma = this.start), this.finishNode(a2, "SpreadElement"));
|
|
1102
|
+
this.options.ecmaVersion >= 6 && (a2.method = false, a2.shorthand = false, (e10 || t3) && (r2 = this.start, n2 = this.startLoc), e10 || (i2 = this.eat(x.star)));
|
|
1103
|
+
var o2 = this.containsEsc;
|
|
1104
|
+
return this.parsePropertyName(a2), !e10 && !o2 && this.options.ecmaVersion >= 8 && !i2 && this.isAsyncProp(a2) ? (s2 = true, i2 = this.options.ecmaVersion >= 9 && this.eat(x.star), this.parsePropertyName(a2)) : s2 = false, this.parsePropertyValue(a2, e10, i2, s2, r2, n2, t3, o2), this.finishNode(a2, "Property");
|
|
1105
|
+
}, W.parseGetterSetter = function(e10) {
|
|
1106
|
+
var t3 = e10.key.name;
|
|
1107
|
+
this.parsePropertyName(e10), e10.value = this.parseMethod(false), e10.kind = t3;
|
|
1108
|
+
var i2 = +("get" !== e10.kind);
|
|
1109
|
+
if (e10.value.params.length !== i2) {
|
|
1110
|
+
var s2 = e10.value.start;
|
|
1111
|
+
"get" === e10.kind ? this.raiseRecoverable(s2, "getter should have no params") : this.raiseRecoverable(s2, "setter should have exactly one param");
|
|
1112
|
+
} else "set" === e10.kind && "RestElement" === e10.value.params[0].type && this.raiseRecoverable(e10.value.params[0].start, "Setter cannot use rest params");
|
|
1113
|
+
}, W.parsePropertyValue = function(e10, t3, i2, s2, r2, n2, a2, o2) {
|
|
1114
|
+
(i2 || s2) && this.type === x.colon && this.unexpected(), this.eat(x.colon) ? (e10.value = t3 ? this.parseMaybeDefault(this.start, this.startLoc) : this.parseMaybeAssign(false, a2), e10.kind = "init") : this.options.ecmaVersion >= 6 && this.type === x.parenL ? (t3 && this.unexpected(), e10.method = true, e10.value = this.parseMethod(i2, s2), e10.kind = "init") : t3 || o2 || !(this.options.ecmaVersion >= 5) || e10.computed || "Identifier" !== e10.key.type || "get" !== e10.key.name && "set" !== e10.key.name || this.type === x.comma || this.type === x.braceR || this.type === x.eq ? this.options.ecmaVersion >= 6 && !e10.computed && "Identifier" === e10.key.type ? ((i2 || s2) && this.unexpected(), this.checkUnreserved(e10.key), "await" !== e10.key.name || this.awaitIdentPos || (this.awaitIdentPos = r2), t3 ? e10.value = this.parseMaybeDefault(r2, n2, this.copyNode(e10.key)) : this.type === x.eq && a2 ? (a2.shorthandAssign < 0 && (a2.shorthandAssign = this.start), e10.value = this.parseMaybeDefault(r2, n2, this.copyNode(e10.key))) : e10.value = this.copyNode(e10.key), e10.kind = "init", e10.shorthand = true) : this.unexpected() : ((i2 || s2) && this.unexpected(), this.parseGetterSetter(e10));
|
|
1115
|
+
}, W.parsePropertyName = function(e10) {
|
|
1116
|
+
if (this.options.ecmaVersion >= 6) if (this.eat(x.bracketL)) return e10.computed = true, e10.key = this.parseMaybeAssign(), this.expect(x.bracketR), e10.key;
|
|
1117
|
+
else e10.computed = false;
|
|
1118
|
+
return e10.key = this.type === x.num || this.type === x.string ? this.parseExprAtom() : this.parseIdent("never" !== this.options.allowReserved);
|
|
1119
|
+
}, W.initFunction = function(e10) {
|
|
1120
|
+
e10.id = null, this.options.ecmaVersion >= 6 && (e10.generator = e10.expression = false), this.options.ecmaVersion >= 8 && (e10.async = false);
|
|
1121
|
+
}, W.parseMethod = function(e10, t3, i2) {
|
|
1122
|
+
var s2 = this.startNode(), r2 = this.yieldPos, n2 = this.awaitPos, a2 = this.awaitIdentPos;
|
|
1123
|
+
return this.initFunction(s2), this.options.ecmaVersion >= 6 && (s2.generator = e10), this.options.ecmaVersion >= 8 && (s2.async = !!t3), this.yieldPos = 0, this.awaitPos = 0, this.awaitIdentPos = 0, this.enterScope(64 | functionFlags(t3, s2.generator) | 128 * !!i2), this.expect(x.parenL), s2.params = this.parseBindingList(x.parenR, false, this.options.ecmaVersion >= 8), this.checkYieldAwaitInDefaultParams(), this.parseFunctionBody(s2, false, true, false), this.yieldPos = r2, this.awaitPos = n2, this.awaitIdentPos = a2, this.finishNode(s2, "FunctionExpression");
|
|
1124
|
+
}, W.parseArrowExpression = function(e10, t3, i2, s2) {
|
|
1125
|
+
var r2 = this.yieldPos, n2 = this.awaitPos, a2 = this.awaitIdentPos;
|
|
1126
|
+
return this.enterScope(16 | functionFlags(i2, false)), this.initFunction(e10), this.options.ecmaVersion >= 8 && (e10.async = !!i2), this.yieldPos = 0, this.awaitPos = 0, this.awaitIdentPos = 0, e10.params = this.toAssignableList(t3, true), this.parseFunctionBody(e10, true, false, s2), this.yieldPos = r2, this.awaitPos = n2, this.awaitIdentPos = a2, this.finishNode(e10, "ArrowFunctionExpression");
|
|
1127
|
+
}, W.parseFunctionBody = function(e10, t3, i2, s2) {
|
|
1128
|
+
var r2 = t3 && this.type !== x.braceL, n2 = this.strict, a2 = false;
|
|
1129
|
+
if (r2) e10.body = this.parseMaybeAssign(s2), e10.expression = true, this.checkParams(e10, false);
|
|
1130
|
+
else {
|
|
1131
|
+
var o2 = this.options.ecmaVersion >= 7 && !this.isSimpleParamList(e10.params);
|
|
1132
|
+
(!n2 || o2) && (a2 = this.strictDirective(this.end)) && o2 && this.raiseRecoverable(e10.start, "Illegal 'use strict' directive in function with non-simple parameter list");
|
|
1133
|
+
var h2 = this.labels;
|
|
1134
|
+
this.labels = [], a2 && (this.strict = true), this.checkParams(e10, !n2 && !a2 && !t3 && !i2 && this.isSimpleParamList(e10.params)), this.strict && e10.id && this.checkLValSimple(e10.id, 5), e10.body = this.parseBlock(false, void 0, a2 && !n2), e10.expression = false, this.adaptDirectivePrologue(e10.body.body), this.labels = h2;
|
|
1135
|
+
}
|
|
1136
|
+
this.exitScope();
|
|
1137
|
+
}, W.isSimpleParamList = function(e10) {
|
|
1138
|
+
for (var t3 = 0; t3 < e10.length; t3 += 1) if ("Identifier" !== e10[t3].type) return false;
|
|
1139
|
+
return true;
|
|
1140
|
+
}, W.checkParams = function(e10, t3) {
|
|
1141
|
+
for (var i2 = /* @__PURE__ */ Object.create(null), s2 = 0, r2 = e10.params; s2 < r2.length; s2 += 1) {
|
|
1142
|
+
var n2 = r2[s2];
|
|
1143
|
+
this.checkLValInnerPattern(n2, 1, t3 ? null : i2);
|
|
1144
|
+
}
|
|
1145
|
+
}, W.parseExprList = function(e10, t3, i2, s2) {
|
|
1146
|
+
for (var r2 = [], n2 = true; !this.eat(e10); ) {
|
|
1147
|
+
if (n2) n2 = false;
|
|
1148
|
+
else if (this.expect(x.comma), t3 && this.afterTrailingComma(e10)) break;
|
|
1149
|
+
var a2 = void 0;
|
|
1150
|
+
i2 && this.type === x.comma ? a2 = null : this.type === x.ellipsis ? (a2 = this.parseSpread(s2), s2 && this.type === x.comma && s2.trailingComma < 0 && (s2.trailingComma = this.start)) : a2 = this.parseMaybeAssign(false, s2), r2.push(a2);
|
|
1151
|
+
}
|
|
1152
|
+
return r2;
|
|
1153
|
+
}, W.checkUnreserved = function(e10) {
|
|
1154
|
+
var t3 = e10.start, i2 = e10.end, s2 = e10.name;
|
|
1155
|
+
this.inGenerator && "yield" === s2 && this.raiseRecoverable(t3, "Cannot use 'yield' as identifier inside a generator"), this.inAsync && "await" === s2 && this.raiseRecoverable(t3, "Cannot use 'await' as identifier inside an async function"), 259 & this.currentThisScope().flags || "arguments" !== s2 || this.raiseRecoverable(t3, "Cannot use 'arguments' in class field initializer"), this.inClassStaticBlock && ("arguments" === s2 || "await" === s2) && this.raise(t3, "Cannot use " + s2 + " in class static initialization block"), this.keywords.test(s2) && this.raise(t3, "Unexpected keyword '" + s2 + "'"), (!(this.options.ecmaVersion < 6) || -1 === this.input.slice(t3, i2).indexOf("\\")) && (this.strict ? this.reservedWordsStrict : this.reservedWords).test(s2) && (this.inAsync || "await" !== s2 || this.raiseRecoverable(t3, "Cannot use keyword 'await' outside an async function"), this.raiseRecoverable(t3, "The keyword '" + s2 + "' is reserved"));
|
|
1156
|
+
}, W.parseIdent = function(e10) {
|
|
1157
|
+
var t3 = this.parseIdentNode();
|
|
1158
|
+
return this.next(!!e10), this.finishNode(t3, "Identifier"), !e10 && (this.checkUnreserved(t3), "await" !== t3.name || this.awaitIdentPos || (this.awaitIdentPos = t3.start)), t3;
|
|
1159
|
+
}, W.parseIdentNode = function() {
|
|
1160
|
+
var e10 = this.startNode();
|
|
1161
|
+
return this.type === x.name ? e10.name = this.value : this.type.keyword ? (e10.name = this.type.keyword, ("class" === e10.name || "function" === e10.name) && (this.lastTokEnd !== this.lastTokStart + 1 || 46 !== this.input.charCodeAt(this.lastTokStart)) && this.context.pop(), this.type = x.name) : this.unexpected(), e10;
|
|
1162
|
+
}, W.parsePrivateIdent = function() {
|
|
1163
|
+
var e10 = this.startNode();
|
|
1164
|
+
return this.type === x.privateId ? e10.name = this.value : this.unexpected(), this.next(), this.finishNode(e10, "PrivateIdentifier"), this.options.checkPrivateFields && (0 === this.privateNameStack.length ? this.raise(e10.start, "Private field '#" + e10.name + "' must be declared in an enclosing class") : this.privateNameStack[this.privateNameStack.length - 1].used.push(e10)), e10;
|
|
1165
|
+
}, W.parseYield = function(e10) {
|
|
1166
|
+
this.yieldPos || (this.yieldPos = this.start);
|
|
1167
|
+
var t3 = this.startNode();
|
|
1168
|
+
return this.next(), this.type === x.semi || this.canInsertSemicolon() || this.type !== x.star && !this.type.startsExpr ? (t3.delegate = false, t3.argument = null) : (t3.delegate = this.eat(x.star), t3.argument = this.parseMaybeAssign(e10)), this.finishNode(t3, "YieldExpression");
|
|
1169
|
+
}, W.parseAwait = function(e10) {
|
|
1170
|
+
this.awaitPos || (this.awaitPos = this.start);
|
|
1171
|
+
var t3 = this.startNode();
|
|
1172
|
+
return this.next(), t3.argument = this.parseMaybeUnary(null, true, false, e10), this.finishNode(t3, "AwaitExpression");
|
|
1173
|
+
};
|
|
1174
|
+
var H = acorn_Parser.prototype;
|
|
1175
|
+
H.raise = function(e10, t3) {
|
|
1176
|
+
var i2 = getLineInfo(this.input, e10);
|
|
1177
|
+
t3 += " (" + i2.line + ":" + i2.column + ")", this.sourceFile && (t3 += " in " + this.sourceFile);
|
|
1178
|
+
var s2 = SyntaxError(t3);
|
|
1179
|
+
throw s2.pos = e10, s2.loc = i2, s2.raisedAt = this.pos, s2;
|
|
1180
|
+
}, H.raiseRecoverable = H.raise, H.curPosition = function() {
|
|
1181
|
+
if (this.options.locations) return new acorn_Position(this.curLine, this.pos - this.lineStart);
|
|
1182
|
+
};
|
|
1183
|
+
var z = acorn_Parser.prototype, acorn_Scope = /* @__PURE__ */ __name(function(e10) {
|
|
1184
|
+
this.flags = e10, this.var = [], this.lexical = [], this.functions = [];
|
|
1185
|
+
}, "acorn_Scope");
|
|
1186
|
+
z.enterScope = function(e10) {
|
|
1187
|
+
this.scopeStack.push(new acorn_Scope(e10));
|
|
1188
|
+
}, z.exitScope = function() {
|
|
1189
|
+
this.scopeStack.pop();
|
|
1190
|
+
}, z.treatFunctionsAsVarInScope = function(e10) {
|
|
1191
|
+
return 2 & e10.flags || !this.inModule && 1 & e10.flags;
|
|
1192
|
+
}, z.declareName = function(e10, t3, i2) {
|
|
1193
|
+
var s2 = false;
|
|
1194
|
+
if (2 === t3) {
|
|
1195
|
+
var r2 = this.currentScope();
|
|
1196
|
+
s2 = r2.lexical.indexOf(e10) > -1 || r2.functions.indexOf(e10) > -1 || r2.var.indexOf(e10) > -1, r2.lexical.push(e10), this.inModule && 1 & r2.flags && delete this.undefinedExports[e10];
|
|
1197
|
+
} else if (4 === t3) this.currentScope().lexical.push(e10);
|
|
1198
|
+
else if (3 === t3) {
|
|
1199
|
+
var n2 = this.currentScope();
|
|
1200
|
+
s2 = this.treatFunctionsAsVar ? n2.lexical.indexOf(e10) > -1 : n2.lexical.indexOf(e10) > -1 || n2.var.indexOf(e10) > -1, n2.functions.push(e10);
|
|
1201
|
+
} else for (var a2 = this.scopeStack.length - 1; a2 >= 0; --a2) {
|
|
1202
|
+
var o2 = this.scopeStack[a2];
|
|
1203
|
+
if (o2.lexical.indexOf(e10) > -1 && !(32 & o2.flags && o2.lexical[0] === e10) || !this.treatFunctionsAsVarInScope(o2) && o2.functions.indexOf(e10) > -1) {
|
|
1204
|
+
s2 = true;
|
|
1205
|
+
break;
|
|
1206
|
+
}
|
|
1207
|
+
if (o2.var.push(e10), this.inModule && 1 & o2.flags && delete this.undefinedExports[e10], 259 & o2.flags) break;
|
|
1208
|
+
}
|
|
1209
|
+
s2 && this.raiseRecoverable(i2, "Identifier '" + e10 + "' has already been declared");
|
|
1210
|
+
}, z.checkLocalExport = function(e10) {
|
|
1211
|
+
-1 === this.scopeStack[0].lexical.indexOf(e10.name) && -1 === this.scopeStack[0].var.indexOf(e10.name) && (this.undefinedExports[e10.name] = e10);
|
|
1212
|
+
}, z.currentScope = function() {
|
|
1213
|
+
return this.scopeStack[this.scopeStack.length - 1];
|
|
1214
|
+
}, z.currentVarScope = function() {
|
|
1215
|
+
for (var e10 = this.scopeStack.length - 1; ; e10--) {
|
|
1216
|
+
var t3 = this.scopeStack[e10];
|
|
1217
|
+
if (771 & t3.flags) return t3;
|
|
1218
|
+
}
|
|
1219
|
+
}, z.currentThisScope = function() {
|
|
1220
|
+
for (var e10 = this.scopeStack.length - 1; ; e10--) {
|
|
1221
|
+
var t3 = this.scopeStack[e10];
|
|
1222
|
+
if (771 & t3.flags && !(16 & t3.flags)) return t3;
|
|
1223
|
+
}
|
|
1224
|
+
};
|
|
1225
|
+
var acorn_Node = /* @__PURE__ */ __name(function(e10, t3, i2) {
|
|
1226
|
+
this.type = "", this.start = t3, this.end = 0, e10.options.locations && (this.loc = new acorn_SourceLocation(e10, i2)), e10.options.directSourceFile && (this.sourceFile = e10.options.directSourceFile), e10.options.ranges && (this.range = [t3, 0]);
|
|
1227
|
+
}, "acorn_Node"), K = acorn_Parser.prototype;
|
|
1228
|
+
function finishNodeAt(e10, t3, i2, s2) {
|
|
1229
|
+
return e10.type = t3, e10.end = i2, this.options.locations && (e10.loc.end = s2), this.options.ranges && (e10.range[1] = i2), e10;
|
|
1230
|
+
}
|
|
1231
|
+
__name(finishNodeAt, "finishNodeAt");
|
|
1232
|
+
K.startNode = function() {
|
|
1233
|
+
return new acorn_Node(this, this.start, this.startLoc);
|
|
1234
|
+
}, K.startNodeAt = function(e10, t3) {
|
|
1235
|
+
return new acorn_Node(this, e10, t3);
|
|
1236
|
+
}, K.finishNode = function(e10, t3) {
|
|
1237
|
+
return finishNodeAt.call(this, e10, t3, this.lastTokEnd, this.lastTokEndLoc);
|
|
1238
|
+
}, K.finishNodeAt = function(e10, t3, i2, s2) {
|
|
1239
|
+
return finishNodeAt.call(this, e10, t3, i2, s2);
|
|
1240
|
+
}, K.copyNode = function(e10) {
|
|
1241
|
+
var t3 = new acorn_Node(this, e10.start, this.startLoc);
|
|
1242
|
+
for (var i2 in e10) t3[i2] = e10[i2];
|
|
1243
|
+
return t3;
|
|
1244
|
+
};
|
|
1245
|
+
var Z = "ASCII ASCII_Hex_Digit AHex Alphabetic Alpha Any Assigned Bidi_Control Bidi_C Bidi_Mirrored Bidi_M Case_Ignorable CI Cased Changes_When_Casefolded CWCF Changes_When_Casemapped CWCM Changes_When_Lowercased CWL Changes_When_NFKC_Casefolded CWKCF Changes_When_Titlecased CWT Changes_When_Uppercased CWU Dash Default_Ignorable_Code_Point DI Deprecated Dep Diacritic Dia Emoji Emoji_Component Emoji_Modifier Emoji_Modifier_Base Emoji_Presentation Extender Ext Grapheme_Base Gr_Base Grapheme_Extend Gr_Ext Hex_Digit Hex IDS_Binary_Operator IDSB IDS_Trinary_Operator IDST ID_Continue IDC ID_Start IDS Ideographic Ideo Join_Control Join_C Logical_Order_Exception LOE Lowercase Lower Math Noncharacter_Code_Point NChar Pattern_Syntax Pat_Syn Pattern_White_Space Pat_WS Quotation_Mark QMark Radical Regional_Indicator RI Sentence_Terminal STerm Soft_Dotted SD Terminal_Punctuation Term Unified_Ideograph UIdeo Uppercase Upper Variation_Selector VS White_Space space XID_Continue XIDC XID_Start XIDS", J = Z + " Extended_Pictographic", Y = J + " EBase EComp EMod EPres ExtPict", Q = { 9: Z, 10: J, 11: J, 12: Y, 13: Y, 14: Y }, X = { 9: "", 10: "", 11: "", 12: "", 13: "", 14: "Basic_Emoji Emoji_Keycap_Sequence RGI_Emoji_Modifier_Sequence RGI_Emoji_Flag_Sequence RGI_Emoji_Tag_Sequence RGI_Emoji_ZWJ_Sequence RGI_Emoji" }, ee = "Cased_Letter LC Close_Punctuation Pe Connector_Punctuation Pc Control Cc cntrl Currency_Symbol Sc Dash_Punctuation Pd Decimal_Number Nd digit Enclosing_Mark Me Final_Punctuation Pf Format Cf Initial_Punctuation Pi Letter L Letter_Number Nl Line_Separator Zl Lowercase_Letter Ll Mark M Combining_Mark Math_Symbol Sm Modifier_Letter Lm Modifier_Symbol Sk Nonspacing_Mark Mn Number N Open_Punctuation Ps Other C Other_Letter Lo Other_Number No Other_Punctuation Po Other_Symbol So Paragraph_Separator Zp Private_Use Co Punctuation P punct Separator Z Space_Separator Zs Spacing_Mark Mc Surrogate Cs Symbol S Titlecase_Letter Lt Unassigned Cn Uppercase_Letter Lu", et = "Adlam Adlm Ahom Anatolian_Hieroglyphs Hluw Arabic Arab Armenian Armn Avestan Avst Balinese Bali Bamum Bamu Bassa_Vah Bass Batak Batk Bengali Beng Bhaiksuki Bhks Bopomofo Bopo Brahmi Brah Braille Brai Buginese Bugi Buhid Buhd Canadian_Aboriginal Cans Carian Cari Caucasian_Albanian Aghb Chakma Cakm Cham Cham Cherokee Cher Common Zyyy Coptic Copt Qaac Cuneiform Xsux Cypriot Cprt Cyrillic Cyrl Deseret Dsrt Devanagari Deva Duployan Dupl Egyptian_Hieroglyphs Egyp Elbasan Elba Ethiopic Ethi Georgian Geor Glagolitic Glag Gothic Goth Grantha Gran Greek Grek Gujarati Gujr Gurmukhi Guru Han Hani Hangul Hang Hanunoo Hano Hatran Hatr Hebrew Hebr Hiragana Hira Imperial_Aramaic Armi Inherited Zinh Qaai Inscriptional_Pahlavi Phli Inscriptional_Parthian Prti Javanese Java Kaithi Kthi Kannada Knda Katakana Kana Kayah_Li Kali Kharoshthi Khar Khmer Khmr Khojki Khoj Khudawadi Sind Lao Laoo Latin Latn Lepcha Lepc Limbu Limb Linear_A Lina Linear_B Linb Lisu Lisu Lycian Lyci Lydian Lydi Mahajani Mahj Malayalam Mlym Mandaic Mand Manichaean Mani Marchen Marc Masaram_Gondi Gonm Meetei_Mayek Mtei Mende_Kikakui Mend Meroitic_Cursive Merc Meroitic_Hieroglyphs Mero Miao Plrd Modi Mongolian Mong Mro Mroo Multani Mult Myanmar Mymr Nabataean Nbat New_Tai_Lue Talu Newa Newa Nko Nkoo Nushu Nshu Ogham Ogam Ol_Chiki Olck Old_Hungarian Hung Old_Italic Ital Old_North_Arabian Narb Old_Permic Perm Old_Persian Xpeo Old_South_Arabian Sarb Old_Turkic Orkh Oriya Orya Osage Osge Osmanya Osma Pahawh_Hmong Hmng Palmyrene Palm Pau_Cin_Hau Pauc Phags_Pa Phag Phoenician Phnx Psalter_Pahlavi Phlp Rejang Rjng Runic Runr Samaritan Samr Saurashtra Saur Sharada Shrd Shavian Shaw Siddham Sidd SignWriting Sgnw Sinhala Sinh Sora_Sompeng Sora Soyombo Soyo Sundanese Sund Syloti_Nagri Sylo Syriac Syrc Tagalog Tglg Tagbanwa Tagb Tai_Le Tale Tai_Tham Lana Tai_Viet Tavt Takri Takr Tamil Taml Tangut Tang Telugu Telu Thaana Thaa Thai Thai Tibetan Tibt Tifinagh Tfng Tirhuta Tirh Ugaritic Ugar Vai Vaii Warang_Citi Wara Yi Yiii Zanabazar_Square Zanb", ei = et + " Dogra Dogr Gunjala_Gondi Gong Hanifi_Rohingya Rohg Makasar Maka Medefaidrin Medf Old_Sogdian Sogo Sogdian Sogd", es = ei + " Elymaic Elym Nandinagari Nand Nyiakeng_Puachue_Hmong Hmnp Wancho Wcho", er = es + " Chorasmian Chrs Diak Dives_Akuru Khitan_Small_Script Kits Yezi Yezidi", en = er + " Cypro_Minoan Cpmn Old_Uyghur Ougr Tangsa Tnsa Toto Vithkuqi Vith", ea = { 9: et, 10: ei, 11: es, 12: er, 13: en, 14: en + " Gara Garay Gukh Gurung_Khema Hrkt Katakana_Or_Hiragana Kawi Kirat_Rai Krai Nag_Mundari Nagm Ol_Onal Onao Sunu Sunuwar Todhri Todr Tulu_Tigalari Tutg Unknown Zzzz" }, eo = {};
|
|
1246
|
+
function buildUnicodeData(e10) {
|
|
1247
|
+
var t3 = eo[e10] = { binary: wordsRegexp(Q[e10] + " " + ee), binaryOfStrings: wordsRegexp(X[e10]), nonBinary: { General_Category: wordsRegexp(ee), Script: wordsRegexp(ea[e10]) } };
|
|
1248
|
+
t3.nonBinary.Script_Extensions = t3.nonBinary.Script, t3.nonBinary.gc = t3.nonBinary.General_Category, t3.nonBinary.sc = t3.nonBinary.Script, t3.nonBinary.scx = t3.nonBinary.Script_Extensions;
|
|
1249
|
+
}
|
|
1250
|
+
__name(buildUnicodeData, "buildUnicodeData");
|
|
1251
|
+
for (var eh = 0, ec = [9, 10, 11, 12, 13, 14]; eh < ec.length; eh += 1) buildUnicodeData(ec[eh]);
|
|
1252
|
+
var ep = acorn_Parser.prototype, acorn_BranchID = /* @__PURE__ */ __name(function(e10, t3) {
|
|
1253
|
+
this.parent = e10, this.base = t3 || this;
|
|
1254
|
+
}, "acorn_BranchID");
|
|
1255
|
+
acorn_BranchID.prototype.separatedFrom = function(e10) {
|
|
1256
|
+
for (var t3 = this; t3; t3 = t3.parent) for (var i2 = e10; i2; i2 = i2.parent) if (t3.base === i2.base && t3 !== i2) return true;
|
|
1257
|
+
return false;
|
|
1258
|
+
}, acorn_BranchID.prototype.sibling = function() {
|
|
1259
|
+
return new acorn_BranchID(this.parent, this.base);
|
|
1260
|
+
};
|
|
1261
|
+
var acorn_RegExpValidationState = /* @__PURE__ */ __name(function(e10) {
|
|
1262
|
+
this.parser = e10, this.validFlags = "gim" + (e10.options.ecmaVersion >= 6 ? "uy" : "") + (e10.options.ecmaVersion >= 9 ? "s" : "") + (e10.options.ecmaVersion >= 13 ? "d" : "") + (e10.options.ecmaVersion >= 15 ? "v" : ""), this.unicodeProperties = eo[e10.options.ecmaVersion >= 14 ? 14 : e10.options.ecmaVersion], this.source = "", this.flags = "", this.start = 0, this.switchU = false, this.switchV = false, this.switchN = false, this.pos = 0, this.lastIntValue = 0, this.lastStringValue = "", this.lastAssertionIsQuantifiable = false, this.numCapturingParens = 0, this.maxBackReference = 0, this.groupNames = /* @__PURE__ */ Object.create(null), this.backReferenceNames = [], this.branchID = null;
|
|
1263
|
+
}, "acorn_RegExpValidationState");
|
|
1264
|
+
function hasProp(e10) {
|
|
1265
|
+
for (var t3 in e10) return true;
|
|
1266
|
+
return false;
|
|
1267
|
+
}
|
|
1268
|
+
__name(hasProp, "hasProp");
|
|
1269
|
+
function isRegularExpressionModifier(e10) {
|
|
1270
|
+
return 105 === e10 || 109 === e10 || 115 === e10;
|
|
1271
|
+
}
|
|
1272
|
+
__name(isRegularExpressionModifier, "isRegularExpressionModifier");
|
|
1273
|
+
function isSyntaxCharacter(e10) {
|
|
1274
|
+
return 36 === e10 || e10 >= 40 && e10 <= 43 || 46 === e10 || 63 === e10 || e10 >= 91 && e10 <= 94 || e10 >= 123 && e10 <= 125;
|
|
1275
|
+
}
|
|
1276
|
+
__name(isSyntaxCharacter, "isSyntaxCharacter");
|
|
1277
|
+
function isRegExpIdentifierStart(e10) {
|
|
1278
|
+
return isIdentifierStart(e10, true) || 36 === e10 || 95 === e10;
|
|
1279
|
+
}
|
|
1280
|
+
__name(isRegExpIdentifierStart, "isRegExpIdentifierStart");
|
|
1281
|
+
function isRegExpIdentifierPart(e10) {
|
|
1282
|
+
return isIdentifierChar(e10, true) || 36 === e10 || 95 === e10 || 8204 === e10 || 8205 === e10;
|
|
1283
|
+
}
|
|
1284
|
+
__name(isRegExpIdentifierPart, "isRegExpIdentifierPart");
|
|
1285
|
+
function isControlLetter(e10) {
|
|
1286
|
+
return e10 >= 65 && e10 <= 90 || e10 >= 97 && e10 <= 122;
|
|
1287
|
+
}
|
|
1288
|
+
__name(isControlLetter, "isControlLetter");
|
|
1289
|
+
function isValidUnicode(e10) {
|
|
1290
|
+
return e10 >= 0 && e10 <= 1114111;
|
|
1291
|
+
}
|
|
1292
|
+
__name(isValidUnicode, "isValidUnicode");
|
|
1293
|
+
function isCharacterClassEscape(e10) {
|
|
1294
|
+
return 100 === e10 || 68 === e10 || 115 === e10 || 83 === e10 || 119 === e10 || 87 === e10;
|
|
1295
|
+
}
|
|
1296
|
+
__name(isCharacterClassEscape, "isCharacterClassEscape");
|
|
1297
|
+
function isUnicodePropertyNameCharacter(e10) {
|
|
1298
|
+
return isControlLetter(e10) || 95 === e10;
|
|
1299
|
+
}
|
|
1300
|
+
__name(isUnicodePropertyNameCharacter, "isUnicodePropertyNameCharacter");
|
|
1301
|
+
function isUnicodePropertyValueCharacter(e10) {
|
|
1302
|
+
return isUnicodePropertyNameCharacter(e10) || isDecimalDigit(e10);
|
|
1303
|
+
}
|
|
1304
|
+
__name(isUnicodePropertyValueCharacter, "isUnicodePropertyValueCharacter");
|
|
1305
|
+
function isClassSetReservedDoublePunctuatorCharacter(e10) {
|
|
1306
|
+
return 33 === e10 || e10 >= 35 && e10 <= 38 || e10 >= 42 && e10 <= 44 || 46 === e10 || e10 >= 58 && e10 <= 64 || 94 === e10 || 96 === e10 || 126 === e10;
|
|
1307
|
+
}
|
|
1308
|
+
__name(isClassSetReservedDoublePunctuatorCharacter, "isClassSetReservedDoublePunctuatorCharacter");
|
|
1309
|
+
function isClassSetSyntaxCharacter(e10) {
|
|
1310
|
+
return 40 === e10 || 41 === e10 || 45 === e10 || 47 === e10 || e10 >= 91 && e10 <= 93 || e10 >= 123 && e10 <= 125;
|
|
1311
|
+
}
|
|
1312
|
+
__name(isClassSetSyntaxCharacter, "isClassSetSyntaxCharacter");
|
|
1313
|
+
function isClassSetReservedPunctuator(e10) {
|
|
1314
|
+
return 33 === e10 || 35 === e10 || 37 === e10 || 38 === e10 || 44 === e10 || 45 === e10 || e10 >= 58 && e10 <= 62 || 64 === e10 || 96 === e10 || 126 === e10;
|
|
1315
|
+
}
|
|
1316
|
+
__name(isClassSetReservedPunctuator, "isClassSetReservedPunctuator");
|
|
1317
|
+
function isDecimalDigit(e10) {
|
|
1318
|
+
return e10 >= 48 && e10 <= 57;
|
|
1319
|
+
}
|
|
1320
|
+
__name(isDecimalDigit, "isDecimalDigit");
|
|
1321
|
+
function isHexDigit(e10) {
|
|
1322
|
+
return e10 >= 48 && e10 <= 57 || e10 >= 65 && e10 <= 70 || e10 >= 97 && e10 <= 102;
|
|
1323
|
+
}
|
|
1324
|
+
__name(isHexDigit, "isHexDigit");
|
|
1325
|
+
function hexToInt(e10) {
|
|
1326
|
+
return e10 >= 65 && e10 <= 70 ? 10 + (e10 - 65) : e10 >= 97 && e10 <= 102 ? 10 + (e10 - 97) : e10 - 48;
|
|
1327
|
+
}
|
|
1328
|
+
__name(hexToInt, "hexToInt");
|
|
1329
|
+
function isOctalDigit(e10) {
|
|
1330
|
+
return e10 >= 48 && e10 <= 55;
|
|
1331
|
+
}
|
|
1332
|
+
__name(isOctalDigit, "isOctalDigit");
|
|
1333
|
+
acorn_RegExpValidationState.prototype.reset = function(e10, t3, i2) {
|
|
1334
|
+
var s2 = -1 !== i2.indexOf("v"), r2 = -1 !== i2.indexOf("u");
|
|
1335
|
+
this.start = 0 | e10, this.source = t3 + "", this.flags = i2, s2 && this.parser.options.ecmaVersion >= 15 ? (this.switchU = true, this.switchV = true, this.switchN = true) : (this.switchU = r2 && this.parser.options.ecmaVersion >= 6, this.switchV = false, this.switchN = r2 && this.parser.options.ecmaVersion >= 9);
|
|
1336
|
+
}, acorn_RegExpValidationState.prototype.raise = function(e10) {
|
|
1337
|
+
this.parser.raiseRecoverable(this.start, "Invalid regular expression: /" + this.source + "/: " + e10);
|
|
1338
|
+
}, acorn_RegExpValidationState.prototype.at = function(e10, t3) {
|
|
1339
|
+
void 0 === t3 && (t3 = false);
|
|
1340
|
+
var i2 = this.source, s2 = i2.length;
|
|
1341
|
+
if (e10 >= s2) return -1;
|
|
1342
|
+
var r2 = i2.charCodeAt(e10);
|
|
1343
|
+
if (!(t3 || this.switchU) || r2 <= 55295 || r2 >= 57344 || e10 + 1 >= s2) return r2;
|
|
1344
|
+
var n2 = i2.charCodeAt(e10 + 1);
|
|
1345
|
+
return n2 >= 56320 && n2 <= 57343 ? (r2 << 10) + n2 - 56613888 : r2;
|
|
1346
|
+
}, acorn_RegExpValidationState.prototype.nextIndex = function(e10, t3) {
|
|
1347
|
+
void 0 === t3 && (t3 = false);
|
|
1348
|
+
var i2 = this.source, s2 = i2.length;
|
|
1349
|
+
if (e10 >= s2) return s2;
|
|
1350
|
+
var r2, n2 = i2.charCodeAt(e10);
|
|
1351
|
+
return !(t3 || this.switchU) || n2 <= 55295 || n2 >= 57344 || e10 + 1 >= s2 || (r2 = i2.charCodeAt(e10 + 1)) < 56320 || r2 > 57343 ? e10 + 1 : e10 + 2;
|
|
1352
|
+
}, acorn_RegExpValidationState.prototype.current = function(e10) {
|
|
1353
|
+
return void 0 === e10 && (e10 = false), this.at(this.pos, e10);
|
|
1354
|
+
}, acorn_RegExpValidationState.prototype.lookahead = function(e10) {
|
|
1355
|
+
return void 0 === e10 && (e10 = false), this.at(this.nextIndex(this.pos, e10), e10);
|
|
1356
|
+
}, acorn_RegExpValidationState.prototype.advance = function(e10) {
|
|
1357
|
+
void 0 === e10 && (e10 = false), this.pos = this.nextIndex(this.pos, e10);
|
|
1358
|
+
}, acorn_RegExpValidationState.prototype.eat = function(e10, t3) {
|
|
1359
|
+
return void 0 === t3 && (t3 = false), this.current(t3) === e10 && (this.advance(t3), true);
|
|
1360
|
+
}, acorn_RegExpValidationState.prototype.eatChars = function(e10, t3) {
|
|
1361
|
+
void 0 === t3 && (t3 = false);
|
|
1362
|
+
for (var i2 = this.pos, s2 = 0; s2 < e10.length; s2 += 1) {
|
|
1363
|
+
var r2 = e10[s2], n2 = this.at(i2, t3);
|
|
1364
|
+
if (-1 === n2 || n2 !== r2) return false;
|
|
1365
|
+
i2 = this.nextIndex(i2, t3);
|
|
1366
|
+
}
|
|
1367
|
+
return this.pos = i2, true;
|
|
1368
|
+
}, ep.validateRegExpFlags = function(e10) {
|
|
1369
|
+
for (var t3 = e10.validFlags, i2 = e10.flags, s2 = false, r2 = false, n2 = 0; n2 < i2.length; n2++) {
|
|
1370
|
+
var a2 = i2.charAt(n2);
|
|
1371
|
+
-1 === t3.indexOf(a2) && this.raise(e10.start, "Invalid regular expression flag"), i2.indexOf(a2, n2 + 1) > -1 && this.raise(e10.start, "Duplicate regular expression flag"), "u" === a2 && (s2 = true), "v" === a2 && (r2 = true);
|
|
1372
|
+
}
|
|
1373
|
+
this.options.ecmaVersion >= 15 && s2 && r2 && this.raise(e10.start, "Invalid regular expression flag");
|
|
1374
|
+
}, ep.validateRegExpPattern = function(e10) {
|
|
1375
|
+
this.regexp_pattern(e10), !e10.switchN && this.options.ecmaVersion >= 9 && hasProp(e10.groupNames) && (e10.switchN = true, this.regexp_pattern(e10));
|
|
1376
|
+
}, ep.regexp_pattern = function(e10) {
|
|
1377
|
+
e10.pos = 0, e10.lastIntValue = 0, e10.lastStringValue = "", e10.lastAssertionIsQuantifiable = false, e10.numCapturingParens = 0, e10.maxBackReference = 0, e10.groupNames = /* @__PURE__ */ Object.create(null), e10.backReferenceNames.length = 0, e10.branchID = null, this.regexp_disjunction(e10), e10.pos !== e10.source.length && (e10.eat(41) && e10.raise("Unmatched ')'"), (e10.eat(93) || e10.eat(125)) && e10.raise("Lone quantifier brackets")), e10.maxBackReference > e10.numCapturingParens && e10.raise("Invalid escape");
|
|
1378
|
+
for (var t3 = 0, i2 = e10.backReferenceNames; t3 < i2.length; t3 += 1) {
|
|
1379
|
+
var s2 = i2[t3];
|
|
1380
|
+
e10.groupNames[s2] || e10.raise("Invalid named capture referenced");
|
|
1381
|
+
}
|
|
1382
|
+
}, ep.regexp_disjunction = function(e10) {
|
|
1383
|
+
var t3 = this.options.ecmaVersion >= 16;
|
|
1384
|
+
for (t3 && (e10.branchID = new acorn_BranchID(e10.branchID, null)), this.regexp_alternative(e10); e10.eat(124); ) t3 && (e10.branchID = e10.branchID.sibling()), this.regexp_alternative(e10);
|
|
1385
|
+
t3 && (e10.branchID = e10.branchID.parent), this.regexp_eatQuantifier(e10, true) && e10.raise("Nothing to repeat"), e10.eat(123) && e10.raise("Lone quantifier brackets");
|
|
1386
|
+
}, ep.regexp_alternative = function(e10) {
|
|
1387
|
+
for (; e10.pos < e10.source.length && this.regexp_eatTerm(e10); ) ;
|
|
1388
|
+
}, ep.regexp_eatTerm = function(e10) {
|
|
1389
|
+
return this.regexp_eatAssertion(e10) ? (e10.lastAssertionIsQuantifiable && this.regexp_eatQuantifier(e10) && e10.switchU && e10.raise("Invalid quantifier"), true) : (e10.switchU ? !!this.regexp_eatAtom(e10) : !!this.regexp_eatExtendedAtom(e10)) && (this.regexp_eatQuantifier(e10), true);
|
|
1390
|
+
}, ep.regexp_eatAssertion = function(e10) {
|
|
1391
|
+
var t3 = e10.pos;
|
|
1392
|
+
if (e10.lastAssertionIsQuantifiable = false, e10.eat(94) || e10.eat(36)) return true;
|
|
1393
|
+
if (e10.eat(92)) {
|
|
1394
|
+
if (e10.eat(66) || e10.eat(98)) return true;
|
|
1395
|
+
e10.pos = t3;
|
|
1396
|
+
}
|
|
1397
|
+
if (e10.eat(40) && e10.eat(63)) {
|
|
1398
|
+
var i2 = false;
|
|
1399
|
+
if (this.options.ecmaVersion >= 9 && (i2 = e10.eat(60)), e10.eat(61) || e10.eat(33)) return this.regexp_disjunction(e10), e10.eat(41) || e10.raise("Unterminated group"), e10.lastAssertionIsQuantifiable = !i2, true;
|
|
1400
|
+
}
|
|
1401
|
+
return e10.pos = t3, false;
|
|
1402
|
+
}, ep.regexp_eatQuantifier = function(e10, t3) {
|
|
1403
|
+
return void 0 === t3 && (t3 = false), !!this.regexp_eatQuantifierPrefix(e10, t3) && (e10.eat(63), true);
|
|
1404
|
+
}, ep.regexp_eatQuantifierPrefix = function(e10, t3) {
|
|
1405
|
+
return e10.eat(42) || e10.eat(43) || e10.eat(63) || this.regexp_eatBracedQuantifier(e10, t3);
|
|
1406
|
+
}, ep.regexp_eatBracedQuantifier = function(e10, t3) {
|
|
1407
|
+
var i2 = e10.pos;
|
|
1408
|
+
if (e10.eat(123)) {
|
|
1409
|
+
var s2 = 0, r2 = -1;
|
|
1410
|
+
if (this.regexp_eatDecimalDigits(e10) && (s2 = e10.lastIntValue, e10.eat(44) && this.regexp_eatDecimalDigits(e10) && (r2 = e10.lastIntValue), e10.eat(125))) return -1 !== r2 && r2 < s2 && !t3 && e10.raise("numbers out of order in {} quantifier"), true;
|
|
1411
|
+
e10.switchU && !t3 && e10.raise("Incomplete quantifier"), e10.pos = i2;
|
|
1412
|
+
}
|
|
1413
|
+
return false;
|
|
1414
|
+
}, ep.regexp_eatAtom = function(e10) {
|
|
1415
|
+
return this.regexp_eatPatternCharacters(e10) || e10.eat(46) || this.regexp_eatReverseSolidusAtomEscape(e10) || this.regexp_eatCharacterClass(e10) || this.regexp_eatUncapturingGroup(e10) || this.regexp_eatCapturingGroup(e10);
|
|
1416
|
+
}, ep.regexp_eatReverseSolidusAtomEscape = function(e10) {
|
|
1417
|
+
var t3 = e10.pos;
|
|
1418
|
+
if (e10.eat(92)) {
|
|
1419
|
+
if (this.regexp_eatAtomEscape(e10)) return true;
|
|
1420
|
+
e10.pos = t3;
|
|
1421
|
+
}
|
|
1422
|
+
return false;
|
|
1423
|
+
}, ep.regexp_eatUncapturingGroup = function(e10) {
|
|
1424
|
+
var t3 = e10.pos;
|
|
1425
|
+
if (e10.eat(40)) {
|
|
1426
|
+
if (e10.eat(63)) {
|
|
1427
|
+
if (this.options.ecmaVersion >= 16) {
|
|
1428
|
+
var i2 = this.regexp_eatModifiers(e10), s2 = e10.eat(45);
|
|
1429
|
+
if (i2 || s2) {
|
|
1430
|
+
for (var r2 = 0; r2 < i2.length; r2++) {
|
|
1431
|
+
var n2 = i2.charAt(r2);
|
|
1432
|
+
i2.indexOf(n2, r2 + 1) > -1 && e10.raise("Duplicate regular expression modifiers");
|
|
1433
|
+
}
|
|
1434
|
+
if (s2) {
|
|
1435
|
+
var a2 = this.regexp_eatModifiers(e10);
|
|
1436
|
+
i2 || a2 || 58 !== e10.current() || e10.raise("Invalid regular expression modifiers");
|
|
1437
|
+
for (var o2 = 0; o2 < a2.length; o2++) {
|
|
1438
|
+
var h2 = a2.charAt(o2);
|
|
1439
|
+
(a2.indexOf(h2, o2 + 1) > -1 || i2.indexOf(h2) > -1) && e10.raise("Duplicate regular expression modifiers");
|
|
1440
|
+
}
|
|
1441
|
+
}
|
|
1442
|
+
}
|
|
1443
|
+
}
|
|
1444
|
+
if (e10.eat(58)) {
|
|
1445
|
+
if (this.regexp_disjunction(e10), e10.eat(41)) return true;
|
|
1446
|
+
e10.raise("Unterminated group");
|
|
1447
|
+
}
|
|
1448
|
+
}
|
|
1449
|
+
e10.pos = t3;
|
|
1450
|
+
}
|
|
1451
|
+
return false;
|
|
1452
|
+
}, ep.regexp_eatCapturingGroup = function(e10) {
|
|
1453
|
+
if (e10.eat(40)) {
|
|
1454
|
+
if (this.options.ecmaVersion >= 9 ? this.regexp_groupSpecifier(e10) : 63 === e10.current() && e10.raise("Invalid group"), this.regexp_disjunction(e10), e10.eat(41)) return e10.numCapturingParens += 1, true;
|
|
1455
|
+
e10.raise("Unterminated group");
|
|
1456
|
+
}
|
|
1457
|
+
return false;
|
|
1458
|
+
}, ep.regexp_eatModifiers = function(e10) {
|
|
1459
|
+
for (var t3 = "", i2 = 0; -1 !== (i2 = e10.current()) && isRegularExpressionModifier(i2); ) t3 += codePointToString(i2), e10.advance();
|
|
1460
|
+
return t3;
|
|
1461
|
+
}, ep.regexp_eatExtendedAtom = function(e10) {
|
|
1462
|
+
return e10.eat(46) || this.regexp_eatReverseSolidusAtomEscape(e10) || this.regexp_eatCharacterClass(e10) || this.regexp_eatUncapturingGroup(e10) || this.regexp_eatCapturingGroup(e10) || this.regexp_eatInvalidBracedQuantifier(e10) || this.regexp_eatExtendedPatternCharacter(e10);
|
|
1463
|
+
}, ep.regexp_eatInvalidBracedQuantifier = function(e10) {
|
|
1464
|
+
return this.regexp_eatBracedQuantifier(e10, true) && e10.raise("Nothing to repeat"), false;
|
|
1465
|
+
}, ep.regexp_eatSyntaxCharacter = function(e10) {
|
|
1466
|
+
var t3 = e10.current();
|
|
1467
|
+
return !!isSyntaxCharacter(t3) && (e10.lastIntValue = t3, e10.advance(), true);
|
|
1468
|
+
}, ep.regexp_eatPatternCharacters = function(e10) {
|
|
1469
|
+
for (var t3 = e10.pos, i2 = 0; -1 !== (i2 = e10.current()) && !isSyntaxCharacter(i2); ) e10.advance();
|
|
1470
|
+
return e10.pos !== t3;
|
|
1471
|
+
}, ep.regexp_eatExtendedPatternCharacter = function(e10) {
|
|
1472
|
+
var t3 = e10.current();
|
|
1473
|
+
return -1 !== t3 && 36 !== t3 && (!(t3 >= 40) || !(t3 <= 43)) && 46 !== t3 && 63 !== t3 && 91 !== t3 && 94 !== t3 && 124 !== t3 && (e10.advance(), true);
|
|
1474
|
+
}, ep.regexp_groupSpecifier = function(e10) {
|
|
1475
|
+
if (e10.eat(63)) {
|
|
1476
|
+
this.regexp_eatGroupName(e10) || e10.raise("Invalid group");
|
|
1477
|
+
var t3 = this.options.ecmaVersion >= 16, i2 = e10.groupNames[e10.lastStringValue];
|
|
1478
|
+
if (i2) if (t3) for (var s2 = 0; s2 < i2.length; s2 += 1) i2[s2].separatedFrom(e10.branchID) || e10.raise("Duplicate capture group name");
|
|
1479
|
+
else e10.raise("Duplicate capture group name");
|
|
1480
|
+
t3 ? (i2 || (e10.groupNames[e10.lastStringValue] = [])).push(e10.branchID) : e10.groupNames[e10.lastStringValue] = true;
|
|
1481
|
+
}
|
|
1482
|
+
}, ep.regexp_eatGroupName = function(e10) {
|
|
1483
|
+
if (e10.lastStringValue = "", e10.eat(60)) {
|
|
1484
|
+
if (this.regexp_eatRegExpIdentifierName(e10) && e10.eat(62)) return true;
|
|
1485
|
+
e10.raise("Invalid capture group name");
|
|
1486
|
+
}
|
|
1487
|
+
return false;
|
|
1488
|
+
}, ep.regexp_eatRegExpIdentifierName = function(e10) {
|
|
1489
|
+
if (e10.lastStringValue = "", this.regexp_eatRegExpIdentifierStart(e10)) {
|
|
1490
|
+
for (e10.lastStringValue += codePointToString(e10.lastIntValue); this.regexp_eatRegExpIdentifierPart(e10); ) e10.lastStringValue += codePointToString(e10.lastIntValue);
|
|
1491
|
+
return true;
|
|
1492
|
+
}
|
|
1493
|
+
return false;
|
|
1494
|
+
}, ep.regexp_eatRegExpIdentifierStart = function(e10) {
|
|
1495
|
+
var t3 = e10.pos, i2 = this.options.ecmaVersion >= 11, s2 = e10.current(i2);
|
|
1496
|
+
return (e10.advance(i2), 92 === s2 && this.regexp_eatRegExpUnicodeEscapeSequence(e10, i2) && (s2 = e10.lastIntValue), isRegExpIdentifierStart(s2)) ? (e10.lastIntValue = s2, true) : (e10.pos = t3, false);
|
|
1497
|
+
}, ep.regexp_eatRegExpIdentifierPart = function(e10) {
|
|
1498
|
+
var t3 = e10.pos, i2 = this.options.ecmaVersion >= 11, s2 = e10.current(i2);
|
|
1499
|
+
return (e10.advance(i2), 92 === s2 && this.regexp_eatRegExpUnicodeEscapeSequence(e10, i2) && (s2 = e10.lastIntValue), isRegExpIdentifierPart(s2)) ? (e10.lastIntValue = s2, true) : (e10.pos = t3, false);
|
|
1500
|
+
}, ep.regexp_eatAtomEscape = function(e10) {
|
|
1501
|
+
return !!(this.regexp_eatBackReference(e10) || this.regexp_eatCharacterClassEscape(e10) || this.regexp_eatCharacterEscape(e10) || e10.switchN && this.regexp_eatKGroupName(e10)) || (e10.switchU && (99 === e10.current() && e10.raise("Invalid unicode escape"), e10.raise("Invalid escape")), false);
|
|
1502
|
+
}, ep.regexp_eatBackReference = function(e10) {
|
|
1503
|
+
var t3 = e10.pos;
|
|
1504
|
+
if (this.regexp_eatDecimalEscape(e10)) {
|
|
1505
|
+
var i2 = e10.lastIntValue;
|
|
1506
|
+
if (e10.switchU) return i2 > e10.maxBackReference && (e10.maxBackReference = i2), true;
|
|
1507
|
+
if (i2 <= e10.numCapturingParens) return true;
|
|
1508
|
+
e10.pos = t3;
|
|
1509
|
+
}
|
|
1510
|
+
return false;
|
|
1511
|
+
}, ep.regexp_eatKGroupName = function(e10) {
|
|
1512
|
+
if (e10.eat(107)) {
|
|
1513
|
+
if (this.regexp_eatGroupName(e10)) return e10.backReferenceNames.push(e10.lastStringValue), true;
|
|
1514
|
+
e10.raise("Invalid named reference");
|
|
1515
|
+
}
|
|
1516
|
+
return false;
|
|
1517
|
+
}, ep.regexp_eatCharacterEscape = function(e10) {
|
|
1518
|
+
return this.regexp_eatControlEscape(e10) || this.regexp_eatCControlLetter(e10) || this.regexp_eatZero(e10) || this.regexp_eatHexEscapeSequence(e10) || this.regexp_eatRegExpUnicodeEscapeSequence(e10, false) || !e10.switchU && this.regexp_eatLegacyOctalEscapeSequence(e10) || this.regexp_eatIdentityEscape(e10);
|
|
1519
|
+
}, ep.regexp_eatCControlLetter = function(e10) {
|
|
1520
|
+
var t3 = e10.pos;
|
|
1521
|
+
if (e10.eat(99)) {
|
|
1522
|
+
if (this.regexp_eatControlLetter(e10)) return true;
|
|
1523
|
+
e10.pos = t3;
|
|
1524
|
+
}
|
|
1525
|
+
return false;
|
|
1526
|
+
}, ep.regexp_eatZero = function(e10) {
|
|
1527
|
+
return !(48 !== e10.current() || isDecimalDigit(e10.lookahead())) && (e10.lastIntValue = 0, e10.advance(), true);
|
|
1528
|
+
}, ep.regexp_eatControlEscape = function(e10) {
|
|
1529
|
+
var t3 = e10.current();
|
|
1530
|
+
return 116 === t3 ? (e10.lastIntValue = 9, e10.advance(), true) : 110 === t3 ? (e10.lastIntValue = 10, e10.advance(), true) : 118 === t3 ? (e10.lastIntValue = 11, e10.advance(), true) : 102 === t3 ? (e10.lastIntValue = 12, e10.advance(), true) : 114 === t3 && (e10.lastIntValue = 13, e10.advance(), true);
|
|
1531
|
+
}, ep.regexp_eatControlLetter = function(e10) {
|
|
1532
|
+
var t3 = e10.current();
|
|
1533
|
+
return !!isControlLetter(t3) && (e10.lastIntValue = t3 % 32, e10.advance(), true);
|
|
1534
|
+
}, ep.regexp_eatRegExpUnicodeEscapeSequence = function(e10, t3) {
|
|
1535
|
+
void 0 === t3 && (t3 = false);
|
|
1536
|
+
var i2 = e10.pos, s2 = t3 || e10.switchU;
|
|
1537
|
+
if (e10.eat(117)) {
|
|
1538
|
+
if (this.regexp_eatFixedHexDigits(e10, 4)) {
|
|
1539
|
+
var r2 = e10.lastIntValue;
|
|
1540
|
+
if (s2 && r2 >= 55296 && r2 <= 56319) {
|
|
1541
|
+
var n2 = e10.pos;
|
|
1542
|
+
if (e10.eat(92) && e10.eat(117) && this.regexp_eatFixedHexDigits(e10, 4)) {
|
|
1543
|
+
var a2 = e10.lastIntValue;
|
|
1544
|
+
if (a2 >= 56320 && a2 <= 57343) return e10.lastIntValue = (r2 - 55296) * 1024 + (a2 - 56320) + 65536, true;
|
|
1545
|
+
}
|
|
1546
|
+
e10.pos = n2, e10.lastIntValue = r2;
|
|
1547
|
+
}
|
|
1548
|
+
return true;
|
|
1549
|
+
}
|
|
1550
|
+
if (s2 && e10.eat(123) && this.regexp_eatHexDigits(e10) && e10.eat(125) && isValidUnicode(e10.lastIntValue)) return true;
|
|
1551
|
+
s2 && e10.raise("Invalid unicode escape"), e10.pos = i2;
|
|
1552
|
+
}
|
|
1553
|
+
return false;
|
|
1554
|
+
}, ep.regexp_eatIdentityEscape = function(e10) {
|
|
1555
|
+
if (e10.switchU) return !!this.regexp_eatSyntaxCharacter(e10) || !!e10.eat(47) && (e10.lastIntValue = 47, true);
|
|
1556
|
+
var t3 = e10.current();
|
|
1557
|
+
return 99 !== t3 && (!e10.switchN || 107 !== t3) && (e10.lastIntValue = t3, e10.advance(), true);
|
|
1558
|
+
}, ep.regexp_eatDecimalEscape = function(e10) {
|
|
1559
|
+
e10.lastIntValue = 0;
|
|
1560
|
+
var t3 = e10.current();
|
|
1561
|
+
if (t3 >= 49 && t3 <= 57) {
|
|
1562
|
+
do
|
|
1563
|
+
e10.lastIntValue = 10 * e10.lastIntValue + (t3 - 48), e10.advance();
|
|
1564
|
+
while ((t3 = e10.current()) >= 48 && t3 <= 57);
|
|
1565
|
+
return true;
|
|
1566
|
+
}
|
|
1567
|
+
return false;
|
|
1568
|
+
}, ep.regexp_eatCharacterClassEscape = function(e10) {
|
|
1569
|
+
var t3, i2 = e10.current();
|
|
1570
|
+
if (isCharacterClassEscape(i2)) return e10.lastIntValue = -1, e10.advance(), 1;
|
|
1571
|
+
var s2 = false;
|
|
1572
|
+
if (e10.switchU && this.options.ecmaVersion >= 9 && ((s2 = 80 === i2) || 112 === i2)) {
|
|
1573
|
+
if (e10.lastIntValue = -1, e10.advance(), e10.eat(123) && (t3 = this.regexp_eatUnicodePropertyValueExpression(e10)) && e10.eat(125)) return s2 && 2 === t3 && e10.raise("Invalid property name"), t3;
|
|
1574
|
+
e10.raise("Invalid property name");
|
|
1575
|
+
}
|
|
1576
|
+
return 0;
|
|
1577
|
+
}, ep.regexp_eatUnicodePropertyValueExpression = function(e10) {
|
|
1578
|
+
var t3 = e10.pos;
|
|
1579
|
+
if (this.regexp_eatUnicodePropertyName(e10) && e10.eat(61)) {
|
|
1580
|
+
var i2 = e10.lastStringValue;
|
|
1581
|
+
if (this.regexp_eatUnicodePropertyValue(e10)) {
|
|
1582
|
+
var s2 = e10.lastStringValue;
|
|
1583
|
+
return this.regexp_validateUnicodePropertyNameAndValue(e10, i2, s2), 1;
|
|
1584
|
+
}
|
|
1585
|
+
}
|
|
1586
|
+
if (e10.pos = t3, this.regexp_eatLoneUnicodePropertyNameOrValue(e10)) {
|
|
1587
|
+
var r2 = e10.lastStringValue;
|
|
1588
|
+
return this.regexp_validateUnicodePropertyNameOrValue(e10, r2);
|
|
1589
|
+
}
|
|
1590
|
+
return 0;
|
|
1591
|
+
}, ep.regexp_validateUnicodePropertyNameAndValue = function(e10, t3, i2) {
|
|
1592
|
+
w(e10.unicodeProperties.nonBinary, t3) || e10.raise("Invalid property name"), e10.unicodeProperties.nonBinary[t3].test(i2) || e10.raise("Invalid property value");
|
|
1593
|
+
}, ep.regexp_validateUnicodePropertyNameOrValue = function(e10, t3) {
|
|
1594
|
+
return e10.unicodeProperties.binary.test(t3) ? 1 : e10.switchV && e10.unicodeProperties.binaryOfStrings.test(t3) ? 2 : void e10.raise("Invalid property name");
|
|
1595
|
+
}, ep.regexp_eatUnicodePropertyName = function(e10) {
|
|
1596
|
+
var t3 = 0;
|
|
1597
|
+
for (e10.lastStringValue = ""; isUnicodePropertyNameCharacter(t3 = e10.current()); ) e10.lastStringValue += codePointToString(t3), e10.advance();
|
|
1598
|
+
return "" !== e10.lastStringValue;
|
|
1599
|
+
}, ep.regexp_eatUnicodePropertyValue = function(e10) {
|
|
1600
|
+
var t3 = 0;
|
|
1601
|
+
for (e10.lastStringValue = ""; isUnicodePropertyValueCharacter(t3 = e10.current()); ) e10.lastStringValue += codePointToString(t3), e10.advance();
|
|
1602
|
+
return "" !== e10.lastStringValue;
|
|
1603
|
+
}, ep.regexp_eatLoneUnicodePropertyNameOrValue = function(e10) {
|
|
1604
|
+
return this.regexp_eatUnicodePropertyValue(e10);
|
|
1605
|
+
}, ep.regexp_eatCharacterClass = function(e10) {
|
|
1606
|
+
if (e10.eat(91)) {
|
|
1607
|
+
var t3 = e10.eat(94), i2 = this.regexp_classContents(e10);
|
|
1608
|
+
return e10.eat(93) || e10.raise("Unterminated character class"), t3 && 2 === i2 && e10.raise("Negated character class may contain strings"), true;
|
|
1609
|
+
}
|
|
1610
|
+
return false;
|
|
1611
|
+
}, ep.regexp_classContents = function(e10) {
|
|
1612
|
+
return 93 === e10.current() ? 1 : e10.switchV ? this.regexp_classSetExpression(e10) : (this.regexp_nonEmptyClassRanges(e10), 1);
|
|
1613
|
+
}, ep.regexp_nonEmptyClassRanges = function(e10) {
|
|
1614
|
+
for (; this.regexp_eatClassAtom(e10); ) {
|
|
1615
|
+
var t3 = e10.lastIntValue;
|
|
1616
|
+
if (e10.eat(45) && this.regexp_eatClassAtom(e10)) {
|
|
1617
|
+
var i2 = e10.lastIntValue;
|
|
1618
|
+
e10.switchU && (-1 === t3 || -1 === i2) && e10.raise("Invalid character class"), -1 !== t3 && -1 !== i2 && t3 > i2 && e10.raise("Range out of order in character class");
|
|
1619
|
+
}
|
|
1620
|
+
}
|
|
1621
|
+
}, ep.regexp_eatClassAtom = function(e10) {
|
|
1622
|
+
var t3 = e10.pos;
|
|
1623
|
+
if (e10.eat(92)) {
|
|
1624
|
+
if (this.regexp_eatClassEscape(e10)) return true;
|
|
1625
|
+
if (e10.switchU) {
|
|
1626
|
+
var i2 = e10.current();
|
|
1627
|
+
(99 === i2 || isOctalDigit(i2)) && e10.raise("Invalid class escape"), e10.raise("Invalid escape");
|
|
1628
|
+
}
|
|
1629
|
+
e10.pos = t3;
|
|
1630
|
+
}
|
|
1631
|
+
var s2 = e10.current();
|
|
1632
|
+
return 93 !== s2 && (e10.lastIntValue = s2, e10.advance(), true);
|
|
1633
|
+
}, ep.regexp_eatClassEscape = function(e10) {
|
|
1634
|
+
var t3 = e10.pos;
|
|
1635
|
+
if (e10.eat(98)) return e10.lastIntValue = 8, true;
|
|
1636
|
+
if (e10.switchU && e10.eat(45)) return e10.lastIntValue = 45, true;
|
|
1637
|
+
if (!e10.switchU && e10.eat(99)) {
|
|
1638
|
+
if (this.regexp_eatClassControlLetter(e10)) return true;
|
|
1639
|
+
e10.pos = t3;
|
|
1640
|
+
}
|
|
1641
|
+
return this.regexp_eatCharacterClassEscape(e10) || this.regexp_eatCharacterEscape(e10);
|
|
1642
|
+
}, ep.regexp_classSetExpression = function(e10) {
|
|
1643
|
+
var t3, i2 = 1;
|
|
1644
|
+
if (this.regexp_eatClassSetRange(e10)) ;
|
|
1645
|
+
else if (t3 = this.regexp_eatClassSetOperand(e10)) {
|
|
1646
|
+
2 === t3 && (i2 = 2);
|
|
1647
|
+
for (var s2 = e10.pos; e10.eatChars([38, 38]); ) {
|
|
1648
|
+
if (38 !== e10.current() && (t3 = this.regexp_eatClassSetOperand(e10))) {
|
|
1649
|
+
2 !== t3 && (i2 = 1);
|
|
1650
|
+
continue;
|
|
1651
|
+
}
|
|
1652
|
+
e10.raise("Invalid character in character class");
|
|
1653
|
+
}
|
|
1654
|
+
if (s2 !== e10.pos) return i2;
|
|
1655
|
+
for (; e10.eatChars([45, 45]); ) this.regexp_eatClassSetOperand(e10) || e10.raise("Invalid character in character class");
|
|
1656
|
+
if (s2 !== e10.pos) return i2;
|
|
1657
|
+
} else e10.raise("Invalid character in character class");
|
|
1658
|
+
for (; ; ) if (!this.regexp_eatClassSetRange(e10)) {
|
|
1659
|
+
if (!(t3 = this.regexp_eatClassSetOperand(e10))) return i2;
|
|
1660
|
+
2 === t3 && (i2 = 2);
|
|
1661
|
+
}
|
|
1662
|
+
}, ep.regexp_eatClassSetRange = function(e10) {
|
|
1663
|
+
var t3 = e10.pos;
|
|
1664
|
+
if (this.regexp_eatClassSetCharacter(e10)) {
|
|
1665
|
+
var i2 = e10.lastIntValue;
|
|
1666
|
+
if (e10.eat(45) && this.regexp_eatClassSetCharacter(e10)) {
|
|
1667
|
+
var s2 = e10.lastIntValue;
|
|
1668
|
+
return -1 !== i2 && -1 !== s2 && i2 > s2 && e10.raise("Range out of order in character class"), true;
|
|
1669
|
+
}
|
|
1670
|
+
e10.pos = t3;
|
|
1671
|
+
}
|
|
1672
|
+
return false;
|
|
1673
|
+
}, ep.regexp_eatClassSetOperand = function(e10) {
|
|
1674
|
+
return this.regexp_eatClassSetCharacter(e10) ? 1 : this.regexp_eatClassStringDisjunction(e10) || this.regexp_eatNestedClass(e10);
|
|
1675
|
+
}, ep.regexp_eatNestedClass = function(e10) {
|
|
1676
|
+
var t3 = e10.pos;
|
|
1677
|
+
if (e10.eat(91)) {
|
|
1678
|
+
var i2 = e10.eat(94), s2 = this.regexp_classContents(e10);
|
|
1679
|
+
if (e10.eat(93)) return i2 && 2 === s2 && e10.raise("Negated character class may contain strings"), s2;
|
|
1680
|
+
e10.pos = t3;
|
|
1681
|
+
}
|
|
1682
|
+
if (e10.eat(92)) {
|
|
1683
|
+
var r2 = this.regexp_eatCharacterClassEscape(e10);
|
|
1684
|
+
if (r2) return r2;
|
|
1685
|
+
e10.pos = t3;
|
|
1686
|
+
}
|
|
1687
|
+
return null;
|
|
1688
|
+
}, ep.regexp_eatClassStringDisjunction = function(e10) {
|
|
1689
|
+
var t3 = e10.pos;
|
|
1690
|
+
if (e10.eatChars([92, 113])) {
|
|
1691
|
+
if (e10.eat(123)) {
|
|
1692
|
+
var i2 = this.regexp_classStringDisjunctionContents(e10);
|
|
1693
|
+
if (e10.eat(125)) return i2;
|
|
1694
|
+
} else e10.raise("Invalid escape");
|
|
1695
|
+
e10.pos = t3;
|
|
1696
|
+
}
|
|
1697
|
+
return null;
|
|
1698
|
+
}, ep.regexp_classStringDisjunctionContents = function(e10) {
|
|
1699
|
+
for (var t3 = this.regexp_classString(e10); e10.eat(124); ) 2 === this.regexp_classString(e10) && (t3 = 2);
|
|
1700
|
+
return t3;
|
|
1701
|
+
}, ep.regexp_classString = function(e10) {
|
|
1702
|
+
for (var t3 = 0; this.regexp_eatClassSetCharacter(e10); ) t3++;
|
|
1703
|
+
return 1 === t3 ? 1 : 2;
|
|
1704
|
+
}, ep.regexp_eatClassSetCharacter = function(e10) {
|
|
1705
|
+
var t3 = e10.pos;
|
|
1706
|
+
if (e10.eat(92)) return !!(this.regexp_eatCharacterEscape(e10) || this.regexp_eatClassSetReservedPunctuator(e10)) || (e10.eat(98) ? (e10.lastIntValue = 8, true) : (e10.pos = t3, false));
|
|
1707
|
+
var i2 = e10.current();
|
|
1708
|
+
return !(i2 < 0 || i2 === e10.lookahead() && isClassSetReservedDoublePunctuatorCharacter(i2) || isClassSetSyntaxCharacter(i2)) && (e10.advance(), e10.lastIntValue = i2, true);
|
|
1709
|
+
}, ep.regexp_eatClassSetReservedPunctuator = function(e10) {
|
|
1710
|
+
var t3 = e10.current();
|
|
1711
|
+
return !!isClassSetReservedPunctuator(t3) && (e10.lastIntValue = t3, e10.advance(), true);
|
|
1712
|
+
}, ep.regexp_eatClassControlLetter = function(e10) {
|
|
1713
|
+
var t3 = e10.current();
|
|
1714
|
+
return (!!isDecimalDigit(t3) || 95 === t3) && (e10.lastIntValue = t3 % 32, e10.advance(), true);
|
|
1715
|
+
}, ep.regexp_eatHexEscapeSequence = function(e10) {
|
|
1716
|
+
var t3 = e10.pos;
|
|
1717
|
+
if (e10.eat(120)) {
|
|
1718
|
+
if (this.regexp_eatFixedHexDigits(e10, 2)) return true;
|
|
1719
|
+
e10.switchU && e10.raise("Invalid escape"), e10.pos = t3;
|
|
1720
|
+
}
|
|
1721
|
+
return false;
|
|
1722
|
+
}, ep.regexp_eatDecimalDigits = function(e10) {
|
|
1723
|
+
var t3 = e10.pos, i2 = 0;
|
|
1724
|
+
for (e10.lastIntValue = 0; isDecimalDigit(i2 = e10.current()); ) e10.lastIntValue = 10 * e10.lastIntValue + (i2 - 48), e10.advance();
|
|
1725
|
+
return e10.pos !== t3;
|
|
1726
|
+
}, ep.regexp_eatHexDigits = function(e10) {
|
|
1727
|
+
var t3 = e10.pos, i2 = 0;
|
|
1728
|
+
for (e10.lastIntValue = 0; isHexDigit(i2 = e10.current()); ) e10.lastIntValue = 16 * e10.lastIntValue + hexToInt(i2), e10.advance();
|
|
1729
|
+
return e10.pos !== t3;
|
|
1730
|
+
}, ep.regexp_eatLegacyOctalEscapeSequence = function(e10) {
|
|
1731
|
+
if (this.regexp_eatOctalDigit(e10)) {
|
|
1732
|
+
var t3 = e10.lastIntValue;
|
|
1733
|
+
if (this.regexp_eatOctalDigit(e10)) {
|
|
1734
|
+
var i2 = e10.lastIntValue;
|
|
1735
|
+
t3 <= 3 && this.regexp_eatOctalDigit(e10) ? e10.lastIntValue = 64 * t3 + 8 * i2 + e10.lastIntValue : e10.lastIntValue = 8 * t3 + i2;
|
|
1736
|
+
} else e10.lastIntValue = t3;
|
|
1737
|
+
return true;
|
|
1738
|
+
}
|
|
1739
|
+
return false;
|
|
1740
|
+
}, ep.regexp_eatOctalDigit = function(e10) {
|
|
1741
|
+
var t3 = e10.current();
|
|
1742
|
+
return isOctalDigit(t3) ? (e10.lastIntValue = t3 - 48, e10.advance(), true) : (e10.lastIntValue = 0, false);
|
|
1743
|
+
}, ep.regexp_eatFixedHexDigits = function(e10, t3) {
|
|
1744
|
+
var i2 = e10.pos;
|
|
1745
|
+
e10.lastIntValue = 0;
|
|
1746
|
+
for (var s2 = 0; s2 < t3; ++s2) {
|
|
1747
|
+
var r2 = e10.current();
|
|
1748
|
+
if (!isHexDigit(r2)) return e10.pos = i2, false;
|
|
1749
|
+
e10.lastIntValue = 16 * e10.lastIntValue + hexToInt(r2), e10.advance();
|
|
1750
|
+
}
|
|
1751
|
+
return true;
|
|
1752
|
+
};
|
|
1753
|
+
var acorn_Token = /* @__PURE__ */ __name(function(e10) {
|
|
1754
|
+
this.type = e10.type, this.value = e10.value, this.start = e10.start, this.end = e10.end, e10.options.locations && (this.loc = new acorn_SourceLocation(e10, e10.startLoc, e10.endLoc)), e10.options.ranges && (this.range = [e10.start, e10.end]);
|
|
1755
|
+
}, "acorn_Token"), el = acorn_Parser.prototype;
|
|
1756
|
+
function stringToNumber(e10, t3) {
|
|
1757
|
+
return t3 ? parseInt(e10, 8) : parseFloat(e10.replace(/_/g, ""));
|
|
1758
|
+
}
|
|
1759
|
+
__name(stringToNumber, "stringToNumber");
|
|
1760
|
+
function stringToBigInt(e10) {
|
|
1761
|
+
return "function" != typeof BigInt ? null : BigInt(e10.replace(/_/g, ""));
|
|
1762
|
+
}
|
|
1763
|
+
__name(stringToBigInt, "stringToBigInt");
|
|
1764
|
+
el.next = function(e10) {
|
|
1765
|
+
!e10 && this.type.keyword && this.containsEsc && this.raiseRecoverable(this.start, "Escape sequence in keyword " + this.type.keyword), this.options.onToken && this.options.onToken(new acorn_Token(this)), this.lastTokEnd = this.end, this.lastTokStart = this.start, this.lastTokEndLoc = this.endLoc, this.lastTokStartLoc = this.startLoc, this.nextToken();
|
|
1766
|
+
}, el.getToken = function() {
|
|
1767
|
+
return this.next(), new acorn_Token(this);
|
|
1768
|
+
}, "undefined" != typeof Symbol && (el[Symbol.iterator] = function() {
|
|
1769
|
+
var e10 = this;
|
|
1770
|
+
return { next: /* @__PURE__ */ __name(function() {
|
|
1771
|
+
var t3 = e10.getToken();
|
|
1772
|
+
return { done: t3.type === x.eof, value: t3 };
|
|
1773
|
+
}, "next") };
|
|
1774
|
+
}), el.nextToken = function() {
|
|
1775
|
+
var e10 = this.curContext();
|
|
1776
|
+
return (e10 && e10.preserveSpace || this.skipSpace(), this.start = this.pos, this.options.locations && (this.startLoc = this.curPosition()), this.pos >= this.input.length) ? this.finishToken(x.eof) : e10.override ? e10.override(this) : void this.readToken(this.fullCharCodeAtPos());
|
|
1777
|
+
}, el.readToken = function(e10) {
|
|
1778
|
+
return isIdentifierStart(e10, this.options.ecmaVersion >= 6) || 92 === e10 ? this.readWord() : this.getTokenFromCode(e10);
|
|
1779
|
+
}, el.fullCharCodeAtPos = function() {
|
|
1780
|
+
var e10 = this.input.charCodeAt(this.pos);
|
|
1781
|
+
if (e10 <= 55295 || e10 >= 56320) return e10;
|
|
1782
|
+
var t3 = this.input.charCodeAt(this.pos + 1);
|
|
1783
|
+
return t3 <= 56319 || t3 >= 57344 ? e10 : (e10 << 10) + t3 - 56613888;
|
|
1784
|
+
}, el.skipBlockComment = function() {
|
|
1785
|
+
var e10 = this.options.onComment && this.curPosition(), t3 = this.pos, i2 = this.input.indexOf("*/", this.pos += 2);
|
|
1786
|
+
if (-1 === i2 && this.raise(this.pos - 2, "Unterminated comment"), this.pos = i2 + 2, this.options.locations) for (var s2 = void 0, r2 = t3; (s2 = nextLineBreak(this.input, r2, this.pos)) > -1; ) ++this.curLine, r2 = this.lineStart = s2;
|
|
1787
|
+
this.options.onComment && this.options.onComment(true, this.input.slice(t3 + 2, i2), t3, this.pos, e10, this.curPosition());
|
|
1788
|
+
}, el.skipLineComment = function(e10) {
|
|
1789
|
+
for (var t3 = this.pos, i2 = this.options.onComment && this.curPosition(), s2 = this.input.charCodeAt(this.pos += e10); this.pos < this.input.length && !isNewLine(s2); ) s2 = this.input.charCodeAt(++this.pos);
|
|
1790
|
+
this.options.onComment && this.options.onComment(false, this.input.slice(t3 + e10, this.pos), t3, this.pos, i2, this.curPosition());
|
|
1791
|
+
}, el.skipSpace = function() {
|
|
1792
|
+
e: for (; this.pos < this.input.length; ) {
|
|
1793
|
+
var e10 = this.input.charCodeAt(this.pos);
|
|
1794
|
+
switch (e10) {
|
|
1795
|
+
case 32:
|
|
1796
|
+
case 160:
|
|
1797
|
+
++this.pos;
|
|
1798
|
+
break;
|
|
1799
|
+
case 13:
|
|
1800
|
+
10 === this.input.charCodeAt(this.pos + 1) && ++this.pos;
|
|
1801
|
+
case 10:
|
|
1802
|
+
case 8232:
|
|
1803
|
+
case 8233:
|
|
1804
|
+
++this.pos, this.options.locations && (++this.curLine, this.lineStart = this.pos);
|
|
1805
|
+
break;
|
|
1806
|
+
case 47:
|
|
1807
|
+
switch (this.input.charCodeAt(this.pos + 1)) {
|
|
1808
|
+
case 42:
|
|
1809
|
+
this.skipBlockComment();
|
|
1810
|
+
break;
|
|
1811
|
+
case 47:
|
|
1812
|
+
this.skipLineComment(2);
|
|
1813
|
+
break;
|
|
1814
|
+
default:
|
|
1815
|
+
break e;
|
|
1816
|
+
}
|
|
1817
|
+
break;
|
|
1818
|
+
default:
|
|
1819
|
+
if (e10 > 8 && e10 < 14 || e10 >= 5760 && b.test(String.fromCharCode(e10))) ++this.pos;
|
|
1820
|
+
else break e;
|
|
1821
|
+
}
|
|
1822
|
+
}
|
|
1823
|
+
}, el.finishToken = function(e10, t3) {
|
|
1824
|
+
this.end = this.pos, this.options.locations && (this.endLoc = this.curPosition());
|
|
1825
|
+
var i2 = this.type;
|
|
1826
|
+
this.type = e10, this.value = t3, this.updateContext(i2);
|
|
1827
|
+
}, el.readToken_dot = function() {
|
|
1828
|
+
var e10 = this.input.charCodeAt(this.pos + 1);
|
|
1829
|
+
if (e10 >= 48 && e10 <= 57) return this.readNumber(true);
|
|
1830
|
+
var t3 = this.input.charCodeAt(this.pos + 2);
|
|
1831
|
+
return this.options.ecmaVersion >= 6 && 46 === e10 && 46 === t3 ? (this.pos += 3, this.finishToken(x.ellipsis)) : (++this.pos, this.finishToken(x.dot));
|
|
1832
|
+
}, el.readToken_slash = function() {
|
|
1833
|
+
var e10 = this.input.charCodeAt(this.pos + 1);
|
|
1834
|
+
return this.exprAllowed ? (++this.pos, this.readRegexp()) : 61 === e10 ? this.finishOp(x.assign, 2) : this.finishOp(x.slash, 1);
|
|
1835
|
+
}, el.readToken_mult_modulo_exp = function(e10) {
|
|
1836
|
+
var t3 = this.input.charCodeAt(this.pos + 1), i2 = 1, s2 = 42 === e10 ? x.star : x.modulo;
|
|
1837
|
+
return (this.options.ecmaVersion >= 7 && 42 === e10 && 42 === t3 && (++i2, s2 = x.starstar, t3 = this.input.charCodeAt(this.pos + 2)), 61 === t3) ? this.finishOp(x.assign, i2 + 1) : this.finishOp(s2, i2);
|
|
1838
|
+
}, el.readToken_pipe_amp = function(e10) {
|
|
1839
|
+
var t3 = this.input.charCodeAt(this.pos + 1);
|
|
1840
|
+
if (t3 === e10) return this.options.ecmaVersion >= 12 && 61 === this.input.charCodeAt(this.pos + 2) ? this.finishOp(x.assign, 3) : this.finishOp(124 === e10 ? x.logicalOR : x.logicalAND, 2);
|
|
1841
|
+
return 61 === t3 ? this.finishOp(x.assign, 2) : this.finishOp(124 === e10 ? x.bitwiseOR : x.bitwiseAND, 1);
|
|
1842
|
+
}, el.readToken_caret = function() {
|
|
1843
|
+
return 61 === this.input.charCodeAt(this.pos + 1) ? this.finishOp(x.assign, 2) : this.finishOp(x.bitwiseXOR, 1);
|
|
1844
|
+
}, el.readToken_plus_min = function(e10) {
|
|
1845
|
+
var t3 = this.input.charCodeAt(this.pos + 1);
|
|
1846
|
+
return t3 === e10 ? 45 === t3 && !this.inModule && 62 === this.input.charCodeAt(this.pos + 2) && (0 === this.lastTokEnd || v.test(this.input.slice(this.lastTokEnd, this.pos))) ? (this.skipLineComment(3), this.skipSpace(), this.nextToken()) : this.finishOp(x.incDec, 2) : 61 === t3 ? this.finishOp(x.assign, 2) : this.finishOp(x.plusMin, 1);
|
|
1847
|
+
}, el.readToken_lt_gt = function(e10) {
|
|
1848
|
+
var t3 = this.input.charCodeAt(this.pos + 1), i2 = 1;
|
|
1849
|
+
return t3 === e10 ? (i2 = 62 === e10 && 62 === this.input.charCodeAt(this.pos + 2) ? 3 : 2, 61 === this.input.charCodeAt(this.pos + i2)) ? this.finishOp(x.assign, i2 + 1) : this.finishOp(x.bitShift, i2) : 33 !== t3 || 60 !== e10 || this.inModule || 45 !== this.input.charCodeAt(this.pos + 2) || 45 !== this.input.charCodeAt(this.pos + 3) ? (61 === t3 && (i2 = 2), this.finishOp(x.relational, i2)) : (this.skipLineComment(4), this.skipSpace(), this.nextToken());
|
|
1850
|
+
}, el.readToken_eq_excl = function(e10) {
|
|
1851
|
+
var t3 = this.input.charCodeAt(this.pos + 1);
|
|
1852
|
+
return 61 === t3 ? this.finishOp(x.equality, 61 === this.input.charCodeAt(this.pos + 2) ? 3 : 2) : 61 === e10 && 62 === t3 && this.options.ecmaVersion >= 6 ? (this.pos += 2, this.finishToken(x.arrow)) : this.finishOp(61 === e10 ? x.eq : x.prefix, 1);
|
|
1853
|
+
}, el.readToken_question = function() {
|
|
1854
|
+
var e10 = this.options.ecmaVersion;
|
|
1855
|
+
if (e10 >= 11) {
|
|
1856
|
+
var t3 = this.input.charCodeAt(this.pos + 1);
|
|
1857
|
+
if (46 === t3) {
|
|
1858
|
+
var i2 = this.input.charCodeAt(this.pos + 2);
|
|
1859
|
+
if (i2 < 48 || i2 > 57) return this.finishOp(x.questionDot, 2);
|
|
1860
|
+
}
|
|
1861
|
+
if (63 === t3) return e10 >= 12 && 61 === this.input.charCodeAt(this.pos + 2) ? this.finishOp(x.assign, 3) : this.finishOp(x.coalesce, 2);
|
|
1862
|
+
}
|
|
1863
|
+
return this.finishOp(x.question, 1);
|
|
1864
|
+
}, el.readToken_numberSign = function() {
|
|
1865
|
+
var e10 = this.options.ecmaVersion, t3 = 35;
|
|
1866
|
+
if (e10 >= 13 && (++this.pos, isIdentifierStart(t3 = this.fullCharCodeAtPos(), true) || 92 === t3)) return this.finishToken(x.privateId, this.readWord1());
|
|
1867
|
+
this.raise(this.pos, "Unexpected character '" + codePointToString(t3) + "'");
|
|
1868
|
+
}, el.getTokenFromCode = function(e10) {
|
|
1869
|
+
switch (e10) {
|
|
1870
|
+
case 46:
|
|
1871
|
+
return this.readToken_dot();
|
|
1872
|
+
case 40:
|
|
1873
|
+
return ++this.pos, this.finishToken(x.parenL);
|
|
1874
|
+
case 41:
|
|
1875
|
+
return ++this.pos, this.finishToken(x.parenR);
|
|
1876
|
+
case 59:
|
|
1877
|
+
return ++this.pos, this.finishToken(x.semi);
|
|
1878
|
+
case 44:
|
|
1879
|
+
return ++this.pos, this.finishToken(x.comma);
|
|
1880
|
+
case 91:
|
|
1881
|
+
return ++this.pos, this.finishToken(x.bracketL);
|
|
1882
|
+
case 93:
|
|
1883
|
+
return ++this.pos, this.finishToken(x.bracketR);
|
|
1884
|
+
case 123:
|
|
1885
|
+
return ++this.pos, this.finishToken(x.braceL);
|
|
1886
|
+
case 125:
|
|
1887
|
+
return ++this.pos, this.finishToken(x.braceR);
|
|
1888
|
+
case 58:
|
|
1889
|
+
return ++this.pos, this.finishToken(x.colon);
|
|
1890
|
+
case 96:
|
|
1891
|
+
if (this.options.ecmaVersion < 6) break;
|
|
1892
|
+
return ++this.pos, this.finishToken(x.backQuote);
|
|
1893
|
+
case 48:
|
|
1894
|
+
var t3 = this.input.charCodeAt(this.pos + 1);
|
|
1895
|
+
if (120 === t3 || 88 === t3) return this.readRadixNumber(16);
|
|
1896
|
+
if (this.options.ecmaVersion >= 6) {
|
|
1897
|
+
if (111 === t3 || 79 === t3) return this.readRadixNumber(8);
|
|
1898
|
+
if (98 === t3 || 66 === t3) return this.readRadixNumber(2);
|
|
1899
|
+
}
|
|
1900
|
+
case 49:
|
|
1901
|
+
case 50:
|
|
1902
|
+
case 51:
|
|
1903
|
+
case 52:
|
|
1904
|
+
case 53:
|
|
1905
|
+
case 54:
|
|
1906
|
+
case 55:
|
|
1907
|
+
case 56:
|
|
1908
|
+
case 57:
|
|
1909
|
+
return this.readNumber(false);
|
|
1910
|
+
case 34:
|
|
1911
|
+
case 39:
|
|
1912
|
+
return this.readString(e10);
|
|
1913
|
+
case 47:
|
|
1914
|
+
return this.readToken_slash();
|
|
1915
|
+
case 37:
|
|
1916
|
+
case 42:
|
|
1917
|
+
return this.readToken_mult_modulo_exp(e10);
|
|
1918
|
+
case 124:
|
|
1919
|
+
case 38:
|
|
1920
|
+
return this.readToken_pipe_amp(e10);
|
|
1921
|
+
case 94:
|
|
1922
|
+
return this.readToken_caret();
|
|
1923
|
+
case 43:
|
|
1924
|
+
case 45:
|
|
1925
|
+
return this.readToken_plus_min(e10);
|
|
1926
|
+
case 60:
|
|
1927
|
+
case 62:
|
|
1928
|
+
return this.readToken_lt_gt(e10);
|
|
1929
|
+
case 61:
|
|
1930
|
+
case 33:
|
|
1931
|
+
return this.readToken_eq_excl(e10);
|
|
1932
|
+
case 63:
|
|
1933
|
+
return this.readToken_question();
|
|
1934
|
+
case 126:
|
|
1935
|
+
return this.finishOp(x.prefix, 1);
|
|
1936
|
+
case 35:
|
|
1937
|
+
return this.readToken_numberSign();
|
|
1938
|
+
}
|
|
1939
|
+
this.raise(this.pos, "Unexpected character '" + codePointToString(e10) + "'");
|
|
1940
|
+
}, el.finishOp = function(e10, t3) {
|
|
1941
|
+
var i2 = this.input.slice(this.pos, this.pos + t3);
|
|
1942
|
+
return this.pos += t3, this.finishToken(e10, i2);
|
|
1943
|
+
}, el.readRegexp = function() {
|
|
1944
|
+
for (var e10, t3, i2 = this.pos; ; ) {
|
|
1945
|
+
this.pos >= this.input.length && this.raise(i2, "Unterminated regular expression");
|
|
1946
|
+
var s2 = this.input.charAt(this.pos);
|
|
1947
|
+
if (v.test(s2) && this.raise(i2, "Unterminated regular expression"), e10) e10 = false;
|
|
1948
|
+
else {
|
|
1949
|
+
if ("[" === s2) t3 = true;
|
|
1950
|
+
else if ("]" === s2 && t3) t3 = false;
|
|
1951
|
+
else if ("/" === s2 && !t3) break;
|
|
1952
|
+
e10 = "\\" === s2;
|
|
1953
|
+
}
|
|
1954
|
+
++this.pos;
|
|
1955
|
+
}
|
|
1956
|
+
var r2 = this.input.slice(i2, this.pos);
|
|
1957
|
+
++this.pos;
|
|
1958
|
+
var n2 = this.pos, a2 = this.readWord1();
|
|
1959
|
+
this.containsEsc && this.unexpected(n2);
|
|
1960
|
+
var o2 = this.regexpState || (this.regexpState = new acorn_RegExpValidationState(this));
|
|
1961
|
+
o2.reset(i2, r2, a2), this.validateRegExpFlags(o2), this.validateRegExpPattern(o2);
|
|
1962
|
+
var h2 = null;
|
|
1963
|
+
try {
|
|
1964
|
+
h2 = new RegExp(r2, a2);
|
|
1965
|
+
} catch (e11) {
|
|
1966
|
+
}
|
|
1967
|
+
return this.finishToken(x.regexp, { pattern: r2, flags: a2, value: h2 });
|
|
1968
|
+
}, el.readInt = function(e10, t3, i2) {
|
|
1969
|
+
for (var s2 = this.options.ecmaVersion >= 12 && void 0 === t3, r2 = i2 && 48 === this.input.charCodeAt(this.pos), n2 = this.pos, a2 = 0, o2 = 0, h2 = 0, c2 = null == t3 ? 1 / 0 : t3; h2 < c2; ++h2, ++this.pos) {
|
|
1970
|
+
var p2 = this.input.charCodeAt(this.pos), l2 = void 0;
|
|
1971
|
+
if (s2 && 95 === p2) {
|
|
1972
|
+
r2 && this.raiseRecoverable(this.pos, "Numeric separator is not allowed in legacy octal numeric literals"), 95 === o2 && this.raiseRecoverable(this.pos, "Numeric separator must be exactly one underscore"), 0 === h2 && this.raiseRecoverable(this.pos, "Numeric separator is not allowed at the first of digits"), o2 = p2;
|
|
1973
|
+
continue;
|
|
1974
|
+
}
|
|
1975
|
+
if ((l2 = p2 >= 97 ? p2 - 97 + 10 : p2 >= 65 ? p2 - 65 + 10 : p2 >= 48 && p2 <= 57 ? p2 - 48 : 1 / 0) >= e10) break;
|
|
1976
|
+
o2 = p2, a2 = a2 * e10 + l2;
|
|
1977
|
+
}
|
|
1978
|
+
return (s2 && 95 === o2 && this.raiseRecoverable(this.pos - 1, "Numeric separator is not allowed at the last of digits"), this.pos === n2 || null != t3 && this.pos - n2 !== t3) ? null : a2;
|
|
1979
|
+
}, el.readRadixNumber = function(e10) {
|
|
1980
|
+
var t3 = this.pos;
|
|
1981
|
+
this.pos += 2;
|
|
1982
|
+
var i2 = this.readInt(e10);
|
|
1983
|
+
return null == i2 && this.raise(this.start + 2, "Expected number in radix " + e10), this.options.ecmaVersion >= 11 && 110 === this.input.charCodeAt(this.pos) ? (i2 = stringToBigInt(this.input.slice(t3, this.pos)), ++this.pos) : isIdentifierStart(this.fullCharCodeAtPos()) && this.raise(this.pos, "Identifier directly after number"), this.finishToken(x.num, i2);
|
|
1984
|
+
}, el.readNumber = function(e10) {
|
|
1985
|
+
var t3 = this.pos;
|
|
1986
|
+
e10 || null !== this.readInt(10, void 0, true) || this.raise(t3, "Invalid number");
|
|
1987
|
+
var i2 = this.pos - t3 >= 2 && 48 === this.input.charCodeAt(t3);
|
|
1988
|
+
i2 && this.strict && this.raise(t3, "Invalid number");
|
|
1989
|
+
var s2 = this.input.charCodeAt(this.pos);
|
|
1990
|
+
if (!i2 && !e10 && this.options.ecmaVersion >= 11 && 110 === s2) {
|
|
1991
|
+
var r2 = stringToBigInt(this.input.slice(t3, this.pos));
|
|
1992
|
+
return ++this.pos, isIdentifierStart(this.fullCharCodeAtPos()) && this.raise(this.pos, "Identifier directly after number"), this.finishToken(x.num, r2);
|
|
1993
|
+
}
|
|
1994
|
+
i2 && /[89]/.test(this.input.slice(t3, this.pos)) && (i2 = false), 46 !== s2 || i2 || (++this.pos, this.readInt(10), s2 = this.input.charCodeAt(this.pos)), 69 !== s2 && 101 !== s2 || i2 || ((43 === (s2 = this.input.charCodeAt(++this.pos)) || 45 === s2) && ++this.pos, null === this.readInt(10) && this.raise(t3, "Invalid number")), isIdentifierStart(this.fullCharCodeAtPos()) && this.raise(this.pos, "Identifier directly after number");
|
|
1995
|
+
var n2 = stringToNumber(this.input.slice(t3, this.pos), i2);
|
|
1996
|
+
return this.finishToken(x.num, n2);
|
|
1997
|
+
}, el.readCodePoint = function() {
|
|
1998
|
+
var e10;
|
|
1999
|
+
if (123 === this.input.charCodeAt(this.pos)) {
|
|
2000
|
+
this.options.ecmaVersion < 6 && this.unexpected();
|
|
2001
|
+
var t3 = ++this.pos;
|
|
2002
|
+
e10 = this.readHexChar(this.input.indexOf("}", this.pos) - this.pos), ++this.pos, e10 > 1114111 && this.invalidStringToken(t3, "Code point out of bounds");
|
|
2003
|
+
} else e10 = this.readHexChar(4);
|
|
2004
|
+
return e10;
|
|
2005
|
+
}, el.readString = function(e10) {
|
|
2006
|
+
for (var t3 = "", i2 = ++this.pos; ; ) {
|
|
2007
|
+
this.pos >= this.input.length && this.raise(this.start, "Unterminated string constant");
|
|
2008
|
+
var s2 = this.input.charCodeAt(this.pos);
|
|
2009
|
+
if (s2 === e10) break;
|
|
2010
|
+
92 === s2 ? (t3 += this.input.slice(i2, this.pos), t3 += this.readEscapedChar(false), i2 = this.pos) : 8232 === s2 || 8233 === s2 ? (this.options.ecmaVersion < 10 && this.raise(this.start, "Unterminated string constant"), ++this.pos, this.options.locations && (this.curLine++, this.lineStart = this.pos)) : (isNewLine(s2) && this.raise(this.start, "Unterminated string constant"), ++this.pos);
|
|
2011
|
+
}
|
|
2012
|
+
return t3 += this.input.slice(i2, this.pos++), this.finishToken(x.string, t3);
|
|
2013
|
+
};
|
|
2014
|
+
var eu = {};
|
|
2015
|
+
el.tryReadTemplateToken = function() {
|
|
2016
|
+
this.inTemplateElement = true;
|
|
2017
|
+
try {
|
|
2018
|
+
this.readTmplToken();
|
|
2019
|
+
} catch (e10) {
|
|
2020
|
+
if (e10 === eu) this.readInvalidTemplateToken();
|
|
2021
|
+
else throw e10;
|
|
2022
|
+
}
|
|
2023
|
+
this.inTemplateElement = false;
|
|
2024
|
+
}, el.invalidStringToken = function(e10, t3) {
|
|
2025
|
+
if (this.inTemplateElement && this.options.ecmaVersion >= 9) throw eu;
|
|
2026
|
+
this.raise(e10, t3);
|
|
2027
|
+
}, el.readTmplToken = function() {
|
|
2028
|
+
for (var e10 = "", t3 = this.pos; ; ) {
|
|
2029
|
+
this.pos >= this.input.length && this.raise(this.start, "Unterminated template");
|
|
2030
|
+
var i2 = this.input.charCodeAt(this.pos);
|
|
2031
|
+
if (96 === i2 || 36 === i2 && 123 === this.input.charCodeAt(this.pos + 1)) {
|
|
2032
|
+
if (this.pos === this.start && (this.type === x.template || this.type === x.invalidTemplate)) if (36 === i2) return this.pos += 2, this.finishToken(x.dollarBraceL);
|
|
2033
|
+
else return ++this.pos, this.finishToken(x.backQuote);
|
|
2034
|
+
return e10 += this.input.slice(t3, this.pos), this.finishToken(x.template, e10);
|
|
2035
|
+
}
|
|
2036
|
+
if (92 === i2) e10 += this.input.slice(t3, this.pos), e10 += this.readEscapedChar(true), t3 = this.pos;
|
|
2037
|
+
else if (isNewLine(i2)) {
|
|
2038
|
+
switch (e10 += this.input.slice(t3, this.pos), ++this.pos, i2) {
|
|
2039
|
+
case 13:
|
|
2040
|
+
10 === this.input.charCodeAt(this.pos) && ++this.pos;
|
|
2041
|
+
case 10:
|
|
2042
|
+
e10 += "\n";
|
|
2043
|
+
break;
|
|
2044
|
+
default:
|
|
2045
|
+
e10 += String.fromCharCode(i2);
|
|
2046
|
+
}
|
|
2047
|
+
this.options.locations && (++this.curLine, this.lineStart = this.pos), t3 = this.pos;
|
|
2048
|
+
} else ++this.pos;
|
|
2049
|
+
}
|
|
2050
|
+
}, el.readInvalidTemplateToken = function() {
|
|
2051
|
+
for (; this.pos < this.input.length; this.pos++) switch (this.input[this.pos]) {
|
|
2052
|
+
case "\\":
|
|
2053
|
+
++this.pos;
|
|
2054
|
+
break;
|
|
2055
|
+
case "$":
|
|
2056
|
+
if ("{" !== this.input[this.pos + 1]) break;
|
|
2057
|
+
case "`":
|
|
2058
|
+
return this.finishToken(x.invalidTemplate, this.input.slice(this.start, this.pos));
|
|
2059
|
+
case "\r":
|
|
2060
|
+
"\n" === this.input[this.pos + 1] && ++this.pos;
|
|
2061
|
+
case "\n":
|
|
2062
|
+
case "\u2028":
|
|
2063
|
+
case "\u2029":
|
|
2064
|
+
++this.curLine, this.lineStart = this.pos + 1;
|
|
2065
|
+
}
|
|
2066
|
+
this.raise(this.start, "Unterminated template");
|
|
2067
|
+
}, el.readEscapedChar = function(e10) {
|
|
2068
|
+
var t3 = this.input.charCodeAt(++this.pos);
|
|
2069
|
+
switch (++this.pos, t3) {
|
|
2070
|
+
case 110:
|
|
2071
|
+
return "\n";
|
|
2072
|
+
case 114:
|
|
2073
|
+
return "\r";
|
|
2074
|
+
case 120:
|
|
2075
|
+
return String.fromCharCode(this.readHexChar(2));
|
|
2076
|
+
case 117:
|
|
2077
|
+
return codePointToString(this.readCodePoint());
|
|
2078
|
+
case 116:
|
|
2079
|
+
return " ";
|
|
2080
|
+
case 98:
|
|
2081
|
+
return "\b";
|
|
2082
|
+
case 118:
|
|
2083
|
+
return "\v";
|
|
2084
|
+
case 102:
|
|
2085
|
+
return "\f";
|
|
2086
|
+
case 13:
|
|
2087
|
+
10 === this.input.charCodeAt(this.pos) && ++this.pos;
|
|
2088
|
+
case 10:
|
|
2089
|
+
return this.options.locations && (this.lineStart = this.pos, ++this.curLine), "";
|
|
2090
|
+
case 56:
|
|
2091
|
+
case 57:
|
|
2092
|
+
if (this.strict && this.invalidStringToken(this.pos - 1, "Invalid escape sequence"), e10) {
|
|
2093
|
+
var i2 = this.pos - 1;
|
|
2094
|
+
this.invalidStringToken(i2, "Invalid escape sequence in template string");
|
|
2095
|
+
}
|
|
2096
|
+
default:
|
|
2097
|
+
if (t3 >= 48 && t3 <= 55) {
|
|
2098
|
+
var s2 = this.input.substr(this.pos - 1, 3).match(/^[0-7]+/)[0], r2 = parseInt(s2, 8);
|
|
2099
|
+
return r2 > 255 && (r2 = parseInt(s2 = s2.slice(0, -1), 8)), this.pos += s2.length - 1, t3 = this.input.charCodeAt(this.pos), ("0" !== s2 || 56 === t3 || 57 === t3) && (this.strict || e10) && this.invalidStringToken(this.pos - 1 - s2.length, e10 ? "Octal literal in template string" : "Octal literal in strict mode"), String.fromCharCode(r2);
|
|
2100
|
+
}
|
|
2101
|
+
if (isNewLine(t3)) return this.options.locations && (this.lineStart = this.pos, ++this.curLine), "";
|
|
2102
|
+
return String.fromCharCode(t3);
|
|
2103
|
+
}
|
|
2104
|
+
}, el.readHexChar = function(e10) {
|
|
2105
|
+
var t3 = this.pos, i2 = this.readInt(16, e10);
|
|
2106
|
+
return null === i2 && this.invalidStringToken(t3, "Bad character escape sequence"), i2;
|
|
2107
|
+
}, el.readWord1 = function() {
|
|
2108
|
+
this.containsEsc = false;
|
|
2109
|
+
for (var e10 = "", t3 = true, i2 = this.pos, s2 = this.options.ecmaVersion >= 6; this.pos < this.input.length; ) {
|
|
2110
|
+
var r2 = this.fullCharCodeAtPos();
|
|
2111
|
+
if (isIdentifierChar(r2, s2)) this.pos += r2 <= 65535 ? 1 : 2;
|
|
2112
|
+
else if (92 === r2) {
|
|
2113
|
+
this.containsEsc = true, e10 += this.input.slice(i2, this.pos);
|
|
2114
|
+
var n2 = this.pos;
|
|
2115
|
+
117 !== this.input.charCodeAt(++this.pos) && this.invalidStringToken(this.pos, "Expecting Unicode escape sequence \\uXXXX"), ++this.pos;
|
|
2116
|
+
var a2 = this.readCodePoint();
|
|
2117
|
+
(t3 ? isIdentifierStart : isIdentifierChar)(a2, s2) || this.invalidStringToken(n2, "Invalid Unicode escape"), e10 += codePointToString(a2), i2 = this.pos;
|
|
2118
|
+
} else break;
|
|
2119
|
+
t3 = false;
|
|
2120
|
+
}
|
|
2121
|
+
return e10 + this.input.slice(i2, this.pos);
|
|
2122
|
+
}, el.readWord = function() {
|
|
2123
|
+
var e10 = this.readWord1(), t3 = x.name;
|
|
2124
|
+
return this.keywords.test(e10) && (t3 = _[e10]), this.finishToken(t3, e10);
|
|
2125
|
+
}, acorn_Parser.acorn = { Parser: acorn_Parser, version: "8.15.0", defaultOptions: P, Position: acorn_Position, SourceLocation: acorn_SourceLocation, getLineInfo, Node: acorn_Node, TokenType: acorn_TokenType, tokTypes: x, keywordTypes: _, TokContext: acorn_TokContext, tokContexts: $, isIdentifierChar, isIdentifierStart, Token: acorn_Token, isNewLine, lineBreak: v, lineBreakG: y, nonASCIIwhitespace: b };
|
|
2126
|
+
let ed = __require("node:module"), ef = __require("node:fs"), em = /\/$|\/\?|\/#/, eg = /^\.?\//;
|
|
2127
|
+
function hasTrailingSlash(e10 = "", t3) {
|
|
2128
|
+
return t3 ? em.test(e10) : e10.endsWith("/");
|
|
2129
|
+
}
|
|
2130
|
+
__name(hasTrailingSlash, "hasTrailingSlash");
|
|
2131
|
+
function withTrailingSlash(e10 = "", t3) {
|
|
2132
|
+
if (!t3) return e10.endsWith("/") ? e10 : e10 + "/";
|
|
2133
|
+
if (hasTrailingSlash(e10, true)) return e10 || "/";
|
|
2134
|
+
let i2 = e10, s2 = "", r2 = e10.indexOf("#");
|
|
2135
|
+
if (-1 !== r2 && (i2 = e10.slice(0, r2), s2 = e10.slice(r2), !i2)) return s2;
|
|
2136
|
+
let [n2, ...a2] = i2.split("?");
|
|
2137
|
+
return n2 + "/" + (a2.length > 0 ? `?${a2.join("?")}` : "") + s2;
|
|
2138
|
+
}
|
|
2139
|
+
__name(withTrailingSlash, "withTrailingSlash");
|
|
2140
|
+
function isNonEmptyURL(e10) {
|
|
2141
|
+
return e10 && "/" !== e10;
|
|
2142
|
+
}
|
|
2143
|
+
__name(isNonEmptyURL, "isNonEmptyURL");
|
|
2144
|
+
function dist_joinURL(e10, ...t3) {
|
|
2145
|
+
let i2 = e10 || "";
|
|
2146
|
+
for (let e11 of t3.filter((e12) => isNonEmptyURL(e12))) if (i2) {
|
|
2147
|
+
let t4 = e11.replace(eg, "");
|
|
2148
|
+
i2 = withTrailingSlash(i2) + t4;
|
|
2149
|
+
} else i2 = e11;
|
|
2150
|
+
return i2;
|
|
2151
|
+
}
|
|
2152
|
+
__name(dist_joinURL, "dist_joinURL");
|
|
2153
|
+
Symbol.for("ufo:protocolRelative");
|
|
2154
|
+
let e_ = /^[A-Za-z]:\//;
|
|
2155
|
+
function pathe_M_eThtNZ_normalizeWindowsPath(e10 = "") {
|
|
2156
|
+
return e10 ? e10.replace(/\\/g, "/").replace(e_, (e11) => e11.toUpperCase()) : e10;
|
|
2157
|
+
}
|
|
2158
|
+
__name(pathe_M_eThtNZ_normalizeWindowsPath, "pathe_M_eThtNZ_normalizeWindowsPath");
|
|
2159
|
+
let ex = /^[/\\]{2}/, ev = /^[/\\](?![/\\])|^[/\\]{2}(?!\.)|^[A-Za-z]:[/\\]/, ey = /^[A-Za-z]:$/, eb = /.(\.[^./]+|\.)$/, pathe_M_eThtNZ_normalize = /* @__PURE__ */ __name(function(e10) {
|
|
2160
|
+
if (0 === e10.length) return ".";
|
|
2161
|
+
let t3 = (e10 = pathe_M_eThtNZ_normalizeWindowsPath(e10)).match(ex), i2 = isAbsolute(e10), s2 = "/" === e10[e10.length - 1];
|
|
2162
|
+
return 0 === (e10 = normalizeString(e10, !i2)).length ? i2 ? "/" : s2 ? "./" : "." : (s2 && (e10 += "/"), ey.test(e10) && (e10 += "/"), t3) ? i2 ? `//${e10}` : `//./${e10}` : i2 && !isAbsolute(e10) ? `/${e10}` : e10;
|
|
2163
|
+
}, "pathe_M_eThtNZ_normalize"), pathe_M_eThtNZ_join = /* @__PURE__ */ __name(function(...e10) {
|
|
2164
|
+
let t3 = "";
|
|
2165
|
+
for (let i2 of e10) if (i2) if (t3.length > 0) {
|
|
2166
|
+
let e11 = "/" === t3[t3.length - 1], s2 = "/" === i2[0];
|
|
2167
|
+
e11 && s2 ? t3 += i2.slice(1) : t3 += e11 || s2 ? i2 : `/${i2}`;
|
|
2168
|
+
} else t3 += i2;
|
|
2169
|
+
return pathe_M_eThtNZ_normalize(t3);
|
|
2170
|
+
}, "pathe_M_eThtNZ_join");
|
|
2171
|
+
function pathe_M_eThtNZ_cwd() {
|
|
2172
|
+
return "undefined" != typeof process && "function" == typeof process.cwd ? process.cwd().replace(/\\/g, "/") : "/";
|
|
2173
|
+
}
|
|
2174
|
+
__name(pathe_M_eThtNZ_cwd, "pathe_M_eThtNZ_cwd");
|
|
2175
|
+
let pathe_M_eThtNZ_resolve = /* @__PURE__ */ __name(function(...e10) {
|
|
2176
|
+
e10 = e10.map((e11) => pathe_M_eThtNZ_normalizeWindowsPath(e11));
|
|
2177
|
+
let t3 = "", i2 = false;
|
|
2178
|
+
for (let s2 = e10.length - 1; s2 >= -1 && !i2; s2--) {
|
|
2179
|
+
let r2 = s2 >= 0 ? e10[s2] : pathe_M_eThtNZ_cwd();
|
|
2180
|
+
r2 && 0 !== r2.length && (t3 = `${r2}/${t3}`, i2 = isAbsolute(r2));
|
|
2181
|
+
}
|
|
2182
|
+
return (t3 = normalizeString(t3, !i2), i2 && !isAbsolute(t3)) ? `/${t3}` : t3.length > 0 ? t3 : ".";
|
|
2183
|
+
}, "pathe_M_eThtNZ_resolve");
|
|
2184
|
+
function normalizeString(e10, t3) {
|
|
2185
|
+
let i2 = "", s2 = 0, r2 = -1, n2 = 0, a2 = null;
|
|
2186
|
+
for (let o2 = 0; o2 <= e10.length; ++o2) {
|
|
2187
|
+
if (o2 < e10.length) a2 = e10[o2];
|
|
2188
|
+
else if ("/" === a2) break;
|
|
2189
|
+
else a2 = "/";
|
|
2190
|
+
if ("/" === a2) {
|
|
2191
|
+
if (r2 === o2 - 1 || 1 === n2) ;
|
|
2192
|
+
else if (2 === n2) {
|
|
2193
|
+
if (i2.length < 2 || 2 !== s2 || "." !== i2[i2.length - 1] || "." !== i2[i2.length - 2]) {
|
|
2194
|
+
if (i2.length > 2) {
|
|
2195
|
+
let e11 = i2.lastIndexOf("/");
|
|
2196
|
+
-1 === e11 ? (i2 = "", s2 = 0) : s2 = (i2 = i2.slice(0, e11)).length - 1 - i2.lastIndexOf("/"), r2 = o2, n2 = 0;
|
|
2197
|
+
continue;
|
|
2198
|
+
} else if (i2.length > 0) {
|
|
2199
|
+
i2 = "", s2 = 0, r2 = o2, n2 = 0;
|
|
2200
|
+
continue;
|
|
2201
|
+
}
|
|
2202
|
+
}
|
|
2203
|
+
t3 && (i2 += i2.length > 0 ? "/.." : "..", s2 = 2);
|
|
2204
|
+
} else i2.length > 0 ? i2 += `/${e10.slice(r2 + 1, o2)}` : i2 = e10.slice(r2 + 1, o2), s2 = o2 - r2 - 1;
|
|
2205
|
+
r2 = o2, n2 = 0;
|
|
2206
|
+
} else "." === a2 && -1 !== n2 ? ++n2 : n2 = -1;
|
|
2207
|
+
}
|
|
2208
|
+
return i2;
|
|
2209
|
+
}
|
|
2210
|
+
__name(normalizeString, "normalizeString");
|
|
2211
|
+
let isAbsolute = /* @__PURE__ */ __name(function(e10) {
|
|
2212
|
+
return ev.test(e10);
|
|
2213
|
+
}, "isAbsolute"), extname = /* @__PURE__ */ __name(function(e10) {
|
|
2214
|
+
if (".." === e10) return "";
|
|
2215
|
+
let t3 = eb.exec(pathe_M_eThtNZ_normalizeWindowsPath(e10));
|
|
2216
|
+
return t3 && t3[1] || "";
|
|
2217
|
+
}, "extname"), pathe_M_eThtNZ_dirname = /* @__PURE__ */ __name(function(e10) {
|
|
2218
|
+
let t3 = pathe_M_eThtNZ_normalizeWindowsPath(e10).replace(/\/$/, "").split("/").slice(0, -1);
|
|
2219
|
+
return 1 === t3.length && ey.test(t3[0]) && (t3[0] += "/"), t3.join("/") || (isAbsolute(e10) ? "/" : ".");
|
|
2220
|
+
}, "pathe_M_eThtNZ_dirname"), basename = /* @__PURE__ */ __name(function(e10, t3) {
|
|
2221
|
+
let i2 = pathe_M_eThtNZ_normalizeWindowsPath(e10).split("/"), s2 = "";
|
|
2222
|
+
for (let e11 = i2.length - 1; e11 >= 0; e11--) {
|
|
2223
|
+
let t4 = i2[e11];
|
|
2224
|
+
if (t4) {
|
|
2225
|
+
s2 = t4;
|
|
2226
|
+
break;
|
|
2227
|
+
}
|
|
2228
|
+
}
|
|
2229
|
+
return t3 && s2.endsWith(t3) ? s2.slice(0, -t3.length) : s2;
|
|
2230
|
+
}, "basename"), eE = __require("node:url"), ek = __require("node:assert"), eS = __require("node:process"), eC = __require("node:path"), ew = __require("node:v8"), eT = __require("node:util"), eI = new Set(ed.builtinModules);
|
|
2231
|
+
function normalizeSlash(e10) {
|
|
2232
|
+
return e10.replace(/\\/g, "/");
|
|
2233
|
+
}
|
|
2234
|
+
__name(normalizeSlash, "normalizeSlash");
|
|
2235
|
+
let eR = {}.hasOwnProperty, eP = /^([A-Z][a-z\d]*)+$/, eA = /* @__PURE__ */ new Set(["string", "function", "number", "object", "Function", "Object", "boolean", "bigint", "symbol"]), eN = {};
|
|
2236
|
+
function formatList(e10, t3 = "and") {
|
|
2237
|
+
return e10.length < 3 ? e10.join(` ${t3} `) : `${e10.slice(0, -1).join(", ")}, ${t3} ${e10[e10.length - 1]}`;
|
|
2238
|
+
}
|
|
2239
|
+
__name(formatList, "formatList");
|
|
2240
|
+
let eL = /* @__PURE__ */ new Map();
|
|
2241
|
+
function createError(e10, t3, i2) {
|
|
2242
|
+
return eL.set(e10, t3), makeNodeErrorWithCode(i2, e10);
|
|
2243
|
+
}
|
|
2244
|
+
__name(createError, "createError");
|
|
2245
|
+
function makeNodeErrorWithCode(e10, t3) {
|
|
2246
|
+
return NodeError;
|
|
2247
|
+
function NodeError(...i2) {
|
|
2248
|
+
let s2 = Error.stackTraceLimit;
|
|
2249
|
+
isErrorStackTraceLimitWritable() && (Error.stackTraceLimit = 0);
|
|
2250
|
+
let r2 = new e10();
|
|
2251
|
+
isErrorStackTraceLimitWritable() && (Error.stackTraceLimit = s2);
|
|
2252
|
+
let n2 = getMessage(t3, i2, r2);
|
|
2253
|
+
return Object.defineProperties(r2, { message: { value: n2, enumerable: false, writable: true, configurable: true }, toString: { value() {
|
|
2254
|
+
return `${this.name} [${t3}]: ${this.message}`;
|
|
2255
|
+
}, enumerable: false, writable: true, configurable: true } }), eD(r2), r2.code = t3, r2;
|
|
2256
|
+
}
|
|
2257
|
+
__name(NodeError, "NodeError");
|
|
2258
|
+
}
|
|
2259
|
+
__name(makeNodeErrorWithCode, "makeNodeErrorWithCode");
|
|
2260
|
+
function isErrorStackTraceLimitWritable() {
|
|
2261
|
+
try {
|
|
2262
|
+
if (ew.startupSnapshot.isBuildingSnapshot()) return false;
|
|
2263
|
+
} catch {
|
|
2264
|
+
}
|
|
2265
|
+
let e10 = Object.getOwnPropertyDescriptor(Error, "stackTraceLimit");
|
|
2266
|
+
return void 0 === e10 ? Object.isExtensible(Error) : eR.call(e10, "writable") && void 0 !== e10.writable ? e10.writable : void 0 !== e10.set;
|
|
2267
|
+
}
|
|
2268
|
+
__name(isErrorStackTraceLimitWritable, "isErrorStackTraceLimitWritable");
|
|
2269
|
+
eN.ERR_INVALID_ARG_TYPE = createError("ERR_INVALID_ARG_TYPE", (e10, t3, i2) => {
|
|
2270
|
+
ek("string" == typeof e10, "'name' must be a string"), Array.isArray(t3) || (t3 = [t3]);
|
|
2271
|
+
let s2 = "The ";
|
|
2272
|
+
if (e10.endsWith(" argument")) s2 += `${e10} `;
|
|
2273
|
+
else {
|
|
2274
|
+
let t4 = e10.includes(".") ? "property" : "argument";
|
|
2275
|
+
s2 += `"${e10}" ${t4} `;
|
|
2276
|
+
}
|
|
2277
|
+
s2 += "must be ";
|
|
2278
|
+
let r2 = [], n2 = [], a2 = [];
|
|
2279
|
+
for (let e11 of t3) ek("string" == typeof e11, "All expected entries have to be of type string"), eA.has(e11) ? r2.push(e11.toLowerCase()) : null === eP.exec(e11) ? (ek("object" !== e11, 'The value "object" should be written as "Object"'), a2.push(e11)) : n2.push(e11);
|
|
2280
|
+
if (n2.length > 0) {
|
|
2281
|
+
let e11 = r2.indexOf("object");
|
|
2282
|
+
-1 !== e11 && (r2.slice(e11, 1), n2.push("Object"));
|
|
2283
|
+
}
|
|
2284
|
+
return r2.length > 0 && (s2 += `${r2.length > 1 ? "one of type" : "of type"} ${formatList(r2, "or")}`, (n2.length > 0 || a2.length > 0) && (s2 += " or ")), n2.length > 0 && (s2 += `an instance of ${formatList(n2, "or")}`, a2.length > 0 && (s2 += " or ")), a2.length > 0 && (a2.length > 1 ? s2 += `one of ${formatList(a2, "or")}` : (a2[0].toLowerCase() !== a2[0] && (s2 += "an "), s2 += `${a2[0]}`)), s2 += `. Received ${determineSpecificType(i2)}`;
|
|
2285
|
+
}, TypeError), eN.ERR_INVALID_MODULE_SPECIFIER = createError("ERR_INVALID_MODULE_SPECIFIER", (e10, t3, i2) => `Invalid module "${e10}" ${t3}${i2 ? ` imported from ${i2}` : ""}`, TypeError), eN.ERR_INVALID_PACKAGE_CONFIG = createError("ERR_INVALID_PACKAGE_CONFIG", (e10, t3, i2) => `Invalid package config ${e10}${t3 ? ` while importing ${t3}` : ""}${i2 ? `. ${i2}` : ""}`, Error), eN.ERR_INVALID_PACKAGE_TARGET = createError("ERR_INVALID_PACKAGE_TARGET", (e10, t3, i2, s2 = false, r2) => {
|
|
2286
|
+
let n2 = "string" == typeof i2 && !s2 && i2.length > 0 && !i2.startsWith("./");
|
|
2287
|
+
return "." === t3 ? (ek(false === s2), `Invalid "exports" main target ${JSON.stringify(i2)} defined in the package config ${e10}package.json${r2 ? ` imported from ${r2}` : ""}${n2 ? '; targets must start with "./"' : ""}`) : `Invalid "${s2 ? "imports" : "exports"}" target ${JSON.stringify(i2)} defined for '${t3}' in the package config ${e10}package.json${r2 ? ` imported from ${r2}` : ""}${n2 ? '; targets must start with "./"' : ""}`;
|
|
2288
|
+
}, Error), eN.ERR_MODULE_NOT_FOUND = createError("ERR_MODULE_NOT_FOUND", (e10, t3, i2 = false) => `Cannot find ${i2 ? "module" : "package"} '${e10}' imported from ${t3}`, Error), eN.ERR_NETWORK_IMPORT_DISALLOWED = createError("ERR_NETWORK_IMPORT_DISALLOWED", "import of '%s' by %s is not supported: %s", Error), eN.ERR_PACKAGE_IMPORT_NOT_DEFINED = createError("ERR_PACKAGE_IMPORT_NOT_DEFINED", (e10, t3, i2) => `Package import specifier "${e10}" is not defined${t3 ? ` in package ${t3}package.json` : ""} imported from ${i2}`, TypeError), eN.ERR_PACKAGE_PATH_NOT_EXPORTED = createError("ERR_PACKAGE_PATH_NOT_EXPORTED", (e10, t3, i2) => "." === t3 ? `No "exports" main defined in ${e10}package.json${i2 ? ` imported from ${i2}` : ""}` : `Package subpath '${t3}' is not defined by "exports" in ${e10}package.json${i2 ? ` imported from ${i2}` : ""}`, Error), eN.ERR_UNSUPPORTED_DIR_IMPORT = createError("ERR_UNSUPPORTED_DIR_IMPORT", "Directory import '%s' is not supported resolving ES modules imported from %s", Error), eN.ERR_UNSUPPORTED_RESOLVE_REQUEST = createError("ERR_UNSUPPORTED_RESOLVE_REQUEST", 'Failed to resolve module specifier "%s" from "%s": Invalid relative URL or base scheme is not hierarchical.', TypeError), eN.ERR_UNKNOWN_FILE_EXTENSION = createError("ERR_UNKNOWN_FILE_EXTENSION", (e10, t3) => `Unknown file extension "${e10}" for ${t3}`, TypeError), eN.ERR_INVALID_ARG_VALUE = createError("ERR_INVALID_ARG_VALUE", (e10, t3, i2 = "is invalid") => {
|
|
2289
|
+
let s2 = (0, eT.inspect)(t3);
|
|
2290
|
+
s2.length > 128 && (s2 = `${s2.slice(0, 128)}...`);
|
|
2291
|
+
let r2 = e10.includes(".") ? "property" : "argument";
|
|
2292
|
+
return `The ${r2} '${e10}' ${i2}. Received ${s2}`;
|
|
2293
|
+
}, TypeError);
|
|
2294
|
+
let eD = (s = "__node_internal_" + (n = /* @__PURE__ */ __name(function(t3) {
|
|
2295
|
+
let i2 = isErrorStackTraceLimitWritable();
|
|
2296
|
+
return i2 && (e2 = Error.stackTraceLimit, Error.stackTraceLimit = 1 / 0), Error.captureStackTrace(t3), i2 && (Error.stackTraceLimit = e2), t3;
|
|
2297
|
+
}, "n")).name, Object.defineProperty(n, "name", { value: s }), n);
|
|
2298
|
+
function getMessage(e10, t3, i2) {
|
|
2299
|
+
let s2 = eL.get(e10);
|
|
2300
|
+
if (ek(void 0 !== s2, "expected `message` to be found"), "function" == typeof s2) return ek(s2.length <= t3.length, `Code: ${e10}; The provided arguments length (${t3.length}) does not match the required ones (${s2.length}).`), Reflect.apply(s2, i2, t3);
|
|
2301
|
+
let r2 = /%[dfijoOs]/g, n2 = 0;
|
|
2302
|
+
for (; null !== r2.exec(s2); ) n2++;
|
|
2303
|
+
return (ek(n2 === t3.length, `Code: ${e10}; The provided arguments length (${t3.length}) does not match the required ones (${n2}).`), 0 === t3.length) ? s2 : (t3.unshift(s2), Reflect.apply(eT.format, null, t3));
|
|
2304
|
+
}
|
|
2305
|
+
__name(getMessage, "getMessage");
|
|
2306
|
+
function determineSpecificType(e10) {
|
|
2307
|
+
if (null == e10) return String(e10);
|
|
2308
|
+
if ("function" == typeof e10 && e10.name) return `function ${e10.name}`;
|
|
2309
|
+
if ("object" == typeof e10) return e10.constructor && e10.constructor.name ? `an instance of ${e10.constructor.name}` : `${(0, eT.inspect)(e10, { depth: -1 })}`;
|
|
2310
|
+
let t3 = (0, eT.inspect)(e10, { colors: false });
|
|
2311
|
+
return t3.length > 28 && (t3 = `${t3.slice(0, 25)}...`), `type ${typeof e10} (${t3})`;
|
|
2312
|
+
}
|
|
2313
|
+
__name(determineSpecificType, "determineSpecificType");
|
|
2314
|
+
let eO = {}.hasOwnProperty, { ERR_INVALID_PACKAGE_CONFIG: eV } = eN, eU = /* @__PURE__ */ new Map();
|
|
2315
|
+
function read(e10, { base: t3, specifier: i2 }) {
|
|
2316
|
+
let s2, r2 = eU.get(e10);
|
|
2317
|
+
if (r2) return r2;
|
|
2318
|
+
try {
|
|
2319
|
+
s2 = ef.readFileSync(eC.toNamespacedPath(e10), "utf8");
|
|
2320
|
+
} catch (e11) {
|
|
2321
|
+
if ("ENOENT" !== e11.code) throw e11;
|
|
2322
|
+
}
|
|
2323
|
+
let n2 = { exists: false, pjsonPath: e10, main: void 0, name: void 0, type: "none", exports: void 0, imports: void 0 };
|
|
2324
|
+
if (void 0 !== s2) {
|
|
2325
|
+
let r3;
|
|
2326
|
+
try {
|
|
2327
|
+
r3 = JSON.parse(s2);
|
|
2328
|
+
} catch (r4) {
|
|
2329
|
+
let s3 = new eV(e10, (t3 ? `"${i2}" from ` : "") + (0, eE.fileURLToPath)(t3 || i2), r4.message);
|
|
2330
|
+
throw s3.cause = r4, s3;
|
|
2331
|
+
}
|
|
2332
|
+
n2.exists = true, eO.call(r3, "name") && "string" == typeof r3.name && (n2.name = r3.name), eO.call(r3, "main") && "string" == typeof r3.main && (n2.main = r3.main), eO.call(r3, "exports") && (n2.exports = r3.exports), eO.call(r3, "imports") && (n2.imports = r3.imports), eO.call(r3, "type") && ("commonjs" === r3.type || "module" === r3.type) && (n2.type = r3.type);
|
|
2333
|
+
}
|
|
2334
|
+
return eU.set(e10, n2), n2;
|
|
2335
|
+
}
|
|
2336
|
+
__name(read, "read");
|
|
2337
|
+
function getPackageScopeConfig(e10) {
|
|
2338
|
+
let t3 = new URL("package.json", e10);
|
|
2339
|
+
for (; !t3.pathname.endsWith("node_modules/package.json"); ) {
|
|
2340
|
+
let i2 = read((0, eE.fileURLToPath)(t3), { specifier: e10 });
|
|
2341
|
+
if (i2.exists) return i2;
|
|
2342
|
+
let s2 = t3;
|
|
2343
|
+
if ((t3 = new URL("../package.json", t3)).pathname === s2.pathname) break;
|
|
2344
|
+
}
|
|
2345
|
+
return { pjsonPath: (0, eE.fileURLToPath)(t3), exists: false, type: "none" };
|
|
2346
|
+
}
|
|
2347
|
+
__name(getPackageScopeConfig, "getPackageScopeConfig");
|
|
2348
|
+
let { ERR_UNKNOWN_FILE_EXTENSION: eM } = eN, ej = {}.hasOwnProperty, eB = { __proto__: null, ".cjs": "commonjs", ".js": "module", ".json": "json", ".mjs": "module" };
|
|
2349
|
+
function mimeToFormat(e10) {
|
|
2350
|
+
return e10 && /\s*(text|application)\/javascript\s*(;\s*charset=utf-?8\s*)?/i.test(e10) ? "module" : "application/json" === e10 ? "json" : null;
|
|
2351
|
+
}
|
|
2352
|
+
__name(mimeToFormat, "mimeToFormat");
|
|
2353
|
+
let eF = { __proto__: null, "data:": getDataProtocolModuleFormat, "file:": getFileProtocolModuleFormat, "http:": getHttpProtocolModuleFormat, "https:": getHttpProtocolModuleFormat, "node:": /* @__PURE__ */ __name(() => "builtin", "node:") };
|
|
2354
|
+
function getDataProtocolModuleFormat(e10) {
|
|
2355
|
+
let { 1: t3 } = /^([^/]+\/[^;,]+)[^,]*?(;base64)?,/.exec(e10.pathname) || [null, null, null];
|
|
2356
|
+
return mimeToFormat(t3);
|
|
2357
|
+
}
|
|
2358
|
+
__name(getDataProtocolModuleFormat, "getDataProtocolModuleFormat");
|
|
2359
|
+
function dist_extname(e10) {
|
|
2360
|
+
let t3 = e10.pathname, i2 = t3.length;
|
|
2361
|
+
for (; i2--; ) {
|
|
2362
|
+
let e11 = t3.codePointAt(i2);
|
|
2363
|
+
if (47 === e11) break;
|
|
2364
|
+
if (46 === e11) return 47 === t3.codePointAt(i2 - 1) ? "" : t3.slice(i2);
|
|
2365
|
+
}
|
|
2366
|
+
return "";
|
|
2367
|
+
}
|
|
2368
|
+
__name(dist_extname, "dist_extname");
|
|
2369
|
+
function getFileProtocolModuleFormat(e10, t3, i2) {
|
|
2370
|
+
let s2 = dist_extname(e10);
|
|
2371
|
+
if (".js" === s2) {
|
|
2372
|
+
let t4 = getPackageScopeConfig(e10).type;
|
|
2373
|
+
return "none" !== t4 ? t4 : "commonjs";
|
|
2374
|
+
}
|
|
2375
|
+
if ("" === s2) {
|
|
2376
|
+
let t4 = getPackageScopeConfig(e10).type;
|
|
2377
|
+
return "none" === t4 || "commonjs" === t4 ? "commonjs" : "module";
|
|
2378
|
+
}
|
|
2379
|
+
let r2 = eB[s2];
|
|
2380
|
+
if (r2) return r2;
|
|
2381
|
+
if (!i2) throw new eM(s2, (0, eE.fileURLToPath)(e10));
|
|
2382
|
+
}
|
|
2383
|
+
__name(getFileProtocolModuleFormat, "getFileProtocolModuleFormat");
|
|
2384
|
+
function getHttpProtocolModuleFormat() {
|
|
2385
|
+
}
|
|
2386
|
+
__name(getHttpProtocolModuleFormat, "getHttpProtocolModuleFormat");
|
|
2387
|
+
function defaultGetFormatWithoutErrors(e10, t3) {
|
|
2388
|
+
let i2 = e10.protocol;
|
|
2389
|
+
return ej.call(eF, i2) && eF[i2](e10, t3, true) || null;
|
|
2390
|
+
}
|
|
2391
|
+
__name(defaultGetFormatWithoutErrors, "defaultGetFormatWithoutErrors");
|
|
2392
|
+
let e$ = RegExp.prototype[Symbol.replace], { ERR_INVALID_MODULE_SPECIFIER: eq, ERR_INVALID_PACKAGE_CONFIG: eW, ERR_INVALID_PACKAGE_TARGET: eG, ERR_MODULE_NOT_FOUND: eH, ERR_PACKAGE_IMPORT_NOT_DEFINED: ez, ERR_PACKAGE_PATH_NOT_EXPORTED: eK, ERR_UNSUPPORTED_DIR_IMPORT: eZ, ERR_UNSUPPORTED_RESOLVE_REQUEST: eJ } = eN, eY = {}.hasOwnProperty, eQ = /(^|\\|\/)((\.|%2e)(\.|%2e)?|(n|%6e|%4e)(o|%6f|%4f)(d|%64|%44)(e|%65|%45)(_|%5f)(m|%6d|%4d)(o|%6f|%4f)(d|%64|%44)(u|%75|%55)(l|%6c|%4c)(e|%65|%45)(s|%73|%53))?(\\|\/|$)/i, eX = /(^|\\|\/)((\.|%2e)(\.|%2e)?|(n|%6e|%4e)(o|%6f|%4f)(d|%64|%44)(e|%65|%45)(_|%5f)(m|%6d|%4d)(o|%6f|%4f)(d|%64|%44)(u|%75|%55)(l|%6c|%4c)(e|%65|%45)(s|%73|%53))(\\|\/|$)/i, e1 = /^\.|%|\\/, e0 = /\*/g, e22 = /%2f|%5c/i, e3 = /* @__PURE__ */ new Set(), e4 = /[/\\]{2}/;
|
|
2393
|
+
function emitInvalidSegmentDeprecation(e10, t3, i2, s2, r2, n2, a2) {
|
|
2394
|
+
if (eS.noDeprecation) return;
|
|
2395
|
+
let o2 = (0, eE.fileURLToPath)(s2), h2 = null !== e4.exec(a2 ? e10 : t3);
|
|
2396
|
+
eS.emitWarning(`Use of deprecated ${h2 ? "double slash" : "leading or trailing slash matching"} resolving "${e10}" for module request "${t3}" ${t3 === i2 ? "" : `matched to "${i2}" `}in the "${r2 ? "imports" : "exports"}" field module resolution of the package at ${o2}${n2 ? ` imported from ${(0, eE.fileURLToPath)(n2)}` : ""}.`, "DeprecationWarning", "DEP0166");
|
|
2397
|
+
}
|
|
2398
|
+
__name(emitInvalidSegmentDeprecation, "emitInvalidSegmentDeprecation");
|
|
2399
|
+
function emitLegacyIndexDeprecation(e10, t3, i2, s2) {
|
|
2400
|
+
if (eS.noDeprecation || "module" !== defaultGetFormatWithoutErrors(e10, { parentURL: i2.href })) return;
|
|
2401
|
+
let r2 = (0, eE.fileURLToPath)(e10.href), n2 = (0, eE.fileURLToPath)(new eE.URL(".", t3)), a2 = (0, eE.fileURLToPath)(i2);
|
|
2402
|
+
s2 ? eC.resolve(n2, s2) !== r2 && eS.emitWarning(`Package ${n2} has a "main" field set to "${s2}", excluding the full filename and extension to the resolved file at "${r2.slice(n2.length)}", imported from ${a2}.
|
|
2403
|
+
Automatic extension resolution of the "main" field is deprecated for ES modules.`, "DeprecationWarning", "DEP0151") : eS.emitWarning(`No "main" or "exports" field defined in the package.json for ${n2} resolving the main entry point "${r2.slice(n2.length)}", imported from ${a2}.
|
|
2404
|
+
Default "index" lookups for the main are deprecated for ES modules.`, "DeprecationWarning", "DEP0151");
|
|
2405
|
+
}
|
|
2406
|
+
__name(emitLegacyIndexDeprecation, "emitLegacyIndexDeprecation");
|
|
2407
|
+
function tryStatSync(e10) {
|
|
2408
|
+
try {
|
|
2409
|
+
return (0, ef.statSync)(e10);
|
|
2410
|
+
} catch {
|
|
2411
|
+
}
|
|
2412
|
+
}
|
|
2413
|
+
__name(tryStatSync, "tryStatSync");
|
|
2414
|
+
function fileExists(e10) {
|
|
2415
|
+
let t3 = (0, ef.statSync)(e10, { throwIfNoEntry: false }), i2 = t3 ? t3.isFile() : void 0;
|
|
2416
|
+
return null != i2 && i2;
|
|
2417
|
+
}
|
|
2418
|
+
__name(fileExists, "fileExists");
|
|
2419
|
+
function legacyMainResolve(e10, t3, i2) {
|
|
2420
|
+
let s2;
|
|
2421
|
+
if (void 0 !== t3.main) {
|
|
2422
|
+
if (fileExists(s2 = new eE.URL(t3.main, e10))) return s2;
|
|
2423
|
+
let r3 = [`./${t3.main}.js`, `./${t3.main}.json`, `./${t3.main}.node`, `./${t3.main}/index.js`, `./${t3.main}/index.json`, `./${t3.main}/index.node`], n3 = -1;
|
|
2424
|
+
for (; ++n3 < r3.length && !fileExists(s2 = new eE.URL(r3[n3], e10)); ) s2 = void 0;
|
|
2425
|
+
if (s2) return emitLegacyIndexDeprecation(s2, e10, i2, t3.main), s2;
|
|
2426
|
+
}
|
|
2427
|
+
let r2 = ["./index.js", "./index.json", "./index.node"], n2 = -1;
|
|
2428
|
+
for (; ++n2 < r2.length && !fileExists(s2 = new eE.URL(r2[n2], e10)); ) s2 = void 0;
|
|
2429
|
+
if (s2) return emitLegacyIndexDeprecation(s2, e10, i2, t3.main), s2;
|
|
2430
|
+
throw new eH((0, eE.fileURLToPath)(new eE.URL(".", e10)), (0, eE.fileURLToPath)(i2));
|
|
2431
|
+
}
|
|
2432
|
+
__name(legacyMainResolve, "legacyMainResolve");
|
|
2433
|
+
function finalizeResolution(e10, t3, i2) {
|
|
2434
|
+
let s2;
|
|
2435
|
+
if (null !== e22.exec(e10.pathname)) throw new eq(e10.pathname, 'must not include encoded "/" or "\\" characters', (0, eE.fileURLToPath)(t3));
|
|
2436
|
+
try {
|
|
2437
|
+
s2 = (0, eE.fileURLToPath)(e10);
|
|
2438
|
+
} catch (i3) {
|
|
2439
|
+
throw Object.defineProperty(i3, "input", { value: String(e10) }), Object.defineProperty(i3, "module", { value: String(t3) }), i3;
|
|
2440
|
+
}
|
|
2441
|
+
let r2 = tryStatSync(s2.endsWith("/") ? s2.slice(-1) : s2);
|
|
2442
|
+
if (r2 && r2.isDirectory()) {
|
|
2443
|
+
let i3 = new eZ(s2, (0, eE.fileURLToPath)(t3));
|
|
2444
|
+
throw i3.url = String(e10), i3;
|
|
2445
|
+
}
|
|
2446
|
+
if (!r2 || !r2.isFile()) {
|
|
2447
|
+
let i3 = new eH(s2 || e10.pathname, t3 && (0, eE.fileURLToPath)(t3), true);
|
|
2448
|
+
throw i3.url = String(e10), i3;
|
|
2449
|
+
}
|
|
2450
|
+
{
|
|
2451
|
+
let t4 = (0, ef.realpathSync)(s2), { search: i3, hash: r3 } = e10;
|
|
2452
|
+
(e10 = (0, eE.pathToFileURL)(t4 + (s2.endsWith(eC.sep) ? "/" : ""))).search = i3, e10.hash = r3;
|
|
2453
|
+
}
|
|
2454
|
+
return e10;
|
|
2455
|
+
}
|
|
2456
|
+
__name(finalizeResolution, "finalizeResolution");
|
|
2457
|
+
function importNotDefined(e10, t3, i2) {
|
|
2458
|
+
return new ez(e10, t3 && (0, eE.fileURLToPath)(new eE.URL(".", t3)), (0, eE.fileURLToPath)(i2));
|
|
2459
|
+
}
|
|
2460
|
+
__name(importNotDefined, "importNotDefined");
|
|
2461
|
+
function exportsNotFound(e10, t3, i2) {
|
|
2462
|
+
return new eK((0, eE.fileURLToPath)(new eE.URL(".", t3)), e10, i2 && (0, eE.fileURLToPath)(i2));
|
|
2463
|
+
}
|
|
2464
|
+
__name(exportsNotFound, "exportsNotFound");
|
|
2465
|
+
function throwInvalidSubpath(e10, t3, i2, s2, r2) {
|
|
2466
|
+
throw new eq(e10, `request is not a valid match in pattern "${t3}" for the "${s2 ? "imports" : "exports"}" resolution of ${(0, eE.fileURLToPath)(i2)}`, r2 && (0, eE.fileURLToPath)(r2));
|
|
2467
|
+
}
|
|
2468
|
+
__name(throwInvalidSubpath, "throwInvalidSubpath");
|
|
2469
|
+
function invalidPackageTarget(e10, t3, i2, s2, r2) {
|
|
2470
|
+
return t3 = "object" == typeof t3 && null !== t3 ? JSON.stringify(t3, null, "") : `${t3}`, new eG((0, eE.fileURLToPath)(new eE.URL(".", i2)), e10, t3, s2, r2 && (0, eE.fileURLToPath)(r2));
|
|
2471
|
+
}
|
|
2472
|
+
__name(invalidPackageTarget, "invalidPackageTarget");
|
|
2473
|
+
function resolvePackageTargetString(e10, t3, i2, s2, r2, n2, a2, o2, h2) {
|
|
2474
|
+
if ("" !== t3 && !n2 && "/" !== e10[e10.length - 1]) throw invalidPackageTarget(i2, e10, s2, a2, r2);
|
|
2475
|
+
if (!e10.startsWith("./")) {
|
|
2476
|
+
if (a2 && !e10.startsWith("../") && !e10.startsWith("/")) {
|
|
2477
|
+
let i3 = false;
|
|
2478
|
+
try {
|
|
2479
|
+
new eE.URL(e10), i3 = true;
|
|
2480
|
+
} catch {
|
|
2481
|
+
}
|
|
2482
|
+
if (!i3) return packageResolve(n2 ? e$.call(e0, e10, () => t3) : e10 + t3, s2, h2);
|
|
2483
|
+
}
|
|
2484
|
+
throw invalidPackageTarget(i2, e10, s2, a2, r2);
|
|
2485
|
+
}
|
|
2486
|
+
if (null !== eQ.exec(e10.slice(2))) if (null === eX.exec(e10.slice(2))) {
|
|
2487
|
+
if (!o2) {
|
|
2488
|
+
let o3 = n2 ? i2.replace("*", () => t3) : i2 + t3;
|
|
2489
|
+
emitInvalidSegmentDeprecation(n2 ? e$.call(e0, e10, () => t3) : e10, o3, i2, s2, a2, r2, true);
|
|
2490
|
+
}
|
|
2491
|
+
} else throw invalidPackageTarget(i2, e10, s2, a2, r2);
|
|
2492
|
+
let c2 = new eE.URL(e10, s2), p2 = c2.pathname, l2 = new eE.URL(".", s2).pathname;
|
|
2493
|
+
if (!p2.startsWith(l2)) throw invalidPackageTarget(i2, e10, s2, a2, r2);
|
|
2494
|
+
if ("" === t3) return c2;
|
|
2495
|
+
if (null !== eQ.exec(t3)) {
|
|
2496
|
+
let h3 = n2 ? i2.replace("*", () => t3) : i2 + t3;
|
|
2497
|
+
null === eX.exec(t3) ? o2 || emitInvalidSegmentDeprecation(n2 ? e$.call(e0, e10, () => t3) : e10, h3, i2, s2, a2, r2, false) : throwInvalidSubpath(h3, i2, s2, a2, r2);
|
|
2498
|
+
}
|
|
2499
|
+
return n2 ? new eE.URL(e$.call(e0, c2.href, () => t3)) : new eE.URL(t3, c2);
|
|
2500
|
+
}
|
|
2501
|
+
__name(resolvePackageTargetString, "resolvePackageTargetString");
|
|
2502
|
+
function isArrayIndex(e10) {
|
|
2503
|
+
let t3 = Number(e10);
|
|
2504
|
+
return `${t3}` === e10 && t3 >= 0 && t3 < 4294967295;
|
|
2505
|
+
}
|
|
2506
|
+
__name(isArrayIndex, "isArrayIndex");
|
|
2507
|
+
function resolvePackageTarget(e10, t3, i2, s2, r2, n2, a2, o2, h2) {
|
|
2508
|
+
if ("string" == typeof t3) return resolvePackageTargetString(t3, i2, s2, e10, r2, n2, a2, o2, h2);
|
|
2509
|
+
if (Array.isArray(t3)) {
|
|
2510
|
+
let c2;
|
|
2511
|
+
if (0 === t3.length) return null;
|
|
2512
|
+
let p2 = -1;
|
|
2513
|
+
for (; ++p2 < t3.length; ) {
|
|
2514
|
+
let l2, u2 = t3[p2];
|
|
2515
|
+
try {
|
|
2516
|
+
l2 = resolvePackageTarget(e10, u2, i2, s2, r2, n2, a2, o2, h2);
|
|
2517
|
+
} catch (e11) {
|
|
2518
|
+
if (c2 = e11, "ERR_INVALID_PACKAGE_TARGET" === e11.code) continue;
|
|
2519
|
+
throw e11;
|
|
2520
|
+
}
|
|
2521
|
+
if (void 0 !== l2) {
|
|
2522
|
+
if (null === l2) {
|
|
2523
|
+
c2 = null;
|
|
2524
|
+
continue;
|
|
2525
|
+
}
|
|
2526
|
+
return l2;
|
|
2527
|
+
}
|
|
2528
|
+
}
|
|
2529
|
+
if (null == c2) return null;
|
|
2530
|
+
throw c2;
|
|
2531
|
+
}
|
|
2532
|
+
if ("object" == typeof t3 && null !== t3) {
|
|
2533
|
+
let c2 = Object.getOwnPropertyNames(t3), p2 = -1;
|
|
2534
|
+
for (; ++p2 < c2.length; ) if (isArrayIndex(c2[p2])) throw new eW((0, eE.fileURLToPath)(e10), r2, '"exports" cannot contain numeric property keys.');
|
|
2535
|
+
for (p2 = -1; ++p2 < c2.length; ) {
|
|
2536
|
+
let l2 = c2[p2];
|
|
2537
|
+
if ("default" === l2 || h2 && h2.has(l2)) {
|
|
2538
|
+
let c3 = resolvePackageTarget(e10, t3[l2], i2, s2, r2, n2, a2, o2, h2);
|
|
2539
|
+
if (void 0 === c3) continue;
|
|
2540
|
+
return c3;
|
|
2541
|
+
}
|
|
2542
|
+
}
|
|
2543
|
+
return null;
|
|
2544
|
+
}
|
|
2545
|
+
if (null === t3) return null;
|
|
2546
|
+
throw invalidPackageTarget(s2, t3, e10, a2, r2);
|
|
2547
|
+
}
|
|
2548
|
+
__name(resolvePackageTarget, "resolvePackageTarget");
|
|
2549
|
+
function isConditionalExportsMainSugar(e10, t3, i2) {
|
|
2550
|
+
if ("string" == typeof e10 || Array.isArray(e10)) return true;
|
|
2551
|
+
if ("object" != typeof e10 || null === e10) return false;
|
|
2552
|
+
let s2 = Object.getOwnPropertyNames(e10), r2 = false, n2 = 0, a2 = -1;
|
|
2553
|
+
for (; ++a2 < s2.length; ) {
|
|
2554
|
+
let e11 = s2[a2], o2 = "" === e11 || "." !== e11[0];
|
|
2555
|
+
if (0 == n2++) r2 = o2;
|
|
2556
|
+
else if (r2 !== o2) throw new eW((0, eE.fileURLToPath)(t3), i2, `"exports" cannot contain some keys starting with '.' and some not. The exports object must either be an object of package subpath keys or an object of main entry condition name keys only.`);
|
|
2557
|
+
}
|
|
2558
|
+
return r2;
|
|
2559
|
+
}
|
|
2560
|
+
__name(isConditionalExportsMainSugar, "isConditionalExportsMainSugar");
|
|
2561
|
+
function emitTrailingSlashPatternDeprecation(e10, t3, i2) {
|
|
2562
|
+
if (eS.noDeprecation) return;
|
|
2563
|
+
let s2 = (0, eE.fileURLToPath)(t3);
|
|
2564
|
+
e3.has(s2 + "|" + e10) || (e3.add(s2 + "|" + e10), eS.emitWarning(`Use of deprecated trailing slash pattern mapping "${e10}" in the "exports" field module resolution of the package at ${s2}${i2 ? ` imported from ${(0, eE.fileURLToPath)(i2)}` : ""}. Mapping specifiers ending in "/" is no longer supported.`, "DeprecationWarning", "DEP0155"));
|
|
2565
|
+
}
|
|
2566
|
+
__name(emitTrailingSlashPatternDeprecation, "emitTrailingSlashPatternDeprecation");
|
|
2567
|
+
function packageExportsResolve(e10, t3, i2, s2, r2) {
|
|
2568
|
+
let n2 = i2.exports;
|
|
2569
|
+
if (isConditionalExportsMainSugar(n2, e10, s2) && (n2 = { ".": n2 }), eY.call(n2, t3) && !t3.includes("*") && !t3.endsWith("/")) {
|
|
2570
|
+
let i3 = resolvePackageTarget(e10, n2[t3], "", t3, s2, false, false, false, r2);
|
|
2571
|
+
if (null == i3) throw exportsNotFound(t3, e10, s2);
|
|
2572
|
+
return i3;
|
|
2573
|
+
}
|
|
2574
|
+
let a2 = "", o2 = "", h2 = Object.getOwnPropertyNames(n2), c2 = -1;
|
|
2575
|
+
for (; ++c2 < h2.length; ) {
|
|
2576
|
+
let i3 = h2[c2], r3 = i3.indexOf("*");
|
|
2577
|
+
if (-1 !== r3 && t3.startsWith(i3.slice(0, r3))) {
|
|
2578
|
+
t3.endsWith("/") && emitTrailingSlashPatternDeprecation(t3, e10, s2);
|
|
2579
|
+
let n3 = i3.slice(r3 + 1);
|
|
2580
|
+
t3.length >= i3.length && t3.endsWith(n3) && 1 === patternKeyCompare(a2, i3) && i3.lastIndexOf("*") === r3 && (a2 = i3, o2 = t3.slice(r3, t3.length - n3.length));
|
|
2581
|
+
}
|
|
2582
|
+
}
|
|
2583
|
+
if (a2) {
|
|
2584
|
+
let i3 = resolvePackageTarget(e10, n2[a2], o2, a2, s2, true, false, t3.endsWith("/"), r2);
|
|
2585
|
+
if (null == i3) throw exportsNotFound(t3, e10, s2);
|
|
2586
|
+
return i3;
|
|
2587
|
+
}
|
|
2588
|
+
throw exportsNotFound(t3, e10, s2);
|
|
2589
|
+
}
|
|
2590
|
+
__name(packageExportsResolve, "packageExportsResolve");
|
|
2591
|
+
function patternKeyCompare(e10, t3) {
|
|
2592
|
+
let i2 = e10.indexOf("*"), s2 = t3.indexOf("*"), r2 = -1 === i2 ? e10.length : i2 + 1, n2 = -1 === s2 ? t3.length : s2 + 1;
|
|
2593
|
+
return r2 > n2 ? -1 : n2 > r2 || -1 === i2 ? 1 : -1 === s2 || e10.length > t3.length ? -1 : +(t3.length > e10.length);
|
|
2594
|
+
}
|
|
2595
|
+
__name(patternKeyCompare, "patternKeyCompare");
|
|
2596
|
+
function packageImportsResolve(e10, t3, i2) {
|
|
2597
|
+
let s2;
|
|
2598
|
+
if ("#" === e10 || e10.startsWith("#/") || e10.endsWith("/")) throw new eq(e10, "is not a valid internal imports specifier name", (0, eE.fileURLToPath)(t3));
|
|
2599
|
+
let r2 = getPackageScopeConfig(t3);
|
|
2600
|
+
if (r2.exists) {
|
|
2601
|
+
s2 = (0, eE.pathToFileURL)(r2.pjsonPath);
|
|
2602
|
+
let n2 = r2.imports;
|
|
2603
|
+
if (n2) if (eY.call(n2, e10) && !e10.includes("*")) {
|
|
2604
|
+
let r3 = resolvePackageTarget(s2, n2[e10], "", e10, t3, false, true, false, i2);
|
|
2605
|
+
if (null != r3) return r3;
|
|
2606
|
+
} else {
|
|
2607
|
+
let r3 = "", a2 = "", o2 = Object.getOwnPropertyNames(n2), h2 = -1;
|
|
2608
|
+
for (; ++h2 < o2.length; ) {
|
|
2609
|
+
let t4 = o2[h2], i3 = t4.indexOf("*");
|
|
2610
|
+
if (-1 !== i3 && e10.startsWith(t4.slice(0, -1))) {
|
|
2611
|
+
let s3 = t4.slice(i3 + 1);
|
|
2612
|
+
e10.length >= t4.length && e10.endsWith(s3) && 1 === patternKeyCompare(r3, t4) && t4.lastIndexOf("*") === i3 && (r3 = t4, a2 = e10.slice(i3, e10.length - s3.length));
|
|
2613
|
+
}
|
|
2614
|
+
}
|
|
2615
|
+
if (r3) {
|
|
2616
|
+
let e11 = resolvePackageTarget(s2, n2[r3], a2, r3, t3, true, true, false, i2);
|
|
2617
|
+
if (null != e11) return e11;
|
|
2618
|
+
}
|
|
2619
|
+
}
|
|
2620
|
+
}
|
|
2621
|
+
throw importNotDefined(e10, s2, t3);
|
|
2622
|
+
}
|
|
2623
|
+
__name(packageImportsResolve, "packageImportsResolve");
|
|
2624
|
+
function parsePackageName(e10, t3) {
|
|
2625
|
+
let i2 = e10.indexOf("/"), s2 = true, r2 = false;
|
|
2626
|
+
"@" === e10[0] && (r2 = true, -1 === i2 || 0 === e10.length ? s2 = false : i2 = e10.indexOf("/", i2 + 1));
|
|
2627
|
+
let n2 = -1 === i2 ? e10 : e10.slice(0, i2);
|
|
2628
|
+
if (null !== e1.exec(n2) && (s2 = false), !s2) throw new eq(e10, "is not a valid package name", (0, eE.fileURLToPath)(t3));
|
|
2629
|
+
return { packageName: n2, packageSubpath: "." + (-1 === i2 ? "" : e10.slice(i2)), isScoped: r2 };
|
|
2630
|
+
}
|
|
2631
|
+
__name(parsePackageName, "parsePackageName");
|
|
2632
|
+
function packageResolve(e10, t3, i2) {
|
|
2633
|
+
let s2;
|
|
2634
|
+
if (ed.builtinModules.includes(e10)) return new eE.URL("node:" + e10);
|
|
2635
|
+
let { packageName: r2, packageSubpath: n2, isScoped: a2 } = parsePackageName(e10, t3), o2 = getPackageScopeConfig(t3);
|
|
2636
|
+
if (o2.exists) {
|
|
2637
|
+
let e11 = (0, eE.pathToFileURL)(o2.pjsonPath);
|
|
2638
|
+
if (o2.name === r2 && void 0 !== o2.exports && null !== o2.exports) return packageExportsResolve(e11, n2, o2, t3, i2);
|
|
2639
|
+
}
|
|
2640
|
+
let h2 = new eE.URL("./node_modules/" + r2 + "/package.json", t3), c2 = (0, eE.fileURLToPath)(h2);
|
|
2641
|
+
do {
|
|
2642
|
+
let o3 = tryStatSync(c2.slice(0, -13));
|
|
2643
|
+
if (!o3 || !o3.isDirectory()) {
|
|
2644
|
+
s2 = c2, h2 = new eE.URL((a2 ? "../../../../node_modules/" : "../../../node_modules/") + r2 + "/package.json", h2), c2 = (0, eE.fileURLToPath)(h2);
|
|
2645
|
+
continue;
|
|
2646
|
+
}
|
|
2647
|
+
let p2 = read(c2, { base: t3, specifier: e10 });
|
|
2648
|
+
if (void 0 !== p2.exports && null !== p2.exports) return packageExportsResolve(h2, n2, p2, t3, i2);
|
|
2649
|
+
if ("." === n2) return legacyMainResolve(h2, p2, t3);
|
|
2650
|
+
return new eE.URL(n2, h2);
|
|
2651
|
+
} while (c2.length !== s2.length);
|
|
2652
|
+
throw new eH(r2, (0, eE.fileURLToPath)(t3), false);
|
|
2653
|
+
}
|
|
2654
|
+
__name(packageResolve, "packageResolve");
|
|
2655
|
+
function isRelativeSpecifier(e10) {
|
|
2656
|
+
return "." === e10[0] && (1 === e10.length || "/" === e10[1] || "." === e10[1] && (2 === e10.length || "/" === e10[2])) || false;
|
|
2657
|
+
}
|
|
2658
|
+
__name(isRelativeSpecifier, "isRelativeSpecifier");
|
|
2659
|
+
function shouldBeTreatedAsRelativeOrAbsolutePath(e10) {
|
|
2660
|
+
return "" !== e10 && ("/" === e10[0] || isRelativeSpecifier(e10));
|
|
2661
|
+
}
|
|
2662
|
+
__name(shouldBeTreatedAsRelativeOrAbsolutePath, "shouldBeTreatedAsRelativeOrAbsolutePath");
|
|
2663
|
+
function moduleResolve(e10, t3, i2, s2) {
|
|
2664
|
+
let r2, n2 = t3.protocol;
|
|
2665
|
+
if (shouldBeTreatedAsRelativeOrAbsolutePath(e10)) try {
|
|
2666
|
+
r2 = new eE.URL(e10, t3);
|
|
2667
|
+
} catch (s3) {
|
|
2668
|
+
let i3 = new eJ(e10, t3);
|
|
2669
|
+
throw i3.cause = s3, i3;
|
|
2670
|
+
}
|
|
2671
|
+
else if ("file:" === n2 && "#" === e10[0]) r2 = packageImportsResolve(e10, t3, i2);
|
|
2672
|
+
else try {
|
|
2673
|
+
r2 = new eE.URL(e10);
|
|
2674
|
+
} catch (s3) {
|
|
2675
|
+
if (("data:" === n2 || "http:" === n2 || "https:" === n2) && !ed.builtinModules.includes(e10)) {
|
|
2676
|
+
let i3 = new eJ(e10, t3);
|
|
2677
|
+
throw i3.cause = s3, i3;
|
|
2678
|
+
}
|
|
2679
|
+
r2 = packageResolve(e10, t3, i2);
|
|
2680
|
+
}
|
|
2681
|
+
return (ek(void 0 !== r2, "expected to be defined"), "file:" !== r2.protocol) ? r2 : finalizeResolution(r2, t3);
|
|
2682
|
+
}
|
|
2683
|
+
__name(moduleResolve, "moduleResolve");
|
|
2684
|
+
function fileURLToPath(e10) {
|
|
2685
|
+
return "string" != typeof e10 || e10.startsWith("file://") ? normalizeSlash((0, eE.fileURLToPath)(e10)) : normalizeSlash(e10);
|
|
2686
|
+
}
|
|
2687
|
+
__name(fileURLToPath, "fileURLToPath");
|
|
2688
|
+
function pathToFileURL(e10) {
|
|
2689
|
+
return (0, eE.pathToFileURL)(fileURLToPath(e10)).toString();
|
|
2690
|
+
}
|
|
2691
|
+
__name(pathToFileURL, "pathToFileURL");
|
|
2692
|
+
function normalizeid(e10) {
|
|
2693
|
+
return ("string" != typeof e10 && (e10 = e10.toString()), /(?:node|data|http|https|file):/.test(e10)) ? e10 : eI.has(e10) ? "node:" + e10 : "file://" + encodeURI(normalizeSlash(e10));
|
|
2694
|
+
}
|
|
2695
|
+
__name(normalizeid, "normalizeid");
|
|
2696
|
+
let e6 = /* @__PURE__ */ new Set(["node", "import"]), e5 = [".mjs", ".cjs", ".js", ".json"], e9 = /* @__PURE__ */ new Set(["ERR_MODULE_NOT_FOUND", "ERR_UNSUPPORTED_DIR_IMPORT", "MODULE_NOT_FOUND", "ERR_PACKAGE_PATH_NOT_EXPORTED"]);
|
|
2697
|
+
function _tryModuleResolve(e10, t3, i2) {
|
|
2698
|
+
try {
|
|
2699
|
+
return moduleResolve(e10, t3, i2);
|
|
2700
|
+
} catch (e11) {
|
|
2701
|
+
if (!e9.has(e11?.code)) throw e11;
|
|
2702
|
+
}
|
|
2703
|
+
}
|
|
2704
|
+
__name(_tryModuleResolve, "_tryModuleResolve");
|
|
2705
|
+
function _resolve(e10, t3 = {}) {
|
|
2706
|
+
let i2;
|
|
2707
|
+
if ("string" != typeof e10) if (e10 instanceof URL) e10 = fileURLToPath(e10);
|
|
2708
|
+
else throw TypeError("input must be a `string` or `URL`");
|
|
2709
|
+
if (/(?:node|data|http|https):/.test(e10)) return e10;
|
|
2710
|
+
if (eI.has(e10)) return "node:" + e10;
|
|
2711
|
+
if (e10.startsWith("file://") && (e10 = fileURLToPath(e10)), isAbsolute(e10)) try {
|
|
2712
|
+
if ((0, ef.statSync)(e10).isFile()) return pathToFileURL(e10);
|
|
2713
|
+
} catch (e11) {
|
|
2714
|
+
if (e11?.code !== "ENOENT") throw e11;
|
|
2715
|
+
}
|
|
2716
|
+
let s2 = t3.conditions ? new Set(t3.conditions) : e6, r2 = (Array.isArray(t3.url) ? t3.url : [t3.url]).filter(Boolean).map((e11) => new URL(normalizeid(e11.toString())));
|
|
2717
|
+
0 === r2.length && r2.push(new URL(pathToFileURL(process.cwd())));
|
|
2718
|
+
let n2 = [...r2];
|
|
2719
|
+
for (let e11 of r2) "file:" === e11.protocol && n2.push(new URL("./", e11), new URL(dist_joinURL(e11.pathname, "_index.js"), e11), new URL("node_modules", e11));
|
|
2720
|
+
for (let r3 of n2) {
|
|
2721
|
+
if (i2 = _tryModuleResolve(e10, r3, s2)) break;
|
|
2722
|
+
for (let n3 of ["", "/index"]) {
|
|
2723
|
+
for (let a2 of t3.extensions || e5) if (i2 = _tryModuleResolve(dist_joinURL(e10, n3) + a2, r3, s2)) break;
|
|
2724
|
+
if (i2) break;
|
|
2725
|
+
}
|
|
2726
|
+
if (i2) break;
|
|
2727
|
+
}
|
|
2728
|
+
if (!i2) {
|
|
2729
|
+
let t4 = Error(`Cannot find module ${e10} imported from ${n2.join(", ")}`);
|
|
2730
|
+
throw t4.code = "ERR_MODULE_NOT_FOUND", t4;
|
|
2731
|
+
}
|
|
2732
|
+
return pathToFileURL(i2);
|
|
2733
|
+
}
|
|
2734
|
+
__name(_resolve, "_resolve");
|
|
2735
|
+
function resolveSync(e10, t3) {
|
|
2736
|
+
return _resolve(e10, t3);
|
|
2737
|
+
}
|
|
2738
|
+
__name(resolveSync, "resolveSync");
|
|
2739
|
+
function resolvePathSync(e10, t3) {
|
|
2740
|
+
return fileURLToPath(resolveSync(e10, t3));
|
|
2741
|
+
}
|
|
2742
|
+
__name(resolvePathSync, "resolvePathSync");
|
|
2743
|
+
let e8 = /(?:[\s;]|^)(?:import[\s\w*,{}]*from|import\s*["'*{]|export\b\s*(?:[*{]|default|class|type|function|const|var|let|async function)|import\.meta\b)/m, e7 = /\/\*.+?\*\/|\/\/.*(?=[nr])/g;
|
|
2744
|
+
function hasESMSyntax(e10, t3 = {}) {
|
|
2745
|
+
return t3.stripComments && (e10 = e10.replace(e7, "")), e8.test(e10);
|
|
2746
|
+
}
|
|
2747
|
+
__name(hasESMSyntax, "hasESMSyntax");
|
|
2748
|
+
function escapeStringRegexp(e10) {
|
|
2749
|
+
if ("string" != typeof e10) throw TypeError("Expected a string");
|
|
2750
|
+
return e10.replace(/[|\\{}()[\]^$+*?.]/g, "\\$&").replace(/-/g, "\\x2d");
|
|
2751
|
+
}
|
|
2752
|
+
__name(escapeStringRegexp, "escapeStringRegexp");
|
|
2753
|
+
let te = /* @__PURE__ */ new Set(["/", "\\", void 0]), tt = Symbol.for("pathe:normalizedAlias"), ti = /[/\\]/;
|
|
2754
|
+
function normalizeAliases(e10) {
|
|
2755
|
+
if (e10[tt]) return e10;
|
|
2756
|
+
let t3 = Object.fromEntries(Object.entries(e10).sort(([e11], [t4]) => _compareAliases(e11, t4)));
|
|
2757
|
+
for (let e11 in t3) for (let i2 in t3) !(i2 === e11 || e11.startsWith(i2)) && t3[e11]?.startsWith(i2) && te.has(t3[e11][i2.length]) && (t3[e11] = t3[i2] + t3[e11].slice(i2.length));
|
|
2758
|
+
return Object.defineProperty(t3, tt, { value: true, enumerable: false }), t3;
|
|
2759
|
+
}
|
|
2760
|
+
__name(normalizeAliases, "normalizeAliases");
|
|
2761
|
+
function resolveAlias(e10, t3) {
|
|
2762
|
+
let i2 = pathe_M_eThtNZ_normalizeWindowsPath(e10);
|
|
2763
|
+
for (let [e11, s2] of Object.entries(t3 = normalizeAliases(t3))) {
|
|
2764
|
+
if (!i2.startsWith(e11)) continue;
|
|
2765
|
+
let t4 = utils_hasTrailingSlash(e11) ? e11.slice(0, -1) : e11;
|
|
2766
|
+
if (utils_hasTrailingSlash(i2[t4.length])) return pathe_M_eThtNZ_join(s2, i2.slice(e11.length));
|
|
2767
|
+
}
|
|
2768
|
+
return i2;
|
|
2769
|
+
}
|
|
2770
|
+
__name(resolveAlias, "resolveAlias");
|
|
2771
|
+
function utils_filename(e10) {
|
|
2772
|
+
let t3 = e10.split(ti).pop();
|
|
2773
|
+
if (!t3) return;
|
|
2774
|
+
let i2 = t3.lastIndexOf(".");
|
|
2775
|
+
return i2 <= 0 ? t3 : t3.slice(0, i2);
|
|
2776
|
+
}
|
|
2777
|
+
__name(utils_filename, "utils_filename");
|
|
2778
|
+
function _compareAliases(e10, t3) {
|
|
2779
|
+
return t3.split("/").length - e10.split("/").length;
|
|
2780
|
+
}
|
|
2781
|
+
__name(_compareAliases, "_compareAliases");
|
|
2782
|
+
function utils_hasTrailingSlash(e10 = "/") {
|
|
2783
|
+
let t3 = e10[e10.length - 1];
|
|
2784
|
+
return "/" === t3 || "\\" === t3;
|
|
2785
|
+
}
|
|
2786
|
+
__name(utils_hasTrailingSlash, "utils_hasTrailingSlash");
|
|
2787
|
+
let ts = __require("node:crypto");
|
|
2788
|
+
var tr = __webpack_require__.n(ts);
|
|
2789
|
+
let tn = /* @__PURE__ */ Object.create(null), dist_i = /* @__PURE__ */ __name((e10) => globalThis.process?.env || globalThis.Deno?.env.toObject() || globalThis.__env__ || (e10 ? tn : globalThis), "dist_i"), ta = new Proxy(tn, { get: /* @__PURE__ */ __name((e10, t3) => dist_i()[t3] ?? tn[t3], "get"), has: /* @__PURE__ */ __name((e10, t3) => t3 in dist_i() || t3 in tn, "has"), set: /* @__PURE__ */ __name((e10, t3, i2) => (dist_i(true)[t3] = i2, true), "set"), deleteProperty(e10, t3) {
|
|
2790
|
+
if (!t3) return false;
|
|
2791
|
+
let i2 = dist_i(true);
|
|
2792
|
+
return delete i2[t3], true;
|
|
2793
|
+
}, ownKeys: /* @__PURE__ */ __name(() => Object.keys(dist_i(true)), "ownKeys") }), to = "u" > typeof process && process.env && process.env.NODE_ENV || "", th = [["APPVEYOR"], ["AWS_AMPLIFY", "AWS_APP_ID", { ci: true }], ["AZURE_PIPELINES", "SYSTEM_TEAMFOUNDATIONCOLLECTIONURI"], ["AZURE_STATIC", "INPUT_AZURE_STATIC_WEB_APPS_API_TOKEN"], ["APPCIRCLE", "AC_APPCIRCLE"], ["BAMBOO", "bamboo_planKey"], ["BITBUCKET", "BITBUCKET_COMMIT"], ["BITRISE", "BITRISE_IO"], ["BUDDY", "BUDDY_WORKSPACE_ID"], ["BUILDKITE"], ["CIRCLE", "CIRCLECI"], ["CIRRUS", "CIRRUS_CI"], ["CLOUDFLARE_PAGES", "CF_PAGES", { ci: true }], ["CLOUDFLARE_WORKERS", "WORKERS_CI", { ci: true }], ["CODEBUILD", "CODEBUILD_BUILD_ARN"], ["CODEFRESH", "CF_BUILD_ID"], ["DRONE"], ["DRONE", "DRONE_BUILD_EVENT"], ["DSARI"], ["GITHUB_ACTIONS"], ["GITLAB", "GITLAB_CI"], ["GITLAB", "CI_MERGE_REQUEST_ID"], ["GOCD", "GO_PIPELINE_LABEL"], ["LAYERCI"], ["HUDSON", "HUDSON_URL"], ["JENKINS", "JENKINS_URL"], ["MAGNUM"], ["NETLIFY"], ["NETLIFY", "NETLIFY_LOCAL", { ci: false }], ["NEVERCODE"], ["RENDER"], ["SAIL", "SAILCI"], ["SEMAPHORE"], ["SCREWDRIVER"], ["SHIPPABLE"], ["SOLANO", "TDDIUM"], ["STRIDER"], ["TEAMCITY", "TEAMCITY_VERSION"], ["TRAVIS"], ["VERCEL", "NOW_BUILDER"], ["VERCEL", "VERCEL", { ci: false }], ["VERCEL", "VERCEL_ENV", { ci: false }], ["APPCENTER", "APPCENTER_BUILD_ID"], ["CODESANDBOX", "CODESANDBOX_SSE", { ci: false }], ["CODESANDBOX", "CODESANDBOX_HOST", { ci: false }], ["STACKBLITZ"], ["STORMKIT"], ["CLEAVR"], ["ZEABUR"], ["CODESPHERE", "CODESPHERE_APP_ID", { ci: true }], ["RAILWAY", "RAILWAY_PROJECT_ID"], ["RAILWAY", "RAILWAY_SERVICE_ID"], ["DENO-DEPLOY", "DENO_DEPLOYMENT_ID"], ["FIREBASE_APP_HOSTING", "FIREBASE_APP_HOSTING", { ci: true }]], tc = function() {
|
|
2794
|
+
if (globalThis.process?.env) for (let e10 of th) {
|
|
2795
|
+
let t3 = e10[1] || e10[0];
|
|
2796
|
+
if (globalThis.process?.env[t3]) return { name: e10[0].toLowerCase(), ...e10[2] };
|
|
2797
|
+
}
|
|
2798
|
+
return globalThis.process?.env?.SHELL === "/bin/jsh" && globalThis.process?.versions?.webcontainer ? { name: "stackblitz", ci: false } : { name: "", ci: false };
|
|
2799
|
+
}();
|
|
2800
|
+
function std_env_dist_n(e10) {
|
|
2801
|
+
return !!e10 && "false" !== e10;
|
|
2802
|
+
}
|
|
2803
|
+
__name(std_env_dist_n, "std_env_dist_n");
|
|
2804
|
+
tc.name;
|
|
2805
|
+
let tp = globalThis.process?.platform || "", tl = (std_env_dist_n(ta.CI) || tc.ci, std_env_dist_n(globalThis.process?.stdout && globalThis.process?.stdout.isTTY)), tu = (std_env_dist_n(ta.DEBUG), "test" === to || std_env_dist_n(ta.TEST), std_env_dist_n(ta.MINIMAL), /^win/i.test(tp)), td = (/^linux/i.test(tp), /^darwin/i.test(tp), !std_env_dist_n(ta.NO_COLOR) && (std_env_dist_n(ta.FORCE_COLOR) || (tl || tu) && ta.TERM), (globalThis.process?.versions?.node || "").replace(/^v/, "") || null), tf = (td?.split(".")[0], globalThis.process || /* @__PURE__ */ Object.create(null)), tm = { versions: {} }, tg = (new Proxy(tf, { get: /* @__PURE__ */ __name((e10, t3) => "env" === t3 ? ta : t3 in e10 ? e10[t3] : t3 in tm ? tm[t3] : void 0, "get") }), globalThis.process?.release?.name === "node"), t_ = !!globalThis.Bun || !!globalThis.process?.versions?.bun, tx = !!globalThis.Deno, tv = !!globalThis.fastly, ty = [[!!globalThis.Netlify, "netlify"], [!!globalThis.EdgeRuntime, "edge-light"], [globalThis.navigator?.userAgent === "Cloudflare-Workers", "workerd"], [tv, "fastly"], [tx, "deno"], [t_, "bun"], [tg, "node"]], tb = function() {
|
|
2806
|
+
let e10 = ty.find((e11) => e11[0]);
|
|
2807
|
+
if (e10) return { name: e10[1] };
|
|
2808
|
+
}();
|
|
2809
|
+
tb?.name;
|
|
2810
|
+
let tE = __require("node:tty"), tk = tE?.WriteStream?.prototype?.hasColors?.() ?? false, base_format = /* @__PURE__ */ __name((e10, t3) => {
|
|
2811
|
+
if (!tk) return (e11) => e11;
|
|
2812
|
+
let i2 = `\x1B[${e10}m`, s2 = `\x1B[${t3}m`;
|
|
2813
|
+
return (e11) => {
|
|
2814
|
+
let r2 = e11 + "", n2 = r2.indexOf(s2);
|
|
2815
|
+
if (-1 === n2) return i2 + r2 + s2;
|
|
2816
|
+
let a2 = i2, o2 = 0, h2 = (22 === t3 ? s2 : "") + i2;
|
|
2817
|
+
for (; -1 !== n2; ) a2 += r2.slice(o2, n2) + h2, o2 = n2 + s2.length, n2 = r2.indexOf(s2, o2);
|
|
2818
|
+
return a2 + (r2.slice(o2) + s2);
|
|
2819
|
+
};
|
|
2820
|
+
}, "base_format");
|
|
2821
|
+
base_format(0, 0), base_format(1, 22), base_format(2, 22), base_format(3, 23), base_format(4, 24), base_format(53, 55), base_format(7, 27), base_format(8, 28), base_format(9, 29), base_format(30, 39);
|
|
2822
|
+
let tS = base_format(31, 39), tC = base_format(32, 39), tw = base_format(33, 39), tT = base_format(34, 39);
|
|
2823
|
+
base_format(35, 39);
|
|
2824
|
+
let tI = base_format(36, 39);
|
|
2825
|
+
base_format(37, 39);
|
|
2826
|
+
let tR = base_format(90, 39);
|
|
2827
|
+
function isDir(e10) {
|
|
2828
|
+
if ("string" != typeof e10 || e10.startsWith("file://")) return false;
|
|
2829
|
+
try {
|
|
2830
|
+
return (0, ef.lstatSync)(e10).isDirectory();
|
|
2831
|
+
} catch {
|
|
2832
|
+
return false;
|
|
2833
|
+
}
|
|
2834
|
+
}
|
|
2835
|
+
__name(isDir, "isDir");
|
|
2836
|
+
function isWritable(e10) {
|
|
2837
|
+
try {
|
|
2838
|
+
return (0, ef.accessSync)(e10, ef.constants.W_OK), true;
|
|
2839
|
+
} catch {
|
|
2840
|
+
return false;
|
|
2841
|
+
}
|
|
2842
|
+
}
|
|
2843
|
+
__name(isWritable, "isWritable");
|
|
2844
|
+
function utils_hash(e10, t3 = 8) {
|
|
2845
|
+
return (isFipsMode() ? tr().createHash("sha256") : tr().createHash("md5")).update(e10).digest("hex").slice(0, t3);
|
|
2846
|
+
}
|
|
2847
|
+
__name(utils_hash, "utils_hash");
|
|
2848
|
+
function readNearestPackageJSON(e10) {
|
|
2849
|
+
for (; e10 && "." !== e10 && "/" !== e10; ) {
|
|
2850
|
+
e10 = pathe_M_eThtNZ_join(e10, "..");
|
|
2851
|
+
try {
|
|
2852
|
+
let t3 = (0, ef.readFileSync)(pathe_M_eThtNZ_join(e10, "package.json"), "utf8");
|
|
2853
|
+
try {
|
|
2854
|
+
return JSON.parse(t3);
|
|
2855
|
+
} catch {
|
|
2856
|
+
}
|
|
2857
|
+
break;
|
|
2858
|
+
} catch {
|
|
2859
|
+
}
|
|
2860
|
+
}
|
|
2861
|
+
}
|
|
2862
|
+
__name(readNearestPackageJSON, "readNearestPackageJSON");
|
|
2863
|
+
function wrapModule(e10, t3) {
|
|
2864
|
+
return `(${t3?.async ? "async " : ""}function (exports, require, module, __filename, __dirname, jitiImport, jitiESMResolve) { ${e10}
|
|
2865
|
+
});`;
|
|
2866
|
+
}
|
|
2867
|
+
__name(wrapModule, "wrapModule");
|
|
2868
|
+
base_format(40, 49), base_format(41, 49), base_format(42, 49), base_format(43, 49), base_format(44, 49), base_format(45, 49), base_format(46, 49), base_format(47, 49), base_format(100, 49), base_format(91, 39), base_format(92, 39), base_format(93, 39), base_format(94, 39), base_format(95, 39), base_format(96, 39), base_format(97, 39), base_format(101, 49), base_format(102, 49), base_format(103, 49), base_format(104, 49), base_format(105, 49), base_format(106, 49), base_format(107, 49);
|
|
2869
|
+
let tP = { true: tC("true"), false: tw("false"), "[rebuild]": tw("[rebuild]"), "[esm]": tT("[esm]"), "[cjs]": tC("[cjs]"), "[import]": tT("[import]"), "[require]": tC("[require]"), "[native]": tI("[native]"), "[transpile]": tw("[transpile]"), "[fallback]": tS("[fallback]"), "[unknown]": tS("[unknown]"), "[hit]": tC("[hit]"), "[miss]": tw("[miss]"), "[json]": tC("[json]"), "[data]": tC("[data]") };
|
|
2870
|
+
function debug(e10, ...t3) {
|
|
2871
|
+
if (!e10.opts.debug) return;
|
|
2872
|
+
let i2 = process.cwd();
|
|
2873
|
+
console.log(tR(["[jiti]", ...t3.map((e11) => e11 in tP ? tP[e11] : "string" != typeof e11 ? JSON.stringify(e11) : e11.replace(i2, "."))].join(" ")));
|
|
2874
|
+
}
|
|
2875
|
+
__name(debug, "debug");
|
|
2876
|
+
function jitiInteropDefault(e10, t3) {
|
|
2877
|
+
return e10.opts.interopDefault ? utils_interopDefault(t3) : t3;
|
|
2878
|
+
}
|
|
2879
|
+
__name(jitiInteropDefault, "jitiInteropDefault");
|
|
2880
|
+
function utils_interopDefault(e10) {
|
|
2881
|
+
let t3 = typeof e10;
|
|
2882
|
+
if (null === e10 || "object" !== t3 && "function" !== t3) return e10;
|
|
2883
|
+
let i2 = e10.default, s2 = typeof i2, r2 = null == i2, n2 = "object" === s2 || "function" === s2;
|
|
2884
|
+
return r2 && e10 instanceof Promise ? e10 : new Proxy(e10, { get(t4, s3, a2) {
|
|
2885
|
+
if ("__esModule" === s3) return true;
|
|
2886
|
+
if ("default" === s3) return r2 ? e10 : "function" == typeof i2?.default && e10.__esModule ? i2.default : i2;
|
|
2887
|
+
if (Reflect.has(t4, s3)) return Reflect.get(t4, s3, a2);
|
|
2888
|
+
if (n2) {
|
|
2889
|
+
let e11 = Reflect.get(i2, s3, a2);
|
|
2890
|
+
return "function" == typeof e11 && (e11 = e11.bind(i2)), e11;
|
|
2891
|
+
}
|
|
2892
|
+
}, apply: /* @__PURE__ */ __name((e11, t4, r3) => "function" == typeof e11 ? Reflect.apply(e11, t4, r3) : "function" === s2 ? Reflect.apply(i2, t4, r3) : void 0, "apply") });
|
|
2893
|
+
}
|
|
2894
|
+
__name(utils_interopDefault, "utils_interopDefault");
|
|
2895
|
+
function normalizeWindowsImportId(e10) {
|
|
2896
|
+
return tu && isAbsolute(e10) ? pathToFileURL(e10) : e10;
|
|
2897
|
+
}
|
|
2898
|
+
__name(normalizeWindowsImportId, "normalizeWindowsImportId");
|
|
2899
|
+
function isFipsMode() {
|
|
2900
|
+
if (void 0 !== t2) return t2;
|
|
2901
|
+
try {
|
|
2902
|
+
return t2 = !!tr().getFips?.();
|
|
2903
|
+
} catch {
|
|
2904
|
+
return t2 = false;
|
|
2905
|
+
}
|
|
2906
|
+
}
|
|
2907
|
+
__name(isFipsMode, "isFipsMode");
|
|
2908
|
+
function resolveJitiOptions(e10) {
|
|
2909
|
+
let t3 = { fsCache: _booleanEnv("JITI_FS_CACHE", _booleanEnv("JITI_CACHE", true)), rebuildFsCache: _booleanEnv("JITI_REBUILD_FS_CACHE", false), moduleCache: _booleanEnv("JITI_MODULE_CACHE", _booleanEnv("JITI_REQUIRE_CACHE", true)), debug: _booleanEnv("JITI_DEBUG", false), sourceMaps: _booleanEnv("JITI_SOURCE_MAPS", false), interopDefault: _booleanEnv("JITI_INTEROP_DEFAULT", true), extensions: _jsonEnv("JITI_EXTENSIONS", [".js", ".mjs", ".cjs", ".ts", ".tsx", ".mts", ".cts", ".mtsx", ".ctsx"]), alias: _jsonEnv("JITI_ALIAS", {}), nativeModules: _jsonEnv("JITI_NATIVE_MODULES", []), transformModules: _jsonEnv("JITI_TRANSFORM_MODULES", []), tryNative: _jsonEnv("JITI_TRY_NATIVE", "Bun" in globalThis), jsx: _booleanEnv("JITI_JSX", false) };
|
|
2910
|
+
t3.jsx && t3.extensions.push(".jsx", ".tsx");
|
|
2911
|
+
let i2 = {};
|
|
2912
|
+
return void 0 !== e10.cache && (i2.fsCache = e10.cache), void 0 !== e10.requireCache && (i2.moduleCache = e10.requireCache), { ...t3, ...i2, ...e10 };
|
|
2913
|
+
}
|
|
2914
|
+
__name(resolveJitiOptions, "resolveJitiOptions");
|
|
2915
|
+
function _booleanEnv(e10, t3) {
|
|
2916
|
+
return !!_jsonEnv(e10, t3);
|
|
2917
|
+
}
|
|
2918
|
+
__name(_booleanEnv, "_booleanEnv");
|
|
2919
|
+
function _jsonEnv(e10, t3) {
|
|
2920
|
+
let i2 = process.env[e10];
|
|
2921
|
+
if (!(e10 in process.env)) return t3;
|
|
2922
|
+
try {
|
|
2923
|
+
return JSON.parse(i2);
|
|
2924
|
+
} catch {
|
|
2925
|
+
return t3;
|
|
2926
|
+
}
|
|
2927
|
+
}
|
|
2928
|
+
__name(_jsonEnv, "_jsonEnv");
|
|
2929
|
+
let tA = /\.(c|m)?j(sx?)$/, tN = /\.(c|m)?t(sx?)$/;
|
|
2930
|
+
function jitiResolve(e10, t3, i2) {
|
|
2931
|
+
let s2, r2;
|
|
2932
|
+
if (e10.isNativeRe.test(t3)) return t3;
|
|
2933
|
+
e10.alias && (t3 = resolveAlias(t3, e10.alias));
|
|
2934
|
+
let n2 = i2?.parentURL || e10.url;
|
|
2935
|
+
for (let a2 of (isDir(n2) && (n2 = pathe_M_eThtNZ_join(n2, "_index.js")), (i2?.async ? [i2?.conditions, ["node", "import"], ["node", "require"]] : [i2?.conditions, ["node", "require"], ["node", "import"]]).filter(Boolean))) {
|
|
2936
|
+
try {
|
|
2937
|
+
s2 = resolvePathSync(t3, { url: n2, conditions: a2, extensions: e10.opts.extensions });
|
|
2938
|
+
} catch (e11) {
|
|
2939
|
+
r2 = e11;
|
|
2940
|
+
}
|
|
2941
|
+
if (s2) return s2;
|
|
2942
|
+
}
|
|
2943
|
+
try {
|
|
2944
|
+
return e10.nativeRequire.resolve(t3, { paths: i2.paths });
|
|
2945
|
+
} catch (e11) {
|
|
2946
|
+
r2 = e11;
|
|
2947
|
+
}
|
|
2948
|
+
for (let r3 of e10.additionalExts) if ((s2 = tryNativeRequireResolve(e10, t3 + r3, n2, i2) || tryNativeRequireResolve(e10, t3 + "/index" + r3, n2, i2)) || (tN.test(e10.filename) || tN.test(e10.parentModule?.filename || "") || tA.test(t3)) && (s2 = tryNativeRequireResolve(e10, t3.replace(tA, ".$1t$2"), n2, i2))) return s2;
|
|
2949
|
+
if (!i2?.try) throw r2;
|
|
2950
|
+
}
|
|
2951
|
+
__name(jitiResolve, "jitiResolve");
|
|
2952
|
+
function tryNativeRequireResolve(e10, t3, i2, s2) {
|
|
2953
|
+
try {
|
|
2954
|
+
return e10.nativeRequire.resolve(t3, { ...s2, paths: [pathe_M_eThtNZ_dirname(fileURLToPath(i2)), ...s2?.paths || []] });
|
|
2955
|
+
} catch {
|
|
2956
|
+
}
|
|
2957
|
+
}
|
|
2958
|
+
__name(tryNativeRequireResolve, "tryNativeRequireResolve");
|
|
2959
|
+
let tL = __require("node:perf_hooks"), tD = __require("node:vm");
|
|
2960
|
+
var tO = __webpack_require__.n(tD);
|
|
2961
|
+
function jitiRequire(e10, t3, i2) {
|
|
2962
|
+
let s2 = e10.parentCache || {};
|
|
2963
|
+
if (t3.startsWith("node:")) return nativeImportOrRequire(e10, t3, i2.async);
|
|
2964
|
+
if (t3.startsWith("file:")) t3 = (0, eE.fileURLToPath)(t3);
|
|
2965
|
+
else if (t3.startsWith("data:")) {
|
|
2966
|
+
if (!i2.async) throw Error("`data:` URLs are only supported in ESM context. Use `import` or `jiti.import` instead.");
|
|
2967
|
+
return debug(e10, "[native]", "[data]", "[import]", t3), nativeImportOrRequire(e10, t3, true);
|
|
2968
|
+
}
|
|
2969
|
+
if (ed.builtinModules.includes(t3) || ".pnp.js" === t3) return nativeImportOrRequire(e10, t3, i2.async);
|
|
2970
|
+
if (e10.opts.tryNative && !e10.opts.transformOptions) try {
|
|
2971
|
+
if (!(t3 = jitiResolve(e10, t3, i2)) && i2.try) return;
|
|
2972
|
+
if (debug(e10, "[try-native]", i2.async && e10.nativeImport ? "[import]" : "[require]", t3), i2.async && e10.nativeImport) return e10.nativeImport(t3).then((i3) => (false === e10.opts.moduleCache && delete e10.nativeRequire.cache[t3], jitiInteropDefault(e10, i3)));
|
|
2973
|
+
{
|
|
2974
|
+
let i3 = e10.nativeRequire(t3);
|
|
2975
|
+
return false === e10.opts.moduleCache && delete e10.nativeRequire.cache[t3], jitiInteropDefault(e10, i3);
|
|
2976
|
+
}
|
|
2977
|
+
} catch (i3) {
|
|
2978
|
+
debug(e10, `[try-native] Using fallback for ${t3} because of an error:`, i3);
|
|
2979
|
+
}
|
|
2980
|
+
let r2 = jitiResolve(e10, t3, i2);
|
|
2981
|
+
if (!r2 && i2.try) return;
|
|
2982
|
+
let n2 = extname(r2);
|
|
2983
|
+
if (".json" === n2) {
|
|
2984
|
+
debug(e10, "[json]", r2);
|
|
2985
|
+
let t4 = e10.nativeRequire(r2);
|
|
2986
|
+
return !t4 || "default" in t4 || Object.defineProperty(t4, "default", { value: t4, enumerable: false }), t4;
|
|
2987
|
+
}
|
|
2988
|
+
if (n2 && !e10.opts.extensions.includes(n2)) return debug(e10, "[native]", "[unknown]", i2.async ? "[import]" : "[require]", r2), nativeImportOrRequire(e10, r2, i2.async);
|
|
2989
|
+
if (e10.isNativeRe.test(r2)) return debug(e10, "[native]", i2.async ? "[import]" : "[require]", r2), nativeImportOrRequire(e10, r2, i2.async);
|
|
2990
|
+
if (s2[r2]) return jitiInteropDefault(e10, s2[r2]?.exports);
|
|
2991
|
+
if (e10.opts.moduleCache) {
|
|
2992
|
+
let t4 = e10.nativeRequire.cache[r2];
|
|
2993
|
+
if (t4?.loaded) return jitiInteropDefault(e10, t4.exports);
|
|
2994
|
+
}
|
|
2995
|
+
return eval_evalModule(e10, (0, ef.readFileSync)(r2, "utf8"), { id: t3, filename: r2, ext: n2, cache: s2, async: i2.async });
|
|
2996
|
+
}
|
|
2997
|
+
__name(jitiRequire, "jitiRequire");
|
|
2998
|
+
function nativeImportOrRequire(e10, t3, i2) {
|
|
2999
|
+
return i2 && e10.nativeImport ? e10.nativeImport(normalizeWindowsImportId(t3)).then((t4) => jitiInteropDefault(e10, t4)) : jitiInteropDefault(e10, e10.nativeRequire(t3));
|
|
3000
|
+
}
|
|
3001
|
+
__name(nativeImportOrRequire, "nativeImportOrRequire");
|
|
3002
|
+
function getCache(e10, t3, i2) {
|
|
3003
|
+
if (!e10.opts.fsCache || !t3.filename) return i2();
|
|
3004
|
+
let s2 = ` /* v9-${utils_hash(t3.source, 16)} */
|
|
3005
|
+
`, r2 = `${basename(pathe_M_eThtNZ_dirname(t3.filename))}-${utils_filename(t3.filename)}` + (e10.opts.sourceMaps ? "+map" : "") + (t3.interopDefault ? ".i" : "") + `.${utils_hash(t3.filename)}` + (t3.async ? ".mjs" : ".cjs");
|
|
3006
|
+
t3.jsx && t3.filename.endsWith("x") && (r2 += "x");
|
|
3007
|
+
let n2 = pathe_M_eThtNZ_join(e10.opts.fsCache, r2);
|
|
3008
|
+
if (!e10.opts.rebuildFsCache && (0, ef.existsSync)(n2)) {
|
|
3009
|
+
let i3 = (0, ef.readFileSync)(n2, "utf8");
|
|
3010
|
+
if (i3.endsWith(s2)) return debug(e10, "[cache]", "[hit]", t3.filename, "~>", n2), i3;
|
|
3011
|
+
}
|
|
3012
|
+
debug(e10, "[cache]", "[miss]", t3.filename);
|
|
3013
|
+
let a2 = i2();
|
|
3014
|
+
return a2.includes("__JITI_ERROR__") || ((0, ef.writeFileSync)(n2, a2 + s2, "utf8"), debug(e10, "[cache]", "[store]", t3.filename, "~>", n2)), a2;
|
|
3015
|
+
}
|
|
3016
|
+
__name(getCache, "getCache");
|
|
3017
|
+
function prepareCacheDir(e10) {
|
|
3018
|
+
if (true === e10.opts.fsCache && (e10.opts.fsCache = getCacheDir(e10)), e10.opts.fsCache) try {
|
|
3019
|
+
if ((0, ef.mkdirSync)(e10.opts.fsCache, { recursive: true }), !isWritable(e10.opts.fsCache)) throw Error("directory is not writable!");
|
|
3020
|
+
} catch (t3) {
|
|
3021
|
+
debug(e10, "Error creating cache directory at ", e10.opts.fsCache, t3), e10.opts.fsCache = false;
|
|
3022
|
+
}
|
|
3023
|
+
}
|
|
3024
|
+
__name(prepareCacheDir, "prepareCacheDir");
|
|
3025
|
+
function getCacheDir(e10) {
|
|
3026
|
+
let t3 = e10.filename && pathe_M_eThtNZ_resolve(e10.filename, "../node_modules");
|
|
3027
|
+
if (t3 && (0, ef.existsSync)(t3)) return pathe_M_eThtNZ_join(t3, ".cache/jiti");
|
|
3028
|
+
let i2 = (0, r.tmpdir)();
|
|
3029
|
+
if (process.env.TMPDIR && i2 === process.cwd() && !process.env.JITI_RESPECT_TMPDIR_ENV) {
|
|
3030
|
+
let e11 = process.env.TMPDIR;
|
|
3031
|
+
delete process.env.TMPDIR, i2 = (0, r.tmpdir)(), process.env.TMPDIR = e11;
|
|
3032
|
+
}
|
|
3033
|
+
return pathe_M_eThtNZ_join(i2, "jiti");
|
|
3034
|
+
}
|
|
3035
|
+
__name(getCacheDir, "getCacheDir");
|
|
3036
|
+
function transform(e10, t3) {
|
|
3037
|
+
let i2 = getCache(e10, t3, () => {
|
|
3038
|
+
let i3 = e10.opts.transform({ ...e10.opts.transformOptions, babel: { ...e10.opts.sourceMaps ? { sourceFileName: t3.filename, sourceMaps: "inline" } : {}, ...e10.opts.transformOptions?.babel }, interopDefault: e10.opts.interopDefault, ...t3 });
|
|
3039
|
+
return i3.error && e10.opts.debug && debug(e10, i3.error), i3.code;
|
|
3040
|
+
});
|
|
3041
|
+
return i2.startsWith("#!") && (i2 = "// " + i2), i2;
|
|
3042
|
+
}
|
|
3043
|
+
__name(transform, "transform");
|
|
3044
|
+
function eval_evalModule(e10, t3, i2 = {}) {
|
|
3045
|
+
let s2, r2, n2 = i2.id || (i2.filename ? basename(i2.filename) : `_jitiEval.${i2.ext || (i2.async ? "mjs" : "js")}`), a2 = i2.filename || jitiResolve(e10, n2, { async: i2.async }), o2 = i2.ext || extname(a2), h2 = i2.cache || e10.parentCache || {}, c2 = /\.[cm]?tsx?$/.test(o2), p2 = ".mjs" === o2 || ".js" === o2 && readNearestPackageJSON(a2)?.type === "module", l2 = ".cjs" === o2, u2 = i2.forceTranspile ?? (!l2 && !(p2 && i2.async) && (c2 || p2 || e10.isTransformRe.test(a2) || hasESMSyntax(t3))), d2 = tL.performance.now();
|
|
3046
|
+
if (u2) {
|
|
3047
|
+
t3 = transform(e10, { filename: a2, source: t3, ts: c2, async: i2.async ?? false, jsx: e10.opts.jsx });
|
|
3048
|
+
let s3 = Math.round((tL.performance.now() - d2) * 1e3) / 1e3;
|
|
3049
|
+
debug(e10, "[transpile]", i2.async ? "[esm]" : "[cjs]", a2, `(${s3}ms)`);
|
|
3050
|
+
} else {
|
|
3051
|
+
if (debug(e10, "[native]", i2.async ? "[import]" : "[require]", a2), i2.async) return Promise.resolve(nativeImportOrRequire(e10, a2, i2.async)).catch((s3) => (debug(e10, "Native import error:", s3), debug(e10, "[fallback]", a2), eval_evalModule(e10, t3, { ...i2, forceTranspile: true })));
|
|
3052
|
+
try {
|
|
3053
|
+
return nativeImportOrRequire(e10, a2, i2.async);
|
|
3054
|
+
} catch (s3) {
|
|
3055
|
+
debug(e10, "Native require error:", s3), debug(e10, "[fallback]", a2), t3 = transform(e10, { filename: a2, source: t3, ts: c2, async: i2.async ?? false, jsx: e10.opts.jsx });
|
|
3056
|
+
}
|
|
3057
|
+
}
|
|
3058
|
+
let f2 = new ed.Module(a2);
|
|
3059
|
+
f2.filename = a2, e10.parentModule && (f2.parent = e10.parentModule, Array.isArray(e10.parentModule.children) && !e10.parentModule.children.includes(f2) && e10.parentModule.children.push(f2));
|
|
3060
|
+
let m2 = createJiti2(a2, e10.opts, { parentModule: f2, parentCache: h2, nativeImport: e10.nativeImport, onError: e10.onError, createRequire: e10.createRequire }, true);
|
|
3061
|
+
f2.require = m2, f2.path = pathe_M_eThtNZ_dirname(a2), f2.paths = ed.Module._nodeModulePaths(f2.path), h2[a2] = f2, e10.opts.moduleCache && (e10.nativeRequire.cache[a2] = f2);
|
|
3062
|
+
let g2 = wrapModule(t3, { async: i2.async });
|
|
3063
|
+
try {
|
|
3064
|
+
s2 = tO().runInThisContext(g2, { filename: a2, lineOffset: 0, displayErrors: false });
|
|
3065
|
+
} catch (t4) {
|
|
3066
|
+
"SyntaxError" === t4.name && i2.async && e10.nativeImport ? (debug(e10, "[esm]", "[import]", "[fallback]", a2), s2 = esmEval(g2, e10.nativeImport)) : (e10.opts.moduleCache && delete e10.nativeRequire.cache[a2], e10.onError(t4));
|
|
3067
|
+
}
|
|
3068
|
+
try {
|
|
3069
|
+
r2 = s2(f2.exports, f2.require, f2, f2.filename, pathe_M_eThtNZ_dirname(f2.filename), m2.import, m2.esmResolve);
|
|
3070
|
+
} catch (t4) {
|
|
3071
|
+
e10.opts.moduleCache && delete e10.nativeRequire.cache[a2], e10.onError(t4);
|
|
3072
|
+
}
|
|
3073
|
+
function next() {
|
|
3074
|
+
if (f2.exports && f2.exports.__JITI_ERROR__) {
|
|
3075
|
+
let { filename: t4, line: i3, column: s3, code: r3, message: n3 } = f2.exports.__JITI_ERROR__, a3 = `${t4}:${i3}:${s3}`, o3 = Error(`${r3}: ${n3}
|
|
3076
|
+
${a3}`);
|
|
3077
|
+
Error.captureStackTrace(o3, jitiRequire), e10.onError(o3);
|
|
3078
|
+
}
|
|
3079
|
+
return f2.loaded = true, jitiInteropDefault(e10, f2.exports);
|
|
3080
|
+
}
|
|
3081
|
+
__name(next, "next");
|
|
3082
|
+
return i2.async ? Promise.resolve(r2).then(next) : next();
|
|
3083
|
+
}
|
|
3084
|
+
__name(eval_evalModule, "eval_evalModule");
|
|
3085
|
+
function esmEval(e10, t3) {
|
|
3086
|
+
let i2 = `data:text/javascript;base64,${Buffer.from(`export default ${e10}`).toString("base64")}`;
|
|
3087
|
+
return (...e11) => t3(i2).then((t4) => t4.default(...e11));
|
|
3088
|
+
}
|
|
3089
|
+
__name(esmEval, "esmEval");
|
|
3090
|
+
let tV = "win32" === (0, r.platform)();
|
|
3091
|
+
function createJiti2(e10, t3 = {}, i2, s2 = false) {
|
|
3092
|
+
let r2 = s2 ? t3 : resolveJitiOptions(t3), n2 = r2.alias && Object.keys(r2.alias).length > 0 ? normalizeAliases(r2.alias || {}) : void 0, a2 = ["typescript", "jiti", ...r2.nativeModules || []], o2 = RegExp(`node_modules/(${a2.map((e11) => escapeStringRegexp(e11)).join("|")})/`), h2 = [...r2.transformModules || []], c2 = RegExp(`node_modules/(${h2.map((e11) => escapeStringRegexp(e11)).join("|")})/`);
|
|
3093
|
+
e10 || (e10 = process.cwd()), !s2 && isDir(e10) && (e10 = pathe_M_eThtNZ_join(e10, "_index.js"));
|
|
3094
|
+
let p2 = pathToFileURL(e10), l2 = [...r2.extensions].filter((e11) => ".js" !== e11), u2 = i2.createRequire(tV ? e10.replace(/\//g, "\\") : e10), d2 = { filename: e10, url: p2, opts: r2, alias: n2, nativeModules: a2, transformModules: h2, isNativeRe: o2, isTransformRe: c2, additionalExts: l2, nativeRequire: u2, onError: i2.onError, parentModule: i2.parentModule, parentCache: i2.parentCache, nativeImport: i2.nativeImport, createRequire: i2.createRequire };
|
|
3095
|
+
return s2 || debug(d2, "[init]", ...[["version:", "2.6.0"], ["module-cache:", r2.moduleCache], ["fs-cache:", r2.fsCache], ["rebuild-fs-cache:", r2.rebuildFsCache], ["interop-defaults:", r2.interopDefault]].flat()), s2 || prepareCacheDir(d2), Object.assign(function(e11) {
|
|
3096
|
+
return jitiRequire(d2, e11, { async: false });
|
|
3097
|
+
}, { cache: r2.moduleCache ? u2.cache : /* @__PURE__ */ Object.create(null), extensions: u2.extensions, main: u2.main, options: r2, resolve: Object.assign(function(e11) {
|
|
3098
|
+
return jitiResolve(d2, e11, { async: false });
|
|
3099
|
+
}, { paths: u2.resolve.paths }), transform: /* @__PURE__ */ __name((e11) => transform(d2, e11), "transform"), evalModule: /* @__PURE__ */ __name((e11, t4) => eval_evalModule(d2, e11, t4), "evalModule"), async import(e11, t4) {
|
|
3100
|
+
let i3 = await jitiRequire(d2, e11, { ...t4, async: true });
|
|
3101
|
+
return t4?.default ? i3?.default ?? i3 : i3;
|
|
3102
|
+
}, esmResolve(e11, t4) {
|
|
3103
|
+
"string" == typeof t4 && (t4 = { parentURL: t4 });
|
|
3104
|
+
let i3 = jitiResolve(d2, e11, { parentURL: p2, ...t4, async: true });
|
|
3105
|
+
return !i3 || "string" != typeof i3 || i3.startsWith("file://") ? i3 : pathToFileURL(i3);
|
|
3106
|
+
} });
|
|
3107
|
+
}
|
|
3108
|
+
__name(createJiti2, "createJiti");
|
|
3109
|
+
})(), module.exports = i.default;
|
|
3110
|
+
})();
|
|
3111
|
+
}
|
|
3112
|
+
});
|
|
3113
|
+
|
|
3114
|
+
// ../../node_modules/jiti/lib/jiti.mjs
|
|
3115
|
+
import { createRequire } from "node:module";
|
|
3116
|
+
function onError(err) {
|
|
3117
|
+
throw err;
|
|
3118
|
+
}
|
|
3119
|
+
function lazyTransform(...args) {
|
|
3120
|
+
if (!_transform) {
|
|
3121
|
+
_transform = createRequire(import.meta.url)("../dist/babel.cjs");
|
|
3122
|
+
}
|
|
3123
|
+
return _transform(...args);
|
|
3124
|
+
}
|
|
3125
|
+
function createJiti(id, opts = {}) {
|
|
3126
|
+
if (!opts.transform) {
|
|
3127
|
+
opts = { ...opts, transform: lazyTransform };
|
|
3128
|
+
}
|
|
3129
|
+
return (0, import_jiti.default)(id, opts, {
|
|
3130
|
+
onError,
|
|
3131
|
+
nativeImport,
|
|
3132
|
+
createRequire
|
|
3133
|
+
});
|
|
3134
|
+
}
|
|
3135
|
+
var import_jiti, nativeImport, _transform, jiti_default;
|
|
3136
|
+
var init_jiti = __esm({
|
|
3137
|
+
"../../node_modules/jiti/lib/jiti.mjs"() {
|
|
3138
|
+
import_jiti = __toESM(require_jiti(), 1);
|
|
3139
|
+
__name(onError, "onError");
|
|
3140
|
+
nativeImport = /* @__PURE__ */ __name((id) => import(id), "nativeImport");
|
|
3141
|
+
__name(lazyTransform, "lazyTransform");
|
|
3142
|
+
__name(createJiti, "createJiti");
|
|
3143
|
+
jiti_default = createJiti;
|
|
3144
|
+
}
|
|
3145
|
+
});
|
|
3146
|
+
init_jiti();
|
|
3147
|
+
export {
|
|
3148
|
+
createJiti,
|
|
3149
|
+
jiti_default as default
|
|
3150
|
+
};
|