rolldown 1.0.0-beta.7-commit.25f3c61 → 1.0.0-beta.7-commit.8d551a2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (32) hide show
  1. package/bin/cli.mjs +2 -0
  2. package/dist/{cjs/cli.cjs → cli.cjs} +4 -5
  3. package/dist/cli.mjs +1829 -0
  4. package/dist/{cjs/experimental-index.cjs → experimental-index.cjs} +3 -3
  5. package/dist/{esm/experimental-index.mjs → experimental-index.mjs} +13 -2
  6. package/dist/{cjs/index.cjs → index.cjs} +2 -2
  7. package/dist/index.mjs +5 -0
  8. package/dist/{cjs/parallel-plugin-worker.cjs → parallel-plugin-worker.cjs} +3 -4
  9. package/dist/parallel-plugin-worker.mjs +47 -0
  10. package/dist/parse-ast-index.cjs +4 -0
  11. package/dist/parse-ast-index.mjs +4 -0
  12. package/dist/shared/chunk-DUYDk_2O.mjs +33 -0
  13. package/dist/shared/{parse-ast-index-DNOUVcBy.mjs → parse-ast-index-5U4JtZBO.mjs} +108 -110
  14. package/dist/shared/{parse-ast-index-0ei4fTjl.cjs → parse-ast-index-BfKb9n4T.cjs} +1 -1
  15. package/dist/shared/prompt-W5YHe0v6.mjs +854 -0
  16. package/dist/shared/src-B5-P3A9k.mjs +4311 -0
  17. package/dist/shared/{src-BPcsb-4N.cjs → src-DrZP0HZs.cjs} +15 -4
  18. package/dist/tsconfig.tsbuildinfo +1 -1
  19. package/dist/types/api/rolldown/rolldown-build.d.ts +1 -0
  20. package/dist/types/binding.d.ts +8 -2
  21. package/dist/types/options/input-options.d.ts +5 -1
  22. package/package.json +34 -33
  23. package/bin/cli.js +0 -2
  24. package/dist/cjs/parse-ast-index.cjs +0 -4
  25. package/dist/esm/cli.mjs +0 -1755
  26. package/dist/esm/index.mjs +0 -4
  27. package/dist/esm/parallel-plugin-worker.mjs +0 -41
  28. package/dist/esm/parse-ast-index.mjs +0 -3
  29. package/dist/shared/prompt-C6jWWCza.mjs +0 -852
  30. package/dist/shared/src-DllTyFDp.mjs +0 -2888
  31. /package/dist/{cjs/parallel-plugin.cjs → parallel-plugin.cjs} +0 -0
  32. /package/dist/{esm/parallel-plugin.mjs → parallel-plugin.mjs} +0 -0
