sv 0.8.7 → 0.8.8

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 (2) hide show
  1. package/dist/bin.js +55 -2722
  2. package/package.json +2 -4
package/dist/bin.js CHANGED
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import { AGENT_NAMES, Command, Element, Option, Tag, __commonJS, __export, __require, __toESM, __toESM$1, addPnpmBuildDependencies, box, cancel, confirm, create, detect, esm_exports, from, getUserAgent, group, installDependencies, installOption, intro, isCancel, log, multiselect, note, outro, packageManagerPrompt, parseCss$1, parseHtml, parseHtml$1, parseJson$1, parseScript$1, parseSvelte, program, require_picocolors, resolveCommand, select, spinner, templates, text, up, walk_exports } from "./package-manager-D3PRQ-L_.js";
2
+ import { AGENT_NAMES, Command, Element, Option, Tag, __export, __toESM as __toESM$1, __toESM$1 as __toESM, addPnpmBuildDependencies, box, cancel, confirm, create, detect, esm_exports, from, getUserAgent, group, installDependencies, installOption, intro, isCancel, log, multiselect, note, outro, packageManagerPrompt, parseCss$1, parseHtml, parseHtml$1, parseJson$1, parseScript$1, parseSvelte, program, require_picocolors, resolveCommand, select, spinner, templates, text, up, walk_exports } from "./package-manager-D3PRQ-L_.js";
3
3
  import { addFromString, applyAddons, array_exports, common_exports, createWorkspace, dedent_default, exports_exports, formatFiles, function_exports, getHighlighter, imports_exports, kit_exports, object_exports, require_picocolors$1, setupAddons, variables_exports } from "./install-BTJ6iCTS.js";
4
4
  import fs, { existsSync } from "node:fs";
5
5
  import path, { dirname, join } from "node:path";
@@ -12,7 +12,7 @@ import { promisify } from "node:util";
12
12
 
13
13
  //#region packages/cli/package.json
14
14
  var name = "sv";
15
- var version = "0.8.7";
15
+ var version = "0.8.8";
16
16
  var type = "module";
17
17
  var description = "A CLI for creating and updating SvelteKit projects";
18
18
  var license = "MIT";
@@ -29,7 +29,7 @@ var scripts = {
29
29
  };
30
30
  var files = ["dist"];
31
31
  var bin = "./dist/bin.js";
32
- var exports$1 = {
32
+ var exports = {
33
33
  ".": {
34
34
  "types": "./dist/lib/index.d.ts",
35
35
  "default": "./dist/index.js"
@@ -46,14 +46,12 @@ var devDependencies = {
46
46
  "@sveltejs/create": "workspace:*",
47
47
  "@types/degit": "^2.8.6",
48
48
  "@types/ps-tree": "^1.1.6",
49
- "@types/tar-fs": "^2.0.4",
50
49
  "commander": "^13.1.0",
51
50
  "degit": "^2.8.4",
52
51
  "empathic": "^1.0.0",
53
52
  "package-manager-detector": "^0.2.11",
54
53
  "picocolors": "^1.1.1",
55
54
  "ps-tree": "^1.2.0",
56
- "tar-fs": "^3.0.8",
57
55
  "tinyexec": "^0.3.2",
58
56
  "valibot": "^0.41.0"
59
57
  };
@@ -78,7 +76,7 @@ var package_default = {
78
76
  scripts,
79
77
  files,
80
78
  bin,
81
- exports: exports$1,
79
+ exports,
82
80
  devDependencies,
83
81
  keywords
84
82
  };
@@ -479,7 +477,7 @@ function parse(schema, input, config2) {
479
477
  if (dataset.issues) throw new ValiError(dataset.issues);
480
478
  return dataset.value;
481
479
  }
482
- function pipe$1(...pipe2) {
480
+ function pipe(...pipe2) {
483
481
  return {
484
482
  ...pipe2[0],
485
483
  pipe: pipe2,
@@ -519,12 +517,12 @@ var __hasOwnProp$1 = Object.prototype.hasOwnProperty;
519
517
  var __commonJS$1 = (cb, mod) => function() {
520
518
  return mod || (0, cb[__getOwnPropNames$1(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
521
519
  };
522
- var __copyProps$1 = (to, from$2, except, desc) => {
523
- if (from$2 && typeof from$2 === "object" || typeof from$2 === "function") for (var keys$1 = __getOwnPropNames$1(from$2), i = 0, n$1 = keys$1.length, key; i < n$1; i++) {
520
+ var __copyProps$1 = (to, from$1, except, desc) => {
521
+ if (from$1 && typeof from$1 === "object" || typeof from$1 === "function") for (var keys$1 = __getOwnPropNames$1(from$1), i = 0, n$1 = keys$1.length, key; i < n$1; i++) {
524
522
  key = keys$1[i];
525
523
  if (!__hasOwnProp$1.call(to, key) && key !== except) __defProp$1(to, key, {
526
- get: ((k) => from$2[k]).bind(null, key),
527
- enumerable: !(desc = __getOwnPropDesc$1(from$2, key)) || desc.enumerable
524
+ get: ((k) => from$1[k]).bind(null, key),
525
+ enumerable: !(desc = __getOwnPropDesc$1(from$1, key)) || desc.enumerable
528
526
  });
529
527
  }
530
528
  return to;
@@ -539,15 +537,15 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
539
537
  var __getOwnPropNames = Object.getOwnPropertyNames;
540
538
  var __getProtoOf = Object.getPrototypeOf;
541
539
  var __hasOwnProp = Object.prototype.hasOwnProperty;
542
- var __commonJS$2 = (cb, mod) => function() {
540
+ var __commonJS = (cb, mod) => function() {
543
541
  return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
544
542
  };
545
- var __copyProps = (to, from$2, except, desc) => {
546
- if (from$2 && typeof from$2 === "object" || typeof from$2 === "function") for (var keys$1 = __getOwnPropNames(from$2), i = 0, n$1 = keys$1.length, key; i < n$1; i++) {
543
+ var __copyProps = (to, from$1, except, desc) => {
544
+ if (from$1 && typeof from$1 === "object" || typeof from$1 === "function") for (var keys$1 = __getOwnPropNames(from$1), i = 0, n$1 = keys$1.length, key; i < n$1; i++) {
547
545
  key = keys$1[i];
548
546
  if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
549
- get: ((k) => from$2[k]).bind(null, key),
550
- enumerable: !(desc = __getOwnPropDesc(from$2, key)) || desc.enumerable
547
+ get: ((k) => from$1[k]).bind(null, key),
548
+ enumerable: !(desc = __getOwnPropDesc(from$1, key)) || desc.enumerable
551
549
  });
552
550
  }
553
551
  return to;
@@ -556,7 +554,7 @@ var __toESM$2 = (mod, isNodeMode, target) => (target = mod != null ? __create(__
556
554
  value: mod,
557
555
  enumerable: true
558
556
  }) : target, mod));
559
- var require_src$1 = __commonJS$2({ "node_modules/.pnpm/sisteransi@1.0.5/node_modules/sisteransi/src/index.js"(exports$2, module$1) {
557
+ var require_src$1 = __commonJS({ "node_modules/.pnpm/sisteransi@1.0.5/node_modules/sisteransi/src/index.js"(exports$1, module$1) {
560
558
  const ESC$1 = "\x1B";
561
559
  const CSI$1 = `${ESC$1}[`;
562
560
  const beep$1 = "\x07";
@@ -616,7 +614,7 @@ function ansiRegex$1({ onlyFirst = false } = {}) {
616
614
  return new RegExp(pattern, onlyFirst ? undefined : "g");
617
615
  }
618
616
  const regex = ansiRegex$1();
619
- var require_eastasianwidth = __commonJS$2({ "node_modules/.pnpm/eastasianwidth@0.2.0/node_modules/eastasianwidth/eastasianwidth.js"(exports$2, module$1) {
617
+ var require_eastasianwidth = __commonJS({ "node_modules/.pnpm/eastasianwidth@0.2.0/node_modules/eastasianwidth/eastasianwidth.js"(exports$1, module$1) {
620
618
  var eaw = {};
621
619
  if ("undefined" == typeof module$1) window.eastasianwidth = eaw;
622
620
  else module$1.exports = eaw;
@@ -670,7 +668,7 @@ else break;
670
668
  return result;
671
669
  };
672
670
  } });
673
- var require_emoji_regex = __commonJS$2({ "node_modules/.pnpm/emoji-regex@9.2.2/node_modules/emoji-regex/index.js"(exports$2, module$1) {
671
+ var require_emoji_regex = __commonJS({ "node_modules/.pnpm/emoji-regex@9.2.2/node_modules/emoji-regex/index.js"(exports$1, module$1) {
674
672
  module$1.exports = function() {
675
673
  return /\uD83C\uDFF4\uDB40\uDC67\uDB40\uDC62(?:\uDB40\uDC77\uDB40\uDC6C\uDB40\uDC73|\uDB40\uDC73\uDB40\uDC63\uDB40\uDC74|\uDB40\uDC65\uDB40\uDC6E\uDB40\uDC67)\uDB40\uDC7F|(?:\uD83E\uDDD1\uD83C\uDFFF\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFE])|(?:\uD83E\uDDD1\uD83C\uDFFE\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFD\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFC\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB\uDFFD-\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFB\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFB\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFC-\uDFFF])|\uD83D\uDC68(?:\uD83C\uDFFB(?:\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF]))|\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFC-\uDFFF])|[\u2695\u2696\u2708]\uFE0F|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))?|(?:\uD83C[\uDFFC-\uDFFF])\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF]))|\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83D\uDC68|(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFE])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])\uFE0F|\u200D(?:(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D[\uDC66\uDC67])|\uD83D[\uDC66\uDC67])|\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC)?|(?:\uD83D\uDC69(?:\uD83C\uDFFB\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|(?:\uD83C[\uDFFC-\uDFFF])\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69]))|\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1)(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC69(?:\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83E\uDDD1(?:\u200D(?:\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83D\uDC69\u200D\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D[\uDC66\uDC67])|\uD83D\uDC69\u200D\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|(?:\uD83D\uDC41\uFE0F\u200D\uD83D\uDDE8|\uD83E\uDDD1(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|\uD83D\uDC69(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|\uD83D\uDE36\u200D\uD83C\uDF2B|\uD83C\uDFF3\uFE0F\u200D\u26A7|\uD83D\uDC3B\u200D\u2744|(?:(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF])\u200D[\u2640\u2642]|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|\uD83C\uDFF4\u200D\u2620|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])\u200D[\u2640\u2642]|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u2600-\u2604\u260E\u2611\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26B0\u26B1\u26C8\u26CF\u26D1\u26D3\u26E9\u26F0\u26F1\u26F4\u26F7\u26F8\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u3030\u303D\u3297\u3299]|\uD83C[\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]|\uD83D[\uDC3F\uDCFD\uDD49\uDD4A\uDD6F\uDD70\uDD73\uDD76-\uDD79\uDD87\uDD8A-\uDD8D\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA\uDECB\uDECD-\uDECF\uDEE0-\uDEE5\uDEE9\uDEF0\uDEF3])\uFE0F|\uD83C\uDFF3\uFE0F\u200D\uD83C\uDF08|\uD83D\uDC69\u200D\uD83D\uDC67|\uD83D\uDC69\u200D\uD83D\uDC66|\uD83D\uDE35\u200D\uD83D\uDCAB|\uD83D\uDE2E\u200D\uD83D\uDCA8|\uD83D\uDC15\u200D\uD83E\uDDBA|\uD83E\uDDD1(?:\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC|\uD83C\uDFFB)?|\uD83D\uDC69(?:\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC|\uD83C\uDFFB)?|\uD83C\uDDFD\uD83C\uDDF0|\uD83C\uDDF6\uD83C\uDDE6|\uD83C\uDDF4\uD83C\uDDF2|\uD83D\uDC08\u200D\u2B1B|\u2764\uFE0F\u200D(?:\uD83D\uDD25|\uD83E\uDE79)|\uD83D\uDC41\uFE0F|\uD83C\uDFF3\uFE0F|\uD83C\uDDFF(?:\uD83C[\uDDE6\uDDF2\uDDFC])|\uD83C\uDDFE(?:\uD83C[\uDDEA\uDDF9])|\uD83C\uDDFC(?:\uD83C[\uDDEB\uDDF8])|\uD83C\uDDFB(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA])|\uD83C\uDDFA(?:\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF])|\uD83C\uDDF9(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF])|\uD83C\uDDF8(?:\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF])|\uD83C\uDDF7(?:\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC])|\uD83C\uDDF5(?:\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE])|\uD83C\uDDF3(?:\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF])|\uD83C\uDDF2(?:\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF])|\uD83C\uDDF1(?:\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE])|\uD83C\uDDF0(?:\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF])|\uD83C\uDDEF(?:\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5])|\uD83C\uDDEE(?:\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9])|\uD83C\uDDED(?:\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA])|\uD83C\uDDEC(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE])|\uD83C\uDDEB(?:\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7])|\uD83C\uDDEA(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA])|\uD83C\uDDE9(?:\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF])|\uD83C\uDDE8(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF5\uDDF7\uDDFA-\uDDFF])|\uD83C\uDDE7(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF])|\uD83C\uDDE6(?:\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF])|[#\*0-9]\uFE0F\u20E3|\u2764\uFE0F|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])|\uD83C\uDFF4|(?:[\u270A\u270B]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5])(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u261D\u270C\u270D]|\uD83D[\uDD74\uDD90])(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])|[\u270A\u270B]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC08\uDC15\uDC3B\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE2E\uDE35\uDE36\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5]|\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD]|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF]|[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC3A\uDC3C-\uDC3E\uDC40\uDC44\uDC45\uDC51-\uDC65\uDC6A\uDC79-\uDC7B\uDC7D-\uDC80\uDC84\uDC88-\uDC8E\uDC90\uDC92-\uDCA9\uDCAB-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDDA4\uDDFB-\uDE2D\uDE2F-\uDE34\uDE37-\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED7\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0D\uDD0E\uDD10-\uDD17\uDD1D\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78\uDD7A-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCB\uDDD0\uDDE0-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6]|(?:[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u270A\u270B\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF93\uDFA0-\uDFCA\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF4\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC3E\uDC40\uDC42-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDD7A\uDD95\uDD96\uDDA4\uDDFB-\uDE4F\uDE80-\uDEC5\uDECC\uDED0-\uDED2\uDED5-\uDED7\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0C-\uDD3A\uDD3C-\uDD45\uDD47-\uDD78\uDD7A-\uDDCB\uDDCD-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6])|(?:[#\*0-9\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23E9-\u23F3\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB-\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u261D\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692-\u2697\u2699\u269B\u269C\u26A0\u26A1\u26A7\u26AA\u26AB\u26B0\u26B1\u26BD\u26BE\u26C4\u26C5\u26C8\u26CE\u26CF\u26D1\u26D3\u26D4\u26E9\u26EA\u26F0-\u26F5\u26F7-\u26FA\u26FD\u2702\u2705\u2708-\u270D\u270F\u2712\u2714\u2716\u271D\u2721\u2728\u2733\u2734\u2744\u2747\u274C\u274E\u2753-\u2755\u2757\u2763\u2764\u2795-\u2797\u27A1\u27B0\u27BF\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B50\u2B55\u3030\u303D\u3297\u3299]|\uD83C[\uDC04\uDCCF\uDD70\uDD71\uDD7E\uDD7F\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE02\uDE1A\uDE2F\uDE32-\uDE3A\uDE50\uDE51\uDF00-\uDF21\uDF24-\uDF93\uDF96\uDF97\uDF99-\uDF9B\uDF9E-\uDFF0\uDFF3-\uDFF5\uDFF7-\uDFFF]|\uD83D[\uDC00-\uDCFD\uDCFF-\uDD3D\uDD49-\uDD4E\uDD50-\uDD67\uDD6F\uDD70\uDD73-\uDD7A\uDD87\uDD8A-\uDD8D\uDD90\uDD95\uDD96\uDDA4\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA-\uDE4F\uDE80-\uDEC5\uDECB-\uDED2\uDED5-\uDED7\uDEE0-\uDEE5\uDEE9\uDEEB\uDEEC\uDEF0\uDEF3-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0C-\uDD3A\uDD3C-\uDD45\uDD47-\uDD78\uDD7A-\uDDCB\uDDCD-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6])\uFE0F|(?:[\u261D\u26F9\u270A-\u270D]|\uD83C[\uDF85\uDFC2-\uDFC4\uDFC7\uDFCA-\uDFCC]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66-\uDC78\uDC7C\uDC81-\uDC83\uDC85-\uDC87\uDC8F\uDC91\uDCAA\uDD74\uDD75\uDD7A\uDD90\uDD95\uDD96\uDE45-\uDE47\uDE4B-\uDE4F\uDEA3\uDEB4-\uDEB6\uDEC0\uDECC]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1F\uDD26\uDD30-\uDD39\uDD3C-\uDD3E\uDD77\uDDB5\uDDB6\uDDB8\uDDB9\uDDBB\uDDCD-\uDDCF\uDDD1-\uDDDD])/g;
676
674
  };
@@ -844,7 +842,7 @@ const ANSI_ESCAPE_LINK = `${ANSI_OSC}8;;`;
844
842
  var import_src$2 = __toESM$2(require_src$1(), 1);
845
843
  const cancel$1 = Symbol("clack:cancel");
846
844
  var import_src$1 = __toESM$2(require_src$1(), 1);
