@storybook/preset-react-webpack 11.0.0-alpha.9 → 11.0.0-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/_node-chunks/chunk-4C4IXZWB.js +49 -0
- package/dist/framework-preset-react-docs.js +34 -33
- package/dist/index.d.ts +13 -3
- package/dist/index.js +7 -6
- package/dist/loaders/react-docgen-loader.js +3694 -13
- package/package.json +23 -8
|
@@ -1,20 +1,3702 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import CJS_COMPAT_NODE_URL_0z44iuso0ohl from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_0z44iuso0ohl from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_0z44iuso0ohl from "node:module";
|
|
4
4
|
|
|
5
|
-
var __filename =
|
|
6
|
-
var __dirname =
|
|
7
|
-
var require =
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_0z44iuso0ohl.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_0z44iuso0ohl.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_0z44iuso0ohl.createRequire(import.meta.url);
|
|
8
8
|
|
|
9
9
|
// ------------------------------------------------------------
|
|
10
10
|
// end of CJS compatibility banner, injected by Storybook's esbuild configuration
|
|
11
11
|
// ------------------------------------------------------------
|
|
12
|
+
import {
|
|
13
|
+
__commonJS,
|
|
14
|
+
__require,
|
|
15
|
+
__toESM
|
|
16
|
+
} from "../_node-chunks/chunk-4C4IXZWB.js";
|
|
17
|
+
|
|
18
|
+
// ../../../node_modules/tsconfig-paths/lib/filesystem.js
|
|
19
|
+
var require_filesystem = __commonJS({
|
|
20
|
+
"../../../node_modules/tsconfig-paths/lib/filesystem.js"(exports) {
|
|
21
|
+
"use strict";
|
|
22
|
+
Object.defineProperty(exports, "__esModule", { value: !0 });
|
|
23
|
+
exports.removeExtension = exports.fileExistsAsync = exports.readJsonFromDiskAsync = exports.readJsonFromDiskSync = exports.fileExistsSync = void 0;
|
|
24
|
+
var fs = __require("fs");
|
|
25
|
+
function fileExistsSync(path) {
|
|
26
|
+
if (!fs.existsSync(path))
|
|
27
|
+
return !1;
|
|
28
|
+
try {
|
|
29
|
+
var stats = fs.statSync(path);
|
|
30
|
+
return stats.isFile();
|
|
31
|
+
} catch {
|
|
32
|
+
return !1;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
exports.fileExistsSync = fileExistsSync;
|
|
36
|
+
function readJsonFromDiskSync(packageJsonPath) {
|
|
37
|
+
if (fs.existsSync(packageJsonPath))
|
|
38
|
+
return __require(packageJsonPath);
|
|
39
|
+
}
|
|
40
|
+
exports.readJsonFromDiskSync = readJsonFromDiskSync;
|
|
41
|
+
function readJsonFromDiskAsync(path, callback) {
|
|
42
|
+
fs.readFile(path, "utf8", function(err, result) {
|
|
43
|
+
if (err || !result)
|
|
44
|
+
return callback();
|
|
45
|
+
var json = JSON.parse(result);
|
|
46
|
+
return callback(void 0, json);
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
exports.readJsonFromDiskAsync = readJsonFromDiskAsync;
|
|
50
|
+
function fileExistsAsync(path2, callback2) {
|
|
51
|
+
fs.stat(path2, function(err, stats) {
|
|
52
|
+
if (err)
|
|
53
|
+
return callback2(void 0, !1);
|
|
54
|
+
callback2(void 0, stats ? stats.isFile() : !1);
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
exports.fileExistsAsync = fileExistsAsync;
|
|
58
|
+
function removeExtension(path) {
|
|
59
|
+
return path.substring(0, path.lastIndexOf(".")) || path;
|
|
60
|
+
}
|
|
61
|
+
exports.removeExtension = removeExtension;
|
|
62
|
+
}
|
|
63
|
+
});
|
|
64
|
+
|
|
65
|
+
// ../../../node_modules/tsconfig-paths/lib/mapping-entry.js
|
|
66
|
+
var require_mapping_entry = __commonJS({
|
|
67
|
+
"../../../node_modules/tsconfig-paths/lib/mapping-entry.js"(exports) {
|
|
68
|
+
"use strict";
|
|
69
|
+
Object.defineProperty(exports, "__esModule", { value: !0 });
|
|
70
|
+
exports.getAbsoluteMappingEntries = void 0;
|
|
71
|
+
var path = __require("path");
|
|
72
|
+
function getAbsoluteMappingEntries(absoluteBaseUrl, paths, addMatchAll) {
|
|
73
|
+
for (var sortedKeys = sortByLongestPrefix(Object.keys(paths)), absolutePaths = [], _i = 0, sortedKeys_1 = sortedKeys; _i < sortedKeys_1.length; _i++) {
|
|
74
|
+
var key = sortedKeys_1[_i];
|
|
75
|
+
absolutePaths.push({
|
|
76
|
+
pattern: key,
|
|
77
|
+
paths: paths[key].map(function(pathToResolve) {
|
|
78
|
+
return path.resolve(absoluteBaseUrl, pathToResolve);
|
|
79
|
+
})
|
|
80
|
+
});
|
|
81
|
+
}
|
|
82
|
+
return !paths["*"] && addMatchAll && absolutePaths.push({
|
|
83
|
+
pattern: "*",
|
|
84
|
+
paths: ["".concat(absoluteBaseUrl.replace(/\/$/, ""), "/*")]
|
|
85
|
+
}), absolutePaths;
|
|
86
|
+
}
|
|
87
|
+
exports.getAbsoluteMappingEntries = getAbsoluteMappingEntries;
|
|
88
|
+
function sortByLongestPrefix(arr) {
|
|
89
|
+
return arr.concat().sort(function(a, b) {
|
|
90
|
+
return getPrefixLength(b) - getPrefixLength(a);
|
|
91
|
+
});
|
|
92
|
+
}
|
|
93
|
+
function getPrefixLength(pattern) {
|
|
94
|
+
var prefixLength = pattern.indexOf("*");
|
|
95
|
+
return pattern.substr(0, prefixLength).length;
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
});
|
|
99
|
+
|
|
100
|
+
// ../../../node_modules/tsconfig-paths/lib/try-path.js
|
|
101
|
+
var require_try_path = __commonJS({
|
|
102
|
+
"../../../node_modules/tsconfig-paths/lib/try-path.js"(exports) {
|
|
103
|
+
"use strict";
|
|
104
|
+
Object.defineProperty(exports, "__esModule", { value: !0 });
|
|
105
|
+
exports.exhaustiveTypeException = exports.getStrippedPath = exports.getPathsToTry = void 0;
|
|
106
|
+
var path = __require("path"), path_1 = __require("path"), filesystem_1 = require_filesystem();
|
|
107
|
+
function getPathsToTry(extensions, absolutePathMappings, requestedModule) {
|
|
108
|
+
if (!(!absolutePathMappings || !requestedModule || requestedModule[0] === ".")) {
|
|
109
|
+
for (var pathsToTry = [], _i = 0, absolutePathMappings_1 = absolutePathMappings; _i < absolutePathMappings_1.length; _i++) {
|
|
110
|
+
var entry = absolutePathMappings_1[_i], starMatch = entry.pattern === requestedModule ? "" : matchStar(entry.pattern, requestedModule);
|
|
111
|
+
if (starMatch !== void 0)
|
|
112
|
+
for (var _loop_1 = function(physicalPathPattern2) {
|
|
113
|
+
var physicalPath = physicalPathPattern2.replace("*", starMatch);
|
|
114
|
+
pathsToTry.push({ type: "file", path: physicalPath }), pathsToTry.push.apply(pathsToTry, extensions.map(function(e) {
|
|
115
|
+
return { type: "extension", path: physicalPath + e };
|
|
116
|
+
})), pathsToTry.push({
|
|
117
|
+
type: "package",
|
|
118
|
+
path: path.join(physicalPath, "/package.json")
|
|
119
|
+
});
|
|
120
|
+
var indexPath = path.join(physicalPath, "/index");
|
|
121
|
+
pathsToTry.push.apply(pathsToTry, extensions.map(function(e) {
|
|
122
|
+
return { type: "index", path: indexPath + e };
|
|
123
|
+
}));
|
|
124
|
+
}, _a = 0, _b = entry.paths; _a < _b.length; _a++) {
|
|
125
|
+
var physicalPathPattern = _b[_a];
|
|
126
|
+
_loop_1(physicalPathPattern);
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
return pathsToTry.length === 0 ? void 0 : pathsToTry;
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
exports.getPathsToTry = getPathsToTry;
|
|
133
|
+
function getStrippedPath(tryPath) {
|
|
134
|
+
return tryPath.type === "index" ? (0, path_1.dirname)(tryPath.path) : tryPath.type === "file" ? tryPath.path : tryPath.type === "extension" ? (0, filesystem_1.removeExtension)(tryPath.path) : tryPath.type === "package" ? tryPath.path : exhaustiveTypeException(tryPath.type);
|
|
135
|
+
}
|
|
136
|
+
exports.getStrippedPath = getStrippedPath;
|
|
137
|
+
function exhaustiveTypeException(check) {
|
|
138
|
+
throw new Error("Unknown type ".concat(check));
|
|
139
|
+
}
|
|
140
|
+
exports.exhaustiveTypeException = exhaustiveTypeException;
|
|
141
|
+
function matchStar(pattern, search) {
|
|
142
|
+
if (!(search.length < pattern.length)) {
|
|
143
|
+
if (pattern === "*")
|
|
144
|
+
return search;
|
|
145
|
+
var star = pattern.indexOf("*");
|
|
146
|
+
if (star !== -1) {
|
|
147
|
+
var part1 = pattern.substring(0, star), part2 = pattern.substring(star + 1);
|
|
148
|
+
if (search.substr(0, star) === part1 && search.substr(search.length - part2.length) === part2)
|
|
149
|
+
return search.substr(star, search.length - part2.length);
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
});
|
|
155
|
+
|
|
156
|
+
// ../../../node_modules/tsconfig-paths/lib/match-path-sync.js
|
|
157
|
+
var require_match_path_sync = __commonJS({
|
|
158
|
+
"../../../node_modules/tsconfig-paths/lib/match-path-sync.js"(exports) {
|
|
159
|
+
"use strict";
|
|
160
|
+
Object.defineProperty(exports, "__esModule", { value: !0 });
|
|
161
|
+
exports.matchFromAbsolutePaths = exports.createMatchPath = void 0;
|
|
162
|
+
var path = __require("path"), Filesystem = require_filesystem(), MappingEntry = require_mapping_entry(), TryPath = require_try_path();
|
|
163
|
+
function createMatchPath2(absoluteBaseUrl, paths, mainFields, addMatchAll) {
|
|
164
|
+
mainFields === void 0 && (mainFields = ["main"]), addMatchAll === void 0 && (addMatchAll = !0);
|
|
165
|
+
var absolutePaths = MappingEntry.getAbsoluteMappingEntries(absoluteBaseUrl, paths, addMatchAll);
|
|
166
|
+
return function(requestedModule, readJson, fileExists, extensions) {
|
|
167
|
+
return matchFromAbsolutePaths(absolutePaths, requestedModule, readJson, fileExists, extensions, mainFields);
|
|
168
|
+
};
|
|
169
|
+
}
|
|
170
|
+
exports.createMatchPath = createMatchPath2;
|
|
171
|
+
function matchFromAbsolutePaths(absolutePathMappings, requestedModule, readJson, fileExists, extensions, mainFields) {
|
|
172
|
+
readJson === void 0 && (readJson = Filesystem.readJsonFromDiskSync), fileExists === void 0 && (fileExists = Filesystem.fileExistsSync), extensions === void 0 && (extensions = Object.keys(__require.extensions)), mainFields === void 0 && (mainFields = ["main"]);
|
|
173
|
+
var tryPaths = TryPath.getPathsToTry(extensions, absolutePathMappings, requestedModule);
|
|
174
|
+
if (tryPaths)
|
|
175
|
+
return findFirstExistingPath(tryPaths, readJson, fileExists, mainFields);
|
|
176
|
+
}
|
|
177
|
+
exports.matchFromAbsolutePaths = matchFromAbsolutePaths;
|
|
178
|
+
function findFirstExistingMainFieldMappedFile(packageJson, mainFields, packageJsonPath, fileExists) {
|
|
179
|
+
for (var index = 0; index < mainFields.length; index++) {
|
|
180
|
+
var mainFieldSelector = mainFields[index], candidateMapping = typeof mainFieldSelector == "string" ? packageJson[mainFieldSelector] : mainFieldSelector.reduce(function(obj, key) {
|
|
181
|
+
return obj[key];
|
|
182
|
+
}, packageJson);
|
|
183
|
+
if (candidateMapping && typeof candidateMapping == "string") {
|
|
184
|
+
var candidateFilePath = path.join(path.dirname(packageJsonPath), candidateMapping);
|
|
185
|
+
if (fileExists(candidateFilePath))
|
|
186
|
+
return candidateFilePath;
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
function findFirstExistingPath(tryPaths, readJson, fileExists, mainFields) {
|
|
191
|
+
readJson === void 0 && (readJson = Filesystem.readJsonFromDiskSync), mainFields === void 0 && (mainFields = ["main"]);
|
|
192
|
+
for (var _i = 0, tryPaths_1 = tryPaths; _i < tryPaths_1.length; _i++) {
|
|
193
|
+
var tryPath = tryPaths_1[_i];
|
|
194
|
+
if (tryPath.type === "file" || tryPath.type === "extension" || tryPath.type === "index") {
|
|
195
|
+
if (fileExists(tryPath.path))
|
|
196
|
+
return TryPath.getStrippedPath(tryPath);
|
|
197
|
+
} else if (tryPath.type === "package") {
|
|
198
|
+
var packageJson = readJson(tryPath.path);
|
|
199
|
+
if (packageJson) {
|
|
200
|
+
var mainFieldMappedFile = findFirstExistingMainFieldMappedFile(packageJson, mainFields, tryPath.path, fileExists);
|
|
201
|
+
if (mainFieldMappedFile)
|
|
202
|
+
return mainFieldMappedFile;
|
|
203
|
+
}
|
|
204
|
+
} else
|
|
205
|
+
TryPath.exhaustiveTypeException(tryPath.type);
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
});
|
|
210
|
+
|
|
211
|
+
// ../../../node_modules/tsconfig-paths/lib/match-path-async.js
|
|
212
|
+
var require_match_path_async = __commonJS({
|
|
213
|
+
"../../../node_modules/tsconfig-paths/lib/match-path-async.js"(exports) {
|
|
214
|
+
"use strict";
|
|
215
|
+
Object.defineProperty(exports, "__esModule", { value: !0 });
|
|
216
|
+
exports.matchFromAbsolutePathsAsync = exports.createMatchPathAsync = void 0;
|
|
217
|
+
var path = __require("path"), TryPath = require_try_path(), MappingEntry = require_mapping_entry(), Filesystem = require_filesystem();
|
|
218
|
+
function createMatchPathAsync(absoluteBaseUrl, paths, mainFields, addMatchAll) {
|
|
219
|
+
mainFields === void 0 && (mainFields = ["main"]), addMatchAll === void 0 && (addMatchAll = !0);
|
|
220
|
+
var absolutePaths = MappingEntry.getAbsoluteMappingEntries(absoluteBaseUrl, paths, addMatchAll);
|
|
221
|
+
return function(requestedModule, readJson, fileExists, extensions, callback) {
|
|
222
|
+
return matchFromAbsolutePathsAsync(absolutePaths, requestedModule, readJson, fileExists, extensions, callback, mainFields);
|
|
223
|
+
};
|
|
224
|
+
}
|
|
225
|
+
exports.createMatchPathAsync = createMatchPathAsync;
|
|
226
|
+
function matchFromAbsolutePathsAsync(absolutePathMappings, requestedModule, readJson, fileExists, extensions, callback, mainFields) {
|
|
227
|
+
readJson === void 0 && (readJson = Filesystem.readJsonFromDiskAsync), fileExists === void 0 && (fileExists = Filesystem.fileExistsAsync), extensions === void 0 && (extensions = Object.keys(__require.extensions)), mainFields === void 0 && (mainFields = ["main"]);
|
|
228
|
+
var tryPaths = TryPath.getPathsToTry(extensions, absolutePathMappings, requestedModule);
|
|
229
|
+
if (!tryPaths)
|
|
230
|
+
return callback();
|
|
231
|
+
findFirstExistingPath(tryPaths, readJson, fileExists, callback, 0, mainFields);
|
|
232
|
+
}
|
|
233
|
+
exports.matchFromAbsolutePathsAsync = matchFromAbsolutePathsAsync;
|
|
234
|
+
function findFirstExistingMainFieldMappedFile(packageJson, mainFields, packageJsonPath, fileExistsAsync, doneCallback, index) {
|
|
235
|
+
if (index === void 0 && (index = 0), index >= mainFields.length)
|
|
236
|
+
return doneCallback(void 0, void 0);
|
|
237
|
+
var tryNext = function() {
|
|
238
|
+
return findFirstExistingMainFieldMappedFile(packageJson, mainFields, packageJsonPath, fileExistsAsync, doneCallback, index + 1);
|
|
239
|
+
}, mainFieldSelector = mainFields[index], mainFieldMapping = typeof mainFieldSelector == "string" ? packageJson[mainFieldSelector] : mainFieldSelector.reduce(function(obj, key) {
|
|
240
|
+
return obj[key];
|
|
241
|
+
}, packageJson);
|
|
242
|
+
if (typeof mainFieldMapping != "string")
|
|
243
|
+
return tryNext();
|
|
244
|
+
var mappedFilePath = path.join(path.dirname(packageJsonPath), mainFieldMapping);
|
|
245
|
+
fileExistsAsync(mappedFilePath, function(err, exists) {
|
|
246
|
+
return err ? doneCallback(err) : exists ? doneCallback(void 0, mappedFilePath) : tryNext();
|
|
247
|
+
});
|
|
248
|
+
}
|
|
249
|
+
function findFirstExistingPath(tryPaths, readJson, fileExists, doneCallback, index, mainFields) {
|
|
250
|
+
index === void 0 && (index = 0), mainFields === void 0 && (mainFields = ["main"]);
|
|
251
|
+
var tryPath = tryPaths[index];
|
|
252
|
+
tryPath.type === "file" || tryPath.type === "extension" || tryPath.type === "index" ? fileExists(tryPath.path, function(err, exists) {
|
|
253
|
+
return err ? doneCallback(err) : exists ? doneCallback(void 0, TryPath.getStrippedPath(tryPath)) : index === tryPaths.length - 1 ? doneCallback() : findFirstExistingPath(tryPaths, readJson, fileExists, doneCallback, index + 1, mainFields);
|
|
254
|
+
}) : tryPath.type === "package" ? readJson(tryPath.path, function(err, packageJson) {
|
|
255
|
+
return err ? doneCallback(err) : packageJson ? findFirstExistingMainFieldMappedFile(packageJson, mainFields, tryPath.path, fileExists, function(mainFieldErr, mainFieldMappedFile) {
|
|
256
|
+
return mainFieldErr ? doneCallback(mainFieldErr) : mainFieldMappedFile ? doneCallback(void 0, mainFieldMappedFile) : findFirstExistingPath(tryPaths, readJson, fileExists, doneCallback, index + 1, mainFields);
|
|
257
|
+
}) : findFirstExistingPath(tryPaths, readJson, fileExists, doneCallback, index + 1, mainFields);
|
|
258
|
+
}) : TryPath.exhaustiveTypeException(tryPath.type);
|
|
259
|
+
}
|
|
260
|
+
}
|
|
261
|
+
});
|
|
262
|
+
|
|
263
|
+
// ../../../node_modules/json5/lib/unicode.js
|
|
264
|
+
var require_unicode = __commonJS({
|
|
265
|
+
"../../../node_modules/json5/lib/unicode.js"(exports, module) {
|
|
266
|
+
module.exports.Space_Separator = /[\u1680\u2000-\u200A\u202F\u205F\u3000]/;
|
|
267
|
+
module.exports.ID_Start = /[\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\u0561-\u0587\u05D0-\u05EA\u05F0-\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\u08A0-\u08B4\u08B6-\u08BD\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\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\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\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\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-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\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\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\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\u2E2F\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312E\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FEA\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\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-\uAB65\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]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF2D-\uDF4A\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC03-\uDC37\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDF00-\uDF19]|\uD806[\uDCA0-\uDCDF\uDCFF\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE83\uDE86-\uDE89\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50\uDF93-\uDF9F\uDFE0\uDFE1]|\uD821[\uDC00-\uDFEC]|\uD822[\uDC00-\uDEF2]|\uD82C[\uDC00-\uDD1E\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD83A[\uDC00-\uDCC4\uDD00-\uDD43]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]/;
|
|
268
|
+
module.exports.ID_Continue = /[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0300-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u0483-\u0487\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u05D0-\u05EA\u05F0-\u05F2\u0610-\u061A\u0620-\u0669\u066E-\u06D3\u06D5-\u06DC\u06DF-\u06E8\u06EA-\u06FC\u06FF\u0710-\u074A\u074D-\u07B1\u07C0-\u07F5\u07FA\u0800-\u082D\u0840-\u085B\u0860-\u086A\u08A0-\u08B4\u08B6-\u08BD\u08D4-\u08E1\u08E3-\u0963\u0966-\u096F\u0971-\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BC-\u09C4\u09C7\u09C8\u09CB-\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E3\u09E6-\u09F1\u09FC\u0A01-\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A59-\u0A5C\u0A5E\u0A66-\u0A75\u0A81-\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABC-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AD0\u0AE0-\u0AE3\u0AE6-\u0AEF\u0AF9-\u0AFF\u0B01-\u0B03\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3C-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B5C\u0B5D\u0B5F-\u0B63\u0B66-\u0B6F\u0B71\u0B82\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD0\u0BD7\u0BE6-\u0BEF\u0C00-\u0C03\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C58-\u0C5A\u0C60-\u0C63\u0C66-\u0C6F\u0C80-\u0C83\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBC-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CDE\u0CE0-\u0CE3\u0CE6-\u0CEF\u0CF1\u0CF2\u0D00-\u0D03\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D44\u0D46-\u0D48\u0D4A-\u0D4E\u0D54-\u0D57\u0D5F-\u0D63\u0D66-\u0D6F\u0D7A-\u0D7F\u0D82\u0D83\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E01-\u0E3A\u0E40-\u0E4E\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB9\u0EBB-\u0EBD\u0EC0-\u0EC4\u0EC6\u0EC8-\u0ECD\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E-\u0F47\u0F49-\u0F6C\u0F71-\u0F84\u0F86-\u0F97\u0F99-\u0FBC\u0FC6\u1000-\u1049\u1050-\u109D\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\u135D-\u135F\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1714\u1720-\u1734\u1740-\u1753\u1760-\u176C\u176E-\u1770\u1772\u1773\u1780-\u17D3\u17D7\u17DC\u17DD\u17E0-\u17E9\u180B-\u180D\u1810-\u1819\u1820-\u1877\u1880-\u18AA\u18B0-\u18F5\u1900-\u191E\u1920-\u192B\u1930-\u193B\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19D9\u1A00-\u1A1B\u1A20-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AA7\u1AB0-\u1ABD\u1B00-\u1B4B\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1BF3\u1C00-\u1C37\u1C40-\u1C49\u1C4D-\u1C7D\u1C80-\u1C88\u1CD0-\u1CD2\u1CD4-\u1CF9\u1D00-\u1DF9\u1DFB-\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\u203F\u2040\u2054\u2071\u207F\u2090-\u209C\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D7F-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2DE0-\u2DFF\u2E2F\u3005-\u3007\u3021-\u302F\u3031-\u3035\u3038-\u303C\u3041-\u3096\u3099\u309A\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312E\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FEA\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66F\uA674-\uA67D\uA67F-\uA6F1\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA827\uA840-\uA873\uA880-\uA8C5\uA8D0-\uA8D9\uA8E0-\uA8F7\uA8FB\uA8FD\uA900-\uA92D\uA930-\uA953\uA960-\uA97C\uA980-\uA9C0\uA9CF-\uA9D9\uA9E0-\uA9FE\uAA00-\uAA36\uAA40-\uAA4D\uAA50-\uAA59\uAA60-\uAA76\uAA7A-\uAAC2\uAADB-\uAADD\uAAE0-\uAAEF\uAAF2-\uAAF6\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABEA\uABEC\uABED\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE00-\uFE0F\uFE20-\uFE2F\uFE33\uFE34\uFE4D-\uFE4F\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF3F\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDDFD\uDE80-\uDE9C\uDEA0-\uDED0\uDEE0\uDF00-\uDF1F\uDF2D-\uDF4A\uDF50-\uDF7A\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCA0-\uDCA9\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00-\uDE03\uDE05\uDE06\uDE0C-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE38-\uDE3A\uDE3F\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE6\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC00-\uDC46\uDC66-\uDC6F\uDC7F-\uDCBA\uDCD0-\uDCE8\uDCF0-\uDCF9\uDD00-\uDD34\uDD36-\uDD3F\uDD50-\uDD73\uDD76\uDD80-\uDDC4\uDDCA-\uDDCC\uDDD0-\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE37\uDE3E\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEEA\uDEF0-\uDEF9\uDF00-\uDF03\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3C-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF50\uDF57\uDF5D-\uDF63\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC00-\uDC4A\uDC50-\uDC59\uDC80-\uDCC5\uDCC7\uDCD0-\uDCD9\uDD80-\uDDB5\uDDB8-\uDDC0\uDDD8-\uDDDD\uDE00-\uDE40\uDE44\uDE50-\uDE59\uDE80-\uDEB7\uDEC0-\uDEC9\uDF00-\uDF19\uDF1D-\uDF2B\uDF30-\uDF39]|\uD806[\uDCA0-\uDCE9\uDCFF\uDE00-\uDE3E\uDE47\uDE50-\uDE83\uDE86-\uDE99\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC36\uDC38-\uDC40\uDC50-\uDC59\uDC72-\uDC8F\uDC92-\uDCA7\uDCA9-\uDCB6\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD36\uDD3A\uDD3C\uDD3D\uDD3F-\uDD47\uDD50-\uDD59]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE60-\uDE69\uDED0-\uDEED\uDEF0-\uDEF4\uDF00-\uDF36\uDF40-\uDF43\uDF50-\uDF59\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50-\uDF7E\uDF8F-\uDF9F\uDFE0\uDFE1]|\uD821[\uDC00-\uDFEC]|\uD822[\uDC00-\uDEF2]|\uD82C[\uDC00-\uDD1E\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99\uDC9D\uDC9E]|\uD834[\uDD65-\uDD69\uDD6D-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB\uDFCE-\uDFFF]|\uD836[\uDE00-\uDE36\uDE3B-\uDE6C\uDE75\uDE84\uDE9B-\uDE9F\uDEA1-\uDEAF]|\uD838[\uDC00-\uDC06\uDC08-\uDC18\uDC1B-\uDC21\uDC23\uDC24\uDC26-\uDC2A]|\uD83A[\uDC00-\uDCC4\uDCD0-\uDCD6\uDD00-\uDD4A\uDD50-\uDD59]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]|\uDB40[\uDD00-\uDDEF]/;
|
|
269
|
+
}
|
|
270
|
+
});
|
|
271
|
+
|
|
272
|
+
// ../../../node_modules/json5/lib/util.js
|
|
273
|
+
var require_util = __commonJS({
|
|
274
|
+
"../../../node_modules/json5/lib/util.js"(exports, module) {
|
|
275
|
+
var unicode = require_unicode();
|
|
276
|
+
module.exports = {
|
|
277
|
+
isSpaceSeparator(c) {
|
|
278
|
+
return typeof c == "string" && unicode.Space_Separator.test(c);
|
|
279
|
+
},
|
|
280
|
+
isIdStartChar(c) {
|
|
281
|
+
return typeof c == "string" && (c >= "a" && c <= "z" || c >= "A" && c <= "Z" || c === "$" || c === "_" || unicode.ID_Start.test(c));
|
|
282
|
+
},
|
|
283
|
+
isIdContinueChar(c) {
|
|
284
|
+
return typeof c == "string" && (c >= "a" && c <= "z" || c >= "A" && c <= "Z" || c >= "0" && c <= "9" || c === "$" || c === "_" || c === "\u200C" || c === "\u200D" || unicode.ID_Continue.test(c));
|
|
285
|
+
},
|
|
286
|
+
isDigit(c) {
|
|
287
|
+
return typeof c == "string" && /[0-9]/.test(c);
|
|
288
|
+
},
|
|
289
|
+
isHexDigit(c) {
|
|
290
|
+
return typeof c == "string" && /[0-9A-Fa-f]/.test(c);
|
|
291
|
+
}
|
|
292
|
+
};
|
|
293
|
+
}
|
|
294
|
+
});
|
|
295
|
+
|
|
296
|
+
// ../../../node_modules/json5/lib/parse.js
|
|
297
|
+
var require_parse = __commonJS({
|
|
298
|
+
"../../../node_modules/json5/lib/parse.js"(exports, module) {
|
|
299
|
+
var util = require_util(), source, parseState, stack, pos, line, column, token, key, root;
|
|
300
|
+
module.exports = function(text, reviver) {
|
|
301
|
+
source = String(text), parseState = "start", stack = [], pos = 0, line = 1, column = 0, token = void 0, key = void 0, root = void 0;
|
|
302
|
+
do
|
|
303
|
+
token = lex(), parseStates[parseState]();
|
|
304
|
+
while (token.type !== "eof");
|
|
305
|
+
return typeof reviver == "function" ? internalize({ "": root }, "", reviver) : root;
|
|
306
|
+
};
|
|
307
|
+
function internalize(holder, name, reviver) {
|
|
308
|
+
let value = holder[name];
|
|
309
|
+
if (value != null && typeof value == "object")
|
|
310
|
+
if (Array.isArray(value))
|
|
311
|
+
for (let i = 0; i < value.length; i++) {
|
|
312
|
+
let key2 = String(i), replacement = internalize(value, key2, reviver);
|
|
313
|
+
replacement === void 0 ? delete value[key2] : Object.defineProperty(value, key2, {
|
|
314
|
+
value: replacement,
|
|
315
|
+
writable: !0,
|
|
316
|
+
enumerable: !0,
|
|
317
|
+
configurable: !0
|
|
318
|
+
});
|
|
319
|
+
}
|
|
320
|
+
else
|
|
321
|
+
for (let key2 in value) {
|
|
322
|
+
let replacement = internalize(value, key2, reviver);
|
|
323
|
+
replacement === void 0 ? delete value[key2] : Object.defineProperty(value, key2, {
|
|
324
|
+
value: replacement,
|
|
325
|
+
writable: !0,
|
|
326
|
+
enumerable: !0,
|
|
327
|
+
configurable: !0
|
|
328
|
+
});
|
|
329
|
+
}
|
|
330
|
+
return reviver.call(holder, name, value);
|
|
331
|
+
}
|
|
332
|
+
var lexState, buffer, doubleQuote, sign, c;
|
|
333
|
+
function lex() {
|
|
334
|
+
for (lexState = "default", buffer = "", doubleQuote = !1, sign = 1; ; ) {
|
|
335
|
+
c = peek();
|
|
336
|
+
let token2 = lexStates[lexState]();
|
|
337
|
+
if (token2)
|
|
338
|
+
return token2;
|
|
339
|
+
}
|
|
340
|
+
}
|
|
341
|
+
function peek() {
|
|
342
|
+
if (source[pos])
|
|
343
|
+
return String.fromCodePoint(source.codePointAt(pos));
|
|
344
|
+
}
|
|
345
|
+
function read() {
|
|
346
|
+
let c2 = peek();
|
|
347
|
+
return c2 === `
|
|
348
|
+
` ? (line++, column = 0) : c2 ? column += c2.length : column++, c2 && (pos += c2.length), c2;
|
|
349
|
+
}
|
|
350
|
+
var lexStates = {
|
|
351
|
+
default() {
|
|
352
|
+
switch (c) {
|
|
353
|
+
case " ":
|
|
354
|
+
case "\v":
|
|
355
|
+
case "\f":
|
|
356
|
+
case " ":
|
|
357
|
+
case "\xA0":
|
|
358
|
+
case "\uFEFF":
|
|
359
|
+
case `
|
|
360
|
+
`:
|
|
361
|
+
case "\r":
|
|
362
|
+
case "\u2028":
|
|
363
|
+
case "\u2029":
|
|
364
|
+
read();
|
|
365
|
+
return;
|
|
366
|
+
case "/":
|
|
367
|
+
read(), lexState = "comment";
|
|
368
|
+
return;
|
|
369
|
+
case void 0:
|
|
370
|
+
return read(), newToken("eof");
|
|
371
|
+
}
|
|
372
|
+
if (util.isSpaceSeparator(c)) {
|
|
373
|
+
read();
|
|
374
|
+
return;
|
|
375
|
+
}
|
|
376
|
+
return lexStates[parseState]();
|
|
377
|
+
},
|
|
378
|
+
comment() {
|
|
379
|
+
switch (c) {
|
|
380
|
+
case "*":
|
|
381
|
+
read(), lexState = "multiLineComment";
|
|
382
|
+
return;
|
|
383
|
+
case "/":
|
|
384
|
+
read(), lexState = "singleLineComment";
|
|
385
|
+
return;
|
|
386
|
+
}
|
|
387
|
+
throw invalidChar(read());
|
|
388
|
+
},
|
|
389
|
+
multiLineComment() {
|
|
390
|
+
switch (c) {
|
|
391
|
+
case "*":
|
|
392
|
+
read(), lexState = "multiLineCommentAsterisk";
|
|
393
|
+
return;
|
|
394
|
+
case void 0:
|
|
395
|
+
throw invalidChar(read());
|
|
396
|
+
}
|
|
397
|
+
read();
|
|
398
|
+
},
|
|
399
|
+
multiLineCommentAsterisk() {
|
|
400
|
+
switch (c) {
|
|
401
|
+
case "*":
|
|
402
|
+
read();
|
|
403
|
+
return;
|
|
404
|
+
case "/":
|
|
405
|
+
read(), lexState = "default";
|
|
406
|
+
return;
|
|
407
|
+
case void 0:
|
|
408
|
+
throw invalidChar(read());
|
|
409
|
+
}
|
|
410
|
+
read(), lexState = "multiLineComment";
|
|
411
|
+
},
|
|
412
|
+
singleLineComment() {
|
|
413
|
+
switch (c) {
|
|
414
|
+
case `
|
|
415
|
+
`:
|
|
416
|
+
case "\r":
|
|
417
|
+
case "\u2028":
|
|
418
|
+
case "\u2029":
|
|
419
|
+
read(), lexState = "default";
|
|
420
|
+
return;
|
|
421
|
+
case void 0:
|
|
422
|
+
return read(), newToken("eof");
|
|
423
|
+
}
|
|
424
|
+
read();
|
|
425
|
+
},
|
|
426
|
+
value() {
|
|
427
|
+
switch (c) {
|
|
428
|
+
case "{":
|
|
429
|
+
case "[":
|
|
430
|
+
return newToken("punctuator", read());
|
|
431
|
+
case "n":
|
|
432
|
+
return read(), literal("ull"), newToken("null", null);
|
|
433
|
+
case "t":
|
|
434
|
+
return read(), literal("rue"), newToken("boolean", !0);
|
|
435
|
+
case "f":
|
|
436
|
+
return read(), literal("alse"), newToken("boolean", !1);
|
|
437
|
+
case "-":
|
|
438
|
+
case "+":
|
|
439
|
+
read() === "-" && (sign = -1), lexState = "sign";
|
|
440
|
+
return;
|
|
441
|
+
case ".":
|
|
442
|
+
buffer = read(), lexState = "decimalPointLeading";
|
|
443
|
+
return;
|
|
444
|
+
case "0":
|
|
445
|
+
buffer = read(), lexState = "zero";
|
|
446
|
+
return;
|
|
447
|
+
case "1":
|
|
448
|
+
case "2":
|
|
449
|
+
case "3":
|
|
450
|
+
case "4":
|
|
451
|
+
case "5":
|
|
452
|
+
case "6":
|
|
453
|
+
case "7":
|
|
454
|
+
case "8":
|
|
455
|
+
case "9":
|
|
456
|
+
buffer = read(), lexState = "decimalInteger";
|
|
457
|
+
return;
|
|
458
|
+
case "I":
|
|
459
|
+
return read(), literal("nfinity"), newToken("numeric", 1 / 0);
|
|
460
|
+
case "N":
|
|
461
|
+
return read(), literal("aN"), newToken("numeric", NaN);
|
|
462
|
+
case '"':
|
|
463
|
+
case "'":
|
|
464
|
+
doubleQuote = read() === '"', buffer = "", lexState = "string";
|
|
465
|
+
return;
|
|
466
|
+
}
|
|
467
|
+
throw invalidChar(read());
|
|
468
|
+
},
|
|
469
|
+
identifierNameStartEscape() {
|
|
470
|
+
if (c !== "u")
|
|
471
|
+
throw invalidChar(read());
|
|
472
|
+
read();
|
|
473
|
+
let u = unicodeEscape();
|
|
474
|
+
switch (u) {
|
|
475
|
+
case "$":
|
|
476
|
+
case "_":
|
|
477
|
+
break;
|
|
478
|
+
default:
|
|
479
|
+
if (!util.isIdStartChar(u))
|
|
480
|
+
throw invalidIdentifier();
|
|
481
|
+
break;
|
|
482
|
+
}
|
|
483
|
+
buffer += u, lexState = "identifierName";
|
|
484
|
+
},
|
|
485
|
+
identifierName() {
|
|
486
|
+
switch (c) {
|
|
487
|
+
case "$":
|
|
488
|
+
case "_":
|
|
489
|
+
case "\u200C":
|
|
490
|
+
case "\u200D":
|
|
491
|
+
buffer += read();
|
|
492
|
+
return;
|
|
493
|
+
case "\\":
|
|
494
|
+
read(), lexState = "identifierNameEscape";
|
|
495
|
+
return;
|
|
496
|
+
}
|
|
497
|
+
if (util.isIdContinueChar(c)) {
|
|
498
|
+
buffer += read();
|
|
499
|
+
return;
|
|
500
|
+
}
|
|
501
|
+
return newToken("identifier", buffer);
|
|
502
|
+
},
|
|
503
|
+
identifierNameEscape() {
|
|
504
|
+
if (c !== "u")
|
|
505
|
+
throw invalidChar(read());
|
|
506
|
+
read();
|
|
507
|
+
let u = unicodeEscape();
|
|
508
|
+
switch (u) {
|
|
509
|
+
case "$":
|
|
510
|
+
case "_":
|
|
511
|
+
case "\u200C":
|
|
512
|
+
case "\u200D":
|
|
513
|
+
break;
|
|
514
|
+
default:
|
|
515
|
+
if (!util.isIdContinueChar(u))
|
|
516
|
+
throw invalidIdentifier();
|
|
517
|
+
break;
|
|
518
|
+
}
|
|
519
|
+
buffer += u, lexState = "identifierName";
|
|
520
|
+
},
|
|
521
|
+
sign() {
|
|
522
|
+
switch (c) {
|
|
523
|
+
case ".":
|
|
524
|
+
buffer = read(), lexState = "decimalPointLeading";
|
|
525
|
+
return;
|
|
526
|
+
case "0":
|
|
527
|
+
buffer = read(), lexState = "zero";
|
|
528
|
+
return;
|
|
529
|
+
case "1":
|
|
530
|
+
case "2":
|
|
531
|
+
case "3":
|
|
532
|
+
case "4":
|
|
533
|
+
case "5":
|
|
534
|
+
case "6":
|
|
535
|
+
case "7":
|
|
536
|
+
case "8":
|
|
537
|
+
case "9":
|
|
538
|
+
buffer = read(), lexState = "decimalInteger";
|
|
539
|
+
return;
|
|
540
|
+
case "I":
|
|
541
|
+
return read(), literal("nfinity"), newToken("numeric", sign * (1 / 0));
|
|
542
|
+
case "N":
|
|
543
|
+
return read(), literal("aN"), newToken("numeric", NaN);
|
|
544
|
+
}
|
|
545
|
+
throw invalidChar(read());
|
|
546
|
+
},
|
|
547
|
+
zero() {
|
|
548
|
+
switch (c) {
|
|
549
|
+
case ".":
|
|
550
|
+
buffer += read(), lexState = "decimalPoint";
|
|
551
|
+
return;
|
|
552
|
+
case "e":
|
|
553
|
+
case "E":
|
|
554
|
+
buffer += read(), lexState = "decimalExponent";
|
|
555
|
+
return;
|
|
556
|
+
case "x":
|
|
557
|
+
case "X":
|
|
558
|
+
buffer += read(), lexState = "hexadecimal";
|
|
559
|
+
return;
|
|
560
|
+
}
|
|
561
|
+
return newToken("numeric", sign * 0);
|
|
562
|
+
},
|
|
563
|
+
decimalInteger() {
|
|
564
|
+
switch (c) {
|
|
565
|
+
case ".":
|
|
566
|
+
buffer += read(), lexState = "decimalPoint";
|
|
567
|
+
return;
|
|
568
|
+
case "e":
|
|
569
|
+
case "E":
|
|
570
|
+
buffer += read(), lexState = "decimalExponent";
|
|
571
|
+
return;
|
|
572
|
+
}
|
|
573
|
+
if (util.isDigit(c)) {
|
|
574
|
+
buffer += read();
|
|
575
|
+
return;
|
|
576
|
+
}
|
|
577
|
+
return newToken("numeric", sign * Number(buffer));
|
|
578
|
+
},
|
|
579
|
+
decimalPointLeading() {
|
|
580
|
+
if (util.isDigit(c)) {
|
|
581
|
+
buffer += read(), lexState = "decimalFraction";
|
|
582
|
+
return;
|
|
583
|
+
}
|
|
584
|
+
throw invalidChar(read());
|
|
585
|
+
},
|
|
586
|
+
decimalPoint() {
|
|
587
|
+
switch (c) {
|
|
588
|
+
case "e":
|
|
589
|
+
case "E":
|
|
590
|
+
buffer += read(), lexState = "decimalExponent";
|
|
591
|
+
return;
|
|
592
|
+
}
|
|
593
|
+
if (util.isDigit(c)) {
|
|
594
|
+
buffer += read(), lexState = "decimalFraction";
|
|
595
|
+
return;
|
|
596
|
+
}
|
|
597
|
+
return newToken("numeric", sign * Number(buffer));
|
|
598
|
+
},
|
|
599
|
+
decimalFraction() {
|
|
600
|
+
switch (c) {
|
|
601
|
+
case "e":
|
|
602
|
+
case "E":
|
|
603
|
+
buffer += read(), lexState = "decimalExponent";
|
|
604
|
+
return;
|
|
605
|
+
}
|
|
606
|
+
if (util.isDigit(c)) {
|
|
607
|
+
buffer += read();
|
|
608
|
+
return;
|
|
609
|
+
}
|
|
610
|
+
return newToken("numeric", sign * Number(buffer));
|
|
611
|
+
},
|
|
612
|
+
decimalExponent() {
|
|
613
|
+
switch (c) {
|
|
614
|
+
case "+":
|
|
615
|
+
case "-":
|
|
616
|
+
buffer += read(), lexState = "decimalExponentSign";
|
|
617
|
+
return;
|
|
618
|
+
}
|
|
619
|
+
if (util.isDigit(c)) {
|
|
620
|
+
buffer += read(), lexState = "decimalExponentInteger";
|
|
621
|
+
return;
|
|
622
|
+
}
|
|
623
|
+
throw invalidChar(read());
|
|
624
|
+
},
|
|
625
|
+
decimalExponentSign() {
|
|
626
|
+
if (util.isDigit(c)) {
|
|
627
|
+
buffer += read(), lexState = "decimalExponentInteger";
|
|
628
|
+
return;
|
|
629
|
+
}
|
|
630
|
+
throw invalidChar(read());
|
|
631
|
+
},
|
|
632
|
+
decimalExponentInteger() {
|
|
633
|
+
if (util.isDigit(c)) {
|
|
634
|
+
buffer += read();
|
|
635
|
+
return;
|
|
636
|
+
}
|
|
637
|
+
return newToken("numeric", sign * Number(buffer));
|
|
638
|
+
},
|
|
639
|
+
hexadecimal() {
|
|
640
|
+
if (util.isHexDigit(c)) {
|
|
641
|
+
buffer += read(), lexState = "hexadecimalInteger";
|
|
642
|
+
return;
|
|
643
|
+
}
|
|
644
|
+
throw invalidChar(read());
|
|
645
|
+
},
|
|
646
|
+
hexadecimalInteger() {
|
|
647
|
+
if (util.isHexDigit(c)) {
|
|
648
|
+
buffer += read();
|
|
649
|
+
return;
|
|
650
|
+
}
|
|
651
|
+
return newToken("numeric", sign * Number(buffer));
|
|
652
|
+
},
|
|
653
|
+
string() {
|
|
654
|
+
switch (c) {
|
|
655
|
+
case "\\":
|
|
656
|
+
read(), buffer += escape();
|
|
657
|
+
return;
|
|
658
|
+
case '"':
|
|
659
|
+
if (doubleQuote)
|
|
660
|
+
return read(), newToken("string", buffer);
|
|
661
|
+
buffer += read();
|
|
662
|
+
return;
|
|
663
|
+
case "'":
|
|
664
|
+
if (!doubleQuote)
|
|
665
|
+
return read(), newToken("string", buffer);
|
|
666
|
+
buffer += read();
|
|
667
|
+
return;
|
|
668
|
+
case `
|
|
669
|
+
`:
|
|
670
|
+
case "\r":
|
|
671
|
+
throw invalidChar(read());
|
|
672
|
+
case "\u2028":
|
|
673
|
+
case "\u2029":
|
|
674
|
+
separatorChar(c);
|
|
675
|
+
break;
|
|
676
|
+
case void 0:
|
|
677
|
+
throw invalidChar(read());
|
|
678
|
+
}
|
|
679
|
+
buffer += read();
|
|
680
|
+
},
|
|
681
|
+
start() {
|
|
682
|
+
switch (c) {
|
|
683
|
+
case "{":
|
|
684
|
+
case "[":
|
|
685
|
+
return newToken("punctuator", read());
|
|
686
|
+
}
|
|
687
|
+
lexState = "value";
|
|
688
|
+
},
|
|
689
|
+
beforePropertyName() {
|
|
690
|
+
switch (c) {
|
|
691
|
+
case "$":
|
|
692
|
+
case "_":
|
|
693
|
+
buffer = read(), lexState = "identifierName";
|
|
694
|
+
return;
|
|
695
|
+
case "\\":
|
|
696
|
+
read(), lexState = "identifierNameStartEscape";
|
|
697
|
+
return;
|
|
698
|
+
case "}":
|
|
699
|
+
return newToken("punctuator", read());
|
|
700
|
+
case '"':
|
|
701
|
+
case "'":
|
|
702
|
+
doubleQuote = read() === '"', lexState = "string";
|
|
703
|
+
return;
|
|
704
|
+
}
|
|
705
|
+
if (util.isIdStartChar(c)) {
|
|
706
|
+
buffer += read(), lexState = "identifierName";
|
|
707
|
+
return;
|
|
708
|
+
}
|
|
709
|
+
throw invalidChar(read());
|
|
710
|
+
},
|
|
711
|
+
afterPropertyName() {
|
|
712
|
+
if (c === ":")
|
|
713
|
+
return newToken("punctuator", read());
|
|
714
|
+
throw invalidChar(read());
|
|
715
|
+
},
|
|
716
|
+
beforePropertyValue() {
|
|
717
|
+
lexState = "value";
|
|
718
|
+
},
|
|
719
|
+
afterPropertyValue() {
|
|
720
|
+
switch (c) {
|
|
721
|
+
case ",":
|
|
722
|
+
case "}":
|
|
723
|
+
return newToken("punctuator", read());
|
|
724
|
+
}
|
|
725
|
+
throw invalidChar(read());
|
|
726
|
+
},
|
|
727
|
+
beforeArrayValue() {
|
|
728
|
+
if (c === "]")
|
|
729
|
+
return newToken("punctuator", read());
|
|
730
|
+
lexState = "value";
|
|
731
|
+
},
|
|
732
|
+
afterArrayValue() {
|
|
733
|
+
switch (c) {
|
|
734
|
+
case ",":
|
|
735
|
+
case "]":
|
|
736
|
+
return newToken("punctuator", read());
|
|
737
|
+
}
|
|
738
|
+
throw invalidChar(read());
|
|
739
|
+
},
|
|
740
|
+
end() {
|
|
741
|
+
throw invalidChar(read());
|
|
742
|
+
}
|
|
743
|
+
};
|
|
744
|
+
function newToken(type, value) {
|
|
745
|
+
return {
|
|
746
|
+
type,
|
|
747
|
+
value,
|
|
748
|
+
line,
|
|
749
|
+
column
|
|
750
|
+
};
|
|
751
|
+
}
|
|
752
|
+
function literal(s) {
|
|
753
|
+
for (let c2 of s) {
|
|
754
|
+
if (peek() !== c2)
|
|
755
|
+
throw invalidChar(read());
|
|
756
|
+
read();
|
|
757
|
+
}
|
|
758
|
+
}
|
|
759
|
+
function escape() {
|
|
760
|
+
switch (peek()) {
|
|
761
|
+
case "b":
|
|
762
|
+
return read(), "\b";
|
|
763
|
+
case "f":
|
|
764
|
+
return read(), "\f";
|
|
765
|
+
case "n":
|
|
766
|
+
return read(), `
|
|
767
|
+
`;
|
|
768
|
+
case "r":
|
|
769
|
+
return read(), "\r";
|
|
770
|
+
case "t":
|
|
771
|
+
return read(), " ";
|
|
772
|
+
case "v":
|
|
773
|
+
return read(), "\v";
|
|
774
|
+
case "0":
|
|
775
|
+
if (read(), util.isDigit(peek()))
|
|
776
|
+
throw invalidChar(read());
|
|
777
|
+
return "\0";
|
|
778
|
+
case "x":
|
|
779
|
+
return read(), hexEscape();
|
|
780
|
+
case "u":
|
|
781
|
+
return read(), unicodeEscape();
|
|
782
|
+
case `
|
|
783
|
+
`:
|
|
784
|
+
case "\u2028":
|
|
785
|
+
case "\u2029":
|
|
786
|
+
return read(), "";
|
|
787
|
+
case "\r":
|
|
788
|
+
return read(), peek() === `
|
|
789
|
+
` && read(), "";
|
|
790
|
+
case "1":
|
|
791
|
+
case "2":
|
|
792
|
+
case "3":
|
|
793
|
+
case "4":
|
|
794
|
+
case "5":
|
|
795
|
+
case "6":
|
|
796
|
+
case "7":
|
|
797
|
+
case "8":
|
|
798
|
+
case "9":
|
|
799
|
+
throw invalidChar(read());
|
|
800
|
+
case void 0:
|
|
801
|
+
throw invalidChar(read());
|
|
802
|
+
}
|
|
803
|
+
return read();
|
|
804
|
+
}
|
|
805
|
+
function hexEscape() {
|
|
806
|
+
let buffer2 = "", c2 = peek();
|
|
807
|
+
if (!util.isHexDigit(c2) || (buffer2 += read(), c2 = peek(), !util.isHexDigit(c2)))
|
|
808
|
+
throw invalidChar(read());
|
|
809
|
+
return buffer2 += read(), String.fromCodePoint(parseInt(buffer2, 16));
|
|
810
|
+
}
|
|
811
|
+
function unicodeEscape() {
|
|
812
|
+
let buffer2 = "", count = 4;
|
|
813
|
+
for (; count-- > 0; ) {
|
|
814
|
+
let c2 = peek();
|
|
815
|
+
if (!util.isHexDigit(c2))
|
|
816
|
+
throw invalidChar(read());
|
|
817
|
+
buffer2 += read();
|
|
818
|
+
}
|
|
819
|
+
return String.fromCodePoint(parseInt(buffer2, 16));
|
|
820
|
+
}
|
|
821
|
+
var parseStates = {
|
|
822
|
+
start() {
|
|
823
|
+
if (token.type === "eof")
|
|
824
|
+
throw invalidEOF();
|
|
825
|
+
push();
|
|
826
|
+
},
|
|
827
|
+
beforePropertyName() {
|
|
828
|
+
switch (token.type) {
|
|
829
|
+
case "identifier":
|
|
830
|
+
case "string":
|
|
831
|
+
key = token.value, parseState = "afterPropertyName";
|
|
832
|
+
return;
|
|
833
|
+
case "punctuator":
|
|
834
|
+
pop();
|
|
835
|
+
return;
|
|
836
|
+
case "eof":
|
|
837
|
+
throw invalidEOF();
|
|
838
|
+
}
|
|
839
|
+
},
|
|
840
|
+
afterPropertyName() {
|
|
841
|
+
if (token.type === "eof")
|
|
842
|
+
throw invalidEOF();
|
|
843
|
+
parseState = "beforePropertyValue";
|
|
844
|
+
},
|
|
845
|
+
beforePropertyValue() {
|
|
846
|
+
if (token.type === "eof")
|
|
847
|
+
throw invalidEOF();
|
|
848
|
+
push();
|
|
849
|
+
},
|
|
850
|
+
beforeArrayValue() {
|
|
851
|
+
if (token.type === "eof")
|
|
852
|
+
throw invalidEOF();
|
|
853
|
+
if (token.type === "punctuator" && token.value === "]") {
|
|
854
|
+
pop();
|
|
855
|
+
return;
|
|
856
|
+
}
|
|
857
|
+
push();
|
|
858
|
+
},
|
|
859
|
+
afterPropertyValue() {
|
|
860
|
+
if (token.type === "eof")
|
|
861
|
+
throw invalidEOF();
|
|
862
|
+
switch (token.value) {
|
|
863
|
+
case ",":
|
|
864
|
+
parseState = "beforePropertyName";
|
|
865
|
+
return;
|
|
866
|
+
case "}":
|
|
867
|
+
pop();
|
|
868
|
+
}
|
|
869
|
+
},
|
|
870
|
+
afterArrayValue() {
|
|
871
|
+
if (token.type === "eof")
|
|
872
|
+
throw invalidEOF();
|
|
873
|
+
switch (token.value) {
|
|
874
|
+
case ",":
|
|
875
|
+
parseState = "beforeArrayValue";
|
|
876
|
+
return;
|
|
877
|
+
case "]":
|
|
878
|
+
pop();
|
|
879
|
+
}
|
|
880
|
+
},
|
|
881
|
+
end() {
|
|
882
|
+
}
|
|
883
|
+
};
|
|
884
|
+
function push() {
|
|
885
|
+
let value;
|
|
886
|
+
switch (token.type) {
|
|
887
|
+
case "punctuator":
|
|
888
|
+
switch (token.value) {
|
|
889
|
+
case "{":
|
|
890
|
+
value = {};
|
|
891
|
+
break;
|
|
892
|
+
case "[":
|
|
893
|
+
value = [];
|
|
894
|
+
break;
|
|
895
|
+
}
|
|
896
|
+
break;
|
|
897
|
+
case "null":
|
|
898
|
+
case "boolean":
|
|
899
|
+
case "numeric":
|
|
900
|
+
case "string":
|
|
901
|
+
value = token.value;
|
|
902
|
+
break;
|
|
903
|
+
}
|
|
904
|
+
if (root === void 0)
|
|
905
|
+
root = value;
|
|
906
|
+
else {
|
|
907
|
+
let parent = stack[stack.length - 1];
|
|
908
|
+
Array.isArray(parent) ? parent.push(value) : Object.defineProperty(parent, key, {
|
|
909
|
+
value,
|
|
910
|
+
writable: !0,
|
|
911
|
+
enumerable: !0,
|
|
912
|
+
configurable: !0
|
|
913
|
+
});
|
|
914
|
+
}
|
|
915
|
+
if (value !== null && typeof value == "object")
|
|
916
|
+
stack.push(value), Array.isArray(value) ? parseState = "beforeArrayValue" : parseState = "beforePropertyName";
|
|
917
|
+
else {
|
|
918
|
+
let current = stack[stack.length - 1];
|
|
919
|
+
current == null ? parseState = "end" : Array.isArray(current) ? parseState = "afterArrayValue" : parseState = "afterPropertyValue";
|
|
920
|
+
}
|
|
921
|
+
}
|
|
922
|
+
function pop() {
|
|
923
|
+
stack.pop();
|
|
924
|
+
let current = stack[stack.length - 1];
|
|
925
|
+
current == null ? parseState = "end" : Array.isArray(current) ? parseState = "afterArrayValue" : parseState = "afterPropertyValue";
|
|
926
|
+
}
|
|
927
|
+
function invalidChar(c2) {
|
|
928
|
+
return syntaxError(c2 === void 0 ? `JSON5: invalid end of input at ${line}:${column}` : `JSON5: invalid character '${formatChar(c2)}' at ${line}:${column}`);
|
|
929
|
+
}
|
|
930
|
+
function invalidEOF() {
|
|
931
|
+
return syntaxError(`JSON5: invalid end of input at ${line}:${column}`);
|
|
932
|
+
}
|
|
933
|
+
function invalidIdentifier() {
|
|
934
|
+
return column -= 5, syntaxError(`JSON5: invalid identifier character at ${line}:${column}`);
|
|
935
|
+
}
|
|
936
|
+
function separatorChar(c2) {
|
|
937
|
+
console.warn(`JSON5: '${formatChar(c2)}' in strings is not valid ECMAScript; consider escaping`);
|
|
938
|
+
}
|
|
939
|
+
function formatChar(c2) {
|
|
940
|
+
let replacements = {
|
|
941
|
+
"'": "\\'",
|
|
942
|
+
'"': '\\"',
|
|
943
|
+
"\\": "\\\\",
|
|
944
|
+
"\b": "\\b",
|
|
945
|
+
"\f": "\\f",
|
|
946
|
+
"\n": "\\n",
|
|
947
|
+
"\r": "\\r",
|
|
948
|
+
" ": "\\t",
|
|
949
|
+
"\v": "\\v",
|
|
950
|
+
"\0": "\\0",
|
|
951
|
+
"\u2028": "\\u2028",
|
|
952
|
+
"\u2029": "\\u2029"
|
|
953
|
+
};
|
|
954
|
+
if (replacements[c2])
|
|
955
|
+
return replacements[c2];
|
|
956
|
+
if (c2 < " ") {
|
|
957
|
+
let hexString = c2.charCodeAt(0).toString(16);
|
|
958
|
+
return "\\x" + ("00" + hexString).substring(hexString.length);
|
|
959
|
+
}
|
|
960
|
+
return c2;
|
|
961
|
+
}
|
|
962
|
+
function syntaxError(message) {
|
|
963
|
+
let err = new SyntaxError(message);
|
|
964
|
+
return err.lineNumber = line, err.columnNumber = column, err;
|
|
965
|
+
}
|
|
966
|
+
}
|
|
967
|
+
});
|
|
968
|
+
|
|
969
|
+
// ../../../node_modules/json5/lib/stringify.js
|
|
970
|
+
var require_stringify = __commonJS({
|
|
971
|
+
"../../../node_modules/json5/lib/stringify.js"(exports, module) {
|
|
972
|
+
var util = require_util();
|
|
973
|
+
module.exports = function(value, replacer, space) {
|
|
974
|
+
let stack = [], indent = "", propertyList, replacerFunc, gap = "", quote;
|
|
975
|
+
if (replacer != null && typeof replacer == "object" && !Array.isArray(replacer) && (space = replacer.space, quote = replacer.quote, replacer = replacer.replacer), typeof replacer == "function")
|
|
976
|
+
replacerFunc = replacer;
|
|
977
|
+
else if (Array.isArray(replacer)) {
|
|
978
|
+
propertyList = [];
|
|
979
|
+
for (let v of replacer) {
|
|
980
|
+
let item;
|
|
981
|
+
typeof v == "string" ? item = v : (typeof v == "number" || v instanceof String || v instanceof Number) && (item = String(v)), item !== void 0 && propertyList.indexOf(item) < 0 && propertyList.push(item);
|
|
982
|
+
}
|
|
983
|
+
}
|
|
984
|
+
return space instanceof Number ? space = Number(space) : space instanceof String && (space = String(space)), typeof space == "number" ? space > 0 && (space = Math.min(10, Math.floor(space)), gap = " ".substr(0, space)) : typeof space == "string" && (gap = space.substr(0, 10)), serializeProperty("", { "": value });
|
|
985
|
+
function serializeProperty(key, holder) {
|
|
986
|
+
let value2 = holder[key];
|
|
987
|
+
switch (value2 != null && (typeof value2.toJSON5 == "function" ? value2 = value2.toJSON5(key) : typeof value2.toJSON == "function" && (value2 = value2.toJSON(key))), replacerFunc && (value2 = replacerFunc.call(holder, key, value2)), value2 instanceof Number ? value2 = Number(value2) : value2 instanceof String ? value2 = String(value2) : value2 instanceof Boolean && (value2 = value2.valueOf()), value2) {
|
|
988
|
+
case null:
|
|
989
|
+
return "null";
|
|
990
|
+
case !0:
|
|
991
|
+
return "true";
|
|
992
|
+
case !1:
|
|
993
|
+
return "false";
|
|
994
|
+
}
|
|
995
|
+
if (typeof value2 == "string")
|
|
996
|
+
return quoteString(value2, !1);
|
|
997
|
+
if (typeof value2 == "number")
|
|
998
|
+
return String(value2);
|
|
999
|
+
if (typeof value2 == "object")
|
|
1000
|
+
return Array.isArray(value2) ? serializeArray(value2) : serializeObject(value2);
|
|
1001
|
+
}
|
|
1002
|
+
function quoteString(value2) {
|
|
1003
|
+
let quotes = {
|
|
1004
|
+
"'": 0.1,
|
|
1005
|
+
'"': 0.2
|
|
1006
|
+
}, replacements = {
|
|
1007
|
+
"'": "\\'",
|
|
1008
|
+
'"': '\\"',
|
|
1009
|
+
"\\": "\\\\",
|
|
1010
|
+
"\b": "\\b",
|
|
1011
|
+
"\f": "\\f",
|
|
1012
|
+
"\n": "\\n",
|
|
1013
|
+
"\r": "\\r",
|
|
1014
|
+
" ": "\\t",
|
|
1015
|
+
"\v": "\\v",
|
|
1016
|
+
"\0": "\\0",
|
|
1017
|
+
"\u2028": "\\u2028",
|
|
1018
|
+
"\u2029": "\\u2029"
|
|
1019
|
+
}, product = "";
|
|
1020
|
+
for (let i = 0; i < value2.length; i++) {
|
|
1021
|
+
let c = value2[i];
|
|
1022
|
+
switch (c) {
|
|
1023
|
+
case "'":
|
|
1024
|
+
case '"':
|
|
1025
|
+
quotes[c]++, product += c;
|
|
1026
|
+
continue;
|
|
1027
|
+
case "\0":
|
|
1028
|
+
if (util.isDigit(value2[i + 1])) {
|
|
1029
|
+
product += "\\x00";
|
|
1030
|
+
continue;
|
|
1031
|
+
}
|
|
1032
|
+
}
|
|
1033
|
+
if (replacements[c]) {
|
|
1034
|
+
product += replacements[c];
|
|
1035
|
+
continue;
|
|
1036
|
+
}
|
|
1037
|
+
if (c < " ") {
|
|
1038
|
+
let hexString = c.charCodeAt(0).toString(16);
|
|
1039
|
+
product += "\\x" + ("00" + hexString).substring(hexString.length);
|
|
1040
|
+
continue;
|
|
1041
|
+
}
|
|
1042
|
+
product += c;
|
|
1043
|
+
}
|
|
1044
|
+
let quoteChar = quote || Object.keys(quotes).reduce((a, b) => quotes[a] < quotes[b] ? a : b);
|
|
1045
|
+
return product = product.replace(new RegExp(quoteChar, "g"), replacements[quoteChar]), quoteChar + product + quoteChar;
|
|
1046
|
+
}
|
|
1047
|
+
function serializeObject(value2) {
|
|
1048
|
+
if (stack.indexOf(value2) >= 0)
|
|
1049
|
+
throw TypeError("Converting circular structure to JSON5");
|
|
1050
|
+
stack.push(value2);
|
|
1051
|
+
let stepback = indent;
|
|
1052
|
+
indent = indent + gap;
|
|
1053
|
+
let keys = propertyList || Object.keys(value2), partial = [];
|
|
1054
|
+
for (let key of keys) {
|
|
1055
|
+
let propertyString = serializeProperty(key, value2);
|
|
1056
|
+
if (propertyString !== void 0) {
|
|
1057
|
+
let member = serializeKey(key) + ":";
|
|
1058
|
+
gap !== "" && (member += " "), member += propertyString, partial.push(member);
|
|
1059
|
+
}
|
|
1060
|
+
}
|
|
1061
|
+
let final;
|
|
1062
|
+
if (partial.length === 0)
|
|
1063
|
+
final = "{}";
|
|
1064
|
+
else {
|
|
1065
|
+
let properties;
|
|
1066
|
+
if (gap === "")
|
|
1067
|
+
properties = partial.join(","), final = "{" + properties + "}";
|
|
1068
|
+
else {
|
|
1069
|
+
let separator = `,
|
|
1070
|
+
` + indent;
|
|
1071
|
+
properties = partial.join(separator), final = `{
|
|
1072
|
+
` + indent + properties + `,
|
|
1073
|
+
` + stepback + "}";
|
|
1074
|
+
}
|
|
1075
|
+
}
|
|
1076
|
+
return stack.pop(), indent = stepback, final;
|
|
1077
|
+
}
|
|
1078
|
+
function serializeKey(key) {
|
|
1079
|
+
if (key.length === 0)
|
|
1080
|
+
return quoteString(key, !0);
|
|
1081
|
+
let firstChar = String.fromCodePoint(key.codePointAt(0));
|
|
1082
|
+
if (!util.isIdStartChar(firstChar))
|
|
1083
|
+
return quoteString(key, !0);
|
|
1084
|
+
for (let i = firstChar.length; i < key.length; i++)
|
|
1085
|
+
if (!util.isIdContinueChar(String.fromCodePoint(key.codePointAt(i))))
|
|
1086
|
+
return quoteString(key, !0);
|
|
1087
|
+
return key;
|
|
1088
|
+
}
|
|
1089
|
+
function serializeArray(value2) {
|
|
1090
|
+
if (stack.indexOf(value2) >= 0)
|
|
1091
|
+
throw TypeError("Converting circular structure to JSON5");
|
|
1092
|
+
stack.push(value2);
|
|
1093
|
+
let stepback = indent;
|
|
1094
|
+
indent = indent + gap;
|
|
1095
|
+
let partial = [];
|
|
1096
|
+
for (let i = 0; i < value2.length; i++) {
|
|
1097
|
+
let propertyString = serializeProperty(String(i), value2);
|
|
1098
|
+
partial.push(propertyString !== void 0 ? propertyString : "null");
|
|
1099
|
+
}
|
|
1100
|
+
let final;
|
|
1101
|
+
if (partial.length === 0)
|
|
1102
|
+
final = "[]";
|
|
1103
|
+
else if (gap === "")
|
|
1104
|
+
final = "[" + partial.join(",") + "]";
|
|
1105
|
+
else {
|
|
1106
|
+
let separator = `,
|
|
1107
|
+
` + indent, properties = partial.join(separator);
|
|
1108
|
+
final = `[
|
|
1109
|
+
` + indent + properties + `,
|
|
1110
|
+
` + stepback + "]";
|
|
1111
|
+
}
|
|
1112
|
+
return stack.pop(), indent = stepback, final;
|
|
1113
|
+
}
|
|
1114
|
+
};
|
|
1115
|
+
}
|
|
1116
|
+
});
|
|
1117
|
+
|
|
1118
|
+
// ../../../node_modules/json5/lib/index.js
|
|
1119
|
+
var require_lib = __commonJS({
|
|
1120
|
+
"../../../node_modules/json5/lib/index.js"(exports, module) {
|
|
1121
|
+
var parse2 = require_parse(), stringify = require_stringify(), JSON5 = {
|
|
1122
|
+
parse: parse2,
|
|
1123
|
+
stringify
|
|
1124
|
+
};
|
|
1125
|
+
module.exports = JSON5;
|
|
1126
|
+
}
|
|
1127
|
+
});
|
|
1128
|
+
|
|
1129
|
+
// ../../../node_modules/strip-bom/index.js
|
|
1130
|
+
var require_strip_bom = __commonJS({
|
|
1131
|
+
"../../../node_modules/strip-bom/index.js"(exports, module) {
|
|
1132
|
+
"use strict";
|
|
1133
|
+
module.exports = (x) => {
|
|
1134
|
+
if (typeof x != "string")
|
|
1135
|
+
throw new TypeError("Expected a string, got " + typeof x);
|
|
1136
|
+
return x.charCodeAt(0) === 65279 ? x.slice(1) : x;
|
|
1137
|
+
};
|
|
1138
|
+
}
|
|
1139
|
+
});
|
|
1140
|
+
|
|
1141
|
+
// ../../../node_modules/tsconfig-paths/lib/tsconfig-loader.js
|
|
1142
|
+
var require_tsconfig_loader = __commonJS({
|
|
1143
|
+
"../../../node_modules/tsconfig-paths/lib/tsconfig-loader.js"(exports) {
|
|
1144
|
+
"use strict";
|
|
1145
|
+
var __assign = exports && exports.__assign || function() {
|
|
1146
|
+
return __assign = Object.assign || function(t) {
|
|
1147
|
+
for (var s, i = 1, n2 = arguments.length; i < n2; i++) {
|
|
1148
|
+
s = arguments[i];
|
|
1149
|
+
for (var p in s) Object.prototype.hasOwnProperty.call(s, p) && (t[p] = s[p]);
|
|
1150
|
+
}
|
|
1151
|
+
return t;
|
|
1152
|
+
}, __assign.apply(this, arguments);
|
|
1153
|
+
};
|
|
1154
|
+
Object.defineProperty(exports, "__esModule", { value: !0 });
|
|
1155
|
+
exports.loadTsconfig = exports.walkForTsConfig = exports.tsConfigLoader = void 0;
|
|
1156
|
+
var path = __require("path"), fs = __require("fs"), JSON5 = require_lib(), StripBom = require_strip_bom();
|
|
1157
|
+
function tsConfigLoader(_a) {
|
|
1158
|
+
var getEnv = _a.getEnv, cwd = _a.cwd, _b = _a.loadSync, loadSync = _b === void 0 ? loadSyncDefault : _b, TS_NODE_PROJECT = getEnv("TS_NODE_PROJECT"), TS_NODE_BASEURL = getEnv("TS_NODE_BASEURL"), loadResult = loadSync(cwd, TS_NODE_PROJECT, TS_NODE_BASEURL);
|
|
1159
|
+
return loadResult;
|
|
1160
|
+
}
|
|
1161
|
+
exports.tsConfigLoader = tsConfigLoader;
|
|
1162
|
+
function loadSyncDefault(cwd, filename, baseUrl) {
|
|
1163
|
+
var configPath = resolveConfigPath(cwd, filename);
|
|
1164
|
+
if (!configPath)
|
|
1165
|
+
return {
|
|
1166
|
+
tsConfigPath: void 0,
|
|
1167
|
+
baseUrl: void 0,
|
|
1168
|
+
paths: void 0
|
|
1169
|
+
};
|
|
1170
|
+
var config = loadTsconfig(configPath);
|
|
1171
|
+
return {
|
|
1172
|
+
tsConfigPath: configPath,
|
|
1173
|
+
baseUrl: baseUrl || config && config.compilerOptions && config.compilerOptions.baseUrl,
|
|
1174
|
+
paths: config && config.compilerOptions && config.compilerOptions.paths
|
|
1175
|
+
};
|
|
1176
|
+
}
|
|
1177
|
+
function resolveConfigPath(cwd, filename) {
|
|
1178
|
+
if (filename) {
|
|
1179
|
+
var absolutePath = fs.lstatSync(filename).isDirectory() ? path.resolve(filename, "./tsconfig.json") : path.resolve(cwd, filename);
|
|
1180
|
+
return absolutePath;
|
|
1181
|
+
}
|
|
1182
|
+
if (fs.statSync(cwd).isFile())
|
|
1183
|
+
return path.resolve(cwd);
|
|
1184
|
+
var configAbsolutePath = walkForTsConfig(cwd);
|
|
1185
|
+
return configAbsolutePath ? path.resolve(configAbsolutePath) : void 0;
|
|
1186
|
+
}
|
|
1187
|
+
function walkForTsConfig(directory, readdirSync) {
|
|
1188
|
+
readdirSync === void 0 && (readdirSync = fs.readdirSync);
|
|
1189
|
+
for (var files = readdirSync(directory), filesToCheck = ["tsconfig.json", "jsconfig.json"], _i = 0, filesToCheck_1 = filesToCheck; _i < filesToCheck_1.length; _i++) {
|
|
1190
|
+
var fileToCheck = filesToCheck_1[_i];
|
|
1191
|
+
if (files.indexOf(fileToCheck) !== -1)
|
|
1192
|
+
return path.join(directory, fileToCheck);
|
|
1193
|
+
}
|
|
1194
|
+
var parentDirectory = path.dirname(directory);
|
|
1195
|
+
if (directory !== parentDirectory)
|
|
1196
|
+
return walkForTsConfig(parentDirectory, readdirSync);
|
|
1197
|
+
}
|
|
1198
|
+
exports.walkForTsConfig = walkForTsConfig;
|
|
1199
|
+
function loadTsconfig(configFilePath, existsSync, readFileSync) {
|
|
1200
|
+
if (existsSync === void 0 && (existsSync = fs.existsSync), readFileSync === void 0 && (readFileSync = function(filename) {
|
|
1201
|
+
return fs.readFileSync(filename, "utf8");
|
|
1202
|
+
}), !!existsSync(configFilePath)) {
|
|
1203
|
+
var configString = readFileSync(configFilePath), cleanedJson = StripBom(configString), config;
|
|
1204
|
+
try {
|
|
1205
|
+
config = JSON5.parse(cleanedJson);
|
|
1206
|
+
} catch (e) {
|
|
1207
|
+
throw new Error("".concat(configFilePath, " is malformed ").concat(e.message));
|
|
1208
|
+
}
|
|
1209
|
+
var extendedConfig = config.extends;
|
|
1210
|
+
if (extendedConfig) {
|
|
1211
|
+
var base = void 0;
|
|
1212
|
+
return Array.isArray(extendedConfig) ? base = extendedConfig.reduce(function(currBase, extendedConfigElement) {
|
|
1213
|
+
return mergeTsconfigs(currBase, loadTsconfigFromExtends(configFilePath, extendedConfigElement, existsSync, readFileSync));
|
|
1214
|
+
}, {}) : base = loadTsconfigFromExtends(configFilePath, extendedConfig, existsSync, readFileSync), mergeTsconfigs(base, config);
|
|
1215
|
+
}
|
|
1216
|
+
return config;
|
|
1217
|
+
}
|
|
1218
|
+
}
|
|
1219
|
+
exports.loadTsconfig = loadTsconfig;
|
|
1220
|
+
function loadTsconfigFromExtends(configFilePath, extendedConfigValue, existsSync, readFileSync) {
|
|
1221
|
+
var _a;
|
|
1222
|
+
typeof extendedConfigValue == "string" && extendedConfigValue.indexOf(".json") === -1 && (extendedConfigValue += ".json");
|
|
1223
|
+
var currentDir = path.dirname(configFilePath), extendedConfigPath = path.join(currentDir, extendedConfigValue);
|
|
1224
|
+
extendedConfigValue.indexOf("/") !== -1 && extendedConfigValue.indexOf(".") !== -1 && !existsSync(extendedConfigPath) && (extendedConfigPath = path.join(currentDir, "node_modules", extendedConfigValue));
|
|
1225
|
+
var config = loadTsconfig(extendedConfigPath, existsSync, readFileSync) || {};
|
|
1226
|
+
if (!((_a = config.compilerOptions) === null || _a === void 0) && _a.baseUrl) {
|
|
1227
|
+
var extendsDir = path.dirname(extendedConfigValue);
|
|
1228
|
+
config.compilerOptions.baseUrl = path.join(extendsDir, config.compilerOptions.baseUrl);
|
|
1229
|
+
}
|
|
1230
|
+
return config;
|
|
1231
|
+
}
|
|
1232
|
+
function mergeTsconfigs(base, config) {
|
|
1233
|
+
return base = base || {}, config = config || {}, __assign(__assign(__assign({}, base), config), { compilerOptions: __assign(__assign({}, base.compilerOptions), config.compilerOptions) });
|
|
1234
|
+
}
|
|
1235
|
+
}
|
|
1236
|
+
});
|
|
1237
|
+
|
|
1238
|
+
// ../../../node_modules/tsconfig-paths/lib/config-loader.js
|
|
1239
|
+
var require_config_loader = __commonJS({
|
|
1240
|
+
"../../../node_modules/tsconfig-paths/lib/config-loader.js"(exports) {
|
|
1241
|
+
"use strict";
|
|
1242
|
+
Object.defineProperty(exports, "__esModule", { value: !0 });
|
|
1243
|
+
exports.configLoader = exports.loadConfig = void 0;
|
|
1244
|
+
var TsConfigLoader2 = require_tsconfig_loader(), path = __require("path");
|
|
1245
|
+
function loadConfig2(cwd) {
|
|
1246
|
+
return cwd === void 0 && (cwd = process.cwd()), configLoader({ cwd });
|
|
1247
|
+
}
|
|
1248
|
+
exports.loadConfig = loadConfig2;
|
|
1249
|
+
function configLoader(_a) {
|
|
1250
|
+
var cwd = _a.cwd, explicitParams = _a.explicitParams, _b = _a.tsConfigLoader, tsConfigLoader = _b === void 0 ? TsConfigLoader2.tsConfigLoader : _b;
|
|
1251
|
+
if (explicitParams) {
|
|
1252
|
+
var absoluteBaseUrl = path.isAbsolute(explicitParams.baseUrl) ? explicitParams.baseUrl : path.join(cwd, explicitParams.baseUrl);
|
|
1253
|
+
return {
|
|
1254
|
+
resultType: "success",
|
|
1255
|
+
configFileAbsolutePath: "",
|
|
1256
|
+
baseUrl: explicitParams.baseUrl,
|
|
1257
|
+
absoluteBaseUrl,
|
|
1258
|
+
paths: explicitParams.paths,
|
|
1259
|
+
mainFields: explicitParams.mainFields,
|
|
1260
|
+
addMatchAll: explicitParams.addMatchAll
|
|
1261
|
+
};
|
|
1262
|
+
}
|
|
1263
|
+
var loadResult = tsConfigLoader({
|
|
1264
|
+
cwd,
|
|
1265
|
+
getEnv: function(key) {
|
|
1266
|
+
return process.env[key];
|
|
1267
|
+
}
|
|
1268
|
+
});
|
|
1269
|
+
return loadResult.tsConfigPath ? {
|
|
1270
|
+
resultType: "success",
|
|
1271
|
+
configFileAbsolutePath: loadResult.tsConfigPath,
|
|
1272
|
+
baseUrl: loadResult.baseUrl,
|
|
1273
|
+
absoluteBaseUrl: path.resolve(path.dirname(loadResult.tsConfigPath), loadResult.baseUrl || ""),
|
|
1274
|
+
paths: loadResult.paths || {},
|
|
1275
|
+
addMatchAll: loadResult.baseUrl !== void 0
|
|
1276
|
+
} : {
|
|
1277
|
+
resultType: "failed",
|
|
1278
|
+
message: "Couldn't find tsconfig.json"
|
|
1279
|
+
};
|
|
1280
|
+
}
|
|
1281
|
+
exports.configLoader = configLoader;
|
|
1282
|
+
}
|
|
1283
|
+
});
|
|
1284
|
+
|
|
1285
|
+
// ../../../node_modules/minimist/index.js
|
|
1286
|
+
var require_minimist = __commonJS({
|
|
1287
|
+
"../../../node_modules/minimist/index.js"(exports, module) {
|
|
1288
|
+
"use strict";
|
|
1289
|
+
function hasKey(obj, keys) {
|
|
1290
|
+
var o = obj;
|
|
1291
|
+
keys.slice(0, -1).forEach(function(key2) {
|
|
1292
|
+
o = o[key2] || {};
|
|
1293
|
+
});
|
|
1294
|
+
var key = keys[keys.length - 1];
|
|
1295
|
+
return key in o;
|
|
1296
|
+
}
|
|
1297
|
+
function isNumber(x) {
|
|
1298
|
+
return typeof x == "number" || /^0x[0-9a-f]+$/i.test(x) ? !0 : /^[-+]?(?:\d+(?:\.\d*)?|\.\d+)(e[-+]?\d+)?$/.test(x);
|
|
1299
|
+
}
|
|
1300
|
+
function isConstructorOrProto(obj, key) {
|
|
1301
|
+
return key === "constructor" && typeof obj[key] == "function" || key === "__proto__";
|
|
1302
|
+
}
|
|
1303
|
+
module.exports = function(args, opts) {
|
|
1304
|
+
opts || (opts = {});
|
|
1305
|
+
var flags = {
|
|
1306
|
+
bools: {},
|
|
1307
|
+
strings: {},
|
|
1308
|
+
unknownFn: null
|
|
1309
|
+
};
|
|
1310
|
+
typeof opts.unknown == "function" && (flags.unknownFn = opts.unknown), typeof opts.boolean == "boolean" && opts.boolean ? flags.allBools = !0 : [].concat(opts.boolean).filter(Boolean).forEach(function(key2) {
|
|
1311
|
+
flags.bools[key2] = !0;
|
|
1312
|
+
});
|
|
1313
|
+
var aliases = {};
|
|
1314
|
+
function aliasIsBoolean(key2) {
|
|
1315
|
+
return aliases[key2].some(function(x) {
|
|
1316
|
+
return flags.bools[x];
|
|
1317
|
+
});
|
|
1318
|
+
}
|
|
1319
|
+
Object.keys(opts.alias || {}).forEach(function(key2) {
|
|
1320
|
+
aliases[key2] = [].concat(opts.alias[key2]), aliases[key2].forEach(function(x) {
|
|
1321
|
+
aliases[x] = [key2].concat(aliases[key2].filter(function(y) {
|
|
1322
|
+
return x !== y;
|
|
1323
|
+
}));
|
|
1324
|
+
});
|
|
1325
|
+
}), [].concat(opts.string).filter(Boolean).forEach(function(key2) {
|
|
1326
|
+
flags.strings[key2] = !0, aliases[key2] && [].concat(aliases[key2]).forEach(function(k) {
|
|
1327
|
+
flags.strings[k] = !0;
|
|
1328
|
+
});
|
|
1329
|
+
});
|
|
1330
|
+
var defaults = opts.default || {}, argv = { _: [] };
|
|
1331
|
+
function argDefined(key2, arg2) {
|
|
1332
|
+
return flags.allBools && /^--[^=]+$/.test(arg2) || flags.strings[key2] || flags.bools[key2] || aliases[key2];
|
|
1333
|
+
}
|
|
1334
|
+
function setKey(obj, keys, value2) {
|
|
1335
|
+
for (var o = obj, i2 = 0; i2 < keys.length - 1; i2++) {
|
|
1336
|
+
var key2 = keys[i2];
|
|
1337
|
+
if (isConstructorOrProto(o, key2))
|
|
1338
|
+
return;
|
|
1339
|
+
o[key2] === void 0 && (o[key2] = {}), (o[key2] === Object.prototype || o[key2] === Number.prototype || o[key2] === String.prototype) && (o[key2] = {}), o[key2] === Array.prototype && (o[key2] = []), o = o[key2];
|
|
1340
|
+
}
|
|
1341
|
+
var lastKey = keys[keys.length - 1];
|
|
1342
|
+
isConstructorOrProto(o, lastKey) || ((o === Object.prototype || o === Number.prototype || o === String.prototype) && (o = {}), o === Array.prototype && (o = []), o[lastKey] === void 0 || flags.bools[lastKey] || typeof o[lastKey] == "boolean" ? o[lastKey] = value2 : Array.isArray(o[lastKey]) ? o[lastKey].push(value2) : o[lastKey] = [o[lastKey], value2]);
|
|
1343
|
+
}
|
|
1344
|
+
function setArg(key2, val, arg2) {
|
|
1345
|
+
if (!(arg2 && flags.unknownFn && !argDefined(key2, arg2) && flags.unknownFn(arg2) === !1)) {
|
|
1346
|
+
var value2 = !flags.strings[key2] && isNumber(val) ? Number(val) : val;
|
|
1347
|
+
setKey(argv, key2.split("."), value2), (aliases[key2] || []).forEach(function(x) {
|
|
1348
|
+
setKey(argv, x.split("."), value2);
|
|
1349
|
+
});
|
|
1350
|
+
}
|
|
1351
|
+
}
|
|
1352
|
+
Object.keys(flags.bools).forEach(function(key2) {
|
|
1353
|
+
setArg(key2, defaults[key2] === void 0 ? !1 : defaults[key2]);
|
|
1354
|
+
});
|
|
1355
|
+
var notFlags = [];
|
|
1356
|
+
args.indexOf("--") !== -1 && (notFlags = args.slice(args.indexOf("--") + 1), args = args.slice(0, args.indexOf("--")));
|
|
1357
|
+
for (var i = 0; i < args.length; i++) {
|
|
1358
|
+
var arg = args[i], key, next;
|
|
1359
|
+
if (/^--.+=/.test(arg)) {
|
|
1360
|
+
var m = arg.match(/^--([^=]+)=([\s\S]*)$/);
|
|
1361
|
+
key = m[1];
|
|
1362
|
+
var value = m[2];
|
|
1363
|
+
flags.bools[key] && (value = value !== "false"), setArg(key, value, arg);
|
|
1364
|
+
} else if (/^--no-.+/.test(arg))
|
|
1365
|
+
key = arg.match(/^--no-(.+)/)[1], setArg(key, !1, arg);
|
|
1366
|
+
else if (/^--.+/.test(arg))
|
|
1367
|
+
key = arg.match(/^--(.+)/)[1], next = args[i + 1], next !== void 0 && !/^(-|--)[^-]/.test(next) && !flags.bools[key] && !flags.allBools && (!aliases[key] || !aliasIsBoolean(key)) ? (setArg(key, next, arg), i += 1) : /^(true|false)$/.test(next) ? (setArg(key, next === "true", arg), i += 1) : setArg(key, flags.strings[key] ? "" : !0, arg);
|
|
1368
|
+
else if (/^-[^-]+/.test(arg)) {
|
|
1369
|
+
for (var letters = arg.slice(1, -1).split(""), broken = !1, j = 0; j < letters.length; j++) {
|
|
1370
|
+
if (next = arg.slice(j + 2), next === "-") {
|
|
1371
|
+
setArg(letters[j], next, arg);
|
|
1372
|
+
continue;
|
|
1373
|
+
}
|
|
1374
|
+
if (/[A-Za-z]/.test(letters[j]) && next[0] === "=") {
|
|
1375
|
+
setArg(letters[j], next.slice(1), arg), broken = !0;
|
|
1376
|
+
break;
|
|
1377
|
+
}
|
|
1378
|
+
if (/[A-Za-z]/.test(letters[j]) && /-?\d+(\.\d*)?(e-?\d+)?$/.test(next)) {
|
|
1379
|
+
setArg(letters[j], next, arg), broken = !0;
|
|
1380
|
+
break;
|
|
1381
|
+
}
|
|
1382
|
+
if (letters[j + 1] && letters[j + 1].match(/\W/)) {
|
|
1383
|
+
setArg(letters[j], arg.slice(j + 2), arg), broken = !0;
|
|
1384
|
+
break;
|
|
1385
|
+
} else
|
|
1386
|
+
setArg(letters[j], flags.strings[letters[j]] ? "" : !0, arg);
|
|
1387
|
+
}
|
|
1388
|
+
key = arg.slice(-1)[0], !broken && key !== "-" && (args[i + 1] && !/^(-|--)[^-]/.test(args[i + 1]) && !flags.bools[key] && (!aliases[key] || !aliasIsBoolean(key)) ? (setArg(key, args[i + 1], arg), i += 1) : args[i + 1] && /^(true|false)$/.test(args[i + 1]) ? (setArg(key, args[i + 1] === "true", arg), i += 1) : setArg(key, flags.strings[key] ? "" : !0, arg));
|
|
1389
|
+
} else if ((!flags.unknownFn || flags.unknownFn(arg) !== !1) && argv._.push(flags.strings._ || !isNumber(arg) ? arg : Number(arg)), opts.stopEarly) {
|
|
1390
|
+
argv._.push.apply(argv._, args.slice(i + 1));
|
|
1391
|
+
break;
|
|
1392
|
+
}
|
|
1393
|
+
}
|
|
1394
|
+
return Object.keys(defaults).forEach(function(k) {
|
|
1395
|
+
hasKey(argv, k.split(".")) || (setKey(argv, k.split("."), defaults[k]), (aliases[k] || []).forEach(function(x) {
|
|
1396
|
+
setKey(argv, x.split("."), defaults[k]);
|
|
1397
|
+
}));
|
|
1398
|
+
}), opts["--"] ? argv["--"] = notFlags.slice() : notFlags.forEach(function(k) {
|
|
1399
|
+
argv._.push(k);
|
|
1400
|
+
}), argv;
|
|
1401
|
+
};
|
|
1402
|
+
}
|
|
1403
|
+
});
|
|
1404
|
+
|
|
1405
|
+
// ../../../node_modules/tsconfig-paths/lib/register.js
|
|
1406
|
+
var require_register = __commonJS({
|
|
1407
|
+
"../../../node_modules/tsconfig-paths/lib/register.js"(exports) {
|
|
1408
|
+
"use strict";
|
|
1409
|
+
var __spreadArray = exports && exports.__spreadArray || function(to, from, pack) {
|
|
1410
|
+
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++)
|
|
1411
|
+
(ar || !(i in from)) && (ar || (ar = Array.prototype.slice.call(from, 0, i)), ar[i] = from[i]);
|
|
1412
|
+
return to.concat(ar || Array.prototype.slice.call(from));
|
|
1413
|
+
};
|
|
1414
|
+
Object.defineProperty(exports, "__esModule", { value: !0 });
|
|
1415
|
+
exports.register = void 0;
|
|
1416
|
+
var match_path_sync_1 = require_match_path_sync(), config_loader_1 = require_config_loader(), noOp = function() {
|
|
1417
|
+
};
|
|
1418
|
+
function getCoreModules(builtinModules) {
|
|
1419
|
+
builtinModules = builtinModules || [
|
|
1420
|
+
"assert",
|
|
1421
|
+
"buffer",
|
|
1422
|
+
"child_process",
|
|
1423
|
+
"cluster",
|
|
1424
|
+
"crypto",
|
|
1425
|
+
"dgram",
|
|
1426
|
+
"dns",
|
|
1427
|
+
"domain",
|
|
1428
|
+
"events",
|
|
1429
|
+
"fs",
|
|
1430
|
+
"http",
|
|
1431
|
+
"https",
|
|
1432
|
+
"net",
|
|
1433
|
+
"os",
|
|
1434
|
+
"path",
|
|
1435
|
+
"punycode",
|
|
1436
|
+
"querystring",
|
|
1437
|
+
"readline",
|
|
1438
|
+
"stream",
|
|
1439
|
+
"string_decoder",
|
|
1440
|
+
"tls",
|
|
1441
|
+
"tty",
|
|
1442
|
+
"url",
|
|
1443
|
+
"util",
|
|
1444
|
+
"v8",
|
|
1445
|
+
"vm",
|
|
1446
|
+
"zlib"
|
|
1447
|
+
];
|
|
1448
|
+
for (var coreModules = {}, _i = 0, builtinModules_1 = builtinModules; _i < builtinModules_1.length; _i++) {
|
|
1449
|
+
var module_1 = builtinModules_1[_i];
|
|
1450
|
+
coreModules[module_1] = !0;
|
|
1451
|
+
}
|
|
1452
|
+
return coreModules;
|
|
1453
|
+
}
|
|
1454
|
+
function register(params) {
|
|
1455
|
+
var cwd, explicitParams;
|
|
1456
|
+
if (params)
|
|
1457
|
+
cwd = params.cwd, (params.baseUrl || params.paths) && (explicitParams = params);
|
|
1458
|
+
else {
|
|
1459
|
+
var minimist = require_minimist(), argv = minimist(process.argv.slice(2), {
|
|
1460
|
+
// eslint-disable-next-line id-denylist
|
|
1461
|
+
string: ["project"],
|
|
1462
|
+
alias: {
|
|
1463
|
+
project: ["P"]
|
|
1464
|
+
}
|
|
1465
|
+
});
|
|
1466
|
+
cwd = argv.project;
|
|
1467
|
+
}
|
|
1468
|
+
var configLoaderResult = (0, config_loader_1.configLoader)({
|
|
1469
|
+
cwd: cwd ?? process.cwd(),
|
|
1470
|
+
explicitParams
|
|
1471
|
+
});
|
|
1472
|
+
if (configLoaderResult.resultType === "failed")
|
|
1473
|
+
return console.warn("".concat(configLoaderResult.message, ". tsconfig-paths will be skipped")), noOp;
|
|
1474
|
+
var matchPath = (0, match_path_sync_1.createMatchPath)(configLoaderResult.absoluteBaseUrl, configLoaderResult.paths, configLoaderResult.mainFields, configLoaderResult.addMatchAll), Module = __require("module"), originalResolveFilename = Module._resolveFilename, coreModules = getCoreModules(Module.builtinModules);
|
|
1475
|
+
return Module._resolveFilename = function(request, _parent) {
|
|
1476
|
+
var isCoreModule = coreModules.hasOwnProperty(request);
|
|
1477
|
+
if (!isCoreModule) {
|
|
1478
|
+
var found = matchPath(request);
|
|
1479
|
+
if (found) {
|
|
1480
|
+
var modifiedArguments = __spreadArray([found], [].slice.call(arguments, 1), !0);
|
|
1481
|
+
return originalResolveFilename.apply(this, modifiedArguments);
|
|
1482
|
+
}
|
|
1483
|
+
}
|
|
1484
|
+
return originalResolveFilename.apply(this, arguments);
|
|
1485
|
+
}, function() {
|
|
1486
|
+
Module._resolveFilename = originalResolveFilename;
|
|
1487
|
+
};
|
|
1488
|
+
}
|
|
1489
|
+
exports.register = register;
|
|
1490
|
+
}
|
|
1491
|
+
});
|
|
1492
|
+
|
|
1493
|
+
// ../../../node_modules/tsconfig-paths/lib/index.js
|
|
1494
|
+
var require_lib2 = __commonJS({
|
|
1495
|
+
"../../../node_modules/tsconfig-paths/lib/index.js"(exports) {
|
|
1496
|
+
"use strict";
|
|
1497
|
+
Object.defineProperty(exports, "__esModule", { value: !0 });
|
|
1498
|
+
exports.loadConfig = exports.register = exports.matchFromAbsolutePathsAsync = exports.createMatchPathAsync = exports.matchFromAbsolutePaths = exports.createMatchPath = void 0;
|
|
1499
|
+
var match_path_sync_1 = require_match_path_sync();
|
|
1500
|
+
Object.defineProperty(exports, "createMatchPath", { enumerable: !0, get: function() {
|
|
1501
|
+
return match_path_sync_1.createMatchPath;
|
|
1502
|
+
} });
|
|
1503
|
+
Object.defineProperty(exports, "matchFromAbsolutePaths", { enumerable: !0, get: function() {
|
|
1504
|
+
return match_path_sync_1.matchFromAbsolutePaths;
|
|
1505
|
+
} });
|
|
1506
|
+
var match_path_async_1 = require_match_path_async();
|
|
1507
|
+
Object.defineProperty(exports, "createMatchPathAsync", { enumerable: !0, get: function() {
|
|
1508
|
+
return match_path_async_1.createMatchPathAsync;
|
|
1509
|
+
} });
|
|
1510
|
+
Object.defineProperty(exports, "matchFromAbsolutePathsAsync", { enumerable: !0, get: function() {
|
|
1511
|
+
return match_path_async_1.matchFromAbsolutePathsAsync;
|
|
1512
|
+
} });
|
|
1513
|
+
var register_1 = require_register();
|
|
1514
|
+
Object.defineProperty(exports, "register", { enumerable: !0, get: function() {
|
|
1515
|
+
return register_1.register;
|
|
1516
|
+
} });
|
|
1517
|
+
var config_loader_1 = require_config_loader();
|
|
1518
|
+
Object.defineProperty(exports, "loadConfig", { enumerable: !0, get: function() {
|
|
1519
|
+
return config_loader_1.loadConfig;
|
|
1520
|
+
} });
|
|
1521
|
+
}
|
|
1522
|
+
});
|
|
1523
|
+
|
|
1524
|
+
// ../../../node_modules/resolve/lib/homedir.js
|
|
1525
|
+
var require_homedir = __commonJS({
|
|
1526
|
+
"../../../node_modules/resolve/lib/homedir.js"(exports, module) {
|
|
1527
|
+
"use strict";
|
|
1528
|
+
var os = __require("os");
|
|
1529
|
+
module.exports = os.homedir || function() {
|
|
1530
|
+
var home = process.env.HOME, user = process.env.LOGNAME || process.env.USER || process.env.LNAME || process.env.USERNAME;
|
|
1531
|
+
return process.platform === "win32" ? process.env.USERPROFILE || process.env.HOMEDRIVE && process.env.HOMEPATH && process.env.HOMEDRIVE + process.env.HOMEPATH || home || null : process.platform === "darwin" ? home || (user ? "/Users/" + user : null) : process.platform === "linux" ? home || (process.getuid() === 0 ? "/root" : user ? "/home/" + user : null) : home || null;
|
|
1532
|
+
};
|
|
1533
|
+
}
|
|
1534
|
+
});
|
|
1535
|
+
|
|
1536
|
+
// ../../../node_modules/es-errors/index.js
|
|
1537
|
+
var require_es_errors = __commonJS({
|
|
1538
|
+
"../../../node_modules/es-errors/index.js"(exports, module) {
|
|
1539
|
+
"use strict";
|
|
1540
|
+
module.exports = Error;
|
|
1541
|
+
}
|
|
1542
|
+
});
|
|
1543
|
+
|
|
1544
|
+
// ../../../node_modules/resolve/lib/caller.js
|
|
1545
|
+
var require_caller = __commonJS({
|
|
1546
|
+
"../../../node_modules/resolve/lib/caller.js"(exports, module) {
|
|
1547
|
+
"use strict";
|
|
1548
|
+
var $Error = require_es_errors();
|
|
1549
|
+
module.exports = function() {
|
|
1550
|
+
var origPrepareStackTrace = $Error.prepareStackTrace;
|
|
1551
|
+
$Error.prepareStackTrace = function(_, stack2) {
|
|
1552
|
+
return stack2;
|
|
1553
|
+
};
|
|
1554
|
+
var stack = new $Error().stack;
|
|
1555
|
+
return $Error.prepareStackTrace = origPrepareStackTrace, stack[2].getFileName();
|
|
1556
|
+
};
|
|
1557
|
+
}
|
|
1558
|
+
});
|
|
1559
|
+
|
|
1560
|
+
// ../../../node_modules/path-parse/index.js
|
|
1561
|
+
var require_path_parse = __commonJS({
|
|
1562
|
+
"../../../node_modules/path-parse/index.js"(exports, module) {
|
|
1563
|
+
"use strict";
|
|
1564
|
+
var isWindows = process.platform === "win32", splitWindowsRe = /^(((?:[a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/]+[^\\\/]+)?[\\\/]?)(?:[^\\\/]*[\\\/])*)((\.{1,2}|[^\\\/]+?|)(\.[^.\/\\]*|))[\\\/]*$/, win32 = {};
|
|
1565
|
+
function win32SplitPath(filename) {
|
|
1566
|
+
return splitWindowsRe.exec(filename).slice(1);
|
|
1567
|
+
}
|
|
1568
|
+
win32.parse = function(pathString) {
|
|
1569
|
+
if (typeof pathString != "string")
|
|
1570
|
+
throw new TypeError(
|
|
1571
|
+
"Parameter 'pathString' must be a string, not " + typeof pathString
|
|
1572
|
+
);
|
|
1573
|
+
var allParts = win32SplitPath(pathString);
|
|
1574
|
+
if (!allParts || allParts.length !== 5)
|
|
1575
|
+
throw new TypeError("Invalid path '" + pathString + "'");
|
|
1576
|
+
return {
|
|
1577
|
+
root: allParts[1],
|
|
1578
|
+
dir: allParts[0] === allParts[1] ? allParts[0] : allParts[0].slice(0, -1),
|
|
1579
|
+
base: allParts[2],
|
|
1580
|
+
ext: allParts[4],
|
|
1581
|
+
name: allParts[3]
|
|
1582
|
+
};
|
|
1583
|
+
};
|
|
1584
|
+
var splitPathRe = /^((\/?)(?:[^\/]*\/)*)((\.{1,2}|[^\/]+?|)(\.[^.\/]*|))[\/]*$/, posix = {};
|
|
1585
|
+
function posixSplitPath(filename) {
|
|
1586
|
+
return splitPathRe.exec(filename).slice(1);
|
|
1587
|
+
}
|
|
1588
|
+
posix.parse = function(pathString) {
|
|
1589
|
+
if (typeof pathString != "string")
|
|
1590
|
+
throw new TypeError(
|
|
1591
|
+
"Parameter 'pathString' must be a string, not " + typeof pathString
|
|
1592
|
+
);
|
|
1593
|
+
var allParts = posixSplitPath(pathString);
|
|
1594
|
+
if (!allParts || allParts.length !== 5)
|
|
1595
|
+
throw new TypeError("Invalid path '" + pathString + "'");
|
|
1596
|
+
return {
|
|
1597
|
+
root: allParts[1],
|
|
1598
|
+
dir: allParts[0].slice(0, -1),
|
|
1599
|
+
base: allParts[2],
|
|
1600
|
+
ext: allParts[4],
|
|
1601
|
+
name: allParts[3]
|
|
1602
|
+
};
|
|
1603
|
+
};
|
|
1604
|
+
isWindows ? module.exports = win32.parse : module.exports = posix.parse;
|
|
1605
|
+
module.exports.posix = posix.parse;
|
|
1606
|
+
module.exports.win32 = win32.parse;
|
|
1607
|
+
}
|
|
1608
|
+
});
|
|
1609
|
+
|
|
1610
|
+
// ../../../node_modules/resolve/lib/node-modules-paths.js
|
|
1611
|
+
var require_node_modules_paths = __commonJS({
|
|
1612
|
+
"../../../node_modules/resolve/lib/node-modules-paths.js"(exports, module) {
|
|
1613
|
+
var path = __require("path"), parse2 = path.parse || require_path_parse(), driveLetterRegex = /^([A-Za-z]:)/, uncPathRegex = /^\\\\/;
|
|
1614
|
+
function getNodeModulesDirs(absoluteStart, modules) {
|
|
1615
|
+
var prefix = "/";
|
|
1616
|
+
driveLetterRegex.test(absoluteStart) ? prefix = "" : uncPathRegex.test(absoluteStart) && (prefix = "\\\\");
|
|
1617
|
+
for (var paths = [absoluteStart], parsed = parse2(absoluteStart); parsed.dir !== paths[paths.length - 1]; )
|
|
1618
|
+
paths.push(parsed.dir), parsed = parse2(parsed.dir);
|
|
1619
|
+
return paths.reduce(function(dirs, aPath) {
|
|
1620
|
+
return dirs.concat(modules.map(function(moduleDir) {
|
|
1621
|
+
return path.resolve(prefix, aPath, moduleDir);
|
|
1622
|
+
}));
|
|
1623
|
+
}, []);
|
|
1624
|
+
}
|
|
1625
|
+
module.exports = function(start, opts, request) {
|
|
1626
|
+
var modules = opts && opts.moduleDirectory ? [].concat(opts.moduleDirectory) : ["node_modules"];
|
|
1627
|
+
if (opts && typeof opts.paths == "function")
|
|
1628
|
+
return opts.paths(
|
|
1629
|
+
request,
|
|
1630
|
+
start,
|
|
1631
|
+
function() {
|
|
1632
|
+
return getNodeModulesDirs(start, modules);
|
|
1633
|
+
},
|
|
1634
|
+
opts
|
|
1635
|
+
);
|
|
1636
|
+
var dirs = getNodeModulesDirs(start, modules);
|
|
1637
|
+
return opts && opts.paths ? dirs.concat(opts.paths) : dirs;
|
|
1638
|
+
};
|
|
1639
|
+
}
|
|
1640
|
+
});
|
|
1641
|
+
|
|
1642
|
+
// ../../../node_modules/resolve/lib/normalize-options.js
|
|
1643
|
+
var require_normalize_options = __commonJS({
|
|
1644
|
+
"../../../node_modules/resolve/lib/normalize-options.js"(exports, module) {
|
|
1645
|
+
var path = __require("path");
|
|
1646
|
+
module.exports = function(_, opts) {
|
|
1647
|
+
if (opts = opts || {}, opts.forceNodeResolution || !process.versions.pnp)
|
|
1648
|
+
return opts;
|
|
1649
|
+
let { findPnpApi } = __require("module"), runPnpResolution = (request, basedir) => {
|
|
1650
|
+
let parts = request.match(/^((?:@[^/]+\/)?[^/]+)(\/.*)?/);
|
|
1651
|
+
if (!parts)
|
|
1652
|
+
throw new Error(`Assertion failed: Expected the "resolve" package to call the "paths" callback with package names only (got "${request}")`);
|
|
1653
|
+
basedir.charAt(basedir.length - 1) !== "/" && (basedir = path.join(basedir, "/"));
|
|
1654
|
+
let api = findPnpApi(basedir);
|
|
1655
|
+
if (api === null)
|
|
1656
|
+
return;
|
|
1657
|
+
let manifestPath;
|
|
1658
|
+
try {
|
|
1659
|
+
manifestPath = api.resolveToUnqualified(`${parts[1]}/package.json`, basedir, { considerBuiltins: !1 });
|
|
1660
|
+
} catch {
|
|
1661
|
+
return null;
|
|
1662
|
+
}
|
|
1663
|
+
if (manifestPath === null)
|
|
1664
|
+
throw new Error(`Assertion failed: The resolution thinks that "${parts[1]}" is a Node builtin`);
|
|
1665
|
+
let packagePath = path.dirname(manifestPath), unqualifiedPath = typeof parts[2] < "u" ? path.join(packagePath, parts[2]) : packagePath;
|
|
1666
|
+
return { packagePath, unqualifiedPath };
|
|
1667
|
+
}, runPnpResolutionOnArray = (request, paths2) => {
|
|
1668
|
+
for (let i = 0; i < paths2.length; i++) {
|
|
1669
|
+
let resolution = runPnpResolution(request, paths2[i]);
|
|
1670
|
+
if (resolution || i === paths2.length - 1)
|
|
1671
|
+
return resolution;
|
|
1672
|
+
}
|
|
1673
|
+
return null;
|
|
1674
|
+
}, originalPaths = Array.isArray(opts.paths) ? opts.paths : [], packageIterator = (request, basedir, getCandidates, opts2) => {
|
|
1675
|
+
let pathsToTest = [basedir].concat(originalPaths), resolution = runPnpResolutionOnArray(request, pathsToTest);
|
|
1676
|
+
return resolution == null ? getCandidates() : [resolution.unqualifiedPath];
|
|
1677
|
+
}, paths = (request, basedir, getNodeModulePaths, opts2) => {
|
|
1678
|
+
let pathsToTest = [basedir].concat(originalPaths), resolution = runPnpResolutionOnArray(request, pathsToTest);
|
|
1679
|
+
if (resolution == null)
|
|
1680
|
+
return getNodeModulePaths().concat(originalPaths);
|
|
1681
|
+
let nodeModules = path.dirname(resolution.packagePath);
|
|
1682
|
+
return request.match(/^@[^/]+\//) && (nodeModules = path.dirname(nodeModules)), [nodeModules];
|
|
1683
|
+
}, isInsideIterator = !1;
|
|
1684
|
+
return opts.__skipPackageIterator || (opts.packageIterator = function(request, basedir, getCandidates, opts2) {
|
|
1685
|
+
isInsideIterator = !0;
|
|
1686
|
+
try {
|
|
1687
|
+
return packageIterator(request, basedir, getCandidates, opts2);
|
|
1688
|
+
} finally {
|
|
1689
|
+
isInsideIterator = !1;
|
|
1690
|
+
}
|
|
1691
|
+
}), opts.paths = function(request, basedir, getNodeModulePaths, opts2) {
|
|
1692
|
+
return isInsideIterator ? getNodeModulePaths().concat(originalPaths) : paths(request, basedir, getNodeModulePaths, opts2);
|
|
1693
|
+
}, opts;
|
|
1694
|
+
};
|
|
1695
|
+
}
|
|
1696
|
+
});
|
|
1697
|
+
|
|
1698
|
+
// ../../../node_modules/function-bind/implementation.js
|
|
1699
|
+
var require_implementation = __commonJS({
|
|
1700
|
+
"../../../node_modules/function-bind/implementation.js"(exports, module) {
|
|
1701
|
+
"use strict";
|
|
1702
|
+
var ERROR_MESSAGE = "Function.prototype.bind called on incompatible ", toStr = Object.prototype.toString, max = Math.max, funcType = "[object Function]", concatty = function(a, b) {
|
|
1703
|
+
for (var arr = [], i = 0; i < a.length; i += 1)
|
|
1704
|
+
arr[i] = a[i];
|
|
1705
|
+
for (var j = 0; j < b.length; j += 1)
|
|
1706
|
+
arr[j + a.length] = b[j];
|
|
1707
|
+
return arr;
|
|
1708
|
+
}, slicy = function(arrLike, offset) {
|
|
1709
|
+
for (var arr = [], i = offset || 0, j = 0; i < arrLike.length; i += 1, j += 1)
|
|
1710
|
+
arr[j] = arrLike[i];
|
|
1711
|
+
return arr;
|
|
1712
|
+
}, joiny = function(arr, joiner) {
|
|
1713
|
+
for (var str = "", i = 0; i < arr.length; i += 1)
|
|
1714
|
+
str += arr[i], i + 1 < arr.length && (str += joiner);
|
|
1715
|
+
return str;
|
|
1716
|
+
};
|
|
1717
|
+
module.exports = function(that) {
|
|
1718
|
+
var target = this;
|
|
1719
|
+
if (typeof target != "function" || toStr.apply(target) !== funcType)
|
|
1720
|
+
throw new TypeError(ERROR_MESSAGE + target);
|
|
1721
|
+
for (var args = slicy(arguments, 1), bound, binder = function() {
|
|
1722
|
+
if (this instanceof bound) {
|
|
1723
|
+
var result = target.apply(
|
|
1724
|
+
this,
|
|
1725
|
+
concatty(args, arguments)
|
|
1726
|
+
);
|
|
1727
|
+
return Object(result) === result ? result : this;
|
|
1728
|
+
}
|
|
1729
|
+
return target.apply(
|
|
1730
|
+
that,
|
|
1731
|
+
concatty(args, arguments)
|
|
1732
|
+
);
|
|
1733
|
+
}, boundLength = max(0, target.length - args.length), boundArgs = [], i = 0; i < boundLength; i++)
|
|
1734
|
+
boundArgs[i] = "$" + i;
|
|
1735
|
+
if (bound = Function("binder", "return function (" + joiny(boundArgs, ",") + "){ return binder.apply(this,arguments); }")(binder), target.prototype) {
|
|
1736
|
+
var Empty = function() {
|
|
1737
|
+
};
|
|
1738
|
+
Empty.prototype = target.prototype, bound.prototype = new Empty(), Empty.prototype = null;
|
|
1739
|
+
}
|
|
1740
|
+
return bound;
|
|
1741
|
+
};
|
|
1742
|
+
}
|
|
1743
|
+
});
|
|
1744
|
+
|
|
1745
|
+
// ../../../node_modules/function-bind/index.js
|
|
1746
|
+
var require_function_bind = __commonJS({
|
|
1747
|
+
"../../../node_modules/function-bind/index.js"(exports, module) {
|
|
1748
|
+
"use strict";
|
|
1749
|
+
var implementation = require_implementation();
|
|
1750
|
+
module.exports = Function.prototype.bind || implementation;
|
|
1751
|
+
}
|
|
1752
|
+
});
|
|
1753
|
+
|
|
1754
|
+
// ../../../node_modules/hasown/index.js
|
|
1755
|
+
var require_hasown = __commonJS({
|
|
1756
|
+
"../../../node_modules/hasown/index.js"(exports, module) {
|
|
1757
|
+
"use strict";
|
|
1758
|
+
var call = Function.prototype.call, $hasOwn = Object.prototype.hasOwnProperty, bind = require_function_bind();
|
|
1759
|
+
module.exports = bind.call(call, $hasOwn);
|
|
1760
|
+
}
|
|
1761
|
+
});
|
|
1762
|
+
|
|
1763
|
+
// ../../../node_modules/is-core-module/core.json
|
|
1764
|
+
var require_core = __commonJS({
|
|
1765
|
+
"../../../node_modules/is-core-module/core.json"(exports, module) {
|
|
1766
|
+
module.exports = {
|
|
1767
|
+
assert: !0,
|
|
1768
|
+
"node:assert": [">= 14.18 && < 15", ">= 16"],
|
|
1769
|
+
"assert/strict": ">= 15",
|
|
1770
|
+
"node:assert/strict": ">= 16",
|
|
1771
|
+
async_hooks: ">= 8",
|
|
1772
|
+
"node:async_hooks": [">= 14.18 && < 15", ">= 16"],
|
|
1773
|
+
buffer_ieee754: ">= 0.5 && < 0.9.7",
|
|
1774
|
+
buffer: !0,
|
|
1775
|
+
"node:buffer": [">= 14.18 && < 15", ">= 16"],
|
|
1776
|
+
child_process: !0,
|
|
1777
|
+
"node:child_process": [">= 14.18 && < 15", ">= 16"],
|
|
1778
|
+
cluster: ">= 0.5",
|
|
1779
|
+
"node:cluster": [">= 14.18 && < 15", ">= 16"],
|
|
1780
|
+
console: !0,
|
|
1781
|
+
"node:console": [">= 14.18 && < 15", ">= 16"],
|
|
1782
|
+
constants: !0,
|
|
1783
|
+
"node:constants": [">= 14.18 && < 15", ">= 16"],
|
|
1784
|
+
crypto: !0,
|
|
1785
|
+
"node:crypto": [">= 14.18 && < 15", ">= 16"],
|
|
1786
|
+
_debug_agent: ">= 1 && < 8",
|
|
1787
|
+
_debugger: "< 8",
|
|
1788
|
+
dgram: !0,
|
|
1789
|
+
"node:dgram": [">= 14.18 && < 15", ">= 16"],
|
|
1790
|
+
diagnostics_channel: [">= 14.17 && < 15", ">= 15.1"],
|
|
1791
|
+
"node:diagnostics_channel": [">= 14.18 && < 15", ">= 16"],
|
|
1792
|
+
dns: !0,
|
|
1793
|
+
"node:dns": [">= 14.18 && < 15", ">= 16"],
|
|
1794
|
+
"dns/promises": ">= 15",
|
|
1795
|
+
"node:dns/promises": ">= 16",
|
|
1796
|
+
domain: ">= 0.7.12",
|
|
1797
|
+
"node:domain": [">= 14.18 && < 15", ">= 16"],
|
|
1798
|
+
events: !0,
|
|
1799
|
+
"node:events": [">= 14.18 && < 15", ">= 16"],
|
|
1800
|
+
freelist: "< 6",
|
|
1801
|
+
fs: !0,
|
|
1802
|
+
"node:fs": [">= 14.18 && < 15", ">= 16"],
|
|
1803
|
+
"fs/promises": [">= 10 && < 10.1", ">= 14"],
|
|
1804
|
+
"node:fs/promises": [">= 14.18 && < 15", ">= 16"],
|
|
1805
|
+
_http_agent: ">= 0.11.1",
|
|
1806
|
+
"node:_http_agent": [">= 14.18 && < 15", ">= 16"],
|
|
1807
|
+
_http_client: ">= 0.11.1",
|
|
1808
|
+
"node:_http_client": [">= 14.18 && < 15", ">= 16"],
|
|
1809
|
+
_http_common: ">= 0.11.1",
|
|
1810
|
+
"node:_http_common": [">= 14.18 && < 15", ">= 16"],
|
|
1811
|
+
_http_incoming: ">= 0.11.1",
|
|
1812
|
+
"node:_http_incoming": [">= 14.18 && < 15", ">= 16"],
|
|
1813
|
+
_http_outgoing: ">= 0.11.1",
|
|
1814
|
+
"node:_http_outgoing": [">= 14.18 && < 15", ">= 16"],
|
|
1815
|
+
_http_server: ">= 0.11.1",
|
|
1816
|
+
"node:_http_server": [">= 14.18 && < 15", ">= 16"],
|
|
1817
|
+
http: !0,
|
|
1818
|
+
"node:http": [">= 14.18 && < 15", ">= 16"],
|
|
1819
|
+
http2: ">= 8.8",
|
|
1820
|
+
"node:http2": [">= 14.18 && < 15", ">= 16"],
|
|
1821
|
+
https: !0,
|
|
1822
|
+
"node:https": [">= 14.18 && < 15", ">= 16"],
|
|
1823
|
+
inspector: ">= 8",
|
|
1824
|
+
"node:inspector": [">= 14.18 && < 15", ">= 16"],
|
|
1825
|
+
"inspector/promises": [">= 19"],
|
|
1826
|
+
"node:inspector/promises": [">= 19"],
|
|
1827
|
+
_linklist: "< 8",
|
|
1828
|
+
module: !0,
|
|
1829
|
+
"node:module": [">= 14.18 && < 15", ">= 16"],
|
|
1830
|
+
net: !0,
|
|
1831
|
+
"node:net": [">= 14.18 && < 15", ">= 16"],
|
|
1832
|
+
"node-inspect/lib/_inspect": ">= 7.6 && < 12",
|
|
1833
|
+
"node-inspect/lib/internal/inspect_client": ">= 7.6 && < 12",
|
|
1834
|
+
"node-inspect/lib/internal/inspect_repl": ">= 7.6 && < 12",
|
|
1835
|
+
os: !0,
|
|
1836
|
+
"node:os": [">= 14.18 && < 15", ">= 16"],
|
|
1837
|
+
path: !0,
|
|
1838
|
+
"node:path": [">= 14.18 && < 15", ">= 16"],
|
|
1839
|
+
"path/posix": ">= 15.3",
|
|
1840
|
+
"node:path/posix": ">= 16",
|
|
1841
|
+
"path/win32": ">= 15.3",
|
|
1842
|
+
"node:path/win32": ">= 16",
|
|
1843
|
+
perf_hooks: ">= 8.5",
|
|
1844
|
+
"node:perf_hooks": [">= 14.18 && < 15", ">= 16"],
|
|
1845
|
+
process: ">= 1",
|
|
1846
|
+
"node:process": [">= 14.18 && < 15", ">= 16"],
|
|
1847
|
+
punycode: ">= 0.5",
|
|
1848
|
+
"node:punycode": [">= 14.18 && < 15", ">= 16"],
|
|
1849
|
+
querystring: !0,
|
|
1850
|
+
"node:querystring": [">= 14.18 && < 15", ">= 16"],
|
|
1851
|
+
readline: !0,
|
|
1852
|
+
"node:readline": [">= 14.18 && < 15", ">= 16"],
|
|
1853
|
+
"readline/promises": ">= 17",
|
|
1854
|
+
"node:readline/promises": ">= 17",
|
|
1855
|
+
repl: !0,
|
|
1856
|
+
"node:repl": [">= 14.18 && < 15", ">= 16"],
|
|
1857
|
+
"node:sea": [">= 20.12 && < 21", ">= 21.7"],
|
|
1858
|
+
smalloc: ">= 0.11.5 && < 3",
|
|
1859
|
+
"node:sqlite": [">= 22.13 && < 23", ">= 23.4"],
|
|
1860
|
+
_stream_duplex: ">= 0.9.4 && < 26",
|
|
1861
|
+
"node:_stream_duplex": [">= 14.18 && < 15", ">= 16 && < 26"],
|
|
1862
|
+
_stream_transform: ">= 0.9.4 && < 26",
|
|
1863
|
+
"node:_stream_transform": [">= 14.18 && < 15", ">= 16 && < 26"],
|
|
1864
|
+
_stream_wrap: ">= 1.4.1 && < 26",
|
|
1865
|
+
"node:_stream_wrap": [">= 14.18 && < 15", ">= 16 && < 26"],
|
|
1866
|
+
_stream_passthrough: ">= 0.9.4 && < 26",
|
|
1867
|
+
"node:_stream_passthrough": [">= 14.18 && < 15", ">= 16 && < 26"],
|
|
1868
|
+
_stream_readable: ">= 0.9.4 && < 26",
|
|
1869
|
+
"node:_stream_readable": [">= 14.18 && < 15", ">= 16 && < 26"],
|
|
1870
|
+
_stream_writable: ">= 0.9.4 && < 26",
|
|
1871
|
+
"node:_stream_writable": [">= 14.18 && < 15", ">= 16 && < 26"],
|
|
1872
|
+
stream: !0,
|
|
1873
|
+
"node:stream": [">= 14.18 && < 15", ">= 16"],
|
|
1874
|
+
"stream/consumers": ">= 16.7",
|
|
1875
|
+
"node:stream/consumers": ">= 16.7",
|
|
1876
|
+
"stream/promises": ">= 15",
|
|
1877
|
+
"node:stream/promises": ">= 16",
|
|
1878
|
+
"stream/web": ">= 16.5",
|
|
1879
|
+
"node:stream/web": ">= 16.5",
|
|
1880
|
+
string_decoder: !0,
|
|
1881
|
+
"node:string_decoder": [">= 14.18 && < 15", ">= 16"],
|
|
1882
|
+
sys: [">= 0.4 && < 0.7", ">= 0.8"],
|
|
1883
|
+
"node:sys": [">= 14.18 && < 15", ">= 16"],
|
|
1884
|
+
"test/reporters": ">= 19.9 && < 20.2",
|
|
1885
|
+
"node:test/reporters": [">= 18.17 && < 19", ">= 19.9", ">= 20"],
|
|
1886
|
+
"test/mock_loader": ">= 22.3 && < 22.7",
|
|
1887
|
+
"node:test/mock_loader": ">= 22.3 && < 22.7",
|
|
1888
|
+
"node:test": [">= 16.17 && < 17", ">= 18"],
|
|
1889
|
+
timers: !0,
|
|
1890
|
+
"node:timers": [">= 14.18 && < 15", ">= 16"],
|
|
1891
|
+
"timers/promises": ">= 15",
|
|
1892
|
+
"node:timers/promises": ">= 16",
|
|
1893
|
+
_tls_common: ">= 0.11.13",
|
|
1894
|
+
"node:_tls_common": [">= 14.18 && < 15", ">= 16"],
|
|
1895
|
+
_tls_legacy: ">= 0.11.3 && < 10",
|
|
1896
|
+
_tls_wrap: ">= 0.11.3",
|
|
1897
|
+
"node:_tls_wrap": [">= 14.18 && < 15", ">= 16"],
|
|
1898
|
+
tls: !0,
|
|
1899
|
+
"node:tls": [">= 14.18 && < 15", ">= 16"],
|
|
1900
|
+
trace_events: ">= 10",
|
|
1901
|
+
"node:trace_events": [">= 14.18 && < 15", ">= 16"],
|
|
1902
|
+
tty: !0,
|
|
1903
|
+
"node:tty": [">= 14.18 && < 15", ">= 16"],
|
|
1904
|
+
url: !0,
|
|
1905
|
+
"node:url": [">= 14.18 && < 15", ">= 16"],
|
|
1906
|
+
util: !0,
|
|
1907
|
+
"node:util": [">= 14.18 && < 15", ">= 16"],
|
|
1908
|
+
"util/types": ">= 15.3",
|
|
1909
|
+
"node:util/types": ">= 16",
|
|
1910
|
+
"v8/tools/arguments": ">= 10 && < 12",
|
|
1911
|
+
"v8/tools/codemap": [">= 4.4 && < 5", ">= 5.2 && < 12"],
|
|
1912
|
+
"v8/tools/consarray": [">= 4.4 && < 5", ">= 5.2 && < 12"],
|
|
1913
|
+
"v8/tools/csvparser": [">= 4.4 && < 5", ">= 5.2 && < 12"],
|
|
1914
|
+
"v8/tools/logreader": [">= 4.4 && < 5", ">= 5.2 && < 12"],
|
|
1915
|
+
"v8/tools/profile_view": [">= 4.4 && < 5", ">= 5.2 && < 12"],
|
|
1916
|
+
"v8/tools/splaytree": [">= 4.4 && < 5", ">= 5.2 && < 12"],
|
|
1917
|
+
v8: ">= 1",
|
|
1918
|
+
"node:v8": [">= 14.18 && < 15", ">= 16"],
|
|
1919
|
+
vm: !0,
|
|
1920
|
+
"node:vm": [">= 14.18 && < 15", ">= 16"],
|
|
1921
|
+
wasi: [">= 13.4 && < 13.5", ">= 18.17 && < 19", ">= 20"],
|
|
1922
|
+
"node:wasi": [">= 18.17 && < 19", ">= 20"],
|
|
1923
|
+
worker_threads: ">= 11.7",
|
|
1924
|
+
"node:worker_threads": [">= 14.18 && < 15", ">= 16"],
|
|
1925
|
+
zlib: ">= 0.5",
|
|
1926
|
+
"node:zlib": [">= 14.18 && < 15", ">= 16"]
|
|
1927
|
+
};
|
|
1928
|
+
}
|
|
1929
|
+
});
|
|
1930
|
+
|
|
1931
|
+
// ../../../node_modules/is-core-module/index.js
|
|
1932
|
+
var require_is_core_module = __commonJS({
|
|
1933
|
+
"../../../node_modules/is-core-module/index.js"(exports, module) {
|
|
1934
|
+
"use strict";
|
|
1935
|
+
var hasOwn = require_hasown();
|
|
1936
|
+
function specifierIncluded(current, specifier) {
|
|
1937
|
+
for (var nodeParts = current.split("."), parts = specifier.split(" "), op = parts.length > 1 ? parts[0] : "=", versionParts = (parts.length > 1 ? parts[1] : parts[0]).split("."), i = 0; i < 3; ++i) {
|
|
1938
|
+
var cur = parseInt(nodeParts[i] || 0, 10), ver = parseInt(versionParts[i] || 0, 10);
|
|
1939
|
+
if (cur !== ver)
|
|
1940
|
+
return op === "<" ? cur < ver : op === ">=" ? cur >= ver : !1;
|
|
1941
|
+
}
|
|
1942
|
+
return op === ">=";
|
|
1943
|
+
}
|
|
1944
|
+
function matchesRange(current, range) {
|
|
1945
|
+
var specifiers = range.split(/ ?&& ?/);
|
|
1946
|
+
if (specifiers.length === 0)
|
|
1947
|
+
return !1;
|
|
1948
|
+
for (var i = 0; i < specifiers.length; ++i)
|
|
1949
|
+
if (!specifierIncluded(current, specifiers[i]))
|
|
1950
|
+
return !1;
|
|
1951
|
+
return !0;
|
|
1952
|
+
}
|
|
1953
|
+
function versionIncluded(nodeVersion, specifierValue) {
|
|
1954
|
+
if (typeof specifierValue == "boolean")
|
|
1955
|
+
return specifierValue;
|
|
1956
|
+
var current = typeof nodeVersion > "u" ? process.versions && process.versions.node : nodeVersion;
|
|
1957
|
+
if (typeof current != "string")
|
|
1958
|
+
throw new TypeError(typeof nodeVersion > "u" ? "Unable to determine current node version" : "If provided, a valid node version is required");
|
|
1959
|
+
if (specifierValue && typeof specifierValue == "object") {
|
|
1960
|
+
for (var i = 0; i < specifierValue.length; ++i)
|
|
1961
|
+
if (matchesRange(current, specifierValue[i]))
|
|
1962
|
+
return !0;
|
|
1963
|
+
return !1;
|
|
1964
|
+
}
|
|
1965
|
+
return matchesRange(current, specifierValue);
|
|
1966
|
+
}
|
|
1967
|
+
var data = require_core();
|
|
1968
|
+
module.exports = function(x, nodeVersion) {
|
|
1969
|
+
return hasOwn(data, x) && versionIncluded(nodeVersion, data[x]);
|
|
1970
|
+
};
|
|
1971
|
+
}
|
|
1972
|
+
});
|
|
1973
|
+
|
|
1974
|
+
// ../../../node_modules/es-errors/type.js
|
|
1975
|
+
var require_type = __commonJS({
|
|
1976
|
+
"../../../node_modules/es-errors/type.js"(exports, module) {
|
|
1977
|
+
"use strict";
|
|
1978
|
+
module.exports = TypeError;
|
|
1979
|
+
}
|
|
1980
|
+
});
|
|
1981
|
+
|
|
1982
|
+
// ../../../node_modules/resolve/lib/async.js
|
|
1983
|
+
var require_async = __commonJS({
|
|
1984
|
+
"../../../node_modules/resolve/lib/async.js"(exports, module) {
|
|
1985
|
+
var fs = __require("fs"), getHomedir = require_homedir(), path = __require("path"), caller = require_caller(), nodeModulesPaths = require_node_modules_paths(), normalizeOptions = require_normalize_options(), isCore = require_is_core_module(), $Error = require_es_errors(), $TypeError = require_type(), realpathFS = process.platform !== "win32" && fs.realpath && typeof fs.realpath.native == "function" ? fs.realpath.native : fs.realpath, relativePathRegex = /^(?:\.\.?(?:\/|$)|\/|([A-Za-z]:)?[/\\])/, windowsDriveRegex = /^\w:[/\\]*$/, nodeModulesRegex = /[/\\]node_modules[/\\]*$/, homedir = getHomedir();
|
|
1986
|
+
function defaultPaths() {
|
|
1987
|
+
return homedir ? [
|
|
1988
|
+
path.join(homedir, ".node_modules"),
|
|
1989
|
+
path.join(homedir, ".node_libraries")
|
|
1990
|
+
] : [];
|
|
1991
|
+
}
|
|
1992
|
+
var defaultIsFile = function(file, cb) {
|
|
1993
|
+
fs.stat(file, function(err, stat) {
|
|
1994
|
+
return err ? err.code === "ENOENT" || err.code === "ENOTDIR" ? cb(null, !1) : cb(err) : cb(null, stat.isFile() || stat.isFIFO());
|
|
1995
|
+
});
|
|
1996
|
+
}, defaultIsDir = function(dir, cb) {
|
|
1997
|
+
fs.stat(dir, function(err, stat) {
|
|
1998
|
+
return err ? err.code === "ENOENT" || err.code === "ENOTDIR" ? cb(null, !1) : cb(err) : cb(null, stat.isDirectory());
|
|
1999
|
+
});
|
|
2000
|
+
}, defaultRealpath = function(x, cb) {
|
|
2001
|
+
realpathFS(x, function(realpathErr, realPath) {
|
|
2002
|
+
realpathErr && realpathErr.code !== "ENOENT" ? cb(realpathErr) : cb(null, realpathErr ? x : realPath);
|
|
2003
|
+
});
|
|
2004
|
+
};
|
|
2005
|
+
function maybeRealpath(realpath, x, opts, cb) {
|
|
2006
|
+
opts && opts.preserveSymlinks === !1 ? realpath(x, cb) : cb(null, x);
|
|
2007
|
+
}
|
|
2008
|
+
function defaultReadPackage(readFile, pkgfile, cb) {
|
|
2009
|
+
readFile(pkgfile, function(readFileErr, body) {
|
|
2010
|
+
if (readFileErr) cb(readFileErr);
|
|
2011
|
+
else
|
|
2012
|
+
try {
|
|
2013
|
+
var pkg = JSON.parse(body);
|
|
2014
|
+
cb(null, pkg);
|
|
2015
|
+
} catch {
|
|
2016
|
+
cb(null);
|
|
2017
|
+
}
|
|
2018
|
+
});
|
|
2019
|
+
}
|
|
2020
|
+
function getPackageCandidates(x, start, opts) {
|
|
2021
|
+
for (var dirs = nodeModulesPaths(start, opts, x), i = 0; i < dirs.length; i++)
|
|
2022
|
+
dirs[i] = path.join(dirs[i], x);
|
|
2023
|
+
return dirs;
|
|
2024
|
+
}
|
|
2025
|
+
module.exports = function(x, options, callback) {
|
|
2026
|
+
var cb = callback, opts = options;
|
|
2027
|
+
if (typeof options == "function" && (cb = opts, opts = {}), typeof x != "string") {
|
|
2028
|
+
var err = new $TypeError("Path must be a string.");
|
|
2029
|
+
return process.nextTick(function() {
|
|
2030
|
+
cb(err);
|
|
2031
|
+
});
|
|
2032
|
+
}
|
|
2033
|
+
opts = normalizeOptions(x, opts);
|
|
2034
|
+
var isFile = opts.isFile || defaultIsFile, isDirectory = opts.isDirectory || defaultIsDir, readFile = opts.readFile || fs.readFile, realpath = opts.realpath || defaultRealpath, readPackage = opts.readPackage || defaultReadPackage;
|
|
2035
|
+
if (opts.readFile && opts.readPackage) {
|
|
2036
|
+
var conflictErr = new $TypeError("`readFile` and `readPackage` are mutually exclusive.");
|
|
2037
|
+
return process.nextTick(function() {
|
|
2038
|
+
cb(conflictErr);
|
|
2039
|
+
});
|
|
2040
|
+
}
|
|
2041
|
+
var packageIterator = opts.packageIterator, extensions = opts.extensions || [".js"], includeCoreModules = opts.includeCoreModules !== !1, basedir = opts.basedir || path.dirname(caller()), parent = opts.filename || basedir;
|
|
2042
|
+
opts.paths = opts.paths || defaultPaths();
|
|
2043
|
+
var absoluteStart = path.resolve(basedir);
|
|
2044
|
+
maybeRealpath(
|
|
2045
|
+
realpath,
|
|
2046
|
+
absoluteStart,
|
|
2047
|
+
opts,
|
|
2048
|
+
function(err2, realStart) {
|
|
2049
|
+
err2 ? cb(err2) : init(realStart);
|
|
2050
|
+
}
|
|
2051
|
+
);
|
|
2052
|
+
var res;
|
|
2053
|
+
function init(basedir2) {
|
|
2054
|
+
if (relativePathRegex.test(x))
|
|
2055
|
+
res = path.resolve(basedir2, x), (x === "." || x === ".." || x.slice(-1) === "/") && (res += "/"), x.slice(-1) === "/" && res === basedir2 ? loadAsDirectory(res, opts.package, onfile) : loadAsFile(res, opts.package, onfile);
|
|
2056
|
+
else {
|
|
2057
|
+
if (includeCoreModules && isCore(x))
|
|
2058
|
+
return cb(null, x);
|
|
2059
|
+
loadNodeModules(x, basedir2, function(err2, n2, pkg) {
|
|
2060
|
+
if (err2) cb(err2);
|
|
2061
|
+
else {
|
|
2062
|
+
if (n2)
|
|
2063
|
+
return maybeRealpath(realpath, n2, opts, function(err3, realN) {
|
|
2064
|
+
err3 ? cb(err3) : cb(null, realN, pkg);
|
|
2065
|
+
});
|
|
2066
|
+
var moduleError = new $Error("Cannot find module '" + x + "' from '" + parent + "'");
|
|
2067
|
+
moduleError.code = "MODULE_NOT_FOUND", cb(moduleError);
|
|
2068
|
+
}
|
|
2069
|
+
});
|
|
2070
|
+
}
|
|
2071
|
+
}
|
|
2072
|
+
function onfile(err2, m, pkg) {
|
|
2073
|
+
err2 ? cb(err2) : m ? cb(null, m, pkg) : loadAsDirectory(res, function(err3, d, pkg2) {
|
|
2074
|
+
if (err3) cb(err3);
|
|
2075
|
+
else if (d)
|
|
2076
|
+
maybeRealpath(realpath, d, opts, function(err4, realD) {
|
|
2077
|
+
err4 ? cb(err4) : cb(null, realD, pkg2);
|
|
2078
|
+
});
|
|
2079
|
+
else {
|
|
2080
|
+
var moduleError = new $Error("Cannot find module '" + x + "' from '" + parent + "'");
|
|
2081
|
+
moduleError.code = "MODULE_NOT_FOUND", cb(moduleError);
|
|
2082
|
+
}
|
|
2083
|
+
});
|
|
2084
|
+
}
|
|
2085
|
+
function loadAsFile(x2, thePackage, callback2) {
|
|
2086
|
+
var loadAsFilePackage = thePackage, cb2 = callback2;
|
|
2087
|
+
typeof loadAsFilePackage == "function" && (cb2 = loadAsFilePackage, loadAsFilePackage = void 0);
|
|
2088
|
+
var exts = [""].concat(extensions);
|
|
2089
|
+
load(exts, x2, loadAsFilePackage);
|
|
2090
|
+
function load(exts2, x3, loadPackage) {
|
|
2091
|
+
if (exts2.length === 0) return cb2(null, void 0, loadPackage);
|
|
2092
|
+
var file = x3 + exts2[0], pkg = loadPackage;
|
|
2093
|
+
pkg ? onpkg(null, pkg) : loadpkg(path.dirname(file), onpkg);
|
|
2094
|
+
function onpkg(err2, pkg_, dir) {
|
|
2095
|
+
if (pkg = pkg_, err2) return cb2(err2);
|
|
2096
|
+
if (dir && pkg && opts.pathFilter) {
|
|
2097
|
+
var rfile = path.relative(dir, file), rel = rfile.slice(0, rfile.length - exts2[0].length), r = opts.pathFilter(pkg, x3, rel);
|
|
2098
|
+
if (r) return load(
|
|
2099
|
+
[""].concat(extensions),
|
|
2100
|
+
path.resolve(dir, r),
|
|
2101
|
+
pkg
|
|
2102
|
+
);
|
|
2103
|
+
}
|
|
2104
|
+
isFile(file, onex);
|
|
2105
|
+
}
|
|
2106
|
+
function onex(err2, ex) {
|
|
2107
|
+
if (err2) return cb2(err2);
|
|
2108
|
+
if (ex) return cb2(null, file, pkg);
|
|
2109
|
+
load(exts2.slice(1), x3, pkg);
|
|
2110
|
+
}
|
|
2111
|
+
}
|
|
2112
|
+
}
|
|
2113
|
+
function loadpkg(dir, cb2) {
|
|
2114
|
+
if (dir === "" || dir === "/" || process.platform === "win32" && windowsDriveRegex.test(dir) || nodeModulesRegex.test(dir)) return cb2(null);
|
|
2115
|
+
maybeRealpath(realpath, dir, opts, function(unwrapErr, pkgdir) {
|
|
2116
|
+
if (unwrapErr) return loadpkg(path.dirname(dir), cb2);
|
|
2117
|
+
var pkgfile = path.join(pkgdir, "package.json");
|
|
2118
|
+
isFile(pkgfile, function(err2, ex) {
|
|
2119
|
+
if (!ex) return loadpkg(path.dirname(dir), cb2);
|
|
2120
|
+
readPackage(readFile, pkgfile, function(err3, pkgParam) {
|
|
2121
|
+
if (err3)
|
|
2122
|
+
return cb2(err3);
|
|
2123
|
+
var pkg = pkgParam;
|
|
2124
|
+
pkg && opts.packageFilter && (pkg = opts.packageFilter(pkg, pkgfile)), cb2(null, pkg, dir);
|
|
2125
|
+
});
|
|
2126
|
+
});
|
|
2127
|
+
});
|
|
2128
|
+
}
|
|
2129
|
+
function loadAsDirectory(x2, loadAsDirectoryPackage, callback2) {
|
|
2130
|
+
var cb2 = callback2, fpkg = loadAsDirectoryPackage;
|
|
2131
|
+
typeof fpkg == "function" && (cb2 = fpkg, fpkg = opts.package), maybeRealpath(realpath, x2, opts, function(unwrapErr, pkgdir) {
|
|
2132
|
+
if (unwrapErr) return cb2(unwrapErr);
|
|
2133
|
+
var pkgfile = path.join(pkgdir, "package.json");
|
|
2134
|
+
isFile(pkgfile, function(err2, ex) {
|
|
2135
|
+
if (err2) return cb2(err2);
|
|
2136
|
+
if (!ex) return loadAsFile(path.join(x2, "index"), fpkg, cb2);
|
|
2137
|
+
readPackage(readFile, pkgfile, function(err3, pkgParam) {
|
|
2138
|
+
if (err3) return cb2(err3);
|
|
2139
|
+
var pkg = pkgParam;
|
|
2140
|
+
if (pkg && opts.packageFilter && (pkg = opts.packageFilter(pkg, pkgfile)), pkg && pkg.main) {
|
|
2141
|
+
if (typeof pkg.main != "string") {
|
|
2142
|
+
var mainError = new $TypeError("package \u201C" + pkg.name + "\u201D `main` must be a string");
|
|
2143
|
+
return mainError.code = "INVALID_PACKAGE_MAIN", cb2(mainError);
|
|
2144
|
+
}
|
|
2145
|
+
(pkg.main === "." || pkg.main === "./") && (pkg.main = "index"), loadAsFile(path.resolve(x2, pkg.main), pkg, function(err4, m, pkg2) {
|
|
2146
|
+
if (err4) return cb2(err4);
|
|
2147
|
+
if (m) return cb2(null, m, pkg2);
|
|
2148
|
+
if (!pkg2) return loadAsFile(path.join(x2, "index"), pkg2, cb2);
|
|
2149
|
+
var dir = path.resolve(x2, pkg2.main);
|
|
2150
|
+
loadAsDirectory(dir, pkg2, function(err5, n2, pkg3) {
|
|
2151
|
+
if (err5) return cb2(err5);
|
|
2152
|
+
if (n2) return cb2(null, n2, pkg3);
|
|
2153
|
+
loadAsFile(path.join(x2, "index"), pkg3, cb2);
|
|
2154
|
+
});
|
|
2155
|
+
});
|
|
2156
|
+
return;
|
|
2157
|
+
}
|
|
2158
|
+
loadAsFile(path.join(x2, "/index"), pkg, cb2);
|
|
2159
|
+
});
|
|
2160
|
+
});
|
|
2161
|
+
});
|
|
2162
|
+
}
|
|
2163
|
+
function processDirs(cb2, dirs) {
|
|
2164
|
+
if (dirs.length === 0) return cb2(null, void 0);
|
|
2165
|
+
var dir = dirs[0];
|
|
2166
|
+
isDirectory(path.dirname(dir), isdir);
|
|
2167
|
+
function isdir(err2, isdir2) {
|
|
2168
|
+
if (err2) return cb2(err2);
|
|
2169
|
+
if (!isdir2) return processDirs(cb2, dirs.slice(1));
|
|
2170
|
+
loadAsFile(dir, opts.package, onfile2);
|
|
2171
|
+
}
|
|
2172
|
+
function onfile2(err2, m, pkg) {
|
|
2173
|
+
if (err2) return cb2(err2);
|
|
2174
|
+
if (m) return cb2(null, m, pkg);
|
|
2175
|
+
loadAsDirectory(dir, opts.package, ondir);
|
|
2176
|
+
}
|
|
2177
|
+
function ondir(err2, n2, pkg) {
|
|
2178
|
+
if (err2) return cb2(err2);
|
|
2179
|
+
if (n2) return cb2(null, n2, pkg);
|
|
2180
|
+
processDirs(cb2, dirs.slice(1));
|
|
2181
|
+
}
|
|
2182
|
+
}
|
|
2183
|
+
function loadNodeModules(x2, start, cb2) {
|
|
2184
|
+
var thunk = function() {
|
|
2185
|
+
return getPackageCandidates(x2, start, opts);
|
|
2186
|
+
};
|
|
2187
|
+
processDirs(
|
|
2188
|
+
cb2,
|
|
2189
|
+
packageIterator ? packageIterator(x2, start, thunk, opts) : thunk()
|
|
2190
|
+
);
|
|
2191
|
+
}
|
|
2192
|
+
};
|
|
2193
|
+
}
|
|
2194
|
+
});
|
|
2195
|
+
|
|
2196
|
+
// ../../../node_modules/resolve/lib/core.json
|
|
2197
|
+
var require_core2 = __commonJS({
|
|
2198
|
+
"../../../node_modules/resolve/lib/core.json"(exports, module) {
|
|
2199
|
+
module.exports = {
|
|
2200
|
+
assert: !0,
|
|
2201
|
+
"node:assert": [">= 14.18 && < 15", ">= 16"],
|
|
2202
|
+
"assert/strict": ">= 15",
|
|
2203
|
+
"node:assert/strict": ">= 16",
|
|
2204
|
+
async_hooks: ">= 8",
|
|
2205
|
+
"node:async_hooks": [">= 14.18 && < 15", ">= 16"],
|
|
2206
|
+
buffer_ieee754: ">= 0.5 && < 0.9.7",
|
|
2207
|
+
buffer: !0,
|
|
2208
|
+
"node:buffer": [">= 14.18 && < 15", ">= 16"],
|
|
2209
|
+
child_process: !0,
|
|
2210
|
+
"node:child_process": [">= 14.18 && < 15", ">= 16"],
|
|
2211
|
+
cluster: ">= 0.5",
|
|
2212
|
+
"node:cluster": [">= 14.18 && < 15", ">= 16"],
|
|
2213
|
+
console: !0,
|
|
2214
|
+
"node:console": [">= 14.18 && < 15", ">= 16"],
|
|
2215
|
+
constants: !0,
|
|
2216
|
+
"node:constants": [">= 14.18 && < 15", ">= 16"],
|
|
2217
|
+
crypto: !0,
|
|
2218
|
+
"node:crypto": [">= 14.18 && < 15", ">= 16"],
|
|
2219
|
+
_debug_agent: ">= 1 && < 8",
|
|
2220
|
+
_debugger: "< 8",
|
|
2221
|
+
dgram: !0,
|
|
2222
|
+
"node:dgram": [">= 14.18 && < 15", ">= 16"],
|
|
2223
|
+
diagnostics_channel: [">= 14.17 && < 15", ">= 15.1"],
|
|
2224
|
+
"node:diagnostics_channel": [">= 14.18 && < 15", ">= 16"],
|
|
2225
|
+
dns: !0,
|
|
2226
|
+
"node:dns": [">= 14.18 && < 15", ">= 16"],
|
|
2227
|
+
"dns/promises": ">= 15",
|
|
2228
|
+
"node:dns/promises": ">= 16",
|
|
2229
|
+
domain: ">= 0.7.12",
|
|
2230
|
+
"node:domain": [">= 14.18 && < 15", ">= 16"],
|
|
2231
|
+
events: !0,
|
|
2232
|
+
"node:events": [">= 14.18 && < 15", ">= 16"],
|
|
2233
|
+
freelist: "< 6",
|
|
2234
|
+
fs: !0,
|
|
2235
|
+
"node:fs": [">= 14.18 && < 15", ">= 16"],
|
|
2236
|
+
"fs/promises": [">= 10 && < 10.1", ">= 14"],
|
|
2237
|
+
"node:fs/promises": [">= 14.18 && < 15", ">= 16"],
|
|
2238
|
+
_http_agent: ">= 0.11.1",
|
|
2239
|
+
"node:_http_agent": [">= 14.18 && < 15", ">= 16"],
|
|
2240
|
+
_http_client: ">= 0.11.1",
|
|
2241
|
+
"node:_http_client": [">= 14.18 && < 15", ">= 16"],
|
|
2242
|
+
_http_common: ">= 0.11.1",
|
|
2243
|
+
"node:_http_common": [">= 14.18 && < 15", ">= 16"],
|
|
2244
|
+
_http_incoming: ">= 0.11.1",
|
|
2245
|
+
"node:_http_incoming": [">= 14.18 && < 15", ">= 16"],
|
|
2246
|
+
_http_outgoing: ">= 0.11.1",
|
|
2247
|
+
"node:_http_outgoing": [">= 14.18 && < 15", ">= 16"],
|
|
2248
|
+
_http_server: ">= 0.11.1",
|
|
2249
|
+
"node:_http_server": [">= 14.18 && < 15", ">= 16"],
|
|
2250
|
+
http: !0,
|
|
2251
|
+
"node:http": [">= 14.18 && < 15", ">= 16"],
|
|
2252
|
+
http2: ">= 8.8",
|
|
2253
|
+
"node:http2": [">= 14.18 && < 15", ">= 16"],
|
|
2254
|
+
https: !0,
|
|
2255
|
+
"node:https": [">= 14.18 && < 15", ">= 16"],
|
|
2256
|
+
inspector: ">= 8",
|
|
2257
|
+
"node:inspector": [">= 14.18 && < 15", ">= 16"],
|
|
2258
|
+
"inspector/promises": [">= 19"],
|
|
2259
|
+
"node:inspector/promises": [">= 19"],
|
|
2260
|
+
_linklist: "< 8",
|
|
2261
|
+
module: !0,
|
|
2262
|
+
"node:module": [">= 14.18 && < 15", ">= 16"],
|
|
2263
|
+
net: !0,
|
|
2264
|
+
"node:net": [">= 14.18 && < 15", ">= 16"],
|
|
2265
|
+
"node-inspect/lib/_inspect": ">= 7.6 && < 12",
|
|
2266
|
+
"node-inspect/lib/internal/inspect_client": ">= 7.6 && < 12",
|
|
2267
|
+
"node-inspect/lib/internal/inspect_repl": ">= 7.6 && < 12",
|
|
2268
|
+
os: !0,
|
|
2269
|
+
"node:os": [">= 14.18 && < 15", ">= 16"],
|
|
2270
|
+
path: !0,
|
|
2271
|
+
"node:path": [">= 14.18 && < 15", ">= 16"],
|
|
2272
|
+
"path/posix": ">= 15.3",
|
|
2273
|
+
"node:path/posix": ">= 16",
|
|
2274
|
+
"path/win32": ">= 15.3",
|
|
2275
|
+
"node:path/win32": ">= 16",
|
|
2276
|
+
perf_hooks: ">= 8.5",
|
|
2277
|
+
"node:perf_hooks": [">= 14.18 && < 15", ">= 16"],
|
|
2278
|
+
process: ">= 1",
|
|
2279
|
+
"node:process": [">= 14.18 && < 15", ">= 16"],
|
|
2280
|
+
punycode: ">= 0.5",
|
|
2281
|
+
"node:punycode": [">= 14.18 && < 15", ">= 16"],
|
|
2282
|
+
querystring: !0,
|
|
2283
|
+
"node:querystring": [">= 14.18 && < 15", ">= 16"],
|
|
2284
|
+
readline: !0,
|
|
2285
|
+
"node:readline": [">= 14.18 && < 15", ">= 16"],
|
|
2286
|
+
"readline/promises": ">= 17",
|
|
2287
|
+
"node:readline/promises": ">= 17",
|
|
2288
|
+
repl: !0,
|
|
2289
|
+
"node:repl": [">= 14.18 && < 15", ">= 16"],
|
|
2290
|
+
"node:sea": [">= 20.12 && < 21", ">= 21.7"],
|
|
2291
|
+
smalloc: ">= 0.11.5 && < 3",
|
|
2292
|
+
"node:sqlite": [">= 22.13 && < 23", ">= 23.4"],
|
|
2293
|
+
_stream_duplex: ">= 0.9.4",
|
|
2294
|
+
"node:_stream_duplex": [">= 14.18 && < 15", ">= 16"],
|
|
2295
|
+
_stream_transform: ">= 0.9.4",
|
|
2296
|
+
"node:_stream_transform": [">= 14.18 && < 15", ">= 16"],
|
|
2297
|
+
_stream_wrap: ">= 1.4.1",
|
|
2298
|
+
"node:_stream_wrap": [">= 14.18 && < 15", ">= 16"],
|
|
2299
|
+
_stream_passthrough: ">= 0.9.4",
|
|
2300
|
+
"node:_stream_passthrough": [">= 14.18 && < 15", ">= 16"],
|
|
2301
|
+
_stream_readable: ">= 0.9.4",
|
|
2302
|
+
"node:_stream_readable": [">= 14.18 && < 15", ">= 16"],
|
|
2303
|
+
_stream_writable: ">= 0.9.4",
|
|
2304
|
+
"node:_stream_writable": [">= 14.18 && < 15", ">= 16"],
|
|
2305
|
+
stream: !0,
|
|
2306
|
+
"node:stream": [">= 14.18 && < 15", ">= 16"],
|
|
2307
|
+
"stream/consumers": ">= 16.7",
|
|
2308
|
+
"node:stream/consumers": ">= 16.7",
|
|
2309
|
+
"stream/promises": ">= 15",
|
|
2310
|
+
"node:stream/promises": ">= 16",
|
|
2311
|
+
"stream/web": ">= 16.5",
|
|
2312
|
+
"node:stream/web": ">= 16.5",
|
|
2313
|
+
string_decoder: !0,
|
|
2314
|
+
"node:string_decoder": [">= 14.18 && < 15", ">= 16"],
|
|
2315
|
+
sys: [">= 0.4 && < 0.7", ">= 0.8"],
|
|
2316
|
+
"node:sys": [">= 14.18 && < 15", ">= 16"],
|
|
2317
|
+
"test/reporters": ">= 19.9 && < 20.2",
|
|
2318
|
+
"node:test/reporters": [">= 18.17 && < 19", ">= 19.9", ">= 20"],
|
|
2319
|
+
"test/mock_loader": ">= 22.3 && < 22.7",
|
|
2320
|
+
"node:test/mock_loader": ">= 22.3 && < 22.7",
|
|
2321
|
+
"node:test": [">= 16.17 && < 17", ">= 18"],
|
|
2322
|
+
timers: !0,
|
|
2323
|
+
"node:timers": [">= 14.18 && < 15", ">= 16"],
|
|
2324
|
+
"timers/promises": ">= 15",
|
|
2325
|
+
"node:timers/promises": ">= 16",
|
|
2326
|
+
_tls_common: ">= 0.11.13",
|
|
2327
|
+
"node:_tls_common": [">= 14.18 && < 15", ">= 16"],
|
|
2328
|
+
_tls_legacy: ">= 0.11.3 && < 10",
|
|
2329
|
+
_tls_wrap: ">= 0.11.3",
|
|
2330
|
+
"node:_tls_wrap": [">= 14.18 && < 15", ">= 16"],
|
|
2331
|
+
tls: !0,
|
|
2332
|
+
"node:tls": [">= 14.18 && < 15", ">= 16"],
|
|
2333
|
+
trace_events: ">= 10",
|
|
2334
|
+
"node:trace_events": [">= 14.18 && < 15", ">= 16"],
|
|
2335
|
+
tty: !0,
|
|
2336
|
+
"node:tty": [">= 14.18 && < 15", ">= 16"],
|
|
2337
|
+
url: !0,
|
|
2338
|
+
"node:url": [">= 14.18 && < 15", ">= 16"],
|
|
2339
|
+
util: !0,
|
|
2340
|
+
"node:util": [">= 14.18 && < 15", ">= 16"],
|
|
2341
|
+
"util/types": ">= 15.3",
|
|
2342
|
+
"node:util/types": ">= 16",
|
|
2343
|
+
"v8/tools/arguments": ">= 10 && < 12",
|
|
2344
|
+
"v8/tools/codemap": [">= 4.4 && < 5", ">= 5.2 && < 12"],
|
|
2345
|
+
"v8/tools/consarray": [">= 4.4 && < 5", ">= 5.2 && < 12"],
|
|
2346
|
+
"v8/tools/csvparser": [">= 4.4 && < 5", ">= 5.2 && < 12"],
|
|
2347
|
+
"v8/tools/logreader": [">= 4.4 && < 5", ">= 5.2 && < 12"],
|
|
2348
|
+
"v8/tools/profile_view": [">= 4.4 && < 5", ">= 5.2 && < 12"],
|
|
2349
|
+
"v8/tools/splaytree": [">= 4.4 && < 5", ">= 5.2 && < 12"],
|
|
2350
|
+
v8: ">= 1",
|
|
2351
|
+
"node:v8": [">= 14.18 && < 15", ">= 16"],
|
|
2352
|
+
vm: !0,
|
|
2353
|
+
"node:vm": [">= 14.18 && < 15", ">= 16"],
|
|
2354
|
+
wasi: [">= 13.4 && < 13.5", ">= 18.17 && < 19", ">= 20"],
|
|
2355
|
+
"node:wasi": [">= 18.17 && < 19", ">= 20"],
|
|
2356
|
+
worker_threads: ">= 11.7",
|
|
2357
|
+
"node:worker_threads": [">= 14.18 && < 15", ">= 16"],
|
|
2358
|
+
zlib: ">= 0.5",
|
|
2359
|
+
"node:zlib": [">= 14.18 && < 15", ">= 16"]
|
|
2360
|
+
};
|
|
2361
|
+
}
|
|
2362
|
+
});
|
|
2363
|
+
|
|
2364
|
+
// ../../../node_modules/resolve/lib/core.js
|
|
2365
|
+
var require_core3 = __commonJS({
|
|
2366
|
+
"../../../node_modules/resolve/lib/core.js"(exports, module) {
|
|
2367
|
+
"use strict";
|
|
2368
|
+
var isCoreModule = require_is_core_module(), data = require_core2(), core = {};
|
|
2369
|
+
for (mod in data)
|
|
2370
|
+
Object.prototype.hasOwnProperty.call(data, mod) && (core[mod] = isCoreModule(mod));
|
|
2371
|
+
var mod;
|
|
2372
|
+
module.exports = core;
|
|
2373
|
+
}
|
|
2374
|
+
});
|
|
2375
|
+
|
|
2376
|
+
// ../../../node_modules/resolve/lib/is-core.js
|
|
2377
|
+
var require_is_core = __commonJS({
|
|
2378
|
+
"../../../node_modules/resolve/lib/is-core.js"(exports, module) {
|
|
2379
|
+
var isCoreModule = require_is_core_module();
|
|
2380
|
+
module.exports = function(x) {
|
|
2381
|
+
return isCoreModule(x);
|
|
2382
|
+
};
|
|
2383
|
+
}
|
|
2384
|
+
});
|
|
2385
|
+
|
|
2386
|
+
// ../../../node_modules/resolve/lib/sync.js
|
|
2387
|
+
var require_sync = __commonJS({
|
|
2388
|
+
"../../../node_modules/resolve/lib/sync.js"(exports, module) {
|
|
2389
|
+
var isCore = require_is_core_module(), fs = __require("fs"), path = __require("path"), $Error = require_es_errors(), $TypeError = require_type(), getHomedir = require_homedir(), caller = require_caller(), nodeModulesPaths = require_node_modules_paths(), normalizeOptions = require_normalize_options(), realpathFS = process.platform !== "win32" && fs.realpathSync && typeof fs.realpathSync.native == "function" ? fs.realpathSync.native : fs.realpathSync, relativePathRegex = /^(?:\.\.?(?:\/|$)|\/|([A-Za-z]:)?[/\\])/, windowsDriveRegex = /^\w:[/\\]*$/, nodeModulesRegex = /[/\\]node_modules[/\\]*$/, homedir = getHomedir();
|
|
2390
|
+
function defaultPaths() {
|
|
2391
|
+
return homedir ? [
|
|
2392
|
+
path.join(homedir, ".node_modules"),
|
|
2393
|
+
path.join(homedir, ".node_libraries")
|
|
2394
|
+
] : [];
|
|
2395
|
+
}
|
|
2396
|
+
var defaultIsFile = function(file) {
|
|
2397
|
+
try {
|
|
2398
|
+
var stat = fs.statSync(file, { throwIfNoEntry: !1 });
|
|
2399
|
+
} catch (e) {
|
|
2400
|
+
if (e && (e.code === "ENOENT" || e.code === "ENOTDIR")) return !1;
|
|
2401
|
+
throw e;
|
|
2402
|
+
}
|
|
2403
|
+
return !!stat && (stat.isFile() || stat.isFIFO());
|
|
2404
|
+
}, defaultIsDir = function(dir) {
|
|
2405
|
+
try {
|
|
2406
|
+
var stat = fs.statSync(dir, { throwIfNoEntry: !1 });
|
|
2407
|
+
} catch (e) {
|
|
2408
|
+
if (e && (e.code === "ENOENT" || e.code === "ENOTDIR")) return !1;
|
|
2409
|
+
throw e;
|
|
2410
|
+
}
|
|
2411
|
+
return !!stat && stat.isDirectory();
|
|
2412
|
+
}, defaultRealpathSync = function(x) {
|
|
2413
|
+
try {
|
|
2414
|
+
return realpathFS(x);
|
|
2415
|
+
} catch (realpathErr) {
|
|
2416
|
+
if (realpathErr.code !== "ENOENT")
|
|
2417
|
+
throw realpathErr;
|
|
2418
|
+
}
|
|
2419
|
+
return x;
|
|
2420
|
+
};
|
|
2421
|
+
function maybeRealpathSync(realpathSync, x, opts) {
|
|
2422
|
+
return opts && opts.preserveSymlinks === !1 ? realpathSync(x) : x;
|
|
2423
|
+
}
|
|
2424
|
+
function defaultReadPackageSync(readFileSync, pkgfile) {
|
|
2425
|
+
var body = readFileSync(pkgfile);
|
|
2426
|
+
try {
|
|
2427
|
+
var pkg = JSON.parse(body);
|
|
2428
|
+
return pkg;
|
|
2429
|
+
} catch {
|
|
2430
|
+
}
|
|
2431
|
+
}
|
|
2432
|
+
function getPackageCandidates(x, start, opts) {
|
|
2433
|
+
for (var dirs = nodeModulesPaths(start, opts, x), i = 0; i < dirs.length; i++)
|
|
2434
|
+
dirs[i] = path.join(dirs[i], x);
|
|
2435
|
+
return dirs;
|
|
2436
|
+
}
|
|
2437
|
+
module.exports = function(x, options) {
|
|
2438
|
+
if (typeof x != "string")
|
|
2439
|
+
throw new $TypeError("Path must be a string.");
|
|
2440
|
+
var opts = normalizeOptions(x, options), isFile = opts.isFile || defaultIsFile, readFileSync = opts.readFileSync || fs.readFileSync, isDirectory = opts.isDirectory || defaultIsDir, realpathSync = opts.realpathSync || defaultRealpathSync, readPackageSync = opts.readPackageSync || defaultReadPackageSync;
|
|
2441
|
+
if (opts.readFileSync && opts.readPackageSync)
|
|
2442
|
+
throw new $TypeError("`readFileSync` and `readPackageSync` are mutually exclusive.");
|
|
2443
|
+
var packageIterator = opts.packageIterator, extensions = opts.extensions || [".js"], includeCoreModules = opts.includeCoreModules !== !1, basedir = opts.basedir || path.dirname(caller()), parent = opts.filename || basedir;
|
|
2444
|
+
opts.paths = opts.paths || defaultPaths();
|
|
2445
|
+
var absoluteStart = maybeRealpathSync(realpathSync, path.resolve(basedir), opts);
|
|
2446
|
+
if (relativePathRegex.test(x)) {
|
|
2447
|
+
var res = path.resolve(absoluteStart, x);
|
|
2448
|
+
(x === "." || x === ".." || x.slice(-1) === "/") && (res += "/");
|
|
2449
|
+
var m = loadAsFileSync(res) || loadAsDirectorySync(res);
|
|
2450
|
+
if (m) return maybeRealpathSync(realpathSync, m, opts);
|
|
2451
|
+
} else {
|
|
2452
|
+
if (includeCoreModules && isCore(x))
|
|
2453
|
+
return x;
|
|
2454
|
+
var n2 = loadNodeModulesSync(x, absoluteStart);
|
|
2455
|
+
if (n2) return maybeRealpathSync(realpathSync, n2, opts);
|
|
2456
|
+
}
|
|
2457
|
+
var err = new $Error("Cannot find module '" + x + "' from '" + parent + "'");
|
|
2458
|
+
throw err.code = "MODULE_NOT_FOUND", err;
|
|
2459
|
+
function loadAsFileSync(x2) {
|
|
2460
|
+
var pkg = loadpkg(path.dirname(x2));
|
|
2461
|
+
if (pkg && pkg.dir && pkg.pkg && opts.pathFilter) {
|
|
2462
|
+
var rfile = path.relative(pkg.dir, x2), r = opts.pathFilter(pkg.pkg, x2, rfile);
|
|
2463
|
+
r && (x2 = path.resolve(pkg.dir, r));
|
|
2464
|
+
}
|
|
2465
|
+
if (isFile(x2))
|
|
2466
|
+
return x2;
|
|
2467
|
+
for (var i = 0; i < extensions.length; i++) {
|
|
2468
|
+
var file = x2 + extensions[i];
|
|
2469
|
+
if (isFile(file))
|
|
2470
|
+
return file;
|
|
2471
|
+
}
|
|
2472
|
+
}
|
|
2473
|
+
function loadpkg(dir) {
|
|
2474
|
+
if (!(dir === "" || dir === "/") && !(process.platform === "win32" && windowsDriveRegex.test(dir)) && !nodeModulesRegex.test(dir)) {
|
|
2475
|
+
var pkgfile = path.join(maybeRealpathSync(realpathSync, dir, opts), "package.json");
|
|
2476
|
+
if (!isFile(pkgfile))
|
|
2477
|
+
return loadpkg(path.dirname(dir));
|
|
2478
|
+
var pkg = readPackageSync(readFileSync, pkgfile);
|
|
2479
|
+
return pkg && opts.packageFilter && (pkg = opts.packageFilter(
|
|
2480
|
+
pkg,
|
|
2481
|
+
/*pkgfile,*/
|
|
2482
|
+
dir
|
|
2483
|
+
)), { pkg, dir };
|
|
2484
|
+
}
|
|
2485
|
+
}
|
|
2486
|
+
function loadAsDirectorySync(x2) {
|
|
2487
|
+
var pkgfile = path.join(maybeRealpathSync(realpathSync, x2, opts), "/package.json");
|
|
2488
|
+
if (isFile(pkgfile)) {
|
|
2489
|
+
try {
|
|
2490
|
+
var pkg = readPackageSync(readFileSync, pkgfile);
|
|
2491
|
+
} catch {
|
|
2492
|
+
}
|
|
2493
|
+
if (pkg && opts.packageFilter && (pkg = opts.packageFilter(
|
|
2494
|
+
pkg,
|
|
2495
|
+
/*pkgfile,*/
|
|
2496
|
+
x2
|
|
2497
|
+
)), pkg && pkg.main) {
|
|
2498
|
+
if (typeof pkg.main != "string") {
|
|
2499
|
+
var mainError = new $TypeError("package \u201C" + pkg.name + "\u201D `main` must be a string");
|
|
2500
|
+
throw mainError.code = "INVALID_PACKAGE_MAIN", mainError;
|
|
2501
|
+
}
|
|
2502
|
+
(pkg.main === "." || pkg.main === "./") && (pkg.main = "index");
|
|
2503
|
+
try {
|
|
2504
|
+
var m2 = loadAsFileSync(path.resolve(x2, pkg.main));
|
|
2505
|
+
if (m2) return m2;
|
|
2506
|
+
var n3 = loadAsDirectorySync(path.resolve(x2, pkg.main));
|
|
2507
|
+
if (n3) return n3;
|
|
2508
|
+
} catch {
|
|
2509
|
+
}
|
|
2510
|
+
}
|
|
2511
|
+
}
|
|
2512
|
+
return loadAsFileSync(path.join(x2, "/index"));
|
|
2513
|
+
}
|
|
2514
|
+
function loadNodeModulesSync(x2, start) {
|
|
2515
|
+
for (var thunk = function() {
|
|
2516
|
+
return getPackageCandidates(x2, start, opts);
|
|
2517
|
+
}, dirs = packageIterator ? packageIterator(x2, start, thunk, opts) : thunk(), i = 0; i < dirs.length; i++) {
|
|
2518
|
+
var dir = dirs[i];
|
|
2519
|
+
if (isDirectory(path.dirname(dir))) {
|
|
2520
|
+
var m2 = loadAsFileSync(dir);
|
|
2521
|
+
if (m2) return m2;
|
|
2522
|
+
var n3 = loadAsDirectorySync(dir);
|
|
2523
|
+
if (n3) return n3;
|
|
2524
|
+
}
|
|
2525
|
+
}
|
|
2526
|
+
}
|
|
2527
|
+
};
|
|
2528
|
+
}
|
|
2529
|
+
});
|
|
2530
|
+
|
|
2531
|
+
// ../../../node_modules/resolve/index.js
|
|
2532
|
+
var require_resolve = __commonJS({
|
|
2533
|
+
"../../../node_modules/resolve/index.js"(exports, module) {
|
|
2534
|
+
var async = require_async();
|
|
2535
|
+
async.core = require_core3();
|
|
2536
|
+
async.isCore = require_is_core();
|
|
2537
|
+
async.sync = require_sync();
|
|
2538
|
+
module.exports = async;
|
|
2539
|
+
}
|
|
2540
|
+
});
|
|
12
2541
|
|
|
13
2542
|
// src/loaders/react-docgen-loader.ts
|
|
14
2543
|
import { dirname } from "node:path";
|
|
15
2544
|
import { findTsconfigPathForFile, getTsconfigPathsBaseDir } from "storybook/internal/common";
|
|
16
2545
|
import { logger } from "storybook/internal/node-logger";
|
|
17
|
-
|
|
2546
|
+
|
|
2547
|
+
// ../../../node_modules/@jridgewell/sourcemap-codec/dist/sourcemap-codec.mjs
|
|
2548
|
+
var comma = 44, semicolon = 59, chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/", intToChar = new Uint8Array(64), charToInt = new Uint8Array(128);
|
|
2549
|
+
for (let i = 0; i < chars.length; i++) {
|
|
2550
|
+
let c = chars.charCodeAt(i);
|
|
2551
|
+
intToChar[i] = c, charToInt[c] = i;
|
|
2552
|
+
}
|
|
2553
|
+
function encodeInteger(builder, num) {
|
|
2554
|
+
do {
|
|
2555
|
+
let clamped = num & 31;
|
|
2556
|
+
num >>>= 5, num > 0 && (clamped |= 32), builder.write(intToChar[clamped]);
|
|
2557
|
+
} while (num > 0);
|
|
2558
|
+
}
|
|
2559
|
+
function encodeSign(num) {
|
|
2560
|
+
return num < 0 ? -num << 1 | 1 : num << 1;
|
|
2561
|
+
}
|
|
2562
|
+
var bufLength = 1024 * 16, td = typeof TextDecoder < "u" ? new TextDecoder() : typeof Buffer < "u" ? {
|
|
2563
|
+
decode(buf) {
|
|
2564
|
+
return Buffer.from(buf.buffer, buf.byteOffset, buf.byteLength).toString();
|
|
2565
|
+
}
|
|
2566
|
+
} : {
|
|
2567
|
+
decode(buf) {
|
|
2568
|
+
let out = "";
|
|
2569
|
+
for (let i = 0; i < buf.length; i++)
|
|
2570
|
+
out += String.fromCharCode(buf[i]);
|
|
2571
|
+
return out;
|
|
2572
|
+
}
|
|
2573
|
+
}, StringWriter = class {
|
|
2574
|
+
constructor() {
|
|
2575
|
+
this.pos = 0, this.out = "", this.buffer = new Uint8Array(bufLength);
|
|
2576
|
+
}
|
|
2577
|
+
write(v) {
|
|
2578
|
+
let { buffer } = this;
|
|
2579
|
+
buffer[this.pos++] = v, this.pos === bufLength && (this.out += td.decode(buffer), this.pos = 0);
|
|
2580
|
+
}
|
|
2581
|
+
flush() {
|
|
2582
|
+
let { buffer, out, pos } = this;
|
|
2583
|
+
return pos > 0 ? out + td.decode(buffer.subarray(0, pos)) : out;
|
|
2584
|
+
}
|
|
2585
|
+
};
|
|
2586
|
+
function encodeRangeMappings(decoded) {
|
|
2587
|
+
if (decoded.length === 0) return "";
|
|
2588
|
+
let writer = new StringWriter();
|
|
2589
|
+
for (let i = 0; i < decoded.length; i++) {
|
|
2590
|
+
let indices = decoded[i];
|
|
2591
|
+
i > 0 && writer.write(semicolon);
|
|
2592
|
+
let index = 0;
|
|
2593
|
+
for (let j = 0; j < indices.length; j++) {
|
|
2594
|
+
let offset = indices[j];
|
|
2595
|
+
encodeInteger(writer, offset - index), index = offset;
|
|
2596
|
+
}
|
|
2597
|
+
}
|
|
2598
|
+
return writer.flush();
|
|
2599
|
+
}
|
|
2600
|
+
function encode(decoded) {
|
|
2601
|
+
let writer = new StringWriter(), sourcesIndex = 0, sourceLine = 0, sourceColumn = 0, namesIndex = 0;
|
|
2602
|
+
for (let i = 0; i < decoded.length; i++) {
|
|
2603
|
+
let line = decoded[i];
|
|
2604
|
+
if (i > 0 && writer.write(semicolon), line.length === 0) continue;
|
|
2605
|
+
let genColumn = 0;
|
|
2606
|
+
for (let j = 0; j < line.length; j++) {
|
|
2607
|
+
let segment = line[j];
|
|
2608
|
+
j > 0 && writer.write(comma), encodeInteger(writer, encodeSign(segment[0] - genColumn)), genColumn = segment[0], segment.length !== 1 && (encodeInteger(writer, encodeSign(segment[1] - sourcesIndex)), encodeInteger(writer, encodeSign(segment[2] - sourceLine)), encodeInteger(writer, encodeSign(segment[3] - sourceColumn)), sourcesIndex = segment[1], sourceLine = segment[2], sourceColumn = segment[3], segment.length !== 4 && (encodeInteger(writer, encodeSign(segment[4] - namesIndex)), namesIndex = segment[4]));
|
|
2609
|
+
}
|
|
2610
|
+
}
|
|
2611
|
+
return writer.flush();
|
|
2612
|
+
}
|
|
2613
|
+
|
|
2614
|
+
// ../../../node_modules/magic-string/dist/index.mjs
|
|
2615
|
+
var BitSet = class BitSet2 {
|
|
2616
|
+
constructor(arg) {
|
|
2617
|
+
this.bits = arg instanceof BitSet2 ? arg.bits.slice() : [];
|
|
2618
|
+
}
|
|
2619
|
+
add(n2) {
|
|
2620
|
+
this.bits[n2 >> 5] |= 1 << (n2 & 31);
|
|
2621
|
+
}
|
|
2622
|
+
has(n2) {
|
|
2623
|
+
return !!(this.bits[n2 >> 5] & 1 << (n2 & 31));
|
|
2624
|
+
}
|
|
2625
|
+
forEach(fn) {
|
|
2626
|
+
let bits = this.bits;
|
|
2627
|
+
for (let w = 0; w < bits.length; w++) {
|
|
2628
|
+
let word = bits[w];
|
|
2629
|
+
for (; word; ) {
|
|
2630
|
+
let lowest = word & -word;
|
|
2631
|
+
fn((w << 5) + 31 - Math.clz32(lowest)), word ^= lowest;
|
|
2632
|
+
}
|
|
2633
|
+
}
|
|
2634
|
+
}
|
|
2635
|
+
}, Chunk = class Chunk2 {
|
|
2636
|
+
constructor(start, end, content) {
|
|
2637
|
+
this.start = start, this.end = end, this.original = content, this.intro = "", this.outro = "", this.content = content, this.storeName = !1, this.edited = !1, this.replacesUntil = -1, this.replacedFrom = -1, this.previous = null, this.next = null;
|
|
2638
|
+
}
|
|
2639
|
+
appendLeft(content) {
|
|
2640
|
+
this.outro += content;
|
|
2641
|
+
}
|
|
2642
|
+
appendRight(content) {
|
|
2643
|
+
this.intro = this.intro + content;
|
|
2644
|
+
}
|
|
2645
|
+
clone() {
|
|
2646
|
+
let chunk = new Chunk2(this.start, this.end, this.original);
|
|
2647
|
+
return chunk.intro = this.intro, chunk.outro = this.outro, chunk.content = this.content, chunk.storeName = this.storeName, chunk.edited = this.edited, chunk.replacesUntil = this.replacesUntil, chunk.replacedFrom = this.replacedFrom, chunk;
|
|
2648
|
+
}
|
|
2649
|
+
contains(index) {
|
|
2650
|
+
return this.start < index && index < this.end;
|
|
2651
|
+
}
|
|
2652
|
+
eachNext(fn) {
|
|
2653
|
+
fn(this);
|
|
2654
|
+
let chunk = this.next;
|
|
2655
|
+
for (; chunk; )
|
|
2656
|
+
fn(chunk), chunk = chunk.next;
|
|
2657
|
+
}
|
|
2658
|
+
eachPrevious(fn) {
|
|
2659
|
+
fn(this);
|
|
2660
|
+
let chunk = this.previous;
|
|
2661
|
+
for (; chunk; )
|
|
2662
|
+
fn(chunk), chunk = chunk.previous;
|
|
2663
|
+
}
|
|
2664
|
+
edit(content, storeName, contentOnly) {
|
|
2665
|
+
return this.content = content, contentOnly || (this.intro = "", this.outro = ""), this.storeName = storeName, this.edited = !0, this;
|
|
2666
|
+
}
|
|
2667
|
+
prependLeft(content) {
|
|
2668
|
+
this.outro = content + this.outro;
|
|
2669
|
+
}
|
|
2670
|
+
prependRight(content) {
|
|
2671
|
+
this.intro = content + this.intro;
|
|
2672
|
+
}
|
|
2673
|
+
reset() {
|
|
2674
|
+
this.intro = "", this.outro = "", this.replacesUntil = -1, this.replacedFrom = -1, this.edited && (this.content = this.original, this.storeName = !1, this.edited = !1);
|
|
2675
|
+
}
|
|
2676
|
+
split(index) {
|
|
2677
|
+
let sliceIndex = index - this.start, originalBefore = this.original.slice(0, sliceIndex), originalAfter = this.original.slice(sliceIndex);
|
|
2678
|
+
this.original = originalBefore;
|
|
2679
|
+
let newChunk = new Chunk2(index, this.end, originalAfter);
|
|
2680
|
+
return newChunk.outro = this.outro, this.outro = "", this.end = index, this.edited ? (newChunk.edit("", !1, !0), newChunk.replacedFrom = this.replacedFrom) : this.content = originalBefore, newChunk.next = this.next, newChunk.next && (newChunk.next.previous = newChunk), newChunk.previous = this, this.next = newChunk, newChunk;
|
|
2681
|
+
}
|
|
2682
|
+
toString() {
|
|
2683
|
+
return this.intro + this.content + this.outro;
|
|
2684
|
+
}
|
|
2685
|
+
trimEnd(rx) {
|
|
2686
|
+
if (this.outro = this.outro.replace(rx, ""), this.outro.length) return !0;
|
|
2687
|
+
let trimmed = this.content.replace(rx, "");
|
|
2688
|
+
if (trimmed.length)
|
|
2689
|
+
return trimmed !== this.content && (this.edited ? this.edit(trimmed, this.storeName, !0) : this.split(this.start + trimmed.length).edit("", void 0, !0)), !0;
|
|
2690
|
+
if (this.edit("", void 0, !0), this.intro = this.intro.replace(rx, ""), this.intro.length) return !0;
|
|
2691
|
+
}
|
|
2692
|
+
trimStart(rx) {
|
|
2693
|
+
if (this.intro = this.intro.replace(rx, ""), this.intro.length) return !0;
|
|
2694
|
+
let trimmed = this.content.replace(rx, "");
|
|
2695
|
+
if (trimmed.length)
|
|
2696
|
+
return trimmed !== this.content && (this.edited ? this.edit(trimmed, this.storeName, !0) : (this.split(this.end - trimmed.length), this.edit("", void 0, !0))), !0;
|
|
2697
|
+
if (this.edit("", void 0, !0), this.outro = this.outro.replace(rx, ""), this.outro.length) return !0;
|
|
2698
|
+
}
|
|
2699
|
+
}, MagicStringError = class extends Error {
|
|
2700
|
+
name = "MagicStringError";
|
|
2701
|
+
constructor(message, options) {
|
|
2702
|
+
super(`[MagicString] ${message}`, options);
|
|
2703
|
+
}
|
|
2704
|
+
};
|
|
2705
|
+
function getBtoa() {
|
|
2706
|
+
if (typeof globalThis < "u" && typeof globalThis.btoa == "function") return (str) => globalThis.btoa(unescape(encodeURIComponent(str)));
|
|
2707
|
+
let buffer = globalThis.Buffer;
|
|
2708
|
+
return buffer ? (str) => buffer.from(str, "utf-8").toString("base64") : () => {
|
|
2709
|
+
throw new MagicStringError("unsupported environment: `btoa` or `Buffer` is required");
|
|
2710
|
+
};
|
|
2711
|
+
}
|
|
2712
|
+
var btoa = getBtoa(), SourceMap = class {
|
|
2713
|
+
constructor(properties) {
|
|
2714
|
+
if (this.version = 3, this.file = properties.file, this.sources = properties.sources, this.sourcesContent = properties.sourcesContent, this.names = properties.names, this.mappings = typeof properties.mappings == "string" ? properties.mappings : encode(properties.mappings), typeof properties.x_google_ignoreList < "u" && (this.x_google_ignoreList = properties.x_google_ignoreList), typeof properties.debugId < "u" && (this.debugId = properties.debugId), typeof properties.rangeMappings < "u") {
|
|
2715
|
+
let shouldOutputRangeMapping = !1;
|
|
2716
|
+
for (let line of properties.rangeMappings) if (line.length !== 0) {
|
|
2717
|
+
shouldOutputRangeMapping = !0;
|
|
2718
|
+
break;
|
|
2719
|
+
}
|
|
2720
|
+
shouldOutputRangeMapping && (this.rangeMappings = encodeRangeMappings(properties.rangeMappings));
|
|
2721
|
+
}
|
|
2722
|
+
}
|
|
2723
|
+
/**
|
|
2724
|
+
* Returns the equivalent of `JSON.stringify(map)`
|
|
2725
|
+
*/
|
|
2726
|
+
toString() {
|
|
2727
|
+
return JSON.stringify(this);
|
|
2728
|
+
}
|
|
2729
|
+
/**
|
|
2730
|
+
* Returns a DataURI containing the sourcemap. Useful for doing this sort of thing:
|
|
2731
|
+
* `generateMap(options?: SourceMapOptions): SourceMap;`
|
|
2732
|
+
*/
|
|
2733
|
+
toUrl() {
|
|
2734
|
+
return `data:application/json;charset=utf-8;base64,${btoa(this.toString())}`;
|
|
2735
|
+
}
|
|
2736
|
+
};
|
|
2737
|
+
function getLocator(source) {
|
|
2738
|
+
let lineOffsets = [0];
|
|
2739
|
+
for (let i = source.indexOf(`
|
|
2740
|
+
`); i !== -1; i = source.indexOf(`
|
|
2741
|
+
`, i + 1)) lineOffsets.push(i + 1);
|
|
2742
|
+
return function(index) {
|
|
2743
|
+
let i = 0, j = lineOffsets.length;
|
|
2744
|
+
for (; i < j; ) {
|
|
2745
|
+
let m = i + j >> 1;
|
|
2746
|
+
index < lineOffsets[m] ? j = m : i = m + 1;
|
|
2747
|
+
}
|
|
2748
|
+
let line = i - 1;
|
|
2749
|
+
return {
|
|
2750
|
+
line,
|
|
2751
|
+
column: index - lineOffsets[line]
|
|
2752
|
+
};
|
|
2753
|
+
};
|
|
2754
|
+
}
|
|
2755
|
+
function getRelativePath(from, to) {
|
|
2756
|
+
let fromParts = from.split(/[/\\]/), toParts = to.split(/[/\\]/);
|
|
2757
|
+
for (fromParts.pop(); fromParts[0] === toParts[0]; )
|
|
2758
|
+
fromParts.shift(), toParts.shift();
|
|
2759
|
+
if (fromParts.length) {
|
|
2760
|
+
let i = fromParts.length;
|
|
2761
|
+
for (; i--; ) fromParts[i] = "..";
|
|
2762
|
+
}
|
|
2763
|
+
return fromParts.concat(toParts).join("/");
|
|
2764
|
+
}
|
|
2765
|
+
function guessIndent(code) {
|
|
2766
|
+
let lines = code.split(`
|
|
2767
|
+
`), tabbed = lines.filter((line) => /^\t+/.test(line)), spaced = lines.filter((line) => /^ {2,}/.test(line));
|
|
2768
|
+
if (tabbed.length === 0 && spaced.length === 0) return null;
|
|
2769
|
+
if (tabbed.length >= spaced.length) return " ";
|
|
2770
|
+
let min = spaced.reduce((previous, current) => {
|
|
2771
|
+
let numSpaces = /^ +/.exec(current)[0].length;
|
|
2772
|
+
return Math.min(numSpaces, previous);
|
|
2773
|
+
}, 1 / 0);
|
|
2774
|
+
return " ".repeat(min);
|
|
2775
|
+
}
|
|
2776
|
+
var toString = Object.prototype.toString;
|
|
2777
|
+
function isObject(thing) {
|
|
2778
|
+
return toString.call(thing) === "[object Object]";
|
|
2779
|
+
}
|
|
2780
|
+
var BASE64_CHARS = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/", intToChar2 = (() => {
|
|
2781
|
+
let chars2 = new Uint8Array(64);
|
|
2782
|
+
for (let i = 0; i < 64; i++) chars2[i] = BASE64_CHARS.charCodeAt(i);
|
|
2783
|
+
return chars2;
|
|
2784
|
+
})(), COMMA = 44, SEMICOLON = 59, BUFFER_SIZE = 16384, FLUSH_THRESHOLD = 16348, scratch = new Uint8Array(BUFFER_SIZE);
|
|
2785
|
+
function writeVlq(pos, num) {
|
|
2786
|
+
num = num < 0 ? -num << 1 | 1 : num << 1;
|
|
2787
|
+
do {
|
|
2788
|
+
let clamped = num & 31;
|
|
2789
|
+
num >>>= 5, num > 0 && (clamped |= 32), scratch[pos++] = intToChar2[clamped];
|
|
2790
|
+
} while (num > 0);
|
|
2791
|
+
return pos;
|
|
2792
|
+
}
|
|
2793
|
+
var decoder = new TextDecoder(), MappingsEncoder = class {
|
|
2794
|
+
constructor() {
|
|
2795
|
+
this.out = "", this.pos = 0, this.lines = [], this.buffered = 0, this.needsComma = !1, this.prevGenColumn = 0, this.prevSourceIndex = 0, this.prevSourceLine = 0, this.prevSourceColumn = 0, this.prevNameIndex = 0;
|
|
2796
|
+
}
|
|
2797
|
+
endLine(segments) {
|
|
2798
|
+
this.lines.push(segments), this.buffered += segments.length + 1, this.buffered >= 4096 && this.drain(null);
|
|
2799
|
+
}
|
|
2800
|
+
segments(segments) {
|
|
2801
|
+
this.drain(segments);
|
|
2802
|
+
}
|
|
2803
|
+
finish(segments) {
|
|
2804
|
+
return this.drain(segments), this.flush(), this.out;
|
|
2805
|
+
}
|
|
2806
|
+
drain(trailing) {
|
|
2807
|
+
let lines = this.lines, lineCount = lines.length;
|
|
2808
|
+
for (let l = 0; l <= lineCount; l++) {
|
|
2809
|
+
let line = l < lineCount ? lines[l] : trailing;
|
|
2810
|
+
if (line === null) break;
|
|
2811
|
+
for (let i = 0; i < line.length; i++) {
|
|
2812
|
+
this.pos > FLUSH_THRESHOLD && this.flush();
|
|
2813
|
+
let segment = line[i];
|
|
2814
|
+
this.needsComma && (scratch[this.pos++] = COMMA), this.needsComma = !0, this.pos = writeVlq(this.pos, segment[0] - this.prevGenColumn), this.prevGenColumn = segment[0], this.pos = writeVlq(this.pos, segment[1] - this.prevSourceIndex), this.prevSourceIndex = segment[1], this.pos = writeVlq(this.pos, segment[2] - this.prevSourceLine), this.prevSourceLine = segment[2], this.pos = writeVlq(this.pos, segment[3] - this.prevSourceColumn), this.prevSourceColumn = segment[3], segment.length === 5 && (this.pos = writeVlq(this.pos, segment[4] - this.prevNameIndex), this.prevNameIndex = segment[4]);
|
|
2815
|
+
}
|
|
2816
|
+
l < lineCount && (this.pos > FLUSH_THRESHOLD && this.flush(), scratch[this.pos++] = SEMICOLON, this.needsComma = !1, this.prevGenColumn = 0);
|
|
2817
|
+
}
|
|
2818
|
+
lines.length = 0, this.buffered = 0, this.flush();
|
|
2819
|
+
}
|
|
2820
|
+
flush() {
|
|
2821
|
+
this.out += decoder.decode(scratch.subarray(0, this.pos)), this.pos = 0;
|
|
2822
|
+
}
|
|
2823
|
+
}, NEWLINE_CHAR$1 = 10;
|
|
2824
|
+
function isWordCode(code) {
|
|
2825
|
+
return code >= 97 && code <= 122 || code >= 65 && code <= 90 || code >= 48 && code <= 57 || code === 95;
|
|
2826
|
+
}
|
|
2827
|
+
var Mappings = class {
|
|
2828
|
+
constructor(hires, encoder = null) {
|
|
2829
|
+
this.hires = hires, this.generatedCodeLine = 0, this.generatedCodeColumn = 0, this.raw = [], this.rawSegments = this.raw[this.generatedCodeLine] = [], this.rawRangeMappingsIndices = [], this.rawRangeMappings = hires === "experimental-range" ? [this.rawRangeMappingsIndices] : void 0, this.encoder = encoder;
|
|
2830
|
+
}
|
|
2831
|
+
nextLine() {
|
|
2832
|
+
this.encoder === null ? (this.generatedCodeLine += 1, this.raw[this.generatedCodeLine] = this.rawSegments = []) : (this.encoder.endLine(this.rawSegments), this.rawSegments = [], this.generatedCodeLine += 1), this.generatedCodeColumn = 0, this.rawRangeMappings && (this.rawRangeMappings[this.generatedCodeLine] = this.rawRangeMappingsIndices = []);
|
|
2833
|
+
}
|
|
2834
|
+
/**
|
|
2835
|
+
* Emits the mappings for one MagicString: its intro, every chunk (with the
|
|
2836
|
+
* chunk's own intro/outro) and its outro. `sourceIndex === -1` means the
|
|
2837
|
+
* string has no source of its own, so its content only advances the
|
|
2838
|
+
* generated position without mapping anything.
|
|
2839
|
+
*/
|
|
2840
|
+
addMagicString(magicString, sourceIndex, nameIndex) {
|
|
2841
|
+
let { original } = magicString, locate = getLocator(original);
|
|
2842
|
+
magicString.intro && this.advance(magicString.intro), magicString.firstChunk.eachNext((chunk) => {
|
|
2843
|
+
if (chunk.intro.length && this.advance(chunk.intro), sourceIndex === -1) this.advance(chunk.content);
|
|
2844
|
+
else if (chunk.edited) {
|
|
2845
|
+
let name = chunk.storeName ? nameIndex.get(original.slice(chunk.start, chunk.replacesUntil)) : void 0;
|
|
2846
|
+
this.addEdit(sourceIndex, chunk.content, locate(chunk.start), name ?? -1);
|
|
2847
|
+
} else this.addUneditedChunk(sourceIndex, chunk, original, locate(chunk.start), magicString.sourcemapLocations);
|
|
2848
|
+
chunk.outro.length && this.advance(chunk.outro);
|
|
2849
|
+
}), magicString.outro && this.advance(magicString.outro);
|
|
2850
|
+
}
|
|
2851
|
+
addEdit(sourceIndex, content, loc, nameIndex) {
|
|
2852
|
+
if (content.length) {
|
|
2853
|
+
let contentLengthMinusOne = content.length - 1, contentLineEnd = content.indexOf(`
|
|
2854
|
+
`, 0), previousContentLineEnd = -1;
|
|
2855
|
+
for (; contentLineEnd >= 0 && contentLengthMinusOne > contentLineEnd; ) {
|
|
2856
|
+
let segment2 = [
|
|
2857
|
+
this.generatedCodeColumn,
|
|
2858
|
+
sourceIndex,
|
|
2859
|
+
loc.line,
|
|
2860
|
+
loc.column
|
|
2861
|
+
];
|
|
2862
|
+
nameIndex >= 0 && segment2.push(nameIndex), this.rawSegments.push(segment2), this.nextLine(), previousContentLineEnd = contentLineEnd, contentLineEnd = content.indexOf(`
|
|
2863
|
+
`, contentLineEnd + 1);
|
|
2864
|
+
}
|
|
2865
|
+
let segment = [
|
|
2866
|
+
this.generatedCodeColumn,
|
|
2867
|
+
sourceIndex,
|
|
2868
|
+
loc.line,
|
|
2869
|
+
loc.column
|
|
2870
|
+
];
|
|
2871
|
+
nameIndex >= 0 && segment.push(nameIndex), this.rawSegments.push(segment), this.advance(content.slice(previousContentLineEnd + 1));
|
|
2872
|
+
}
|
|
2873
|
+
}
|
|
2874
|
+
addUneditedChunk(sourceIndex, chunk, original, loc, sourcemapLocations) {
|
|
2875
|
+
let end = chunk.end, i = chunk.start;
|
|
2876
|
+
if (this.hires) {
|
|
2877
|
+
let boundary = this.hires === "boundary", experimentalRange = this.hires === "experimental-range", encoder = experimentalRange ? null : this.encoder, charInHiresBoundary = !1;
|
|
2878
|
+
for (; i < end; ) {
|
|
2879
|
+
encoder !== null && this.rawSegments.length >= 4096 && (encoder.segments(this.rawSegments), this.rawSegments.length = 0), experimentalRange && i + 1 >= end && this.rawSegments.push([
|
|
2880
|
+
this.generatedCodeColumn,
|
|
2881
|
+
sourceIndex,
|
|
2882
|
+
loc.line,
|
|
2883
|
+
loc.column
|
|
2884
|
+
]);
|
|
2885
|
+
let code = original.charCodeAt(i);
|
|
2886
|
+
code === NEWLINE_CHAR$1 ? (loc.line += 1, loc.column = 0, this.nextLine(), charInHiresBoundary = !1) : (boundary ? isWordCode(code) ? charInHiresBoundary || (this.rawSegments.push([
|
|
2887
|
+
this.generatedCodeColumn,
|
|
2888
|
+
sourceIndex,
|
|
2889
|
+
loc.line,
|
|
2890
|
+
loc.column
|
|
2891
|
+
]), charInHiresBoundary = !0) : (this.rawSegments.push([
|
|
2892
|
+
this.generatedCodeColumn,
|
|
2893
|
+
sourceIndex,
|
|
2894
|
+
loc.line,
|
|
2895
|
+
loc.column
|
|
2896
|
+
]), charInHiresBoundary = !1) : experimentalRange ? i === chunk.start && (this.rawRangeMappingsIndices.push(this.rawSegments.length), this.rawSegments.push([
|
|
2897
|
+
this.generatedCodeColumn,
|
|
2898
|
+
sourceIndex,
|
|
2899
|
+
loc.line,
|
|
2900
|
+
loc.column
|
|
2901
|
+
])) : this.rawSegments.push([
|
|
2902
|
+
this.generatedCodeColumn,
|
|
2903
|
+
sourceIndex,
|
|
2904
|
+
loc.line,
|
|
2905
|
+
loc.column
|
|
2906
|
+
]), loc.column += 1, this.generatedCodeColumn += 1), i += 1;
|
|
2907
|
+
}
|
|
2908
|
+
} else {
|
|
2909
|
+
let bits = sourcemapLocations.bits;
|
|
2910
|
+
for (; i < end; ) {
|
|
2911
|
+
let newline = original.indexOf(`
|
|
2912
|
+
`, i);
|
|
2913
|
+
if ((newline === -1 || newline > end) && (newline = end), newline > i) {
|
|
2914
|
+
this.rawSegments.push([
|
|
2915
|
+
this.generatedCodeColumn,
|
|
2916
|
+
sourceIndex,
|
|
2917
|
+
loc.line,
|
|
2918
|
+
loc.column
|
|
2919
|
+
]);
|
|
2920
|
+
for (let w = i + 1 >> 5, last = newline - 1 >> 5; w <= last; w++) {
|
|
2921
|
+
let word = bits[w];
|
|
2922
|
+
if (!word) continue;
|
|
2923
|
+
let base = w << 5;
|
|
2924
|
+
for (; word; ) {
|
|
2925
|
+
let lowest = word & -word, index = base + 31 - Math.clz32(lowest);
|
|
2926
|
+
if (index > i && index < newline) {
|
|
2927
|
+
let offset = index - i;
|
|
2928
|
+
this.rawSegments.push([
|
|
2929
|
+
this.generatedCodeColumn + offset,
|
|
2930
|
+
sourceIndex,
|
|
2931
|
+
loc.line,
|
|
2932
|
+
loc.column + offset
|
|
2933
|
+
]);
|
|
2934
|
+
}
|
|
2935
|
+
word ^= lowest;
|
|
2936
|
+
}
|
|
2937
|
+
}
|
|
2938
|
+
loc.column += newline - i, this.generatedCodeColumn += newline - i;
|
|
2939
|
+
}
|
|
2940
|
+
if (newline === end) break;
|
|
2941
|
+
loc.line += 1, loc.column = 0, this.nextLine(), i = newline + 1;
|
|
2942
|
+
}
|
|
2943
|
+
}
|
|
2944
|
+
}
|
|
2945
|
+
advance(str) {
|
|
2946
|
+
if (!str) return;
|
|
2947
|
+
let lastNewline = str.lastIndexOf(`
|
|
2948
|
+
`);
|
|
2949
|
+
for (let i = str.indexOf(`
|
|
2950
|
+
`); i !== -1; i = str.indexOf(`
|
|
2951
|
+
`, i + 1)) this.nextLine();
|
|
2952
|
+
this.generatedCodeColumn += str.length - lastNewline - 1;
|
|
2953
|
+
}
|
|
2954
|
+
}, n = `
|
|
2955
|
+
`, NEWLINE_CHAR = 10, CR_CHAR = 13, warned = {
|
|
2956
|
+
insertLeft: !1,
|
|
2957
|
+
insertRight: !1,
|
|
2958
|
+
storeName: !1
|
|
2959
|
+
};
|
|
2960
|
+
function expandReplacement(replacement, matched, position, str, captures, namedCaptures) {
|
|
2961
|
+
if (!replacement.includes("$")) return replacement;
|
|
2962
|
+
let result = "", index = 0;
|
|
2963
|
+
for (; index < replacement.length; ) {
|
|
2964
|
+
let dollar = replacement.indexOf("$", index);
|
|
2965
|
+
if (dollar === -1) {
|
|
2966
|
+
result += replacement.slice(index);
|
|
2967
|
+
break;
|
|
2968
|
+
}
|
|
2969
|
+
result += replacement.slice(index, dollar);
|
|
2970
|
+
let char = replacement[dollar + 1], expansion = "$", consumed = 1;
|
|
2971
|
+
if (char === "$") consumed = 2;
|
|
2972
|
+
else if (char === "&")
|
|
2973
|
+
expansion = matched, consumed = 2;
|
|
2974
|
+
else if (char === "`")
|
|
2975
|
+
expansion = str.slice(0, position), consumed = 2;
|
|
2976
|
+
else if (char === "'")
|
|
2977
|
+
expansion = str.slice(position + matched.length), consumed = 2;
|
|
2978
|
+
else if (char === "<" && namedCaptures !== void 0) {
|
|
2979
|
+
let close = replacement.indexOf(">", dollar + 2);
|
|
2980
|
+
close !== -1 && (expansion = namedCaptures[replacement.slice(dollar + 2, close)] ?? "", consumed = close + 1 - dollar);
|
|
2981
|
+
} else if (char >= "0" && char <= "9") {
|
|
2982
|
+
let second = replacement[dollar + 2], double = second >= "0" && second <= "9" ? Number(char + second) : NaN, single = Number(char);
|
|
2983
|
+
double >= 1 && double <= captures.length ? (expansion = captures[double - 1] ?? "", consumed = 3) : single >= 1 && single <= captures.length && (expansion = captures[single - 1] ?? "", consumed = 2);
|
|
2984
|
+
}
|
|
2985
|
+
result += expansion, index = dollar + consumed;
|
|
2986
|
+
}
|
|
2987
|
+
return result;
|
|
2988
|
+
}
|
|
2989
|
+
var MagicString = class MagicString2 {
|
|
2990
|
+
/**
|
|
2991
|
+
* Wraps `string` for editing; every index passed to the editing methods refers to this original string.
|
|
2992
|
+
*/
|
|
2993
|
+
constructor(string, options = {}) {
|
|
2994
|
+
let chunk = new Chunk(0, string.length, string);
|
|
2995
|
+
Object.defineProperties(this, {
|
|
2996
|
+
original: {
|
|
2997
|
+
writable: !0,
|
|
2998
|
+
value: string
|
|
2999
|
+
},
|
|
3000
|
+
outro: {
|
|
3001
|
+
writable: !0,
|
|
3002
|
+
value: ""
|
|
3003
|
+
},
|
|
3004
|
+
intro: {
|
|
3005
|
+
writable: !0,
|
|
3006
|
+
value: ""
|
|
3007
|
+
},
|
|
3008
|
+
firstChunk: {
|
|
3009
|
+
writable: !0,
|
|
3010
|
+
value: chunk
|
|
3011
|
+
},
|
|
3012
|
+
lastChunk: {
|
|
3013
|
+
writable: !0,
|
|
3014
|
+
value: chunk
|
|
3015
|
+
},
|
|
3016
|
+
lastSearchedChunk: {
|
|
3017
|
+
writable: !0,
|
|
3018
|
+
value: chunk
|
|
3019
|
+
},
|
|
3020
|
+
byStart: {
|
|
3021
|
+
writable: !0,
|
|
3022
|
+
value: /* @__PURE__ */ new Map([[0, chunk]])
|
|
3023
|
+
},
|
|
3024
|
+
byEnd: {
|
|
3025
|
+
writable: !0,
|
|
3026
|
+
value: /* @__PURE__ */ new Map([[string.length, chunk]])
|
|
3027
|
+
},
|
|
3028
|
+
filename: {
|
|
3029
|
+
writable: !0,
|
|
3030
|
+
value: options.filename
|
|
3031
|
+
},
|
|
3032
|
+
indentExclusionRanges: {
|
|
3033
|
+
writable: !0,
|
|
3034
|
+
value: options.indentExclusionRanges
|
|
3035
|
+
},
|
|
3036
|
+
sourcemapLocations: {
|
|
3037
|
+
writable: !0,
|
|
3038
|
+
value: new BitSet()
|
|
3039
|
+
},
|
|
3040
|
+
storedNames: {
|
|
3041
|
+
writable: !0,
|
|
3042
|
+
value: /* @__PURE__ */ new Set()
|
|
3043
|
+
},
|
|
3044
|
+
indentStr: {
|
|
3045
|
+
writable: !0,
|
|
3046
|
+
value: void 0
|
|
3047
|
+
},
|
|
3048
|
+
ignoreList: {
|
|
3049
|
+
writable: !0,
|
|
3050
|
+
value: options.ignoreList
|
|
3051
|
+
},
|
|
3052
|
+
offset: {
|
|
3053
|
+
writable: !0,
|
|
3054
|
+
value: options.offset || 0
|
|
3055
|
+
},
|
|
3056
|
+
hasMovedChunks: {
|
|
3057
|
+
writable: !0,
|
|
3058
|
+
value: !1
|
|
3059
|
+
}
|
|
3060
|
+
});
|
|
3061
|
+
}
|
|
3062
|
+
/**
|
|
3063
|
+
* Adds the specified character index (with respect to the original string) to sourcemap mappings, if `hires` is false.
|
|
3064
|
+
*/
|
|
3065
|
+
addSourcemapLocation(char) {
|
|
3066
|
+
this.sourcemapLocations.add(char);
|
|
3067
|
+
}
|
|
3068
|
+
/**
|
|
3069
|
+
* Appends the specified content to the end of the string.
|
|
3070
|
+
*/
|
|
3071
|
+
append(content) {
|
|
3072
|
+
if (typeof content != "string") throw new MagicStringError(`content must be a string, got ${typeof content}`);
|
|
3073
|
+
return this.outro += content, this;
|
|
3074
|
+
}
|
|
3075
|
+
/**
|
|
3076
|
+
* Appends the specified content at the index in the original string.
|
|
3077
|
+
* If a range *ending* with index is subsequently moved, the insert will be moved with it.
|
|
3078
|
+
* See also `s.prependLeft(...)`.
|
|
3079
|
+
*/
|
|
3080
|
+
appendLeft(index, content) {
|
|
3081
|
+
if (index = this._resolveIndex(index), index < 0 || index > this.original.length) throw new MagicStringError(`index ${index} is out of bounds`);
|
|
3082
|
+
if (typeof content != "string") throw new MagicStringError(`content must be a string, got ${typeof content}`);
|
|
3083
|
+
this._split(index);
|
|
3084
|
+
let chunk = this.byEnd.get(index);
|
|
3085
|
+
return chunk ? chunk.appendLeft(content) : this.intro += content, this;
|
|
3086
|
+
}
|
|
3087
|
+
/**
|
|
3088
|
+
* Appends the specified content at the index in the original string.
|
|
3089
|
+
* If a range *starting* with index is subsequently moved, the insert will be moved with it.
|
|
3090
|
+
* See also `s.prependRight(...)`.
|
|
3091
|
+
*/
|
|
3092
|
+
appendRight(index, content) {
|
|
3093
|
+
if (index = this._resolveIndex(index), index < 0 || index > this.original.length) throw new MagicStringError(`index ${index} is out of bounds`);
|
|
3094
|
+
if (typeof content != "string") throw new MagicStringError(`content must be a string, got ${typeof content}`);
|
|
3095
|
+
this._split(index);
|
|
3096
|
+
let chunk = this.byStart.get(index);
|
|
3097
|
+
return chunk ? chunk.appendRight(content) : this.outro += content, this;
|
|
3098
|
+
}
|
|
3099
|
+
/**
|
|
3100
|
+
* Returns an independent copy: the chunk list, string-level intro/outro,
|
|
3101
|
+
* sourcemap locations, stored names, indent exclusion ranges, `offset`,
|
|
3102
|
+
* `filename` and `ignoreList` are all copied; later edits to either string
|
|
3103
|
+
* do not affect the other.
|
|
3104
|
+
*/
|
|
3105
|
+
clone() {
|
|
3106
|
+
let cloned = new MagicString2(this.original, {
|
|
3107
|
+
filename: this.filename,
|
|
3108
|
+
ignoreList: this.ignoreList,
|
|
3109
|
+
offset: this.offset
|
|
3110
|
+
}), originalChunk = this.firstChunk, clonedChunk = cloned.firstChunk = cloned.lastSearchedChunk = originalChunk.clone();
|
|
3111
|
+
for (; originalChunk; ) {
|
|
3112
|
+
cloned.byStart.set(clonedChunk.start, clonedChunk), cloned.byEnd.set(clonedChunk.end, clonedChunk);
|
|
3113
|
+
let nextOriginalChunk = originalChunk.next, nextClonedChunk = nextOriginalChunk && nextOriginalChunk.clone();
|
|
3114
|
+
nextClonedChunk && (clonedChunk.next = nextClonedChunk, nextClonedChunk.previous = clonedChunk, clonedChunk = nextClonedChunk), originalChunk = nextOriginalChunk;
|
|
3115
|
+
}
|
|
3116
|
+
return cloned.lastChunk = clonedChunk, this.indentExclusionRanges && (cloned.indentExclusionRanges = this.indentExclusionRanges.slice()), cloned.sourcemapLocations = new BitSet(this.sourcemapLocations), cloned.storedNames = new Set(this.storedNames), cloned.intro = this.intro, cloned.outro = this.outro, cloned.hasMovedChunks = this.hasMovedChunks, cloned;
|
|
3117
|
+
}
|
|
3118
|
+
/**
|
|
3119
|
+
* Generates a sourcemap object with raw mappings in array form, rather than encoded as a string.
|
|
3120
|
+
* Useful if you need to manipulate the sourcemap further, but most of the time you will use `generateMap` instead.
|
|
3121
|
+
*/
|
|
3122
|
+
generateDecodedMap(options) {
|
|
3123
|
+
options = options || {};
|
|
3124
|
+
let mappings = new Mappings(options.hires), names = this._generateMappings(mappings);
|
|
3125
|
+
return {
|
|
3126
|
+
...this._mapProperties(options, names),
|
|
3127
|
+
mappings: mappings.raw,
|
|
3128
|
+
rangeMappings: mappings.rawRangeMappings
|
|
3129
|
+
};
|
|
3130
|
+
}
|
|
3131
|
+
/**
|
|
3132
|
+
* Generates a version 3 sourcemap.
|
|
3133
|
+
*/
|
|
3134
|
+
generateMap(options) {
|
|
3135
|
+
options = options || {};
|
|
3136
|
+
let encoder = new MappingsEncoder(), mappings = new Mappings(options.hires, encoder), names = this._generateMappings(mappings);
|
|
3137
|
+
return new SourceMap({
|
|
3138
|
+
...this._mapProperties(options, names),
|
|
3139
|
+
mappings: encoder.finish(mappings.rawSegments),
|
|
3140
|
+
rangeMappings: mappings.rawRangeMappings
|
|
3141
|
+
});
|
|
3142
|
+
}
|
|
3143
|
+
/** @internal */
|
|
3144
|
+
_generateMappings(mappings) {
|
|
3145
|
+
let names = [...this.storedNames];
|
|
3146
|
+
return mappings.addMagicString(this, 0, new Map(names.map((name, i) => [name, i]))), names;
|
|
3147
|
+
}
|
|
3148
|
+
/** @internal */
|
|
3149
|
+
_mapProperties(options, names) {
|
|
3150
|
+
return {
|
|
3151
|
+
file: options.file ? options.file.split(/[/\\]/).pop() : void 0,
|
|
3152
|
+
sources: [options.source ? getRelativePath(options.file || "", options.source) : options.file || ""],
|
|
3153
|
+
sourcesContent: options.includeContent ? [this.original] : void 0,
|
|
3154
|
+
names,
|
|
3155
|
+
x_google_ignoreList: this.ignoreList ? [0] : void 0
|
|
3156
|
+
};
|
|
3157
|
+
}
|
|
3158
|
+
/** @internal */
|
|
3159
|
+
_ensureindentStr() {
|
|
3160
|
+
this.indentStr === void 0 && (this.indentStr = guessIndent(this.original));
|
|
3161
|
+
}
|
|
3162
|
+
/** @internal */
|
|
3163
|
+
_getRawIndentString() {
|
|
3164
|
+
return this._ensureindentStr(), this.indentStr;
|
|
3165
|
+
}
|
|
3166
|
+
/**
|
|
3167
|
+
* Returns the indentation string guessed from the original content, falling back to a single tab character.
|
|
3168
|
+
* This is the value `s.indent()` uses when no prefix is supplied.
|
|
3169
|
+
*/
|
|
3170
|
+
getIndentString() {
|
|
3171
|
+
return this._ensureindentStr(), this.indentStr ?? " ";
|
|
3172
|
+
}
|
|
3173
|
+
indent(indentStr, options) {
|
|
3174
|
+
let pattern = /^[^\r\n]/gm;
|
|
3175
|
+
if (isObject(indentStr) && (options = indentStr, indentStr = void 0), indentStr === void 0 && (this._ensureindentStr(), indentStr = this.indentStr || " "), indentStr === "") return this;
|
|
3176
|
+
let resolvedIndentStr = indentStr;
|
|
3177
|
+
options = options || {};
|
|
3178
|
+
let isExcluded = new BitSet();
|
|
3179
|
+
options.exclude && (typeof options.exclude[0] == "number" ? [options.exclude] : options.exclude).forEach((exclusion) => {
|
|
3180
|
+
for (let i = exclusion[0]; i < exclusion[1]; i += 1) isExcluded.add(i);
|
|
3181
|
+
});
|
|
3182
|
+
let shouldIndentNextCharacter = options.indentStart !== !1, indentPiece = (str) => {
|
|
3183
|
+
if (str === "") return str;
|
|
3184
|
+
let indented = str.replace(pattern, (match, offset) => offset > 0 || shouldIndentNextCharacter ? `${resolvedIndentStr}${match}` : match);
|
|
3185
|
+
return shouldIndentNextCharacter = str[str.length - 1] === `
|
|
3186
|
+
`, indented;
|
|
3187
|
+
};
|
|
3188
|
+
this.intro = indentPiece(this.intro);
|
|
3189
|
+
let charIndex = 0, chunk = this.firstChunk, indentAt = (index) => {
|
|
3190
|
+
shouldIndentNextCharacter = !1, index === chunk.start ? chunk.appendRight(resolvedIndentStr) : (this._splitChunk(chunk, index), chunk = chunk.next, chunk.prependRight(resolvedIndentStr));
|
|
3191
|
+
};
|
|
3192
|
+
for (; chunk; ) {
|
|
3193
|
+
let end = chunk.end;
|
|
3194
|
+
if (isExcluded.has(chunk.start) || (chunk.intro = indentPiece(chunk.intro)), chunk.edited)
|
|
3195
|
+
isExcluded.has(chunk.start) ? chunk.content && (shouldIndentNextCharacter = chunk.content[chunk.content.length - 1] === `
|
|
3196
|
+
`) : chunk.content = indentPiece(chunk.content);
|
|
3197
|
+
else if (options.exclude)
|
|
3198
|
+
for (charIndex = chunk.start; charIndex < end; ) {
|
|
3199
|
+
if (!isExcluded.has(charIndex)) {
|
|
3200
|
+
let char = this.original.charCodeAt(charIndex);
|
|
3201
|
+
char === NEWLINE_CHAR ? shouldIndentNextCharacter = !0 : char !== CR_CHAR && shouldIndentNextCharacter && indentAt(charIndex);
|
|
3202
|
+
}
|
|
3203
|
+
charIndex += 1;
|
|
3204
|
+
}
|
|
3205
|
+
else
|
|
3206
|
+
for (charIndex = chunk.start; charIndex < end; ) {
|
|
3207
|
+
if (!shouldIndentNextCharacter) {
|
|
3208
|
+
let nextLine = this.original.indexOf(n, charIndex);
|
|
3209
|
+
if (nextLine === -1 || nextLine >= end) break;
|
|
3210
|
+
shouldIndentNextCharacter = !0, charIndex = nextLine + 1;
|
|
3211
|
+
continue;
|
|
3212
|
+
}
|
|
3213
|
+
let char = this.original.charCodeAt(charIndex);
|
|
3214
|
+
if (char === NEWLINE_CHAR || char === CR_CHAR) {
|
|
3215
|
+
charIndex += 1;
|
|
3216
|
+
continue;
|
|
3217
|
+
}
|
|
3218
|
+
indentAt(charIndex), charIndex += 1;
|
|
3219
|
+
}
|
|
3220
|
+
isExcluded.has(chunk.end - 1) || (chunk.outro = indentPiece(chunk.outro)), charIndex = chunk.end, chunk = chunk.next;
|
|
3221
|
+
}
|
|
3222
|
+
return this.outro = indentPiece(this.outro), this;
|
|
3223
|
+
}
|
|
3224
|
+
/** @internal */
|
|
3225
|
+
insert() {
|
|
3226
|
+
throw new MagicStringError("insert() is deprecated, use appendLeft() or prependRight()");
|
|
3227
|
+
}
|
|
3228
|
+
/** @internal */
|
|
3229
|
+
insertLeft(index, content) {
|
|
3230
|
+
return warned.insertLeft || (console.warn("magicString.insertLeft(...) is deprecated. Use magicString.appendLeft(...) instead"), warned.insertLeft = !0), this.appendLeft(index, content);
|
|
3231
|
+
}
|
|
3232
|
+
/** @internal */
|
|
3233
|
+
insertRight(index, content) {
|
|
3234
|
+
return warned.insertRight || (console.warn("magicString.insertRight(...) is deprecated. Use magicString.prependRight(...) instead"), warned.insertRight = !0), this.prependRight(index, content);
|
|
3235
|
+
}
|
|
3236
|
+
/**
|
|
3237
|
+
* Moves the characters from `start` and `end` to `index`.
|
|
3238
|
+
*
|
|
3239
|
+
* `affinity` controls where the range is anchored at `index`. With the
|
|
3240
|
+
* default `'right'`, it is inserted before the content that starts at `index`;
|
|
3241
|
+
* with `'left'`, it is inserted after the content that ends at `index`. The
|
|
3242
|
+
* two differ only when other content has already been moved to that boundary,
|
|
3243
|
+
* mirroring the `appendLeft`/`appendRight` distinction.
|
|
3244
|
+
*/
|
|
3245
|
+
move(start, end, index, affinity = "right") {
|
|
3246
|
+
if (start = this._resolveIndex(start), end = this._resolveIndex(end), index = this._resolveIndex(index), start === end) return this;
|
|
3247
|
+
if (start < 0 || end > this.original.length || index < 0 || index > this.original.length) throw new MagicStringError(`range ${start}\u2013${end} is out of bounds`);
|
|
3248
|
+
if (start > end) throw new MagicStringError(`end must be greater than start (start: ${start}, end: ${end})`);
|
|
3249
|
+
if (index >= start && index <= end) throw new MagicStringError("cannot move a selection inside itself");
|
|
3250
|
+
this._split(start), this._split(end), this._split(index);
|
|
3251
|
+
let first = this.byStart.get(start), last = this.byEnd.get(end);
|
|
3252
|
+
if (!first || !last) throw new MagicStringError(`range ${start}\u2013${end} is out of bounds`);
|
|
3253
|
+
if (this.hasMovedChunks) {
|
|
3254
|
+
let cursor = first;
|
|
3255
|
+
for (; cursor !== last; )
|
|
3256
|
+
if (cursor = cursor.next, !cursor || cursor.start < start || cursor.end > end) throw new MagicStringError(`cannot move ${start} to ${end} because an earlier move split that range`);
|
|
3257
|
+
}
|
|
3258
|
+
let oldLeft = first.previous, oldRight = last.next, newLeft, newRight;
|
|
3259
|
+
if (affinity === "left")
|
|
3260
|
+
if (newLeft = this.byEnd.get(index) ?? null, newLeft) {
|
|
3261
|
+
if (newLeft.next === first) return this;
|
|
3262
|
+
newRight = newLeft.next;
|
|
3263
|
+
} else {
|
|
3264
|
+
if (first === this.firstChunk) return this;
|
|
3265
|
+
newRight = this.firstChunk;
|
|
3266
|
+
}
|
|
3267
|
+
else if (newRight = this.byStart.get(index) ?? null, newRight) {
|
|
3268
|
+
if (newRight.previous === last) return this;
|
|
3269
|
+
newLeft = newRight.previous;
|
|
3270
|
+
} else {
|
|
3271
|
+
if (last === this.lastChunk) return this;
|
|
3272
|
+
newLeft = this.lastChunk;
|
|
3273
|
+
}
|
|
3274
|
+
return oldLeft && (oldLeft.next = oldRight), oldRight && (oldRight.previous = oldLeft), newLeft && (newLeft.next = first), newRight && (newRight.previous = last), oldLeft || (this.firstChunk = oldRight), oldRight || (this.lastChunk = oldLeft, this.lastChunk.next = null), first.previous = newLeft, last.next = newRight || null, newLeft || (this.firstChunk = first), newRight || (this.lastChunk = last), this.hasMovedChunks = !0, this;
|
|
3275
|
+
}
|
|
3276
|
+
/**
|
|
3277
|
+
* Replaces the characters from `start` to `end` with `content`, along with the appended/prepended content in
|
|
3278
|
+
* that range. The same restrictions as `s.remove()` apply.
|
|
3279
|
+
*
|
|
3280
|
+
* The fourth argument is optional. It can have a storeName property - if true, the original name will be stored
|
|
3281
|
+
* for later inclusion in a sourcemap's names array - and a contentOnly property which determines whether only
|
|
3282
|
+
* the content is overwritten, or anything that was appended/prepended to the range as well.
|
|
3283
|
+
*
|
|
3284
|
+
* It may be preferred to use `s.update(...)` instead if you wish to avoid overwriting the appended/prepended content.
|
|
3285
|
+
*/
|
|
3286
|
+
overwrite(start, end, content, options) {
|
|
3287
|
+
if (options === !0)
|
|
3288
|
+
return warned.storeName || (console.warn("The final argument to magicString.overwrite(...) should be an options object. See https://github.com/rich-harris/magic-string"), warned.storeName = !0), this.update(start, end, content, {
|
|
3289
|
+
storeName: !0,
|
|
3290
|
+
overwrite: !0
|
|
3291
|
+
});
|
|
3292
|
+
let optionObject = typeof options == "object" && options ? options : {};
|
|
3293
|
+
return this.update(start, end, content, {
|
|
3294
|
+
...optionObject,
|
|
3295
|
+
overwrite: !optionObject.contentOnly
|
|
3296
|
+
});
|
|
3297
|
+
}
|
|
3298
|
+
/**
|
|
3299
|
+
* Replaces the characters from `start` to `end` with `content`. The same restrictions as `s.remove()` apply.
|
|
3300
|
+
*
|
|
3301
|
+
* The fourth argument is optional. It can have a storeName property - if true, the original name will be stored
|
|
3302
|
+
* for later inclusion in a sourcemap's names array - and an overwrite property which determines whether only
|
|
3303
|
+
* the content is overwritten, or anything that was appended/prepended to the range as well.
|
|
3304
|
+
*/
|
|
3305
|
+
update(start, end, content, options) {
|
|
3306
|
+
if (start = this._resolveIndex(start), end = this._resolveIndex(end), typeof content != "string") throw new MagicStringError(`content must be a string, got ${typeof content}`);
|
|
3307
|
+
if (start < 0) throw new MagicStringError(`start ${start} is out of bounds`);
|
|
3308
|
+
if (end > this.original.length) throw new MagicStringError(`end ${end} is out of bounds`);
|
|
3309
|
+
if (start === end) throw new MagicStringError(`cannot overwrite a zero-length range at ${start}, use appendLeft() or prependRight()`);
|
|
3310
|
+
if (start > end) throw new MagicStringError(`end must be greater than start (start: ${start}, end: ${end})`);
|
|
3311
|
+
this._split(start), this._split(end), options === !0 && (warned.storeName || (console.warn("The final argument to magicString.overwrite(...) should be an options object. See https://github.com/rich-harris/magic-string"), warned.storeName = !0), options = { storeName: !0 });
|
|
3312
|
+
let optionObject = typeof options == "object" && options ? options : {}, storeName = optionObject.storeName || !1, overwrite = optionObject.overwrite || !1;
|
|
3313
|
+
storeName && this.storedNames.add(this.original.slice(start, end));
|
|
3314
|
+
let first = this.byStart.get(start);
|
|
3315
|
+
for (let chunk = first; chunk.end < end; ) {
|
|
3316
|
+
let next = chunk.next;
|
|
3317
|
+
if (next === null || next !== this.byStart.get(chunk.end)) throw new MagicStringError("cannot overwrite across a split point");
|
|
3318
|
+
chunk = next;
|
|
3319
|
+
}
|
|
3320
|
+
for (let chunk = first.next; chunk !== null && chunk.start < end; chunk = chunk.next)
|
|
3321
|
+
chunk.edit("", !1, !overwrite), chunk.replacesUntil = -1, chunk.replacedFrom = start;
|
|
3322
|
+
return first.edit(content, storeName, !overwrite), first.replacesUntil = end, first.replacedFrom = -1, this;
|
|
3323
|
+
}
|
|
3324
|
+
/**
|
|
3325
|
+
* Prepends the string with the specified content.
|
|
3326
|
+
*/
|
|
3327
|
+
prepend(content) {
|
|
3328
|
+
if (typeof content != "string") throw new MagicStringError(`content must be a string, got ${typeof content}`);
|
|
3329
|
+
return this.intro = content + this.intro, this;
|
|
3330
|
+
}
|
|
3331
|
+
/**
|
|
3332
|
+
* Same as `s.appendLeft(...)`, except that the inserted content will go *before* any previous appends or prepends at index
|
|
3333
|
+
*/
|
|
3334
|
+
prependLeft(index, content) {
|
|
3335
|
+
if (index = this._resolveIndex(index), index < 0 || index > this.original.length) throw new MagicStringError(`index ${index} is out of bounds`);
|
|
3336
|
+
if (typeof content != "string") throw new MagicStringError(`content must be a string, got ${typeof content}`);
|
|
3337
|
+
this._split(index);
|
|
3338
|
+
let chunk = this.byEnd.get(index);
|
|
3339
|
+
return chunk ? chunk.prependLeft(content) : this.intro = content + this.intro, this;
|
|
3340
|
+
}
|
|
3341
|
+
/**
|
|
3342
|
+
* Same as `s.appendRight(...)`, except that the inserted content will go *before* any previous appends or prepends at `index`
|
|
3343
|
+
*/
|
|
3344
|
+
prependRight(index, content) {
|
|
3345
|
+
if (index = this._resolveIndex(index), index < 0 || index > this.original.length) throw new MagicStringError(`index ${index} is out of bounds`);
|
|
3346
|
+
if (typeof content != "string") throw new MagicStringError(`content must be a string, got ${typeof content}`);
|
|
3347
|
+
this._split(index);
|
|
3348
|
+
let chunk = this.byStart.get(index);
|
|
3349
|
+
return chunk ? chunk.prependRight(content) : this.outro = content + this.outro, this;
|
|
3350
|
+
}
|
|
3351
|
+
/**
|
|
3352
|
+
* Removes the characters from `start` to `end` (of the original string, **not** the generated string).
|
|
3353
|
+
* Content appended or prepended at positions strictly inside the range is removed with it, while
|
|
3354
|
+
* content attached at `start` or `end` is preserved — use `s.overwrite(start, end, '')` to remove
|
|
3355
|
+
* the range including its edge inserts.
|
|
3356
|
+
* Repeated removals and removals with partially overlapping ranges are allowed.
|
|
3357
|
+
*/
|
|
3358
|
+
remove(start, end) {
|
|
3359
|
+
if (start = this._resolveIndex(start), end = this._resolveIndex(end), start === end) return this;
|
|
3360
|
+
if (start < 0 || end > this.original.length) throw new MagicStringError(`range ${start}\u2013${end} is out of bounds`);
|
|
3361
|
+
if (start > end) throw new MagicStringError(`end must be greater than start (start: ${start}, end: ${end})`);
|
|
3362
|
+
this._split(start), this._split(end);
|
|
3363
|
+
let chunk = this.byStart.get(start);
|
|
3364
|
+
for (; chunk; )
|
|
3365
|
+
chunk.start > start && (chunk.intro = ""), chunk.end < end && (chunk.outro = ""), chunk.edit("", !1, !0), chunk.replacesUntil = -1, chunk.replacedFrom = -1, chunk = end > chunk.end ? this.byStart.get(chunk.end) : void 0;
|
|
3366
|
+
return this;
|
|
3367
|
+
}
|
|
3368
|
+
/**
|
|
3369
|
+
* Reset the modified characters from `start` to `end` (of the original string, **not** the generated string).
|
|
3370
|
+
*/
|
|
3371
|
+
reset(start, end) {
|
|
3372
|
+
if (start = this._resolveIndex(start), end = this._resolveIndex(end), start === end) return this;
|
|
3373
|
+
if (start < 0 || end > this.original.length) throw new MagicStringError(`range ${start}\u2013${end} is out of bounds`);
|
|
3374
|
+
if (start > end) throw new MagicStringError(`end must be greater than start (start: ${start}, end: ${end})`);
|
|
3375
|
+
this._split(start), this._split(end);
|
|
3376
|
+
let chunk = this.byStart.get(start);
|
|
3377
|
+
for (; chunk; )
|
|
3378
|
+
chunk.reset(), chunk = end > chunk.end ? this.byStart.get(chunk.end) : void 0;
|
|
3379
|
+
return this;
|
|
3380
|
+
}
|
|
3381
|
+
/**
|
|
3382
|
+
* Returns the last character of the generated string, or `''` if it is empty.
|
|
3383
|
+
*/
|
|
3384
|
+
lastChar() {
|
|
3385
|
+
if (this.outro.length) return this.outro[this.outro.length - 1];
|
|
3386
|
+
let chunk = this.lastChunk;
|
|
3387
|
+
for (; chunk; ) {
|
|
3388
|
+
if (chunk.outro.length) return chunk.outro[chunk.outro.length - 1];
|
|
3389
|
+
if (chunk.content.length) return chunk.content[chunk.content.length - 1];
|
|
3390
|
+
if (chunk.intro.length) return chunk.intro[chunk.intro.length - 1];
|
|
3391
|
+
chunk = chunk.previous;
|
|
3392
|
+
}
|
|
3393
|
+
return this.intro.length ? this.intro[this.intro.length - 1] : "";
|
|
3394
|
+
}
|
|
3395
|
+
/**
|
|
3396
|
+
* Returns everything after the last newline in the generated string, or the whole string if there is no newline.
|
|
3397
|
+
*/
|
|
3398
|
+
lastLine() {
|
|
3399
|
+
let lineIndex = this.outro.lastIndexOf(n);
|
|
3400
|
+
if (lineIndex !== -1) return this.outro.slice(lineIndex + 1);
|
|
3401
|
+
let lineStr = this.outro, chunk = this.lastChunk;
|
|
3402
|
+
for (; chunk; ) {
|
|
3403
|
+
if (chunk.outro.length > 0) {
|
|
3404
|
+
if (lineIndex = chunk.outro.lastIndexOf(n), lineIndex !== -1) return chunk.outro.slice(lineIndex + 1) + lineStr;
|
|
3405
|
+
lineStr = chunk.outro + lineStr;
|
|
3406
|
+
}
|
|
3407
|
+
if (chunk.content.length > 0) {
|
|
3408
|
+
if (lineIndex = chunk.content.lastIndexOf(n), lineIndex !== -1) return chunk.content.slice(lineIndex + 1) + lineStr;
|
|
3409
|
+
lineStr = chunk.content + lineStr;
|
|
3410
|
+
}
|
|
3411
|
+
if (chunk.intro.length > 0) {
|
|
3412
|
+
if (lineIndex = chunk.intro.lastIndexOf(n), lineIndex !== -1) return chunk.intro.slice(lineIndex + 1) + lineStr;
|
|
3413
|
+
lineStr = chunk.intro + lineStr;
|
|
3414
|
+
}
|
|
3415
|
+
chunk = chunk.previous;
|
|
3416
|
+
}
|
|
3417
|
+
return lineIndex = this.intro.lastIndexOf(n), lineIndex !== -1 ? this.intro.slice(lineIndex + 1) + lineStr : this.intro + lineStr;
|
|
3418
|
+
}
|
|
3419
|
+
/**
|
|
3420
|
+
* Returns the content of the generated string that corresponds to the slice
|
|
3421
|
+
* between `start` and `end` of the original string, walking the generated
|
|
3422
|
+
* string from the chunk holding `start` to the chunk holding `end`. Throws
|
|
3423
|
+
* if either index falls inside replaced content. After `move()`, a range
|
|
3424
|
+
* whose end now comes before its start in the output yields `''`.
|
|
3425
|
+
*/
|
|
3426
|
+
slice(start = 0, end = this.original.length - this.offset) {
|
|
3427
|
+
start = this._resolveIndex(start), end = this._resolveIndex(end);
|
|
3428
|
+
let result = "", chunk;
|
|
3429
|
+
if (this.hasMovedChunks)
|
|
3430
|
+
for (chunk = this.firstChunk; chunk && (chunk.start > start || chunk.end <= start); ) {
|
|
3431
|
+
if (chunk.start < end && chunk.end >= end || end === 0 && chunk.start === 0) return result;
|
|
3432
|
+
chunk = chunk.next;
|
|
3433
|
+
}
|
|
3434
|
+
else {
|
|
3435
|
+
if (start >= end) return result;
|
|
3436
|
+
chunk = this._chunkAt(start);
|
|
3437
|
+
}
|
|
3438
|
+
if (chunk && chunk.edited && chunk.start !== start) throw new MagicStringError(`cannot use edited character ${start} as slice start anchor`);
|
|
3439
|
+
let startChunk = chunk;
|
|
3440
|
+
for (; chunk && !(end === 0 && chunk.start === 0); ) {
|
|
3441
|
+
chunk.intro && (startChunk !== chunk || chunk.start === start) && (result += chunk.intro);
|
|
3442
|
+
let containsEnd = chunk.start < end && chunk.end >= end;
|
|
3443
|
+
if (containsEnd && chunk.edited && chunk.end !== end) throw new MagicStringError(`cannot use edited character ${end} as slice end anchor`);
|
|
3444
|
+
let sliceStart = startChunk === chunk ? start - chunk.start : 0, sliceEnd = containsEnd ? chunk.content.length + end - chunk.end : chunk.content.length;
|
|
3445
|
+
if (result += chunk.content.slice(sliceStart, sliceEnd), chunk.outro && (!containsEnd || chunk.end === end) && (result += chunk.outro), containsEnd) break;
|
|
3446
|
+
chunk = chunk.next;
|
|
3447
|
+
}
|
|
3448
|
+
return result;
|
|
3449
|
+
}
|
|
3450
|
+
/**
|
|
3451
|
+
* Returns a clone of `s`, with all content before the `start` and `end` characters of the original string removed.
|
|
3452
|
+
*/
|
|
3453
|
+
snip(start, end) {
|
|
3454
|
+
let clone = this.clone();
|
|
3455
|
+
return clone.remove(-clone.offset, start), clone.remove(end, clone.original.length - clone.offset), clone;
|
|
3456
|
+
}
|
|
3457
|
+
/**
|
|
3458
|
+
* Applies `offset`, resolves a negative index from the end of `original` as
|
|
3459
|
+
* `update`/`remove` always have, and rejects anything that is not an integer.
|
|
3460
|
+
* Bounds are checked by the caller, because the methods report them differently.
|
|
3461
|
+
*
|
|
3462
|
+
* @internal
|
|
3463
|
+
*/
|
|
3464
|
+
_resolveIndex(index) {
|
|
3465
|
+
let resolved = index + this.offset;
|
|
3466
|
+
if (!Number.isInteger(resolved)) throw new MagicStringError(`index must be an integer, got ${index}`);
|
|
3467
|
+
return resolved < 0 && this.original.length !== 0 ? Math.max(0, resolved + this.original.length) : resolved;
|
|
3468
|
+
}
|
|
3469
|
+
/**
|
|
3470
|
+
* The chunk whose original range holds `index` (`chunk.start <= index < chunk.end`),
|
|
3471
|
+
* or `undefined` when `index` is at or past the end. Searches from the last
|
|
3472
|
+
* visited chunk so that scans over nearby indices stay cheap.
|
|
3473
|
+
*
|
|
3474
|
+
* @internal
|
|
3475
|
+
*/
|
|
3476
|
+
_chunkAt(index) {
|
|
3477
|
+
let chunk = this.byStart.get(index);
|
|
3478
|
+
if (chunk) return chunk;
|
|
3479
|
+
chunk = this.lastSearchedChunk;
|
|
3480
|
+
let searchForward = index >= chunk.end;
|
|
3481
|
+
for (; chunk && !chunk.contains(index); ) chunk = searchForward ? this.byStart.get(chunk.end) : this.byEnd.get(chunk.start);
|
|
3482
|
+
return chunk && (this.lastSearchedChunk = chunk), chunk;
|
|
3483
|
+
}
|
|
3484
|
+
/** @internal */
|
|
3485
|
+
_split(index) {
|
|
3486
|
+
if (this.byStart.get(index) || this.byEnd.get(index)) return;
|
|
3487
|
+
let chunk = this.lastSearchedChunk, previousChunk = chunk, searchForward = index > chunk.end;
|
|
3488
|
+
for (; chunk; ) {
|
|
3489
|
+
if (chunk.contains(index)) return this._splitChunk(chunk, index);
|
|
3490
|
+
if (chunk = searchForward ? this.byStart.get(chunk.end) : this.byEnd.get(chunk.start), chunk === previousChunk) return;
|
|
3491
|
+
previousChunk = chunk;
|
|
3492
|
+
}
|
|
3493
|
+
}
|
|
3494
|
+
/** @internal */
|
|
3495
|
+
_splitChunk(chunk, index) {
|
|
3496
|
+
if (chunk.edited && chunk.content.length) {
|
|
3497
|
+
let loc = getLocator(this.original)(index);
|
|
3498
|
+
throw new MagicStringError(`cannot split a chunk that has already been edited (${loc.line}:${loc.column} \u2013 "${chunk.original}")`);
|
|
3499
|
+
}
|
|
3500
|
+
let newChunk = chunk.split(index);
|
|
3501
|
+
return this.byEnd.set(index, chunk), this.byStart.set(index, newChunk), this.byEnd.set(newChunk.end, newChunk), chunk === this.lastChunk && (this.lastChunk = newChunk), this.lastSearchedChunk = chunk, !0;
|
|
3502
|
+
}
|
|
3503
|
+
/**
|
|
3504
|
+
* Returns the generated string.
|
|
3505
|
+
*/
|
|
3506
|
+
toString() {
|
|
3507
|
+
let str = this.intro, chunk = this.firstChunk;
|
|
3508
|
+
for (; chunk; )
|
|
3509
|
+
str += chunk.toString(), chunk = chunk.next;
|
|
3510
|
+
return str + this.outro;
|
|
3511
|
+
}
|
|
3512
|
+
/**
|
|
3513
|
+
* Returns true if the resulting source is empty (disregarding white space).
|
|
3514
|
+
*/
|
|
3515
|
+
isEmpty() {
|
|
3516
|
+
if (this.intro.length && this.intro.trim()) return !1;
|
|
3517
|
+
let chunk = this.firstChunk;
|
|
3518
|
+
for (; chunk; ) {
|
|
3519
|
+
if (chunk.intro.length && chunk.intro.trim() || chunk.content.length && chunk.content.trim() || chunk.outro.length && chunk.outro.trim()) return !1;
|
|
3520
|
+
chunk = chunk.next;
|
|
3521
|
+
}
|
|
3522
|
+
return !(this.outro.length && this.outro.trim());
|
|
3523
|
+
}
|
|
3524
|
+
/**
|
|
3525
|
+
* Returns the length of the generated string, counting only content attached to the original characters.
|
|
3526
|
+
* Content outside the string body (`s.prepend()`/`s.append()`, and inserts before the first or after the last
|
|
3527
|
+
* character) is not counted, so this can differ from `s.toString().length`.
|
|
3528
|
+
*/
|
|
3529
|
+
length() {
|
|
3530
|
+
let chunk = this.firstChunk, length = 0;
|
|
3531
|
+
for (; chunk; )
|
|
3532
|
+
length += chunk.intro.length + chunk.content.length + chunk.outro.length, chunk = chunk.next;
|
|
3533
|
+
return length;
|
|
3534
|
+
}
|
|
3535
|
+
/**
|
|
3536
|
+
* Removes empty lines from the start and end.
|
|
3537
|
+
*/
|
|
3538
|
+
trimLines() {
|
|
3539
|
+
return this.trim("[\\r\\n]");
|
|
3540
|
+
}
|
|
3541
|
+
/**
|
|
3542
|
+
* Trims content matching `charType` (defaults to `\s`, i.e. whitespace) from the start and end.
|
|
3543
|
+
*/
|
|
3544
|
+
trim(charType) {
|
|
3545
|
+
return this.trimStart(charType).trimEnd(charType);
|
|
3546
|
+
}
|
|
3547
|
+
/** @internal */
|
|
3548
|
+
trimEndAborted(charType) {
|
|
3549
|
+
let rx = new RegExp(`${charType || "\\s"}+$`);
|
|
3550
|
+
if (this.outro = this.outro.replace(rx, ""), this.outro.length) return !0;
|
|
3551
|
+
let chunk = this.lastChunk;
|
|
3552
|
+
do {
|
|
3553
|
+
let end = chunk.end, aborted = chunk.trimEnd(rx);
|
|
3554
|
+
if (chunk.end !== end) {
|
|
3555
|
+
let next = chunk.next;
|
|
3556
|
+
this.lastChunk === chunk && (this.lastChunk = next), this.byEnd.set(chunk.end, chunk), this.byStart.set(next.start, next), this.byEnd.set(next.end, next);
|
|
3557
|
+
}
|
|
3558
|
+
if (aborted) return !0;
|
|
3559
|
+
chunk = chunk.previous;
|
|
3560
|
+
} while (chunk);
|
|
3561
|
+
return this.intro = this.intro.replace(rx, ""), this.intro.length > 0;
|
|
3562
|
+
}
|
|
3563
|
+
/**
|
|
3564
|
+
* Trims content matching `charType` (defaults to `\s`, i.e. whitespace) from the end.
|
|
3565
|
+
*/
|
|
3566
|
+
trimEnd(charType) {
|
|
3567
|
+
return this.trimEndAborted(charType), this;
|
|
3568
|
+
}
|
|
3569
|
+
/** @internal */
|
|
3570
|
+
trimStartAborted(charType) {
|
|
3571
|
+
let rx = new RegExp(`^${charType || "\\s"}+`);
|
|
3572
|
+
if (this.intro = this.intro.replace(rx, ""), this.intro.length) return !0;
|
|
3573
|
+
let chunk = this.firstChunk;
|
|
3574
|
+
do {
|
|
3575
|
+
let end = chunk.end, aborted = chunk.trimStart(rx);
|
|
3576
|
+
if (chunk.end !== end) {
|
|
3577
|
+
let next = chunk.next;
|
|
3578
|
+
chunk === this.lastChunk && (this.lastChunk = next), this.byEnd.set(chunk.end, chunk), this.byStart.set(next.start, next), this.byEnd.set(next.end, next);
|
|
3579
|
+
}
|
|
3580
|
+
if (aborted) return !0;
|
|
3581
|
+
chunk = chunk.next;
|
|
3582
|
+
} while (chunk);
|
|
3583
|
+
return this.outro = this.outro.replace(rx, ""), this.outro.length > 0;
|
|
3584
|
+
}
|
|
3585
|
+
/**
|
|
3586
|
+
* Trims content matching `charType` (defaults to `\s`, i.e. whitespace) from the start.
|
|
3587
|
+
*/
|
|
3588
|
+
trimStart(charType) {
|
|
3589
|
+
return this.trimStartAborted(charType), this;
|
|
3590
|
+
}
|
|
3591
|
+
/**
|
|
3592
|
+
* Indicates if the string has been changed.
|
|
3593
|
+
*/
|
|
3594
|
+
hasChanged() {
|
|
3595
|
+
if (this.intro || this.outro) return !0;
|
|
3596
|
+
let outputIndex = 0, chunk = this.firstChunk;
|
|
3597
|
+
for (; chunk; ) {
|
|
3598
|
+
if (chunk.intro || chunk.outro) return !0;
|
|
3599
|
+
if (!chunk.edited && chunk.start === outputIndex) outputIndex = chunk.end;
|
|
3600
|
+
else {
|
|
3601
|
+
if (!this.original.startsWith(chunk.content, outputIndex)) return !0;
|
|
3602
|
+
outputIndex += chunk.content.length;
|
|
3603
|
+
}
|
|
3604
|
+
chunk = chunk.next;
|
|
3605
|
+
}
|
|
3606
|
+
return outputIndex !== this.original.length;
|
|
3607
|
+
}
|
|
3608
|
+
/**
|
|
3609
|
+
* Whether the original range [start, end) has had any of its characters
|
|
3610
|
+
* removed. `replace`/`replaceAll` search `original`, so a match can land on
|
|
3611
|
+
* text that is no longer in the output - overwriting it would resurrect the
|
|
3612
|
+
* removed characters, so such matches are skipped instead.
|
|
3613
|
+
*
|
|
3614
|
+
* @internal
|
|
3615
|
+
*/
|
|
3616
|
+
_hasRemovedContent(start, end) {
|
|
3617
|
+
let atBoundary = this.byStart.get(start);
|
|
3618
|
+
if (atBoundary && start === end) {
|
|
3619
|
+
let previous = this.byEnd.get(start);
|
|
3620
|
+
return !!previous && previous.content === "" && atBoundary.content === "";
|
|
3621
|
+
}
|
|
3622
|
+
let chunk = this._chunkAt(start);
|
|
3623
|
+
for (; chunk && chunk.start < end; ) {
|
|
3624
|
+
if (chunk.content === "" && (chunk.replacedFrom < start || this.byStart.get(chunk.replacedFrom).replacesUntil < chunk.end)) return !0;
|
|
3625
|
+
chunk = this.byStart.get(chunk.end);
|
|
3626
|
+
}
|
|
3627
|
+
return !1;
|
|
3628
|
+
}
|
|
3629
|
+
/** @internal */
|
|
3630
|
+
_replaceRegexp(searchValue, replacement) {
|
|
3631
|
+
function getReplacement(match, index, str) {
|
|
3632
|
+
return typeof replacement == "string" ? expandReplacement(replacement, match[0], index, str, match.slice(1), match.groups) : match.groups === void 0 ? replacement(match[0], ...match.slice(1), index, str) : replacement(match[0], ...match.slice(1), index, str, match.groups);
|
|
3633
|
+
}
|
|
3634
|
+
let replaceMatch = (match) => {
|
|
3635
|
+
if (match.index == null || this._hasRemovedContent(match.index, match.index + match[0].length)) return !1;
|
|
3636
|
+
let replacement2 = getReplacement(match, match.index, this.original);
|
|
3637
|
+
return replacement2 === match[0] || (match[0].length === 0 ? this.appendRight(match.index - this.offset, replacement2) : this.overwrite(match.index - this.offset, match.index + match[0].length - this.offset, replacement2)), !0;
|
|
3638
|
+
};
|
|
3639
|
+
if (searchValue.global) {
|
|
3640
|
+
searchValue.lastIndex = 0;
|
|
3641
|
+
for (let match of this.original.matchAll(searchValue)) replaceMatch(match);
|
|
3642
|
+
} else {
|
|
3643
|
+
let match = this.original.match(searchValue);
|
|
3644
|
+
if (match && !replaceMatch(match)) {
|
|
3645
|
+
let global = new RegExp(searchValue.source, `${searchValue.flags}g`);
|
|
3646
|
+
for (let next of this.original.matchAll(global)) if (replaceMatch(next)) break;
|
|
3647
|
+
}
|
|
3648
|
+
}
|
|
3649
|
+
return this;
|
|
3650
|
+
}
|
|
3651
|
+
/** @internal */
|
|
3652
|
+
_replaceString(string, replacement) {
|
|
3653
|
+
let { original } = this, index = original.indexOf(string);
|
|
3654
|
+
for (; index !== -1; ) {
|
|
3655
|
+
if (this._hasRemovedContent(index, index + string.length)) {
|
|
3656
|
+
index = original.indexOf(string, index + string.length);
|
|
3657
|
+
continue;
|
|
3658
|
+
}
|
|
3659
|
+
typeof replacement == "function" ? replacement = replacement(string, index, original) : replacement = expandReplacement(replacement, string, index, original, [], void 0), string !== replacement && (string.length === 0 ? this.appendRight(index - this.offset, replacement) : this.overwrite(index - this.offset, index + string.length - this.offset, replacement));
|
|
3660
|
+
break;
|
|
3661
|
+
}
|
|
3662
|
+
return this;
|
|
3663
|
+
}
|
|
3664
|
+
/**
|
|
3665
|
+
* String replacement with RegExp or string.
|
|
3666
|
+
*/
|
|
3667
|
+
replace(searchValue, replacement) {
|
|
3668
|
+
return typeof searchValue == "string" ? this._replaceString(searchValue, replacement) : this._replaceRegexp(searchValue, replacement);
|
|
3669
|
+
}
|
|
3670
|
+
/** @internal */
|
|
3671
|
+
_replaceAllString(string, replacement) {
|
|
3672
|
+
let { original } = this, stringLength = string.length;
|
|
3673
|
+
if (stringLength === 0) {
|
|
3674
|
+
for (let index = 0; index <= original.length; index += 1) {
|
|
3675
|
+
if (this._hasRemovedContent(index, index)) continue;
|
|
3676
|
+
let _replacement = typeof replacement == "function" ? replacement("", index, original) : expandReplacement(replacement, "", index, original, [], void 0);
|
|
3677
|
+
_replacement !== "" && this.appendRight(index - this.offset, _replacement);
|
|
3678
|
+
}
|
|
3679
|
+
return this;
|
|
3680
|
+
}
|
|
3681
|
+
for (let index = original.indexOf(string); index !== -1; index = original.indexOf(string, index + stringLength)) {
|
|
3682
|
+
if (this._hasRemovedContent(index, index + stringLength)) continue;
|
|
3683
|
+
let previous = original.slice(index, index + stringLength), _replacement = typeof replacement == "function" ? replacement(previous, index, original) : expandReplacement(replacement, previous, index, original, [], void 0);
|
|
3684
|
+
previous !== _replacement && this.overwrite(index - this.offset, index + stringLength - this.offset, _replacement);
|
|
3685
|
+
}
|
|
3686
|
+
return this;
|
|
3687
|
+
}
|
|
3688
|
+
/**
|
|
3689
|
+
* Same as `s.replace`, but replace all matched strings instead of just one.
|
|
3690
|
+
*/
|
|
3691
|
+
replaceAll(searchValue, replacement) {
|
|
3692
|
+
if (typeof searchValue == "string") return this._replaceAllString(searchValue, replacement);
|
|
3693
|
+
if (!searchValue.global) throw new MagicStringError("replaceAll() requires a global RegExp");
|
|
3694
|
+
return this._replaceRegexp(searchValue, replacement);
|
|
3695
|
+
}
|
|
3696
|
+
};
|
|
3697
|
+
|
|
3698
|
+
// src/loaders/react-docgen-loader.ts
|
|
3699
|
+
var TsconfigPaths = __toESM(require_lib2(), 1);
|
|
18
3700
|
import {
|
|
19
3701
|
ERROR_CODES,
|
|
20
3702
|
builtinHandlers as docgenHandlers,
|
|
@@ -23,11 +3705,10 @@ import {
|
|
|
23
3705
|
parse,
|
|
24
3706
|
utils
|
|
25
3707
|
} from "react-docgen";
|
|
26
|
-
import * as TsconfigPaths from "tsconfig-paths";
|
|
27
3708
|
|
|
28
3709
|
// src/loaders/docgen-resolver.ts
|
|
3710
|
+
var import_resolve = __toESM(require_resolve(), 1);
|
|
29
3711
|
import { extname } from "node:path";
|
|
30
|
-
import resolve from "resolve";
|
|
31
3712
|
var ReactDocgenResolveError = class extends Error {
|
|
32
3713
|
constructor(filename) {
|
|
33
3714
|
super(`'${filename}' was ignored by react-docgen.`);
|
|
@@ -60,7 +3741,7 @@ function defaultLookupModule(filename, basedir) {
|
|
|
60
3741
|
includeCoreModules: !1
|
|
61
3742
|
};
|
|
62
3743
|
try {
|
|
63
|
-
return
|
|
3744
|
+
return import_resolve.default.sync(filename, resolveOptions);
|
|
64
3745
|
} catch (error) {
|
|
65
3746
|
let ext = extname(filename), newFilename;
|
|
66
3747
|
switch (ext) {
|
|
@@ -69,7 +3750,7 @@ function defaultLookupModule(filename, basedir) {
|
|
|
69
3750
|
case ".cjs": {
|
|
70
3751
|
let base = filename.slice(0, -2);
|
|
71
3752
|
try {
|
|
72
|
-
return
|
|
3753
|
+
return import_resolve.default.sync(`${base}ts`, { ...resolveOptions, extensions: [] });
|
|
73
3754
|
} catch {
|
|
74
3755
|
newFilename = `${base}tsx`;
|
|
75
3756
|
}
|
|
@@ -81,7 +3762,7 @@ function defaultLookupModule(filename, basedir) {
|
|
|
81
3762
|
default:
|
|
82
3763
|
throw error;
|
|
83
3764
|
}
|
|
84
|
-
return
|
|
3765
|
+
return import_resolve.default.sync(newFilename, {
|
|
85
3766
|
...resolveOptions,
|
|
86
3767
|
// we already know that there is an extension at this point, so no need to check other extensions
|
|
87
3768
|
extensions: []
|
|
@@ -153,7 +3834,7 @@ async function reactDocgenLoader(source, map) {
|
|
|
153
3834
|
}
|
|
154
3835
|
function getReactDocgenImporter(matchingPath) {
|
|
155
3836
|
return makeFsImporter((filename, basedir) => {
|
|
156
|
-
let mappedFilenameByPaths = matchingPath && matchingPath(filename) || filename, result = defaultLookupModule(mappedFilenameByPaths, basedir);
|
|
3837
|
+
let mappedFilenameByPaths = matchingPath && matchingPath(filename, void 0, void 0, RESOLVE_EXTENSIONS) || filename, result = defaultLookupModule(mappedFilenameByPaths, basedir);
|
|
157
3838
|
if (RESOLVE_EXTENSIONS.find((ext) => result.endsWith(ext)))
|
|
158
3839
|
return result;
|
|
159
3840
|
throw new ReactDocgenResolveError(filename);
|