@@ -0,0 +1,4311 @@
1
+ import { __esm } from "./chunk-DUYDk_2O.mjs";
2
+ import { augmentCodeLocation, colors, error, import_binding, init_colors, init_logs, init_parse_ast_index, logCycleLoading, logInputHookInOutputPlugin, logInvalidLogPosition, logMinifyWarning, logMultiplyNotifyOption, logPluginError, parseAst } from "./parse-ast-index-5U4JtZBO.mjs";
3
+ import path from "node:path";
4
+ import { toJsonSchema } from "@valibot/to-json-schema";
5
+ import * as v from "valibot";
6
+ import { Buffer } from "node:buffer";
7
+ import { availableParallelism } from "node:os";
8
+ import { Worker } from "node:worker_threads";
9
+
10
+ //#region package.json
11
+ var version = "1.0.0-beta.7-commit.8d551a2";
12
+ var description = "Fast JavaScript/TypeScript bundler in Rust with Rollup-compatible API.";
13
+
14
+ //#endregion
15
+ //#region src/builtin-plugin/utils.ts
16
+ function makeBuiltinPluginCallable(plugin) {
17
+ let callablePlugin = new import_binding.BindingCallableBuiltinPlugin(bindingifyBuiltInPlugin(plugin));
18
+ const wrappedPlugin = plugin;
19
+ for (const key in callablePlugin) wrappedPlugin[key] = function(...args) {
20
+ return callablePlugin[key](...args);
21
+ };
22
+ return wrappedPlugin;
23
+ }
24
+ function bindingifyBuiltInPlugin(plugin) {
25
+ return {
26
+ __name: plugin.name,
27
+ options: plugin._options
28
+ };
29
+ }
30
+ var init_utils = __esm({ "src/builtin-plugin/utils.ts"() {} });
31
+
32
+ //#endregion
33
+ //#region src/builtin-plugin/constructors.ts
34
+ function modulePreloadPolyfillPlugin(config) {
35
+ return new BuiltinPlugin("builtin:module-preload-polyfill", config);
36
+ }
37
+ function dynamicImportVarsPlugin() {
38
+ return new BuiltinPlugin("builtin:dynamic-import-vars");
39
+ }
40
+ function importGlobPlugin(config) {
41
+ return new BuiltinPlugin("builtin:import-glob", config);
42
+ }
43
+ function manifestPlugin(config) {
44
+ return new BuiltinPlugin("builtin:manifest", config);
45
+ }
46
+ function wasmHelperPlugin() {
47
+ return new BuiltinPlugin("builtin:wasm-helper");
48
+ }
49
+ function wasmFallbackPlugin() {
50
+ return new BuiltinPlugin("builtin:wasm-fallback");
51
+ }
52
+ function loadFallbackPlugin() {
53
+ return new BuiltinPlugin("builtin:load-fallback");
54
+ }
55
+ function jsonPlugin(config) {
56
+ return new BuiltinPlugin("builtin:json", config);
57
+ }
58
+ function buildImportAnalysisPlugin(config) {
59
+ return new BuiltinPlugin("builtin:build-import-analysis", config);
60
+ }
61
+ function viteResolvePlugin(config) {
62
+ const builtinPlugin = new BuiltinPlugin("builtin:vite-resolve", {
63
+ ...config,
64
+ runtime: process.versions.deno ? "deno" : process.versions.bun ? "bun" : "node"
65
+ });
66
+ return makeBuiltinPluginCallable(builtinPlugin);
67
+ }
68
+ function moduleFederationPlugin(config) {
69
+ return new BuiltinPlugin("builtin:module-federation", {
70
+ ...config,
71
+ remotes: config.remotes && Object.entries(config.remotes).map(([name, remote]) => {
72
+ if (typeof remote === "string") {
73
+ const [entryGlobalName] = remote.split("@");
74
+ const entry = remote.replace(entryGlobalName + "@", "");
75
+ return {
76
+ entry,
77
+ name,
78
+ entryGlobalName
79
+ };
80
+ }
81
+ return {
82
+ ...remote,
83
+ name: remote.name ?? name
84
+ };
85
+ }),
86
+ manifest: config.manifest === false ? void 0 : config.manifest === true ? {} : config.manifest
87
+ });
88
+ }
89
+ function isolatedDeclarationPlugin(config) {
90
+ return new BuiltinPlugin("builtin:isolated-declaration", config);
91
+ }
92
+ var BuiltinPlugin;
93
+ var init_constructors = __esm({ "src/builtin-plugin/constructors.ts"() {
94
+ init_utils();
95
+ BuiltinPlugin = class {
96
+ constructor(name, _options) {
97
+ this.name = name;
98
+ this._options = _options;
99
+ }
100
+ };
101
+ } });
102
+
103
+ //#endregion
104
+ //#region src/utils/misc.ts
105
+ function arraify(value) {
106
+ return Array.isArray(value) ? value : [value];
107
+ }
108
+ function isNullish(value) {
109
+ return value === null || value === void 0;
110
+ }
111
+ function unimplemented(info) {
112
+ if (info) throw new Error(`unimplemented: ${info}`);
113
+ throw new Error("unimplemented");
114
+ }
115
+ function unreachable(info) {
116
+ if (info) throw new Error(`unreachable: ${info}`);
117
+ throw new Error("unreachable");
118
+ }
119
+ function unsupported(info) {
120
+ throw new Error(`UNSUPPORTED: ${info}`);
121
+ }
122
+ function noop(..._args) {}
123
+ var init_misc = __esm({ "src/utils/misc.ts"() {} });
124
+
125
+ //#endregion
126
+ //#region src/log/logging.ts
127
+ var LOG_LEVEL_SILENT, LOG_LEVEL_ERROR, LOG_LEVEL_WARN, LOG_LEVEL_INFO, LOG_LEVEL_DEBUG, logLevelPriority;
128
+ var init_logging = __esm({ "src/log/logging.ts"() {
129
+ LOG_LEVEL_SILENT = "silent";
130
+ LOG_LEVEL_ERROR = "error";
131
+ LOG_LEVEL_WARN = "warn";
132
+ LOG_LEVEL_INFO = "info";
133
+ LOG_LEVEL_DEBUG = "debug";
134
+ logLevelPriority = {
135
+ [LOG_LEVEL_DEBUG]: 0,
136
+ [LOG_LEVEL_INFO]: 1,
137
+ [LOG_LEVEL_WARN]: 2,
138
+ [LOG_LEVEL_SILENT]: 3
139
+ };
140
+ } });
141
+
142
+ //#endregion
143
+ //#region src/log/log-handler.ts
144
+ function getLogHandler(level, code, logger, pluginName, logLevel) {
145
+ if (logLevelPriority[level] < logLevelPriority[logLevel]) return noop;
146
+ return (log, pos) => {
147
+ if (pos != null) logger(LOG_LEVEL_WARN, logInvalidLogPosition(pluginName));
148
+ log = normalizeLog(log);
149
+ if (log.code && !log.pluginCode) log.pluginCode = log.code;
150
+ log.code = code;
151
+ log.plugin = pluginName;
152
+ logger(level, log);
153
+ };
154
+ }
155
+ var normalizeLog;
156
+ var init_log_handler = __esm({ "src/log/log-handler.ts"() {
157
+ init_misc();
158
+ init_logging();
159
+ init_logs();
160
+ normalizeLog = (log) => typeof log === "string" ? { message: log } : typeof log === "function" ? normalizeLog(log()) : log;
161
+ } });
162
+
163
+ //#endregion
164
+ //#region src/log/logger.ts
165
+ function getLogger(plugins, onLog, logLevel, watchMode) {
166
+ const minimalPriority = logLevelPriority[logLevel];
167
+ const logger = (level, log, skipped = new Set()) => {
168
+ const logPriority = logLevelPriority[level];
169
+ if (logPriority < minimalPriority) return;
170
+ for (const plugin of getSortedPlugins("onLog", plugins)) {
171
+ if (skipped.has(plugin)) continue;
172
+ const { onLog: pluginOnLog } = plugin;
173
+ if (pluginOnLog) {
174
+ const getLogHandler$1 = (level$1) => {
175
+ if (logLevelPriority[level$1] < minimalPriority) return () => {};
176
+ return (log$1) => logger(level$1, normalizeLog(log$1), new Set(skipped).add(plugin));
177
+ };
178
+ const handler = "handler" in pluginOnLog ? pluginOnLog.handler : pluginOnLog;
179
+ if (handler.call({
180
+ debug: getLogHandler$1(LOG_LEVEL_DEBUG),
181
+ error: (log$1) => error(normalizeLog(log$1)),
182
+ info: getLogHandler$1(LOG_LEVEL_INFO),
183
+ meta: {
184
+ rollupVersion: "4.23.0",
185
+ rolldownVersion: VERSION,
186
+ watchMode
187
+ },
188
+ warn: getLogHandler$1(LOG_LEVEL_WARN),
189
+ pluginName: plugin.name || "unknown"
190
+ }, level, log) === false) return;
191
+ }
192
+ }
193
+ onLog(level, log);
194
+ };
195
+ return logger;
196
+ }
197
+ function relativeId(id) {
198
+ if (!path.isAbsolute(id)) return id;
199
+ return path.relative(path.resolve(), id);
200
+ }
201
+ var getOnLog, getDefaultOnLog, addLogToString, defaultPrintLog, getExtendedLogMessage;
202
+ var init_logger = __esm({ "src/log/logger.ts"() {
203
+ init_src();
204
+ init_plugin_driver();
205
+ init_log_handler();
206
+ init_logging();
207
+ init_logs();
208
+ getOnLog = (config, logLevel, printLog = defaultPrintLog) => {
209
+ const { onwarn, onLog } = config;
210
+ const defaultOnLog = getDefaultOnLog(printLog, onwarn);
211
+ if (onLog) {
212
+ const minimalPriority = logLevelPriority[logLevel];
213
+ return (level, log) => onLog(level, addLogToString(log), (level$1, handledLog) => {
214
+ if (level$1 === LOG_LEVEL_ERROR) return error(normalizeLog(handledLog));
215
+ if (logLevelPriority[level$1] >= minimalPriority) defaultOnLog(level$1, normalizeLog(handledLog));
216
+ });
217
+ }
218
+ return defaultOnLog;
219
+ };
220
+ getDefaultOnLog = (printLog, onwarn) => onwarn ? (level, log) => {
221
+ if (level === LOG_LEVEL_WARN) onwarn(addLogToString(log), (warning) => printLog(LOG_LEVEL_WARN, normalizeLog(warning)));
222
+ else printLog(level, log);
223
+ } : printLog;
224
+ addLogToString = (log) => {
225
+ Object.defineProperty(log, "toString", {
226
+ value: () => getExtendedLogMessage(log),
227
+ writable: true
228
+ });
229
+ return log;
230
+ };
231
+ defaultPrintLog = (level, log) => {
232
+ const message = getExtendedLogMessage(log);
233
+ switch (level) {
234
+ case LOG_LEVEL_WARN: return console.warn(message);
235
+ case LOG_LEVEL_DEBUG: return console.debug(message);
236
+ default: return console.info(message);
237
+ }
238
+ };
239
+ getExtendedLogMessage = (log) => {
240
+ let prefix = "";
241
+ if (log.plugin) prefix += `(${log.plugin} plugin) `;
242
+ if (log.loc) prefix += `${relativeId(log.loc.file)} (${log.loc.line}:${log.loc.column}) `;
243
+ return prefix + log.message;
244
+ };
245
+ } });
246
+
247
+ //#endregion
248
+ //#region src/utils/normalize-hook.ts
249
+ function normalizeHook(hook) {
250
+ if (typeof hook === "function" || typeof hook === "string") return {
251
+ handler: hook,
252
+ options: {},
253
+ meta: {}
254
+ };
255
+ if (typeof hook === "object" && hook !== null) {
256
+ const { handler, order,...options } = hook;
257
+ return {
258
+ handler,
259
+ options,
260
+ meta: { order }
261
+ };
262
+ }
263
+ unreachable("Invalid hook type");
264
+ }
265
+ var init_normalize_hook = __esm({ "src/utils/normalize-hook.ts"() {
266
+ init_misc();
267
+ } });
268
+
269
+ //#endregion
270
+ //#region src/constants/plugin.ts
271
+ var ENUMERATED_INPUT_PLUGIN_HOOK_NAMES, ENUMERATED_OUTPUT_PLUGIN_HOOK_NAMES, ENUMERATED_PLUGIN_HOOK_NAMES, DEFINED_HOOK_NAMES;
272
+ var init_plugin$1 = __esm({ "src/constants/plugin.ts"() {
273
+ ENUMERATED_INPUT_PLUGIN_HOOK_NAMES = [
274
+ "options",
275
+ "buildStart",
276
+ "resolveId",
277
+ "load",
278
+ "transform",
279
+ "moduleParsed",
280
+ "buildEnd",
281
+ "onLog",
282
+ "resolveDynamicImport",
283
+ "closeBundle",
284
+ "closeWatcher",
285
+ "watchChange"
286
+ ];
287
+ ENUMERATED_OUTPUT_PLUGIN_HOOK_NAMES = [
288
+ "augmentChunkHash",
289
+ "outputOptions",
290
+ "renderChunk",
291
+ "renderStart",
292
+ "renderError",
293
+ "writeBundle",
294
+ "generateBundle"
295
+ ];
296
+ ENUMERATED_PLUGIN_HOOK_NAMES = [
297
+ ...ENUMERATED_INPUT_PLUGIN_HOOK_NAMES,
298
+ ...ENUMERATED_OUTPUT_PLUGIN_HOOK_NAMES,
299
+ "footer",
300
+ "banner",
301
+ "intro",
302
+ "outro"
303
+ ];
304
+ DEFINED_HOOK_NAMES = {
305
+ [ENUMERATED_PLUGIN_HOOK_NAMES[0]]: ENUMERATED_PLUGIN_HOOK_NAMES[0],
306
+ [ENUMERATED_PLUGIN_HOOK_NAMES[1]]: ENUMERATED_PLUGIN_HOOK_NAMES[1],
307
+ [ENUMERATED_PLUGIN_HOOK_NAMES[2]]: ENUMERATED_PLUGIN_HOOK_NAMES[2],
308
+ [ENUMERATED_PLUGIN_HOOK_NAMES[3]]: ENUMERATED_PLUGIN_HOOK_NAMES[3],
309
+ [ENUMERATED_PLUGIN_HOOK_NAMES[4]]: ENUMERATED_PLUGIN_HOOK_NAMES[4],
310
+ [ENUMERATED_PLUGIN_HOOK_NAMES[5]]: ENUMERATED_PLUGIN_HOOK_NAMES[5],
311
+ [ENUMERATED_PLUGIN_HOOK_NAMES[6]]: ENUMERATED_PLUGIN_HOOK_NAMES[6],
312
+ [ENUMERATED_PLUGIN_HOOK_NAMES[7]]: ENUMERATED_PLUGIN_HOOK_NAMES[7],
313
+ [ENUMERATED_PLUGIN_HOOK_NAMES[8]]: ENUMERATED_PLUGIN_HOOK_NAMES[8],
314
+ [ENUMERATED_PLUGIN_HOOK_NAMES[9]]: ENUMERATED_PLUGIN_HOOK_NAMES[9],
315
+ [ENUMERATED_PLUGIN_HOOK_NAMES[10]]: ENUMERATED_PLUGIN_HOOK_NAMES[10],
316
+ [ENUMERATED_PLUGIN_HOOK_NAMES[11]]: ENUMERATED_PLUGIN_HOOK_NAMES[11],
317
+ [ENUMERATED_PLUGIN_HOOK_NAMES[12]]: ENUMERATED_PLUGIN_HOOK_NAMES[12],
318
+ [ENUMERATED_PLUGIN_HOOK_NAMES[13]]: ENUMERATED_PLUGIN_HOOK_NAMES[13],
319
+ [ENUMERATED_PLUGIN_HOOK_NAMES[14]]: ENUMERATED_PLUGIN_HOOK_NAMES[14],
320
+ [ENUMERATED_PLUGIN_HOOK_NAMES[15]]: ENUMERATED_PLUGIN_HOOK_NAMES[15],
321
+ [ENUMERATED_PLUGIN_HOOK_NAMES[16]]: ENUMERATED_PLUGIN_HOOK_NAMES[16],
322
+ [ENUMERATED_PLUGIN_HOOK_NAMES[17]]: ENUMERATED_PLUGIN_HOOK_NAMES[17],
323
+ [ENUMERATED_PLUGIN_HOOK_NAMES[18]]: ENUMERATED_PLUGIN_HOOK_NAMES[18],
324
+ [ENUMERATED_PLUGIN_HOOK_NAMES[19]]: ENUMERATED_PLUGIN_HOOK_NAMES[19],
325
+ [ENUMERATED_PLUGIN_HOOK_NAMES[20]]: ENUMERATED_PLUGIN_HOOK_NAMES[20],
326
+ [ENUMERATED_PLUGIN_HOOK_NAMES[21]]: ENUMERATED_PLUGIN_HOOK_NAMES[21],
327
+ [ENUMERATED_PLUGIN_HOOK_NAMES[22]]: ENUMERATED_PLUGIN_HOOK_NAMES[22]
328
+ };
329
+ } });
330
+
331
+ //#endregion
332
+ //#region src/utils/async-flatten.ts
333
+ async function asyncFlatten(array) {
334
+ do
335
+ array = (await Promise.all(array)).flat(Infinity);
336
+ while (array.some((v$1) => v$1?.then));
337
+ return array;
338
+ }
339
+ var init_async_flatten = __esm({ "src/utils/async-flatten.ts"() {} });
340
+
341
+ //#endregion
342
+ //#region src/utils/normalize-plugin-option.ts
343
+ function checkOutputPluginOption(plugins, onLog) {
344
+ for (const plugin of plugins) for (const hook of ENUMERATED_INPUT_PLUGIN_HOOK_NAMES) if (hook in plugin) {
345
+ delete plugin[hook];
346
+ onLog(LOG_LEVEL_WARN, logInputHookInOutputPlugin(plugin.name, hook));
347
+ }
348
+ return plugins;
349
+ }
350
+ function normalizePlugins(plugins, anonymousPrefix) {
351
+ for (const [index, plugin] of plugins.entries()) {
352
+ if ("_parallel" in plugin) continue;
353
+ if (plugin instanceof BuiltinPlugin) continue;
354
+ if (!plugin.name) plugin.name = `${anonymousPrefix}${index + 1}`;
355
+ }
356
+ return plugins;
357
+ }
358
+ var normalizePluginOption, ANONYMOUS_PLUGIN_PREFIX, ANONYMOUS_OUTPUT_PLUGIN_PREFIX;
359
+ var init_normalize_plugin_option = __esm({ "src/utils/normalize-plugin-option.ts"() {
360
+ init_constructors();
361
+ init_plugin$1();
362
+ init_logging();
363
+ init_logs();
364
+ init_async_flatten();
365
+ normalizePluginOption = async (plugins) => (await asyncFlatten([plugins])).filter(Boolean);
366
+ ANONYMOUS_PLUGIN_PREFIX = "at position ";
367
+ ANONYMOUS_OUTPUT_PLUGIN_PREFIX = "at output position ";
368
+ } });
369
+
370
+ //#endregion
371
+ //#region src/plugin/minimal-plugin-context.ts
372
+ var MinimalPluginContextImpl;
373
+ var init_minimal_plugin_context = __esm({ "src/plugin/minimal-plugin-context.ts"() {
374
+ init_src();
375
+ init_log_handler();
376
+ init_logging();
377
+ init_logs();
378
+ MinimalPluginContextImpl = class {
379
+ info;
380
+ warn;
381
+ debug;
382
+ meta;
383
+ constructor(onLog, logLevel, pluginName, watchMode, hookName) {
384
+ this.pluginName = pluginName;
385
+ this.hookName = hookName;
386
+ this.debug = getLogHandler(LOG_LEVEL_DEBUG, "PLUGIN_LOG", onLog, pluginName, logLevel);
387
+ this.info = getLogHandler(LOG_LEVEL_INFO, "PLUGIN_LOG", onLog, pluginName, logLevel);
388
+ this.warn = getLogHandler(LOG_LEVEL_WARN, "PLUGIN_WARNING", onLog, pluginName, logLevel);
389
+ this.meta = {
390
+ rollupVersion: "4.23.0",
391
+ rolldownVersion: VERSION,
392
+ watchMode
393
+ };
394
+ }
395
+ error(e$5) {
396
+ return error(logPluginError(normalizeLog(e$5), this.pluginName, { hook: this.hookName }));
397
+ }
398
+ };
399
+ } });
400
+
401
+ //#endregion
402
+ //#region src/plugin/plugin-driver.ts
403
+ function getObjectPlugins(plugins) {
404
+ return plugins.filter((plugin) => {
405
+ if (!plugin) return void 0;
406
+ if ("_parallel" in plugin) return void 0;
407
+ if (plugin instanceof BuiltinPlugin) return void 0;
408
+ return plugin;
409
+ });
410
+ }
411
+ function getSortedPlugins(hookName, plugins) {
412
+ const pre = [];
413
+ const normal = [];
414
+ const post = [];
415
+ for (const plugin of plugins) {
416
+ const hook = plugin[hookName];
417
+ if (hook) {
418
+ if (typeof hook === "object") {
419
+ if (hook.order === "pre") {
420
+ pre.push(plugin);
421
+ continue;
422
+ }
423
+ if (hook.order === "post") {
424
+ post.push(plugin);
425
+ continue;
426
+ }
427
+ }
428
+ normal.push(plugin);
429
+ }
430
+ }
431
+ return [
432
+ ...pre,
433
+ ...normal,
434
+ ...post
435
+ ];
436
+ }
437
+ var PluginDriver;
438
+ var init_plugin_driver = __esm({ "src/plugin/plugin-driver.ts"() {
439
+ init_constructors();
440
+ init_logger();
441
+ init_logging();
442
+ init_normalize_hook();
443
+ init_normalize_plugin_option();
444
+ init_minimal_plugin_context();
445
+ PluginDriver = class {
446
+ static async callOptionsHook(inputOptions, watchMode = false) {
447
+ const logLevel = inputOptions.logLevel || LOG_LEVEL_INFO;
448
+ const plugins = getSortedPlugins("options", getObjectPlugins(await normalizePluginOption(inputOptions.plugins)));
449
+ const logger = getLogger(plugins, getOnLog(inputOptions, logLevel), logLevel, watchMode);
450
+ for (const plugin of plugins) {
451
+ const name = plugin.name || "unknown";
452
+ const options = plugin.options;
453
+ if (options) {
454
+ const { handler } = normalizeHook(options);
455
+ const result = await handler.call(new MinimalPluginContextImpl(logger, logLevel, name, watchMode, "onLog"), inputOptions);
456
+ if (result) inputOptions = result;
457
+ }
458
+ }
459
+ return inputOptions;
460
+ }
461
+ static callOutputOptionsHook(rawPlugins, outputOptions, onLog, logLevel, watchMode) {
462
+ const sortedPlugins = getSortedPlugins("outputOptions", getObjectPlugins(rawPlugins));
463
+ for (const plugin of sortedPlugins) {
464
+ const name = plugin.name || "unknown";
465
+ const options = plugin.outputOptions;
466
+ if (options) {
467
+ const { handler } = normalizeHook(options);
468
+ const result = handler.call(new MinimalPluginContextImpl(onLog, logLevel, name, watchMode), outputOptions);
469
+ if (result) outputOptions = result;
470
+ }
471
+ }
472
+ return outputOptions;
473
+ }
474
+ };
475
+ } });
476
+
477
+ //#endregion
478
+ //#region src/utils/validator.ts
479
+ function validateCliOptions(options) {
480
+ let parsed = v.safeParse(CliOptionsSchema, options);
481
+ return [parsed.output, parsed.issues?.map((issue) => {
482
+ const option = issue.path?.map((pathItem) => pathItem.key).join(" ");
483
+ return `Invalid value for option ${option}: ${issue.message}`;
484
+ })];
485
+ }
486
+ function validateOption(key, options) {
487
+ if (process.env.ROLLDOWN_OPTIONS_VALIDATION === "loose") return;
488
+ let parsed = v.safeParse(key === "input" ? InputOptionsSchema : OutputOptionsSchema, options);
489
+ if (!parsed.success) {
490
+ const errors = parsed.issues.map((issue) => {
491
+ const issuePaths = issue.path.map((path$1) => path$1.key);
492
+ let issueMsg = issue.message;
493
+ if (issue.type === "union") {
494
+ const subIssue = issue.issues?.find((i$21) => !(i$21.type !== issue.received && i$21.input === issue.input));
495
+ if (subIssue) {
496
+ if (subIssue.path) issuePaths.push(subIssue.path.map((path$1) => path$1.key));
497
+ issueMsg = subIssue.message;
498
+ }
499
+ }
500
+ const stringPath = issuePaths.join(".");
501
+ const helper = key === "input" ? inputHelperMsgRecord[stringPath] : outputHelperMsgRecord[stringPath];
502
+ if (helper && helper.ignored) return "";
503
+ return `- For the "${stringPath}". ${issueMsg}. ${helper ? helper.msg : ""}`;
504
+ }).filter(Boolean);
505
+ if (errors.length) throw new Error(`Failed validate ${key} options.\n` + errors.join("\n"));
506
+ }
507
+ }
508
+ function getInputCliKeys() {
509
+ return v.keyof(InputCliOptionsSchema).options;
510
+ }
511
+ function getOutputCliKeys() {
512
+ return v.keyof(OutputCliOptionsSchema).options;
513
+ }
514
+ function getJsonSchema() {
515
+ return toJsonSchema(CliOptionsSchema);
516
+ }
517
+ var StringOrRegExpSchema, LogLevelSchema, LogLevelOptionSchema, LogLevelWithErrorSchema, RollupLogSchema, RollupLogWithStringSchema, InputOptionSchema, ExternalSchema, ModuleTypesSchema, JsxOptionsSchema, HelperModeSchema, DecoratorOptionSchema, HelpersSchema, RewriteImportExtensionsSchema, TypescriptSchema, AssumptionsSchema, TransformOptionsSchema, WatchOptionsSchema, ChecksOptionsSchema, MinifyOptionsSchema, ResolveOptionsSchema, TreeshakingOptionsSchema, OnLogSchema, OnwarnSchema, InputOptionsSchema, InputCliOverrideSchema, InputCliOptionsSchema, ESTarget, ModuleFormatSchema, AddonFunctionSchema, ChunkFileNamesSchema, AssetFileNamesSchema, SanitizeFileNameSchema, GlobalsFunctionSchema, AdvancedChunksSchema, OutputOptionsSchema, getAddonDescription, OutputCliOverrideSchema, OutputCliOptionsSchema, CliOptionsSchema, inputHelperMsgRecord, outputHelperMsgRecord;
518
+ var init_validator = __esm({ "src/utils/validator.ts"() {
519
+ init_colors();
520
+ StringOrRegExpSchema = v.union([v.string(), v.instance(RegExp)]);
521
+ LogLevelSchema = v.union([
522
+ v.literal("debug"),
523
+ v.literal("info"),
524
+ v.literal("warn")
525
+ ]);
526
+ LogLevelOptionSchema = v.union([LogLevelSchema, v.literal("silent")]);
527
+ LogLevelWithErrorSchema = v.union([LogLevelSchema, v.literal("error")]);
528
+ RollupLogSchema = v.any();
529
+ RollupLogWithStringSchema = v.union([RollupLogSchema, v.string()]);
530
+ InputOptionSchema = v.union([
531
+ v.string(),
532
+ v.array(v.string()),
533
+ v.record(v.string(), v.string())
534
+ ]);
535
+ ExternalSchema = v.union([
536
+ StringOrRegExpSchema,
537
+ v.array(StringOrRegExpSchema),
538
+ v.pipe(v.function(), v.args(v.tuple([
539
+ v.string(),
540
+ v.optional(v.string()),
541
+ v.boolean()
542
+ ])), v.returns(v.nullish(v.boolean())))
543
+ ]);
544
+ ModuleTypesSchema = v.record(v.string(), v.union([
545
+ v.literal("base64"),
546
+ v.literal("binary"),
547
+ v.literal("css"),
548
+ v.literal("dataurl"),
549
+ v.literal("empty"),
550
+ v.literal("js"),
551
+ v.literal("json"),
552
+ v.literal("jsx"),
553
+ v.literal("text"),
554
+ v.literal("ts"),
555
+ v.literal("tsx")
556
+ ]));
557
+ JsxOptionsSchema = v.strictObject({
558
+ development: v.pipe(v.optional(v.boolean()), v.description("Development specific information")),
559
+ factory: v.pipe(v.optional(v.string()), v.description("Jsx element transformation")),
560
+ fragment: v.pipe(v.optional(v.string()), v.description("Jsx fragment transformation")),
561
+ importSource: v.pipe(v.optional(v.string()), v.description("Import the factory of element and fragment if mode is classic")),
562
+ jsxImportSource: v.pipe(v.optional(v.string()), v.description("Import the factory of element and fragment if mode is automatic")),
563
+ mode: v.pipe(v.optional(v.union([
564
+ v.literal("classic"),
565
+ v.literal("automatic"),
566
+ v.literal("preserve")
567
+ ])), v.description("Jsx transformation mode")),
568
+ refresh: v.pipe(v.optional(v.boolean()), v.description("React refresh transformation"))
569
+ });
570
+ HelperModeSchema = v.union([v.literal("Runtime"), v.literal("External")]);
571
+ DecoratorOptionSchema = v.object({
572
+ legacy: v.optional(v.boolean()),
573
+ emitDecoratorMetadata: v.optional(v.boolean())
574
+ });
575
+ HelpersSchema = v.object({ mode: v.optional(HelperModeSchema) });
576
+ RewriteImportExtensionsSchema = v.union([
577
+ v.literal("rewrite"),
578
+ v.literal("remove"),
579
+ v.boolean()
580
+ ]);
581
+ TypescriptSchema = v.object({
582
+ jsxPragma: v.optional(v.string()),
583
+ jsxPragmaFrag: v.optional(v.string()),
584
+ onlyRemoveTypeImports: v.optional(v.boolean()),
585
+ allowNamespaces: v.optional(v.boolean()),
586
+ allowDeclareFields: v.optional(v.boolean()),
587
+ declaration: v.optional(v.object({
588
+ stripInternal: v.optional(v.boolean()),
589
+ sourcemap: v.optional(v.boolean())
590
+ })),
591
+ rewriteImportExtensions: v.optional(RewriteImportExtensionsSchema)
592
+ });
593
+ AssumptionsSchema = v.object({
594
+ ignoreFunctionLength: v.optional(v.boolean()),
595
+ noDocumentAll: v.optional(v.boolean()),
596
+ objectRestNoSymbols: v.optional(v.boolean()),
597
+ pureGetters: v.optional(v.boolean()),
598
+ setPublicClassFields: v.optional(v.boolean())
599
+ });
600
+ TransformOptionsSchema = v.object({
601
+ assumptions: v.optional(AssumptionsSchema),
602
+ typescript: v.optional(TypescriptSchema),
603
+ helpers: v.optional(HelpersSchema),
604
+ decorators: v.optional(DecoratorOptionSchema)
605
+ });
606
+ WatchOptionsSchema = v.strictObject({
607
+ chokidar: v.optional(v.never(`The "watch.chokidar" option is deprecated, please use "watch.notify" instead of it`)),
608
+ exclude: v.optional(v.union([StringOrRegExpSchema, v.array(StringOrRegExpSchema)])),
609
+ include: v.optional(v.union([StringOrRegExpSchema, v.array(StringOrRegExpSchema)])),
610
+ notify: v.pipe(v.optional(v.strictObject({
611
+ compareContents: v.optional(v.boolean()),
612
+ pollInterval: v.optional(v.number())
613
+ })), v.description("Notify options")),
614
+ skipWrite: v.pipe(v.optional(v.boolean()), v.description("Skip the bundle.write() step")),
615
+ buildDelay: v.pipe(v.optional(v.number()), v.description("Throttle watch rebuilds"))
616
+ });
617
+ ChecksOptionsSchema = v.strictObject({
618
+ circularDependency: v.pipe(v.optional(v.boolean()), v.description("Whether to emit warning when detecting circular dependency")),
619
+ eval: v.pipe(v.optional(v.boolean()), v.description("Whether to emit warning when detecting eval")),
620
+ missingGlobalName: v.pipe(v.optional(v.boolean()), v.description("Whether to emit warning when detecting missing global name")),
621
+ missingNameOptionForIifeExport: v.pipe(v.optional(v.boolean()), v.description("Whether to emit warning when detecting missing name option for iife export")),
622
+ mixedExport: v.pipe(v.optional(v.boolean()), v.description("Whether to emit warning when detecting mixed export")),
623
+ unresolvedEntry: v.pipe(v.optional(v.boolean()), v.description("Whether to emit warning when detecting unresolved entry")),
624
+ unresolvedImport: v.pipe(v.optional(v.boolean()), v.description("Whether to emit warning when detecting unresolved import")),
625
+ filenameConflict: v.pipe(v.optional(v.boolean()), v.description("Whether to emit warning when detecting filename conflict")),
626
+ commonJsVariableInEsm: v.pipe(v.optional(v.boolean()), v.description("Whether to emit warning when detecting common js variable in esm")),
627
+ importIsUndefined: v.pipe(v.optional(v.boolean()), v.description("Whether to emit warning when detecting import is undefined")),
628
+ configurationFieldConflict: v.pipe(v.optional(v.boolean()), v.description("Whether to emit warning when detecting configuration field conflict"))
629
+ });
630
+ MinifyOptionsSchema = v.strictObject({
631
+ mangle: v.boolean(),
632
+ compress: v.boolean(),
633
+ deadCodeElimination: v.boolean(),
634
+ removeWhitespace: v.boolean()
635
+ });
636
+ ResolveOptionsSchema = v.strictObject({
637
+ alias: v.optional(v.record(v.string(), v.union([v.string(), v.array(v.string())]))),
638
+ aliasFields: v.optional(v.array(v.array(v.string()))),
639
+ conditionNames: v.optional(v.array(v.string())),
640
+ extensionAlias: v.optional(v.record(v.string(), v.array(v.string()))),
641
+ exportsFields: v.optional(v.array(v.array(v.string()))),
642
+ extensions: v.optional(v.array(v.string())),
643
+ mainFields: v.optional(v.array(v.string())),
644
+ mainFiles: v.optional(v.array(v.string())),
645
+ modules: v.optional(v.array(v.string())),
646
+ symlinks: v.optional(v.boolean()),
647
+ tsconfigFilename: v.optional(v.string())
648
+ });
649
+ TreeshakingOptionsSchema = v.union([v.boolean(), v.looseObject({
650
+ annotations: v.optional(v.boolean()),
651
+ manualPureFunctions: v.optional(v.array(v.string())),
652
+ unknownGlobalSideEffects: v.optional(v.boolean())
653
+ })]);
654
+ OnLogSchema = v.pipe(v.function(), v.args(v.tuple([
655
+ LogLevelSchema,
656
+ RollupLogSchema,
657
+ v.pipe(v.function(), v.args(v.tuple([LogLevelWithErrorSchema, RollupLogWithStringSchema])))
658
+ ])));
659
+ OnwarnSchema = v.pipe(v.function(), v.args(v.tuple([RollupLogSchema, v.pipe(v.function(), v.args(v.tuple([v.union([RollupLogWithStringSchema, v.pipe(v.function(), v.returns(RollupLogWithStringSchema))])])))])));
660
+ InputOptionsSchema = v.strictObject({
661
+ input: v.optional(InputOptionSchema),
662
+ plugins: v.optional(v.custom(() => true)),
663
+ external: v.optional(ExternalSchema),
664
+ resolve: v.optional(ResolveOptionsSchema),
665
+ cwd: v.pipe(v.optional(v.string()), v.description("Current working directory")),
666
+ platform: v.pipe(v.optional(v.union([
667
+ v.literal("browser"),
668
+ v.literal("neutral"),
669
+ v.literal("node")
670
+ ])), v.description(`Platform for which the code should be generated (node, ${colors.underline("browser")}, neutral)`)),
671
+ shimMissingExports: v.pipe(v.optional(v.boolean()), v.description("Create shim variables for missing exports")),
672
+ treeshake: v.optional(TreeshakingOptionsSchema),
673
+ logLevel: v.pipe(v.optional(LogLevelOptionSchema), v.description(`Log level (${colors.dim("silent")}, ${colors.underline(colors.gray("info"))}, debug, ${colors.yellow("warn")})`)),
674
+ onLog: v.optional(OnLogSchema),
675
+ onwarn: v.optional(OnwarnSchema),
676
+ moduleTypes: v.pipe(v.optional(ModuleTypesSchema), v.description("Module types for customized extensions")),
677
+ experimental: v.optional(v.strictObject({
678
+ disableLiveBindings: v.optional(v.boolean()),
679
+ enableComposingJsPlugins: v.optional(v.boolean()),
680
+ resolveNewUrlToAsset: v.optional(v.boolean()),
681
+ strictExecutionOrder: v.optional(v.boolean()),
682
+ hmr: v.optional(v.boolean())
683
+ })),
684
+ define: v.pipe(v.optional(v.record(v.string(), v.string())), v.description("Define global variables")),
685
+ inject: v.optional(v.record(v.string(), v.union([v.string(), v.tuple([v.string(), v.string()])]))),
686
+ profilerNames: v.optional(v.boolean()),
687
+ jsx: v.optional(v.union([
688
+ v.boolean(),
689
+ JsxOptionsSchema,
690
+ v.string("react"),
691
+ v.string("react-jsx"),
692
+ v.string("preserve")
693
+ ])),
694
+ transform: v.optional(TransformOptionsSchema),
695
+ watch: v.optional(v.union([WatchOptionsSchema, v.literal(false)])),
696
+ dropLabels: v.pipe(v.optional(v.array(v.string())), v.description("Remove labeled statements with these label names")),
697
+ checks: v.optional(ChecksOptionsSchema),
698
+ keepNames: v.pipe(v.optional(v.boolean()), v.description("Keep function/class name"))
699
+ });
700
+ InputCliOverrideSchema = v.strictObject({
701
+ external: v.pipe(v.optional(v.array(v.string())), v.description("Comma-separated list of module ids to exclude from the bundle `<module-id>,...`")),
702
+ inject: v.pipe(v.optional(v.record(v.string(), v.string())), v.description("Inject import statements on demand")),
703
+ treeshake: v.pipe(v.optional(v.boolean()), v.description("enable treeshaking")),
704
+ jsx: v.pipe(v.optional(JsxOptionsSchema), v.description("enable jsx"))
705
+ });
706
+ InputCliOptionsSchema = v.omit(v.strictObject({
707
+ ...InputOptionsSchema.entries,
708
+ ...InputCliOverrideSchema.entries
709
+ }), [
710
+ "input",
711
+ "plugins",
712
+ "onwarn",
713
+ "onLog",
714
+ "resolve",
715
+ "experimental",
716
+ "profilerNames",
717
+ "watch"
718
+ ]);
719
+ ESTarget = /* @__PURE__ */ function(ESTarget$1) {
720
+ ESTarget$1["ES6"] = "es6";
721
+ ESTarget$1["ES2015"] = "es2015";
722
+ ESTarget$1["ES2016"] = "es2016";
723
+ ESTarget$1["ES2017"] = "es2017";
724
+ ESTarget$1["ES2018"] = "es2018";
725
+ ESTarget$1["ES2019"] = "es2019";
726
+ ESTarget$1["ES2020"] = "es2020";
727
+ ESTarget$1["ES2021"] = "es2021";
728
+ ESTarget$1["ES2022"] = "es2022";
729
+ ESTarget$1["ES2023"] = "es2023";
730
+ ESTarget$1["ES2024"] = "es2024";
731
+ ESTarget$1["ESNext"] = "esnext";
732
+ return ESTarget$1;
733
+ }(ESTarget || {});
734
+ ModuleFormatSchema = v.union([
735
+ v.literal("es"),
736
+ v.literal("cjs"),
737
+ v.literal("esm"),
738
+ v.literal("module"),
739
+ v.literal("commonjs"),
740
+ v.literal("iife"),
741
+ v.literal("umd")
742
+ ]);
743
+ AddonFunctionSchema = v.pipe(v.function(), v.args(v.tuple([v.custom(() => true)])), v.returnsAsync(v.unionAsync([v.string(), v.pipeAsync(v.promise(), v.awaitAsync(), v.string())])));
744
+ ChunkFileNamesSchema = v.union([v.string(), v.pipe(v.function(), v.args(v.tuple([v.custom(() => true)])), v.returns(v.string()))]);
745
+ AssetFileNamesSchema = v.union([v.string(), v.pipe(v.function(), v.args(v.tuple([v.custom(() => true)])), v.returns(v.string()))]);
746
+ SanitizeFileNameSchema = v.union([v.boolean(), v.pipe(v.function(), v.args(v.tuple([v.string()])), v.returns(v.string()))]);
747
+ GlobalsFunctionSchema = v.pipe(v.function(), v.args(v.tuple([v.string()])), v.returns(v.string()));
748
+ AdvancedChunksSchema = v.strictObject({
749
+ minSize: v.optional(v.number()),
750
+ maxSize: v.optional(v.number()),
751
+ minModuleSize: v.optional(v.number()),
752
+ maxModuleSize: v.optional(v.number()),
753
+ minShareCount: v.optional(v.number()),
754
+ groups: v.optional(v.array(v.strictObject({
755
+ name: v.string(),
756
+ test: v.optional(v.union([v.string(), v.instance(RegExp)])),
757
+ priority: v.optional(v.number()),
758
+ minSize: v.optional(v.number()),
759
+ minShareCount: v.optional(v.number()),
760
+ maxSize: v.optional(v.number()),
761
+ minModuleSize: v.optional(v.number()),
762
+ maxModuleSize: v.optional(v.number())
763
+ })))
764
+ });
765
+ OutputOptionsSchema = v.strictObject({
766
+ dir: v.pipe(v.optional(v.string()), v.description("Output directory, defaults to `dist` if `file` is not set")),
767
+ file: v.pipe(v.optional(v.string()), v.description("Single output file")),
768
+ exports: v.pipe(v.optional(v.union([
769
+ v.literal("auto"),
770
+ v.literal("named"),
771
+ v.literal("default"),
772
+ v.literal("none")
773
+ ])), v.description(`Specify a export mode (${colors.underline("auto")}, named, default, none)`)),
774
+ hashCharacters: v.pipe(v.optional(v.union([
775
+ v.literal("base64"),
776
+ v.literal("base36"),
777
+ v.literal("hex")
778
+ ])), v.description("Use the specified character set for file hashes")),
779
+ format: v.pipe(v.optional(ModuleFormatSchema), v.description(`Output format of the generated bundle (supports ${colors.underline("esm")}, cjs, and iife)`)),
780
+ sourcemap: v.pipe(v.optional(v.union([
781
+ v.boolean(),
782
+ v.literal("inline"),
783
+ v.literal("hidden")
784
+ ])), v.description(`Generate sourcemap (\`-s inline\` for inline, or ${colors.bold("pass the `-s` on the last argument if you want to generate `.map` file")})`)),
785
+ sourcemapDebugIds: v.pipe(v.optional(v.boolean()), v.description("Inject sourcemap debug IDs")),
786
+ sourcemapIgnoreList: v.optional(v.union([v.boolean(), v.custom(() => true)])),
787
+ sourcemapPathTransform: v.optional(v.custom(() => true)),
788
+ banner: v.optional(v.union([v.string(), AddonFunctionSchema])),
789
+ footer: v.optional(v.union([v.string(), AddonFunctionSchema])),
790
+ intro: v.optional(v.union([v.string(), AddonFunctionSchema])),
791
+ outro: v.optional(v.union([v.string(), AddonFunctionSchema])),
792
+ extend: v.pipe(v.optional(v.boolean()), v.description("Extend global variable defined by name in IIFE / UMD formats")),
793
+ esModule: v.optional(v.union([v.boolean(), v.literal("if-default-prop")])),
794
+ assetFileNames: v.optional(AssetFileNamesSchema),
795
+ entryFileNames: v.optional(ChunkFileNamesSchema),
796
+ chunkFileNames: v.optional(ChunkFileNamesSchema),
797
+ cssEntryFileNames: v.optional(ChunkFileNamesSchema),
798
+ cssChunkFileNames: v.optional(ChunkFileNamesSchema),
799
+ sanitizeFileName: v.optional(SanitizeFileNameSchema),
800
+ minify: v.pipe(v.optional(v.union([
801
+ v.boolean(),
802
+ v.string("dce-only"),
803
+ MinifyOptionsSchema
804
+ ])), v.description("Minify the bundled file")),
805
+ name: v.pipe(v.optional(v.string()), v.description("Name for UMD / IIFE format outputs")),
806
+ globals: v.pipe(v.optional(v.union([v.record(v.string(), v.string()), GlobalsFunctionSchema])), v.description("Global variable of UMD / IIFE dependencies (syntax: `key=value`)")),
807
+ externalLiveBindings: v.pipe(v.optional(v.boolean()), v.description("external live bindings")),
808
+ inlineDynamicImports: v.pipe(v.optional(v.boolean()), v.description("Inline dynamic imports")),
809
+ advancedChunks: v.optional(AdvancedChunksSchema),
810
+ comments: v.pipe(v.optional(v.union([v.literal("none"), v.literal("preserve-legal")])), v.description("Control comments in the output")),
811
+ target: v.pipe(v.optional(v.enum(ESTarget)), v.description("The JavaScript target environment")),
812
+ plugins: v.optional(v.custom(() => true))
813
+ });
814
+ getAddonDescription = (placement, wrapper) => {
815
+ return `Code to insert the ${colors.bold(placement)} of the bundled file (${colors.bold(wrapper)} the wrapper function)`;
816
+ };
817
+ OutputCliOverrideSchema = v.strictObject({
818
+ assetFileNames: v.pipe(v.optional(v.string()), v.description("Name pattern for asset files")),
819
+ entryFileNames: v.pipe(v.optional(v.string()), v.description("Name pattern for emitted entry chunks")),
820
+ chunkFileNames: v.pipe(v.optional(v.string()), v.description("Name pattern for emitted secondary chunks")),
821
+ cssEntryFileNames: v.pipe(v.optional(v.string()), v.description("Name pattern for emitted css entry chunks")),
822
+ cssChunkFileNames: v.pipe(v.optional(v.string()), v.description("Name pattern for emitted css secondary chunks")),
823
+ sanitizeFileName: v.pipe(v.optional(v.boolean()), v.description("Sanitize file name")),
824
+ banner: v.pipe(v.optional(v.string()), v.description(getAddonDescription("top", "outside"))),
825
+ footer: v.pipe(v.optional(v.string()), v.description(getAddonDescription("bottom", "outside"))),
826
+ intro: v.pipe(v.optional(v.string()), v.description(getAddonDescription("top", "inside"))),
827
+ outro: v.pipe(v.optional(v.string()), v.description(getAddonDescription("bottom", "inside"))),
828
+ esModule: v.pipe(v.optional(v.boolean()), v.description("Always generate `__esModule` marks in non-ESM formats, defaults to `if-default-prop` (use `--no-esModule` to always disable)")),
829
+ globals: v.pipe(v.optional(v.record(v.string(), v.string())), v.description("Global variable of UMD / IIFE dependencies (syntax: `key=value`)")),
830
+ advancedChunks: v.pipe(v.optional(v.strictObject({
831
+ minSize: v.pipe(v.optional(v.number()), v.description("Minimum size of the chunk")),
832
+ minShareCount: v.pipe(v.optional(v.number()), v.description("Minimum share count of the chunk"))
833
+ })), v.description("Global variable of UMD / IIFE dependencies (syntax: `key=value`)")),
834
+ minify: v.pipe(v.optional(v.boolean()), v.description("Minify the bundled file"))
835
+ });
836
+ OutputCliOptionsSchema = v.omit(v.strictObject({
837
+ ...OutputOptionsSchema.entries,
838
+ ...OutputCliOverrideSchema.entries
839
+ }), [
840
+ "sourcemapIgnoreList",
841
+ "sourcemapPathTransform",
842
+ "plugins"
843
+ ]);
844
+ CliOptionsSchema = v.strictObject({
845
+ config: v.pipe(v.optional(v.union([v.string(), v.boolean()])), v.description("Path to the config file (default: `rolldown.config.js`)")),
846
+ help: v.pipe(v.optional(v.boolean()), v.description("Show help")),
847
+ version: v.pipe(v.optional(v.boolean()), v.description("Show version number")),
848
+ watch: v.pipe(v.optional(v.boolean()), v.description("Watch files in bundle and rebuild on changes")),
849
+ ...InputCliOptionsSchema.entries,
850
+ ...OutputCliOptionsSchema.entries
851
+ });
852
+ inputHelperMsgRecord = { output: { ignored: true } };
853
+ outputHelperMsgRecord = {};
854
+ } });
855
+
856
+ //#endregion
857
+ //#region src/constants/plugin-context.ts
858
+ var SYMBOL_FOR_RESOLVE_CALLER_THAT_SKIP_SELF;
859
+ var init_plugin_context$1 = __esm({ "src/constants/plugin-context.ts"() {
860
+ SYMBOL_FOR_RESOLVE_CALLER_THAT_SKIP_SELF = Symbol("plugin-context-resolve-caller");
861
+ } });
862
+
863
+ //#endregion
864
+ //#region src/options/normalized-input-options.ts
865
+ var NormalizedInputOptionsImpl;
866
+ var init_normalized_input_options = __esm({ "src/options/normalized-input-options.ts"() {
867
+ NormalizedInputOptionsImpl = class {
868
+ inner;
869
+ constructor(inner, onLog) {
870
+ this.onLog = onLog;
871
+ this.inner = inner;
872
+ }
873
+ get shimMissingExports() {
874
+ return this.inner.shimMissingExports;
875
+ }
876
+ get input() {
877
+ return this.inner.input;
878
+ }
879
+ get cwd() {
880
+ return this.inner.cwd ?? void 0;
881
+ }
882
+ get platform() {
883
+ return this.inner.platform;
884
+ }
885
+ };
886
+ } });
887
+
888
+ //#endregion
889
+ //#region src/types/sourcemap.ts
890
+ function bindingifySourcemap(map) {
891
+ if (map == null) return;
892
+ return { inner: typeof map === "string" ? map : {
893
+ file: map.file ?? void 0,
894
+ mappings: map.mappings,
895
+ sourceRoot: "sourceRoot" in map ? map.sourceRoot ?? void 0 : void 0,
896
+ sources: map.sources?.map((s$10) => s$10 ?? void 0),
897
+ sourcesContent: map.sourcesContent?.map((s$10) => s$10 ?? void 0),
898
+ names: map.names,
899
+ x_google_ignoreList: map.x_google_ignoreList,
900
+ debugId: "debugId" in map ? map.debugId : void 0
901
+ } };
902
+ }
903
+ var init_sourcemap = __esm({ "src/types/sourcemap.ts"() {} });
904
+
905
+ //#endregion
906
+ //#region src/utils/error.ts
907
+ function normalizeErrors(rawErrors) {
908
+ const errors = rawErrors.map((e$5) => e$5 instanceof Error ? e$5 : Object.assign(new Error(), {
909
+ kind: e$5.kind,
910
+ message: e$5.message,
911
+ stack: void 0
912
+ }));
913
+ let summary = `Build failed with ${errors.length} error${errors.length < 2 ? "" : "s"}:\n`;
914
+ for (let i$21 = 0; i$21 < errors.length; i$21++) {
915
+ summary += "\n";
916
+ if (i$21 >= 5) {
917
+ summary += "...";
918
+ break;
919
+ }
920
+ summary += getErrorMessage(errors[i$21]);
921
+ }
922
+ const wrapper = new Error(summary);
923
+ Object.defineProperty(wrapper, "errors", {
924
+ configurable: true,
925
+ enumerable: true,
926
+ get: () => errors,
927
+ set: (value) => Object.defineProperty(wrapper, "errors", {
928
+ configurable: true,
929
+ enumerable: true,
930
+ value
931
+ })
932
+ });
933
+ return wrapper;
934
+ }
935
+ function getErrorMessage(e$5) {
936
+ if (Object.hasOwn(e$5, "kind")) return e$5.message;
937
+ let s$10 = "";
938
+ if (e$5.plugin) s$10 += `[plugin ${e$5.plugin}]`;
939
+ const id = e$5.id ?? e$5.loc?.file;
940
+ if (id) {
941
+ s$10 += " " + id;
942
+ if (e$5.loc) s$10 += `:${e$5.loc.line}:${e$5.loc.column}`;
943
+ }
944
+ if (s$10) s$10 += "\n";
945
+ const message = `${e$5.name ?? "Error"}: ${e$5.message}`;
946
+ s$10 += message;
947
+ if (e$5.frame) s$10 = joinNewLine(s$10, e$5.frame);
948
+ if (e$5.stack) s$10 = joinNewLine(s$10, e$5.stack.replace(message, ""));
949
+ return s$10;
950
+ }
951
+ function joinNewLine(s1, s2) {
952
+ return s1.replace(/\n+$/, "") + "\n" + s2.replace(/^\n+/, "");
953
+ }
954
+ var init_error = __esm({ "src/utils/error.ts"() {} });
955
+
956
+ //#endregion
957
+ //#region src/utils/resolved-external.ts
958
+ function transformResolvedExternal(bindingResolvedExternal$1) {
959
+ switch (bindingResolvedExternal$1.type) {
960
+ case "Bool": return bindingResolvedExternal$1.field0;
961
+ case "Absolute": return "absolute";
962
+ case "Relative": unreachable(`The PluginContext resolve result external couldn't be 'relative'`);
963
+ }
964
+ }
965
+ function bindingResolvedExternal(external) {
966
+ if (typeof external === "boolean") return {
967
+ type: "Bool",
968
+ field0: external
969
+ };
970
+ if (external === "absolute") return { type: "Absolute" };
971
+ if (external === "relative") return { type: "Relative" };
972
+ }
973
+ var init_resolved_external = __esm({ "src/utils/resolved-external.ts"() {
974
+ init_misc();
975
+ } });
976
+
977
+ //#endregion
978
+ //#region src/utils/transform-module-info.ts
979
+ function transformModuleInfo(info, option) {
980
+ return {
981
+ get ast() {
982
+ return unsupported("ModuleInfo#ast");
983
+ },
984
+ get code() {
985
+ return info.code;
986
+ },
987
+ id: info.id,
988
+ importers: info.importers,
989
+ dynamicImporters: info.dynamicImporters,
990
+ importedIds: info.importedIds,
991
+ dynamicallyImportedIds: info.dynamicallyImportedIds,
992
+ exports: info.exports,
993
+ isEntry: info.isEntry,
994
+ ...option
995
+ };
996
+ }
997
+ var init_transform_module_info = __esm({ "src/utils/transform-module-info.ts"() {
998
+ init_misc();
999
+ } });
1000
+
1001
+ //#endregion
1002
+ //#region src/utils/transform-side-effects.ts
1003
+ function bindingifySideEffects(sideEffects) {
1004
+ switch (sideEffects) {
1005
+ case true: return import_binding.BindingHookSideEffects.True;
1006
+ case false: return import_binding.BindingHookSideEffects.False;
1007
+ case "no-treeshake": return import_binding.BindingHookSideEffects.NoTreeshake;
1008
+ case null:
1009
+ case void 0: return void 0;
1010
+ default: throw new Error(`Unexpected side effects: ${sideEffects}`);
1011
+ }
1012
+ }
1013
+ var init_transform_side_effects = __esm({ "src/utils/transform-side-effects.ts"() {} });
1014
+
1015
+ //#endregion
1016
+ //#region src/utils/transform-sourcemap.ts
1017
+ function isEmptySourcemapFiled(array) {
1018
+ if (!array) return true;
1019
+ if (array.length === 0 || !array[0]) return true;
1020
+ return false;
1021
+ }
1022
+ function normalizeTransformHookSourcemap(id, originalCode, rawMap) {
1023
+ if (!rawMap) return;
1024
+ let map = typeof rawMap === "object" ? rawMap : JSON.parse(rawMap);
1025
+ if (isEmptySourcemapFiled(map.sourcesContent)) map.sourcesContent = [originalCode];
1026
+ if (isEmptySourcemapFiled(map.sources) || map.sources && map.sources.length === 1 && map.sources[0] !== id) map.sources = [id];
1027
+ return map;
1028
+ }
1029
+ var init_transform_sourcemap = __esm({ "src/utils/transform-sourcemap.ts"() {} });
1030
+
1031
+ //#endregion
1032
+ //#region src/plugin/bindingify-hook-filter.ts
1033
+ function bindingifyStringFilter(matcher) {
1034
+ if (typeof matcher === "string" || matcher instanceof RegExp) return { include: [matcher] };
1035
+ if (Array.isArray(matcher)) return { include: matcher };
1036
+ return {
1037
+ include: matcher.include ? arraify(matcher.include) : void 0,
1038
+ exclude: matcher.exclude ? arraify(matcher.exclude) : void 0
1039
+ };
1040
+ }
1041
+ function bindingifyResolveIdFilter(filterOption) {
1042
+ return filterOption?.id ? bindingifyStringFilter(filterOption.id) : void 0;
1043
+ }
1044
+ function bindingifyLoadFilter(filterOption) {
1045
+ return filterOption?.id ? bindingifyStringFilter(filterOption.id) : void 0;
1046
+ }
1047
+ function bindingifyTransformFilter(filterOption) {
1048
+ if (!filterOption) return void 0;
1049
+ const { id, code, moduleType } = filterOption;
1050
+ let moduleTypeRet;
1051
+ if (moduleType) if (Array.isArray(moduleType)) moduleTypeRet = moduleType;
1052
+ else moduleTypeRet = moduleType.include;
1053
+ return {
1054
+ id: id ? bindingifyStringFilter(id) : void 0,
1055
+ code: code ? bindingifyStringFilter(code) : void 0,
1056
+ moduleType: moduleTypeRet
1057
+ };
1058
+ }
1059
+ var init_bindingify_hook_filter = __esm({ "src/plugin/bindingify-hook-filter.ts"() {
1060
+ init_misc();
1061
+ } });
1062
+
1063
+ //#endregion
1064
+ //#region src/plugin/bindingify-plugin-hook-meta.ts
1065
+ function bindingifyPluginHookMeta(options) {
1066
+ return { order: bindingPluginOrder(options.order) };
1067
+ }
1068
+ function bindingPluginOrder(order) {
1069
+ switch (order) {
1070
+ case "post": return import_binding.BindingPluginOrder.Post;
1071
+ case "pre": return import_binding.BindingPluginOrder.Pre;
1072
+ case null:
1073
+ case void 0: return void 0;
1074
+ default: throw new Error(`Unknown plugin order: ${order}`);
1075
+ }
1076
+ }
1077
+ var init_bindingify_plugin_hook_meta = __esm({ "src/plugin/bindingify-plugin-hook-meta.ts"() {} });
1078
+
1079
+ //#endregion
1080
+ //#region src/utils/asset-source.ts
1081
+ function transformAssetSource(bindingAssetSource$1) {
1082
+ return bindingAssetSource$1.inner;
1083
+ }
1084
+ function bindingAssetSource(source) {
1085
+ return { inner: source };
1086
+ }
1087
+ var init_asset_source = __esm({ "src/utils/asset-source.ts"() {} });
1088
+
1089
+ //#endregion
1090
+ //#region src/plugin/plugin-context.ts
1091
+ var PluginContextImpl;
1092
+ var init_plugin_context = __esm({ "src/plugin/plugin-context.ts"() {
1093
+ init_logging();
1094
+ init_logs();
1095
+ init_parse_ast_index();
1096
+ init_minimal_plugin_context();
1097
+ init_asset_source();
1098
+ init_misc();
1099
+ init_resolved_external();
1100
+ init_transform_side_effects();
1101
+ PluginContextImpl = class extends MinimalPluginContextImpl {
1102
+ getModuleInfo;
1103
+ constructor(outputOptions, context, plugin, data, onLog, logLevel, watchMode, currentLoadingModule) {
1104
+ super(onLog, logLevel, plugin.name, watchMode);
1105
+ this.outputOptions = outputOptions;
1106
+ this.context = context;
1107
+ this.data = data;
1108
+ this.onLog = onLog;
1109
+ this.currentLoadingModule = currentLoadingModule;
1110
+ this.getModuleInfo = (id) => this.data.getModuleInfo(id, context);
1111
+ }
1112
+ async load(options) {
1113
+ const id = options.id;
1114
+ if (id === this.currentLoadingModule) this.onLog(LOG_LEVEL_WARN, logCycleLoading(this.pluginName, this.currentLoadingModule));
1115
+ const moduleInfo = this.data.getModuleInfo(id, this.context);
1116
+ if (moduleInfo && moduleInfo.code !== null) return moduleInfo;
1117
+ const rawOptions = {
1118
+ meta: options.meta || {},
1119
+ moduleSideEffects: options.moduleSideEffects || null,
1120
+ invalidate: false
1121
+ };
1122
+ this.data.updateModuleOption(id, rawOptions);
1123
+ async function createLoadModulePromise(context, data) {
1124
+ const loadPromise = data.loadModulePromiseMap.get(id);
1125
+ if (loadPromise) return loadPromise;
1126
+ let resolveFn;
1127
+ const promise = new Promise((resolve, _) => {
1128
+ resolveFn = resolve;
1129
+ });
1130
+ data.loadModulePromiseMap.set(id, promise);
1131
+ try {
1132
+ await context.load(id, bindingifySideEffects(options.moduleSideEffects), (_success) => {
1133
+ resolveFn();
1134
+ });
1135
+ } finally {
1136
+ data.loadModulePromiseMap.delete(id);
1137
+ }
1138
+ return promise;
1139
+ }
1140
+ await createLoadModulePromise(this.context, this.data);
1141
+ return this.data.getModuleInfo(id, this.context);
1142
+ }
1143
+ async resolve(source, importer, options) {
1144
+ let receipt = void 0;
1145
+ if (options != null) receipt = this.data.saveResolveOptions(options);
1146
+ const res = await this.context.resolve(source, importer, {
1147
+ custom: receipt,
1148
+ skipSelf: options?.skipSelf
1149
+ });
1150
+ if (receipt != null) this.data.removeSavedResolveOptions(receipt);
1151
+ if (res == null) return null;
1152
+ const info = this.data.getModuleOption(res.id) || {};
1153
+ return {
1154
+ ...res,
1155
+ external: transformResolvedExternal(res.external),
1156
+ ...info
1157
+ };
1158
+ }
1159
+ emitFile = (file) => {
1160
+ if (file.type === "prebuilt-chunk") return unimplemented("PluginContext.emitFile with type prebuilt-chunk");
1161
+ if (file.type === "chunk") return this.context.emitChunk(file);
1162
+ const fnSanitizedFileName = file.fileName || typeof this.outputOptions.sanitizeFileName !== "function" ? void 0 : this.outputOptions.sanitizeFileName(file.name || "asset");
1163
+ const filename = file.fileName ? void 0 : this.getAssetFileNames(file);
1164
+ return this.context.emitFile({
1165
+ ...file,
1166
+ originalFileName: file.originalFileName || void 0,
1167
+ source: bindingAssetSource(file.source)
1168
+ }, filename, fnSanitizedFileName);
1169
+ };
1170
+ getAssetFileNames(file) {
1171
+ if (typeof this.outputOptions.assetFileNames === "function") return this.outputOptions.assetFileNames({
1172
+ names: file.name ? [file.name] : [],
1173
+ originalFileNames: file.originalFileName ? [file.originalFileName] : [],
1174
+ source: file.source,
1175
+ type: "asset"
1176
+ });
1177
+ }
1178
+ getFileName(referenceId) {
1179
+ return this.context.getFileName(referenceId);
1180
+ }
1181
+ getModuleIds() {
1182
+ return this.data.getModuleIds(this.context);
1183
+ }
1184
+ addWatchFile(id) {
1185
+ this.context.addWatchFile(id);
1186
+ }
1187
+ parse(input, options) {
1188
+ return parseAst(input, options);
1189
+ }
1190
+ };
1191
+ } });
1192
+
1193
+ //#endregion
1194
+ //#region src/plugin/transform-plugin-context.ts
1195
+ var TransformPluginContextImpl;
1196
+ var init_transform_plugin_context = __esm({ "src/plugin/transform-plugin-context.ts"() {
1197
+ init_log_handler();
1198
+ init_logs();
1199
+ init_plugin_context();
1200
+ TransformPluginContextImpl = class extends PluginContextImpl {
1201
+ constructor(outputOptions, context, plugin, data, inner, moduleId, moduleSource, onLog, LogLevelOption, watchMode) {
1202
+ super(outputOptions, context, plugin, data, onLog, LogLevelOption, watchMode, moduleId);
1203
+ this.inner = inner;
1204
+ this.moduleId = moduleId;
1205
+ this.moduleSource = moduleSource;
1206
+ const getLogHandler$1 = (handler) => (log, pos) => {
1207
+ log = normalizeLog(log);
1208
+ if (pos) augmentCodeLocation(log, pos, moduleSource, moduleId);
1209
+ log.id = moduleId;
1210
+ log.hook = "transform";
1211
+ handler(log);
1212
+ };
1213
+ this.debug = getLogHandler$1(this.debug);
1214
+ this.warn = getLogHandler$1(this.warn);
1215
+ this.info = getLogHandler$1(this.info);
1216
+ }
1217
+ error(e$5, pos) {
1218
+ if (typeof e$5 === "string") e$5 = { message: e$5 };
1219
+ if (pos) augmentCodeLocation(e$5, pos, this.moduleSource, this.moduleId);
1220
+ e$5.id = this.moduleId;
1221
+ e$5.hook = "transform";
1222
+ return error(logPluginError(normalizeLog(e$5), this.pluginName));
1223
+ }
1224
+ getCombinedSourcemap() {
1225
+ return JSON.parse(this.inner.getCombinedSourcemap());
1226
+ }
1227
+ };
1228
+ } });
1229
+
1230
+ //#endregion
1231
+ //#region src/plugin/bindingify-build-hooks.ts
1232
+ function bindingifyBuildStart(args) {
1233
+ const hook = args.plugin.buildStart;
1234
+ if (!hook) return {};
1235
+ const { handler, meta } = normalizeHook(hook);
1236
+ return {
1237
+ plugin: async (ctx, opts) => {
1238
+ await handler.call(new PluginContextImpl(args.outputOptions, ctx, args.plugin, args.pluginContextData, args.onLog, args.logLevel, args.watchMode), new NormalizedInputOptionsImpl(opts, args.onLog));
1239
+ },
1240
+ meta: bindingifyPluginHookMeta(meta)
1241
+ };
1242
+ }
1243
+ function bindingifyBuildEnd(args) {
1244
+ const hook = args.plugin.buildEnd;
1245
+ if (!hook) return {};
1246
+ const { handler, meta } = normalizeHook(hook);
1247
+ return {
1248
+ plugin: async (ctx, err) => {
1249
+ await handler.call(new PluginContextImpl(args.outputOptions, ctx, args.plugin, args.pluginContextData, args.onLog, args.logLevel, args.watchMode), err ? normalizeErrors(err) : void 0);
1250
+ },
1251
+ meta: bindingifyPluginHookMeta(meta)
1252
+ };
1253
+ }
1254
+ function bindingifyResolveId(args) {
1255
+ const hook = args.plugin.resolveId;
1256
+ if (!hook) return {};
1257
+ const { handler, meta, options } = normalizeHook(hook);
1258
+ return {
1259
+ plugin: async (ctx, specifier, importer, extraOptions) => {
1260
+ const contextResolveOptions = extraOptions.custom != null ? args.pluginContextData.getSavedResolveOptions(extraOptions.custom) : void 0;
1261
+ const newExtraOptions = {
1262
+ ...extraOptions,
1263
+ custom: contextResolveOptions?.custom,
1264
+ [SYMBOL_FOR_RESOLVE_CALLER_THAT_SKIP_SELF]: contextResolveOptions?.[SYMBOL_FOR_RESOLVE_CALLER_THAT_SKIP_SELF]
1265
+ };
1266
+ const ret = await handler.call(new PluginContextImpl(args.outputOptions, ctx, args.plugin, args.pluginContextData, args.onLog, args.logLevel, args.watchMode), specifier, importer ?? void 0, newExtraOptions);
1267
+ if (ret == null) return;
1268
+ if (ret === false) return {
1269
+ id: specifier,
1270
+ external: bindingResolvedExternal(true),
1271
+ normalizeExternalId: true
1272
+ };
1273
+ if (typeof ret === "string") return {
1274
+ id: ret,
1275
+ normalizeExternalId: true
1276
+ };
1277
+ let exist = args.pluginContextData.updateModuleOption(ret.id, {
1278
+ meta: ret.meta || {},
1279
+ moduleSideEffects: ret.moduleSideEffects ?? null,
1280
+ invalidate: false
1281
+ });
1282
+ return {
1283
+ id: ret.id,
1284
+ external: bindingResolvedExternal(ret.external),
1285
+ normalizeExternalId: false,
1286
+ sideEffects: bindingifySideEffects(exist.moduleSideEffects)
1287
+ };
1288
+ },
1289
+ meta: bindingifyPluginHookMeta(meta),
1290
+ filter: bindingifyResolveIdFilter(options.filter)
1291
+ };
1292
+ }
1293
+ function bindingifyResolveDynamicImport(args) {
1294
+ const hook = args.plugin.resolveDynamicImport;
1295
+ if (!hook) return {};
1296
+ const { handler, meta } = normalizeHook(hook);
1297
+ return {
1298
+ plugin: async (ctx, specifier, importer) => {
1299
+ const ret = await handler.call(new PluginContextImpl(args.outputOptions, ctx, args.plugin, args.pluginContextData, args.onLog, args.logLevel, args.watchMode), specifier, importer ?? void 0);
1300
+ if (ret == null) return;
1301
+ if (ret === false) return {
1302
+ id: specifier,
1303
+ external: bindingResolvedExternal(true)
1304
+ };
1305
+ if (typeof ret === "string") return { id: ret };
1306
+ const result = {
1307
+ id: ret.id,
1308
+ external: bindingResolvedExternal(ret.external)
1309
+ };
1310
+ if (ret.moduleSideEffects !== null) result.sideEffects = bindingifySideEffects(ret.moduleSideEffects);
1311
+ args.pluginContextData.updateModuleOption(ret.id, {
1312
+ meta: ret.meta || {},
1313
+ moduleSideEffects: ret.moduleSideEffects || null,
1314
+ invalidate: false
1315
+ });
1316
+ return result;
1317
+ },
1318
+ meta: bindingifyPluginHookMeta(meta)
1319
+ };
1320
+ }
1321
+ function bindingifyTransform(args) {
1322
+ const hook = args.plugin.transform;
1323
+ if (!hook) return {};
1324
+ const { handler, meta, options } = normalizeHook(hook);
1325
+ return {
1326
+ plugin: async (ctx, code, id, meta$1) => {
1327
+ const ret = await handler.call(new TransformPluginContextImpl(args.outputOptions, ctx.inner(), args.plugin, args.pluginContextData, ctx, id, code, args.onLog, args.logLevel, args.watchMode), code, id, meta$1);
1328
+ if (ret == null) return void 0;
1329
+ if (typeof ret === "string") return { code: ret };
1330
+ let moduleOption = args.pluginContextData.updateModuleOption(id, {
1331
+ meta: ret.meta ?? {},
1332
+ moduleSideEffects: ret.moduleSideEffects ?? null,
1333
+ invalidate: false
1334
+ });
1335
+ return {
1336
+ code: ret.code,
1337
+ map: bindingifySourcemap(normalizeTransformHookSourcemap(id, code, ret.map)),
1338
+ sideEffects: bindingifySideEffects(moduleOption.moduleSideEffects),
1339
+ moduleType: ret.moduleType
1340
+ };
1341
+ },
1342
+ meta: bindingifyPluginHookMeta(meta),
1343
+ filter: bindingifyTransformFilter(options.filter)
1344
+ };
1345
+ }
1346
+ function bindingifyLoad(args) {
1347
+ const hook = args.plugin.load;
1348
+ if (!hook) return {};
1349
+ const { handler, meta, options } = normalizeHook(hook);
1350
+ return {
1351
+ plugin: async (ctx, id) => {
1352
+ const ret = await handler.call(new PluginContextImpl(args.outputOptions, ctx, args.plugin, args.pluginContextData, args.onLog, args.logLevel, args.watchMode, id), id);
1353
+ if (ret == null) return;
1354
+ if (typeof ret === "string") return { code: ret };
1355
+ let moduleOption = args.pluginContextData.updateModuleOption(id, {
1356
+ meta: ret.meta || {},
1357
+ moduleSideEffects: ret.moduleSideEffects ?? null,
1358
+ invalidate: false
1359
+ });
1360
+ let map = preProcessSourceMap(ret, id);
1361
+ return {
1362
+ code: ret.code,
1363
+ map: bindingifySourcemap(map),
1364
+ moduleType: ret.moduleType,
1365
+ sideEffects: bindingifySideEffects(moduleOption.moduleSideEffects)
1366
+ };
1367
+ },
1368
+ meta: bindingifyPluginHookMeta(meta),
1369
+ filter: bindingifyLoadFilter(options.filter)
1370
+ };
1371
+ }
1372
+ function preProcessSourceMap(ret, id) {
1373
+ if (!ret.map) return;
1374
+ let map = typeof ret.map === "object" ? ret.map : JSON.parse(ret.map);
1375
+ if (!isEmptySourcemapFiled(map.sources)) {
1376
+ const directory = path.dirname(id) || ".";
1377
+ const sourceRoot = map.sourceRoot || ".";
1378
+ map.sources = map.sources.map((source) => path.resolve(directory, sourceRoot, source));
1379
+ }
1380
+ return map;
1381
+ }
1382
+ function bindingifyModuleParsed(args) {
1383
+ const hook = args.plugin.moduleParsed;
1384
+ if (!hook) return {};
1385
+ const { handler, meta } = normalizeHook(hook);
1386
+ return {
1387
+ plugin: async (ctx, moduleInfo) => {
1388
+ await handler.call(new PluginContextImpl(args.outputOptions, ctx, args.plugin, args.pluginContextData, args.onLog, args.logLevel, args.watchMode), transformModuleInfo(moduleInfo, args.pluginContextData.getModuleOption(moduleInfo.id)));
1389
+ },
1390
+ meta: bindingifyPluginHookMeta(meta)
1391
+ };
1392
+ }
1393
+ var init_bindingify_build_hooks = __esm({ "src/plugin/bindingify-build-hooks.ts"() {
1394
+ init_normalize_hook();
1395
+ init_plugin_context$1();
1396
+ init_normalized_input_options();
1397
+ init_sourcemap();
1398
+ init_error();
1399
+ init_resolved_external();
1400
+ init_transform_module_info();
1401
+ init_transform_side_effects();
1402
+ init_transform_sourcemap();
1403
+ init_bindingify_hook_filter();
1404
+ init_bindingify_plugin_hook_meta();
1405
+ init_plugin_context();
1406
+ init_transform_plugin_context();
1407
+ } });
1408
+
1409
+ //#endregion
1410
+ //#region src/utils/transform-rendered-module.ts
1411
+ function transformToRenderedModule(bindingRenderedModule) {
1412
+ return {
1413
+ get code() {
1414
+ return bindingRenderedModule.code;
1415
+ },
1416
+ get renderedLength() {
1417
+ return bindingRenderedModule.code?.length || 0;
1418
+ },
1419
+ get renderedExports() {
1420
+ return bindingRenderedModule.renderedExports;
1421
+ }
1422
+ };
1423
+ }
1424
+ var init_transform_rendered_module = __esm({ "src/utils/transform-rendered-module.ts"() {} });
1425
+
1426
+ //#endregion
1427
+ //#region src/utils/transform-rendered-chunk.ts
1428
+ function transformRenderedChunk(chunk) {
1429
+ let modules = null;
1430
+ return {
1431
+ get name() {
1432
+ return chunk.name;
1433
+ },
1434
+ get isEntry() {
1435
+ return chunk.isEntry;
1436
+ },
1437
+ get isDynamicEntry() {
1438
+ return chunk.isDynamicEntry;
1439
+ },
1440
+ get facadeModuleId() {
1441
+ return chunk.facadeModuleId;
1442
+ },
1443
+ get moduleIds() {
1444
+ return chunk.moduleIds;
1445
+ },
1446
+ get exports() {
1447
+ return chunk.exports;
1448
+ },
1449
+ get fileName() {
1450
+ return chunk.fileName;
1451
+ },
1452
+ get imports() {
1453
+ return chunk.imports;
1454
+ },
1455
+ get dynamicImports() {
1456
+ return chunk.dynamicImports;
1457
+ },
1458
+ get modules() {
1459
+ if (!modules) modules = transformChunkModules(chunk.modules);
1460
+ return modules;
1461
+ }
1462
+ };
1463
+ }
1464
+ function transformChunkModules(modules) {
1465
+ const result = {};
1466
+ for (let i$21 = 0; i$21 < modules.values.length; i$21++) {
1467
+ let key = modules.keys[i$21];
1468
+ const mod = modules.values[i$21];
1469
+ result[key] = transformToRenderedModule(mod);
1470
+ }
1471
+ return result;
1472
+ }
1473
+ var init_transform_rendered_chunk = __esm({ "src/utils/transform-rendered-chunk.ts"() {
1474
+ init_transform_rendered_module();
1475
+ } });
1476
+
1477
+ //#endregion
1478
+ //#region src/utils/bindingify-output-options.ts
1479
+ function bindingifyOutputOptions(outputOptions) {
1480
+ const { dir, format, exports, hashCharacters, sourcemap, sourcemapDebugIds, sourcemapIgnoreList, sourcemapPathTransform, name, assetFileNames, entryFileNames, chunkFileNames, cssEntryFileNames, cssChunkFileNames, banner, footer, intro, outro, esModule, globals, file, sanitizeFileName } = outputOptions;
1481
+ return {
1482
+ dir,
1483
+ file: file == null ? void 0 : file,
1484
+ format: bindingifyFormat(format),
1485
+ exports,
1486
+ hashCharacters,
1487
+ sourcemap: bindingifySourcemap$1(sourcemap),
1488
+ sourcemapDebugIds,
1489
+ sourcemapIgnoreList: bindingifySourcemapIgnoreList(sourcemapIgnoreList),
1490
+ sourcemapPathTransform,
1491
+ banner: bindingifyAddon(banner),
1492
+ footer: bindingifyAddon(footer),
1493
+ intro: bindingifyAddon(intro),
1494
+ outro: bindingifyAddon(outro),
1495
+ extend: outputOptions.extend,
1496
+ globals,
1497
+ esModule,
1498
+ name,
1499
+ assetFileNames: bindingifyAssetFilenames(assetFileNames),
1500
+ entryFileNames,
1501
+ chunkFileNames,
1502
+ cssEntryFileNames,
1503
+ cssChunkFileNames,
1504
+ plugins: [],
1505
+ minify: outputOptions.minify,
1506
+ externalLiveBindings: outputOptions.externalLiveBindings,
1507
+ inlineDynamicImports: outputOptions.inlineDynamicImports,
1508
+ advancedChunks: outputOptions.advancedChunks,
1509
+ polyfillRequire: outputOptions.polyfillRequire,
1510
+ target: outputOptions.target,
1511
+ sanitizeFileName
1512
+ };
1513
+ }
1514
+ function bindingifyAddon(configAddon) {
1515
+ return async (chunk) => {
1516
+ if (typeof configAddon === "function") return configAddon(transformRenderedChunk(chunk));
1517
+ return configAddon || "";
1518
+ };
1519
+ }
1520
+ function bindingifyFormat(format) {
1521
+ switch (format) {
1522
+ case void 0:
1523
+ case "es":
1524
+ case "esm":
1525
+ case "module": return "es";
1526
+ case "cjs":
1527
+ case "commonjs": return "cjs";
1528
+ case "iife": return "iife";
1529
+ case "umd": return "umd";
1530
+ case "experimental-app": return "app";
1531
+ default: unimplemented(`output.format: ${format}`);
1532
+ }
1533
+ }
1534
+ function bindingifySourcemap$1(sourcemap) {
1535
+ switch (sourcemap) {
1536
+ case true: return "file";
1537
+ case "inline": return "inline";
1538
+ case false:
1539
+ case void 0: return void 0;
1540
+ case "hidden": return "hidden";
1541
+ default: throw new Error(`unknown sourcemap: ${sourcemap}`);
1542
+ }
1543
+ }
1544
+ function bindingifySourcemapIgnoreList(sourcemapIgnoreList) {
1545
+ return typeof sourcemapIgnoreList === "function" ? sourcemapIgnoreList : sourcemapIgnoreList === false ? () => false : (relativeSourcePath, _sourcemapPath) => relativeSourcePath.includes("node_modules");
1546
+ }
1547
+ function bindingifyAssetFilenames(assetFileNames) {
1548
+ if (typeof assetFileNames === "function") return (asset) => {
1549
+ return assetFileNames({
1550
+ names: asset.names,
1551
+ originalFileNames: asset.originalFileNames,
1552
+ source: transformAssetSource(asset.source),
1553
+ type: "asset"
1554
+ });
1555
+ };
1556
+ return assetFileNames;
1557
+ }
1558
+ var init_bindingify_output_options = __esm({ "src/utils/bindingify-output-options.ts"() {
1559
+ init_asset_source();
1560
+ init_misc();
1561
+ init_transform_rendered_chunk();
1562
+ } });
1563
+
1564
+ //#endregion
1565
+ //#region src/options/normalized-output-options.ts
1566
+ function normalizeAddon(value) {
1567
+ if (typeof value === "function") return value;
1568
+ return () => value || "";
1569
+ }
1570
+ var NormalizedOutputOptionsImpl;
1571
+ var init_normalized_output_options = __esm({ "src/options/normalized-output-options.ts"() {
1572
+ init_bindingify_output_options();
1573
+ NormalizedOutputOptionsImpl = class {
1574
+ constructor(inner, outputOptions, normalizedOutputPlugins) {
1575
+ this.inner = inner;
1576
+ this.outputOptions = outputOptions;
1577
+ this.normalizedOutputPlugins = normalizedOutputPlugins;
1578
+ }
1579
+ get dir() {
1580
+ return this.inner.dir ?? void 0;
1581
+ }
1582
+ get entryFileNames() {
1583
+ return this.inner.entryFilenames || this.outputOptions.entryFileNames;
1584
+ }
1585
+ get chunkFileNames() {
1586
+ return this.inner.chunkFilenames || this.outputOptions.chunkFileNames;
1587
+ }
1588
+ get assetFileNames() {
1589
+ return this.inner.assetFilenames || this.outputOptions.assetFileNames;
1590
+ }
1591
+ get format() {
1592
+ return this.inner.format;
1593
+ }
1594
+ get exports() {
1595
+ return this.inner.exports;
1596
+ }
1597
+ get sourcemap() {
1598
+ return this.inner.sourcemap;
1599
+ }
1600
+ get cssEntryFileNames() {
1601
+ return this.inner.cssEntryFilenames || this.outputOptions.cssEntryFileNames;
1602
+ }
1603
+ get cssChunkFileNames() {
1604
+ return this.inner.cssChunkFilenames || this.outputOptions.cssChunkFileNames;
1605
+ }
1606
+ get shimMissingExports() {
1607
+ return this.inner.shimMissingExports;
1608
+ }
1609
+ get name() {
1610
+ return this.inner.name ?? void 0;
1611
+ }
1612
+ get file() {
1613
+ return this.inner.file ?? void 0;
1614
+ }
1615
+ get inlineDynamicImports() {
1616
+ return this.inner.inlineDynamicImports;
1617
+ }
1618
+ get externalLiveBindings() {
1619
+ return this.inner.externalLiveBindings;
1620
+ }
1621
+ get banner() {
1622
+ return normalizeAddon(this.outputOptions.banner);
1623
+ }
1624
+ get footer() {
1625
+ return normalizeAddon(this.outputOptions.footer);
1626
+ }
1627
+ get intro() {
1628
+ return normalizeAddon(this.outputOptions.intro);
1629
+ }
1630
+ get outro() {
1631
+ return normalizeAddon(this.outputOptions.outro);
1632
+ }
1633
+ get esModule() {
1634
+ return this.inner.esModule;
1635
+ }
1636
+ get extend() {
1637
+ return this.inner.extend;
1638
+ }
1639
+ get globals() {
1640
+ return this.inner.globals || this.outputOptions.globals;
1641
+ }
1642
+ get hashCharacters() {
1643
+ return this.inner.hashCharacters;
1644
+ }
1645
+ get sourcemapDebugIds() {
1646
+ return this.inner.sourcemapDebugIds;
1647
+ }
1648
+ get sourcemapIgnoreList() {
1649
+ return bindingifySourcemapIgnoreList(this.outputOptions.sourcemapIgnoreList);
1650
+ }
1651
+ get sourcemapPathTransform() {
1652
+ return this.outputOptions.sourcemapPathTransform;
1653
+ }
1654
+ get minify() {
1655
+ return this.inner.minify;
1656
+ }
1657
+ get comments() {
1658
+ return this.inner.comments;
1659
+ }
1660
+ get polyfillRequire() {
1661
+ return this.inner.polyfillRequire;
1662
+ }
1663
+ get plugins() {
1664
+ return this.normalizedOutputPlugins;
1665
+ }
1666
+ };
1667
+ } });
1668
+
1669
+ //#endregion
1670
+ //#region src/utils/transform-to-rollup-output.ts
1671
+ function transformToRollupSourceMap(map) {
1672
+ const parsed = JSON.parse(map);
1673
+ const obj = {
1674
+ ...parsed,
1675
+ toString() {
1676
+ return JSON.stringify(obj);
1677
+ },
1678
+ toUrl() {
1679
+ return `data:application/json;charset=utf-8;base64,${Buffer.from(obj.toString(), "utf-8").toString("base64")}`;
1680
+ }
1681
+ };
1682
+ return obj;
1683
+ }
1684
+ function transformToRollupOutputChunk(bindingChunk, changed) {
1685
+ const chunk = {
1686
+ type: "chunk",
1687
+ get code() {
1688
+ return bindingChunk.code;
1689
+ },
1690
+ fileName: bindingChunk.fileName,
1691
+ name: bindingChunk.name,
1692
+ get modules() {
1693
+ return transformChunkModules(bindingChunk.modules);
1694
+ },
1695
+ get imports() {
1696
+ return bindingChunk.imports;
1697
+ },
1698
+ get dynamicImports() {
1699
+ return bindingChunk.dynamicImports;
1700
+ },
1701
+ exports: bindingChunk.exports,
1702
+ isEntry: bindingChunk.isEntry,
1703
+ facadeModuleId: bindingChunk.facadeModuleId || null,
1704
+ isDynamicEntry: bindingChunk.isDynamicEntry,
1705
+ get moduleIds() {
1706
+ return bindingChunk.moduleIds;
1707
+ },
1708
+ get map() {
1709
+ return bindingChunk.map ? transformToRollupSourceMap(bindingChunk.map) : null;
1710
+ },
1711
+ sourcemapFileName: bindingChunk.sourcemapFileName || null,
1712
+ preliminaryFileName: bindingChunk.preliminaryFileName
1713
+ };
1714
+ const cache = {};
1715
+ return new Proxy(chunk, {
1716
+ get(target, p$3) {
1717
+ if (p$3 in cache) return cache[p$3];
1718
+ return target[p$3];
1719
+ },
1720
+ set(target, p$3, newValue) {
1721
+ cache[p$3] = newValue;
1722
+ changed?.updated.add(bindingChunk.fileName);
1723
+ return true;
1724
+ },
1725
+ has(target, p$3) {
1726
+ if (p$3 in cache) return true;
1727
+ return p$3 in target;
1728
+ }
1729
+ });
1730
+ }
1731
+ function transformToRollupOutputAsset(bindingAsset, changed) {
1732
+ const asset = {
1733
+ type: "asset",
1734
+ fileName: bindingAsset.fileName,
1735
+ originalFileName: bindingAsset.originalFileName || null,
1736
+ originalFileNames: bindingAsset.originalFileNames,
1737
+ get source() {
1738
+ return transformAssetSource(bindingAsset.source);
1739
+ },
1740
+ name: bindingAsset.name ?? void 0,
1741
+ names: bindingAsset.names
1742
+ };
1743
+ const cache = {};
1744
+ return new Proxy(asset, {
1745
+ get(target, p$3) {
1746
+ if (p$3 in cache) return cache[p$3];
1747
+ return target[p$3];
1748
+ },
1749
+ set(target, p$3, newValue) {
1750
+ cache[p$3] = newValue;
1751
+ changed?.updated.add(bindingAsset.fileName);
1752
+ return true;
1753
+ }
1754
+ });
1755
+ }
1756
+ function transformToRollupOutput(output, changed) {
1757
+ handleOutputErrors(output);
1758
+ const { chunks, assets } = output;
1759
+ return { output: [...chunks.map((chunk) => transformToRollupOutputChunk(chunk, changed)), ...assets.map((asset) => transformToRollupOutputAsset(asset, changed))] };
1760
+ }
1761
+ function handleOutputErrors(output) {
1762
+ const rawErrors = output.errors;
1763
+ if (rawErrors.length > 0) throw normalizeErrors(rawErrors);
1764
+ }
1765
+ function transformToOutputBundle(output, changed) {
1766
+ const bundle = Object.fromEntries(transformToRollupOutput(output, changed).output.map((item) => [item.fileName, item]));
1767
+ return new Proxy(bundle, { deleteProperty(target, property) {
1768
+ if (typeof property === "string") changed.deleted.add(property);
1769
+ return true;
1770
+ } });
1771
+ }
1772
+ function collectChangedBundle(changed, bundle) {
1773
+ const assets = [];
1774
+ const chunks = [];
1775
+ for (const key in bundle) {
1776
+ if (changed.deleted.has(key) || !changed.updated.has(key)) continue;
1777
+ const item = bundle[key];
1778
+ if (item.type === "asset") assets.push({
1779
+ filename: item.fileName,
1780
+ originalFileNames: item.originalFileNames,
1781
+ source: bindingAssetSource(item.source),
1782
+ names: item.names
1783
+ });
1784
+ else chunks.push({
1785
+ code: item.code,
1786
+ filename: item.fileName,
1787
+ name: item.name,
1788
+ isEntry: item.isEntry,
1789
+ exports: item.exports,
1790
+ modules: {},
1791
+ imports: item.imports,
1792
+ dynamicImports: item.dynamicImports,
1793
+ facadeModuleId: item.facadeModuleId || void 0,
1794
+ isDynamicEntry: item.isDynamicEntry,
1795
+ moduleIds: item.moduleIds,
1796
+ map: bindingifySourcemap(item.map),
1797
+ sourcemapFilename: item.sourcemapFileName || void 0,
1798
+ preliminaryFilename: item.preliminaryFileName
1799
+ });
1800
+ }
1801
+ return {
1802
+ assets,
1803
+ chunks,
1804
+ deleted: Array.from(changed.deleted)
1805
+ };
1806
+ }
1807
+ var init_transform_to_rollup_output = __esm({ "src/utils/transform-to-rollup-output.ts"() {
1808
+ init_sourcemap();
1809
+ init_asset_source();
1810
+ init_error();
1811
+ init_transform_rendered_chunk();
1812
+ } });
1813
+
1814
+ //#endregion
1815
+ //#region src/plugin/bindingify-output-hooks.ts
1816
+ function bindingifyRenderStart(args) {
1817
+ const hook = args.plugin.renderStart;
1818
+ if (!hook) return {};
1819
+ const { handler, meta } = normalizeHook(hook);
1820
+ return {
1821
+ plugin: async (ctx, opts) => {
1822
+ handler.call(new PluginContextImpl(args.outputOptions, ctx, args.plugin, args.pluginContextData, args.onLog, args.logLevel, args.watchMode), new NormalizedOutputOptionsImpl(opts, args.outputOptions, args.normalizedOutputPlugins), new NormalizedInputOptionsImpl(opts, args.onLog));
1823
+ },
1824
+ meta: bindingifyPluginHookMeta(meta)
1825
+ };
1826
+ }
1827
+ function bindingifyRenderChunk(args) {
1828
+ const hook = args.plugin.renderChunk;
1829
+ if (!hook) return {};
1830
+ const { handler, meta } = normalizeHook(hook);
1831
+ return {
1832
+ plugin: async (ctx, code, chunk, opts, meta$1) => {
1833
+ if (args.pluginContextData.getRenderChunkMeta() == null) args.pluginContextData.setRenderChunkMeta({ chunks: Object.fromEntries(Object.entries(meta$1.chunks).map(([key, value]) => [key, transformRenderedChunk(value)])) });
1834
+ const ret = await handler.call(new PluginContextImpl(args.outputOptions, ctx, args.plugin, args.pluginContextData, args.onLog, args.logLevel, args.watchMode), code, transformRenderedChunk(chunk), new NormalizedOutputOptionsImpl(opts, args.outputOptions, args.normalizedOutputPlugins), args.pluginContextData.getRenderChunkMeta());
1835
+ if (ret == null) return;
1836
+ if (typeof ret === "string") return { code: ret };
1837
+ if (!ret.map) return { code: ret.code };
1838
+ return {
1839
+ code: ret.code,
1840
+ map: bindingifySourcemap(ret.map)
1841
+ };
1842
+ },
1843
+ meta: bindingifyPluginHookMeta(meta)
1844
+ };
1845
+ }
1846
+ function bindingifyAugmentChunkHash(args) {
1847
+ const hook = args.plugin.augmentChunkHash;
1848
+ if (!hook) return {};
1849
+ const { handler, meta } = normalizeHook(hook);
1850
+ return {
1851
+ plugin: async (ctx, chunk) => {
1852
+ return await handler.call(new PluginContextImpl(args.outputOptions, ctx, args.plugin, args.pluginContextData, args.onLog, args.logLevel, args.watchMode), transformRenderedChunk(chunk));
1853
+ },
1854
+ meta: bindingifyPluginHookMeta(meta)
1855
+ };
1856
+ }
1857
+ function bindingifyRenderError(args) {
1858
+ const hook = args.plugin.renderError;
1859
+ if (!hook) return {};
1860
+ const { handler, meta } = normalizeHook(hook);
1861
+ return {
1862
+ plugin: async (ctx, err) => {
1863
+ handler.call(new PluginContextImpl(args.outputOptions, ctx, args.plugin, args.pluginContextData, args.onLog, args.logLevel, args.watchMode), normalizeErrors(err));
1864
+ },
1865
+ meta: bindingifyPluginHookMeta(meta)
1866
+ };
1867
+ }
1868
+ function bindingifyGenerateBundle(args) {
1869
+ const hook = args.plugin.generateBundle;
1870
+ if (!hook) return {};
1871
+ const { handler, meta } = normalizeHook(hook);
1872
+ return {
1873
+ plugin: async (ctx, bundle, isWrite, opts) => {
1874
+ const changed = {
1875
+ updated: new Set(),
1876
+ deleted: new Set()
1877
+ };
1878
+ const output = transformToOutputBundle(bundle, changed);
1879
+ await handler.call(new PluginContextImpl(args.outputOptions, ctx, args.plugin, args.pluginContextData, args.onLog, args.logLevel, args.watchMode), new NormalizedOutputOptionsImpl(opts, args.outputOptions, args.normalizedOutputPlugins), output, isWrite);
1880
+ return collectChangedBundle(changed, output);
1881
+ },
1882
+ meta: bindingifyPluginHookMeta(meta)
1883
+ };
1884
+ }
1885
+ function bindingifyWriteBundle(args) {
1886
+ const hook = args.plugin.writeBundle;
1887
+ if (!hook) return {};
1888
+ const { handler, meta } = normalizeHook(hook);
1889
+ return {
1890
+ plugin: async (ctx, bundle, opts) => {
1891
+ const changed = {
1892
+ updated: new Set(),
1893
+ deleted: new Set()
1894
+ };
1895
+ const output = transformToOutputBundle(bundle, changed);
1896
+ await handler.call(new PluginContextImpl(args.outputOptions, ctx, args.plugin, args.pluginContextData, args.onLog, args.logLevel, args.watchMode), new NormalizedOutputOptionsImpl(opts, args.outputOptions, args.normalizedOutputPlugins), output);
1897
+ return collectChangedBundle(changed, output);
1898
+ },
1899
+ meta: bindingifyPluginHookMeta(meta)
1900
+ };
1901
+ }
1902
+ function bindingifyCloseBundle(args) {
1903
+ const hook = args.plugin.closeBundle;
1904
+ if (!hook) return {};
1905
+ const { handler, meta } = normalizeHook(hook);
1906
+ return {
1907
+ plugin: async (ctx) => {
1908
+ await handler.call(new PluginContextImpl(args.outputOptions, ctx, args.plugin, args.pluginContextData, args.onLog, args.logLevel, args.watchMode));
1909
+ },
1910
+ meta: bindingifyPluginHookMeta(meta)
1911
+ };
1912
+ }
1913
+ function bindingifyBanner(args) {
1914
+ const hook = args.plugin.banner;
1915
+ if (!hook) return {};
1916
+ const { handler, meta } = normalizeHook(hook);
1917
+ return {
1918
+ plugin: async (ctx, chunk) => {
1919
+ if (typeof handler === "string") return handler;
1920
+ return handler.call(new PluginContextImpl(args.outputOptions, ctx, args.plugin, args.pluginContextData, args.onLog, args.logLevel, args.watchMode), transformRenderedChunk(chunk));
1921
+ },
1922
+ meta: bindingifyPluginHookMeta(meta)
1923
+ };
1924
+ }
1925
+ function bindingifyFooter(args) {
1926
+ const hook = args.plugin.footer;
1927
+ if (!hook) return {};
1928
+ const { handler, meta } = normalizeHook(hook);
1929
+ return {
1930
+ plugin: async (ctx, chunk) => {
1931
+ if (typeof handler === "string") return handler;
1932
+ return handler.call(new PluginContextImpl(args.outputOptions, ctx, args.plugin, args.pluginContextData, args.onLog, args.logLevel, args.watchMode), transformRenderedChunk(chunk));
1933
+ },
1934
+ meta: bindingifyPluginHookMeta(meta)
1935
+ };
1936
+ }
1937
+ function bindingifyIntro(args) {
1938
+ const hook = args.plugin.intro;
1939
+ if (!hook) return {};
1940
+ const { handler, meta } = normalizeHook(hook);
1941
+ return {
1942
+ plugin: async (ctx, chunk) => {
1943
+ if (typeof handler === "string") return handler;
1944
+ return handler.call(new PluginContextImpl(args.outputOptions, ctx, args.plugin, args.pluginContextData, args.onLog, args.logLevel, args.watchMode), transformRenderedChunk(chunk));
1945
+ },
1946
+ meta: bindingifyPluginHookMeta(meta)
1947
+ };
1948
+ }
1949
+ function bindingifyOutro(args) {
1950
+ const hook = args.plugin.outro;
1951
+ if (!hook) return {};
1952
+ const { handler, meta } = normalizeHook(hook);
1953
+ return {
1954
+ plugin: async (ctx, chunk) => {
1955
+ if (typeof handler === "string") return handler;
1956
+ return handler.call(new PluginContextImpl(args.outputOptions, ctx, args.plugin, args.pluginContextData, args.onLog, args.logLevel, args.watchMode), transformRenderedChunk(chunk));
1957
+ },
1958
+ meta: bindingifyPluginHookMeta(meta)
1959
+ };
1960
+ }
1961
+ var init_bindingify_output_hooks = __esm({ "src/plugin/bindingify-output-hooks.ts"() {
1962
+ init_normalized_input_options();
1963
+ init_normalized_output_options();
1964
+ init_sourcemap();
1965
+ init_error();
1966
+ init_normalize_hook();
1967
+ init_transform_rendered_chunk();
1968
+ init_transform_to_rollup_output();
1969
+ init_bindingify_plugin_hook_meta();
1970
+ init_plugin_context();
1971
+ } });
1972
+
1973
+ //#endregion
1974
+ //#region src/plugin/bindingify-watch-hooks.ts
1975
+ function bindingifyWatchChange(args) {
1976
+ const hook = args.plugin.watchChange;
1977
+ if (!hook) return {};
1978
+ const { handler, meta } = normalizeHook(hook);
1979
+ return {
1980
+ plugin: async (ctx, id, event) => {
1981
+ await handler.call(new PluginContextImpl(args.outputOptions, ctx, args.plugin, args.pluginContextData, args.onLog, args.logLevel, args.watchMode), id, { event });
1982
+ },
1983
+ meta: bindingifyPluginHookMeta(meta)
1984
+ };
1985
+ }
1986
+ function bindingifyCloseWatcher(args) {
1987
+ const hook = args.plugin.closeWatcher;
1988
+ if (!hook) return {};
1989
+ const { handler, meta } = normalizeHook(hook);
1990
+ return {
1991
+ plugin: async (ctx) => {
1992
+ await handler.call(new PluginContextImpl(args.outputOptions, ctx, args.plugin, args.pluginContextData, args.onLog, args.logLevel, args.watchMode));
1993
+ },
1994
+ meta: bindingifyPluginHookMeta(meta)
1995
+ };
1996
+ }
1997
+ var init_bindingify_watch_hooks = __esm({ "src/plugin/bindingify-watch-hooks.ts"() {
1998
+ init_normalize_hook();
1999
+ init_bindingify_plugin_hook_meta();
2000
+ init_plugin_context();
2001
+ } });
2002
+
2003
+ //#endregion
2004
+ //#region src/plugin/bindingify-plugin.ts
2005
+ function bindingifyPlugin(plugin, options, outputOptions, pluginContextData, normalizedOutputPlugins, onLog, logLevel, watchMode) {
2006
+ const args = {
2007
+ plugin,
2008
+ options,
2009
+ outputOptions,
2010
+ pluginContextData,
2011
+ onLog,
2012
+ logLevel,
2013
+ watchMode,
2014
+ normalizedOutputPlugins
2015
+ };
2016
+ const { plugin: buildStart, meta: buildStartMeta } = bindingifyBuildStart(args);
2017
+ const { plugin: resolveId, meta: resolveIdMeta, filter: resolveIdFilter } = bindingifyResolveId(args);
2018
+ const { plugin: resolveDynamicImport, meta: resolveDynamicImportMeta } = bindingifyResolveDynamicImport(args);
2019
+ const { plugin: buildEnd, meta: buildEndMeta } = bindingifyBuildEnd(args);
2020
+ const { plugin: transform, meta: transformMeta, filter: transformFilter } = bindingifyTransform(args);
2021
+ const { plugin: moduleParsed, meta: moduleParsedMeta } = bindingifyModuleParsed(args);
2022
+ const { plugin: load, meta: loadMeta, filter: loadFilter } = bindingifyLoad(args);
2023
+ const { plugin: renderChunk, meta: renderChunkMeta } = bindingifyRenderChunk(args);
2024
+ const { plugin: augmentChunkHash, meta: augmentChunkHashMeta } = bindingifyAugmentChunkHash(args);
2025
+ const { plugin: renderStart, meta: renderStartMeta } = bindingifyRenderStart(args);
2026
+ const { plugin: renderError, meta: renderErrorMeta } = bindingifyRenderError(args);
2027
+ const { plugin: generateBundle, meta: generateBundleMeta } = bindingifyGenerateBundle(args);
2028
+ const { plugin: writeBundle, meta: writeBundleMeta } = bindingifyWriteBundle(args);
2029
+ const { plugin: closeBundle, meta: closeBundleMeta } = bindingifyCloseBundle(args);
2030
+ const { plugin: banner, meta: bannerMeta } = bindingifyBanner(args);
2031
+ const { plugin: footer, meta: footerMeta } = bindingifyFooter(args);
2032
+ const { plugin: intro, meta: introMeta } = bindingifyIntro(args);
2033
+ const { plugin: outro, meta: outroMeta } = bindingifyOutro(args);
2034
+ const { plugin: watchChange, meta: watchChangeMeta } = bindingifyWatchChange(args);
2035
+ const { plugin: closeWatcher, meta: closeWatcherMeta } = bindingifyCloseWatcher(args);
2036
+ const result = {
2037
+ name: plugin.name,
2038
+ buildStart,
2039
+ buildStartMeta,
2040
+ resolveId,
2041
+ resolveIdMeta,
2042
+ resolveIdFilter,
2043
+ resolveDynamicImport,
2044
+ resolveDynamicImportMeta,
2045
+ buildEnd,
2046
+ buildEndMeta,
2047
+ transform,
2048
+ transformMeta,
2049
+ transformFilter,
2050
+ moduleParsed,
2051
+ moduleParsedMeta,
2052
+ load,
2053
+ loadMeta,
2054
+ loadFilter,
2055
+ renderChunk,
2056
+ renderChunkMeta,
2057
+ augmentChunkHash,
2058
+ augmentChunkHashMeta,
2059
+ renderStart,
2060
+ renderStartMeta,
2061
+ renderError,
2062
+ renderErrorMeta,
2063
+ generateBundle,
2064
+ generateBundleMeta,
2065
+ writeBundle,
2066
+ writeBundleMeta,
2067
+ closeBundle,
2068
+ closeBundleMeta,
2069
+ banner,
2070
+ bannerMeta,
2071
+ footer,
2072
+ footerMeta,
2073
+ intro,
2074
+ introMeta,
2075
+ outro,
2076
+ outroMeta,
2077
+ watchChange,
2078
+ watchChangeMeta,
2079
+ closeWatcher,
2080
+ closeWatcherMeta
2081
+ };
2082
+ return wrapHandlers(result);
2083
+ }
2084
+ function wrapHandlers(plugin) {
2085
+ for (const hookName of [
2086
+ "buildStart",
2087
+ "resolveId",
2088
+ "resolveDynamicImport",
2089
+ "buildEnd",
2090
+ "transform",
2091
+ "moduleParsed",
2092
+ "load",
2093
+ "renderChunk",
2094
+ "augmentChunkHash",
2095
+ "renderStart",
2096
+ "renderError",
2097
+ "generateBundle",
2098
+ "writeBundle",
2099
+ "closeBundle",
2100
+ "banner",
2101
+ "footer",
2102
+ "intro",
2103
+ "outro",
2104
+ "watchChange",
2105
+ "closeWatcher"
2106
+ ]) {
2107
+ const handler = plugin[hookName];
2108
+ if (handler) plugin[hookName] = async (...args) => {
2109
+ try {
2110
+ return await handler(...args);
2111
+ } catch (e$5) {
2112
+ return error(logPluginError(e$5, plugin.name, {
2113
+ hook: hookName,
2114
+ id: hookName === "transform" ? args[2] : void 0
2115
+ }));
2116
+ }
2117
+ };
2118
+ }
2119
+ return plugin;
2120
+ }
2121
+ var init_bindingify_plugin = __esm({ "src/plugin/bindingify-plugin.ts"() {
2122
+ init_bindingify_build_hooks();
2123
+ init_bindingify_output_hooks();
2124
+ init_logs();
2125
+ init_bindingify_watch_hooks();
2126
+ } });
2127
+
2128
+ //#endregion
2129
+ //#region src/plugin/plugin-context-data.ts
2130
+ var PluginContextData;
2131
+ var init_plugin_context_data = __esm({ "src/plugin/plugin-context-data.ts"() {
2132
+ init_transform_module_info();
2133
+ PluginContextData = class {
2134
+ moduleOptionMap = new Map();
2135
+ resolveOptionsMap = new Map();
2136
+ loadModulePromiseMap = new Map();
2137
+ meta = null;
2138
+ updateModuleOption(id, option) {
2139
+ const existing = this.moduleOptionMap.get(id);
2140
+ if (existing) {
2141
+ if (option.moduleSideEffects != null) existing.moduleSideEffects = option.moduleSideEffects;
2142
+ if (option.meta != null) Object.assign(existing.meta, option.meta);
2143
+ if (option.invalidate != null) existing.invalidate = option.invalidate;
2144
+ } else {
2145
+ this.moduleOptionMap.set(id, option);
2146
+ return option;
2147
+ }
2148
+ return existing;
2149
+ }
2150
+ getModuleOption(id) {
2151
+ const option = this.moduleOptionMap.get(id);
2152
+ if (!option) {
2153
+ const raw = {
2154
+ moduleSideEffects: null,
2155
+ meta: {}
2156
+ };
2157
+ this.moduleOptionMap.set(id, raw);
2158
+ return raw;
2159
+ }
2160
+ return option;
2161
+ }
2162
+ getModuleInfo(id, context) {
2163
+ const bindingInfo = context.getModuleInfo(id);
2164
+ if (bindingInfo) {
2165
+ const info = transformModuleInfo(bindingInfo, this.getModuleOption(id));
2166
+ return this.proxyModuleInfo(id, info);
2167
+ }
2168
+ return null;
2169
+ }
2170
+ proxyModuleInfo(id, info) {
2171
+ let moduleSideEffects = info.moduleSideEffects;
2172
+ Object.defineProperty(info, "moduleSideEffects", {
2173
+ get() {
2174
+ return moduleSideEffects;
2175
+ },
2176
+ set: (v$1) => {
2177
+ this.updateModuleOption(id, {
2178
+ moduleSideEffects: v$1,
2179
+ meta: info.meta,
2180
+ invalidate: true
2181
+ });
2182
+ moduleSideEffects = v$1;
2183
+ }
2184
+ });
2185
+ return info;
2186
+ }
2187
+ getModuleIds(context) {
2188
+ const moduleIds = context.getModuleIds();
2189
+ return moduleIds.values();
2190
+ }
2191
+ saveResolveOptions(options) {
2192
+ const index = this.resolveOptionsMap.size;
2193
+ this.resolveOptionsMap.set(index, options);
2194
+ return index;
2195
+ }
2196
+ getSavedResolveOptions(receipt) {
2197
+ return this.resolveOptionsMap.get(receipt);
2198
+ }
2199
+ removeSavedResolveOptions(receipt) {
2200
+ this.resolveOptionsMap.delete(receipt);
2201
+ }
2202
+ setRenderChunkMeta(meta) {
2203
+ this.meta = meta;
2204
+ }
2205
+ getRenderChunkMeta() {
2206
+ return this.meta;
2207
+ }
2208
+ };
2209
+ } });
2210
+
2211
+ //#endregion
2212
+ //#region src/utils/normalize-string-or-regex.ts
2213
+ function normalizedStringOrRegex(pattern) {
2214
+ if (!pattern) return void 0;
2215
+ if (!Array.isArray(pattern)) pattern = [pattern];
2216
+ return pattern;
2217
+ }
2218
+ var init_normalize_string_or_regex = __esm({ "src/utils/normalize-string-or-regex.ts"() {} });
2219
+
2220
+ //#endregion
2221
+ //#region src/utils/bindingify-input-options.ts
2222
+ function bindingifyInputOptions(rawPlugins, inputOptions, outputOptions, normalizedOutputPlugins, onLog, logLevel, watchMode) {
2223
+ const pluginContextData = new PluginContextData();
2224
+ const plugins = rawPlugins.map((plugin) => {
2225
+ if ("_parallel" in plugin) return void 0;
2226
+ if (plugin instanceof BuiltinPlugin) return bindingifyBuiltInPlugin(plugin);
2227
+ return bindingifyPlugin(plugin, inputOptions, outputOptions, pluginContextData, normalizedOutputPlugins, onLog, logLevel, watchMode);
2228
+ });
2229
+ return {
2230
+ input: bindingifyInput(inputOptions.input),
2231
+ plugins,
2232
+ cwd: inputOptions.cwd ?? process.cwd(),
2233
+ external: bindingifyExternal(inputOptions.external),
2234
+ resolve: bindingifyResolve(inputOptions.resolve),
2235
+ platform: inputOptions.platform,
2236
+ shimMissingExports: inputOptions.shimMissingExports,
2237
+ logLevel: bindingifyLogLevel(logLevel),
2238
+ onLog,
2239
+ treeshake: bindingifyTreeshakeOptions(inputOptions.treeshake),
2240
+ moduleTypes: inputOptions.moduleTypes,
2241
+ define: inputOptions.define ? Object.entries(inputOptions.define) : void 0,
2242
+ inject: bindingifyInject(inputOptions.inject),
2243
+ experimental: {
2244
+ strictExecutionOrder: inputOptions.experimental?.strictExecutionOrder,
2245
+ disableLiveBindings: inputOptions.experimental?.disableLiveBindings,
2246
+ viteMode: inputOptions.experimental?.viteMode,
2247
+ resolveNewUrlToAsset: inputOptions.experimental?.resolveNewUrlToAsset,
2248
+ hmr: bindingifyHmr(inputOptions.experimental?.hmr)
2249
+ },
2250
+ profilerNames: inputOptions?.profilerNames,
2251
+ jsx: bindingifyJsx(inputOptions.jsx),
2252
+ transform: inputOptions.transform,
2253
+ watch: bindingifyWatch(inputOptions.watch),
2254
+ dropLabels: inputOptions.dropLabels,
2255
+ keepNames: inputOptions.keepNames,
2256
+ checks: inputOptions.checks,
2257
+ deferSyncScanData: () => {
2258
+ let ret = [];
2259
+ pluginContextData.moduleOptionMap.forEach((value, key) => {
2260
+ if (value.invalidate) ret.push({
2261
+ id: key,
2262
+ sideEffects: bindingifySideEffects(value.moduleSideEffects)
2263
+ });
2264
+ });
2265
+ return ret;
2266
+ },
2267
+ makeAbsoluteExternalsRelative: bindingifyMakeAbsoluteExternalsRelative(inputOptions.makeAbsoluteExternalsRelative)
2268
+ };
2269
+ }
2270
+ function bindingifyHmr(hmr) {
2271
+ if (hmr) {
2272
+ if (typeof hmr === "boolean") return hmr ? {} : void 0;
2273
+ return hmr;
2274
+ }
2275
+ }
2276
+ function bindingifyExternal(external) {
2277
+ if (external) {
2278
+ if (typeof external === "function") return (id, importer, isResolved) => {
2279
+ if (id.startsWith("\0")) return false;
2280
+ return external(id, importer, isResolved) ?? false;
2281
+ };
2282
+ const externalArr = arraify(external);
2283
+ return (id, _importer, _isResolved) => {
2284
+ return externalArr.some((pat) => {
2285
+ if (pat instanceof RegExp) return pat.test(id);
2286
+ return id === pat;
2287
+ });
2288
+ };
2289
+ }
2290
+ }
2291
+ function bindingifyResolve(resolve) {
2292
+ if (resolve) {
2293
+ const { alias, extensionAlias,...rest } = resolve;
2294
+ return {
2295
+ alias: alias ? Object.entries(alias).map(([name, replacement]) => ({
2296
+ find: name,
2297
+ replacements: arraify(replacement)
2298
+ })) : void 0,
2299
+ extensionAlias: extensionAlias ? Object.entries(extensionAlias).map(([name, value]) => ({
2300
+ target: name,
2301
+ replacements: value
2302
+ })) : void 0,
2303
+ ...rest
2304
+ };
2305
+ }
2306
+ }
2307
+ function bindingifyInject(inject) {
2308
+ if (inject) return Object.entries(inject).map(([alias, item]) => {
2309
+ if (Array.isArray(item)) {
2310
+ if (item[1] === "*") return {
2311
+ tagNamespace: true,
2312
+ alias,
2313
+ from: item[0]
2314
+ };
2315
+ return {
2316
+ tagNamed: true,
2317
+ alias,
2318
+ from: item[0],
2319
+ imported: item[1]
2320
+ };
2321
+ } else return {
2322
+ tagNamed: true,
2323
+ imported: "default",
2324
+ alias,
2325
+ from: item
2326
+ };
2327
+ });
2328
+ }
2329
+ function bindingifyLogLevel(logLevel) {
2330
+ switch (logLevel) {
2331
+ case "silent": return import_binding.BindingLogLevel.Silent;
2332
+ case "debug": return import_binding.BindingLogLevel.Debug;
2333
+ case "warn": return import_binding.BindingLogLevel.Warn;
2334
+ case "info": return import_binding.BindingLogLevel.Info;
2335
+ default: throw new Error(`Unexpected log level: ${logLevel}`);
2336
+ }
2337
+ }
2338
+ function bindingifyInput(input) {
2339
+ if (input === void 0) return [];
2340
+ if (typeof input === "string") return [{ import: input }];
2341
+ if (Array.isArray(input)) return input.map((src) => ({ import: src }));
2342
+ return Object.entries(input).map(([name, import_path]) => {
2343
+ return {
2344
+ name,
2345
+ import: import_path
2346
+ };
2347
+ });
2348
+ }
2349
+ function bindingifyJsx(input) {
2350
+ switch (input) {
2351
+ case false: return { type: "Disable" };
2352
+ case "react": return { type: "React" };
2353
+ case "react-jsx": return { type: "ReactJsx" };
2354
+ case "preserve": return { type: "Preserve" };
2355
+ case void 0: return void 0;
2356
+ }
2357
+ if (input.mode === "preserve") return { type: "Preserve" };
2358
+ const mode = input.mode ?? "automatic";
2359
+ return {
2360
+ type: "Enable",
2361
+ field0: {
2362
+ runtime: mode,
2363
+ importSource: mode === "classic" ? input.importSource : mode === "automatic" ? input.jsxImportSource : void 0,
2364
+ pragma: input.factory,
2365
+ pragmaFrag: input.fragment,
2366
+ development: input.development,
2367
+ refresh: input.refresh
2368
+ }
2369
+ };
2370
+ }
2371
+ function bindingifyWatch(watch$1) {
2372
+ if (watch$1) return {
2373
+ buildDelay: watch$1.buildDelay,
2374
+ skipWrite: watch$1.skipWrite,
2375
+ include: normalizedStringOrRegex(watch$1.include),
2376
+ exclude: normalizedStringOrRegex(watch$1.exclude)
2377
+ };
2378
+ }
2379
+ function bindingifyTreeshakeOptions(config) {
2380
+ if (config === false) return void 0;
2381
+ if (config === true || config === void 0) return { moduleSideEffects: true };
2382
+ let normalizedConfig = {
2383
+ moduleSideEffects: true,
2384
+ annotations: config.annotations,
2385
+ manualPureFunctions: config.manualPureFunctions,
2386
+ unknownGlobalSideEffects: config.unknownGlobalSideEffects
2387
+ };
2388
+ if (config.moduleSideEffects === void 0) normalizedConfig.moduleSideEffects = true;
2389
+ else if (config.moduleSideEffects === "no-external") normalizedConfig.moduleSideEffects = [{
2390
+ external: true,
2391
+ sideEffects: false
2392
+ }, {
2393
+ external: false,
2394
+ sideEffects: true
2395
+ }];
2396
+ else normalizedConfig.moduleSideEffects = config.moduleSideEffects;
2397
+ return normalizedConfig;
2398
+ }
2399
+ function bindingifyMakeAbsoluteExternalsRelative(makeAbsoluteExternalsRelative) {
2400
+ if (makeAbsoluteExternalsRelative === "ifRelativeSource") return { type: "IfRelativeSource" };
2401
+ if (typeof makeAbsoluteExternalsRelative === "boolean") return {
2402
+ type: "Bool",
2403
+ field0: makeAbsoluteExternalsRelative
2404
+ };
2405
+ }
2406
+ var init_bindingify_input_options = __esm({ "src/utils/bindingify-input-options.ts"() {
2407
+ init_constructors();
2408
+ init_utils();
2409
+ init_bindingify_plugin();
2410
+ init_plugin_context_data();
2411
+ init_misc();
2412
+ init_normalize_string_or_regex();
2413
+ init_transform_side_effects();
2414
+ } });
2415
+
2416
+ //#endregion
2417
+ //#region ../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-ANXBDSUI.js
2418
+ var init_chunk_ANXBDSUI = __esm({ "../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-ANXBDSUI.js"() {} });
2419
+
2420
+ //#endregion
2421
+ //#region ../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-3GOCSNFN.js
2422
+ var init_chunk_3GOCSNFN = __esm({ "../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-3GOCSNFN.js"() {
2423
+ init_chunk_ANXBDSUI();
2424
+ } });
2425
+
2426
+ //#endregion
2427
+ //#region ../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-LFJW7BOT.js
2428
+ var init_chunk_LFJW7BOT = __esm({ "../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-LFJW7BOT.js"() {
2429
+ init_chunk_3GOCSNFN();
2430
+ } });
2431
+
2432
+ //#endregion
2433
+ //#region ../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-7ZI6JRPB.js
2434
+ var init_chunk_7ZI6JRPB = __esm({ "../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-7ZI6JRPB.js"() {
2435
+ init_chunk_LFJW7BOT();
2436
+ init_chunk_ANXBDSUI();
2437
+ } });
2438
+
2439
+ //#endregion
2440
+ //#region ../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-OXJMERKM.js
2441
+ var init_chunk_OXJMERKM = __esm({ "../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-OXJMERKM.js"() {
2442
+ init_chunk_LFJW7BOT();
2443
+ init_chunk_ANXBDSUI();
2444
+ } });
2445
+
2446
+ //#endregion
2447
+ //#region ../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-D6FCK2GA.js
2448
+ function u$13(o$12, n$7, a$15) {
2449
+ let t$14 = (r$12) => o$12(r$12, ...n$7);
2450
+ return a$15 === void 0 ? t$14 : Object.assign(t$14, {
2451
+ lazy: a$15,
2452
+ lazyArgs: n$7
2453
+ });
2454
+ }
2455
+ var init_chunk_D6FCK2GA = __esm({ "../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-D6FCK2GA.js"() {} });
2456
+
2457
+ //#endregion
2458
+ //#region ../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-WIMGWYZL.js
2459
+ function u$11(r$12, n$7, o$12) {
2460
+ let a$15 = r$12.length - n$7.length;
2461
+ if (a$15 === 0) return r$12(...n$7);
2462
+ if (a$15 === 1) return u$13(r$12, n$7, o$12);
2463
+ throw new Error("Wrong number of arguments");
2464
+ }
2465
+ var init_chunk_WIMGWYZL = __esm({ "../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-WIMGWYZL.js"() {
2466
+ init_chunk_D6FCK2GA();
2467
+ } });
2468
+
2469
+ //#endregion
2470
+ //#region ../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-BSLJB6JE.js
2471
+ var init_chunk_BSLJB6JE = __esm({ "../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-BSLJB6JE.js"() {
2472
+ init_chunk_WIMGWYZL();
2473
+ } });
2474
+
2475
+ //#endregion
2476
+ //#region ../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-NJXNQM3G.js
2477
+ var init_chunk_NJXNQM3G = __esm({ "../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-NJXNQM3G.js"() {} });
2478
+
2479
+ //#endregion
2480
+ //#region ../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-6RKHJ2CP.js
2481
+ var init_chunk_6RKHJ2CP = __esm({ "../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-6RKHJ2CP.js"() {
2482
+ init_chunk_WIMGWYZL();
2483
+ } });
2484
+
2485
+ //#endregion
2486
+ //#region ../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-QDGUNRDA.js
2487
+ var init_chunk_QDGUNRDA = __esm({ "../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-QDGUNRDA.js"() {
2488
+ init_chunk_D6FCK2GA();
2489
+ } });
2490
+
2491
+ //#endregion
2492
+ //#region ../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-MYLLMFC7.js
2493
+ var init_chunk_MYLLMFC7 = __esm({ "../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-MYLLMFC7.js"() {
2494
+ init_chunk_WIMGWYZL();
2495
+ } });
2496
+
2497
+ //#endregion
2498
+ //#region ../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-DEVKGLTN.js
2499
+ var o$11, c$3, i$20;
2500
+ var init_chunk_DEVKGLTN = __esm({ "../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-DEVKGLTN.js"() {
2501
+ o$11 = [
2502
+ " ",
2503
+ `
2504
+ `,
2505
+ "\v",
2506
+ "\f",
2507
+ "\r",
2508
+ " ",
2509
+ "…",
2510
+ "\xA0",
2511
+ " ",
2512
+ " ",
2513
+ " ",
2514
+ " ",
2515
+ " ",
2516
+ " ",
2517
+ " ",
2518
+ " ",
2519
+ " ",
2520
+ " ",
2521
+ " ",
2522
+ " ",
2523
+ "\u2028",
2524
+ "\u2029",
2525
+ " ",
2526
+ " ",
2527
+ " ",
2528
+ ""
2529
+ ], c$3 = new Set([
2530
+ "-",
2531
+ "_",
2532
+ ...o$11
2533
+ ]), i$20 = (r$12) => {
2534
+ let e$5 = [], t$14 = "", u$14 = () => {
2535
+ t$14.length > 0 && (e$5.push(t$14), t$14 = "");
2536
+ };
2537
+ for (let s$10 of r$12) {
2538
+ if (c$3.has(s$10)) {
2539
+ u$14();
2540
+ continue;
2541
+ }
2542
+ if (/[a-z]$/u.test(t$14) && /[A-Z]/u.test(s$10)) u$14();
2543
+ else if (/[A-Z][A-Z]$/u.test(t$14) && /[a-z]/u.test(s$10)) {
2544
+ let n$7 = t$14.slice(-1);
2545
+ t$14 = t$14.slice(0, -1), u$14(), t$14 = n$7;
2546
+ } else /\d$/u.test(t$14) !== /\d/u.test(s$10) && u$14();
2547
+ t$14 += s$10;
2548
+ }
2549
+ return u$14(), e$5;
2550
+ };
2551
+ } });
2552
+
2553
+ //#endregion
2554
+ //#region ../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-N4JUOEMS.js
2555
+ var init_chunk_N4JUOEMS = __esm({ "../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-N4JUOEMS.js"() {
2556
+ init_chunk_DEVKGLTN();
2557
+ } });
2558
+
2559
+ //#endregion
2560
+ //#region ../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-YRJ25UV2.js
2561
+ var init_chunk_YRJ25UV2 = __esm({ "../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-YRJ25UV2.js"() {
2562
+ init_chunk_DEVKGLTN();
2563
+ init_chunk_WIMGWYZL();
2564
+ } });
2565
+
2566
+ //#endregion
2567
+ //#region ../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-Q5ASJ5N7.js
2568
+ var init_chunk_Q5ASJ5N7 = __esm({ "../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-Q5ASJ5N7.js"() {
2569
+ init_chunk_WIMGWYZL();
2570
+ } });
2571
+
2572
+ //#endregion
2573
+ //#region ../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-WZOX4VKU.js
2574
+ var init_chunk_WZOX4VKU = __esm({ "../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-WZOX4VKU.js"() {
2575
+ init_chunk_DEVKGLTN();
2576
+ init_chunk_WIMGWYZL();
2577
+ } });
2578
+
2579
+ //#endregion
2580
+ //#region ../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-Y3VKZ3P5.js
2581
+ var init_chunk_Y3VKZ3P5 = __esm({ "../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-Y3VKZ3P5.js"() {
2582
+ init_chunk_WIMGWYZL();
2583
+ } });
2584
+
2585
+ //#endregion
2586
+ //#region ../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-ZRKG4NSC.js
2587
+ var init_chunk_ZRKG4NSC = __esm({ "../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-ZRKG4NSC.js"() {
2588
+ init_chunk_WIMGWYZL();
2589
+ } });
2590
+
2591
+ //#endregion
2592
+ //#region ../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-QJLMYOTX.js
2593
+ var init_chunk_QJLMYOTX = __esm({ "../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-QJLMYOTX.js"() {
2594
+ init_chunk_LFJW7BOT();
2595
+ init_chunk_ANXBDSUI();
2596
+ } });
2597
+
2598
+ //#endregion
2599
+ //#region ../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-DM52TTEP.js
2600
+ var init_chunk_DM52TTEP = __esm({ "../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-DM52TTEP.js"() {
2601
+ init_chunk_WIMGWYZL();
2602
+ } });
2603
+
2604
+ //#endregion
2605
+ //#region ../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-2P44HXVH.js
2606
+ var init_chunk_2P44HXVH = __esm({ "../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-2P44HXVH.js"() {
2607
+ init_chunk_WIMGWYZL();
2608
+ } });
2609
+
2610
+ //#endregion
2611
+ //#region ../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-ZJS5DNQW.js
2612
+ var init_chunk_ZJS5DNQW = __esm({ "../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-ZJS5DNQW.js"() {
2613
+ init_chunk_ANXBDSUI();
2614
+ init_chunk_WIMGWYZL();
2615
+ } });
2616
+
2617
+ //#endregion
2618
+ //#region ../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-DH3BPT6T.js
2619
+ var init_chunk_DH3BPT6T = __esm({ "../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-DH3BPT6T.js"() {} });
2620
+
2621
+ //#endregion
2622
+ //#region ../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-OAMXQXGR.js
2623
+ var init_chunk_OAMXQXGR = __esm({ "../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-OAMXQXGR.js"() {
2624
+ init_chunk_WIMGWYZL();
2625
+ } });
2626
+
2627
+ //#endregion
2628
+ //#region ../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-P5WDBFN2.js
2629
+ var init_chunk_P5WDBFN2 = __esm({ "../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-P5WDBFN2.js"() {
2630
+ init_chunk_DH3BPT6T();
2631
+ init_chunk_OAMXQXGR();
2632
+ } });
2633
+
2634
+ //#endregion
2635
+ //#region ../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-EMIEIAAH.js
2636
+ var init_chunk_EMIEIAAH = __esm({ "../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-EMIEIAAH.js"() {} });
2637
+
2638
+ //#endregion
2639
+ //#region ../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-AHDTEY6L.js
2640
+ var init_chunk_AHDTEY6L = __esm({ "../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-AHDTEY6L.js"() {
2641
+ init_chunk_P5WDBFN2();
2642
+ init_chunk_EMIEIAAH();
2643
+ } });
2644
+
2645
+ //#endregion
2646
+ //#region ../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-4UEQNEAO.js
2647
+ var init_chunk_4UEQNEAO = __esm({ "../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-4UEQNEAO.js"() {
2648
+ init_chunk_WIMGWYZL();
2649
+ } });
2650
+
2651
+ //#endregion
2652
+ //#region ../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-T4PLMLCP.js
2653
+ var init_chunk_T4PLMLCP = __esm({ "../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-T4PLMLCP.js"() {
2654
+ init_chunk_WIMGWYZL();
2655
+ } });
2656
+
2657
+ //#endregion
2658
+ //#region ../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-SSDL7ATG.js
2659
+ var init_chunk_SSDL7ATG = __esm({ "../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-SSDL7ATG.js"() {
2660
+ init_chunk_WIMGWYZL();
2661
+ } });
2662
+
2663
+ //#endregion
2664
+ //#region ../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-EVIH3PFY.js
2665
+ var init_chunk_EVIH3PFY = __esm({ "../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-EVIH3PFY.js"() {
2666
+ init_chunk_WIMGWYZL();
2667
+ } });
2668
+
2669
+ //#endregion
2670
+ //#region ../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-RBODUO3Q.js
2671
+ var init_chunk_RBODUO3Q = __esm({ "../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-RBODUO3Q.js"() {} });
2672
+
2673
+ //#endregion
2674
+ //#region ../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-S52RID4A.js
2675
+ var init_chunk_S52RID4A = __esm({ "../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-S52RID4A.js"() {
2676
+ init_chunk_WIMGWYZL();
2677
+ } });
2678
+
2679
+ //#endregion
2680
+ //#region ../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-WWPMIW33.js
2681
+ var init_chunk_WWPMIW33 = __esm({ "../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-WWPMIW33.js"() {
2682
+ init_chunk_WIMGWYZL();
2683
+ } });
2684
+
2685
+ //#endregion
2686
+ //#region ../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-57KROWWS.js
2687
+ var init_chunk_57KROWWS = __esm({ "../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-57KROWWS.js"() {
2688
+ init_chunk_WIMGWYZL();
2689
+ } });
2690
+
2691
+ //#endregion
2692
+ //#region ../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-V6HCOU6T.js
2693
+ var init_chunk_V6HCOU6T = __esm({ "../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-V6HCOU6T.js"() {} });
2694
+
2695
+ //#endregion
2696
+ //#region ../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-ALS6JP7S.js
2697
+ var init_chunk_ALS6JP7S = __esm({ "../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-ALS6JP7S.js"() {
2698
+ init_chunk_WIMGWYZL();
2699
+ } });
2700
+
2701
+ //#endregion
2702
+ //#region ../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-QTQTP2VB.js
2703
+ var init_chunk_QTQTP2VB = __esm({ "../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-QTQTP2VB.js"() {
2704
+ init_chunk_WIMGWYZL();
2705
+ } });
2706
+
2707
+ //#endregion
2708
+ //#region ../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-NFFV4IQT.js
2709
+ var init_chunk_NFFV4IQT = __esm({ "../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-NFFV4IQT.js"() {
2710
+ init_chunk_WIMGWYZL();
2711
+ } });
2712
+
2713
+ //#endregion
2714
+ //#region ../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-FDH4IRIM.js
2715
+ var init_chunk_FDH4IRIM = __esm({ "../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-FDH4IRIM.js"() {
2716
+ init_chunk_EMIEIAAH();
2717
+ } });
2718
+
2719
+ //#endregion
2720
+ //#region ../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-QEKOZYJ5.js
2721
+ var init_chunk_QEKOZYJ5 = __esm({ "../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-QEKOZYJ5.js"() {} });
2722
+
2723
+ //#endregion
2724
+ //#region ../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-YDIA5YQI.js
2725
+ var init_chunk_YDIA5YQI = __esm({ "../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-YDIA5YQI.js"() {
2726
+ init_chunk_QEKOZYJ5();
2727
+ init_chunk_WIMGWYZL();
2728
+ } });
2729
+
2730
+ //#endregion
2731
+ //#region ../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-6OEKBHIX.js
2732
+ var init_chunk_6OEKBHIX = __esm({ "../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-6OEKBHIX.js"() {
2733
+ init_chunk_QEKOZYJ5();
2734
+ init_chunk_WIMGWYZL();
2735
+ } });
2736
+
2737
+ //#endregion
2738
+ //#region ../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-GDGEDZJG.js
2739
+ var init_chunk_GDGEDZJG = __esm({ "../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-GDGEDZJG.js"() {
2740
+ init_chunk_QEKOZYJ5();
2741
+ init_chunk_WIMGWYZL();
2742
+ } });
2743
+
2744
+ //#endregion
2745
+ //#region ../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-XE3XIKTJ.js
2746
+ var init_chunk_XE3XIKTJ = __esm({ "../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-XE3XIKTJ.js"() {
2747
+ init_chunk_QEKOZYJ5();
2748
+ init_chunk_WIMGWYZL();
2749
+ } });
2750
+
2751
+ //#endregion
2752
+ //#region ../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-HVJXDSOP.js
2753
+ var init_chunk_HVJXDSOP = __esm({ "../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-HVJXDSOP.js"() {
2754
+ init_chunk_QEKOZYJ5();
2755
+ init_chunk_WIMGWYZL();
2756
+ } });
2757
+
2758
+ //#endregion
2759
+ //#region ../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-MSOX5OUI.js
2760
+ var init_chunk_MSOX5OUI = __esm({ "../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-MSOX5OUI.js"() {
2761
+ init_chunk_WIMGWYZL();
2762
+ } });
2763
+
2764
+ //#endregion
2765
+ //#region ../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-C4OZY4Z2.js
2766
+ var init_chunk_C4OZY4Z2 = __esm({ "../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-C4OZY4Z2.js"() {
2767
+ init_chunk_WIMGWYZL();
2768
+ } });
2769
+
2770
+ //#endregion
2771
+ //#region ../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-P2PQB7KO.js
2772
+ var init_chunk_P2PQB7KO = __esm({ "../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-P2PQB7KO.js"() {
2773
+ init_chunk_WIMGWYZL();
2774
+ } });
2775
+
2776
+ //#endregion
2777
+ //#region ../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-FZHIMCK6.js
2778
+ var init_chunk_FZHIMCK6 = __esm({ "../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-FZHIMCK6.js"() {} });
2779
+
2780
+ //#endregion
2781
+ //#region ../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-UHZ33J57.js
2782
+ var init_chunk_UHZ33J57 = __esm({ "../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-UHZ33J57.js"() {
2783
+ init_chunk_FZHIMCK6();
2784
+ init_chunk_WIMGWYZL();
2785
+ } });
2786
+
2787
+ //#endregion
2788
+ //#region ../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-6RL33UFT.js
2789
+ var init_chunk_6RL33UFT = __esm({ "../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-6RL33UFT.js"() {
2790
+ init_chunk_WIMGWYZL();
2791
+ } });
2792
+
2793
+ //#endregion
2794
+ //#region ../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-YNNF733L.js
2795
+ var init_chunk_YNNF733L = __esm({ "../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-YNNF733L.js"() {
2796
+ init_chunk_WIMGWYZL();
2797
+ } });
2798
+
2799
+ //#endregion
2800
+ //#region ../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-4YLWJIJ6.js
2801
+ var init_chunk_4YLWJIJ6 = __esm({ "../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-4YLWJIJ6.js"() {
2802
+ init_chunk_WIMGWYZL();
2803
+ } });
2804
+
2805
+ //#endregion
2806
+ //#region ../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-KVHF7QRD.js
2807
+ var init_chunk_KVHF7QRD = __esm({ "../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-KVHF7QRD.js"() {
2808
+ init_chunk_WIMGWYZL();
2809
+ } });
2810
+
2811
+ //#endregion
2812
+ //#region ../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-UA6DVSZ3.js
2813
+ var init_chunk_UA6DVSZ3 = __esm({ "../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-UA6DVSZ3.js"() {} });
2814
+
2815
+ //#endregion
2816
+ //#region ../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-G5B2IDWB.js
2817
+ var init_chunk_G5B2IDWB = __esm({ "../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-G5B2IDWB.js"() {
2818
+ init_chunk_WIMGWYZL();
2819
+ } });
2820
+
2821
+ //#endregion
2822
+ //#region ../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-3FKP6OOU.js
2823
+ var init_chunk_3FKP6OOU = __esm({ "../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-3FKP6OOU.js"() {
2824
+ init_chunk_WIMGWYZL();
2825
+ } });
2826
+
2827
+ //#endregion
2828
+ //#region ../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-VFSOOVKJ.js
2829
+ var init_chunk_VFSOOVKJ = __esm({ "../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-VFSOOVKJ.js"() {} });
2830
+
2831
+ //#endregion
2832
+ //#region ../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-K3UJMX27.js
2833
+ var init_chunk_K3UJMX27 = __esm({ "../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-K3UJMX27.js"() {} });
2834
+
2835
+ //#endregion
2836
+ //#region ../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-LE6I3KC6.js
2837
+ var init_chunk_LE6I3KC6 = __esm({ "../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-LE6I3KC6.js"() {
2838
+ init_chunk_WIMGWYZL();
2839
+ } });
2840
+
2841
+ //#endregion
2842
+ //#region ../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-ENS7GPLZ.js
2843
+ var init_chunk_ENS7GPLZ = __esm({ "../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-ENS7GPLZ.js"() {
2844
+ init_chunk_WIMGWYZL();
2845
+ } });
2846
+
2847
+ //#endregion
2848
+ //#region ../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-DSLWSGID.js
2849
+ var init_chunk_DSLWSGID = __esm({ "../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-DSLWSGID.js"() {
2850
+ init_chunk_EMIEIAAH();
2851
+ } });
2852
+
2853
+ //#endregion
2854
+ //#region ../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-R72GEKLP.js
2855
+ var init_chunk_R72GEKLP = __esm({ "../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-R72GEKLP.js"() {} });
2856
+
2857
+ //#endregion
2858
+ //#region ../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-3IFJP4R5.js
2859
+ var init_chunk_3IFJP4R5 = __esm({ "../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-3IFJP4R5.js"() {
2860
+ init_chunk_WIMGWYZL();
2861
+ } });
2862
+
2863
+ //#endregion
2864
+ //#region ../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-J4EKWFDW.js
2865
+ var init_chunk_J4EKWFDW = __esm({ "../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-J4EKWFDW.js"() {
2866
+ init_chunk_WIMGWYZL();
2867
+ } });
2868
+
2869
+ //#endregion
2870
+ //#region ../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-PGMPBC5Q.js
2871
+ var init_chunk_PGMPBC5Q = __esm({ "../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-PGMPBC5Q.js"() {
2872
+ init_chunk_WIMGWYZL();
2873
+ } });
2874
+
2875
+ //#endregion
2876
+ //#region ../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-GGYFZTDW.js
2877
+ var init_chunk_GGYFZTDW = __esm({ "../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-GGYFZTDW.js"() {
2878
+ init_chunk_WIMGWYZL();
2879
+ } });
2880
+
2881
+ //#endregion
2882
+ //#region ../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-EDOGCRPU.js
2883
+ var init_chunk_EDOGCRPU = __esm({ "../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-EDOGCRPU.js"() {
2884
+ init_chunk_3GOCSNFN();
2885
+ } });
2886
+
2887
+ //#endregion
2888
+ //#region ../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-4NRWDO7P.js
2889
+ var init_chunk_4NRWDO7P = __esm({ "../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-4NRWDO7P.js"() {
2890
+ init_chunk_WIMGWYZL();
2891
+ } });
2892
+
2893
+ //#endregion
2894
+ //#region ../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-W6ZHPGFP.js
2895
+ var init_chunk_W6ZHPGFP = __esm({ "../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-W6ZHPGFP.js"() {
2896
+ init_chunk_WIMGWYZL();
2897
+ } });
2898
+
2899
+ //#endregion
2900
+ //#region ../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-J3IRE4DI.js
2901
+ var init_chunk_J3IRE4DI = __esm({ "../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-J3IRE4DI.js"() {
2902
+ init_chunk_DH3BPT6T();
2903
+ init_chunk_EMIEIAAH();
2904
+ } });
2905
+
2906
+ //#endregion
2907
+ //#region ../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-RZUYD7QY.js
2908
+ var init_chunk_RZUYD7QY = __esm({ "../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-RZUYD7QY.js"() {
2909
+ init_chunk_WIMGWYZL();
2910
+ } });
2911
+
2912
+ //#endregion
2913
+ //#region ../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-A3PVMI4K.js
2914
+ var init_chunk_A3PVMI4K = __esm({ "../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-A3PVMI4K.js"() {
2915
+ init_chunk_OAMXQXGR();
2916
+ init_chunk_WIMGWYZL();
2917
+ } });
2918
+
2919
+ //#endregion
2920
+ //#region ../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-4ZFFLFWV.js
2921
+ var init_chunk_4ZFFLFWV = __esm({ "../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-4ZFFLFWV.js"() {
2922
+ init_chunk_WIMGWYZL();
2923
+ } });
2924
+
2925
+ //#endregion
2926
+ //#region ../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-C6IMN7SF.js
2927
+ var init_chunk_C6IMN7SF = __esm({ "../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-C6IMN7SF.js"() {} });
2928
+
2929
+ //#endregion
2930
+ //#region ../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-NS6ZBRLP.js
2931
+ var init_chunk_NS6ZBRLP = __esm({ "../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-NS6ZBRLP.js"() {
2932
+ init_chunk_WIMGWYZL();
2933
+ } });
2934
+
2935
+ //#endregion
2936
+ //#region ../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-FMPZ2CLX.js
2937
+ var init_chunk_FMPZ2CLX = __esm({ "../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-FMPZ2CLX.js"() {} });
2938
+
2939
+ //#endregion
2940
+ //#region ../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-3ZJAREUD.js
2941
+ var init_chunk_3ZJAREUD = __esm({ "../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-3ZJAREUD.js"() {
2942
+ init_chunk_WIMGWYZL();
2943
+ } });
2944
+
2945
+ //#endregion
2946
+ //#region ../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-ZXVA7VDE.js
2947
+ var init_chunk_ZXVA7VDE = __esm({ "../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-ZXVA7VDE.js"() {
2948
+ init_chunk_LFJW7BOT();
2949
+ } });
2950
+
2951
+ //#endregion
2952
+ //#region ../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-567G5ZXL.js
2953
+ var init_chunk_567G5ZXL = __esm({ "../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-567G5ZXL.js"() {
2954
+ init_chunk_WIMGWYZL();
2955
+ } });
2956
+
2957
+ //#endregion
2958
+ //#region ../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-KQRZQWDE.js
2959
+ var init_chunk_KQRZQWDE = __esm({ "../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-KQRZQWDE.js"() {
2960
+ init_chunk_567G5ZXL();
2961
+ init_chunk_WIMGWYZL();
2962
+ } });
2963
+
2964
+ //#endregion
2965
+ //#region ../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-3D3RWAVJ.js
2966
+ var init_chunk_3D3RWAVJ = __esm({ "../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-3D3RWAVJ.js"() {
2967
+ init_chunk_WIMGWYZL();
2968
+ } });
2969
+
2970
+ //#endregion
2971
+ //#region ../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-K2FFNW24.js
2972
+ var init_chunk_K2FFNW24 = __esm({ "../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-K2FFNW24.js"() {
2973
+ init_chunk_WIMGWYZL();
2974
+ } });
2975
+
2976
+ //#endregion
2977
+ //#region ../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-5S4PYKVY.js
2978
+ var init_chunk_5S4PYKVY = __esm({ "../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-5S4PYKVY.js"() {
2979
+ init_chunk_WIMGWYZL();
2980
+ } });
2981
+
2982
+ //#endregion
2983
+ //#region ../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-5WKPQX7L.js
2984
+ var init_chunk_5WKPQX7L = __esm({ "../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-5WKPQX7L.js"() {} });
2985
+
2986
+ //#endregion
2987
+ //#region ../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-BZNENX2T.js
2988
+ var init_chunk_BZNENX2T = __esm({ "../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-BZNENX2T.js"() {} });
2989
+
2990
+ //#endregion
2991
+ //#region ../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-PDQFB3TV.js
2992
+ var init_chunk_PDQFB3TV = __esm({ "../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-PDQFB3TV.js"() {
2993
+ init_chunk_BZNENX2T();
2994
+ init_chunk_WIMGWYZL();
2995
+ } });
2996
+
2997
+ //#endregion
2998
+ //#region ../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-XMLUDZIW.js
2999
+ var init_chunk_XMLUDZIW = __esm({ "../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-XMLUDZIW.js"() {} });
3000
+
3001
+ //#endregion
3002
+ //#region ../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-GMMLSO2N.js
3003
+ var init_chunk_GMMLSO2N = __esm({ "../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-GMMLSO2N.js"() {
3004
+ init_chunk_WIMGWYZL();
3005
+ } });
3006
+
3007
+ //#endregion
3008
+ //#region ../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-5NQBDF4H.js
3009
+ function t$5(...n$7) {
3010
+ return u$11(Object.keys, n$7);
3011
+ }
3012
+ var init_chunk_5NQBDF4H = __esm({ "../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-5NQBDF4H.js"() {
3013
+ init_chunk_WIMGWYZL();
3014
+ } });
3015
+
3016
+ //#endregion
3017
+ //#region ../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-PFSVCZNE.js
3018
+ var init_chunk_PFSVCZNE = __esm({ "../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-PFSVCZNE.js"() {
3019
+ init_chunk_WIMGWYZL();
3020
+ } });
3021
+
3022
+ //#endregion
3023
+ //#region ../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-VO5MRBXA.js
3024
+ var init_chunk_VO5MRBXA = __esm({ "../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-VO5MRBXA.js"() {
3025
+ init_chunk_WIMGWYZL();
3026
+ } });
3027
+
3028
+ //#endregion
3029
+ //#region ../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-XUX3ZEXI.js
3030
+ var init_chunk_XUX3ZEXI = __esm({ "../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-XUX3ZEXI.js"() {
3031
+ init_chunk_WIMGWYZL();
3032
+ } });
3033
+
3034
+ //#endregion
3035
+ //#region ../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-KZIKCQ56.js
3036
+ var init_chunk_KZIKCQ56 = __esm({ "../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-KZIKCQ56.js"() {
3037
+ init_chunk_WIMGWYZL();
3038
+ } });
3039
+
3040
+ //#endregion
3041
+ //#region ../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-P3DXEVTH.js
3042
+ var init_chunk_P3DXEVTH = __esm({ "../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-P3DXEVTH.js"() {
3043
+ init_chunk_WIMGWYZL();
3044
+ } });
3045
+
3046
+ //#endregion
3047
+ //#region ../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-6GTAPB47.js
3048
+ var init_chunk_6GTAPB47 = __esm({ "../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-6GTAPB47.js"() {} });
3049
+
3050
+ //#endregion
3051
+ //#region ../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-NMC53JVB.js
3052
+ var init_chunk_NMC53JVB = __esm({ "../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-NMC53JVB.js"() {} });
3053
+
3054
+ //#endregion
3055
+ //#region ../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-PULGOXDA.js
3056
+ var init_chunk_PULGOXDA = __esm({ "../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-PULGOXDA.js"() {} });
3057
+
3058
+ //#endregion
3059
+ //#region ../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-OLNQBNAJ.js
3060
+ var init_chunk_OLNQBNAJ = __esm({ "../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-OLNQBNAJ.js"() {
3061
+ init_chunk_WIMGWYZL();
3062
+ } });
3063
+
3064
+ //#endregion
3065
+ //#region ../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-QOEIYQAG.js
3066
+ var init_chunk_QOEIYQAG = __esm({ "../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-QOEIYQAG.js"() {
3067
+ init_chunk_WIMGWYZL();
3068
+ } });
3069
+
3070
+ //#endregion
3071
+ //#region ../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-SFZGYJFI.js
3072
+ var init_chunk_SFZGYJFI = __esm({ "../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-SFZGYJFI.js"() {} });
3073
+
3074
+ //#endregion
3075
+ //#region ../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-JJZ7E4YG.js
3076
+ var init_chunk_JJZ7E4YG = __esm({ "../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-JJZ7E4YG.js"() {} });
3077
+
3078
+ //#endregion
3079
+ //#region ../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-VCYTMP4D.js
3080
+ var init_chunk_VCYTMP4D = __esm({ "../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-VCYTMP4D.js"() {} });
3081
+
3082
+ //#endregion
3083
+ //#region ../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-CAZXBO45.js
3084
+ var init_chunk_CAZXBO45 = __esm({ "../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-CAZXBO45.js"() {} });
3085
+
3086
+ //#endregion
3087
+ //#region ../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-ENOHV5LT.js
3088
+ var init_chunk_ENOHV5LT = __esm({ "../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-ENOHV5LT.js"() {} });
3089
+
3090
+ //#endregion
3091
+ //#region ../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-U753ZCO5.js
3092
+ var init_chunk_U753ZCO5 = __esm({ "../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-U753ZCO5.js"() {} });
3093
+
3094
+ //#endregion
3095
+ //#region ../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-5DU4ITSF.js
3096
+ var init_chunk_5DU4ITSF = __esm({ "../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-5DU4ITSF.js"() {} });
3097
+
3098
+ //#endregion
3099
+ //#region ../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-GK5I7C4J.js
3100
+ var init_chunk_GK5I7C4J = __esm({ "../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-GK5I7C4J.js"() {} });
3101
+
3102
+ //#endregion
3103
+ //#region ../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-HV3WACXG.js
3104
+ var init_chunk_HV3WACXG = __esm({ "../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-HV3WACXG.js"() {} });
3105
+
3106
+ //#endregion
3107
+ //#region ../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-JK3VNB42.js
3108
+ var init_chunk_JK3VNB42 = __esm({ "../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-JK3VNB42.js"() {} });
3109
+
3110
+ //#endregion
3111
+ //#region ../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-T45O7BFY.js
3112
+ var init_chunk_T45O7BFY = __esm({ "../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-T45O7BFY.js"() {
3113
+ init_chunk_LFJW7BOT();
3114
+ init_chunk_ANXBDSUI();
3115
+ } });
3116
+
3117
+ //#endregion
3118
+ //#region ../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-OP5ZF26D.js
3119
+ var init_chunk_OP5ZF26D = __esm({ "../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-OP5ZF26D.js"() {
3120
+ init_chunk_WIMGWYZL();
3121
+ } });
3122
+
3123
+ //#endregion
3124
+ //#region ../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-BO3LQZNF.js
3125
+ var init_chunk_BO3LQZNF = __esm({ "../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-BO3LQZNF.js"() {} });
3126
+
3127
+ //#endregion
3128
+ //#region ../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-I3D2BSWJ.js
3129
+ var init_chunk_I3D2BSWJ = __esm({ "../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-I3D2BSWJ.js"() {} });
3130
+
3131
+ //#endregion
3132
+ //#region ../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-7QX4DO53.js
3133
+ var init_chunk_7QX4DO53 = __esm({ "../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-7QX4DO53.js"() {} });
3134
+
3135
+ //#endregion
3136
+ //#region ../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-VMV5GVZ5.js
3137
+ var init_chunk_VMV5GVZ5 = __esm({ "../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-VMV5GVZ5.js"() {} });
3138
+
3139
+ //#endregion
3140
+ //#region ../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-OWH4IQQW.js
3141
+ var init_chunk_OWH4IQQW = __esm({ "../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-OWH4IQQW.js"() {} });
3142
+
3143
+ //#endregion
3144
+ //#region ../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-ETADWPSK.js
3145
+ var init_chunk_ETADWPSK = __esm({ "../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-ETADWPSK.js"() {} });
3146
+
3147
+ //#endregion
3148
+ //#region ../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-OFZGPGDZ.js
3149
+ var init_chunk_OFZGPGDZ = __esm({ "../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-OFZGPGDZ.js"() {
3150
+ init_chunk_WIMGWYZL();
3151
+ } });
3152
+
3153
+ //#endregion
3154
+ //#region ../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-HGKLN5KY.js
3155
+ var init_chunk_HGKLN5KY = __esm({ "../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-HGKLN5KY.js"() {
3156
+ init_chunk_WIMGWYZL();
3157
+ } });
3158
+
3159
+ //#endregion
3160
+ //#region ../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-R7PILVSQ.js
3161
+ var init_chunk_R7PILVSQ = __esm({ "../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-R7PILVSQ.js"() {
3162
+ init_chunk_HGKLN5KY();
3163
+ init_chunk_WIMGWYZL();
3164
+ } });
3165
+
3166
+ //#endregion
3167
+ //#region ../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-HJSE3ESO.js
3168
+ var init_chunk_HJSE3ESO = __esm({ "../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-HJSE3ESO.js"() {} });
3169
+
3170
+ //#endregion
3171
+ //#region ../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-B6PG574O.js
3172
+ var init_chunk_B6PG574O = __esm({ "../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-B6PG574O.js"() {
3173
+ init_chunk_WIMGWYZL();
3174
+ } });
3175
+
3176
+ //#endregion
3177
+ //#region ../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-ICBBHOCR.js
3178
+ var init_chunk_ICBBHOCR = __esm({ "../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-ICBBHOCR.js"() {
3179
+ init_chunk_LFJW7BOT();
3180
+ init_chunk_ANXBDSUI();
3181
+ } });
3182
+
3183
+ //#endregion
3184
+ //#region ../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-DAE7EJQ2.js
3185
+ var init_chunk_DAE7EJQ2 = __esm({ "../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-DAE7EJQ2.js"() {
3186
+ init_chunk_EMIEIAAH();
3187
+ init_chunk_OAMXQXGR();
3188
+ } });
3189
+
3190
+ //#endregion
3191
+ //#region ../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-XPCYQPKH.js
3192
+ var init_chunk_XPCYQPKH = __esm({ "../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-XPCYQPKH.js"() {
3193
+ init_chunk_ANXBDSUI();
3194
+ init_chunk_D6FCK2GA();
3195
+ } });
3196
+
3197
+ //#endregion
3198
+ //#region ../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-FRNNS7AX.js
3199
+ var init_chunk_FRNNS7AX = __esm({ "../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-FRNNS7AX.js"() {
3200
+ init_chunk_WIMGWYZL();
3201
+ } });
3202
+
3203
+ //#endregion
3204
+ //#region ../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-QJOWZFYO.js
3205
+ var init_chunk_QJOWZFYO = __esm({ "../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-QJOWZFYO.js"() {
3206
+ init_chunk_FZHIMCK6();
3207
+ init_chunk_WIMGWYZL();
3208
+ } });
3209
+
3210
+ //#endregion
3211
+ //#region ../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-VIBSXWWU.js
3212
+ var init_chunk_VIBSXWWU = __esm({ "../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-VIBSXWWU.js"() {
3213
+ init_chunk_WIMGWYZL();
3214
+ } });
3215
+
3216
+ //#endregion
3217
+ //#region ../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-T4H4IOYC.js
3218
+ var init_chunk_T4H4IOYC = __esm({ "../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-T4H4IOYC.js"() {
3219
+ init_chunk_WIMGWYZL();
3220
+ } });
3221
+
3222
+ //#endregion
3223
+ //#region ../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-GPLTWAVR.js
3224
+ var init_chunk_GPLTWAVR = __esm({ "../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-GPLTWAVR.js"() {
3225
+ init_chunk_WIMGWYZL();
3226
+ } });
3227
+
3228
+ //#endregion
3229
+ //#region ../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-PIX5OHMW.js
3230
+ var init_chunk_PIX5OHMW = __esm({ "../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-PIX5OHMW.js"() {
3231
+ init_chunk_WIMGWYZL();
3232
+ } });
3233
+
3234
+ //#endregion
3235
+ //#region ../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-VVM5DH6Z.js
3236
+ var init_chunk_VVM5DH6Z = __esm({ "../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-VVM5DH6Z.js"() {
3237
+ init_chunk_WIMGWYZL();
3238
+ } });
3239
+
3240
+ //#endregion
3241
+ //#region ../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-PVYOMZ3I.js
3242
+ var init_chunk_PVYOMZ3I = __esm({ "../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-PVYOMZ3I.js"() {
3243
+ init_chunk_WIMGWYZL();
3244
+ } });
3245
+
3246
+ //#endregion
3247
+ //#region ../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-P6LAFGAN.js
3248
+ var init_chunk_P6LAFGAN = __esm({ "../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-P6LAFGAN.js"() {
3249
+ init_chunk_ANXBDSUI();
3250
+ init_chunk_WIMGWYZL();
3251
+ } });
3252
+
3253
+ //#endregion
3254
+ //#region ../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-SGAFZVQH.js
3255
+ var init_chunk_SGAFZVQH = __esm({ "../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-SGAFZVQH.js"() {} });
3256
+
3257
+ //#endregion
3258
+ //#region ../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-MQDP6CFS.js
3259
+ var init_chunk_MQDP6CFS = __esm({ "../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-MQDP6CFS.js"() {
3260
+ init_chunk_SGAFZVQH();
3261
+ init_chunk_ANXBDSUI();
3262
+ init_chunk_WIMGWYZL();
3263
+ } });
3264
+
3265
+ //#endregion
3266
+ //#region ../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-UZ6BOIAH.js
3267
+ var init_chunk_UZ6BOIAH = __esm({ "../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-UZ6BOIAH.js"() {
3268
+ init_chunk_WIMGWYZL();
3269
+ } });
3270
+
3271
+ //#endregion
3272
+ //#region ../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-KI5UAETW.js
3273
+ var init_chunk_KI5UAETW = __esm({ "../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-KI5UAETW.js"() {
3274
+ init_chunk_WIMGWYZL();
3275
+ } });
3276
+
3277
+ //#endregion
3278
+ //#region ../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-GYH2VCL4.js
3279
+ var init_chunk_GYH2VCL4 = __esm({ "../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-GYH2VCL4.js"() {
3280
+ init_chunk_WIMGWYZL();
3281
+ } });
3282
+
3283
+ //#endregion
3284
+ //#region ../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-26ILFTOP.js
3285
+ var init_chunk_26ILFTOP = __esm({ "../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-26ILFTOP.js"() {
3286
+ init_chunk_SGAFZVQH();
3287
+ init_chunk_WIMGWYZL();
3288
+ } });
3289
+
3290
+ //#endregion
3291
+ //#region ../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-2KIKGHAO.js
3292
+ var init_chunk_2KIKGHAO = __esm({ "../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-2KIKGHAO.js"() {
3293
+ init_chunk_WIMGWYZL();
3294
+ } });
3295
+
3296
+ //#endregion
3297
+ //#region ../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-YVMG2XEU.js
3298
+ var init_chunk_YVMG2XEU = __esm({ "../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-YVMG2XEU.js"() {} });
3299
+
3300
+ //#endregion
3301
+ //#region ../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-ZP6YI2JT.js
3302
+ var init_chunk_ZP6YI2JT = __esm({ "../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-ZP6YI2JT.js"() {
3303
+ init_chunk_ANXBDSUI();
3304
+ init_chunk_WIMGWYZL();
3305
+ } });
3306
+
3307
+ //#endregion
3308
+ //#region ../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-OCJMJQKO.js
3309
+ var init_chunk_OCJMJQKO = __esm({ "../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-OCJMJQKO.js"() {
3310
+ init_chunk_P5WDBFN2();
3311
+ init_chunk_EMIEIAAH();
3312
+ } });
3313
+
3314
+ //#endregion
3315
+ //#region ../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-J7R2OSHS.js
3316
+ var init_chunk_J7R2OSHS = __esm({ "../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-J7R2OSHS.js"() {
3317
+ init_chunk_WIMGWYZL();
3318
+ } });
3319
+
3320
+ //#endregion
3321
+ //#region ../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-GIKF2ZNG.js
3322
+ var init_chunk_GIKF2ZNG = __esm({ "../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-GIKF2ZNG.js"() {
3323
+ init_chunk_WIMGWYZL();
3324
+ } });
3325
+
3326
+ //#endregion
3327
+ //#region ../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-XWBKJZIP.js
3328
+ var init_chunk_XWBKJZIP = __esm({ "../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-XWBKJZIP.js"() {
3329
+ init_chunk_WIMGWYZL();
3330
+ } });
3331
+
3332
+ //#endregion
3333
+ //#region ../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-XHPQVWZM.js
3334
+ var init_chunk_XHPQVWZM = __esm({ "../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-XHPQVWZM.js"() {
3335
+ init_chunk_WIMGWYZL();
3336
+ } });
3337
+
3338
+ //#endregion
3339
+ //#region ../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-2OQBQB3V.js
3340
+ var init_chunk_2OQBQB3V = __esm({ "../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-2OQBQB3V.js"() {
3341
+ init_chunk_WIMGWYZL();
3342
+ } });
3343
+
3344
+ //#endregion
3345
+ //#region ../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-H4OTHZJB.js
3346
+ var init_chunk_H4OTHZJB = __esm({ "../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-H4OTHZJB.js"() {
3347
+ init_chunk_WIMGWYZL();
3348
+ } });
3349
+
3350
+ //#endregion
3351
+ //#region ../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-XZ6COQKM.js
3352
+ function a$13(n$7, t$14, e$5) {
3353
+ return n$7(e$5[0]) ? (r$12) => t$14(r$12, ...e$5) : t$14(...e$5);
3354
+ }
3355
+ function u$12(...n$7) {
3356
+ return a$13(s$8, o$9, n$7);
3357
+ }
3358
+ function o$9(n$7, ...t$14) {
3359
+ for (let [e$5, r$12] of t$14) if (e$5(n$7)) return r$12(n$7);
3360
+ throw new Error("conditional: data failed for all cases");
3361
+ }
3362
+ function s$8(n$7) {
3363
+ if (!Array.isArray(n$7)) return !1;
3364
+ let [t$14, e$5, ...r$12] = n$7;
3365
+ return typeof t$14 == "function" && t$14.length <= 1 && typeof e$5 == "function" && e$5.length <= 1 && r$12.length === 0;
3366
+ }
3367
+ function R(n$7 = d$11) {
3368
+ return [T$7, n$7];
3369
+ }
3370
+ var x$2, T$7, d$11;
3371
+ var init_chunk_XZ6COQKM = __esm({ "../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-XZ6COQKM.js"() {
3372
+ x$2 = Object.assign(u$12, { defaultCase: R });
3373
+ T$7 = () => !0, d$11 = () => {};
3374
+ } });
3375
+
3376
+ //#endregion
3377
+ //#region ../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-T5XG33UI.js
3378
+ var init_chunk_T5XG33UI = __esm({ "../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-T5XG33UI.js"() {} });
3379
+
3380
+ //#endregion
3381
+ //#region ../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-ZTNFU7RH.js
3382
+ var init_chunk_ZTNFU7RH = __esm({ "../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-ZTNFU7RH.js"() {
3383
+ init_chunk_WIMGWYZL();
3384
+ } });
3385
+
3386
+ //#endregion
3387
+ //#region ../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-OIQJEOF7.js
3388
+ var init_chunk_OIQJEOF7 = __esm({ "../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-OIQJEOF7.js"() {} });
3389
+
3390
+ //#endregion
3391
+ //#region ../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-GKXRNLHM.js
3392
+ var init_chunk_GKXRNLHM = __esm({ "../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-GKXRNLHM.js"() {
3393
+ init_chunk_LFJW7BOT();
3394
+ init_chunk_ANXBDSUI();
3395
+ } });
3396
+
3397
+ //#endregion
3398
+ //#region ../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-NYIWN625.js
3399
+ var init_chunk_NYIWN625 = __esm({ "../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-NYIWN625.js"() {
3400
+ init_chunk_LFJW7BOT();
3401
+ init_chunk_ANXBDSUI();
3402
+ } });
3403
+
3404
+ //#endregion
3405
+ //#region ../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-WPTI67A4.js
3406
+ var init_chunk_WPTI67A4 = __esm({ "../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-WPTI67A4.js"() {
3407
+ init_chunk_WIMGWYZL();
3408
+ } });
3409
+
3410
+ //#endregion
3411
+ //#region ../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-W2ARC73P.js
3412
+ var init_chunk_W2ARC73P = __esm({ "../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-W2ARC73P.js"() {
3413
+ init_chunk_WIMGWYZL();
3414
+ } });
3415
+
3416
+ //#endregion
3417
+ //#region ../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-3UBK2BVM.js
3418
+ var init_chunk_3UBK2BVM = __esm({ "../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-3UBK2BVM.js"() {
3419
+ init_chunk_WIMGWYZL();
3420
+ } });
3421
+
3422
+ //#endregion
3423
+ //#region ../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-VFECZ57D.js
3424
+ var init_chunk_VFECZ57D = __esm({ "../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-VFECZ57D.js"() {
3425
+ init_chunk_WIMGWYZL();
3426
+ } });
3427
+
3428
+ //#endregion
3429
+ //#region ../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-VG2NVNXT.js
3430
+ var init_chunk_VG2NVNXT = __esm({ "../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-VG2NVNXT.js"() {
3431
+ init_chunk_WIMGWYZL();
3432
+ } });
3433
+
3434
+ //#endregion
3435
+ //#region ../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-HJSE36CH.js
3436
+ var init_chunk_HJSE36CH = __esm({ "../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-HJSE36CH.js"() {
3437
+ init_chunk_FZHIMCK6();
3438
+ init_chunk_WIMGWYZL();
3439
+ } });
3440
+
3441
+ //#endregion
3442
+ //#region ../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-WFMWIRTS.js
3443
+ var init_chunk_WFMWIRTS = __esm({ "../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-WFMWIRTS.js"() {
3444
+ init_chunk_WIMGWYZL();
3445
+ } });
3446
+
3447
+ //#endregion
3448
+ //#region ../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-UHDYHGOF.js
3449
+ var init_chunk_UHDYHGOF = __esm({ "../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-UHDYHGOF.js"() {
3450
+ init_chunk_WIMGWYZL();
3451
+ } });
3452
+
3453
+ //#endregion
3454
+ //#region ../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/index.js
3455
+ var init_dist = __esm({ "../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/index.js"() {
3456
+ init_chunk_7ZI6JRPB();
3457
+ init_chunk_OXJMERKM();
3458
+ init_chunk_BSLJB6JE();
3459
+ init_chunk_NJXNQM3G();
3460
+ init_chunk_6RKHJ2CP();
3461
+ init_chunk_QDGUNRDA();
3462
+ init_chunk_MYLLMFC7();
3463
+ init_chunk_N4JUOEMS();
3464
+ init_chunk_YRJ25UV2();
3465
+ init_chunk_Q5ASJ5N7();
3466
+ init_chunk_WZOX4VKU();
3467
+ init_chunk_Y3VKZ3P5();
3468
+ init_chunk_ZRKG4NSC();
3469
+ init_chunk_QJLMYOTX();
3470
+ init_chunk_DM52TTEP();
3471
+ init_chunk_2P44HXVH();
3472
+ init_chunk_ZJS5DNQW();
3473
+ init_chunk_AHDTEY6L();
3474
+ init_chunk_4UEQNEAO();
3475
+ init_chunk_T4PLMLCP();
3476
+ init_chunk_SSDL7ATG();
3477
+ init_chunk_EVIH3PFY();
3478
+ init_chunk_RBODUO3Q();
3479
+ init_chunk_S52RID4A();
3480
+ init_chunk_WWPMIW33();
3481
+ init_chunk_57KROWWS();
3482
+ init_chunk_V6HCOU6T();
3483
+ init_chunk_ALS6JP7S();
3484
+ init_chunk_QTQTP2VB();
3485
+ init_chunk_NFFV4IQT();
3486
+ init_chunk_FDH4IRIM();
3487
+ init_chunk_YDIA5YQI();
3488
+ init_chunk_6OEKBHIX();
3489
+ init_chunk_GDGEDZJG();
3490
+ init_chunk_XE3XIKTJ();
3491
+ init_chunk_HVJXDSOP();
3492
+ init_chunk_MSOX5OUI();
3493
+ init_chunk_C4OZY4Z2();
3494
+ init_chunk_P2PQB7KO();
3495
+ init_chunk_UHZ33J57();
3496
+ init_chunk_6RL33UFT();
3497
+ init_chunk_YNNF733L();
3498
+ init_chunk_4YLWJIJ6();
3499
+ init_chunk_KVHF7QRD();
3500
+ init_chunk_UA6DVSZ3();
3501
+ init_chunk_G5B2IDWB();
3502
+ init_chunk_3FKP6OOU();
3503
+ init_chunk_VFSOOVKJ();
3504
+ init_chunk_K3UJMX27();
3505
+ init_chunk_LE6I3KC6();
3506
+ init_chunk_ENS7GPLZ();
3507
+ init_chunk_DSLWSGID();
3508
+ init_chunk_R72GEKLP();
3509
+ init_chunk_3IFJP4R5();
3510
+ init_chunk_J4EKWFDW();
3511
+ init_chunk_PGMPBC5Q();
3512
+ init_chunk_GGYFZTDW();
3513
+ init_chunk_EDOGCRPU();
3514
+ init_chunk_4NRWDO7P();
3515
+ init_chunk_W6ZHPGFP();
3516
+ init_chunk_J3IRE4DI();
3517
+ init_chunk_RZUYD7QY();
3518
+ init_chunk_A3PVMI4K();
3519
+ init_chunk_4ZFFLFWV();
3520
+ init_chunk_C6IMN7SF();
3521
+ init_chunk_NS6ZBRLP();
3522
+ init_chunk_FMPZ2CLX();
3523
+ init_chunk_3ZJAREUD();
3524
+ init_chunk_ZXVA7VDE();
3525
+ init_chunk_KQRZQWDE();
3526
+ init_chunk_567G5ZXL();
3527
+ init_chunk_3D3RWAVJ();
3528
+ init_chunk_K2FFNW24();
3529
+ init_chunk_5S4PYKVY();
3530
+ init_chunk_5WKPQX7L();
3531
+ init_chunk_PDQFB3TV();
3532
+ init_chunk_XMLUDZIW();
3533
+ init_chunk_GMMLSO2N();
3534
+ init_chunk_5NQBDF4H();
3535
+ init_chunk_PFSVCZNE();
3536
+ init_chunk_VO5MRBXA();
3537
+ init_chunk_XUX3ZEXI();
3538
+ init_chunk_KZIKCQ56();
3539
+ init_chunk_P3DXEVTH();
3540
+ init_chunk_6GTAPB47();
3541
+ init_chunk_NMC53JVB();
3542
+ init_chunk_BZNENX2T();
3543
+ init_chunk_PULGOXDA();
3544
+ init_chunk_OLNQBNAJ();
3545
+ init_chunk_QOEIYQAG();
3546
+ init_chunk_SFZGYJFI();
3547
+ init_chunk_JJZ7E4YG();
3548
+ init_chunk_VCYTMP4D();
3549
+ init_chunk_CAZXBO45();
3550
+ init_chunk_ENOHV5LT();
3551
+ init_chunk_U753ZCO5();
3552
+ init_chunk_5DU4ITSF();
3553
+ init_chunk_GK5I7C4J();
3554
+ init_chunk_HV3WACXG();
3555
+ init_chunk_JK3VNB42();
3556
+ init_chunk_T45O7BFY();
3557
+ init_chunk_OP5ZF26D();
3558
+ init_chunk_BO3LQZNF();
3559
+ init_chunk_I3D2BSWJ();
3560
+ init_chunk_7QX4DO53();
3561
+ init_chunk_VMV5GVZ5();
3562
+ init_chunk_OWH4IQQW();
3563
+ init_chunk_ETADWPSK();
3564
+ init_chunk_OFZGPGDZ();
3565
+ init_chunk_R7PILVSQ();
3566
+ init_chunk_HGKLN5KY();
3567
+ init_chunk_HJSE3ESO();
3568
+ init_chunk_B6PG574O();
3569
+ init_chunk_ICBBHOCR();
3570
+ init_chunk_DAE7EJQ2();
3571
+ init_chunk_XPCYQPKH();
3572
+ init_chunk_FRNNS7AX();
3573
+ init_chunk_QJOWZFYO();
3574
+ init_chunk_VIBSXWWU();
3575
+ init_chunk_T4H4IOYC();
3576
+ init_chunk_GPLTWAVR();
3577
+ init_chunk_PIX5OHMW();
3578
+ init_chunk_VVM5DH6Z();
3579
+ init_chunk_PVYOMZ3I();
3580
+ init_chunk_P6LAFGAN();
3581
+ init_chunk_MQDP6CFS();
3582
+ init_chunk_UZ6BOIAH();
3583
+ init_chunk_KI5UAETW();
3584
+ init_chunk_GYH2VCL4();
3585
+ init_chunk_26ILFTOP();
3586
+ init_chunk_2KIKGHAO();
3587
+ init_chunk_YVMG2XEU();
3588
+ init_chunk_ZP6YI2JT();
3589
+ init_chunk_OCJMJQKO();
3590
+ init_chunk_P5WDBFN2();
3591
+ init_chunk_OAMXQXGR();
3592
+ init_chunk_J7R2OSHS();
3593
+ init_chunk_GIKF2ZNG();
3594
+ init_chunk_XWBKJZIP();
3595
+ init_chunk_XHPQVWZM();
3596
+ init_chunk_2OQBQB3V();
3597
+ init_chunk_H4OTHZJB();
3598
+ init_chunk_XZ6COQKM();
3599
+ init_chunk_T5XG33UI();
3600
+ init_chunk_ZTNFU7RH();
3601
+ init_chunk_OIQJEOF7();
3602
+ init_chunk_GKXRNLHM();
3603
+ init_chunk_NYIWN625();
3604
+ init_chunk_LFJW7BOT();
3605
+ init_chunk_3GOCSNFN();
3606
+ init_chunk_WPTI67A4();
3607
+ init_chunk_W2ARC73P();
3608
+ init_chunk_3UBK2BVM();
3609
+ init_chunk_VFECZ57D();
3610
+ init_chunk_VG2NVNXT();
3611
+ init_chunk_HJSE36CH();
3612
+ init_chunk_WFMWIRTS();
3613
+ init_chunk_UHDYHGOF();
3614
+ init_chunk_WIMGWYZL();
3615
+ } });
3616
+
3617
+ //#endregion
3618
+ //#region src/utils/plugin/index.ts
3619
+ var isPluginHookName;
3620
+ var init_plugin = __esm({ "src/utils/plugin/index.ts"() {
3621
+ init_plugin$1();
3622
+ isPluginHookName = function() {
3623
+ const PLUGIN_HOOK_NAMES_SET = new Set(ENUMERATED_PLUGIN_HOOK_NAMES);
3624
+ return function isPluginHookName$1(hookName) {
3625
+ return PLUGIN_HOOK_NAMES_SET.has(hookName);
3626
+ };
3627
+ }();
3628
+ } });
3629
+
3630
+ //#endregion
3631
+ //#region src/utils/compose-js-plugins.ts
3632
+ function isUnsupportedHooks(hookName) {
3633
+ return unsupportedHooks.has(hookName);
3634
+ }
3635
+ function createComposedPlugin(plugins) {
3636
+ const names = [];
3637
+ const batchedHooks = {};
3638
+ plugins.forEach((plugin, index) => {
3639
+ const pluginName = plugin.name || `Anonymous(index: ${index})`;
3640
+ names.push(pluginName);
3641
+ t$5(plugin).forEach((pluginProp) => {
3642
+ if (isUnsupportedHooks(pluginProp)) throw new Error(`Failed to compose js plugins. Plugin ${pluginName} has an unsupported hook: ${pluginProp}`);
3643
+ if (!isPluginHookName(pluginProp)) return;
3644
+ switch (pluginProp) {
3645
+ case "buildStart": {
3646
+ const handlers = batchedHooks.buildStart ?? [];
3647
+ batchedHooks.buildStart = handlers;
3648
+ if (plugin.buildStart) handlers.push([plugin.buildStart, plugin]);
3649
+ break;
3650
+ }
3651
+ case "load": {
3652
+ const handlers = batchedHooks.load ?? [];
3653
+ batchedHooks.load = handlers;
3654
+ if (plugin.load) handlers.push([plugin.load, plugin]);
3655
+ break;
3656
+ }
3657
+ case "transform": {
3658
+ const handlers = batchedHooks.transform ?? [];
3659
+ batchedHooks.transform = handlers;
3660
+ if (plugin.transform) handlers.push([plugin.transform, plugin]);
3661
+ break;
3662
+ }
3663
+ case "resolveId": {
3664
+ const handlers = batchedHooks.resolveId ?? [];
3665
+ batchedHooks.resolveId = handlers;
3666
+ if (plugin.resolveId) handlers.push([plugin.resolveId, plugin]);
3667
+ break;
3668
+ }
3669
+ case "buildEnd": {
3670
+ const handlers = batchedHooks.buildEnd ?? [];
3671
+ batchedHooks.buildEnd = handlers;
3672
+ if (plugin.buildEnd) handlers.push([plugin.buildEnd, plugin]);
3673
+ break;
3674
+ }
3675
+ case "renderChunk": {
3676
+ const handlers = batchedHooks.renderChunk ?? [];
3677
+ batchedHooks.renderChunk = handlers;
3678
+ if (plugin.renderChunk) handlers.push([plugin.renderChunk, plugin]);
3679
+ break;
3680
+ }
3681
+ case "banner":
3682
+ case "footer":
3683
+ case "intro":
3684
+ case "outro": {
3685
+ const hook = plugin[pluginProp];
3686
+ if (hook) (batchedHooks[pluginProp] ??= []).push([hook, plugin]);
3687
+ break;
3688
+ }
3689
+ case "closeBundle": {
3690
+ const handlers = batchedHooks.closeBundle ?? [];
3691
+ batchedHooks.closeBundle = handlers;
3692
+ if (plugin.closeBundle) handlers.push([plugin.closeBundle, plugin]);
3693
+ break;
3694
+ }
3695
+ case "watchChange": {
3696
+ const handlers = batchedHooks.watchChange ?? [];
3697
+ batchedHooks.watchChange = handlers;
3698
+ if (plugin.watchChange) handlers.push([plugin.watchChange, plugin]);
3699
+ break;
3700
+ }
3701
+ case "closeWatcher": {
3702
+ const handlers = batchedHooks.closeWatcher ?? [];
3703
+ batchedHooks.closeWatcher = handlers;
3704
+ if (plugin.closeWatcher) handlers.push([plugin.closeWatcher, plugin]);
3705
+ break;
3706
+ }
3707
+ default: {}
3708
+ }
3709
+ });
3710
+ });
3711
+ const composed = { name: `Composed(${names.join(", ")})` };
3712
+ const createFixedPluginResolveFnMap = new Map();
3713
+ function applyFixedPluginResolveFn(ctx, plugin) {
3714
+ const createFixedPluginResolveFn = createFixedPluginResolveFnMap.get(plugin);
3715
+ if (createFixedPluginResolveFn) ctx.resolve = createFixedPluginResolveFn(ctx, ctx.resolve.bind(ctx));
3716
+ return ctx;
3717
+ }
3718
+ if (batchedHooks.resolveId) {
3719
+ const batchedHandlers = batchedHooks.resolveId;
3720
+ const handlerSymbols = batchedHandlers.map(([_handler, plugin]) => Symbol(plugin.name ?? `Anonymous`));
3721
+ for (let handlerIdx = 0; handlerIdx < batchedHandlers.length; handlerIdx++) {
3722
+ const [_handler, plugin] = batchedHandlers[handlerIdx];
3723
+ const handlerSymbol = handlerSymbols[handlerIdx];
3724
+ const createFixedPluginResolveFn = (ctx, resolve) => {
3725
+ return (source, importer, rawContextResolveOptions) => {
3726
+ const contextResolveOptions = rawContextResolveOptions ?? {};
3727
+ if (contextResolveOptions.skipSelf) {
3728
+ contextResolveOptions[SYMBOL_FOR_RESOLVE_CALLER_THAT_SKIP_SELF] = handlerSymbol;
3729
+ contextResolveOptions.skipSelf = false;
3730
+ }
3731
+ return resolve(source, importer, contextResolveOptions);
3732
+ };
3733
+ };
3734
+ createFixedPluginResolveFnMap.set(plugin, createFixedPluginResolveFn);
3735
+ }
3736
+ composed.resolveId = async function(source, importer, rawHookResolveIdOptions) {
3737
+ const hookResolveIdOptions = rawHookResolveIdOptions;
3738
+ const symbolForCallerThatSkipSelf = hookResolveIdOptions?.[SYMBOL_FOR_RESOLVE_CALLER_THAT_SKIP_SELF];
3739
+ for (let handlerIdx = 0; handlerIdx < batchedHandlers.length; handlerIdx++) {
3740
+ const [handler, plugin] = batchedHandlers[handlerIdx];
3741
+ const handlerSymbol = handlerSymbols[handlerIdx];
3742
+ if (symbolForCallerThatSkipSelf === handlerSymbol) continue;
3743
+ const { handler: handlerFn } = normalizeHook(handler);
3744
+ const result = await handlerFn.call(applyFixedPluginResolveFn(this, plugin), source, importer, rawHookResolveIdOptions);
3745
+ if (!isNullish(result)) return result;
3746
+ }
3747
+ };
3748
+ }
3749
+ t$5(batchedHooks).forEach((hookName) => {
3750
+ switch (hookName) {
3751
+ case "resolveId": break;
3752
+ case "buildStart": {
3753
+ if (batchedHooks.buildStart) {
3754
+ const batchedHandlers = batchedHooks.buildStart;
3755
+ composed.buildStart = async function(options) {
3756
+ await Promise.all(batchedHandlers.map(([handler, plugin]) => {
3757
+ const { handler: handlerFn } = normalizeHook(handler);
3758
+ return handlerFn.call(applyFixedPluginResolveFn(this, plugin), options);
3759
+ }));
3760
+ };
3761
+ }
3762
+ break;
3763
+ }
3764
+ case "load": {
3765
+ if (batchedHooks.load) {
3766
+ const batchedHandlers = batchedHooks.load;
3767
+ composed.load = async function(id) {
3768
+ for (const [handler, plugin] of batchedHandlers) {
3769
+ const { handler: handlerFn } = normalizeHook(handler);
3770
+ const result = await handlerFn.call(applyFixedPluginResolveFn(this, plugin), id);
3771
+ if (!isNullish(result)) return result;
3772
+ }
3773
+ };
3774
+ }
3775
+ break;
3776
+ }
3777
+ case "transform": {
3778
+ if (batchedHooks.transform) {
3779
+ const batchedHandlers = batchedHooks.transform;
3780
+ composed.transform = async function(initialCode, id, moduleType) {
3781
+ let code = initialCode;
3782
+ let moduleSideEffects = void 0;
3783
+ function updateOutput(newCode, newModuleSideEffects) {
3784
+ code = newCode;
3785
+ moduleSideEffects = newModuleSideEffects ?? void 0;
3786
+ }
3787
+ for (const [handler, plugin] of batchedHandlers) {
3788
+ const { handler: handlerFn } = normalizeHook(handler);
3789
+ this.getCombinedSourcemap = () => {
3790
+ throw new Error(`The getCombinedSourcemap is not implement in transform hook at composedJsPlugins`);
3791
+ };
3792
+ const result = await handlerFn.call(applyFixedPluginResolveFn(this, plugin), code, id, moduleType);
3793
+ if (!isNullish(result)) {
3794
+ if (typeof result === "string") updateOutput(result);
3795
+ else if (result.code) updateOutput(result.code, result.moduleSideEffects);
3796
+ }
3797
+ }
3798
+ return {
3799
+ code,
3800
+ moduleSideEffects
3801
+ };
3802
+ };
3803
+ }
3804
+ break;
3805
+ }
3806
+ case "buildEnd": {
3807
+ if (batchedHooks.buildEnd) {
3808
+ const batchedHandlers = batchedHooks.buildEnd;
3809
+ composed.buildEnd = async function(err) {
3810
+ await Promise.all(batchedHandlers.map(([handler, plugin]) => {
3811
+ const { handler: handlerFn } = normalizeHook(handler);
3812
+ return handlerFn.call(applyFixedPluginResolveFn(this, plugin), err);
3813
+ }));
3814
+ };
3815
+ }
3816
+ break;
3817
+ }
3818
+ case "renderChunk": {
3819
+ if (batchedHooks.renderChunk) {
3820
+ const batchedHandlers = batchedHooks.renderChunk;
3821
+ composed.renderChunk = async function(code, chunk, options, meta) {
3822
+ for (const [handler, plugin] of batchedHandlers) {
3823
+ const { handler: handlerFn } = normalizeHook(handler);
3824
+ const result = await handlerFn.call(applyFixedPluginResolveFn(this, plugin), code, chunk, options, meta);
3825
+ if (!isNullish(result)) return result;
3826
+ }
3827
+ };
3828
+ }
3829
+ break;
3830
+ }
3831
+ case "banner":
3832
+ case "footer":
3833
+ case "intro":
3834
+ case "outro": {
3835
+ const hooks = batchedHooks[hookName];
3836
+ if (hooks?.length) composed[hookName] = async function(chunk) {
3837
+ const ret = [];
3838
+ for (const [hook, plugin] of hooks) {
3839
+ const { handler } = normalizeHook(hook);
3840
+ ret.push(typeof handler === "string" ? handler : await handler.call(applyFixedPluginResolveFn(this, plugin), chunk));
3841
+ }
3842
+ return ret.join("\n");
3843
+ };
3844
+ break;
3845
+ }
3846
+ case "closeBundle": {
3847
+ if (batchedHooks.closeBundle) {
3848
+ const batchedHandlers = batchedHooks.closeBundle;
3849
+ composed.closeBundle = async function() {
3850
+ await Promise.all(batchedHandlers.map(([handler, plugin]) => {
3851
+ const { handler: handlerFn } = normalizeHook(handler);
3852
+ return handlerFn.call(applyFixedPluginResolveFn(this, plugin));
3853
+ }));
3854
+ };
3855
+ }
3856
+ break;
3857
+ }
3858
+ case "watchChange": {
3859
+ if (batchedHooks.watchChange) {
3860
+ const batchedHandlers = batchedHooks.watchChange;
3861
+ composed.watchChange = async function(id, event) {
3862
+ await Promise.all(batchedHandlers.map(([handler, plugin]) => {
3863
+ const { handler: handlerFn } = normalizeHook(handler);
3864
+ return handlerFn.call(applyFixedPluginResolveFn(this, plugin), id, event);
3865
+ }));
3866
+ };
3867
+ }
3868
+ break;
3869
+ }
3870
+ case "closeWatcher": {
3871
+ if (batchedHooks.closeWatcher) {
3872
+ const batchedHandlers = batchedHooks.closeWatcher;
3873
+ composed.closeWatcher = async function() {
3874
+ await Promise.all(batchedHandlers.map(([handler, plugin]) => {
3875
+ const { handler: handlerFn } = normalizeHook(handler);
3876
+ return handlerFn.call(applyFixedPluginResolveFn(this, plugin));
3877
+ }));
3878
+ };
3879
+ }
3880
+ break;
3881
+ }
3882
+ default: {}
3883
+ }
3884
+ });
3885
+ return composed;
3886
+ }
3887
+ function isComposablePlugin(plugin) {
3888
+ if (plugin instanceof BuiltinPlugin) return false;
3889
+ if ("_parallel" in plugin) return false;
3890
+ const hasNotComposablePattern = t$5(plugin).some((hookName) => {
3891
+ if (!isPluginHookName(hookName)) return false;
3892
+ const OK_TO_COMPOSE = false;
3893
+ if (isUnsupportedHooks(hookName)) return !OK_TO_COMPOSE;
3894
+ if (plugin[hookName]) {
3895
+ const { meta } = normalizeHook(plugin[hookName]);
3896
+ if (meta.order === "pre" || meta.order === "post") return !OK_TO_COMPOSE;
3897
+ }
3898
+ return OK_TO_COMPOSE;
3899
+ });
3900
+ if (hasNotComposablePattern) return false;
3901
+ return true;
3902
+ }
3903
+ function composeJsPlugins(plugins) {
3904
+ const newPlugins = [];
3905
+ const toBeComposed = [];
3906
+ plugins.forEach((plugin) => {
3907
+ if (isComposablePlugin(plugin)) toBeComposed.push(plugin);
3908
+ else {
3909
+ if (toBeComposed.length > 0) {
3910
+ if (toBeComposed.length > 1) newPlugins.push(createComposedPlugin(toBeComposed));
3911
+ else newPlugins.push(toBeComposed[0]);
3912
+ toBeComposed.length = 0;
3913
+ }
3914
+ newPlugins.push(plugin);
3915
+ }
3916
+ });
3917
+ if (toBeComposed.length > 0) {
3918
+ if (toBeComposed.length > 1) newPlugins.push(createComposedPlugin(toBeComposed));
3919
+ else newPlugins.push(toBeComposed[0]);
3920
+ toBeComposed.length = 0;
3921
+ }
3922
+ return newPlugins;
3923
+ }
3924
+ var unsupportedHookName, unsupportedHooks;
3925
+ var init_compose_js_plugins = __esm({ "src/utils/compose-js-plugins.ts"() {
3926
+ init_dist();
3927
+ init_constructors();
3928
+ init_plugin_context$1();
3929
+ init_misc();
3930
+ init_normalize_hook();
3931
+ init_plugin();
3932
+ unsupportedHookName = [
3933
+ "augmentChunkHash",
3934
+ "generateBundle",
3935
+ "moduleParsed",
3936
+ "onLog",
3937
+ "options",
3938
+ "outputOptions",
3939
+ "renderError",
3940
+ "renderStart",
3941
+ "resolveDynamicImport",
3942
+ "writeBundle"
3943
+ ];
3944
+ unsupportedHooks = new Set(unsupportedHookName);
3945
+ } });
3946
+
3947
+ //#endregion
3948
+ //#region src/utils/initialize-parallel-plugins.ts
3949
+ async function initializeParallelPlugins(plugins) {
3950
+ const pluginInfos = [];
3951
+ for (const [index, plugin] of plugins.entries()) if ("_parallel" in plugin) {
3952
+ const { fileUrl, options } = plugin._parallel;
3953
+ pluginInfos.push({
3954
+ index,
3955
+ fileUrl,
3956
+ options
3957
+ });
3958
+ }
3959
+ if (pluginInfos.length <= 0) return void 0;
3960
+ const count = Math.min(availableParallelism(), 8);
3961
+ const parallelJsPluginRegistry = new import_binding.ParallelJsPluginRegistry(count);
3962
+ const registryId = parallelJsPluginRegistry.id;
3963
+ const workers = await initializeWorkers(registryId, count, pluginInfos);
3964
+ const stopWorkers = async () => {
3965
+ await Promise.all(workers.map((worker) => worker.terminate()));
3966
+ };
3967
+ return {
3968
+ registry: parallelJsPluginRegistry,
3969
+ stopWorkers
3970
+ };
3971
+ }
3972
+ function initializeWorkers(registryId, count, pluginInfos) {
3973
+ return Promise.all(Array.from({ length: count }, (_, i$21) => initializeWorker(registryId, pluginInfos, i$21)));
3974
+ }
3975
+ async function initializeWorker(registryId, pluginInfos, threadNumber) {
3976
+ const urlString = import.meta.resolve("#parallel-plugin-worker");
3977
+ const workerData$1 = {
3978
+ registryId,
3979
+ pluginInfos,
3980
+ threadNumber
3981
+ };
3982
+ let worker;
3983
+ try {
3984
+ worker = new Worker(new URL(urlString), { workerData: workerData$1 });
3985
+ worker.unref();
3986
+ await new Promise((resolve, reject) => {
3987
+ worker.once("message", async (message) => {
3988
+ if (message.type === "error") reject(message.error);
3989
+ else resolve();
3990
+ });
3991
+ });
3992
+ return worker;
3993
+ } catch (e$5) {
3994
+ worker?.terminate();
3995
+ throw e$5;
3996
+ }
3997
+ }
3998
+ var init_initialize_parallel_plugins = __esm({ "src/utils/initialize-parallel-plugins.ts"() {} });
3999
+
4000
+ //#endregion
4001
+ //#region src/utils/create-bundler-option.ts
4002
+ async function createBundlerOptions(inputOptions, outputOptions, watchMode, isClose) {
4003
+ const inputPlugins = await normalizePluginOption(inputOptions.plugins);
4004
+ const outputPlugins = await normalizePluginOption(outputOptions.plugins);
4005
+ const logLevel = inputOptions.logLevel || LOG_LEVEL_INFO;
4006
+ const onLog = getLogger(getObjectPlugins(inputPlugins), getOnLog(inputOptions, logLevel), logLevel, watchMode);
4007
+ if (!isClose) outputOptions = PluginDriver.callOutputOptionsHook([...inputPlugins, ...outputPlugins], outputOptions, onLog, logLevel, watchMode);
4008
+ if (outputOptions.minify === true) onLog(LOG_LEVEL_WARN, logMinifyWarning());
4009
+ const normalizedOutputPlugins = await normalizePluginOption(outputOptions.plugins);
4010
+ let plugins = [...normalizePlugins(inputPlugins, ANONYMOUS_PLUGIN_PREFIX), ...checkOutputPluginOption(normalizePlugins(normalizedOutputPlugins, ANONYMOUS_OUTPUT_PLUGIN_PREFIX), onLog)];
4011
+ if (inputOptions.experimental?.enableComposingJsPlugins ?? false) plugins = composeJsPlugins(plugins);
4012
+ const parallelPluginInitResult = await initializeParallelPlugins(plugins);
4013
+ try {
4014
+ const bindingInputOptions = bindingifyInputOptions(plugins, inputOptions, outputOptions, normalizedOutputPlugins, onLog, logLevel, watchMode);
4015
+ const bindingOutputOptions = bindingifyOutputOptions(outputOptions);
4016
+ return {
4017
+ bundlerOptions: {
4018
+ inputOptions: bindingInputOptions,
4019
+ outputOptions: bindingOutputOptions,
4020
+ parallelPluginsRegistry: parallelPluginInitResult?.registry
4021
+ },
4022
+ inputOptions,
4023
+ onLog,
4024
+ stopWorkers: parallelPluginInitResult?.stopWorkers
4025
+ };
4026
+ } catch (e$5) {
4027
+ await parallelPluginInitResult?.stopWorkers();
4028
+ throw e$5;
4029
+ }
4030
+ }
4031
+ var init_create_bundler_option = __esm({ "src/utils/create-bundler-option.ts"() {
4032
+ init_logger();
4033
+ init_logging();
4034
+ init_logs();
4035
+ init_plugin_driver();
4036
+ init_bindingify_input_options();
4037
+ init_bindingify_output_options();
4038
+ init_compose_js_plugins();
4039
+ init_initialize_parallel_plugins();
4040
+ init_normalize_plugin_option();
4041
+ } });
4042
+
4043
+ //#endregion
4044
+ //#region src/utils/create-bundler.ts
4045
+ async function createBundler(inputOptions, outputOptions, isClose) {
4046
+ const option = await createBundlerOptions(inputOptions, outputOptions, false, isClose);
4047
+ if (asyncRuntimeShutdown) (0, import_binding.startAsyncRuntime)();
4048
+ try {
4049
+ return {
4050
+ bundler: new import_binding.Bundler(option.bundlerOptions),
4051
+ stopWorkers: option.stopWorkers,
4052
+ shutdown: () => {
4053
+ (0, import_binding.shutdownAsyncRuntime)();
4054
+ asyncRuntimeShutdown = true;
4055
+ }
4056
+ };
4057
+ } catch (e$5) {
4058
+ await option.stopWorkers?.();
4059
+ throw e$5;
4060
+ }
4061
+ }
4062
+ var asyncRuntimeShutdown;
4063
+ var init_create_bundler = __esm({ "src/utils/create-bundler.ts"() {
4064
+ init_create_bundler_option();
4065
+ asyncRuntimeShutdown = false;
4066
+ } });
4067
+
4068
+ //#endregion
4069
+ //#region src/api/rolldown/rolldown-build.ts
4070
+ var RolldownBuild;
4071
+ var init_rolldown_build = __esm({ "src/api/rolldown/rolldown-build.ts"() {
4072
+ init_create_bundler();
4073
+ init_transform_to_rollup_output();
4074
+ init_validator();
4075
+ Symbol.asyncDispose ??= Symbol("Symbol.asyncDispose");
4076
+ RolldownBuild = class {
4077
+ #inputOptions;
4078
+ #bundler;
4079
+ constructor(inputOptions) {
4080
+ this.#inputOptions = inputOptions;
4081
+ }
4082
+ get closed() {
4083
+ return this.#bundler?.bundler.closed ?? false;
4084
+ }
4085
+ async #getBundlerWithStopWorker(outputOptions, isClose) {
4086
+ if (this.#bundler) await this.#bundler.stopWorkers?.();
4087
+ return this.#bundler = await createBundler(this.#inputOptions, outputOptions, isClose);
4088
+ }
4089
+ async generate(outputOptions = {}) {
4090
+ validateOption("output", outputOptions);
4091
+ const { bundler } = await this.#getBundlerWithStopWorker(outputOptions);
4092
+ const output = await bundler.generate();
4093
+ return transformToRollupOutput(output);
4094
+ }
4095
+ async write(outputOptions = {}) {
4096
+ validateOption("output", outputOptions);
4097
+ const { bundler } = await this.#getBundlerWithStopWorker(outputOptions);
4098
+ const output = await bundler.write();
4099
+ return transformToRollupOutput(output);
4100
+ }
4101
+ async close() {
4102
+ const { bundler, stopWorkers, shutdown } = await this.#getBundlerWithStopWorker({}, true);
4103
+ await stopWorkers?.();
4104
+ await bundler.close();
4105
+ shutdown();
4106
+ }
4107
+ async [Symbol.asyncDispose]() {
4108
+ await this.close();
4109
+ }
4110
+ async generateHmrPatch(changedFiles) {
4111
+ return this.#bundler?.bundler.generateHmrPatch(changedFiles);
4112
+ }
4113
+ get watchFiles() {
4114
+ return this.#bundler?.bundler.watchFiles ?? [];
4115
+ }
4116
+ };
4117
+ } });
4118
+
4119
+ //#endregion
4120
+ //#region src/api/rolldown/index.ts
4121
+ var rolldown;
4122
+ var init_rolldown = __esm({ "src/api/rolldown/index.ts"() {
4123
+ init_plugin_driver();
4124
+ init_validator();
4125
+ init_rolldown_build();
4126
+ rolldown = async (input) => {
4127
+ validateOption("input", input);
4128
+ const inputOptions = await PluginDriver.callOptionsHook(input);
4129
+ return new RolldownBuild(inputOptions);
4130
+ };
4131
+ } });
4132
+
4133
+ //#endregion
4134
+ //#region src/api/build.ts
4135
+ async function build(options) {
4136
+ if (Array.isArray(options)) return Promise.all(options.map((opts) => build(opts)));
4137
+ else {
4138
+ const { output, write = true,...inputOptions } = options;
4139
+ const build$1 = await rolldown(inputOptions);
4140
+ try {
4141
+ if (write) return await build$1.write(output);
4142
+ else return await build$1.generate(output);
4143
+ } finally {
4144
+ await build$1.close();
4145
+ }
4146
+ }
4147
+ }
4148
+ var init_build = __esm({ "src/api/build.ts"() {
4149
+ init_rolldown();
4150
+ } });
4151
+
4152
+ //#endregion
4153
+ //#region src/api/watch/watch-emitter.ts
4154
+ var WatcherEmitter;
4155
+ var init_watch_emitter = __esm({ "src/api/watch/watch-emitter.ts"() {
4156
+ init_error();
4157
+ WatcherEmitter = class {
4158
+ listeners = new Map();
4159
+ timer;
4160
+ constructor() {
4161
+ this.timer = setInterval(
4162
+ () => {},
4163
+ 1e9
4164
+ /* Low power usage */
4165
+ );
4166
+ }
4167
+ on(event, listener) {
4168
+ const listeners = this.listeners.get(event);
4169
+ if (listeners) listeners.push(listener);
4170
+ else this.listeners.set(event, [listener]);
4171
+ return this;
4172
+ }
4173
+ async onEvent(event) {
4174
+ const listeners = this.listeners.get(event.eventKind());
4175
+ if (listeners) switch (event.eventKind()) {
4176
+ case "close":
4177
+ case "restart":
4178
+ for (const listener of listeners) await listener();
4179
+ break;
4180
+ case "event":
4181
+ for (const listener of listeners) {
4182
+ const code = event.bundleEventKind();
4183
+ switch (code) {
4184
+ case "BUNDLE_END":
4185
+ const { duration, output } = event.bundleEndData();
4186
+ await listener({
4187
+ code: "BUNDLE_END",
4188
+ duration,
4189
+ output: [output]
4190
+ });
4191
+ break;
4192
+ case "ERROR":
4193
+ const errors = event.errors();
4194
+ await listener({
4195
+ code: "ERROR",
4196
+ error: normalizeErrors(errors)
4197
+ });
4198
+ break;
4199
+ default:
4200
+ await listener({ code });
4201
+ break;
4202
+ }
4203
+ }
4204
+ break;
4205
+ case "change":
4206
+ for (const listener of listeners) {
4207
+ const { path: path$1, kind } = event.watchChangeData();
4208
+ await listener(path$1, { event: kind });
4209
+ }
4210
+ break;
4211
+ default: throw new Error(`Unknown event: ${event}`);
4212
+ }
4213
+ }
4214
+ async close() {
4215
+ clearInterval(this.timer);
4216
+ }
4217
+ };
4218
+ } });
4219
+
4220
+ //#endregion
4221
+ //#region src/api/watch/watcher.ts
4222
+ async function createWatcher(emitter, input) {
4223
+ const options = arraify(input);
4224
+ const bundlerOptions = await Promise.all(options.map((option) => arraify(option.output || {}).map(async (output) => {
4225
+ const inputOptions = await PluginDriver.callOptionsHook(option, true);
4226
+ return createBundlerOptions(inputOptions, output, true);
4227
+ })).flat());
4228
+ const notifyOptions = getValidNotifyOption(bundlerOptions);
4229
+ const bindingWatcher = new import_binding.BindingWatcher(bundlerOptions.map((option) => option.bundlerOptions), notifyOptions);
4230
+ const watcher = new Watcher(emitter, bindingWatcher, bundlerOptions.map((option) => option.stopWorkers));
4231
+ watcher.start();
4232
+ }
4233
+ function getValidNotifyOption(bundlerOptions) {
4234
+ let result;
4235
+ for (const option of bundlerOptions) if (option.inputOptions.watch) {
4236
+ const notifyOption = option.inputOptions.watch.notify;
4237
+ if (notifyOption) if (result) {
4238
+ option.onLog(LOG_LEVEL_WARN, logMultiplyNotifyOption());
4239
+ return result;
4240
+ } else result = notifyOption;
4241
+ }
4242
+ }
4243
+ var Watcher;
4244
+ var init_watcher = __esm({ "src/api/watch/watcher.ts"() {
4245
+ init_logging();
4246
+ init_logs();
4247
+ init_plugin_driver();
4248
+ init_create_bundler_option();
4249
+ init_misc();
4250
+ Watcher = class {
4251
+ closed;
4252
+ inner;
4253
+ emitter;
4254
+ stopWorkers;
4255
+ constructor(emitter, inner, stopWorkers) {
4256
+ this.closed = false;
4257
+ this.inner = inner;
4258
+ this.emitter = emitter;
4259
+ const originClose = emitter.close.bind(emitter);
4260
+ emitter.close = async () => {
4261
+ await this.close();
4262
+ originClose();
4263
+ };
4264
+ this.stopWorkers = stopWorkers;
4265
+ }
4266
+ async close() {
4267
+ if (this.closed) return;
4268
+ this.closed = true;
4269
+ for (const stop of this.stopWorkers) await stop?.();
4270
+ await this.inner.close();
4271
+ (0, import_binding.shutdownAsyncRuntime)();
4272
+ }
4273
+ start() {
4274
+ process.nextTick(() => this.inner.start(this.emitter.onEvent.bind(this.emitter)));
4275
+ }
4276
+ };
4277
+ } });
4278
+
4279
+ //#endregion
4280
+ //#region src/api/watch/index.ts
4281
+ var watch;
4282
+ var init_watch = __esm({ "src/api/watch/index.ts"() {
4283
+ init_watch_emitter();
4284
+ init_watcher();
4285
+ watch = (input) => {
4286
+ const emitter = new WatcherEmitter();
4287
+ createWatcher(emitter, input);
4288
+ return emitter;
4289
+ };
4290
+ } });
4291
+
4292
+ //#endregion
4293
+ //#region src/utils/define-config.ts
4294
+ function defineConfig(config) {
4295
+ return config;
4296
+ }
4297
+ var init_define_config = __esm({ "src/utils/define-config.ts"() {} });
4298
+
4299
+ //#endregion
4300
+ //#region src/index.ts
4301
+ var VERSION;
4302
+ var init_src = __esm({ "src/index.ts"() {
4303
+ init_build();
4304
+ init_rolldown();
4305
+ init_watch();
4306
+ init_define_config();
4307
+ VERSION = version;
4308
+ } });
4309
+
4310
+ //#endregion
4311
+ export { BuiltinPlugin, PluginContextData, VERSION, arraify, bindingifyPlugin, build, buildImportAnalysisPlugin, composeJsPlugins, createBundler, defineConfig, description, dynamicImportVarsPlugin, getInputCliKeys, getJsonSchema, getOutputCliKeys, handleOutputErrors, importGlobPlugin, init_bindingify_plugin, init_compose_js_plugins, init_constructors, init_create_bundler, init_misc, init_normalize_string_or_regex, init_plugin_context_data, init_rolldown, init_src, init_transform_to_rollup_output, init_validator, init_watch, isolatedDeclarationPlugin, jsonPlugin, loadFallbackPlugin, manifestPlugin, moduleFederationPlugin, modulePreloadPolyfillPlugin, normalizedStringOrRegex, rolldown, validateCliOptions, version, viteResolvePlugin, wasmFallbackPlugin, wasmHelperPlugin, watch };