847
- var require_picocolors$1$1 = __commonJS$2({ "node_modules/.pnpm/picocolors@1.1.1/node_modules/picocolors/picocolors.js"(exports$2, module$1) {
845
+ var require_picocolors$1$1 = __commonJS({ "node_modules/.pnpm/picocolors@1.1.1/node_modules/picocolors/picocolors.js"(exports$1, module$1) {
848
846
  let p$1 = process || {}, argv$1 = p$1.argv || [], env$1 = p$1.env || {};
849
847
  let isColorSupported$1 = !(!!env$1.NO_COLOR || argv$1.includes("--no-color")) && (!!env$1.FORCE_COLOR || argv$1.includes("--color") || p$1.platform === "win32" || (p$1.stdout || {}).isTTY && env$1.TERM !== "dumb" || !!env$1.CI);
850
848
  let formatter$1 = (open, close, replace = open) => (input) => {
@@ -918,7 +916,7 @@ function isUnicodeSupported() {
918
916
  if (process$1.platform !== "win32") return process$1.env.TERM !== "linux";
919
917
  return Boolean(process$1.env.CI) || Boolean(process$1.env.WT_SESSION) || Boolean(process$1.env.TERMINUS_SUBLIME) || process$1.env.ConEmuTask === "{cmd::Cmder}" || process$1.env.TERM_PROGRAM === "Terminus-Sublime" || process$1.env.TERM_PROGRAM === "vscode" || process$1.env.TERM === "xterm-256color" || process$1.env.TERM === "alacritty" || process$1.env.TERMINAL_EMULATOR === "JetBrains-JediTerm";
920
918
  }
921
- var require_picocolors$2 = __commonJS$1({ "node_modules/.pnpm/picocolors@1.1.1/node_modules/picocolors/picocolors.js"(exports$2, module$1) {
919
+ var require_picocolors$2 = __commonJS$1({ "node_modules/.pnpm/picocolors@1.1.1/node_modules/picocolors/picocolors.js"(exports$1, module) {
922
920
  let p = process || {}, argv = p.argv || [], env$1 = p.env || {};
923
921
  let isColorSupported = !(!!env$1.NO_COLOR || argv.includes("--no-color")) && (!!env$1.FORCE_COLOR || argv.includes("--color") || p.platform === "win32" || (p.stdout || {}).isTTY && env$1.TERM !== "dumb" || !!env$1.CI);
924
922
  let formatter = (open, close, replace = open) => (input) => {
@@ -981,10 +979,10 @@ var require_picocolors$2 = __commonJS$1({ "node_modules/.pnpm/picocolors@1.1.1/n
981
979
  bgWhiteBright: f("\x1B[107m", "\x1B[49m")
982
980
  };
983
981
  };
984
- module$1.exports = createColors();
985
- module$1.exports.createColors = createColors;
982
+ module.exports = createColors();
983
+ module.exports.createColors = createColors;
986
984
  } });
987
- var require_src = __commonJS$1({ "node_modules/.pnpm/sisteransi@1.0.5/node_modules/sisteransi/src/index.js"(exports$2, module$1) {
985
+ var require_src = __commonJS$1({ "node_modules/.pnpm/sisteransi@1.0.5/node_modules/sisteransi/src/index.js"(exports$1, module) {
988
986
  const ESC = "\x1B";
989
987
  const CSI = `${ESC}[`;
990
988
  const beep = "\x07";
@@ -1031,7 +1029,7 @@ else if (y > 0) ret += `${CSI}${y}B`;
1031
1029
  return clear;
1032
1030
  }
1033
1031
  };
1034
- module$1.exports = {
1032
+ module.exports = {
1035
1033
  cursor: cursor$1,
1036
1034
  scroll,
1037
1035
  erase: erase$1,
@@ -1099,7 +1097,7 @@ function createPrinter(...conditions) {
1099
1097
  });
1100
1098
  return printers;
1101
1099
  }
1102
- var import_picocolors$4 = __toESM(require_picocolors(), 1);
1100
+ var import_picocolors$4 = __toESM$1(require_picocolors(), 1);
1103
1101
  var colors = import_picocolors$4.default;
1104
1102
 
1105
1103
  //#endregion
@@ -1129,11 +1127,11 @@ function addEslintConfigPrettier(content) {
1129
1127
  else elements.push(...nodesToInsert);
1130
1128
  return generateCode();
1131
1129
  }
1132
- function addToDemoPage(content, path$2) {
1130
+ function addToDemoPage(content, path$1) {
1133
1131
  const { template, generateCode } = parseSvelte(content);
1134
- for (const node of template.ast.childNodes) if (node.type === "tag" && node.attribs["href"] === `/demo/${path$2}`) return content;
1132
+ for (const node of template.ast.childNodes) if (node.type === "tag" && node.attribs["href"] === `/demo/${path$1}`) return content;
1135
1133
  const newLine = template.source ? "\n" : "";
1136
- const src = template.source + `${newLine}<a href="/demo/${path$2}">${path$2}</a>`;
1134
+ const src = template.source + `${newLine}<a href="/demo/${path$1}">${path$1}</a>`;
1137
1135
  return generateCode({ template: src });
1138
1136
  }
1139
1137
  function getNodeTypesVersion() {
@@ -1503,8 +1501,8 @@ var eslint_default = defineAddon({
1503
1501
  sv.file(".vscode/settings.json", (content) => {
1504
1502
  if (!content) return content;
1505
1503
  const { data, generateCode } = parseJson$1(content);
1506
- const validate$1 = data["eslint.validate"];
1507
- if (validate$1 && !validate$1.includes("svelte")) validate$1.push("svelte");
1504
+ const validate = data["eslint.validate"];
1505
+ if (validate && !validate.includes("svelte")) validate.push("svelte");
1508
1506
  return generateCode();
1509
1507
  });
1510
1508
  sv.file("eslint.config.js", (content) => {
@@ -1928,8 +1926,8 @@ function guessIndent(code) {
1928
1926
  }, Infinity);
1929
1927
  return new Array(min + 1).join(" ");
1930
1928
  }
1931
- function getRelativePath(from$2, to) {
1932
- const fromParts = from$2.split(/[/\\]/);
1929
+ function getRelativePath(from$1, to) {
1930
+ const fromParts = from$1.split(/[/\\]/);
1933
1931
  const toParts = to.split(/[/\\]/);
1934
1932
  fromParts.pop();
1935
1933
  while (fromParts[0] === toParts[0]) {
@@ -1942,9 +1940,9 @@ function getRelativePath(from$2, to) {
1942
1940
  }
1943
1941
  return fromParts.concat(toParts).join("/");
1944
1942
  }
1945
- const toString$1 = Object.prototype.toString;
1943
+ const toString = Object.prototype.toString;
1946
1944
  function isObject(thing) {
1947
- return toString$1.call(thing) === "[object Object]";
1945
+ return toString.call(thing) === "[object Object]";
1948
1946
  }
1949
1947
  function getLocator(source) {
1950
1948
  const originalLines = source.split("\n");
@@ -3599,12 +3597,14 @@ var storybook_default = defineAddon({
3599
3597
  runsAfter("eslint");
3600
3598
  },
3601
3599
  run: async ({ sv }) => {
3602
- await sv.execute([
3600
+ const args = [
3603
3601
  "storybook@latest",
3604
3602
  "init",
3605
3603
  "--skip-install",
3606
3604
  "--no-dev"
3607
- ], "inherit");
3605
+ ];
3606
+ if (process$1.env.NODE_ENV?.toLowerCase() === "test") args.push("--yes");
3607
+ await sv.execute(args, "inherit");
3608
3608
  sv.devDependency(`@types/node`, getNodeTypesVersion());
3609
3609
  }
3610
3610
  });
@@ -3718,7 +3718,7 @@ var vitest_addon_default = defineAddon({
3718
3718
  options: {},
3719
3719
  run: ({ sv, typescript, kit }) => {
3720
3720
  const ext = typescript ? "ts" : "js";
3721
- sv.devDependency("vitest", "^3.0.0");
3721
+ sv.devDependency("vitest", "3.1.4");
3722
3722
  sv.devDependency("@testing-library/svelte", "^5.2.4");
3723
3723
  sv.devDependency("@testing-library/jest-dom", "^6.6.3");
3724
3724
  sv.devDependency("jsdom", "^26.0.0");
@@ -3879,7 +3879,7 @@ var UnsupportedError = class extends Error {
3879
3879
 
3880
3880
  //#endregion
3881
3881
  //#region packages/cli/utils/common.ts
3882
- var import_picocolors$3 = __toESM$1(require_picocolors$1(), 1);
3882
+ var import_picocolors$3 = __toESM(require_picocolors$1(), 1);
3883
3883
  const NO_PREFIX = "--no-";
3884
3884
  let options = [];
3885
3885
  function getLongFlag(flags) {
@@ -3952,2683 +3952,8 @@ function forwardExitCode(error) {
3952
3952
  else process$1.exit(1);
3953
3953
  }
3954
3954
 
3955
- //#endregion
3956
- //#region node_modules/.pnpm/fast-fifo@1.3.2/node_modules/fast-fifo/fixed-size.js
3957
- var require_fixed_size = __commonJS({ "node_modules/.pnpm/fast-fifo@1.3.2/node_modules/fast-fifo/fixed-size.js"(exports, module) {
3958
- module.exports = class FixedFIFO$1 {
3959
- constructor(hwm) {
3960
- if (!(hwm > 0) || (hwm - 1 & hwm) !== 0) throw new Error("Max size for a FixedFIFO should be a power of two");
3961
- this.buffer = new Array(hwm);
3962
- this.mask = hwm - 1;
3963
- this.top = 0;
3964
- this.btm = 0;
3965
- this.next = null;
3966
- }
3967
- clear() {
3968
- this.top = this.btm = 0;
3969
- this.next = null;
3970
- this.buffer.fill(undefined);
3971
- }
3972
- push(data) {
3973
- if (this.buffer[this.top] !== undefined) return false;
3974
- this.buffer[this.top] = data;
3975
- this.top = this.top + 1 & this.mask;
3976
- return true;
3977
- }
3978
- shift() {
3979
- const last = this.buffer[this.btm];
3980
- if (last === undefined) return undefined;
3981
- this.buffer[this.btm] = undefined;
3982
- this.btm = this.btm + 1 & this.mask;
3983
- return last;
3984
- }
3985
- peek() {
3986
- return this.buffer[this.btm];
3987
- }
3988
- isEmpty() {
3989
- return this.buffer[this.btm] === undefined;
3990
- }
3991
- };
3992
- } });
3993
-
3994
- //#endregion
3995
- //#region node_modules/.pnpm/fast-fifo@1.3.2/node_modules/fast-fifo/index.js
3996
- var require_fast_fifo = __commonJS({ "node_modules/.pnpm/fast-fifo@1.3.2/node_modules/fast-fifo/index.js"(exports, module) {
3997
- const FixedFIFO = require_fixed_size();
3998
- module.exports = class FastFIFO {
3999
- constructor(hwm) {
4000
- this.hwm = hwm || 16;
4001
- this.head = new FixedFIFO(this.hwm);
4002
- this.tail = this.head;
4003
- this.length = 0;
4004
- }
4005
- clear() {
4006
- this.head = this.tail;
4007
- this.head.clear();
4008
- this.length = 0;
4009
- }
4010
- push(val) {
4011
- this.length++;
4012
- if (!this.head.push(val)) {
4013
- const prev = this.head;
4014
- this.head = prev.next = new FixedFIFO(2 * this.head.buffer.length);
4015
- this.head.push(val);
4016
- }
4017
- }
4018
- shift() {
4019
- if (this.length !== 0) this.length--;
4020
- const val = this.tail.shift();
4021
- if (val === undefined && this.tail.next) {
4022
- const next = this.tail.next;
4023
- this.tail.next = null;
4024
- this.tail = next;
4025
- return this.tail.shift();
4026
- }
4027
- return val;
4028
- }
4029
- peek() {
4030
- const val = this.tail.peek();
4031
- if (val === undefined && this.tail.next) return this.tail.next.peek();
4032
- return val;
4033
- }
4034
- isEmpty() {
4035
- return this.length === 0;
4036
- }
4037
- };
4038
- } });
4039
-
4040
- //#endregion
4041
- //#region node_modules/.pnpm/b4a@1.6.7/node_modules/b4a/index.js
4042
- var require_b4a = __commonJS({ "node_modules/.pnpm/b4a@1.6.7/node_modules/b4a/index.js"(exports, module) {
4043
- function isBuffer(value) {
4044
- return Buffer.isBuffer(value) || value instanceof Uint8Array;
4045
- }
4046
- function isEncoding(encoding) {
4047
- return Buffer.isEncoding(encoding);
4048
- }
4049
- function alloc(size, fill$1, encoding) {
4050
- return Buffer.alloc(size, fill$1, encoding);
4051
- }
4052
- function allocUnsafe(size) {
4053
- return Buffer.allocUnsafe(size);
4054
- }
4055
- function allocUnsafeSlow(size) {
4056
- return Buffer.allocUnsafeSlow(size);
4057
- }
4058
- function byteLength(string$1, encoding) {
4059
- return Buffer.byteLength(string$1, encoding);
4060
- }
4061
- function compare(a, b) {
4062
- return Buffer.compare(a, b);
4063
- }
4064
- function concat(buffers, totalLength) {
4065
- return Buffer.concat(buffers, totalLength);
4066
- }
4067
- function copy(source, target, targetStart, start, end) {
4068
- return toBuffer(source).copy(target, targetStart, start, end);
4069
- }
4070
- function equals(a, b) {
4071
- return toBuffer(a).equals(b);
4072
- }
4073
- function fill(buffer, value, offset, end, encoding) {
4074
- return toBuffer(buffer).fill(value, offset, end, encoding);
4075
- }
4076
- function from$1(value, encodingOrOffset, length) {
4077
- return Buffer.from(value, encodingOrOffset, length);
4078
- }
4079
- function includes(buffer, value, byteOffset, encoding) {
4080
- return toBuffer(buffer).includes(value, byteOffset, encoding);
4081
- }
4082
- function indexOf$1(buffer, value, byfeOffset, encoding) {
4083
- return toBuffer(buffer).indexOf(value, byfeOffset, encoding);
4084
- }
4085
- function lastIndexOf(buffer, value, byteOffset, encoding) {
4086
- return toBuffer(buffer).lastIndexOf(value, byteOffset, encoding);
4087
- }
4088
- function swap16(buffer) {
4089
- return toBuffer(buffer).swap16();
4090
- }
4091
- function swap32(buffer) {
4092
- return toBuffer(buffer).swap32();
4093
- }
4094
- function swap64(buffer) {
4095
- return toBuffer(buffer).swap64();
4096
- }
4097
- function toBuffer(buffer) {
4098
- if (Buffer.isBuffer(buffer)) return buffer;
4099
- return Buffer.from(buffer.buffer, buffer.byteOffset, buffer.byteLength);
4100
- }
4101
- function toString(buffer, encoding, start, end) {
4102
- return toBuffer(buffer).toString(encoding, start, end);
4103
- }
4104
- function write(buffer, string$1, offset, length, encoding) {
4105
- return toBuffer(buffer).write(string$1, offset, length, encoding);
4106
- }
4107
- function writeDoubleLE(buffer, value, offset) {
4108
- return toBuffer(buffer).writeDoubleLE(value, offset);
4109
- }
4110
- function writeFloatLE(buffer, value, offset) {
4111
- return toBuffer(buffer).writeFloatLE(value, offset);
4112
- }
4113
- function writeUInt32LE(buffer, value, offset) {
4114
- return toBuffer(buffer).writeUInt32LE(value, offset);
4115
- }
4116
- function writeInt32LE(buffer, value, offset) {
4117
- return toBuffer(buffer).writeInt32LE(value, offset);
4118
- }
4119
- function readDoubleLE(buffer, offset) {
4120
- return toBuffer(buffer).readDoubleLE(offset);
4121
- }
4122
- function readFloatLE(buffer, offset) {
4123
- return toBuffer(buffer).readFloatLE(offset);
4124
- }
4125
- function readUInt32LE(buffer, offset) {
4126
- return toBuffer(buffer).readUInt32LE(offset);
4127
- }
4128
- function readInt32LE(buffer, offset) {
4129
- return toBuffer(buffer).readInt32LE(offset);
4130
- }
4131
- function writeDoubleBE(buffer, value, offset) {
4132
- return toBuffer(buffer).writeDoubleBE(value, offset);
4133
- }
4134
- function writeFloatBE(buffer, value, offset) {
4135
- return toBuffer(buffer).writeFloatBE(value, offset);
4136
- }
4137
- function writeUInt32BE(buffer, value, offset) {
4138
- return toBuffer(buffer).writeUInt32BE(value, offset);
4139
- }
4140
- function writeInt32BE(buffer, value, offset) {
4141
- return toBuffer(buffer).writeInt32BE(value, offset);
4142
- }
4143
- function readDoubleBE(buffer, offset) {
4144
- return toBuffer(buffer).readDoubleBE(offset);
4145
- }
4146
- function readFloatBE(buffer, offset) {
4147
- return toBuffer(buffer).readFloatBE(offset);
4148
- }
4149
- function readUInt32BE(buffer, offset) {
4150
- return toBuffer(buffer).readUInt32BE(offset);
4151
- }
4152
- function readInt32BE(buffer, offset) {
4153
- return toBuffer(buffer).readInt32BE(offset);
4154
- }
4155
- module.exports = {
4156
- isBuffer,
4157
- isEncoding,
4158
- alloc,
4159
- allocUnsafe,
4160
- allocUnsafeSlow,
4161
- byteLength,
4162
- compare,
4163
- concat,
4164
- copy,
4165
- equals,
4166
- fill,
4167
- from: from$1,
4168
- includes,
4169
- indexOf: indexOf$1,
4170
- lastIndexOf,
4171
- swap16,
4172
- swap32,
4173
- swap64,
4174
- toBuffer,
4175
- toString,
4176
- write,
4177
- writeDoubleLE,
4178
- writeFloatLE,
4179
- writeUInt32LE,
4180
- writeInt32LE,
4181
- readDoubleLE,
4182
- readFloatLE,
4183
- readUInt32LE,
4184
- readInt32LE,
4185
- writeDoubleBE,
4186
- writeFloatBE,
4187
- writeUInt32BE,
4188
- writeInt32BE,
4189
- readDoubleBE,
4190
- readFloatBE,
4191
- readUInt32BE,
4192
- readInt32BE
4193
- };
4194
- } });
4195
-
4196
- //#endregion
4197
- //#region node_modules/.pnpm/text-decoder@1.2.3/node_modules/text-decoder/lib/pass-through-decoder.js
4198
- var require_pass_through_decoder = __commonJS({ "node_modules/.pnpm/text-decoder@1.2.3/node_modules/text-decoder/lib/pass-through-decoder.js"(exports, module) {
4199
- const b4a$4 = require_b4a();
4200
- module.exports = class PassThroughDecoder$1 {
4201
- constructor(encoding) {
4202
- this.encoding = encoding;
4203
- }
4204
- get remaining() {
4205
- return 0;
4206
- }
4207
- decode(tail) {
4208
- return b4a$4.toString(tail, this.encoding);
4209
- }
4210
- flush() {
4211
- return "";
4212
- }
4213
- };
4214
- } });
4215
-
4216
- //#endregion
4217
- //#region node_modules/.pnpm/text-decoder@1.2.3/node_modules/text-decoder/lib/utf8-decoder.js
4218
- var require_utf8_decoder = __commonJS({ "node_modules/.pnpm/text-decoder@1.2.3/node_modules/text-decoder/lib/utf8-decoder.js"(exports, module) {
4219
- const b4a$3 = require_b4a();
4220
- /**
4221
- * https://encoding.spec.whatwg.org/#utf-8-decoder
4222
- */
4223
- module.exports = class UTF8Decoder$1 {
4224
- constructor() {
4225
- this.codePoint = 0;
4226
- this.bytesSeen = 0;
4227
- this.bytesNeeded = 0;
4228
- this.lowerBoundary = 128;
4229
- this.upperBoundary = 191;
4230
- }
4231
- get remaining() {
4232
- return this.bytesSeen;
4233
- }
4234
- decode(data) {
4235
- if (this.bytesNeeded === 0) {
4236
- let isBoundary = true;
4237
- for (let i = Math.max(0, data.byteLength - 4), n$1 = data.byteLength; i < n$1 && isBoundary; i++) isBoundary = data[i] <= 127;
4238
- if (isBoundary) return b4a$3.toString(data, "utf8");
4239
- }
4240
- let result = "";
4241
- for (let i = 0, n$1 = data.byteLength; i < n$1; i++) {
4242
- const byte = data[i];
4243
- if (this.bytesNeeded === 0) {
4244
- if (byte <= 127) result += String.fromCharCode(byte);
4245
- else {
4246
- this.bytesSeen = 1;
4247
- if (byte >= 194 && byte <= 223) {
4248
- this.bytesNeeded = 2;
4249
- this.codePoint = byte & 31;
4250
- } else if (byte >= 224 && byte <= 239) {
4251
- if (byte === 224) this.lowerBoundary = 160;
4252
- else if (byte === 237) this.upperBoundary = 159;
4253
- this.bytesNeeded = 3;
4254
- this.codePoint = byte & 15;
4255
- } else if (byte >= 240 && byte <= 244) {
4256
- if (byte === 240) this.lowerBoundary = 144;
4257
- if (byte === 244) this.upperBoundary = 143;
4258
- this.bytesNeeded = 4;
4259
- this.codePoint = byte & 7;
4260
- } else result += "�";
4261
- }
4262
- continue;
4263
- }
4264
- if (byte < this.lowerBoundary || byte > this.upperBoundary) {
4265
- this.codePoint = 0;
4266
- this.bytesNeeded = 0;
4267
- this.bytesSeen = 0;
4268
- this.lowerBoundary = 128;
4269
- this.upperBoundary = 191;
4270
- result += "�";
4271
- continue;
4272
- }
4273
- this.lowerBoundary = 128;
4274
- this.upperBoundary = 191;
4275
- this.codePoint = this.codePoint << 6 | byte & 63;
4276
- this.bytesSeen++;
4277
- if (this.bytesSeen !== this.bytesNeeded) continue;
4278
- result += String.fromCodePoint(this.codePoint);
4279
- this.codePoint = 0;
4280
- this.bytesNeeded = 0;
4281
- this.bytesSeen = 0;
4282
- }
4283
- return result;
4284
- }
4285
- flush() {
4286
- const result = this.bytesNeeded > 0 ? "�" : "";
4287
- this.codePoint = 0;
4288
- this.bytesNeeded = 0;
4289
- this.bytesSeen = 0;
4290
- this.lowerBoundary = 128;
4291
- this.upperBoundary = 191;
4292
- return result;
4293
- }
4294
- };
4295
- } });
4296
-
4297
- //#endregion
4298
- //#region node_modules/.pnpm/text-decoder@1.2.3/node_modules/text-decoder/index.js
4299
- var require_text_decoder = __commonJS({ "node_modules/.pnpm/text-decoder@1.2.3/node_modules/text-decoder/index.js"(exports, module) {
4300
- const PassThroughDecoder = require_pass_through_decoder();
4301
- const UTF8Decoder = require_utf8_decoder();
4302
- module.exports = class TextDecoder$2 {
4303
- constructor(encoding = "utf8") {
4304
- this.encoding = normalizeEncoding(encoding);
4305
- switch (this.encoding) {
4306
- case "utf8":
4307
- this.decoder = new UTF8Decoder();
4308
- break;
4309
- case "utf16le":
4310
- case "base64": throw new Error("Unsupported encoding: " + this.encoding);
4311
- default: this.decoder = new PassThroughDecoder(this.encoding);
4312
- }
4313
- }
4314
- get remaining() {
4315
- return this.decoder.remaining;
4316
- }
4317
- push(data) {
4318
- if (typeof data === "string") return data;
4319
- return this.decoder.decode(data);
4320
- }
4321
- write(data) {
4322
- return this.push(data);
4323
- }
4324
- end(data) {
4325
- let result = "";
4326
- if (data) result = this.push(data);
4327
- result += this.decoder.flush();
4328
- return result;
4329
- }
4330
- };
4331
- function normalizeEncoding(encoding) {
4332
- encoding = encoding.toLowerCase();
4333
- switch (encoding) {
4334
- case "utf8":
4335
- case "utf-8": return "utf8";
4336
- case "ucs2":
4337
- case "ucs-2":
4338
- case "utf16le":
4339
- case "utf-16le": return "utf16le";
4340
- case "latin1":
4341
- case "binary": return "latin1";
4342
- case "base64":
4343
- case "ascii":
4344
- case "hex": return encoding;
4345
- default: throw new Error("Unknown encoding: " + encoding);
4346
- }
4347
- }
4348
- } });
4349
-
4350
- //#endregion
4351
- //#region node_modules/.pnpm/streamx@2.22.0/node_modules/streamx/index.js
4352
- var require_streamx = __commonJS({ "node_modules/.pnpm/streamx@2.22.0/node_modules/streamx/index.js"(exports, module) {
4353
- const { EventEmitter } = __require("events");
4354
- const STREAM_DESTROYED = new Error("Stream was destroyed");
4355
- const PREMATURE_CLOSE = new Error("Premature close");
4356
- const FIFO$1 = require_fast_fifo();
4357
- const TextDecoder$1 = require_text_decoder();
4358
- const MAX = 536870911;
4359
- const OPENING = 1;
4360
- const PREDESTROYING = 2;
4361
- const DESTROYING = 4;
4362
- const DESTROYED = 8;
4363
- const NOT_OPENING = MAX ^ OPENING;
4364
- const NOT_PREDESTROYING = MAX ^ PREDESTROYING;
4365
- const READ_ACTIVE = 16;
4366
- const READ_UPDATING = 32;
4367
- const READ_PRIMARY = 64;
4368
- const READ_QUEUED = 128;
4369
- const READ_RESUMED = 256;
4370
- const READ_PIPE_DRAINED = 512;
4371
- const READ_ENDING = 1024;
4372
- const READ_EMIT_DATA = 2048;
4373
- const READ_EMIT_READABLE = 4096;
4374
- const READ_EMITTED_READABLE = 8192;
4375
- const READ_DONE = 16384;
4376
- const READ_NEXT_TICK = 32768;
4377
- const READ_NEEDS_PUSH = 65536;
4378
- const READ_READ_AHEAD = 131072;
4379
- const READ_FLOWING = READ_RESUMED | READ_PIPE_DRAINED;
4380
- const READ_ACTIVE_AND_NEEDS_PUSH = READ_ACTIVE | READ_NEEDS_PUSH;
4381
- const READ_PRIMARY_AND_ACTIVE = READ_PRIMARY | READ_ACTIVE;
4382
- const READ_EMIT_READABLE_AND_QUEUED = READ_EMIT_READABLE | READ_QUEUED;
4383
- const READ_RESUMED_READ_AHEAD = READ_RESUMED | READ_READ_AHEAD;
4384
- const READ_NOT_ACTIVE = MAX ^ READ_ACTIVE;
4385
- const READ_NON_PRIMARY = MAX ^ READ_PRIMARY;
4386
- const READ_NON_PRIMARY_AND_PUSHED = MAX ^ (READ_PRIMARY | READ_NEEDS_PUSH);
4387
- const READ_PUSHED = MAX ^ READ_NEEDS_PUSH;
4388
- const READ_PAUSED = MAX ^ READ_RESUMED;
4389
- const READ_NOT_QUEUED = MAX ^ (READ_QUEUED | READ_EMITTED_READABLE);
4390
- const READ_NOT_ENDING = MAX ^ READ_ENDING;
4391
- const READ_PIPE_NOT_DRAINED = MAX ^ READ_FLOWING;
4392
- const READ_NOT_NEXT_TICK = MAX ^ READ_NEXT_TICK;
4393
- const READ_NOT_UPDATING = MAX ^ READ_UPDATING;
4394
- const READ_NO_READ_AHEAD = MAX ^ READ_READ_AHEAD;
4395
- const READ_PAUSED_NO_READ_AHEAD = MAX ^ READ_RESUMED_READ_AHEAD;
4396
- const WRITE_ACTIVE = 262144;
4397
- const WRITE_UPDATING = 524288;
4398
- const WRITE_PRIMARY = 1048576;
4399
- const WRITE_QUEUED = 2097152;
4400
- const WRITE_UNDRAINED = 4194304;
4401
- const WRITE_DONE = 8388608;
4402
- const WRITE_EMIT_DRAIN = 16777216;
4403
- const WRITE_NEXT_TICK = 33554432;
4404
- const WRITE_WRITING = 67108864;
4405
- const WRITE_FINISHING = 134217728;
4406
- const WRITE_CORKED = 268435456;
4407
- const WRITE_NOT_ACTIVE = MAX ^ (WRITE_ACTIVE | WRITE_WRITING);
4408
- const WRITE_NON_PRIMARY = MAX ^ WRITE_PRIMARY;
4409
- const WRITE_NOT_FINISHING = MAX ^ (WRITE_ACTIVE | WRITE_FINISHING);
4410
- const WRITE_DRAINED = MAX ^ WRITE_UNDRAINED;
4411
- const WRITE_NOT_QUEUED = MAX ^ WRITE_QUEUED;
4412
- const WRITE_NOT_NEXT_TICK = MAX ^ WRITE_NEXT_TICK;
4413
- const WRITE_NOT_UPDATING = MAX ^ WRITE_UPDATING;
4414
- const WRITE_NOT_CORKED = MAX ^ WRITE_CORKED;
4415
- const ACTIVE = READ_ACTIVE | WRITE_ACTIVE;
4416
- const NOT_ACTIVE = MAX ^ ACTIVE;
4417
- const DONE = READ_DONE | WRITE_DONE;
4418
- const DESTROY_STATUS = DESTROYING | DESTROYED | PREDESTROYING;
4419
- const OPEN_STATUS = DESTROY_STATUS | OPENING;
4420
- const AUTO_DESTROY = DESTROY_STATUS | DONE;
4421
- const NON_PRIMARY = WRITE_NON_PRIMARY & READ_NON_PRIMARY;
4422
- const ACTIVE_OR_TICKING = WRITE_NEXT_TICK | READ_NEXT_TICK;
4423
- const TICKING = ACTIVE_OR_TICKING & NOT_ACTIVE;
4424
- const IS_OPENING = OPEN_STATUS | TICKING;
4425
- const READ_PRIMARY_STATUS = OPEN_STATUS | READ_ENDING | READ_DONE;
4426
- const READ_STATUS = OPEN_STATUS | READ_DONE | READ_QUEUED;
4427
- const READ_ENDING_STATUS = OPEN_STATUS | READ_ENDING | READ_QUEUED;
4428
- const READ_READABLE_STATUS = OPEN_STATUS | READ_EMIT_READABLE | READ_QUEUED | READ_EMITTED_READABLE;
4429
- const SHOULD_NOT_READ = OPEN_STATUS | READ_ACTIVE | READ_ENDING | READ_DONE | READ_NEEDS_PUSH | READ_READ_AHEAD;
4430
- const READ_BACKPRESSURE_STATUS = DESTROY_STATUS | READ_ENDING | READ_DONE;
4431
- const READ_UPDATE_SYNC_STATUS = READ_UPDATING | OPEN_STATUS | READ_NEXT_TICK | READ_PRIMARY;
4432
- const READ_NEXT_TICK_OR_OPENING = READ_NEXT_TICK | OPENING;
4433
- const WRITE_PRIMARY_STATUS = OPEN_STATUS | WRITE_FINISHING | WRITE_DONE;
4434
- const WRITE_QUEUED_AND_UNDRAINED = WRITE_QUEUED | WRITE_UNDRAINED;
4435
- const WRITE_QUEUED_AND_ACTIVE = WRITE_QUEUED | WRITE_ACTIVE;
4436
- const WRITE_DRAIN_STATUS = WRITE_QUEUED | WRITE_UNDRAINED | OPEN_STATUS | WRITE_ACTIVE;
4437
- const WRITE_STATUS = OPEN_STATUS | WRITE_ACTIVE | WRITE_QUEUED | WRITE_CORKED;
4438
- const WRITE_PRIMARY_AND_ACTIVE = WRITE_PRIMARY | WRITE_ACTIVE;
4439
- const WRITE_ACTIVE_AND_WRITING = WRITE_ACTIVE | WRITE_WRITING;
4440
- const WRITE_FINISHING_STATUS = OPEN_STATUS | WRITE_FINISHING | WRITE_QUEUED_AND_ACTIVE | WRITE_DONE;
4441
- const WRITE_BACKPRESSURE_STATUS = WRITE_UNDRAINED | DESTROY_STATUS | WRITE_FINISHING | WRITE_DONE;
4442
- const WRITE_UPDATE_SYNC_STATUS = WRITE_UPDATING | OPEN_STATUS | WRITE_NEXT_TICK | WRITE_PRIMARY;
4443
- const WRITE_DROP_DATA = WRITE_FINISHING | WRITE_DONE | DESTROY_STATUS;
4444
- const asyncIterator = Symbol.asyncIterator || Symbol("asyncIterator");
4445
- var WritableState = class {
4446
- constructor(stream, { highWaterMark = 16384, map = null, mapWritable: mapWritable$1, byteLength: byteLength$1, byteLengthWritable } = {}) {
4447
- this.stream = stream;
4448
- this.queue = new FIFO$1();
4449
- this.highWaterMark = highWaterMark;
4450
- this.buffered = 0;
4451
- this.error = null;
4452
- this.pipeline = null;
4453
- this.drains = null;
4454
- this.byteLength = byteLengthWritable || byteLength$1 || defaultByteLength;
4455
- this.map = mapWritable$1 || map;
4456
- this.afterWrite = afterWrite.bind(this);
4457
- this.afterUpdateNextTick = updateWriteNT.bind(this);
4458
- }
4459
- get ended() {
4460
- return (this.stream._duplexState & WRITE_DONE) !== 0;
4461
- }
4462
- push(data) {
4463
- if ((this.stream._duplexState & WRITE_DROP_DATA) !== 0) return false;
4464
- if (this.map !== null) data = this.map(data);
4465
- this.buffered += this.byteLength(data);
4466
- this.queue.push(data);
4467
- if (this.buffered < this.highWaterMark) {
4468
- this.stream._duplexState |= WRITE_QUEUED;
4469
- return true;
4470
- }
4471
- this.stream._duplexState |= WRITE_QUEUED_AND_UNDRAINED;
4472
- return false;
4473
- }
4474
- shift() {
4475
- const data = this.queue.shift();
4476
- this.buffered -= this.byteLength(data);
4477
- if (this.buffered === 0) this.stream._duplexState &= WRITE_NOT_QUEUED;
4478
- return data;
4479
- }
4480
- end(data) {
4481
- if (typeof data === "function") this.stream.once("finish", data);
4482
- else if (data !== undefined && data !== null) this.push(data);
4483
- this.stream._duplexState = (this.stream._duplexState | WRITE_FINISHING) & WRITE_NON_PRIMARY;
4484
- }
4485
- autoBatch(data, cb) {
4486
- const buffer = [];
4487
- const stream = this.stream;
4488
- buffer.push(data);
4489
- while ((stream._duplexState & WRITE_STATUS) === WRITE_QUEUED_AND_ACTIVE) buffer.push(stream._writableState.shift());
4490
- if ((stream._duplexState & OPEN_STATUS) !== 0) return cb(null);
4491
- stream._writev(buffer, cb);
4492
- }
4493
- update() {
4494
- const stream = this.stream;
4495
- stream._duplexState |= WRITE_UPDATING;
4496
- do {
4497
- while ((stream._duplexState & WRITE_STATUS) === WRITE_QUEUED) {
4498
- const data = this.shift();
4499
- stream._duplexState |= WRITE_ACTIVE_AND_WRITING;
4500
- stream._write(data, this.afterWrite);
4501
- }
4502
- if ((stream._duplexState & WRITE_PRIMARY_AND_ACTIVE) === 0) this.updateNonPrimary();
4503
- } while (this.continueUpdate() === true);
4504
- stream._duplexState &= WRITE_NOT_UPDATING;
4505
- }
4506
- updateNonPrimary() {
4507
- const stream = this.stream;
4508
- if ((stream._duplexState & WRITE_FINISHING_STATUS) === WRITE_FINISHING) {
4509
- stream._duplexState = stream._duplexState | WRITE_ACTIVE;
4510
- stream._final(afterFinal.bind(this));
4511
- return;
4512
- }
4513
- if ((stream._duplexState & DESTROY_STATUS) === DESTROYING) {
4514
- if ((stream._duplexState & ACTIVE_OR_TICKING) === 0) {
4515
- stream._duplexState |= ACTIVE;
4516
- stream._destroy(afterDestroy.bind(this));
4517
- }
4518
- return;
4519
- }
4520
- if ((stream._duplexState & IS_OPENING) === OPENING) {
4521
- stream._duplexState = (stream._duplexState | ACTIVE) & NOT_OPENING;
4522
- stream._open(afterOpen.bind(this));
4523
- }
4524
- }
4525
- continueUpdate() {
4526
- if ((this.stream._duplexState & WRITE_NEXT_TICK) === 0) return false;
4527
- this.stream._duplexState &= WRITE_NOT_NEXT_TICK;
4528
- return true;
4529
- }
4530
- updateCallback() {
4531
- if ((this.stream._duplexState & WRITE_UPDATE_SYNC_STATUS) === WRITE_PRIMARY) this.update();
4532
- else this.updateNextTick();
4533
- }
4534
- updateNextTick() {
4535
- if ((this.stream._duplexState & WRITE_NEXT_TICK) !== 0) return;
4536
- this.stream._duplexState |= WRITE_NEXT_TICK;
4537
- if ((this.stream._duplexState & WRITE_UPDATING) === 0) queueMicrotask(this.afterUpdateNextTick);
4538
- }
4539
- };
4540
- var ReadableState = class {
4541
- constructor(stream, { highWaterMark = 16384, map = null, mapReadable, byteLength: byteLength$1, byteLengthReadable } = {}) {
4542
- this.stream = stream;
4543
- this.queue = new FIFO$1();
4544
- this.highWaterMark = highWaterMark === 0 ? 1 : highWaterMark;
4545
- this.buffered = 0;
4546
- this.readAhead = highWaterMark > 0;
4547
- this.error = null;
4548
- this.pipeline = null;
4549
- this.byteLength = byteLengthReadable || byteLength$1 || defaultByteLength;
4550
- this.map = mapReadable || map;
4551
- this.pipeTo = null;
4552
- this.afterRead = afterRead.bind(this);
4553
- this.afterUpdateNextTick = updateReadNT.bind(this);
4554
- }
4555
- get ended() {
4556
- return (this.stream._duplexState & READ_DONE) !== 0;
4557
- }
4558
- pipe(pipeTo, cb) {
4559
- if (this.pipeTo !== null) throw new Error("Can only pipe to one destination");
4560
- if (typeof cb !== "function") cb = null;
4561
- this.stream._duplexState |= READ_PIPE_DRAINED;
4562
- this.pipeTo = pipeTo;
4563
- this.pipeline = new Pipeline(this.stream, pipeTo, cb);
4564
- if (cb) this.stream.on("error", noop$5);
4565
- if (isStreamx(pipeTo)) {
4566
- pipeTo._writableState.pipeline = this.pipeline;
4567
- if (cb) pipeTo.on("error", noop$5);
4568
- pipeTo.on("finish", this.pipeline.finished.bind(this.pipeline));
4569
- } else {
4570
- const onerror = this.pipeline.done.bind(this.pipeline, pipeTo);
4571
- const onclose = this.pipeline.done.bind(this.pipeline, pipeTo, null);
4572
- pipeTo.on("error", onerror);
4573
- pipeTo.on("close", onclose);
4574
- pipeTo.on("finish", this.pipeline.finished.bind(this.pipeline));
4575
- }
4576
- pipeTo.on("drain", afterDrain.bind(this));
4577
- this.stream.emit("piping", pipeTo);
4578
- pipeTo.emit("pipe", this.stream);
4579
- }
4580
- push(data) {
4581
- const stream = this.stream;
4582
- if (data === null) {
4583
- this.highWaterMark = 0;
4584
- stream._duplexState = (stream._duplexState | READ_ENDING) & READ_NON_PRIMARY_AND_PUSHED;
4585
- return false;
4586
- }
4587
- if (this.map !== null) {
4588
- data = this.map(data);
4589
- if (data === null) {
4590
- stream._duplexState &= READ_PUSHED;
4591
- return this.buffered < this.highWaterMark;
4592
- }
4593
- }
4594
- this.buffered += this.byteLength(data);
4595
- this.queue.push(data);
4596
- stream._duplexState = (stream._duplexState | READ_QUEUED) & READ_PUSHED;
4597
- return this.buffered < this.highWaterMark;
4598
- }
4599
- shift() {
4600
- const data = this.queue.shift();
4601
- this.buffered -= this.byteLength(data);
4602
- if (this.buffered === 0) this.stream._duplexState &= READ_NOT_QUEUED;
4603
- return data;
4604
- }
4605
- unshift(data) {
4606
- const pending = [this.map !== null ? this.map(data) : data];
4607
- while (this.buffered > 0) pending.push(this.shift());
4608
- for (let i = 0; i < pending.length - 1; i++) {
4609
- const data$1 = pending[i];
4610
- this.buffered += this.byteLength(data$1);
4611
- this.queue.push(data$1);
4612
- }
4613
- this.push(pending[pending.length - 1]);
4614
- }
4615
- read() {
4616
- const stream = this.stream;
4617
- if ((stream._duplexState & READ_STATUS) === READ_QUEUED) {
4618
- const data = this.shift();
4619
- if (this.pipeTo !== null && this.pipeTo.write(data) === false) stream._duplexState &= READ_PIPE_NOT_DRAINED;
4620
- if ((stream._duplexState & READ_EMIT_DATA) !== 0) stream.emit("data", data);
4621
- return data;
4622
- }
4623
- if (this.readAhead === false) {
4624
- stream._duplexState |= READ_READ_AHEAD;
4625
- this.updateNextTick();
4626
- }
4627
- return null;
4628
- }
4629
- drain() {
4630
- const stream = this.stream;
4631
- while ((stream._duplexState & READ_STATUS) === READ_QUEUED && (stream._duplexState & READ_FLOWING) !== 0) {
4632
- const data = this.shift();
4633
- if (this.pipeTo !== null && this.pipeTo.write(data) === false) stream._duplexState &= READ_PIPE_NOT_DRAINED;
4634
- if ((stream._duplexState & READ_EMIT_DATA) !== 0) stream.emit("data", data);
4635
- }
4636
- }
4637
- update() {
4638
- const stream = this.stream;
4639
- stream._duplexState |= READ_UPDATING;
4640
- do {
4641
- this.drain();
4642
- while (this.buffered < this.highWaterMark && (stream._duplexState & SHOULD_NOT_READ) === READ_READ_AHEAD) {
4643
- stream._duplexState |= READ_ACTIVE_AND_NEEDS_PUSH;
4644
- stream._read(this.afterRead);
4645
- this.drain();
4646
- }
4647
- if ((stream._duplexState & READ_READABLE_STATUS) === READ_EMIT_READABLE_AND_QUEUED) {
4648
- stream._duplexState |= READ_EMITTED_READABLE;
4649
- stream.emit("readable");
4650
- }
4651
- if ((stream._duplexState & READ_PRIMARY_AND_ACTIVE) === 0) this.updateNonPrimary();
4652
- } while (this.continueUpdate() === true);
4653
- stream._duplexState &= READ_NOT_UPDATING;
4654
- }
4655
- updateNonPrimary() {
4656
- const stream = this.stream;
4657
- if ((stream._duplexState & READ_ENDING_STATUS) === READ_ENDING) {
4658
- stream._duplexState = (stream._duplexState | READ_DONE) & READ_NOT_ENDING;
4659
- stream.emit("end");
4660
- if ((stream._duplexState & AUTO_DESTROY) === DONE) stream._duplexState |= DESTROYING;
4661
- if (this.pipeTo !== null) this.pipeTo.end();
4662
- }
4663
- if ((stream._duplexState & DESTROY_STATUS) === DESTROYING) {
4664
- if ((stream._duplexState & ACTIVE_OR_TICKING) === 0) {
4665
- stream._duplexState |= ACTIVE;
4666
- stream._destroy(afterDestroy.bind(this));
4667
- }
4668
- return;
4669
- }
4670
- if ((stream._duplexState & IS_OPENING) === OPENING) {
4671
- stream._duplexState = (stream._duplexState | ACTIVE) & NOT_OPENING;
4672
- stream._open(afterOpen.bind(this));
4673
- }
4674
- }
4675
- continueUpdate() {
4676
- if ((this.stream._duplexState & READ_NEXT_TICK) === 0) return false;
4677
- this.stream._duplexState &= READ_NOT_NEXT_TICK;
4678
- return true;
4679
- }
4680
- updateCallback() {
4681
- if ((this.stream._duplexState & READ_UPDATE_SYNC_STATUS) === READ_PRIMARY) this.update();
4682
- else this.updateNextTick();
4683
- }
4684
- updateNextTickIfOpen() {
4685
- if ((this.stream._duplexState & READ_NEXT_TICK_OR_OPENING) !== 0) return;
4686
- this.stream._duplexState |= READ_NEXT_TICK;
4687
- if ((this.stream._duplexState & READ_UPDATING) === 0) queueMicrotask(this.afterUpdateNextTick);
4688
- }
4689
- updateNextTick() {
4690
- if ((this.stream._duplexState & READ_NEXT_TICK) !== 0) return;
4691
- this.stream._duplexState |= READ_NEXT_TICK;
4692
- if ((this.stream._duplexState & READ_UPDATING) === 0) queueMicrotask(this.afterUpdateNextTick);
4693
- }
4694
- };
4695
- var TransformState = class {
4696
- constructor(stream) {
4697
- this.data = null;
4698
- this.afterTransform = afterTransform.bind(stream);
4699
- this.afterFinal = null;
4700
- }
4701
- };
4702
- var Pipeline = class {
4703
- constructor(src, dst, cb) {
4704
- this.from = src;
4705
- this.to = dst;
4706
- this.afterPipe = cb;
4707
- this.error = null;
4708
- this.pipeToFinished = false;
4709
- }
4710
- finished() {
4711
- this.pipeToFinished = true;
4712
- }
4713
- done(stream, err) {
4714
- if (err) this.error = err;
4715
- if (stream === this.to) {
4716
- this.to = null;
4717
- if (this.from !== null) {
4718
- if ((this.from._duplexState & READ_DONE) === 0 || !this.pipeToFinished) this.from.destroy(this.error || new Error("Writable stream closed prematurely"));
4719
- return;
4720
- }
4721
- }
4722
- if (stream === this.from) {
4723
- this.from = null;
4724
- if (this.to !== null) {
4725
- if ((stream._duplexState & READ_DONE) === 0) this.to.destroy(this.error || new Error("Readable stream closed before ending"));
4726
- return;
4727
- }
4728
- }
4729
- if (this.afterPipe !== null) this.afterPipe(this.error);
4730
- this.to = this.from = this.afterPipe = null;
4731
- }
4732
- };
4733
- function afterDrain() {
4734
- this.stream._duplexState |= READ_PIPE_DRAINED;
4735
- this.updateCallback();
4736
- }
4737
- function afterFinal(err) {
4738
- const stream = this.stream;
4739
- if (err) stream.destroy(err);
4740
- if ((stream._duplexState & DESTROY_STATUS) === 0) {
4741
- stream._duplexState |= WRITE_DONE;
4742
- stream.emit("finish");
4743
- }
4744
- if ((stream._duplexState & AUTO_DESTROY) === DONE) stream._duplexState |= DESTROYING;
4745
- stream._duplexState &= WRITE_NOT_FINISHING;
4746
- if ((stream._duplexState & WRITE_UPDATING) === 0) this.update();
4747
- else this.updateNextTick();
4748
- }
4749
- function afterDestroy(err) {
4750
- const stream = this.stream;
4751
- if (!err && this.error !== STREAM_DESTROYED) err = this.error;
4752
- if (err) stream.emit("error", err);
4753
- stream._duplexState |= DESTROYED;
4754
- stream.emit("close");
4755
- const rs = stream._readableState;
4756
- const ws = stream._writableState;
4757
- if (rs !== null && rs.pipeline !== null) rs.pipeline.done(stream, err);
4758
- if (ws !== null) {
4759
- while (ws.drains !== null && ws.drains.length > 0) ws.drains.shift().resolve(false);
4760
- if (ws.pipeline !== null) ws.pipeline.done(stream, err);
4761
- }
4762
- }
4763
- function afterWrite(err) {
4764
- const stream = this.stream;
4765
- if (err) stream.destroy(err);
4766
- stream._duplexState &= WRITE_NOT_ACTIVE;
4767
- if (this.drains !== null) tickDrains(this.drains);
4768
- if ((stream._duplexState & WRITE_DRAIN_STATUS) === WRITE_UNDRAINED) {
4769
- stream._duplexState &= WRITE_DRAINED;
4770
- if ((stream._duplexState & WRITE_EMIT_DRAIN) === WRITE_EMIT_DRAIN) stream.emit("drain");
4771
- }
4772
- this.updateCallback();
4773
- }
4774
- function afterRead(err) {
4775
- if (err) this.stream.destroy(err);
4776
- this.stream._duplexState &= READ_NOT_ACTIVE;
4777
- if (this.readAhead === false && (this.stream._duplexState & READ_RESUMED) === 0) this.stream._duplexState &= READ_NO_READ_AHEAD;
4778
- this.updateCallback();
4779
- }
4780
- function updateReadNT() {
4781
- if ((this.stream._duplexState & READ_UPDATING) === 0) {
4782
- this.stream._duplexState &= READ_NOT_NEXT_TICK;
4783
- this.update();
4784
- }
4785
- }
4786
- function updateWriteNT() {
4787
- if ((this.stream._duplexState & WRITE_UPDATING) === 0) {
4788
- this.stream._duplexState &= WRITE_NOT_NEXT_TICK;
4789
- this.update();
4790
- }
4791
- }
4792
- function tickDrains(drains) {
4793
- for (let i = 0; i < drains.length; i++) if (--drains[i].writes === 0) {
4794
- drains.shift().resolve(true);
4795
- i--;
4796
- }
4797
- }
4798
- function afterOpen(err) {
4799
- const stream = this.stream;
4800
- if (err) stream.destroy(err);
4801
- if ((stream._duplexState & DESTROYING) === 0) {
4802
- if ((stream._duplexState & READ_PRIMARY_STATUS) === 0) stream._duplexState |= READ_PRIMARY;
4803
- if ((stream._duplexState & WRITE_PRIMARY_STATUS) === 0) stream._duplexState |= WRITE_PRIMARY;
4804
- stream.emit("open");
4805
- }
4806
- stream._duplexState &= NOT_ACTIVE;
4807
- if (stream._writableState !== null) stream._writableState.updateCallback();
4808
- if (stream._readableState !== null) stream._readableState.updateCallback();
4809
- }
4810
- function afterTransform(err, data) {
4811
- if (data !== undefined && data !== null) this.push(data);
4812
- this._writableState.afterWrite(err);
4813
- }
4814
- function newListener(name$1) {
4815
- if (this._readableState !== null) {
4816
- if (name$1 === "data") {
4817
- this._duplexState |= READ_EMIT_DATA | READ_RESUMED_READ_AHEAD;
4818
- this._readableState.updateNextTick();
4819
- }
4820
- if (name$1 === "readable") {
4821
- this._duplexState |= READ_EMIT_READABLE;
4822
- this._readableState.updateNextTick();
4823
- }
4824
- }
4825
- if (this._writableState !== null) {
4826
- if (name$1 === "drain") {
4827
- this._duplexState |= WRITE_EMIT_DRAIN;
4828
- this._writableState.updateNextTick();
4829
- }
4830
- }
4831
- }
4832
- var Stream = class extends EventEmitter {
4833
- constructor(opts) {
4834
- super();
4835
- this._duplexState = 0;
4836
- this._readableState = null;
4837
- this._writableState = null;
4838
- if (opts) {
4839
- if (opts.open) this._open = opts.open;
4840
- if (opts.destroy) this._destroy = opts.destroy;
4841
- if (opts.predestroy) this._predestroy = opts.predestroy;
4842
- if (opts.signal) opts.signal.addEventListener("abort", abort.bind(this));
4843
- }
4844
- this.on("newListener", newListener);
4845
- }
4846
- _open(cb) {
4847
- cb(null);
4848
- }
4849
- _destroy(cb) {
4850
- cb(null);
4851
- }
4852
- _predestroy() {}
4853
- get readable() {
4854
- return this._readableState !== null ? true : undefined;
4855
- }
4856
- get writable() {
4857
- return this._writableState !== null ? true : undefined;
4858
- }
4859
- get destroyed() {
4860
- return (this._duplexState & DESTROYED) !== 0;
4861
- }
4862
- get destroying() {
4863
- return (this._duplexState & DESTROY_STATUS) !== 0;
4864
- }
4865
- destroy(err) {
4866
- if ((this._duplexState & DESTROY_STATUS) === 0) {
4867
- if (!err) err = STREAM_DESTROYED;
4868
- this._duplexState = (this._duplexState | DESTROYING) & NON_PRIMARY;
4869
- if (this._readableState !== null) {
4870
- this._readableState.highWaterMark = 0;
4871
- this._readableState.error = err;
4872
- }
4873
- if (this._writableState !== null) {
4874
- this._writableState.highWaterMark = 0;
4875
- this._writableState.error = err;
4876
- }
4877
- this._duplexState |= PREDESTROYING;
4878
- this._predestroy();
4879
- this._duplexState &= NOT_PREDESTROYING;
4880
- if (this._readableState !== null) this._readableState.updateNextTick();
4881
- if (this._writableState !== null) this._writableState.updateNextTick();
4882
- }
4883
- }
4884
- };
4885
- var Readable$2 = class Readable$2 extends Stream {
4886
- constructor(opts) {
4887
- super(opts);
4888
- this._duplexState |= OPENING | WRITE_DONE | READ_READ_AHEAD;
4889
- this._readableState = new ReadableState(this, opts);
4890
- if (opts) {
4891
- if (this._readableState.readAhead === false) this._duplexState &= READ_NO_READ_AHEAD;
4892
- if (opts.read) this._read = opts.read;
4893
- if (opts.eagerOpen) this._readableState.updateNextTick();
4894
- if (opts.encoding) this.setEncoding(opts.encoding);
4895
- }
4896
- }
4897
- setEncoding(encoding) {
4898
- const dec = new TextDecoder$1(encoding);
4899
- const map = this._readableState.map || echo$1;
4900
- this._readableState.map = mapOrSkip;
4901
- return this;
4902
- function mapOrSkip(data) {
4903
- const next = dec.push(data);
4904
- return next === "" && (data.byteLength !== 0 || dec.remaining > 0) ? null : map(next);
4905
- }
4906
- }
4907
- _read(cb) {
4908
- cb(null);
4909
- }
4910
- pipe(dest, cb) {
4911
- this._readableState.updateNextTick();
4912
- this._readableState.pipe(dest, cb);
4913
- return dest;
4914
- }
4915
- read() {
4916
- this._readableState.updateNextTick();
4917
- return this._readableState.read();
4918
- }
4919
- push(data) {
4920
- this._readableState.updateNextTickIfOpen();
4921
- return this._readableState.push(data);
4922
- }
4923
- unshift(data) {
4924
- this._readableState.updateNextTickIfOpen();
4925
- return this._readableState.unshift(data);
4926
- }
4927
- resume() {
4928
- this._duplexState |= READ_RESUMED_READ_AHEAD;
4929
- this._readableState.updateNextTick();
4930
- return this;
4931
- }
4932
- pause() {
4933
- this._duplexState &= this._readableState.readAhead === false ? READ_PAUSED_NO_READ_AHEAD : READ_PAUSED;
4934
- return this;
4935
- }
4936
- static _fromAsyncIterator(ite, opts) {
4937
- let destroy;
4938
- const rs = new Readable$2({
4939
- ...opts,
4940
- read(cb) {
4941
- ite.next().then(push).then(cb.bind(null, null)).catch(cb);
4942
- },
4943
- predestroy() {
4944
- destroy = ite.return();
4945
- },
4946
- destroy(cb) {
4947
- if (!destroy) return cb(null);
4948
- destroy.then(cb.bind(null, null)).catch(cb);
4949
- }
4950
- });
4951
- return rs;
4952
- function push(data) {
4953
- if (data.done) rs.push(null);
4954
- else rs.push(data.value);
4955
- }
4956
- }
4957
- static from(data, opts) {
4958
- if (isReadStreamx(data)) return data;
4959
- if (data[asyncIterator]) return this._fromAsyncIterator(data[asyncIterator](), opts);
4960
- if (!Array.isArray(data)) data = data === undefined ? [] : [data];
4961
- let i = 0;
4962
- return new Readable$2({
4963
- ...opts,
4964
- read(cb) {
4965
- this.push(i === data.length ? null : data[i++]);
4966
- cb(null);
4967
- }
4968
- });
4969
- }
4970
- static isBackpressured(rs) {
4971
- return (rs._duplexState & READ_BACKPRESSURE_STATUS) !== 0 || rs._readableState.buffered >= rs._readableState.highWaterMark;
4972
- }
4973
- static isPaused(rs) {
4974
- return (rs._duplexState & READ_RESUMED) === 0;
4975
- }
4976
- [asyncIterator]() {
4977
- const stream = this;
4978
- let error = null;
4979
- let promiseResolve = null;
4980
- let promiseReject = null;
4981
- this.on("error", (err) => {
4982
- error = err;
4983
- });
4984
- this.on("readable", onreadable);
4985
- this.on("close", onclose);
4986
- return {
4987
- [asyncIterator]() {
4988
- return this;
4989
- },
4990
- next() {
4991
- return new Promise(function(resolve$1, reject) {
4992
- promiseResolve = resolve$1;
4993
- promiseReject = reject;
4994
- const data = stream.read();
4995
- if (data !== null) ondata(data);
4996
- else if ((stream._duplexState & DESTROYED) !== 0) ondata(null);
4997
- });
4998
- },
4999
- return() {
5000
- return destroy(null);
5001
- },
5002
- throw(err) {
5003
- return destroy(err);
5004
- }
5005
- };
5006
- function onreadable() {
5007
- if (promiseResolve !== null) ondata(stream.read());
5008
- }
5009
- function onclose() {
5010
- if (promiseResolve !== null) ondata(null);
5011
- }
5012
- function ondata(data) {
5013
- if (promiseReject === null) return;
5014
- if (error) promiseReject(error);
5015
- else if (data === null && (stream._duplexState & READ_DONE) === 0) promiseReject(STREAM_DESTROYED);
5016
- else promiseResolve({
5017
- value: data,
5018
- done: data === null
5019
- });
5020
- promiseReject = promiseResolve = null;
5021
- }
5022
- function destroy(err) {
5023
- stream.destroy(err);
5024
- return new Promise((resolve$1, reject) => {
5025
- if (stream._duplexState & DESTROYED) return resolve$1({
5026
- value: undefined,
5027
- done: true
5028
- });
5029
- stream.once("close", function() {
5030
- if (err) reject(err);
5031
- else resolve$1({
5032
- value: undefined,
5033
- done: true
5034
- });
5035
- });
5036
- });
5037
- }
5038
- }
5039
- };
5040
- var Writable$2 = class extends Stream {
5041
- constructor(opts) {
5042
- super(opts);
5043
- this._duplexState |= OPENING | READ_DONE;
5044
- this._writableState = new WritableState(this, opts);
5045
- if (opts) {
5046
- if (opts.writev) this._writev = opts.writev;
5047
- if (opts.write) this._write = opts.write;
5048
- if (opts.final) this._final = opts.final;
5049
- if (opts.eagerOpen) this._writableState.updateNextTick();
5050
- }
5051
- }
5052
- cork() {
5053
- this._duplexState |= WRITE_CORKED;
5054
- }
5055
- uncork() {
5056
- this._duplexState &= WRITE_NOT_CORKED;
5057
- this._writableState.updateNextTick();
5058
- }
5059
- _writev(batch, cb) {
5060
- cb(null);
5061
- }
5062
- _write(data, cb) {
5063
- this._writableState.autoBatch(data, cb);
5064
- }
5065
- _final(cb) {
5066
- cb(null);
5067
- }
5068
- static isBackpressured(ws) {
5069
- return (ws._duplexState & WRITE_BACKPRESSURE_STATUS) !== 0;
5070
- }
5071
- static drained(ws) {
5072
- if (ws.destroyed) return Promise.resolve(false);
5073
- const state = ws._writableState;
5074
- const pending = isWritev(ws) ? Math.min(1, state.queue.length) : state.queue.length;
5075
- const writes = pending + (ws._duplexState & WRITE_WRITING ? 1 : 0);
5076
- if (writes === 0) return Promise.resolve(true);
5077
- if (state.drains === null) state.drains = [];
5078
- return new Promise((resolve$1) => {
5079
- state.drains.push({
5080
- writes,
5081
- resolve: resolve$1
5082
- });
5083
- });
5084
- }
5085
- write(data) {
5086
- this._writableState.updateNextTick();
5087
- return this._writableState.push(data);
5088
- }
5089
- end(data) {
5090
- this._writableState.updateNextTick();
5091
- this._writableState.end(data);
5092
- return this;
5093
- }
5094
- };
5095
- var Duplex = class extends Readable$2 {
5096
- constructor(opts) {
5097
- super(opts);
5098
- this._duplexState = OPENING | this._duplexState & READ_READ_AHEAD;
5099
- this._writableState = new WritableState(this, opts);
5100
- if (opts) {
5101
- if (opts.writev) this._writev = opts.writev;
5102
- if (opts.write) this._write = opts.write;
5103
- if (opts.final) this._final = opts.final;
5104
- }
5105
- }
5106
- cork() {
5107
- this._duplexState |= WRITE_CORKED;
5108
- }
5109
- uncork() {
5110
- this._duplexState &= WRITE_NOT_CORKED;
5111
- this._writableState.updateNextTick();
5112
- }
5113
- _writev(batch, cb) {
5114
- cb(null);
5115
- }
5116
- _write(data, cb) {
5117
- this._writableState.autoBatch(data, cb);
5118
- }
5119
- _final(cb) {
5120
- cb(null);
5121
- }
5122
- write(data) {
5123
- this._writableState.updateNextTick();
5124
- return this._writableState.push(data);
5125
- }
5126
- end(data) {
5127
- this._writableState.updateNextTick();
5128
- this._writableState.end(data);
5129
- return this;
5130
- }
5131
- };
5132
- var Transform = class extends Duplex {
5133
- constructor(opts) {
5134
- super(opts);
5135
- this._transformState = new TransformState(this);
5136
- if (opts) {
5137
- if (opts.transform) this._transform = opts.transform;
5138
- if (opts.flush) this._flush = opts.flush;
5139
- }
5140
- }
5141
- _write(data, cb) {
5142
- if (this._readableState.buffered >= this._readableState.highWaterMark) this._transformState.data = data;
5143
- else this._transform(data, this._transformState.afterTransform);
5144
- }
5145
- _read(cb) {
5146
- if (this._transformState.data !== null) {
5147
- const data = this._transformState.data;
5148
- this._transformState.data = null;
5149
- cb(null);
5150
- this._transform(data, this._transformState.afterTransform);
5151
- } else cb(null);
5152
- }
5153
- destroy(err) {
5154
- super.destroy(err);
5155
- if (this._transformState.data !== null) {
5156
- this._transformState.data = null;
5157
- this._transformState.afterTransform();
5158
- }
5159
- }
5160
- _transform(data, cb) {
5161
- cb(null, data);
5162
- }
5163
- _flush(cb) {
5164
- cb(null);
5165
- }
5166
- _final(cb) {
5167
- this._transformState.afterFinal = cb;
5168
- this._flush(transformAfterFlush.bind(this));
5169
- }
5170
- };
5171
- var PassThrough = class extends Transform {};
5172
- function transformAfterFlush(err, data) {
5173
- const cb = this._transformState.afterFinal;
5174
- if (err) return cb(err);
5175
- if (data !== null && data !== undefined) this.push(data);
5176
- this.push(null);
5177
- cb(null);
5178
- }
5179
- function pipelinePromise(...streams) {
5180
- return new Promise((resolve$1, reject) => {
5181
- return pipeline$1(...streams, (err) => {
5182
- if (err) return reject(err);
5183
- resolve$1();
5184
- });
5185
- });
5186
- }
5187
- function pipeline$1(stream, ...streams) {
5188
- const all = Array.isArray(stream) ? [...stream, ...streams] : [stream, ...streams];
5189
- const done = all.length && typeof all[all.length - 1] === "function" ? all.pop() : null;
5190
- if (all.length < 2) throw new Error("Pipeline requires at least 2 streams");
5191
- let src = all[0];
5192
- let dest = null;
5193
- let error = null;
5194
- for (let i = 1; i < all.length; i++) {
5195
- dest = all[i];
5196
- if (isStreamx(src)) src.pipe(dest, onerror);
5197
- else {
5198
- errorHandle(src, true, i > 1, onerror);
5199
- src.pipe(dest);
5200
- }
5201
- src = dest;
5202
- }
5203
- if (done) {
5204
- let fin = false;
5205
- const autoDestroy = isStreamx(dest) || !!(dest._writableState && dest._writableState.autoDestroy);
5206
- dest.on("error", (err) => {
5207
- if (error === null) error = err;
5208
- });
5209
- dest.on("finish", () => {
5210
- fin = true;
5211
- if (!autoDestroy) done(error);
5212
- });
5213
- if (autoDestroy) dest.on("close", () => done(error || (fin ? null : PREMATURE_CLOSE)));
5214
- }
5215
- return dest;
5216
- function errorHandle(s$1, rd, wr, onerror$1) {
5217
- s$1.on("error", onerror$1);
5218
- s$1.on("close", onclose);
5219
- function onclose() {
5220
- if (rd && s$1._readableState && !s$1._readableState.ended) return onerror$1(PREMATURE_CLOSE);
5221
- if (wr && s$1._writableState && !s$1._writableState.ended) return onerror$1(PREMATURE_CLOSE);
5222
- }
5223
- }
5224
- function onerror(err) {
5225
- if (!err || error) return;
5226
- error = err;
5227
- for (const s$1 of all) s$1.destroy(err);
5228
- }
5229
- }
5230
- function echo$1(s$1) {
5231
- return s$1;
5232
- }
5233
- function isStream(stream) {
5234
- return !!stream._readableState || !!stream._writableState;
5235
- }
5236
- function isStreamx(stream) {
5237
- return typeof stream._duplexState === "number" && isStream(stream);
5238
- }
5239
- function isEnded(stream) {
5240
- return !!stream._readableState && stream._readableState.ended;
5241
- }
5242
- function isFinished(stream) {
5243
- return !!stream._writableState && stream._writableState.ended;
5244
- }
5245
- function getStreamError$2(stream, opts = {}) {
5246
- const err = stream._readableState && stream._readableState.error || stream._writableState && stream._writableState.error;
5247
- return !opts.all && err === STREAM_DESTROYED ? null : err;
5248
- }
5249
- function isReadStreamx(stream) {
5250
- return isStreamx(stream) && stream.readable;
5251
- }
5252
- function isDisturbed(stream) {
5253
- return (stream._duplexState & OPENING) !== OPENING || (stream._duplexState & ACTIVE_OR_TICKING) !== 0;
5254
- }
5255
- function isTypedArray(data) {
5256
- return typeof data === "object" && data !== null && typeof data.byteLength === "number";
5257
- }
5258
- function defaultByteLength(data) {
5259
- return isTypedArray(data) ? data.byteLength : 1024;
5260
- }
5261
- function noop$5() {}
5262
- function abort() {
5263
- this.destroy(new Error("Stream aborted."));
5264
- }
5265
- function isWritev(s$1) {
5266
- return s$1._writev !== Writable$2.prototype._writev && s$1._writev !== Duplex.prototype._writev;
5267
- }
5268
- module.exports = {
5269
- pipeline: pipeline$1,
5270
- pipelinePromise,
5271
- isStream,
5272
- isStreamx,
5273
- isEnded,
5274
- isFinished,
5275
- isDisturbed,
5276
- getStreamError: getStreamError$2,
5277
- Stream,
5278
- Writable: Writable$2,
5279
- Readable: Readable$2,
5280
- Duplex,
5281
- Transform,
5282
- PassThrough
5283
- };
5284
- } });
5285
-
5286
- //#endregion
5287
- //#region node_modules/.pnpm/tar-stream@3.1.7/node_modules/tar-stream/headers.js
5288
- var require_headers = __commonJS({ "node_modules/.pnpm/tar-stream@3.1.7/node_modules/tar-stream/headers.js"(exports) {
5289
- const b4a$2 = require_b4a();
5290
- const ZEROS = "0000000000000000000";
5291
- const SEVENS = "7777777777777777777";
5292
- const ZERO_OFFSET = "0".charCodeAt(0);
5293
- const USTAR_MAGIC = b4a$2.from([
5294
- 117,
5295
- 115,
5296
- 116,
5297
- 97,
5298
- 114,
5299
- 0
5300
- ]);
5301
- const USTAR_VER = b4a$2.from([ZERO_OFFSET, ZERO_OFFSET]);
5302
- const GNU_MAGIC = b4a$2.from([
5303
- 117,
5304
- 115,
5305
- 116,
5306
- 97,
5307
- 114,
5308
- 32
5309
- ]);
5310
- const GNU_VER = b4a$2.from([32, 0]);
5311
- const MASK = 4095;
5312
- const MAGIC_OFFSET = 257;
5313
- const VERSION_OFFSET = 263;
5314
- exports.decodeLongPath = function decodeLongPath(buf, encoding) {
5315
- return decodeStr(buf, 0, buf.length, encoding);
5316
- };
5317
- exports.encodePax = function encodePax(opts) {
5318
- let result = "";
5319
- if (opts.name) result += addLength(" path=" + opts.name + "\n");
5320
- if (opts.linkname) result += addLength(" linkpath=" + opts.linkname + "\n");
5321
- const pax = opts.pax;
5322
- if (pax) for (const key in pax) result += addLength(" " + key + "=" + pax[key] + "\n");
5323
- return b4a$2.from(result);
5324
- };
5325
- exports.decodePax = function decodePax(buf) {
5326
- const result = {};
5327
- while (buf.length) {
5328
- let i = 0;
5329
- while (i < buf.length && buf[i] !== 32) i++;
5330
- const len = parseInt(b4a$2.toString(buf.subarray(0, i)), 10);
5331
- if (!len) return result;
5332
- const b = b4a$2.toString(buf.subarray(i + 1, len - 1));
5333
- const keyIndex = b.indexOf("=");
5334
- if (keyIndex === -1) return result;
5335
- result[b.slice(0, keyIndex)] = b.slice(keyIndex + 1);
5336
- buf = buf.subarray(len);
5337
- }
5338
- return result;
5339
- };
5340
- exports.encode = function encode$1(opts) {
5341
- const buf = b4a$2.alloc(512);
5342
- let name$1 = opts.name;
5343
- let prefix = "";
5344
- if (opts.typeflag === 5 && name$1[name$1.length - 1] !== "/") name$1 += "/";
5345
- if (b4a$2.byteLength(name$1) !== name$1.length) return null;
5346
- while (b4a$2.byteLength(name$1) > 100) {
5347
- const i = name$1.indexOf("/");
5348
- if (i === -1) return null;
5349
- prefix += prefix ? "/" + name$1.slice(0, i) : name$1.slice(0, i);
5350
- name$1 = name$1.slice(i + 1);
5351
- }
5352
- if (b4a$2.byteLength(name$1) > 100 || b4a$2.byteLength(prefix) > 155) return null;
5353
- if (opts.linkname && b4a$2.byteLength(opts.linkname) > 100) return null;
5354
- b4a$2.write(buf, name$1);
5355
- b4a$2.write(buf, encodeOct(opts.mode & MASK, 6), 100);
5356
- b4a$2.write(buf, encodeOct(opts.uid, 6), 108);
5357
- b4a$2.write(buf, encodeOct(opts.gid, 6), 116);
5358
- encodeSize(opts.size, buf, 124);
5359
- b4a$2.write(buf, encodeOct(opts.mtime.getTime() / 1e3 | 0, 11), 136);
5360
- buf[156] = ZERO_OFFSET + toTypeflag(opts.type);
5361
- if (opts.linkname) b4a$2.write(buf, opts.linkname, 157);
5362
- b4a$2.copy(USTAR_MAGIC, buf, MAGIC_OFFSET);
5363
- b4a$2.copy(USTAR_VER, buf, VERSION_OFFSET);
5364
- if (opts.uname) b4a$2.write(buf, opts.uname, 265);
5365
- if (opts.gname) b4a$2.write(buf, opts.gname, 297);
5366
- b4a$2.write(buf, encodeOct(opts.devmajor || 0, 6), 329);
5367
- b4a$2.write(buf, encodeOct(opts.devminor || 0, 6), 337);
5368
- if (prefix) b4a$2.write(buf, prefix, 345);
5369
- b4a$2.write(buf, encodeOct(cksum(buf), 6), 148);
5370
- return buf;
5371
- };
5372
- exports.decode = function decode(buf, filenameEncoding, allowUnknownFormat) {
5373
- let typeflag = buf[156] === 0 ? 0 : buf[156] - ZERO_OFFSET;
5374
- let name$1 = decodeStr(buf, 0, 100, filenameEncoding);
5375
- const mode = decodeOct(buf, 100, 8);
5376
- const uid = decodeOct(buf, 108, 8);
5377
- const gid = decodeOct(buf, 116, 8);
5378
- const size = decodeOct(buf, 124, 12);
5379
- const mtime = decodeOct(buf, 136, 12);
5380
- const type$1 = toType(typeflag);
5381
- const linkname = buf[157] === 0 ? null : decodeStr(buf, 157, 100, filenameEncoding);
5382
- const uname = decodeStr(buf, 265, 32);
5383
- const gname = decodeStr(buf, 297, 32);
5384
- const devmajor = decodeOct(buf, 329, 8);
5385
- const devminor = decodeOct(buf, 337, 8);
5386
- const c = cksum(buf);
5387
- if (c === 256) return null;
5388
- if (c !== decodeOct(buf, 148, 8)) throw new Error("Invalid tar header. Maybe the tar is corrupted or it needs to be gunzipped?");
5389
- if (isUSTAR(buf)) {
5390
- if (buf[345]) name$1 = decodeStr(buf, 345, 155, filenameEncoding) + "/" + name$1;
5391
- } else if (isGNU(buf)) {} else if (!allowUnknownFormat) throw new Error("Invalid tar header: unknown format.");
5392
- if (typeflag === 0 && name$1 && name$1[name$1.length - 1] === "/") typeflag = 5;
5393
- return {
5394
- name: name$1,
5395
- mode,
5396
- uid,
5397
- gid,
5398
- size,
5399
- mtime: new Date(1e3 * mtime),
5400
- type: type$1,
5401
- linkname,
5402
- uname,
5403
- gname,
5404
- devmajor,
5405
- devminor,
5406
- pax: null
5407
- };
5408
- };
5409
- function isUSTAR(buf) {
5410
- return b4a$2.equals(USTAR_MAGIC, buf.subarray(MAGIC_OFFSET, MAGIC_OFFSET + 6));
5411
- }
5412
- function isGNU(buf) {
5413
- return b4a$2.equals(GNU_MAGIC, buf.subarray(MAGIC_OFFSET, MAGIC_OFFSET + 6)) && b4a$2.equals(GNU_VER, buf.subarray(VERSION_OFFSET, VERSION_OFFSET + 2));
5414
- }
5415
- function clamp(index, len, defaultValue) {
5416
- if (typeof index !== "number") return defaultValue;
5417
- index = ~~index;
5418
- if (index >= len) return len;
5419
- if (index >= 0) return index;
5420
- index += len;
5421
- if (index >= 0) return index;
5422
- return 0;
5423
- }
5424
- function toType(flag) {
5425
- switch (flag) {
5426
- case 0: return "file";
5427
- case 1: return "link";
5428
- case 2: return "symlink";
5429
- case 3: return "character-device";
5430
- case 4: return "block-device";
5431
- case 5: return "directory";
5432
- case 6: return "fifo";
5433
- case 7: return "contiguous-file";
5434
- case 72: return "pax-header";
5435
- case 55: return "pax-global-header";
5436
- case 27: return "gnu-long-link-path";
5437
- case 28:
5438
- case 30: return "gnu-long-path";
5439
- }
5440
- return null;
5441
- }
5442
- function toTypeflag(flag) {
5443
- switch (flag) {
5444
- case "file": return 0;
5445
- case "link": return 1;
5446
- case "symlink": return 2;
5447
- case "character-device": return 3;
5448
- case "block-device": return 4;
5449
- case "directory": return 5;
5450
- case "fifo": return 6;
5451
- case "contiguous-file": return 7;
5452
- case "pax-header": return 72;
5453
- }
5454
- return 0;
5455
- }
5456
- function indexOf(block, num, offset, end) {
5457
- for (; offset < end; offset++) if (block[offset] === num) return offset;
5458
- return end;
5459
- }
5460
- function cksum(block) {
5461
- let sum = 256;
5462
- for (let i = 0; i < 148; i++) sum += block[i];
5463
- for (let j = 156; j < 512; j++) sum += block[j];
5464
- return sum;
5465
- }
5466
- function encodeOct(val, n$1) {
5467
- val = val.toString(8);
5468
- if (val.length > n$1) return SEVENS.slice(0, n$1) + " ";
5469
- return ZEROS.slice(0, n$1 - val.length) + val + " ";
5470
- }
5471
- function encodeSizeBin(num, buf, off) {
5472
- buf[off] = 128;
5473
- for (let i = 11; i > 0; i--) {
5474
- buf[off + i] = num & 255;
5475
- num = Math.floor(num / 256);
5476
- }
5477
- }
5478
- function encodeSize(num, buf, off) {
5479
- if (num.toString(8).length > 11) encodeSizeBin(num, buf, off);
5480
- else b4a$2.write(buf, encodeOct(num, 11), off);
5481
- }
5482
- function parse256(buf) {
5483
- let positive;
5484
- if (buf[0] === 128) positive = true;
5485
- else if (buf[0] === 255) positive = false;
5486
- else return null;
5487
- const tuple = [];
5488
- let i;
5489
- for (i = buf.length - 1; i > 0; i--) {
5490
- const byte = buf[i];
5491
- if (positive) tuple.push(byte);
5492
- else tuple.push(255 - byte);
5493
- }
5494
- let sum = 0;
5495
- const l = tuple.length;
5496
- for (i = 0; i < l; i++) sum += tuple[i] * Math.pow(256, i);
5497
- return positive ? sum : -1 * sum;
5498
- }
5499
- function decodeOct(val, offset, length) {
5500
- val = val.subarray(offset, offset + length);
5501
- offset = 0;
5502
- if (val[offset] & 128) return parse256(val);
5503
- else {
5504
- while (offset < val.length && val[offset] === 32) offset++;
5505
- const end = clamp(indexOf(val, 32, offset, val.length), val.length, val.length);
5506
- while (offset < end && val[offset] === 0) offset++;
5507
- if (end === offset) return 0;
5508
- return parseInt(b4a$2.toString(val.subarray(offset, end)), 8);
5509
- }
5510
- }
5511
- function decodeStr(val, offset, length, encoding) {
5512
- return b4a$2.toString(val.subarray(offset, indexOf(val, 0, offset, offset + length)), encoding);
5513
- }
5514
- function addLength(str) {
5515
- const len = b4a$2.byteLength(str);
5516
- let digits = Math.floor(Math.log(len) / Math.log(10)) + 1;
5517
- if (len + digits >= Math.pow(10, digits)) digits++;
5518
- return len + digits + str;
5519
- }
5520
- } });
5521
-
5522
- //#endregion
5523
- //#region node_modules/.pnpm/tar-stream@3.1.7/node_modules/tar-stream/extract.js
5524
- var require_extract = __commonJS({ "node_modules/.pnpm/tar-stream@3.1.7/node_modules/tar-stream/extract.js"(exports, module) {
5525
- const { Writable: Writable$1, Readable: Readable$1, getStreamError: getStreamError$1 } = require_streamx();
5526
- const FIFO = require_fast_fifo();
5527
- const b4a$1 = require_b4a();
5528
- const headers$1 = require_headers();
5529
- const EMPTY = b4a$1.alloc(0);
5530
- var BufferList = class {
5531
- constructor() {
5532
- this.buffered = 0;
5533
- this.shifted = 0;
5534
- this.queue = new FIFO();
5535
- this._offset = 0;
5536
- }
5537
- push(buffer) {
5538
- this.buffered += buffer.byteLength;
5539
- this.queue.push(buffer);
5540
- }
5541
- shiftFirst(size) {
5542
- return this._buffered === 0 ? null : this._next(size);
5543
- }
5544
- shift(size) {
5545
- if (size > this.buffered) return null;
5546
- if (size === 0) return EMPTY;
5547
- let chunk = this._next(size);
5548
- if (size === chunk.byteLength) return chunk;
5549
- const chunks = [chunk];
5550
- while ((size -= chunk.byteLength) > 0) {
5551
- chunk = this._next(size);
5552
- chunks.push(chunk);
5553
- }
5554
- return b4a$1.concat(chunks);
5555
- }
5556
- _next(size) {
5557
- const buf = this.queue.peek();
5558
- const rem = buf.byteLength - this._offset;
5559
- if (size >= rem) {
5560
- const sub = this._offset ? buf.subarray(this._offset, buf.byteLength) : buf;
5561
- this.queue.shift();
5562
- this._offset = 0;
5563
- this.buffered -= rem;
5564
- this.shifted += rem;
5565
- return sub;
5566
- }
5567
- this.buffered -= size;
5568
- this.shifted += size;
5569
- return buf.subarray(this._offset, this._offset += size);
5570
- }
5571
- };
5572
- var Source = class extends Readable$1 {
5573
- constructor(self, header, offset) {
5574
- super();
5575
- this.header = header;
5576
- this.offset = offset;
5577
- this._parent = self;
5578
- }
5579
- _read(cb) {
5580
- if (this.header.size === 0) this.push(null);
5581
- if (this._parent._stream === this) this._parent._update();
5582
- cb(null);
5583
- }
5584
- _predestroy() {
5585
- this._parent.destroy(getStreamError$1(this));
5586
- }
5587
- _detach() {
5588
- if (this._parent._stream === this) {
5589
- this._parent._stream = null;
5590
- this._parent._missing = overflow$1(this.header.size);
5591
- this._parent._update();
5592
- }
5593
- }
5594
- _destroy(cb) {
5595
- this._detach();
5596
- cb(null);
5597
- }
5598
- };
5599
- var Extract = class extends Writable$1 {
5600
- constructor(opts) {
5601
- super(opts);
5602
- if (!opts) opts = {};
5603
- this._buffer = new BufferList();
5604
- this._offset = 0;
5605
- this._header = null;
5606
- this._stream = null;
5607
- this._missing = 0;
5608
- this._longHeader = false;
5609
- this._callback = noop$4;
5610
- this._locked = false;
5611
- this._finished = false;
5612
- this._pax = null;
5613
- this._paxGlobal = null;
5614
- this._gnuLongPath = null;
5615
- this._gnuLongLinkPath = null;
5616
- this._filenameEncoding = opts.filenameEncoding || "utf-8";
5617
- this._allowUnknownFormat = !!opts.allowUnknownFormat;
5618
- this._unlockBound = this._unlock.bind(this);
5619
- }
5620
- _unlock(err) {
5621
- this._locked = false;
5622
- if (err) {
5623
- this.destroy(err);
5624
- this._continueWrite(err);
5625
- return;
5626
- }
5627
- this._update();
5628
- }
5629
- _consumeHeader() {
5630
- if (this._locked) return false;
5631
- this._offset = this._buffer.shifted;
5632
- try {
5633
- this._header = headers$1.decode(this._buffer.shift(512), this._filenameEncoding, this._allowUnknownFormat);
5634
- } catch (err) {
5635
- this._continueWrite(err);
5636
- return false;
5637
- }
5638
- if (!this._header) return true;
5639
- switch (this._header.type) {
5640
- case "gnu-long-path":
5641
- case "gnu-long-link-path":
5642
- case "pax-global-header":
5643
- case "pax-header":
5644
- this._longHeader = true;
5645
- this._missing = this._header.size;
5646
- return true;
5647
- }
5648
- this._locked = true;
5649
- this._applyLongHeaders();
5650
- if (this._header.size === 0 || this._header.type === "directory") {
5651
- this.emit("entry", this._header, this._createStream(), this._unlockBound);
5652
- return true;
5653
- }
5654
- this._stream = this._createStream();
5655
- this._missing = this._header.size;
5656
- this.emit("entry", this._header, this._stream, this._unlockBound);
5657
- return true;
5658
- }
5659
- _applyLongHeaders() {
5660
- if (this._gnuLongPath) {
5661
- this._header.name = this._gnuLongPath;
5662
- this._gnuLongPath = null;
5663
- }
5664
- if (this._gnuLongLinkPath) {
5665
- this._header.linkname = this._gnuLongLinkPath;
5666
- this._gnuLongLinkPath = null;
5667
- }
5668
- if (this._pax) {
5669
- if (this._pax.path) this._header.name = this._pax.path;
5670
- if (this._pax.linkpath) this._header.linkname = this._pax.linkpath;
5671
- if (this._pax.size) this._header.size = parseInt(this._pax.size, 10);
5672
- this._header.pax = this._pax;
5673
- this._pax = null;
5674
- }
5675
- }
5676
- _decodeLongHeader(buf) {
5677
- switch (this._header.type) {
5678
- case "gnu-long-path":
5679
- this._gnuLongPath = headers$1.decodeLongPath(buf, this._filenameEncoding);
5680
- break;
5681
- case "gnu-long-link-path":
5682
- this._gnuLongLinkPath = headers$1.decodeLongPath(buf, this._filenameEncoding);
5683
- break;
5684
- case "pax-global-header":
5685
- this._paxGlobal = headers$1.decodePax(buf);
5686
- break;
5687
- case "pax-header":
5688
- this._pax = this._paxGlobal === null ? headers$1.decodePax(buf) : Object.assign({}, this._paxGlobal, headers$1.decodePax(buf));
5689
- break;
5690
- }
5691
- }
5692
- _consumeLongHeader() {
5693
- this._longHeader = false;
5694
- this._missing = overflow$1(this._header.size);
5695
- const buf = this._buffer.shift(this._header.size);
5696
- try {
5697
- this._decodeLongHeader(buf);
5698
- } catch (err) {
5699
- this._continueWrite(err);
5700
- return false;
5701
- }
5702
- return true;
5703
- }
5704
- _consumeStream() {
5705
- const buf = this._buffer.shiftFirst(this._missing);
5706
- if (buf === null) return false;
5707
- this._missing -= buf.byteLength;
5708
- const drained = this._stream.push(buf);
5709
- if (this._missing === 0) {
5710
- this._stream.push(null);
5711
- if (drained) this._stream._detach();
5712
- return drained && this._locked === false;
5713
- }
5714
- return drained;
5715
- }
5716
- _createStream() {
5717
- return new Source(this, this._header, this._offset);
5718
- }
5719
- _update() {
5720
- while (this._buffer.buffered > 0 && !this.destroying) {
5721
- if (this._missing > 0) {
5722
- if (this._stream !== null) {
5723
- if (this._consumeStream() === false) return;
5724
- continue;
5725
- }
5726
- if (this._longHeader === true) {
5727
- if (this._missing > this._buffer.buffered) break;
5728
- if (this._consumeLongHeader() === false) return false;
5729
- continue;
5730
- }
5731
- const ignore = this._buffer.shiftFirst(this._missing);
5732
- if (ignore !== null) this._missing -= ignore.byteLength;
5733
- continue;
5734
- }
5735
- if (this._buffer.buffered < 512) break;
5736
- if (this._stream !== null || this._consumeHeader() === false) return;
5737
- }
5738
- this._continueWrite(null);
5739
- }
5740
- _continueWrite(err) {
5741
- const cb = this._callback;
5742
- this._callback = noop$4;
5743
- cb(err);
5744
- }
5745
- _write(data, cb) {
5746
- this._callback = cb;
5747
- this._buffer.push(data);
5748
- this._update();
5749
- }
5750
- _final(cb) {
5751
- this._finished = this._missing === 0 && this._buffer.buffered === 0;
5752
- cb(this._finished ? null : new Error("Unexpected end of data"));
5753
- }
5754
- _predestroy() {
5755
- this._continueWrite(null);
5756
- }
5757
- _destroy(cb) {
5758
- if (this._stream) this._stream.destroy(getStreamError$1(this));
5759
- cb(null);
5760
- }
5761
- [Symbol.asyncIterator]() {
5762
- let error = null;
5763
- let promiseResolve = null;
5764
- let promiseReject = null;
5765
- let entryStream = null;
5766
- let entryCallback = null;
5767
- const extract$1 = this;
5768
- this.on("entry", onentry);
5769
- this.on("error", (err) => {
5770
- error = err;
5771
- });
5772
- this.on("close", onclose);
5773
- return {
5774
- [Symbol.asyncIterator]() {
5775
- return this;
5776
- },
5777
- next() {
5778
- return new Promise(onnext);
5779
- },
5780
- return() {
5781
- return destroy(null);
5782
- },
5783
- throw(err) {
5784
- return destroy(err);
5785
- }
5786
- };
5787
- function consumeCallback(err) {
5788
- if (!entryCallback) return;
5789
- const cb = entryCallback;
5790
- entryCallback = null;
5791
- cb(err);
5792
- }
5793
- function onnext(resolve$1, reject) {
5794
- if (error) return reject(error);
5795
- if (entryStream) {
5796
- resolve$1({
5797
- value: entryStream,
5798
- done: false
5799
- });
5800
- entryStream = null;
5801
- return;
5802
- }
5803
- promiseResolve = resolve$1;
5804
- promiseReject = reject;
5805
- consumeCallback(null);
5806
- if (extract$1._finished && promiseResolve) {
5807
- promiseResolve({
5808
- value: undefined,
5809
- done: true
5810
- });
5811
- promiseResolve = promiseReject = null;
5812
- }
5813
- }
5814
- function onentry(header, stream, callback) {
5815
- entryCallback = callback;
5816
- stream.on("error", noop$4);
5817
- if (promiseResolve) {
5818
- promiseResolve({
5819
- value: stream,
5820
- done: false
5821
- });
5822
- promiseResolve = promiseReject = null;
5823
- } else entryStream = stream;
5824
- }
5825
- function onclose() {
5826
- consumeCallback(error);
5827
- if (!promiseResolve) return;
5828
- if (error) promiseReject(error);
5829
- else promiseResolve({
5830
- value: undefined,
5831
- done: true
5832
- });
5833
- promiseResolve = promiseReject = null;
5834
- }
5835
- function destroy(err) {
5836
- extract$1.destroy(err);
5837
- consumeCallback(err);
5838
- return new Promise((resolve$1, reject) => {
5839
- if (extract$1.destroyed) return resolve$1({
5840
- value: undefined,
5841
- done: true
5842
- });
5843
- extract$1.once("close", function() {
5844
- if (err) reject(err);
5845
- else resolve$1({
5846
- value: undefined,
5847
- done: true
5848
- });
5849
- });
5850
- });
5851
- }
5852
- }
5853
- };
5854
- module.exports = function extract$1(opts) {
5855
- return new Extract(opts);
5856
- };
5857
- function noop$4() {}
5858
- function overflow$1(size) {
5859
- size &= 511;
5860
- return size && 512 - size;
5861
- }
5862
- } });
5863
-
5864
- //#endregion
5865
- //#region node_modules/.pnpm/tar-stream@3.1.7/node_modules/tar-stream/constants.js
5866
- var require_constants = __commonJS({ "node_modules/.pnpm/tar-stream@3.1.7/node_modules/tar-stream/constants.js"(exports, module) {
5867
- const constants$2 = {
5868
- S_IFMT: 61440,
5869
- S_IFDIR: 16384,
5870
- S_IFCHR: 8192,
5871
- S_IFBLK: 24576,
5872
- S_IFIFO: 4096,
5873
- S_IFLNK: 40960
5874
- };
5875
- try {
5876
- module.exports = __require("fs").constants || constants$2;
5877
- } catch {
5878
- module.exports = constants$2;
5879
- }
5880
- } });
5881
-
5882
- //#endregion
5883
- //#region node_modules/.pnpm/tar-stream@3.1.7/node_modules/tar-stream/pack.js
5884
- var require_pack = __commonJS({ "node_modules/.pnpm/tar-stream@3.1.7/node_modules/tar-stream/pack.js"(exports, module) {
5885
- const { Readable, Writable, getStreamError } = require_streamx();
5886
- const b4a = require_b4a();
5887
- const constants$1 = require_constants();
5888
- const headers = require_headers();
5889
- const DMODE = 493;
5890
- const FMODE = 420;
5891
- const END_OF_TAR = b4a.alloc(1024);
5892
- var Sink = class extends Writable {
5893
- constructor(pack, header, callback) {
5894
- super({
5895
- mapWritable,
5896
- eagerOpen: true
5897
- });
5898
- this.written = 0;
5899
- this.header = header;
5900
- this._callback = callback;
5901
- this._linkname = null;
5902
- this._isLinkname = header.type === "symlink" && !header.linkname;
5903
- this._isVoid = header.type !== "file" && header.type !== "contiguous-file";
5904
- this._finished = false;
5905
- this._pack = pack;
5906
- this._openCallback = null;
5907
- if (this._pack._stream === null) this._pack._stream = this;
5908
- else this._pack._pending.push(this);
5909
- }
5910
- _open(cb) {
5911
- this._openCallback = cb;
5912
- if (this._pack._stream === this) this._continueOpen();
5913
- }
5914
- _continuePack(err) {
5915
- if (this._callback === null) return;
5916
- const callback = this._callback;
5917
- this._callback = null;
5918
- callback(err);
5919
- }
5920
- _continueOpen() {
5921
- if (this._pack._stream === null) this._pack._stream = this;
5922
- const cb = this._openCallback;
5923
- this._openCallback = null;
5924
- if (cb === null) return;
5925
- if (this._pack.destroying) return cb(new Error("pack stream destroyed"));
5926
- if (this._pack._finalized) return cb(new Error("pack stream is already finalized"));
5927
- this._pack._stream = this;
5928
- if (!this._isLinkname) this._pack._encode(this.header);
5929
- if (this._isVoid) {
5930
- this._finish();
5931
- this._continuePack(null);
5932
- }
5933
- cb(null);
5934
- }
5935
- _write(data, cb) {
5936
- if (this._isLinkname) {
5937
- this._linkname = this._linkname ? b4a.concat([this._linkname, data]) : data;
5938
- return cb(null);
5939
- }
5940
- if (this._isVoid) {
5941
- if (data.byteLength > 0) return cb(new Error("No body allowed for this entry"));
5942
- return cb();
5943
- }
5944
- this.written += data.byteLength;
5945
- if (this._pack.push(data)) return cb();
5946
- this._pack._drain = cb;
5947
- }
5948
- _finish() {
5949
- if (this._finished) return;
5950
- this._finished = true;
5951
- if (this._isLinkname) {
5952
- this.header.linkname = this._linkname ? b4a.toString(this._linkname, "utf-8") : "";
5953
- this._pack._encode(this.header);
5954
- }
5955
- overflow(this._pack, this.header.size);
5956
- this._pack._done(this);
5957
- }
5958
- _final(cb) {
5959
- if (this.written !== this.header.size) return cb(new Error("Size mismatch"));
5960
- this._finish();
5961
- cb(null);
5962
- }
5963
- _getError() {
5964
- return getStreamError(this) || new Error("tar entry destroyed");
5965
- }
5966
- _predestroy() {
5967
- this._pack.destroy(this._getError());
5968
- }
5969
- _destroy(cb) {
5970
- this._pack._done(this);
5971
- this._continuePack(this._finished ? null : this._getError());
5972
- cb();
5973
- }
5974
- };
5975
- var Pack = class extends Readable {
5976
- constructor(opts) {
5977
- super(opts);
5978
- this._drain = noop$3;
5979
- this._finalized = false;
5980
- this._finalizing = false;
5981
- this._pending = [];
5982
- this._stream = null;
5983
- }
5984
- entry(header, buffer, callback) {
5985
- if (this._finalized || this.destroying) throw new Error("already finalized or destroyed");
5986
- if (typeof buffer === "function") {
5987
- callback = buffer;
5988
- buffer = null;
5989
- }
5990
- if (!callback) callback = noop$3;
5991
- if (!header.size || header.type === "symlink") header.size = 0;
5992
- if (!header.type) header.type = modeToType(header.mode);
5993
- if (!header.mode) header.mode = header.type === "directory" ? DMODE : FMODE;
5994
- if (!header.uid) header.uid = 0;
5995
- if (!header.gid) header.gid = 0;
5996
- if (!header.mtime) header.mtime = new Date();
5997
- if (typeof buffer === "string") buffer = b4a.from(buffer);
5998
- const sink = new Sink(this, header, callback);
5999
- if (b4a.isBuffer(buffer)) {
6000
- header.size = buffer.byteLength;
6001
- sink.write(buffer);
6002
- sink.end();
6003
- return sink;
6004
- }
6005
- if (sink._isVoid) return sink;
6006
- return sink;
6007
- }
6008
- finalize() {
6009
- if (this._stream || this._pending.length > 0) {
6010
- this._finalizing = true;
6011
- return;
6012
- }
6013
- if (this._finalized) return;
6014
- this._finalized = true;
6015
- this.push(END_OF_TAR);
6016
- this.push(null);
6017
- }
6018
- _done(stream) {
6019
- if (stream !== this._stream) return;
6020
- this._stream = null;
6021
- if (this._finalizing) this.finalize();
6022
- if (this._pending.length) this._pending.shift()._continueOpen();
6023
- }
6024
- _encode(header) {
6025
- if (!header.pax) {
6026
- const buf = headers.encode(header);
6027
- if (buf) {
6028
- this.push(buf);
6029
- return;
6030
- }
6031
- }
6032
- this._encodePax(header);
6033
- }
6034
- _encodePax(header) {
6035
- const paxHeader = headers.encodePax({
6036
- name: header.name,
6037
- linkname: header.linkname,
6038
- pax: header.pax
6039
- });
6040
- const newHeader = {
6041
- name: "PaxHeader",
6042
- mode: header.mode,
6043
- uid: header.uid,
6044
- gid: header.gid,
6045
- size: paxHeader.byteLength,
6046
- mtime: header.mtime,
6047
- type: "pax-header",
6048
- linkname: header.linkname && "PaxHeader",
6049
- uname: header.uname,
6050
- gname: header.gname,
6051
- devmajor: header.devmajor,
6052
- devminor: header.devminor
6053
- };
6054
- this.push(headers.encode(newHeader));
6055
- this.push(paxHeader);
6056
- overflow(this, paxHeader.byteLength);
6057
- newHeader.size = header.size;
6058
- newHeader.type = header.type;
6059
- this.push(headers.encode(newHeader));
6060
- }
6061
- _doDrain() {
6062
- const drain = this._drain;
6063
- this._drain = noop$3;
6064
- drain();
6065
- }
6066
- _predestroy() {
6067
- const err = getStreamError(this);
6068
- if (this._stream) this._stream.destroy(err);
6069
- while (this._pending.length) {
6070
- const stream = this._pending.shift();
6071
- stream.destroy(err);
6072
- stream._continueOpen();
6073
- }
6074
- this._doDrain();
6075
- }
6076
- _read(cb) {
6077
- this._doDrain();
6078
- cb();
6079
- }
6080
- };
6081
- module.exports = function pack(opts) {
6082
- return new Pack(opts);
6083
- };
6084
- function modeToType(mode) {
6085
- switch (mode & constants$1.S_IFMT) {
6086
- case constants$1.S_IFBLK: return "block-device";
6087
- case constants$1.S_IFCHR: return "character-device";
6088
- case constants$1.S_IFDIR: return "directory";
6089
- case constants$1.S_IFIFO: return "fifo";
6090
- case constants$1.S_IFLNK: return "symlink";
6091
- }
6092
- return "file";
6093
- }
6094
- function noop$3() {}
6095
- function overflow(self, size) {
6096
- size &= 511;
6097
- if (size) self.push(END_OF_TAR.subarray(0, 512 - size));
6098
- }
6099
- function mapWritable(buf) {
6100
- return b4a.isBuffer(buf) ? buf : b4a.from(buf);
6101
- }
6102
- } });
6103
-
6104
- //#endregion
6105
- //#region node_modules/.pnpm/tar-stream@3.1.7/node_modules/tar-stream/index.js
6106
- var require_tar_stream = __commonJS({ "node_modules/.pnpm/tar-stream@3.1.7/node_modules/tar-stream/index.js"(exports) {
6107
- exports.extract = require_extract();
6108
- exports.pack = require_pack();
6109
- } });
6110
-
6111
- //#endregion
6112
- //#region node_modules/.pnpm/wrappy@1.0.2/node_modules/wrappy/wrappy.js
6113
- var require_wrappy = __commonJS({ "node_modules/.pnpm/wrappy@1.0.2/node_modules/wrappy/wrappy.js"(exports, module) {
6114
- module.exports = wrappy$1;
6115
- function wrappy$1(fn, cb) {
6116
- if (fn && cb) return wrappy$1(fn)(cb);
6117
- if (typeof fn !== "function") throw new TypeError("need wrapper function");
6118
- Object.keys(fn).forEach(function(k) {
6119
- wrapper[k] = fn[k];
6120
- });
6121
- return wrapper;
6122
- function wrapper() {
6123
- var args = new Array(arguments.length);
6124
- for (var i = 0; i < args.length; i++) args[i] = arguments[i];
6125
- var ret = fn.apply(this, args);
6126
- var cb$1 = args[args.length - 1];
6127
- if (typeof ret === "function" && ret !== cb$1) Object.keys(cb$1).forEach(function(k) {
6128
- ret[k] = cb$1[k];
6129
- });
6130
- return ret;
6131
- }
6132
- }
6133
- } });
6134
-
6135
- //#endregion
6136
- //#region node_modules/.pnpm/once@1.4.0/node_modules/once/once.js
6137
- var require_once = __commonJS({ "node_modules/.pnpm/once@1.4.0/node_modules/once/once.js"(exports, module) {
6138
- var wrappy = require_wrappy();
6139
- module.exports = wrappy(once$2);
6140
- module.exports.strict = wrappy(onceStrict);
6141
- once$2.proto = once$2(function() {
6142
- Object.defineProperty(Function.prototype, "once", {
6143
- value: function() {
6144
- return once$2(this);
6145
- },
6146
- configurable: true
6147
- });
6148
- Object.defineProperty(Function.prototype, "onceStrict", {
6149
- value: function() {
6150
- return onceStrict(this);
6151
- },
6152
- configurable: true
6153
- });
6154
- });
6155
- function once$2(fn) {
6156
- var f = function() {
6157
- if (f.called) return f.value;
6158
- f.called = true;
6159
- return f.value = fn.apply(this, arguments);
6160
- };
6161
- f.called = false;
6162
- return f;
6163
- }
6164
- function onceStrict(fn) {
6165
- var f = function() {
6166
- if (f.called) throw new Error(f.onceError);
6167
- f.called = true;
6168
- return f.value = fn.apply(this, arguments);
6169
- };
6170
- var name$1 = fn.name || "Function wrapped with `once`";
6171
- f.onceError = name$1 + " shouldn't be called more than once";
6172
- f.called = false;
6173
- return f;
6174
- }
6175
- } });
6176
-
6177
- //#endregion
6178
- //#region node_modules/.pnpm/end-of-stream@1.4.4/node_modules/end-of-stream/index.js
6179
- var require_end_of_stream = __commonJS({ "node_modules/.pnpm/end-of-stream@1.4.4/node_modules/end-of-stream/index.js"(exports, module) {
6180
- var once$1 = require_once();
6181
- var noop$2 = function() {};
6182
- var isRequest$1 = function(stream) {
6183
- return stream.setHeader && typeof stream.abort === "function";
6184
- };
6185
- var isChildProcess = function(stream) {
6186
- return stream.stdio && Array.isArray(stream.stdio) && stream.stdio.length === 3;
6187
- };
6188
- var eos$1 = function(stream, opts, callback) {
6189
- if (typeof opts === "function") return eos$1(stream, null, opts);
6190
- if (!opts) opts = {};
6191
- callback = once$1(callback || noop$2);
6192
- var ws = stream._writableState;
6193
- var rs = stream._readableState;
6194
- var readable = opts.readable || opts.readable !== false && stream.readable;
6195
- var writable = opts.writable || opts.writable !== false && stream.writable;
6196
- var cancelled = false;
6197
- var onlegacyfinish = function() {
6198
- if (!stream.writable) onfinish();
6199
- };
6200
- var onfinish = function() {
6201
- writable = false;
6202
- if (!readable) callback.call(stream);
6203
- };
6204
- var onend = function() {
6205
- readable = false;
6206
- if (!writable) callback.call(stream);
6207
- };
6208
- var onexit = function(exitCode) {
6209
- callback.call(stream, exitCode ? new Error("exited with error code: " + exitCode) : null);
6210
- };
6211
- var onerror = function(err) {
6212
- callback.call(stream, err);
6213
- };
6214
- var onclose = function() {
6215
- process.nextTick(onclosenexttick);
6216
- };
6217
- var onclosenexttick = function() {
6218
- if (cancelled) return;
6219
- if (readable && !(rs && rs.ended && !rs.destroyed)) return callback.call(stream, new Error("premature close"));
6220
- if (writable && !(ws && ws.ended && !ws.destroyed)) return callback.call(stream, new Error("premature close"));
6221
- };
6222
- var onrequest = function() {
6223
- stream.req.on("finish", onfinish);
6224
- };
6225
- if (isRequest$1(stream)) {
6226
- stream.on("complete", onfinish);
6227
- stream.on("abort", onclose);
6228
- if (stream.req) onrequest();
6229
- else stream.on("request", onrequest);
6230
- } else if (writable && !ws) {
6231
- stream.on("end", onlegacyfinish);
6232
- stream.on("close", onlegacyfinish);
6233
- }
6234
- if (isChildProcess(stream)) stream.on("exit", onexit);
6235
- stream.on("end", onend);
6236
- stream.on("finish", onfinish);
6237
- if (opts.error !== false) stream.on("error", onerror);
6238
- stream.on("close", onclose);
6239
- return function() {
6240
- cancelled = true;
6241
- stream.removeListener("complete", onfinish);
6242
- stream.removeListener("abort", onclose);
6243
- stream.removeListener("request", onrequest);
6244
- if (stream.req) stream.req.removeListener("finish", onfinish);
6245
- stream.removeListener("end", onlegacyfinish);
6246
- stream.removeListener("close", onlegacyfinish);
6247
- stream.removeListener("finish", onfinish);
6248
- stream.removeListener("exit", onexit);
6249
- stream.removeListener("end", onend);
6250
- stream.removeListener("error", onerror);
6251
- stream.removeListener("close", onclose);
6252
- };
6253
- };
6254
- module.exports = eos$1;
6255
- } });
6256
-
6257
- //#endregion
6258
- //#region node_modules/.pnpm/pump@3.0.2/node_modules/pump/index.js
6259
- var require_pump = __commonJS({ "node_modules/.pnpm/pump@3.0.2/node_modules/pump/index.js"(exports, module) {
6260
- var once = require_once();
6261
- var eos = require_end_of_stream();
6262
- var fs$2;
6263
- try {
6264
- fs$2 = __require("fs");
6265
- } catch (e) {}
6266
- var noop$1 = function() {};
6267
- var ancient = /^v?\.0/.test(process.version);
6268
- var isFn = function(fn) {
6269
- return typeof fn === "function";
6270
- };
6271
- var isFS = function(stream) {
6272
- if (!ancient) return false;
6273
- if (!fs$2) return false;
6274
- return (stream instanceof (fs$2.ReadStream || noop$1) || stream instanceof (fs$2.WriteStream || noop$1)) && isFn(stream.close);
6275
- };
6276
- var isRequest = function(stream) {
6277
- return stream.setHeader && isFn(stream.abort);
6278
- };
6279
- var destroyer = function(stream, reading, writing, callback) {
6280
- callback = once(callback);
6281
- var closed = false;
6282
- stream.on("close", function() {
6283
- closed = true;
6284
- });
6285
- eos(stream, {
6286
- readable: reading,
6287
- writable: writing
6288
- }, function(err) {
6289
- if (err) return callback(err);
6290
- closed = true;
6291
- callback();
6292
- });
6293
- var destroyed = false;
6294
- return function(err) {
6295
- if (closed) return;
6296
- if (destroyed) return;
6297
- destroyed = true;
6298
- if (isFS(stream)) return stream.close(noop$1);
6299
- if (isRequest(stream)) return stream.abort();
6300
- if (isFn(stream.destroy)) return stream.destroy();
6301
- callback(err || new Error("stream was destroyed"));
6302
- };
6303
- };
6304
- var call = function(fn) {
6305
- fn();
6306
- };
6307
- var pipe = function(from$2, to) {
6308
- return from$2.pipe(to);
6309
- };
6310
- var pump$1 = function() {
6311
- var streams = Array.prototype.slice.call(arguments);
6312
- var callback = isFn(streams[streams.length - 1] || noop$1) && streams.pop() || noop$1;
6313
- if (Array.isArray(streams[0])) streams = streams[0];
6314
- if (streams.length < 2) throw new Error("pump requires two streams per minimum");
6315
- var error;
6316
- var destroys = streams.map(function(stream, i) {
6317
- var reading = i < streams.length - 1;
6318
- var writing = i > 0;
6319
- return destroyer(stream, reading, writing, function(err) {
6320
- if (!error) error = err;
6321
- if (err) destroys.forEach(call);
6322
- if (reading) return;
6323
- destroys.forEach(call);
6324
- callback(error);
6325
- });
6326
- });
6327
- return streams.reduce(pipe);
6328
- };
6329
- module.exports = pump$1;
6330
- } });
6331
-
6332
- //#endregion
6333
- //#region node_modules/.pnpm/tar-fs@3.0.8/node_modules/tar-fs/index.js
6334
- var require_tar_fs = __commonJS({ "node_modules/.pnpm/tar-fs@3.0.8/node_modules/tar-fs/index.js"(exports) {
6335
- const tar = require_tar_stream();
6336
- const pump = require_pump();
6337
- const fs$1 = __require("fs");
6338
- const path$1 = __require("path");
6339
- const win32 = (global.Bare?.platform || process.platform) === "win32";
6340
- exports.pack = function pack(cwd, opts) {
6341
- if (!cwd) cwd = ".";
6342
- if (!opts) opts = {};
6343
- const xfs = opts.fs || fs$1;
6344
- const ignore = opts.ignore || opts.filter || noop;
6345
- const mapStream = opts.mapStream || echo;
6346
- const statNext = statAll(xfs, opts.dereference ? xfs.stat : xfs.lstat, cwd, ignore, opts.entries, opts.sort);
6347
- const strict = opts.strict !== false;
6348
- const umask = typeof opts.umask === "number" ? ~opts.umask : ~processUmask();
6349
- const pack = opts.pack || tar.pack();
6350
- const finish = opts.finish || noop;
6351
- let map = opts.map || noop;
6352
- let dmode = typeof opts.dmode === "number" ? opts.dmode : 0;
6353
- let fmode = typeof opts.fmode === "number" ? opts.fmode : 0;
6354
- if (opts.strip) map = strip(map, opts.strip);
6355
- if (opts.readable) {
6356
- dmode |= parseInt(555, 8);
6357
- fmode |= parseInt(444, 8);
6358
- }
6359
- if (opts.writable) {
6360
- dmode |= parseInt(333, 8);
6361
- fmode |= parseInt(222, 8);
6362
- }
6363
- onnextentry();
6364
- function onsymlink(filename, header) {
6365
- xfs.readlink(path$1.join(cwd, filename), function(err, linkname) {
6366
- if (err) return pack.destroy(err);
6367
- header.linkname = normalize(linkname);
6368
- pack.entry(header, onnextentry);
6369
- });
6370
- }
6371
- function onstat(err, filename, stat) {
6372
- if (pack.destroyed) return;
6373
- if (err) return pack.destroy(err);
6374
- if (!filename) {
6375
- if (opts.finalize !== false) pack.finalize();
6376
- return finish(pack);
6377
- }
6378
- if (stat.isSocket()) return onnextentry();
6379
- let header = {
6380
- name: normalize(filename),
6381
- mode: (stat.mode | (stat.isDirectory() ? dmode : fmode)) & umask,
6382
- mtime: stat.mtime,
6383
- size: stat.size,
6384
- type: "file",
6385
- uid: stat.uid,
6386
- gid: stat.gid
6387
- };
6388
- if (stat.isDirectory()) {
6389
- header.size = 0;
6390
- header.type = "directory";
6391
- header = map(header) || header;
6392
- return pack.entry(header, onnextentry);
6393
- }
6394
- if (stat.isSymbolicLink()) {
6395
- header.size = 0;
6396
- header.type = "symlink";
6397
- header = map(header) || header;
6398
- return onsymlink(filename, header);
6399
- }
6400
- header = map(header) || header;
6401
- if (!stat.isFile()) {
6402
- if (strict) return pack.destroy(new Error("unsupported type for " + filename));
6403
- return onnextentry();
6404
- }
6405
- const entry = pack.entry(header, onnextentry);
6406
- const rs = mapStream(xfs.createReadStream(path$1.join(cwd, filename), {
6407
- start: 0,
6408
- end: header.size > 0 ? header.size - 1 : header.size
6409
- }), header);
6410
- rs.on("error", function(err$1) {
6411
- entry.destroy(err$1);
6412
- });
6413
- pump(rs, entry);
6414
- }
6415
- function onnextentry(err) {
6416
- if (err) return pack.destroy(err);
6417
- statNext(onstat);
6418
- }
6419
- return pack;
6420
- };
6421
- function head(list) {
6422
- return list.length ? list[list.length - 1] : null;
6423
- }
6424
- function processGetuid() {
6425
- return process.getuid ? process.getuid() : -1;
6426
- }
6427
- function processUmask() {
6428
- return process.umask ? process.umask() : 0;
6429
- }
6430
- exports.extract = function extract$1(cwd, opts) {
6431
- if (!cwd) cwd = ".";
6432
- if (!opts) opts = {};
6433
- cwd = path$1.resolve(cwd);
6434
- const xfs = opts.fs || fs$1;
6435
- const ignore = opts.ignore || opts.filter || noop;
6436
- const mapStream = opts.mapStream || echo;
6437
- const own = opts.chown !== false && !win32 && processGetuid() === 0;
6438
- const extract$1 = opts.extract || tar.extract();
6439
- const stack = [];
6440
- const now = new Date();
6441
- const umask = typeof opts.umask === "number" ? ~opts.umask : ~processUmask();
6442
- const strict = opts.strict !== false;
6443
- let map = opts.map || noop;
6444
- let dmode = typeof opts.dmode === "number" ? opts.dmode : 0;
6445
- let fmode = typeof opts.fmode === "number" ? opts.fmode : 0;
6446
- if (opts.strip) map = strip(map, opts.strip);
6447
- if (opts.readable) {
6448
- dmode |= parseInt(555, 8);
6449
- fmode |= parseInt(444, 8);
6450
- }
6451
- if (opts.writable) {
6452
- dmode |= parseInt(333, 8);
6453
- fmode |= parseInt(222, 8);
6454
- }
6455
- extract$1.on("entry", onentry);
6456
- if (opts.finish) extract$1.on("finish", opts.finish);
6457
- return extract$1;
6458
- function onentry(header, stream, next) {
6459
- header = map(header) || header;
6460
- header.name = normalize(header.name);
6461
- const name$1 = path$1.join(cwd, path$1.join("/", header.name));
6462
- if (ignore(name$1, header)) {
6463
- stream.resume();
6464
- return next();
6465
- }
6466
- if (header.type === "directory") {
6467
- stack.push([name$1, header.mtime]);
6468
- return mkdirfix(name$1, {
6469
- fs: xfs,
6470
- own,
6471
- uid: header.uid,
6472
- gid: header.gid,
6473
- mode: header.mode
6474
- }, stat);
6475
- }
6476
- const dir = path$1.dirname(name$1);
6477
- validate(xfs, dir, path$1.join(cwd, "."), function(err, valid) {
6478
- if (err) return next(err);
6479
- if (!valid) return next(new Error(dir + " is not a valid path"));
6480
- mkdirfix(dir, {
6481
- fs: xfs,
6482
- own,
6483
- uid: header.uid,
6484
- gid: header.gid,
6485
- mode: 493
6486
- }, function(err$1) {
6487
- if (err$1) return next(err$1);
6488
- switch (header.type) {
6489
- case "file": return onfile();
6490
- case "link": return onlink();
6491
- case "symlink": return onsymlink();
6492
- }
6493
- if (strict) return next(new Error("unsupported type for " + name$1 + " (" + header.type + ")"));
6494
- stream.resume();
6495
- next();
6496
- });
6497
- });
6498
- function stat(err) {
6499
- if (err) return next(err);
6500
- utimes(name$1, header, function(err$1) {
6501
- if (err$1) return next(err$1);
6502
- if (win32) return next();
6503
- chperm(name$1, header, next);
6504
- });
6505
- }
6506
- function onsymlink() {
6507
- if (win32) return next();
6508
- xfs.unlink(name$1, function() {
6509
- const dst = path$1.resolve(path$1.dirname(name$1), header.linkname);
6510
- if (!inCwd(dst)) return next(new Error(name$1 + " is not a valid symlink"));
6511
- xfs.symlink(header.linkname, name$1, stat);
6512
- });
6513
- }
6514
- function onlink() {
6515
- if (win32) return next();
6516
- xfs.unlink(name$1, function() {
6517
- const dst = path$1.join(cwd, path$1.join("/", header.linkname));
6518
- xfs.link(dst, name$1, function(err) {
6519
- if (err && err.code === "EPERM" && opts.hardlinkAsFilesFallback) {
6520
- stream = xfs.createReadStream(dst);
6521
- return onfile();
6522
- }
6523
- stat(err);
6524
- });
6525
- });
6526
- }
6527
- function inCwd(dst) {
6528
- return dst.startsWith(cwd);
6529
- }
6530
- function onfile() {
6531
- const ws = xfs.createWriteStream(name$1);
6532
- const rs = mapStream(stream, header);
6533
- ws.on("error", function(err) {
6534
- rs.destroy(err);
6535
- });
6536
- pump(rs, ws, function(err) {
6537
- if (err) return next(err);
6538
- ws.on("close", stat);
6539
- });
6540
- }
6541
- }
6542
- function utimesParent(name$1, cb) {
6543
- let top;
6544
- while ((top = head(stack)) && name$1.slice(0, top[0].length) !== top[0]) stack.pop();
6545
- if (!top) return cb();
6546
- xfs.utimes(top[0], now, top[1], cb);
6547
- }
6548
- function utimes(name$1, header, cb) {
6549
- if (opts.utimes === false) return cb();
6550
- if (header.type === "directory") return xfs.utimes(name$1, now, header.mtime, cb);
6551
- if (header.type === "symlink") return utimesParent(name$1, cb);
6552
- xfs.utimes(name$1, now, header.mtime, function(err) {
6553
- if (err) return cb(err);
6554
- utimesParent(name$1, cb);
6555
- });
6556
- }
6557
- function chperm(name$1, header, cb) {
6558
- const link = header.type === "symlink";
6559
- const chmod = link ? xfs.lchmod : xfs.chmod;
6560
- const chown = link ? xfs.lchown : xfs.chown;
6561
- if (!chmod) return cb();
6562
- const mode = (header.mode | (header.type === "directory" ? dmode : fmode)) & umask;
6563
- if (chown && own) chown.call(xfs, name$1, header.uid, header.gid, onchown);
6564
- else onchown(null);
6565
- function onchown(err) {
6566
- if (err) return cb(err);
6567
- if (!chmod) return cb();
6568
- chmod.call(xfs, name$1, mode, cb);
6569
- }
6570
- }
6571
- function mkdirfix(name$1, opts$1, cb) {
6572
- xfs.stat(name$1, function(err) {
6573
- if (!err) return cb(null);
6574
- if (err.code !== "ENOENT") return cb(err);
6575
- xfs.mkdir(name$1, {
6576
- mode: opts$1.mode,
6577
- recursive: true
6578
- }, function(err$1, made) {
6579
- if (err$1) return cb(err$1);
6580
- chperm(name$1, opts$1, cb);
6581
- });
6582
- });
6583
- }
6584
- };
6585
- function validate(fs$3, name$1, root, cb) {
6586
- if (name$1 === root) return cb(null, true);
6587
- fs$3.lstat(name$1, function(err, st) {
6588
- if (err && err.code === "ENOENT") return validate(fs$3, path$1.join(name$1, ".."), root, cb);
6589
- else if (err) return cb(err);
6590
- cb(null, st.isDirectory());
6591
- });
6592
- }
6593
- function noop() {}
6594
- function echo(name$1) {
6595
- return name$1;
6596
- }
6597
- function normalize(name$1) {
6598
- return win32 ? name$1.replace(/\\/g, "/").replace(/[:?<>|]/g, "_") : name$1;
6599
- }
6600
- function statAll(fs$3, stat, cwd, ignore, entries, sort) {
6601
- if (!entries) entries = ["."];
6602
- const queue = entries.slice(0);
6603
- return function loop(callback) {
6604
- if (!queue.length) return callback(null);
6605
- const next = queue.shift();
6606
- const nextAbs = path$1.join(cwd, next);
6607
- stat.call(fs$3, nextAbs, function(err, stat$1) {
6608
- if (err) return callback(entries.indexOf(next) === -1 && err.code === "ENOENT" ? null : err);
6609
- if (!stat$1.isDirectory()) return callback(null, next, stat$1);
6610
- fs$3.readdir(nextAbs, function(err$1, files$1) {
6611
- if (err$1) return callback(err$1);
6612
- if (sort) files$1.sort();
6613
- for (let i = 0; i < files$1.length; i++) if (!ignore(path$1.join(cwd, next, files$1[i]))) queue.push(path$1.join(next, files$1[i]));
6614
- callback(null, next, stat$1);
6615
- });
6616
- });
6617
- };
6618
- }
6619
- function strip(map, level) {
6620
- return function(header) {
6621
- header.name = header.name.split("/").slice(level).join("/");
6622
- const linkname = header.linkname;
6623
- if (linkname && (header.type === "link" || path$1.isAbsolute(linkname))) header.linkname = linkname.split("/").slice(level).join("/");
6624
- return map(header);
6625
- };
6626
- }
6627
- } });
6628
-
6629
3955
  //#endregion
6630
3956
  //#region packages/cli/commands/add/fetch-packages.ts
6631
- var import_tar_fs = __toESM$1(require_tar_fs(), 1);
6632
3957
  const NODE_MODULES = fileURLToPath(new URL("../node_modules", import.meta.url));
6633
3958
  const REGISTRY = "https://registry.npmjs.org";
6634
3959
  const Directive = {
@@ -6660,10 +3985,18 @@ async function downloadPackage(options$6) {
6660
3985
  const tarballUrl = pkg.dist.tarball;
6661
3986
  const data = await fetch(tarballUrl);
6662
3987
  if (!data.body) throw new Error(`Unexpected response: '${tarballUrl}' responded with no body`);
6663
- await pipeline(data.body, createGunzip(), (0, import_tar_fs.extract)(NODE_MODULES, { map: (header) => {
6664
- header.name = header.name.replace("package", pkg.name);
6665
- return header;
6666
- } }));
3988
+ await pipeline(
3989
+ data.body,
3990
+ createGunzip()
3991
+ // extract(NODE_MODULES, {
3992
+ // map: (header) => {
3993
+ // // file paths from the tarball will always have a `package/` prefix,
3994
+ // // so we'll need to replace it with the name of the package
3995
+ // header.name = header.name.replace('package', pkg.name);
3996
+ // return header;
3997
+ // }
3998
+ // })
3999
+ );
6667
4000
  const { default: details } = await import(pkg.name);
6668
4001
  return details;
6669
4002
  }
@@ -6750,7 +4083,7 @@ function getGlobalPreconditions(cwd, addons, addonSetupResult) {
6750
4083
 
6751
4084
  //#endregion
6752
4085
  //#region packages/cli/commands/add/index.ts
6753
- var import_picocolors$2 = __toESM$1(require_picocolors$1(), 1);
4086
+ var import_picocolors$2 = __toESM(require_picocolors$1(), 1);
6754
4087
  const aliases = officialAddons.map((c) => c.alias).filter((v) => v !== undefined);
6755
4088
  const addonOptions = getAddonOptionFlags();
6756
4089
  const communityDetails = [];
@@ -7231,7 +4564,7 @@ function getOptionChoices(details) {
7231
4564
 
7232
4565
  //#endregion
7233
4566
  //#region packages/cli/commands/create.ts
7234
- var import_picocolors$1 = __toESM$1(require_picocolors$1(), 1);
4567
+ var import_picocolors$1 = __toESM(require_picocolors$1(), 1);
7235
4568
  const langs = ["ts", "jsdoc"];
7236
4569
  const langMap = {
7237
4570
  ts: "typescript",
@@ -7243,7 +4576,7 @@ const langOption = new Option("--types <lang>", "add type checking").choices(lan
7243
4576
  const templateOption = new Option("--template <type>", "template to scaffold").choices(templateChoices);
7244
4577
  const ProjectPathSchema = optional(string());
7245
4578
  const OptionsSchema = strictObject({
7246
- types: pipe$1(optional(union([picklist(langs), boolean()])), transform((lang) => langMap[String(lang)])),
4579
+ types: pipe(optional(union([picklist(langs), boolean()])), transform((lang) => langMap[String(lang)])),
7247
4580
  addOns: boolean(),
7248
4581
  install: union([boolean(), picklist(AGENT_NAMES)]),
7249
4582
  template: optional(picklist(templateChoices))
@@ -7399,7 +4732,7 @@ function runMigrate(cwd, args) {
7399
4732
 
7400
4733
  //#endregion
7401
4734
  //#region packages/cli/commands/check.ts
7402
- var import_picocolors = __toESM$1(require_picocolors$1(), 1);
4735
+ var import_picocolors = __toESM(require_picocolors$1(), 1);
7403
4736
  const check = new Command("check").description("a CLI for checking your Svelte code").allowUnknownOption(true).allowExcessArguments(true).option("-C, --cwd <path>", "path to working directory", process$1.cwd()).configureHelp({ formatHelp() {
7404
4737
  runCheck(process$1.cwd(), ["--help"]);
7405
4738
  return "";