@datadog/datadog-ci-plugin-terraform 5.13.1 → 5.14.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/bundle.js CHANGED
@@ -39,12 +39,12 @@ let child_process = require("child_process");
39
39
  let node_path = require("node:path");
40
40
  node_path = __toESM(node_path);
41
41
  let path = require("path");
42
- let crypto = require("crypto");
43
- let stream = require("stream");
44
- let node_fs_promises = require("node:fs/promises");
45
- node_fs_promises = __toESM(node_fs_promises);
46
42
  let node_fs = require("node:fs");
47
43
  node_fs = __toESM(node_fs);
44
+ let node_fs_promises = require("node:fs/promises");
45
+ node_fs_promises = __toESM(node_fs_promises);
46
+ let crypto = require("crypto");
47
+ let stream = require("stream");
48
48
  let zlib = require("zlib");
49
49
  let node_process = require("node:process");
50
50
  node_process = __toESM(node_process);
@@ -7735,11 +7735,3458 @@ var require_upath = /* @__PURE__ */ __commonJSMin(((exports) => {
7735
7735
  }
7736
7736
  }));
7737
7737
  //#endregion
7738
+ //#region ../../node_modules/glob/dist/commonjs/index.min.js
7739
+ var require_index_min = /* @__PURE__ */ __commonJSMin(((exports) => {
7740
+ var R = (n, t) => () => (t || n((t = { exports: {} }).exports, t), t.exports);
7741
+ var Ge = R((Y) => {
7742
+ "use strict";
7743
+ Object.defineProperty(Y, "__esModule", { value: !0 });
7744
+ Y.range = Y.balanced = void 0;
7745
+ var Gs = (n, t, e) => {
7746
+ let s = n instanceof RegExp ? Ie(n, e) : n, i = t instanceof RegExp ? Ie(t, e) : t, r = s !== null && i != null && (0, Y.range)(s, i, e);
7747
+ return r && {
7748
+ start: r[0],
7749
+ end: r[1],
7750
+ pre: e.slice(0, r[0]),
7751
+ body: e.slice(r[0] + s.length, r[1]),
7752
+ post: e.slice(r[1] + i.length)
7753
+ };
7754
+ };
7755
+ Y.balanced = Gs;
7756
+ var Ie = (n, t) => {
7757
+ let e = t.match(n);
7758
+ return e ? e[0] : null;
7759
+ }, zs = (n, t, e) => {
7760
+ let s, i, r, h, o, a = e.indexOf(n), l = e.indexOf(t, a + 1), f = a;
7761
+ if (a >= 0 && l > 0) {
7762
+ if (n === t) return [a, l];
7763
+ for (s = [], r = e.length; f >= 0 && !o;) {
7764
+ if (f === a) s.push(f), a = e.indexOf(n, f + 1);
7765
+ else if (s.length === 1) {
7766
+ let c = s.pop();
7767
+ c !== void 0 && (o = [c, l]);
7768
+ } else i = s.pop(), i !== void 0 && i < r && (r = i, h = l), l = e.indexOf(t, f + 1);
7769
+ f = a < l && a >= 0 ? a : l;
7770
+ }
7771
+ s.length && h !== void 0 && (o = [r, h]);
7772
+ }
7773
+ return o;
7774
+ };
7775
+ Y.range = zs;
7776
+ });
7777
+ var Ke = R((it) => {
7778
+ "use strict";
7779
+ Object.defineProperty(it, "__esModule", { value: !0 });
7780
+ it.EXPANSION_MAX = void 0;
7781
+ it.expand = ei;
7782
+ var ze = Ge(), Ue = "\0SLASH" + Math.random() + "\0", $e = "\0OPEN" + Math.random() + "\0", ue = "\0CLOSE" + Math.random() + "\0", qe = "\0COMMA" + Math.random() + "\0", He = "\0PERIOD" + Math.random() + "\0", Us = new RegExp(Ue, "g"), $s = new RegExp($e, "g"), qs = new RegExp(ue, "g"), Hs = new RegExp(qe, "g"), Vs = new RegExp(He, "g"), Ks = /\\\\/g, Xs = /\\{/g, Ys = /\\}/g, Js = /\\,/g, Zs = /\\./g;
7783
+ it.EXPANSION_MAX = 1e5;
7784
+ function ce(n) {
7785
+ return isNaN(n) ? n.charCodeAt(0) : parseInt(n, 10);
7786
+ }
7787
+ function Qs(n) {
7788
+ return n.replace(Ks, Ue).replace(Xs, $e).replace(Ys, ue).replace(Js, qe).replace(Zs, He);
7789
+ }
7790
+ function ti(n) {
7791
+ return n.replace(Us, "\\").replace($s, "{").replace(qs, "}").replace(Hs, ",").replace(Vs, ".");
7792
+ }
7793
+ function Ve(n) {
7794
+ if (!n) return [""];
7795
+ let t = [], e = (0, ze.balanced)("{", "}", n);
7796
+ if (!e) return n.split(",");
7797
+ let { pre: s, body: i, post: r } = e, h = s.split(",");
7798
+ h[h.length - 1] += "{" + i + "}";
7799
+ let o = Ve(r);
7800
+ return r.length && (h[h.length - 1] += o.shift(), h.push.apply(h, o)), t.push.apply(t, h), t;
7801
+ }
7802
+ function ei(n, t = {}) {
7803
+ if (!n) return [];
7804
+ let { max: e = it.EXPANSION_MAX } = t;
7805
+ return n.slice(0, 2) === "{}" && (n = "\\{\\}" + n.slice(2)), ht(Qs(n), e, !0).map(ti);
7806
+ }
7807
+ function si(n) {
7808
+ return "{" + n + "}";
7809
+ }
7810
+ function ii(n) {
7811
+ return /^-?0\d/.test(n);
7812
+ }
7813
+ function ri(n, t) {
7814
+ return n <= t;
7815
+ }
7816
+ function ni(n, t) {
7817
+ return n >= t;
7818
+ }
7819
+ function ht(n, t, e) {
7820
+ let s = [], i = (0, ze.balanced)("{", "}", n);
7821
+ if (!i) return [n];
7822
+ let r = i.pre, h = i.post.length ? ht(i.post, t, !1) : [""];
7823
+ if (/\$$/.test(i.pre)) for (let o = 0; o < h.length && o < t; o++) {
7824
+ let a = r + "{" + i.body + "}" + h[o];
7825
+ s.push(a);
7826
+ }
7827
+ else {
7828
+ let o = /^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(i.body), a = /^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(i.body), l = o || a, f = i.body.indexOf(",") >= 0;
7829
+ if (!l && !f) return i.post.match(/,(?!,).*\}/) ? (n = i.pre + "{" + i.body + ue + i.post, ht(n, t, !0)) : [n];
7830
+ let c;
7831
+ if (l) c = i.body.split(/\.\./);
7832
+ else if (c = Ve(i.body), c.length === 1 && c[0] !== void 0 && (c = ht(c[0], t, !1).map(si), c.length === 1)) return h.map((u) => i.pre + c[0] + u);
7833
+ let d;
7834
+ if (l && c[0] !== void 0 && c[1] !== void 0) {
7835
+ let u = ce(c[0]), m = ce(c[1]), p = Math.max(c[0].length, c[1].length), b = c.length === 3 && c[2] !== void 0 ? Math.abs(ce(c[2])) : 1, w = ri;
7836
+ m < u && (b *= -1, w = ni);
7837
+ let E = c.some(ii);
7838
+ d = [];
7839
+ for (let y = u; w(y, m); y += b) {
7840
+ let S;
7841
+ if (a) S = String.fromCharCode(y), S === "\\" && (S = "");
7842
+ else if (S = String(y), E) {
7843
+ let B = p - S.length;
7844
+ if (B > 0) {
7845
+ let U = new Array(B + 1).join("0");
7846
+ y < 0 ? S = "-" + U + S.slice(1) : S = U + S;
7847
+ }
7848
+ }
7849
+ d.push(S);
7850
+ }
7851
+ } else {
7852
+ d = [];
7853
+ for (let u = 0; u < c.length; u++) d.push.apply(d, ht(c[u], t, !1));
7854
+ }
7855
+ for (let u = 0; u < d.length; u++) for (let m = 0; m < h.length && s.length < t; m++) {
7856
+ let p = r + d[u] + h[m];
7857
+ (!e || l || p) && s.push(p);
7858
+ }
7859
+ }
7860
+ return s;
7861
+ }
7862
+ });
7863
+ var Xe = R((Ct) => {
7864
+ "use strict";
7865
+ Object.defineProperty(Ct, "__esModule", { value: !0 });
7866
+ Ct.assertValidPattern = void 0;
7867
+ var hi = 1024 * 64, oi = (n) => {
7868
+ if (typeof n != "string") throw new TypeError("invalid pattern");
7869
+ if (n.length > hi) throw new TypeError("pattern is too long");
7870
+ };
7871
+ Ct.assertValidPattern = oi;
7872
+ });
7873
+ var Je = R((Rt) => {
7874
+ "use strict";
7875
+ Object.defineProperty(Rt, "__esModule", { value: !0 });
7876
+ Rt.parseClass = void 0;
7877
+ var ai = {
7878
+ "[:alnum:]": ["\\p{L}\\p{Nl}\\p{Nd}", !0],
7879
+ "[:alpha:]": ["\\p{L}\\p{Nl}", !0],
7880
+ "[:ascii:]": ["\\x00-\\x7f", !1],
7881
+ "[:blank:]": ["\\p{Zs}\\t", !0],
7882
+ "[:cntrl:]": ["\\p{Cc}", !0],
7883
+ "[:digit:]": ["\\p{Nd}", !0],
7884
+ "[:graph:]": [
7885
+ "\\p{Z}\\p{C}",
7886
+ !0,
7887
+ !0
7888
+ ],
7889
+ "[:lower:]": ["\\p{Ll}", !0],
7890
+ "[:print:]": ["\\p{C}", !0],
7891
+ "[:punct:]": ["\\p{P}", !0],
7892
+ "[:space:]": ["\\p{Z}\\t\\r\\n\\v\\f", !0],
7893
+ "[:upper:]": ["\\p{Lu}", !0],
7894
+ "[:word:]": ["\\p{L}\\p{Nl}\\p{Nd}\\p{Pc}", !0],
7895
+ "[:xdigit:]": ["A-Fa-f0-9", !1]
7896
+ }, ot = (n) => n.replace(/[[\]\\-]/g, "\\$&"), li = (n) => n.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&"), Ye = (n) => n.join(""), ci = (n, t) => {
7897
+ let e = t;
7898
+ if (n.charAt(e) !== "[") throw new Error("not in a brace expression");
7899
+ let s = [], i = [], r = e + 1, h = !1, o = !1, a = !1, l = !1, f = e, c = "";
7900
+ t: for (; r < n.length;) {
7901
+ let p = n.charAt(r);
7902
+ if ((p === "!" || p === "^") && r === e + 1) {
7903
+ l = !0, r++;
7904
+ continue;
7905
+ }
7906
+ if (p === "]" && h && !a) {
7907
+ f = r + 1;
7908
+ break;
7909
+ }
7910
+ if (h = !0, p === "\\" && !a) {
7911
+ a = !0, r++;
7912
+ continue;
7913
+ }
7914
+ if (p === "[" && !a) {
7915
+ for (let [b, [w, v, E]] of Object.entries(ai)) if (n.startsWith(b, r)) {
7916
+ if (c) return [
7917
+ "$.",
7918
+ !1,
7919
+ n.length - e,
7920
+ !0
7921
+ ];
7922
+ r += b.length, E ? i.push(w) : s.push(w), o = o || v;
7923
+ continue t;
7924
+ }
7925
+ }
7926
+ if (a = !1, c) {
7927
+ p > c ? s.push(ot(c) + "-" + ot(p)) : p === c && s.push(ot(p)), c = "", r++;
7928
+ continue;
7929
+ }
7930
+ if (n.startsWith("-]", r + 1)) {
7931
+ s.push(ot(p + "-")), r += 2;
7932
+ continue;
7933
+ }
7934
+ if (n.startsWith("-", r + 1)) {
7935
+ c = p, r += 2;
7936
+ continue;
7937
+ }
7938
+ s.push(ot(p)), r++;
7939
+ }
7940
+ if (f < r) return [
7941
+ "",
7942
+ !1,
7943
+ 0,
7944
+ !1
7945
+ ];
7946
+ if (!s.length && !i.length) return [
7947
+ "$.",
7948
+ !1,
7949
+ n.length - e,
7950
+ !0
7951
+ ];
7952
+ if (i.length === 0 && s.length === 1 && /^\\?.$/.test(s[0]) && !l) return [
7953
+ li(s[0].length === 2 ? s[0].slice(-1) : s[0]),
7954
+ !1,
7955
+ f - e,
7956
+ !1
7957
+ ];
7958
+ let d = "[" + (l ? "^" : "") + Ye(s) + "]", u = "[" + (l ? "" : "^") + Ye(i) + "]";
7959
+ return [
7960
+ s.length && i.length ? "(" + d + "|" + u + ")" : s.length ? d : u,
7961
+ o,
7962
+ f - e,
7963
+ !0
7964
+ ];
7965
+ };
7966
+ Rt.parseClass = ci;
7967
+ });
7968
+ var kt = R((At) => {
7969
+ "use strict";
7970
+ Object.defineProperty(At, "__esModule", { value: !0 });
7971
+ At.unescape = void 0;
7972
+ var ui = (n, { windowsPathsNoEscape: t = !1, magicalBraces: e = !0 } = {}) => e ? t ? n.replace(/\[([^\/\\])\]/g, "$1") : n.replace(/((?!\\).|^)\[([^\/\\])\]/g, "$1$2").replace(/\\([^\/])/g, "$1") : t ? n.replace(/\[([^\/\\{}])\]/g, "$1") : n.replace(/((?!\\).|^)\[([^\/\\{}])\]/g, "$1$2").replace(/\\([^\/{}])/g, "$1");
7973
+ At.unescape = ui;
7974
+ });
7975
+ var pe = R((Dt) => {
7976
+ "use strict";
7977
+ Object.defineProperty(Dt, "__esModule", { value: !0 });
7978
+ Dt.AST = void 0;
7979
+ var fi = Je(), Mt = kt(), di = new Set([
7980
+ "!",
7981
+ "?",
7982
+ "+",
7983
+ "*",
7984
+ "@"
7985
+ ]), Ze = (n) => di.has(n), pi = "(?!(?:^|/)\\.\\.?(?:$|/))", Pt = "(?!\\.)", mi = new Set(["[", "."]), gi = new Set(["..", "."]), wi = /* @__PURE__ */ new Set("().*{}+?[]^$\\!"), bi = (n) => n.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&"), de = "[^/]", Qe = de + "*?", ts = de + "+?";
7986
+ Dt.AST = class n {
7987
+ type;
7988
+ #t;
7989
+ #s;
7990
+ #n = !1;
7991
+ #r = [];
7992
+ #h;
7993
+ #S;
7994
+ #w;
7995
+ #c = !1;
7996
+ #o;
7997
+ #f;
7998
+ #u = !1;
7999
+ constructor(t, e, s = {}) {
8000
+ this.type = t, t && (this.#s = !0), this.#h = e, this.#t = this.#h ? this.#h.#t : this, this.#o = this.#t === this ? s : this.#t.#o, this.#w = this.#t === this ? [] : this.#t.#w, t === "!" && !this.#t.#c && this.#w.push(this), this.#S = this.#h ? this.#h.#r.length : 0;
8001
+ }
8002
+ get hasMagic() {
8003
+ if (this.#s !== void 0) return this.#s;
8004
+ for (let t of this.#r) if (typeof t != "string" && (t.type || t.hasMagic)) return this.#s = !0;
8005
+ return this.#s;
8006
+ }
8007
+ toString() {
8008
+ return this.#f !== void 0 ? this.#f : this.type ? this.#f = this.type + "(" + this.#r.map((t) => String(t)).join("|") + ")" : this.#f = this.#r.map((t) => String(t)).join("");
8009
+ }
8010
+ #a() {
8011
+ if (this !== this.#t) throw new Error("should only call on root");
8012
+ if (this.#c) return this;
8013
+ this.toString(), this.#c = !0;
8014
+ let t;
8015
+ for (; t = this.#w.pop();) {
8016
+ if (t.type !== "!") continue;
8017
+ let e = t, s = e.#h;
8018
+ for (; s;) {
8019
+ for (let i = e.#S + 1; !s.type && i < s.#r.length; i++) for (let r of t.#r) {
8020
+ if (typeof r == "string") throw new Error("string part in extglob AST??");
8021
+ r.copyIn(s.#r[i]);
8022
+ }
8023
+ e = s, s = e.#h;
8024
+ }
8025
+ }
8026
+ return this;
8027
+ }
8028
+ push(...t) {
8029
+ for (let e of t) if (e !== "") {
8030
+ if (typeof e != "string" && !(e instanceof n && e.#h === this)) throw new Error("invalid part: " + e);
8031
+ this.#r.push(e);
8032
+ }
8033
+ }
8034
+ toJSON() {
8035
+ let t = this.type === null ? this.#r.slice().map((e) => typeof e == "string" ? e : e.toJSON()) : [this.type, ...this.#r.map((e) => e.toJSON())];
8036
+ return this.isStart() && !this.type && t.unshift([]), this.isEnd() && (this === this.#t || this.#t.#c && this.#h?.type === "!") && t.push({}), t;
8037
+ }
8038
+ isStart() {
8039
+ if (this.#t === this) return !0;
8040
+ if (!this.#h?.isStart()) return !1;
8041
+ if (this.#S === 0) return !0;
8042
+ let t = this.#h;
8043
+ for (let e = 0; e < this.#S; e++) {
8044
+ let s = t.#r[e];
8045
+ if (!(s instanceof n && s.type === "!")) return !1;
8046
+ }
8047
+ return !0;
8048
+ }
8049
+ isEnd() {
8050
+ if (this.#t === this || this.#h?.type === "!") return !0;
8051
+ if (!this.#h?.isEnd()) return !1;
8052
+ if (!this.type) return this.#h?.isEnd();
8053
+ let t = this.#h ? this.#h.#r.length : 0;
8054
+ return this.#S === t - 1;
8055
+ }
8056
+ copyIn(t) {
8057
+ typeof t == "string" ? this.push(t) : this.push(t.clone(this));
8058
+ }
8059
+ clone(t) {
8060
+ let e = new n(this.type, t);
8061
+ for (let s of this.#r) e.copyIn(s);
8062
+ return e;
8063
+ }
8064
+ static #i(t, e, s, i) {
8065
+ let r = !1, h = !1, o = -1, a = !1;
8066
+ if (e.type === null) {
8067
+ let u = s, m = "";
8068
+ for (; u < t.length;) {
8069
+ let p = t.charAt(u++);
8070
+ if (r || p === "\\") {
8071
+ r = !r, m += p;
8072
+ continue;
8073
+ }
8074
+ if (h) {
8075
+ u === o + 1 ? (p === "^" || p === "!") && (a = !0) : p === "]" && !(u === o + 2 && a) && (h = !1), m += p;
8076
+ continue;
8077
+ } else if (p === "[") {
8078
+ h = !0, o = u, a = !1, m += p;
8079
+ continue;
8080
+ }
8081
+ if (!i.noext && Ze(p) && t.charAt(u) === "(") {
8082
+ e.push(m), m = "";
8083
+ let b = new n(p, e);
8084
+ u = n.#i(t, b, u, i), e.push(b);
8085
+ continue;
8086
+ }
8087
+ m += p;
8088
+ }
8089
+ return e.push(m), u;
8090
+ }
8091
+ let l = s + 1, f = new n(null, e), c = [], d = "";
8092
+ for (; l < t.length;) {
8093
+ let u = t.charAt(l++);
8094
+ if (r || u === "\\") {
8095
+ r = !r, d += u;
8096
+ continue;
8097
+ }
8098
+ if (h) {
8099
+ l === o + 1 ? (u === "^" || u === "!") && (a = !0) : u === "]" && !(l === o + 2 && a) && (h = !1), d += u;
8100
+ continue;
8101
+ } else if (u === "[") {
8102
+ h = !0, o = l, a = !1, d += u;
8103
+ continue;
8104
+ }
8105
+ if (Ze(u) && t.charAt(l) === "(") {
8106
+ f.push(d), d = "";
8107
+ let m = new n(u, f);
8108
+ f.push(m), l = n.#i(t, m, l, i);
8109
+ continue;
8110
+ }
8111
+ if (u === "|") {
8112
+ f.push(d), d = "", c.push(f), f = new n(null, e);
8113
+ continue;
8114
+ }
8115
+ if (u === ")") return d === "" && e.#r.length === 0 && (e.#u = !0), f.push(d), d = "", e.push(...c, f), l;
8116
+ d += u;
8117
+ }
8118
+ return e.type = null, e.#s = void 0, e.#r = [t.substring(s - 1)], l;
8119
+ }
8120
+ static fromGlob(t, e = {}) {
8121
+ let s = new n(null, void 0, e);
8122
+ return n.#i(t, s, 0, e), s;
8123
+ }
8124
+ toMMPattern() {
8125
+ if (this !== this.#t) return this.#t.toMMPattern();
8126
+ let t = this.toString(), [e, s, i, r] = this.toRegExpSource();
8127
+ if (!(i || this.#s || this.#o.nocase && !this.#o.nocaseMagicOnly && t.toUpperCase() !== t.toLowerCase())) return s;
8128
+ let o = (this.#o.nocase ? "i" : "") + (r ? "u" : "");
8129
+ return Object.assign(new RegExp(`^${e}$`, o), {
8130
+ _src: e,
8131
+ _glob: t
8132
+ });
8133
+ }
8134
+ get options() {
8135
+ return this.#o;
8136
+ }
8137
+ toRegExpSource(t) {
8138
+ let e = t ?? !!this.#o.dot;
8139
+ if (this.#t === this && this.#a(), !this.type) {
8140
+ let a = this.isStart() && this.isEnd() && !this.#r.some((u) => typeof u != "string"), l = this.#r.map((u) => {
8141
+ let [m, p, b, w] = typeof u == "string" ? n.#v(u, this.#s, a) : u.toRegExpSource(t);
8142
+ return this.#s = this.#s || b, this.#n = this.#n || w, m;
8143
+ }).join(""), f = "";
8144
+ if (this.isStart() && typeof this.#r[0] == "string" && !(this.#r.length === 1 && gi.has(this.#r[0]))) {
8145
+ let m = mi, p = e && m.has(l.charAt(0)) || l.startsWith("\\.") && m.has(l.charAt(2)) || l.startsWith("\\.\\.") && m.has(l.charAt(4)), b = !e && !t && m.has(l.charAt(0));
8146
+ f = p ? pi : b ? Pt : "";
8147
+ }
8148
+ let c = "";
8149
+ return this.isEnd() && this.#t.#c && this.#h?.type === "!" && (c = "(?:$|\\/)"), [
8150
+ f + l + c,
8151
+ (0, Mt.unescape)(l),
8152
+ this.#s = !!this.#s,
8153
+ this.#n
8154
+ ];
8155
+ }
8156
+ let s = this.type === "*" || this.type === "+", i = this.type === "!" ? "(?:(?!(?:" : "(?:", r = this.#d(e);
8157
+ if (this.isStart() && this.isEnd() && !r && this.type !== "!") {
8158
+ let a = this.toString();
8159
+ return this.#r = [a], this.type = null, this.#s = void 0, [
8160
+ a,
8161
+ (0, Mt.unescape)(this.toString()),
8162
+ !1,
8163
+ !1
8164
+ ];
8165
+ }
8166
+ let h = !s || t || e || !Pt ? "" : this.#d(!0);
8167
+ h === r && (h = ""), h && (r = `(?:${r})(?:${h})*?`);
8168
+ let o = "";
8169
+ if (this.type === "!" && this.#u) o = (this.isStart() && !e ? Pt : "") + ts;
8170
+ else {
8171
+ let a = this.type === "!" ? "))" + (this.isStart() && !e && !t ? Pt : "") + Qe + ")" : this.type === "@" ? ")" : this.type === "?" ? ")?" : this.type === "+" && h ? ")" : this.type === "*" && h ? ")?" : `)${this.type}`;
8172
+ o = i + r + a;
8173
+ }
8174
+ return [
8175
+ o,
8176
+ (0, Mt.unescape)(r),
8177
+ this.#s = !!this.#s,
8178
+ this.#n
8179
+ ];
8180
+ }
8181
+ #d(t) {
8182
+ return this.#r.map((e) => {
8183
+ if (typeof e == "string") throw new Error("string type in extglob ast??");
8184
+ let [s, i, r, h] = e.toRegExpSource(t);
8185
+ return this.#n = this.#n || h, s;
8186
+ }).filter((e) => !(this.isStart() && this.isEnd()) || !!e).join("|");
8187
+ }
8188
+ static #v(t, e, s = !1) {
8189
+ let i = !1, r = "", h = !1, o = !1;
8190
+ for (let a = 0; a < t.length; a++) {
8191
+ let l = t.charAt(a);
8192
+ if (i) {
8193
+ i = !1, r += (wi.has(l) ? "\\" : "") + l;
8194
+ continue;
8195
+ }
8196
+ if (l === "*") {
8197
+ if (o) continue;
8198
+ o = !0, r += s && /^[*]+$/.test(t) ? ts : Qe, e = !0;
8199
+ continue;
8200
+ } else o = !1;
8201
+ if (l === "\\") {
8202
+ a === t.length - 1 ? r += "\\\\" : i = !0;
8203
+ continue;
8204
+ }
8205
+ if (l === "[") {
8206
+ let [f, c, d, u] = (0, fi.parseClass)(t, a);
8207
+ if (d) {
8208
+ r += f, h = h || c, a += d - 1, e = e || u;
8209
+ continue;
8210
+ }
8211
+ }
8212
+ if (l === "?") {
8213
+ r += de, e = !0;
8214
+ continue;
8215
+ }
8216
+ r += bi(l);
8217
+ }
8218
+ return [
8219
+ r,
8220
+ (0, Mt.unescape)(t),
8221
+ !!e,
8222
+ h
8223
+ ];
8224
+ }
8225
+ };
8226
+ });
8227
+ var me = R((Ft) => {
8228
+ "use strict";
8229
+ Object.defineProperty(Ft, "__esModule", { value: !0 });
8230
+ Ft.escape = void 0;
8231
+ var yi = (n, { windowsPathsNoEscape: t = !1, magicalBraces: e = !1 } = {}) => e ? t ? n.replace(/[?*()[\]{}]/g, "[$&]") : n.replace(/[?*()[\]\\{}]/g, "\\$&") : t ? n.replace(/[?*()[\]]/g, "[$&]") : n.replace(/[?*()[\]\\]/g, "\\$&");
8232
+ Ft.escape = yi;
8233
+ });
8234
+ var H = R((g) => {
8235
+ "use strict";
8236
+ Object.defineProperty(g, "__esModule", { value: !0 });
8237
+ g.unescape = g.escape = g.AST = g.Minimatch = g.match = g.makeRe = g.braceExpand = g.defaults = g.filter = g.GLOBSTAR = g.sep = g.minimatch = void 0;
8238
+ var Si = Ke(), jt = Xe(), is = pe(), vi = me(), Ei = kt(), _i = (n, t, e = {}) => ((0, jt.assertValidPattern)(t), !e.nocomment && t.charAt(0) === "#" ? !1 : new J(t, e).match(n));
8239
+ g.minimatch = _i;
8240
+ var Oi = /^\*+([^+@!?\*\[\(]*)$/, xi = (n) => (t) => !t.startsWith(".") && t.endsWith(n), Ti = (n) => (t) => t.endsWith(n), Ci = (n) => (n = n.toLowerCase(), (t) => !t.startsWith(".") && t.toLowerCase().endsWith(n)), Ri = (n) => (n = n.toLowerCase(), (t) => t.toLowerCase().endsWith(n)), Ai = /^\*+\.\*+$/, ki = (n) => !n.startsWith(".") && n.includes("."), Mi = (n) => n !== "." && n !== ".." && n.includes("."), Pi = /^\.\*+$/, Di = (n) => n !== "." && n !== ".." && n.startsWith("."), Fi = /^\*+$/, ji = (n) => n.length !== 0 && !n.startsWith("."), Ni = (n) => n.length !== 0 && n !== "." && n !== "..", Li = /^\?+([^+@!?\*\[\(]*)?$/, Wi = ([n, t = ""]) => {
8241
+ let e = rs([n]);
8242
+ return t ? (t = t.toLowerCase(), (s) => e(s) && s.toLowerCase().endsWith(t)) : e;
8243
+ }, Bi = ([n, t = ""]) => {
8244
+ let e = ns([n]);
8245
+ return t ? (t = t.toLowerCase(), (s) => e(s) && s.toLowerCase().endsWith(t)) : e;
8246
+ }, Ii = ([n, t = ""]) => {
8247
+ let e = ns([n]);
8248
+ return t ? (s) => e(s) && s.endsWith(t) : e;
8249
+ }, Gi = ([n, t = ""]) => {
8250
+ let e = rs([n]);
8251
+ return t ? (s) => e(s) && s.endsWith(t) : e;
8252
+ }, rs = ([n]) => {
8253
+ let t = n.length;
8254
+ return (e) => e.length === t && !e.startsWith(".");
8255
+ }, ns = ([n]) => {
8256
+ let t = n.length;
8257
+ return (e) => e.length === t && e !== "." && e !== "..";
8258
+ }, hs = typeof process == "object" && process ? typeof process.env == "object" && process.env && process.env.__MINIMATCH_TESTING_PLATFORM__ || process.platform : "posix", es = {
8259
+ win32: { sep: "\\" },
8260
+ posix: { sep: "/" }
8261
+ };
8262
+ g.sep = hs === "win32" ? es.win32.sep : es.posix.sep;
8263
+ g.minimatch.sep = g.sep;
8264
+ g.GLOBSTAR = Symbol("globstar **");
8265
+ g.minimatch.GLOBSTAR = g.GLOBSTAR;
8266
+ var Ui = "[^/]*?", $i = "(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?", qi = "(?:(?!(?:\\/|^)\\.).)*?", Hi = (n, t = {}) => (e) => (0, g.minimatch)(e, n, t);
8267
+ g.filter = Hi;
8268
+ g.minimatch.filter = g.filter;
8269
+ var F = (n, t = {}) => Object.assign({}, n, t), Vi = (n) => {
8270
+ if (!n || typeof n != "object" || !Object.keys(n).length) return g.minimatch;
8271
+ let t = g.minimatch;
8272
+ return Object.assign((s, i, r = {}) => t(s, i, F(n, r)), {
8273
+ Minimatch: class extends t.Minimatch {
8274
+ constructor(i, r = {}) {
8275
+ super(i, F(n, r));
8276
+ }
8277
+ static defaults(i) {
8278
+ return t.defaults(F(n, i)).Minimatch;
8279
+ }
8280
+ },
8281
+ AST: class extends t.AST {
8282
+ constructor(i, r, h = {}) {
8283
+ super(i, r, F(n, h));
8284
+ }
8285
+ static fromGlob(i, r = {}) {
8286
+ return t.AST.fromGlob(i, F(n, r));
8287
+ }
8288
+ },
8289
+ unescape: (s, i = {}) => t.unescape(s, F(n, i)),
8290
+ escape: (s, i = {}) => t.escape(s, F(n, i)),
8291
+ filter: (s, i = {}) => t.filter(s, F(n, i)),
8292
+ defaults: (s) => t.defaults(F(n, s)),
8293
+ makeRe: (s, i = {}) => t.makeRe(s, F(n, i)),
8294
+ braceExpand: (s, i = {}) => t.braceExpand(s, F(n, i)),
8295
+ match: (s, i, r = {}) => t.match(s, i, F(n, r)),
8296
+ sep: t.sep,
8297
+ GLOBSTAR: g.GLOBSTAR
8298
+ });
8299
+ };
8300
+ g.defaults = Vi;
8301
+ g.minimatch.defaults = g.defaults;
8302
+ var Ki = (n, t = {}) => ((0, jt.assertValidPattern)(n), t.nobrace || !/\{(?:(?!\{).)*\}/.test(n) ? [n] : (0, Si.expand)(n, { max: t.braceExpandMax }));
8303
+ g.braceExpand = Ki;
8304
+ g.minimatch.braceExpand = g.braceExpand;
8305
+ var Xi = (n, t = {}) => new J(n, t).makeRe();
8306
+ g.makeRe = Xi;
8307
+ g.minimatch.makeRe = g.makeRe;
8308
+ var Yi = (n, t, e = {}) => {
8309
+ let s = new J(t, e);
8310
+ return n = n.filter((i) => s.match(i)), s.options.nonull && !n.length && n.push(t), n;
8311
+ };
8312
+ g.match = Yi;
8313
+ g.minimatch.match = g.match;
8314
+ var ss = /[?*]|[+@!]\(.*?\)|\[|\]/, Ji = (n) => n.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&"), J = class {
8315
+ options;
8316
+ set;
8317
+ pattern;
8318
+ windowsPathsNoEscape;
8319
+ nonegate;
8320
+ negate;
8321
+ comment;
8322
+ empty;
8323
+ preserveMultipleSlashes;
8324
+ partial;
8325
+ globSet;
8326
+ globParts;
8327
+ nocase;
8328
+ isWindows;
8329
+ platform;
8330
+ windowsNoMagicRoot;
8331
+ regexp;
8332
+ constructor(t, e = {}) {
8333
+ (0, jt.assertValidPattern)(t), e = e || {}, this.options = e, this.pattern = t, this.platform = e.platform || hs, this.isWindows = this.platform === "win32";
8334
+ this.windowsPathsNoEscape = !!e.windowsPathsNoEscape || e["allowWindowsEscape"] === !1, this.windowsPathsNoEscape && (this.pattern = this.pattern.replace(/\\/g, "/")), this.preserveMultipleSlashes = !!e.preserveMultipleSlashes, this.regexp = null, this.negate = !1, this.nonegate = !!e.nonegate, this.comment = !1, this.empty = !1, this.partial = !!e.partial, this.nocase = !!this.options.nocase, this.windowsNoMagicRoot = e.windowsNoMagicRoot !== void 0 ? e.windowsNoMagicRoot : !!(this.isWindows && this.nocase), this.globSet = [], this.globParts = [], this.set = [], this.make();
8335
+ }
8336
+ hasMagic() {
8337
+ if (this.options.magicalBraces && this.set.length > 1) return !0;
8338
+ for (let t of this.set) for (let e of t) if (typeof e != "string") return !0;
8339
+ return !1;
8340
+ }
8341
+ debug(...t) {}
8342
+ make() {
8343
+ let t = this.pattern, e = this.options;
8344
+ if (!e.nocomment && t.charAt(0) === "#") {
8345
+ this.comment = !0;
8346
+ return;
8347
+ }
8348
+ if (!t) {
8349
+ this.empty = !0;
8350
+ return;
8351
+ }
8352
+ this.parseNegate(), this.globSet = [...new Set(this.braceExpand())], e.debug && (this.debug = (...r) => console.error(...r)), this.debug(this.pattern, this.globSet);
8353
+ let s = this.globSet.map((r) => this.slashSplit(r));
8354
+ this.globParts = this.preprocess(s), this.debug(this.pattern, this.globParts);
8355
+ let i = this.globParts.map((r, h, o) => {
8356
+ if (this.isWindows && this.windowsNoMagicRoot) {
8357
+ let a = r[0] === "" && r[1] === "" && (r[2] === "?" || !ss.test(r[2])) && !ss.test(r[3]), l = /^[a-z]:/i.test(r[0]);
8358
+ if (a) return [...r.slice(0, 4), ...r.slice(4).map((f) => this.parse(f))];
8359
+ if (l) return [r[0], ...r.slice(1).map((f) => this.parse(f))];
8360
+ }
8361
+ return r.map((a) => this.parse(a));
8362
+ });
8363
+ if (this.debug(this.pattern, i), this.set = i.filter((r) => r.indexOf(!1) === -1), this.isWindows) for (let r = 0; r < this.set.length; r++) {
8364
+ let h = this.set[r];
8365
+ h[0] === "" && h[1] === "" && this.globParts[r][2] === "?" && typeof h[3] == "string" && /^[a-z]:$/i.test(h[3]) && (h[2] = "?");
8366
+ }
8367
+ this.debug(this.pattern, this.set);
8368
+ }
8369
+ preprocess(t) {
8370
+ if (this.options.noglobstar) for (let s = 0; s < t.length; s++) for (let i = 0; i < t[s].length; i++) t[s][i] === "**" && (t[s][i] = "*");
8371
+ let { optimizationLevel: e = 1 } = this.options;
8372
+ return e >= 2 ? (t = this.firstPhasePreProcess(t), t = this.secondPhasePreProcess(t)) : e >= 1 ? t = this.levelOneOptimize(t) : t = this.adjascentGlobstarOptimize(t), t;
8373
+ }
8374
+ adjascentGlobstarOptimize(t) {
8375
+ return t.map((e) => {
8376
+ let s = -1;
8377
+ for (; (s = e.indexOf("**", s + 1)) !== -1;) {
8378
+ let i = s;
8379
+ for (; e[i + 1] === "**";) i++;
8380
+ i !== s && e.splice(s, i - s);
8381
+ }
8382
+ return e;
8383
+ });
8384
+ }
8385
+ levelOneOptimize(t) {
8386
+ return t.map((e) => (e = e.reduce((s, i) => {
8387
+ let r = s[s.length - 1];
8388
+ return i === "**" && r === "**" ? s : i === ".." && r && r !== ".." && r !== "." && r !== "**" ? (s.pop(), s) : (s.push(i), s);
8389
+ }, []), e.length === 0 ? [""] : e));
8390
+ }
8391
+ levelTwoFileOptimize(t) {
8392
+ Array.isArray(t) || (t = this.slashSplit(t));
8393
+ let e = !1;
8394
+ do {
8395
+ if (e = !1, !this.preserveMultipleSlashes) {
8396
+ for (let i = 1; i < t.length - 1; i++) {
8397
+ let r = t[i];
8398
+ i === 1 && r === "" && t[0] === "" || (r === "." || r === "") && (e = !0, t.splice(i, 1), i--);
8399
+ }
8400
+ t[0] === "." && t.length === 2 && (t[1] === "." || t[1] === "") && (e = !0, t.pop());
8401
+ }
8402
+ let s = 0;
8403
+ for (; (s = t.indexOf("..", s + 1)) !== -1;) {
8404
+ let i = t[s - 1];
8405
+ i && i !== "." && i !== ".." && i !== "**" && (e = !0, t.splice(s - 1, 2), s -= 2);
8406
+ }
8407
+ } while (e);
8408
+ return t.length === 0 ? [""] : t;
8409
+ }
8410
+ firstPhasePreProcess(t) {
8411
+ let e = !1;
8412
+ do {
8413
+ e = !1;
8414
+ for (let s of t) {
8415
+ let i = -1;
8416
+ for (; (i = s.indexOf("**", i + 1)) !== -1;) {
8417
+ let h = i;
8418
+ for (; s[h + 1] === "**";) h++;
8419
+ h > i && s.splice(i + 1, h - i);
8420
+ let o = s[i + 1], a = s[i + 2], l = s[i + 3];
8421
+ if (o !== ".." || !a || a === "." || a === ".." || !l || l === "." || l === "..") continue;
8422
+ e = !0, s.splice(i, 1);
8423
+ let f = s.slice(0);
8424
+ f[i] = "**", t.push(f), i--;
8425
+ }
8426
+ if (!this.preserveMultipleSlashes) {
8427
+ for (let h = 1; h < s.length - 1; h++) {
8428
+ let o = s[h];
8429
+ h === 1 && o === "" && s[0] === "" || (o === "." || o === "") && (e = !0, s.splice(h, 1), h--);
8430
+ }
8431
+ s[0] === "." && s.length === 2 && (s[1] === "." || s[1] === "") && (e = !0, s.pop());
8432
+ }
8433
+ let r = 0;
8434
+ for (; (r = s.indexOf("..", r + 1)) !== -1;) {
8435
+ let h = s[r - 1];
8436
+ if (h && h !== "." && h !== ".." && h !== "**") {
8437
+ e = !0;
8438
+ let a = r === 1 && s[r + 1] === "**" ? ["."] : [];
8439
+ s.splice(r - 1, 2, ...a), s.length === 0 && s.push(""), r -= 2;
8440
+ }
8441
+ }
8442
+ }
8443
+ } while (e);
8444
+ return t;
8445
+ }
8446
+ secondPhasePreProcess(t) {
8447
+ for (let e = 0; e < t.length - 1; e++) for (let s = e + 1; s < t.length; s++) {
8448
+ let i = this.partsMatch(t[e], t[s], !this.preserveMultipleSlashes);
8449
+ if (i) {
8450
+ t[e] = [], t[s] = i;
8451
+ break;
8452
+ }
8453
+ }
8454
+ return t.filter((e) => e.length);
8455
+ }
8456
+ partsMatch(t, e, s = !1) {
8457
+ let i = 0, r = 0, h = [], o = "";
8458
+ for (; i < t.length && r < e.length;) if (t[i] === e[r]) h.push(o === "b" ? e[r] : t[i]), i++, r++;
8459
+ else if (s && t[i] === "**" && e[r] === t[i + 1]) h.push(t[i]), i++;
8460
+ else if (s && e[r] === "**" && t[i] === e[r + 1]) h.push(e[r]), r++;
8461
+ else if (t[i] === "*" && e[r] && (this.options.dot || !e[r].startsWith(".")) && e[r] !== "**") {
8462
+ if (o === "b") return !1;
8463
+ o = "a", h.push(t[i]), i++, r++;
8464
+ } else if (e[r] === "*" && t[i] && (this.options.dot || !t[i].startsWith(".")) && t[i] !== "**") {
8465
+ if (o === "a") return !1;
8466
+ o = "b", h.push(e[r]), i++, r++;
8467
+ } else return !1;
8468
+ return t.length === e.length && h;
8469
+ }
8470
+ parseNegate() {
8471
+ if (this.nonegate) return;
8472
+ let t = this.pattern, e = !1, s = 0;
8473
+ for (let i = 0; i < t.length && t.charAt(i) === "!"; i++) e = !e, s++;
8474
+ s && (this.pattern = t.slice(s)), this.negate = e;
8475
+ }
8476
+ matchOne(t, e, s = !1) {
8477
+ let i = this.options;
8478
+ if (this.isWindows) {
8479
+ let p = typeof t[0] == "string" && /^[a-z]:$/i.test(t[0]), b = !p && t[0] === "" && t[1] === "" && t[2] === "?" && /^[a-z]:$/i.test(t[3]), w = typeof e[0] == "string" && /^[a-z]:$/i.test(e[0]), v = !w && e[0] === "" && e[1] === "" && e[2] === "?" && typeof e[3] == "string" && /^[a-z]:$/i.test(e[3]), E = b ? 3 : p ? 0 : void 0, y = v ? 3 : w ? 0 : void 0;
8480
+ if (typeof E == "number" && typeof y == "number") {
8481
+ let [S, B] = [t[E], e[y]];
8482
+ S.toLowerCase() === B.toLowerCase() && (e[y] = S, y > E ? e = e.slice(y) : E > y && (t = t.slice(E)));
8483
+ }
8484
+ }
8485
+ let { optimizationLevel: r = 1 } = this.options;
8486
+ r >= 2 && (t = this.levelTwoFileOptimize(t)), this.debug("matchOne", this, {
8487
+ file: t,
8488
+ pattern: e
8489
+ }), this.debug("matchOne", t.length, e.length);
8490
+ for (var h = 0, o = 0, a = t.length, l = e.length; h < a && o < l; h++, o++) {
8491
+ this.debug("matchOne loop");
8492
+ var f = e[o], c = t[h];
8493
+ if (this.debug(e, f, c), f === !1) return !1;
8494
+ if (f === g.GLOBSTAR) {
8495
+ this.debug("GLOBSTAR", [
8496
+ e,
8497
+ f,
8498
+ c
8499
+ ]);
8500
+ var d = h, u = o + 1;
8501
+ if (u === l) {
8502
+ for (this.debug("** at the end"); h < a; h++) if (t[h] === "." || t[h] === ".." || !i.dot && t[h].charAt(0) === ".") return !1;
8503
+ return !0;
8504
+ }
8505
+ for (; d < a;) {
8506
+ var m = t[d];
8507
+ if (this.debug(`
8508
+ globstar while`, t, d, e, u, m), this.matchOne(t.slice(d), e.slice(u), s)) return this.debug("globstar found match!", d, a, m), !0;
8509
+ if (m === "." || m === ".." || !i.dot && m.charAt(0) === ".") {
8510
+ this.debug("dot detected!", t, d, e, u);
8511
+ break;
8512
+ }
8513
+ this.debug("globstar swallow a segment, and continue"), d++;
8514
+ }
8515
+ return !!(s && (this.debug(`
8516
+ >>> no match, partial?`, t, d, e, u), d === a));
8517
+ }
8518
+ let p;
8519
+ if (typeof f == "string" ? (p = c === f, this.debug("string match", f, c, p)) : (p = f.test(c), this.debug("pattern match", f, c, p)), !p) return !1;
8520
+ }
8521
+ if (h === a && o === l) return !0;
8522
+ if (h === a) return s;
8523
+ if (o === l) return h === a - 1 && t[h] === "";
8524
+ throw new Error("wtf?");
8525
+ }
8526
+ braceExpand() {
8527
+ return (0, g.braceExpand)(this.pattern, this.options);
8528
+ }
8529
+ parse(t) {
8530
+ (0, jt.assertValidPattern)(t);
8531
+ let e = this.options;
8532
+ if (t === "**") return g.GLOBSTAR;
8533
+ if (t === "") return "";
8534
+ let s, i = null;
8535
+ (s = t.match(Fi)) ? i = e.dot ? Ni : ji : (s = t.match(Oi)) ? i = (e.nocase ? e.dot ? Ri : Ci : e.dot ? Ti : xi)(s[1]) : (s = t.match(Li)) ? i = (e.nocase ? e.dot ? Bi : Wi : e.dot ? Ii : Gi)(s) : (s = t.match(Ai)) ? i = e.dot ? Mi : ki : (s = t.match(Pi)) && (i = Di);
8536
+ let r = is.AST.fromGlob(t, this.options).toMMPattern();
8537
+ return i && typeof r == "object" && Reflect.defineProperty(r, "test", { value: i }), r;
8538
+ }
8539
+ makeRe() {
8540
+ if (this.regexp || this.regexp === !1) return this.regexp;
8541
+ let t = this.set;
8542
+ if (!t.length) return this.regexp = !1, this.regexp;
8543
+ let e = this.options, s = e.noglobstar ? Ui : e.dot ? $i : qi, i = new Set(e.nocase ? ["i"] : []), r = t.map((a) => {
8544
+ let l = a.map((c) => {
8545
+ if (c instanceof RegExp) for (let d of c.flags.split("")) i.add(d);
8546
+ return typeof c == "string" ? Ji(c) : c === g.GLOBSTAR ? g.GLOBSTAR : c._src;
8547
+ });
8548
+ l.forEach((c, d) => {
8549
+ let u = l[d + 1], m = l[d - 1];
8550
+ c !== g.GLOBSTAR || m === g.GLOBSTAR || (m === void 0 ? u !== void 0 && u !== g.GLOBSTAR ? l[d + 1] = "(?:\\/|" + s + "\\/)?" + u : l[d] = s : u === void 0 ? l[d - 1] = m + "(?:\\/|\\/" + s + ")?" : u !== g.GLOBSTAR && (l[d - 1] = m + "(?:\\/|\\/" + s + "\\/)" + u, l[d + 1] = g.GLOBSTAR));
8551
+ });
8552
+ let f = l.filter((c) => c !== g.GLOBSTAR);
8553
+ if (this.partial && f.length >= 1) {
8554
+ let c = [];
8555
+ for (let d = 1; d <= f.length; d++) c.push(f.slice(0, d).join("/"));
8556
+ return "(?:" + c.join("|") + ")";
8557
+ }
8558
+ return f.join("/");
8559
+ }).join("|"), [h, o] = t.length > 1 ? ["(?:", ")"] : ["", ""];
8560
+ r = "^" + h + r + o + "$", this.partial && (r = "^(?:\\/|" + h + r.slice(1, -1) + o + ")$"), this.negate && (r = "^(?!" + r + ").+$");
8561
+ try {
8562
+ this.regexp = new RegExp(r, [...i].join(""));
8563
+ } catch {
8564
+ this.regexp = !1;
8565
+ }
8566
+ return this.regexp;
8567
+ }
8568
+ slashSplit(t) {
8569
+ return this.preserveMultipleSlashes ? t.split("/") : this.isWindows && /^\/\/[^\/]+/.test(t) ? ["", ...t.split(/\/+/)] : t.split(/\/+/);
8570
+ }
8571
+ match(t, e = this.partial) {
8572
+ if (this.debug("match", t, this.pattern), this.comment) return !1;
8573
+ if (this.empty) return t === "";
8574
+ if (t === "/" && e) return !0;
8575
+ let s = this.options;
8576
+ this.isWindows && (t = t.split("\\").join("/"));
8577
+ let i = this.slashSplit(t);
8578
+ this.debug(this.pattern, "split", i);
8579
+ let r = this.set;
8580
+ this.debug(this.pattern, "set", r);
8581
+ let h = i[i.length - 1];
8582
+ if (!h) for (let o = i.length - 2; !h && o >= 0; o--) h = i[o];
8583
+ for (let o = 0; o < r.length; o++) {
8584
+ let a = r[o], l = i;
8585
+ if (s.matchBase && a.length === 1 && (l = [h]), this.matchOne(l, a, e)) return s.flipNegate ? !0 : !this.negate;
8586
+ }
8587
+ return s.flipNegate ? !1 : this.negate;
8588
+ }
8589
+ static defaults(t) {
8590
+ return g.minimatch.defaults(t).Minimatch;
8591
+ }
8592
+ };
8593
+ g.Minimatch = J;
8594
+ var Zi = pe();
8595
+ Object.defineProperty(g, "AST", {
8596
+ enumerable: !0,
8597
+ get: function() {
8598
+ return Zi.AST;
8599
+ }
8600
+ });
8601
+ var Qi = me();
8602
+ Object.defineProperty(g, "escape", {
8603
+ enumerable: !0,
8604
+ get: function() {
8605
+ return Qi.escape;
8606
+ }
8607
+ });
8608
+ var tr = kt();
8609
+ Object.defineProperty(g, "unescape", {
8610
+ enumerable: !0,
8611
+ get: function() {
8612
+ return tr.unescape;
8613
+ }
8614
+ });
8615
+ g.minimatch.AST = is.AST;
8616
+ g.minimatch.Minimatch = J;
8617
+ g.minimatch.escape = vi.escape;
8618
+ g.minimatch.unescape = Ei.unescape;
8619
+ });
8620
+ var fs = R((Wt) => {
8621
+ "use strict";
8622
+ Object.defineProperty(Wt, "__esModule", { value: !0 });
8623
+ Wt.LRUCache = void 0;
8624
+ var er = typeof performance == "object" && performance && typeof performance.now == "function" ? performance : Date, as = /* @__PURE__ */ new Set(), ge = typeof process == "object" && process ? process : {}, ls = (n, t, e, s) => {
8625
+ typeof ge.emitWarning == "function" ? ge.emitWarning(n, t, e, s) : console.error(`[${e}] ${t}: ${n}`);
8626
+ }, Lt = globalThis.AbortController, os = globalThis.AbortSignal;
8627
+ if (typeof Lt > "u") {
8628
+ os = class {
8629
+ onabort;
8630
+ _onabort = [];
8631
+ reason;
8632
+ aborted = !1;
8633
+ addEventListener(e, s) {
8634
+ this._onabort.push(s);
8635
+ }
8636
+ }, Lt = class {
8637
+ constructor() {
8638
+ t();
8639
+ }
8640
+ signal = new os();
8641
+ abort(e) {
8642
+ if (!this.signal.aborted) {
8643
+ this.signal.reason = e, this.signal.aborted = !0;
8644
+ for (let s of this.signal._onabort) s(e);
8645
+ this.signal.onabort?.(e);
8646
+ }
8647
+ }
8648
+ };
8649
+ let n = ge.env?.LRU_CACHE_IGNORE_AC_WARNING !== "1", t = () => {
8650
+ n && (n = !1, ls("AbortController is not defined. If using lru-cache in node 14, load an AbortController polyfill from the `node-abort-controller` package. A minimal polyfill is provided for use by LRUCache.fetch(), but it should not be relied upon in other contexts (eg, passing it to other APIs that use AbortController/AbortSignal might have undesirable effects). You may disable this with LRU_CACHE_IGNORE_AC_WARNING=1 in the env.", "NO_ABORT_CONTROLLER", "ENOTSUP", t));
8651
+ };
8652
+ }
8653
+ var sr = (n) => !as.has(n), V = (n) => n && n === Math.floor(n) && n > 0 && isFinite(n), cs = (n) => V(n) ? n <= Math.pow(2, 8) ? Uint8Array : n <= Math.pow(2, 16) ? Uint16Array : n <= Math.pow(2, 32) ? Uint32Array : n <= Number.MAX_SAFE_INTEGER ? Nt : null : null, Nt = class extends Array {
8654
+ constructor(n) {
8655
+ super(n), this.fill(0);
8656
+ }
8657
+ }, ir = class at {
8658
+ heap;
8659
+ length;
8660
+ static #t = !1;
8661
+ static create(t) {
8662
+ let e = cs(t);
8663
+ if (!e) return [];
8664
+ at.#t = !0;
8665
+ let s = new at(t, e);
8666
+ return at.#t = !1, s;
8667
+ }
8668
+ constructor(t, e) {
8669
+ if (!at.#t) throw new TypeError("instantiate Stack using Stack.create(n)");
8670
+ this.heap = new e(t), this.length = 0;
8671
+ }
8672
+ push(t) {
8673
+ this.heap[this.length++] = t;
8674
+ }
8675
+ pop() {
8676
+ return this.heap[--this.length];
8677
+ }
8678
+ };
8679
+ Wt.LRUCache = class us {
8680
+ #t;
8681
+ #s;
8682
+ #n;
8683
+ #r;
8684
+ #h;
8685
+ #S;
8686
+ #w;
8687
+ #c;
8688
+ get perf() {
8689
+ return this.#c;
8690
+ }
8691
+ ttl;
8692
+ ttlResolution;
8693
+ ttlAutopurge;
8694
+ updateAgeOnGet;
8695
+ updateAgeOnHas;
8696
+ allowStale;
8697
+ noDisposeOnSet;
8698
+ noUpdateTTL;
8699
+ maxEntrySize;
8700
+ sizeCalculation;
8701
+ noDeleteOnFetchRejection;
8702
+ noDeleteOnStaleGet;
8703
+ allowStaleOnFetchAbort;
8704
+ allowStaleOnFetchRejection;
8705
+ ignoreFetchAbort;
8706
+ #o;
8707
+ #f;
8708
+ #u;
8709
+ #a;
8710
+ #i;
8711
+ #d;
8712
+ #v;
8713
+ #y;
8714
+ #p;
8715
+ #R;
8716
+ #m;
8717
+ #O;
8718
+ #x;
8719
+ #g;
8720
+ #b;
8721
+ #E;
8722
+ #T;
8723
+ #e;
8724
+ #F;
8725
+ static unsafeExposeInternals(t) {
8726
+ return {
8727
+ starts: t.#x,
8728
+ ttls: t.#g,
8729
+ autopurgeTimers: t.#b,
8730
+ sizes: t.#O,
8731
+ keyMap: t.#u,
8732
+ keyList: t.#a,
8733
+ valList: t.#i,
8734
+ next: t.#d,
8735
+ prev: t.#v,
8736
+ get head() {
8737
+ return t.#y;
8738
+ },
8739
+ get tail() {
8740
+ return t.#p;
8741
+ },
8742
+ free: t.#R,
8743
+ isBackgroundFetch: (e) => t.#l(e),
8744
+ backgroundFetch: (e, s, i, r) => t.#z(e, s, i, r),
8745
+ moveToTail: (e) => t.#N(e),
8746
+ indexes: (e) => t.#k(e),
8747
+ rindexes: (e) => t.#M(e),
8748
+ isStale: (e) => t.#_(e)
8749
+ };
8750
+ }
8751
+ get max() {
8752
+ return this.#t;
8753
+ }
8754
+ get maxSize() {
8755
+ return this.#s;
8756
+ }
8757
+ get calculatedSize() {
8758
+ return this.#f;
8759
+ }
8760
+ get size() {
8761
+ return this.#o;
8762
+ }
8763
+ get fetchMethod() {
8764
+ return this.#S;
8765
+ }
8766
+ get memoMethod() {
8767
+ return this.#w;
8768
+ }
8769
+ get dispose() {
8770
+ return this.#n;
8771
+ }
8772
+ get onInsert() {
8773
+ return this.#r;
8774
+ }
8775
+ get disposeAfter() {
8776
+ return this.#h;
8777
+ }
8778
+ constructor(t) {
8779
+ let { max: e = 0, ttl: s, ttlResolution: i = 1, ttlAutopurge: r, updateAgeOnGet: h, updateAgeOnHas: o, allowStale: a, dispose: l, onInsert: f, disposeAfter: c, noDisposeOnSet: d, noUpdateTTL: u, maxSize: m = 0, maxEntrySize: p = 0, sizeCalculation: b, fetchMethod: w, memoMethod: v, noDeleteOnFetchRejection: E, noDeleteOnStaleGet: y, allowStaleOnFetchRejection: S, allowStaleOnFetchAbort: B, ignoreFetchAbort: U, perf: et } = t;
8780
+ if (et !== void 0 && typeof et?.now != "function") throw new TypeError("perf option must have a now() method if specified");
8781
+ if (this.#c = et ?? er, e !== 0 && !V(e)) throw new TypeError("max option must be a nonnegative integer");
8782
+ let st = e ? cs(e) : Array;
8783
+ if (!st) throw new Error("invalid max value: " + e);
8784
+ if (this.#t = e, this.#s = m, this.maxEntrySize = p || this.#s, this.sizeCalculation = b, this.sizeCalculation) {
8785
+ if (!this.#s && !this.maxEntrySize) throw new TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");
8786
+ if (typeof this.sizeCalculation != "function") throw new TypeError("sizeCalculation set to non-function");
8787
+ }
8788
+ if (v !== void 0 && typeof v != "function") throw new TypeError("memoMethod must be a function if defined");
8789
+ if (this.#w = v, w !== void 0 && typeof w != "function") throw new TypeError("fetchMethod must be a function if specified");
8790
+ if (this.#S = w, this.#T = !!w, this.#u = /* @__PURE__ */ new Map(), this.#a = new Array(e).fill(void 0), this.#i = new Array(e).fill(void 0), this.#d = new st(e), this.#v = new st(e), this.#y = 0, this.#p = 0, this.#R = ir.create(e), this.#o = 0, this.#f = 0, typeof l == "function" && (this.#n = l), typeof f == "function" && (this.#r = f), typeof c == "function" ? (this.#h = c, this.#m = []) : (this.#h = void 0, this.#m = void 0), this.#E = !!this.#n, this.#F = !!this.#r, this.#e = !!this.#h, this.noDisposeOnSet = !!d, this.noUpdateTTL = !!u, this.noDeleteOnFetchRejection = !!E, this.allowStaleOnFetchRejection = !!S, this.allowStaleOnFetchAbort = !!B, this.ignoreFetchAbort = !!U, this.maxEntrySize !== 0) {
8791
+ if (this.#s !== 0 && !V(this.#s)) throw new TypeError("maxSize must be a positive integer if specified");
8792
+ if (!V(this.maxEntrySize)) throw new TypeError("maxEntrySize must be a positive integer if specified");
8793
+ this.#$();
8794
+ }
8795
+ if (this.allowStale = !!a, this.noDeleteOnStaleGet = !!y, this.updateAgeOnGet = !!h, this.updateAgeOnHas = !!o, this.ttlResolution = V(i) || i === 0 ? i : 1, this.ttlAutopurge = !!r, this.ttl = s || 0, this.ttl) {
8796
+ if (!V(this.ttl)) throw new TypeError("ttl must be a positive integer if specified");
8797
+ this.#P();
8798
+ }
8799
+ if (this.#t === 0 && this.ttl === 0 && this.#s === 0) throw new TypeError("At least one of max, maxSize, or ttl is required");
8800
+ if (!this.ttlAutopurge && !this.#t && !this.#s) {
8801
+ let le = "LRU_CACHE_UNBOUNDED";
8802
+ sr(le) && (as.add(le), ls("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.", "UnboundedCacheWarning", le, us));
8803
+ }
8804
+ }
8805
+ getRemainingTTL(t) {
8806
+ return this.#u.has(t) ? Infinity : 0;
8807
+ }
8808
+ #P() {
8809
+ let t = new Nt(this.#t), e = new Nt(this.#t);
8810
+ this.#g = t, this.#x = e;
8811
+ let s = this.ttlAutopurge ? new Array(this.#t) : void 0;
8812
+ this.#b = s, this.#W = (h, o, a = this.#c.now()) => {
8813
+ if (e[h] = o !== 0 ? a : 0, t[h] = o, s?.[h] && (clearTimeout(s[h]), s[h] = void 0), o !== 0 && s) {
8814
+ let l = setTimeout(() => {
8815
+ this.#_(h) && this.#A(this.#a[h], "expire");
8816
+ }, o + 1);
8817
+ l.unref && l.unref(), s[h] = l;
8818
+ }
8819
+ }, this.#C = (h) => {
8820
+ e[h] = t[h] !== 0 ? this.#c.now() : 0;
8821
+ }, this.#D = (h, o) => {
8822
+ if (t[o]) {
8823
+ let a = t[o], l = e[o];
8824
+ if (!a || !l) return;
8825
+ h.ttl = a, h.start = l, h.now = i || r();
8826
+ h.remainingTTL = a - (h.now - l);
8827
+ }
8828
+ };
8829
+ let i = 0, r = () => {
8830
+ let h = this.#c.now();
8831
+ if (this.ttlResolution > 0) {
8832
+ i = h;
8833
+ let o = setTimeout(() => i = 0, this.ttlResolution);
8834
+ o.unref && o.unref();
8835
+ }
8836
+ return h;
8837
+ };
8838
+ this.getRemainingTTL = (h) => {
8839
+ let o = this.#u.get(h);
8840
+ if (o === void 0) return 0;
8841
+ let a = t[o], l = e[o];
8842
+ if (!a || !l) return Infinity;
8843
+ return a - ((i || r()) - l);
8844
+ }, this.#_ = (h) => {
8845
+ let o = e[h], a = t[h];
8846
+ return !!a && !!o && (i || r()) - o > a;
8847
+ };
8848
+ }
8849
+ #C = () => {};
8850
+ #D = () => {};
8851
+ #W = () => {};
8852
+ #_ = () => !1;
8853
+ #$() {
8854
+ let t = new Nt(this.#t);
8855
+ this.#f = 0, this.#O = t, this.#L = (e) => {
8856
+ this.#f -= t[e], t[e] = 0;
8857
+ }, this.#B = (e, s, i, r) => {
8858
+ if (this.#l(s)) return 0;
8859
+ if (!V(i)) if (r) {
8860
+ if (typeof r != "function") throw new TypeError("sizeCalculation must be a function");
8861
+ if (i = r(s, e), !V(i)) throw new TypeError("sizeCalculation return invalid (expect positive integer)");
8862
+ } else throw new TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.");
8863
+ return i;
8864
+ }, this.#j = (e, s, i) => {
8865
+ if (t[e] = s, this.#s) {
8866
+ let r = this.#s - t[e];
8867
+ for (; this.#f > r;) this.#G(!0);
8868
+ }
8869
+ this.#f += t[e], i && (i.entrySize = s, i.totalCalculatedSize = this.#f);
8870
+ };
8871
+ }
8872
+ #L = (t) => {};
8873
+ #j = (t, e, s) => {};
8874
+ #B = (t, e, s, i) => {
8875
+ if (s || i) throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");
8876
+ return 0;
8877
+ };
8878
+ *#k({ allowStale: t = this.allowStale } = {}) {
8879
+ if (this.#o) for (let e = this.#p; !(!this.#I(e) || ((t || !this.#_(e)) && (yield e), e === this.#y));) e = this.#v[e];
8880
+ }
8881
+ *#M({ allowStale: t = this.allowStale } = {}) {
8882
+ if (this.#o) for (let e = this.#y; !(!this.#I(e) || ((t || !this.#_(e)) && (yield e), e === this.#p));) e = this.#d[e];
8883
+ }
8884
+ #I(t) {
8885
+ return t !== void 0 && this.#u.get(this.#a[t]) === t;
8886
+ }
8887
+ *entries() {
8888
+ for (let t of this.#k()) this.#i[t] !== void 0 && this.#a[t] !== void 0 && !this.#l(this.#i[t]) && (yield [this.#a[t], this.#i[t]]);
8889
+ }
8890
+ *rentries() {
8891
+ for (let t of this.#M()) this.#i[t] !== void 0 && this.#a[t] !== void 0 && !this.#l(this.#i[t]) && (yield [this.#a[t], this.#i[t]]);
8892
+ }
8893
+ *keys() {
8894
+ for (let t of this.#k()) {
8895
+ let e = this.#a[t];
8896
+ e !== void 0 && !this.#l(this.#i[t]) && (yield e);
8897
+ }
8898
+ }
8899
+ *rkeys() {
8900
+ for (let t of this.#M()) {
8901
+ let e = this.#a[t];
8902
+ e !== void 0 && !this.#l(this.#i[t]) && (yield e);
8903
+ }
8904
+ }
8905
+ *values() {
8906
+ for (let t of this.#k()) this.#i[t] !== void 0 && !this.#l(this.#i[t]) && (yield this.#i[t]);
8907
+ }
8908
+ *rvalues() {
8909
+ for (let t of this.#M()) this.#i[t] !== void 0 && !this.#l(this.#i[t]) && (yield this.#i[t]);
8910
+ }
8911
+ [Symbol.iterator]() {
8912
+ return this.entries();
8913
+ }
8914
+ [Symbol.toStringTag] = "LRUCache";
8915
+ find(t, e = {}) {
8916
+ for (let s of this.#k()) {
8917
+ let i = this.#i[s], r = this.#l(i) ? i.__staleWhileFetching : i;
8918
+ if (r !== void 0 && t(r, this.#a[s], this)) return this.get(this.#a[s], e);
8919
+ }
8920
+ }
8921
+ forEach(t, e = this) {
8922
+ for (let s of this.#k()) {
8923
+ let i = this.#i[s], r = this.#l(i) ? i.__staleWhileFetching : i;
8924
+ r !== void 0 && t.call(e, r, this.#a[s], this);
8925
+ }
8926
+ }
8927
+ rforEach(t, e = this) {
8928
+ for (let s of this.#M()) {
8929
+ let i = this.#i[s], r = this.#l(i) ? i.__staleWhileFetching : i;
8930
+ r !== void 0 && t.call(e, r, this.#a[s], this);
8931
+ }
8932
+ }
8933
+ purgeStale() {
8934
+ let t = !1;
8935
+ for (let e of this.#M({ allowStale: !0 })) this.#_(e) && (this.#A(this.#a[e], "expire"), t = !0);
8936
+ return t;
8937
+ }
8938
+ info(t) {
8939
+ let e = this.#u.get(t);
8940
+ if (e === void 0) return;
8941
+ let s = this.#i[e], i = this.#l(s) ? s.__staleWhileFetching : s;
8942
+ if (i === void 0) return;
8943
+ let r = { value: i };
8944
+ if (this.#g && this.#x) {
8945
+ let h = this.#g[e], o = this.#x[e];
8946
+ if (h && o) r.ttl = h - (this.#c.now() - o), r.start = Date.now();
8947
+ }
8948
+ return this.#O && (r.size = this.#O[e]), r;
8949
+ }
8950
+ dump() {
8951
+ let t = [];
8952
+ for (let e of this.#k({ allowStale: !0 })) {
8953
+ let s = this.#a[e], i = this.#i[e], r = this.#l(i) ? i.__staleWhileFetching : i;
8954
+ if (r === void 0 || s === void 0) continue;
8955
+ let h = { value: r };
8956
+ if (this.#g && this.#x) {
8957
+ h.ttl = this.#g[e];
8958
+ let o = this.#c.now() - this.#x[e];
8959
+ h.start = Math.floor(Date.now() - o);
8960
+ }
8961
+ this.#O && (h.size = this.#O[e]), t.unshift([s, h]);
8962
+ }
8963
+ return t;
8964
+ }
8965
+ load(t) {
8966
+ this.clear();
8967
+ for (let [e, s] of t) {
8968
+ if (s.start) {
8969
+ let i = Date.now() - s.start;
8970
+ s.start = this.#c.now() - i;
8971
+ }
8972
+ this.set(e, s.value, s);
8973
+ }
8974
+ }
8975
+ set(t, e, s = {}) {
8976
+ if (e === void 0) return this.delete(t), this;
8977
+ let { ttl: i = this.ttl, start: r, noDisposeOnSet: h = this.noDisposeOnSet, sizeCalculation: o = this.sizeCalculation, status: a } = s, { noUpdateTTL: l = this.noUpdateTTL } = s, f = this.#B(t, e, s.size || 0, o);
8978
+ if (this.maxEntrySize && f > this.maxEntrySize) return a && (a.set = "miss", a.maxEntrySizeExceeded = !0), this.#A(t, "set"), this;
8979
+ let c = this.#o === 0 ? void 0 : this.#u.get(t);
8980
+ if (c === void 0) c = this.#o === 0 ? this.#p : this.#R.length !== 0 ? this.#R.pop() : this.#o === this.#t ? this.#G(!1) : this.#o, this.#a[c] = t, this.#i[c] = e, this.#u.set(t, c), this.#d[this.#p] = c, this.#v[c] = this.#p, this.#p = c, this.#o++, this.#j(c, f, a), a && (a.set = "add"), l = !1, this.#F && this.#r?.(e, t, "add");
8981
+ else {
8982
+ this.#N(c);
8983
+ let d = this.#i[c];
8984
+ if (e !== d) {
8985
+ if (this.#T && this.#l(d)) {
8986
+ d.__abortController.abort(/* @__PURE__ */ new Error("replaced"));
8987
+ let { __staleWhileFetching: u } = d;
8988
+ u !== void 0 && !h && (this.#E && this.#n?.(u, t, "set"), this.#e && this.#m?.push([
8989
+ u,
8990
+ t,
8991
+ "set"
8992
+ ]));
8993
+ } else h || (this.#E && this.#n?.(d, t, "set"), this.#e && this.#m?.push([
8994
+ d,
8995
+ t,
8996
+ "set"
8997
+ ]));
8998
+ if (this.#L(c), this.#j(c, f, a), this.#i[c] = e, a) {
8999
+ a.set = "replace";
9000
+ let u = d && this.#l(d) ? d.__staleWhileFetching : d;
9001
+ u !== void 0 && (a.oldValue = u);
9002
+ }
9003
+ } else a && (a.set = "update");
9004
+ this.#F && this.onInsert?.(e, t, e === d ? "update" : "replace");
9005
+ }
9006
+ if (i !== 0 && !this.#g && this.#P(), this.#g && (l || this.#W(c, i, r), a && this.#D(a, c)), !h && this.#e && this.#m) {
9007
+ let d = this.#m, u;
9008
+ for (; u = d?.shift();) this.#h?.(...u);
9009
+ }
9010
+ return this;
9011
+ }
9012
+ pop() {
9013
+ try {
9014
+ for (; this.#o;) {
9015
+ let t = this.#i[this.#y];
9016
+ if (this.#G(!0), this.#l(t)) {
9017
+ if (t.__staleWhileFetching) return t.__staleWhileFetching;
9018
+ } else if (t !== void 0) return t;
9019
+ }
9020
+ } finally {
9021
+ if (this.#e && this.#m) {
9022
+ let t = this.#m, e;
9023
+ for (; e = t?.shift();) this.#h?.(...e);
9024
+ }
9025
+ }
9026
+ }
9027
+ #G(t) {
9028
+ let e = this.#y, s = this.#a[e], i = this.#i[e];
9029
+ return this.#T && this.#l(i) ? i.__abortController.abort(/* @__PURE__ */ new Error("evicted")) : (this.#E || this.#e) && (this.#E && this.#n?.(i, s, "evict"), this.#e && this.#m?.push([
9030
+ i,
9031
+ s,
9032
+ "evict"
9033
+ ])), this.#L(e), this.#b?.[e] && (clearTimeout(this.#b[e]), this.#b[e] = void 0), t && (this.#a[e] = void 0, this.#i[e] = void 0, this.#R.push(e)), this.#o === 1 ? (this.#y = this.#p = 0, this.#R.length = 0) : this.#y = this.#d[e], this.#u.delete(s), this.#o--, e;
9034
+ }
9035
+ has(t, e = {}) {
9036
+ let { updateAgeOnHas: s = this.updateAgeOnHas, status: i } = e, r = this.#u.get(t);
9037
+ if (r !== void 0) {
9038
+ let h = this.#i[r];
9039
+ if (this.#l(h) && h.__staleWhileFetching === void 0) return !1;
9040
+ if (this.#_(r)) i && (i.has = "stale", this.#D(i, r));
9041
+ else return s && this.#C(r), i && (i.has = "hit", this.#D(i, r)), !0;
9042
+ } else i && (i.has = "miss");
9043
+ return !1;
9044
+ }
9045
+ peek(t, e = {}) {
9046
+ let { allowStale: s = this.allowStale } = e, i = this.#u.get(t);
9047
+ if (i === void 0 || !s && this.#_(i)) return;
9048
+ let r = this.#i[i];
9049
+ return this.#l(r) ? r.__staleWhileFetching : r;
9050
+ }
9051
+ #z(t, e, s, i) {
9052
+ let r = e === void 0 ? void 0 : this.#i[e];
9053
+ if (this.#l(r)) return r;
9054
+ let h = new Lt(), { signal: o } = s;
9055
+ o?.addEventListener("abort", () => h.abort(o.reason), { signal: h.signal });
9056
+ let a = {
9057
+ signal: h.signal,
9058
+ options: s,
9059
+ context: i
9060
+ }, l = (p, b = !1) => {
9061
+ let { aborted: w } = h.signal, v = s.ignoreFetchAbort && p !== void 0, E = s.ignoreFetchAbort || !!(s.allowStaleOnFetchAbort && p !== void 0);
9062
+ if (s.status && (w && !b ? (s.status.fetchAborted = !0, s.status.fetchError = h.signal.reason, v && (s.status.fetchAbortIgnored = !0)) : s.status.fetchResolved = !0), w && !v && !b) return c(h.signal.reason, E);
9063
+ let y = u, S = this.#i[e];
9064
+ return (S === u || v && b && S === void 0) && (p === void 0 ? y.__staleWhileFetching !== void 0 ? this.#i[e] = y.__staleWhileFetching : this.#A(t, "fetch") : (s.status && (s.status.fetchUpdated = !0), this.set(t, p, a.options))), p;
9065
+ }, f = (p) => (s.status && (s.status.fetchRejected = !0, s.status.fetchError = p), c(p, !1)), c = (p, b) => {
9066
+ let { aborted: w } = h.signal, v = w && s.allowStaleOnFetchAbort, E = v || s.allowStaleOnFetchRejection, y = E || s.noDeleteOnFetchRejection, S = u;
9067
+ if (this.#i[e] === u && (!y || !b && S.__staleWhileFetching === void 0 ? this.#A(t, "fetch") : v || (this.#i[e] = S.__staleWhileFetching)), E) return s.status && S.__staleWhileFetching !== void 0 && (s.status.returnedStale = !0), S.__staleWhileFetching;
9068
+ if (S.__returned === S) throw p;
9069
+ }, d = (p, b) => {
9070
+ let w = this.#S?.(t, r, a);
9071
+ w && w instanceof Promise && w.then((v) => p(v === void 0 ? void 0 : v), b), h.signal.addEventListener("abort", () => {
9072
+ (!s.ignoreFetchAbort || s.allowStaleOnFetchAbort) && (p(void 0), s.allowStaleOnFetchAbort && (p = (v) => l(v, !0)));
9073
+ });
9074
+ };
9075
+ s.status && (s.status.fetchDispatched = !0);
9076
+ let u = new Promise(d).then(l, f), m = Object.assign(u, {
9077
+ __abortController: h,
9078
+ __staleWhileFetching: r,
9079
+ __returned: void 0
9080
+ });
9081
+ return e === void 0 ? (this.set(t, m, {
9082
+ ...a.options,
9083
+ status: void 0
9084
+ }), e = this.#u.get(t)) : this.#i[e] = m, m;
9085
+ }
9086
+ #l(t) {
9087
+ if (!this.#T) return !1;
9088
+ let e = t;
9089
+ return !!e && e instanceof Promise && e.hasOwnProperty("__staleWhileFetching") && e.__abortController instanceof Lt;
9090
+ }
9091
+ async fetch(t, e = {}) {
9092
+ let { allowStale: s = this.allowStale, updateAgeOnGet: i = this.updateAgeOnGet, noDeleteOnStaleGet: r = this.noDeleteOnStaleGet, ttl: h = this.ttl, noDisposeOnSet: o = this.noDisposeOnSet, size: a = 0, sizeCalculation: l = this.sizeCalculation, noUpdateTTL: f = this.noUpdateTTL, noDeleteOnFetchRejection: c = this.noDeleteOnFetchRejection, allowStaleOnFetchRejection: d = this.allowStaleOnFetchRejection, ignoreFetchAbort: u = this.ignoreFetchAbort, allowStaleOnFetchAbort: m = this.allowStaleOnFetchAbort, context: p, forceRefresh: b = !1, status: w, signal: v } = e;
9093
+ if (!this.#T) return w && (w.fetch = "get"), this.get(t, {
9094
+ allowStale: s,
9095
+ updateAgeOnGet: i,
9096
+ noDeleteOnStaleGet: r,
9097
+ status: w
9098
+ });
9099
+ let E = {
9100
+ allowStale: s,
9101
+ updateAgeOnGet: i,
9102
+ noDeleteOnStaleGet: r,
9103
+ ttl: h,
9104
+ noDisposeOnSet: o,
9105
+ size: a,
9106
+ sizeCalculation: l,
9107
+ noUpdateTTL: f,
9108
+ noDeleteOnFetchRejection: c,
9109
+ allowStaleOnFetchRejection: d,
9110
+ allowStaleOnFetchAbort: m,
9111
+ ignoreFetchAbort: u,
9112
+ status: w,
9113
+ signal: v
9114
+ }, y = this.#u.get(t);
9115
+ if (y === void 0) {
9116
+ w && (w.fetch = "miss");
9117
+ let S = this.#z(t, y, E, p);
9118
+ return S.__returned = S;
9119
+ } else {
9120
+ let S = this.#i[y];
9121
+ if (this.#l(S)) {
9122
+ let st = s && S.__staleWhileFetching !== void 0;
9123
+ return w && (w.fetch = "inflight", st && (w.returnedStale = !0)), st ? S.__staleWhileFetching : S.__returned = S;
9124
+ }
9125
+ let B = this.#_(y);
9126
+ if (!b && !B) return w && (w.fetch = "hit"), this.#N(y), i && this.#C(y), w && this.#D(w, y), S;
9127
+ let U = this.#z(t, y, E, p), et = U.__staleWhileFetching !== void 0 && s;
9128
+ return w && (w.fetch = B ? "stale" : "refresh", et && B && (w.returnedStale = !0)), et ? U.__staleWhileFetching : U.__returned = U;
9129
+ }
9130
+ }
9131
+ async forceFetch(t, e = {}) {
9132
+ let s = await this.fetch(t, e);
9133
+ if (s === void 0) throw new Error("fetch() returned undefined");
9134
+ return s;
9135
+ }
9136
+ memo(t, e = {}) {
9137
+ let s = this.#w;
9138
+ if (!s) throw new Error("no memoMethod provided to constructor");
9139
+ let { context: i, forceRefresh: r, ...h } = e, o = this.get(t, h);
9140
+ if (!r && o !== void 0) return o;
9141
+ let a = s(t, o, {
9142
+ options: h,
9143
+ context: i
9144
+ });
9145
+ return this.set(t, a, h), a;
9146
+ }
9147
+ get(t, e = {}) {
9148
+ let { allowStale: s = this.allowStale, updateAgeOnGet: i = this.updateAgeOnGet, noDeleteOnStaleGet: r = this.noDeleteOnStaleGet, status: h } = e, o = this.#u.get(t);
9149
+ if (o !== void 0) {
9150
+ let a = this.#i[o], l = this.#l(a);
9151
+ return h && this.#D(h, o), this.#_(o) ? (h && (h.get = "stale"), l ? (h && s && a.__staleWhileFetching !== void 0 && (h.returnedStale = !0), s ? a.__staleWhileFetching : void 0) : (r || this.#A(t, "expire"), h && s && (h.returnedStale = !0), s ? a : void 0)) : (h && (h.get = "hit"), l ? a.__staleWhileFetching : (this.#N(o), i && this.#C(o), a));
9152
+ } else h && (h.get = "miss");
9153
+ }
9154
+ #U(t, e) {
9155
+ this.#v[e] = t, this.#d[t] = e;
9156
+ }
9157
+ #N(t) {
9158
+ t !== this.#p && (t === this.#y ? this.#y = this.#d[t] : this.#U(this.#v[t], this.#d[t]), this.#U(this.#p, t), this.#p = t);
9159
+ }
9160
+ delete(t) {
9161
+ return this.#A(t, "delete");
9162
+ }
9163
+ #A(t, e) {
9164
+ let s = !1;
9165
+ if (this.#o !== 0) {
9166
+ let i = this.#u.get(t);
9167
+ if (i !== void 0) if (this.#b?.[i] && (clearTimeout(this.#b?.[i]), this.#b[i] = void 0), s = !0, this.#o === 1) this.#q(e);
9168
+ else {
9169
+ this.#L(i);
9170
+ let r = this.#i[i];
9171
+ if (this.#l(r) ? r.__abortController.abort(/* @__PURE__ */ new Error("deleted")) : (this.#E || this.#e) && (this.#E && this.#n?.(r, t, e), this.#e && this.#m?.push([
9172
+ r,
9173
+ t,
9174
+ e
9175
+ ])), this.#u.delete(t), this.#a[i] = void 0, this.#i[i] = void 0, i === this.#p) this.#p = this.#v[i];
9176
+ else if (i === this.#y) this.#y = this.#d[i];
9177
+ else {
9178
+ let h = this.#v[i];
9179
+ this.#d[h] = this.#d[i];
9180
+ let o = this.#d[i];
9181
+ this.#v[o] = this.#v[i];
9182
+ }
9183
+ this.#o--, this.#R.push(i);
9184
+ }
9185
+ }
9186
+ if (this.#e && this.#m?.length) {
9187
+ let i = this.#m, r;
9188
+ for (; r = i?.shift();) this.#h?.(...r);
9189
+ }
9190
+ return s;
9191
+ }
9192
+ clear() {
9193
+ return this.#q("delete");
9194
+ }
9195
+ #q(t) {
9196
+ for (let e of this.#M({ allowStale: !0 })) {
9197
+ let s = this.#i[e];
9198
+ if (this.#l(s)) s.__abortController.abort(/* @__PURE__ */ new Error("deleted"));
9199
+ else {
9200
+ let i = this.#a[e];
9201
+ this.#E && this.#n?.(s, i, t), this.#e && this.#m?.push([
9202
+ s,
9203
+ i,
9204
+ t
9205
+ ]);
9206
+ }
9207
+ }
9208
+ if (this.#u.clear(), this.#i.fill(void 0), this.#a.fill(void 0), this.#g && this.#x) {
9209
+ this.#g.fill(0), this.#x.fill(0);
9210
+ for (let e of this.#b ?? []) e !== void 0 && clearTimeout(e);
9211
+ this.#b?.fill(void 0);
9212
+ }
9213
+ if (this.#O && this.#O.fill(0), this.#y = 0, this.#p = 0, this.#R.length = 0, this.#f = 0, this.#o = 0, this.#e && this.#m) {
9214
+ let e = this.#m, s;
9215
+ for (; s = e?.shift();) this.#h?.(...s);
9216
+ }
9217
+ }
9218
+ };
9219
+ });
9220
+ var Oe = R((P) => {
9221
+ "use strict";
9222
+ var nr = P && P.__importDefault || function(n) {
9223
+ return n && n.__esModule ? n : { default: n };
9224
+ };
9225
+ Object.defineProperty(P, "__esModule", { value: !0 });
9226
+ P.Minipass = P.isWritable = P.isReadable = P.isStream = void 0;
9227
+ var ds = typeof process == "object" && process ? process : {
9228
+ stdout: null,
9229
+ stderr: null
9230
+ }, _e = require("node:events"), ws = nr(require("node:stream")), hr = require("node:string_decoder"), or = (n) => !!n && typeof n == "object" && (n instanceof qt || n instanceof ws.default || (0, P.isReadable)(n) || (0, P.isWritable)(n));
9231
+ P.isStream = or;
9232
+ var ar = (n) => !!n && typeof n == "object" && n instanceof _e.EventEmitter && typeof n.pipe == "function" && n.pipe !== ws.default.Writable.prototype.pipe;
9233
+ P.isReadable = ar;
9234
+ var lr = (n) => !!n && typeof n == "object" && n instanceof _e.EventEmitter && typeof n.write == "function" && typeof n.end == "function";
9235
+ P.isWritable = lr;
9236
+ var $ = Symbol("EOF"), q = Symbol("maybeEmitEnd"), K = Symbol("emittedEnd"), Bt = Symbol("emittingEnd"), lt = Symbol("emittedError"), It = Symbol("closed"), ps = Symbol("read"), Gt = Symbol("flush"), ms = Symbol("flushChunk"), L = Symbol("encoding"), rt = Symbol("decoder"), x = Symbol("flowing"), ct = Symbol("paused"), nt = Symbol("resume"), T = Symbol("buffer"), M = Symbol("pipes"), C = Symbol("bufferLength"), we = Symbol("bufferPush"), zt = Symbol("bufferShift"), k = Symbol("objectMode"), O = Symbol("destroyed"), be = Symbol("error"), ye = Symbol("emitData"), gs = Symbol("emitEnd"), Se = Symbol("emitEnd2"), I = Symbol("async"), ve = Symbol("abort"), Ut = Symbol("aborted"), ut = Symbol("signal"), Z = Symbol("dataListeners"), D = Symbol("discarded"), ft = (n) => Promise.resolve().then(n), cr = (n) => n(), ur = (n) => n === "end" || n === "finish" || n === "prefinish", fr = (n) => n instanceof ArrayBuffer || !!n && typeof n == "object" && n.constructor && n.constructor.name === "ArrayBuffer" && n.byteLength >= 0, dr = (n) => !Buffer.isBuffer(n) && ArrayBuffer.isView(n), $t = class {
9237
+ src;
9238
+ dest;
9239
+ opts;
9240
+ ondrain;
9241
+ constructor(t, e, s) {
9242
+ this.src = t, this.dest = e, this.opts = s, this.ondrain = () => t[nt](), this.dest.on("drain", this.ondrain);
9243
+ }
9244
+ unpipe() {
9245
+ this.dest.removeListener("drain", this.ondrain);
9246
+ }
9247
+ proxyErrors(t) {}
9248
+ end() {
9249
+ this.unpipe(), this.opts.end && this.dest.end();
9250
+ }
9251
+ }, Ee = class extends $t {
9252
+ unpipe() {
9253
+ this.src.removeListener("error", this.proxyErrors), super.unpipe();
9254
+ }
9255
+ constructor(t, e, s) {
9256
+ super(t, e, s), this.proxyErrors = (i) => this.dest.emit("error", i), t.on("error", this.proxyErrors);
9257
+ }
9258
+ }, pr = (n) => !!n.objectMode, mr = (n) => !n.objectMode && !!n.encoding && n.encoding !== "buffer", qt = class extends _e.EventEmitter {
9259
+ [x] = !1;
9260
+ [ct] = !1;
9261
+ [M] = [];
9262
+ [T] = [];
9263
+ [k];
9264
+ [L];
9265
+ [I];
9266
+ [rt];
9267
+ [$] = !1;
9268
+ [K] = !1;
9269
+ [Bt] = !1;
9270
+ [It] = !1;
9271
+ [lt] = null;
9272
+ [C] = 0;
9273
+ [O] = !1;
9274
+ [ut];
9275
+ [Ut] = !1;
9276
+ [Z] = 0;
9277
+ [D] = !1;
9278
+ writable = !0;
9279
+ readable = !0;
9280
+ constructor(...t) {
9281
+ let e = t[0] || {};
9282
+ if (super(), e.objectMode && typeof e.encoding == "string") throw new TypeError("Encoding and objectMode may not be used together");
9283
+ pr(e) ? (this[k] = !0, this[L] = null) : mr(e) ? (this[L] = e.encoding, this[k] = !1) : (this[k] = !1, this[L] = null), this[I] = !!e.async, this[rt] = this[L] ? new hr.StringDecoder(this[L]) : null, e && e.debugExposeBuffer === !0 && Object.defineProperty(this, "buffer", { get: () => this[T] }), e && e.debugExposePipes === !0 && Object.defineProperty(this, "pipes", { get: () => this[M] });
9284
+ let { signal: s } = e;
9285
+ s && (this[ut] = s, s.aborted ? this[ve]() : s.addEventListener("abort", () => this[ve]()));
9286
+ }
9287
+ get bufferLength() {
9288
+ return this[C];
9289
+ }
9290
+ get encoding() {
9291
+ return this[L];
9292
+ }
9293
+ set encoding(t) {
9294
+ throw new Error("Encoding must be set at instantiation time");
9295
+ }
9296
+ setEncoding(t) {
9297
+ throw new Error("Encoding must be set at instantiation time");
9298
+ }
9299
+ get objectMode() {
9300
+ return this[k];
9301
+ }
9302
+ set objectMode(t) {
9303
+ throw new Error("objectMode must be set at instantiation time");
9304
+ }
9305
+ get async() {
9306
+ return this[I];
9307
+ }
9308
+ set async(t) {
9309
+ this[I] = this[I] || !!t;
9310
+ }
9311
+ [ve]() {
9312
+ this[Ut] = !0, this.emit("abort", this[ut]?.reason), this.destroy(this[ut]?.reason);
9313
+ }
9314
+ get aborted() {
9315
+ return this[Ut];
9316
+ }
9317
+ set aborted(t) {}
9318
+ write(t, e, s) {
9319
+ if (this[Ut]) return !1;
9320
+ if (this[$]) throw new Error("write after end");
9321
+ if (this[O]) return this.emit("error", Object.assign(/* @__PURE__ */ new Error("Cannot call write after a stream was destroyed"), { code: "ERR_STREAM_DESTROYED" })), !0;
9322
+ typeof e == "function" && (s = e, e = "utf8"), e || (e = "utf8");
9323
+ let i = this[I] ? ft : cr;
9324
+ if (!this[k] && !Buffer.isBuffer(t)) {
9325
+ if (dr(t)) t = Buffer.from(t.buffer, t.byteOffset, t.byteLength);
9326
+ else if (fr(t)) t = Buffer.from(t);
9327
+ else if (typeof t != "string") throw new Error("Non-contiguous data written to non-objectMode stream");
9328
+ }
9329
+ return this[k] ? (this[x] && this[C] !== 0 && this[Gt](!0), this[x] ? this.emit("data", t) : this[we](t), this[C] !== 0 && this.emit("readable"), s && i(s), this[x]) : t.length ? (typeof t == "string" && !(e === this[L] && !this[rt]?.lastNeed) && (t = Buffer.from(t, e)), Buffer.isBuffer(t) && this[L] && (t = this[rt].write(t)), this[x] && this[C] !== 0 && this[Gt](!0), this[x] ? this.emit("data", t) : this[we](t), this[C] !== 0 && this.emit("readable"), s && i(s), this[x]) : (this[C] !== 0 && this.emit("readable"), s && i(s), this[x]);
9330
+ }
9331
+ read(t) {
9332
+ if (this[O]) return null;
9333
+ if (this[D] = !1, this[C] === 0 || t === 0 || t && t > this[C]) return this[q](), null;
9334
+ this[k] && (t = null), this[T].length > 1 && !this[k] && (this[T] = [this[L] ? this[T].join("") : Buffer.concat(this[T], this[C])]);
9335
+ let e = this[ps](t || null, this[T][0]);
9336
+ return this[q](), e;
9337
+ }
9338
+ [ps](t, e) {
9339
+ if (this[k]) this[zt]();
9340
+ else {
9341
+ let s = e;
9342
+ t === s.length || t === null ? this[zt]() : typeof s == "string" ? (this[T][0] = s.slice(t), e = s.slice(0, t), this[C] -= t) : (this[T][0] = s.subarray(t), e = s.subarray(0, t), this[C] -= t);
9343
+ }
9344
+ return this.emit("data", e), !this[T].length && !this[$] && this.emit("drain"), e;
9345
+ }
9346
+ end(t, e, s) {
9347
+ return typeof t == "function" && (s = t, t = void 0), typeof e == "function" && (s = e, e = "utf8"), t !== void 0 && this.write(t, e), s && this.once("end", s), this[$] = !0, this.writable = !1, (this[x] || !this[ct]) && this[q](), this;
9348
+ }
9349
+ [nt]() {
9350
+ this[O] || (!this[Z] && !this[M].length && (this[D] = !0), this[ct] = !1, this[x] = !0, this.emit("resume"), this[T].length ? this[Gt]() : this[$] ? this[q]() : this.emit("drain"));
9351
+ }
9352
+ resume() {
9353
+ return this[nt]();
9354
+ }
9355
+ pause() {
9356
+ this[x] = !1, this[ct] = !0, this[D] = !1;
9357
+ }
9358
+ get destroyed() {
9359
+ return this[O];
9360
+ }
9361
+ get flowing() {
9362
+ return this[x];
9363
+ }
9364
+ get paused() {
9365
+ return this[ct];
9366
+ }
9367
+ [we](t) {
9368
+ this[k] ? this[C] += 1 : this[C] += t.length, this[T].push(t);
9369
+ }
9370
+ [zt]() {
9371
+ return this[k] ? this[C] -= 1 : this[C] -= this[T][0].length, this[T].shift();
9372
+ }
9373
+ [Gt](t = !1) {
9374
+ do ;
9375
+ while (this[ms](this[zt]()) && this[T].length);
9376
+ !t && !this[T].length && !this[$] && this.emit("drain");
9377
+ }
9378
+ [ms](t) {
9379
+ return this.emit("data", t), this[x];
9380
+ }
9381
+ pipe(t, e) {
9382
+ if (this[O]) return t;
9383
+ this[D] = !1;
9384
+ let s = this[K];
9385
+ return e = e || {}, t === ds.stdout || t === ds.stderr ? e.end = !1 : e.end = e.end !== !1, e.proxyErrors = !!e.proxyErrors, s ? e.end && t.end() : (this[M].push(e.proxyErrors ? new Ee(this, t, e) : new $t(this, t, e)), this[I] ? ft(() => this[nt]()) : this[nt]()), t;
9386
+ }
9387
+ unpipe(t) {
9388
+ let e = this[M].find((s) => s.dest === t);
9389
+ e && (this[M].length === 1 ? (this[x] && this[Z] === 0 && (this[x] = !1), this[M] = []) : this[M].splice(this[M].indexOf(e), 1), e.unpipe());
9390
+ }
9391
+ addListener(t, e) {
9392
+ return this.on(t, e);
9393
+ }
9394
+ on(t, e) {
9395
+ let s = super.on(t, e);
9396
+ if (t === "data") this[D] = !1, this[Z]++, !this[M].length && !this[x] && this[nt]();
9397
+ else if (t === "readable" && this[C] !== 0) super.emit("readable");
9398
+ else if (ur(t) && this[K]) super.emit(t), this.removeAllListeners(t);
9399
+ else if (t === "error" && this[lt]) {
9400
+ let i = e;
9401
+ this[I] ? ft(() => i.call(this, this[lt])) : i.call(this, this[lt]);
9402
+ }
9403
+ return s;
9404
+ }
9405
+ removeListener(t, e) {
9406
+ return this.off(t, e);
9407
+ }
9408
+ off(t, e) {
9409
+ let s = super.off(t, e);
9410
+ return t === "data" && (this[Z] = this.listeners("data").length, this[Z] === 0 && !this[D] && !this[M].length && (this[x] = !1)), s;
9411
+ }
9412
+ removeAllListeners(t) {
9413
+ let e = super.removeAllListeners(t);
9414
+ return (t === "data" || t === void 0) && (this[Z] = 0, !this[D] && !this[M].length && (this[x] = !1)), e;
9415
+ }
9416
+ get emittedEnd() {
9417
+ return this[K];
9418
+ }
9419
+ [q]() {
9420
+ !this[Bt] && !this[K] && !this[O] && this[T].length === 0 && this[$] && (this[Bt] = !0, this.emit("end"), this.emit("prefinish"), this.emit("finish"), this[It] && this.emit("close"), this[Bt] = !1);
9421
+ }
9422
+ emit(t, ...e) {
9423
+ let s = e[0];
9424
+ if (t !== "error" && t !== "close" && t !== O && this[O]) return !1;
9425
+ if (t === "data") return !this[k] && !s ? !1 : this[I] ? (ft(() => this[ye](s)), !0) : this[ye](s);
9426
+ if (t === "end") return this[gs]();
9427
+ if (t === "close") {
9428
+ if (this[It] = !0, !this[K] && !this[O]) return !1;
9429
+ let r = super.emit("close");
9430
+ return this.removeAllListeners("close"), r;
9431
+ } else if (t === "error") {
9432
+ this[lt] = s, super.emit(be, s);
9433
+ let r = !this[ut] || this.listeners("error").length ? super.emit("error", s) : !1;
9434
+ return this[q](), r;
9435
+ } else if (t === "resume") {
9436
+ let r = super.emit("resume");
9437
+ return this[q](), r;
9438
+ } else if (t === "finish" || t === "prefinish") {
9439
+ let r = super.emit(t);
9440
+ return this.removeAllListeners(t), r;
9441
+ }
9442
+ let i = super.emit(t, ...e);
9443
+ return this[q](), i;
9444
+ }
9445
+ [ye](t) {
9446
+ for (let s of this[M]) s.dest.write(t) === !1 && this.pause();
9447
+ let e = this[D] ? !1 : super.emit("data", t);
9448
+ return this[q](), e;
9449
+ }
9450
+ [gs]() {
9451
+ return this[K] ? !1 : (this[K] = !0, this.readable = !1, this[I] ? (ft(() => this[Se]()), !0) : this[Se]());
9452
+ }
9453
+ [Se]() {
9454
+ if (this[rt]) {
9455
+ let e = this[rt].end();
9456
+ if (e) {
9457
+ for (let s of this[M]) s.dest.write(e);
9458
+ this[D] || super.emit("data", e);
9459
+ }
9460
+ }
9461
+ for (let e of this[M]) e.end();
9462
+ let t = super.emit("end");
9463
+ return this.removeAllListeners("end"), t;
9464
+ }
9465
+ async collect() {
9466
+ let t = Object.assign([], { dataLength: 0 });
9467
+ this[k] || (t.dataLength = 0);
9468
+ let e = this.promise();
9469
+ return this.on("data", (s) => {
9470
+ t.push(s), this[k] || (t.dataLength += s.length);
9471
+ }), await e, t;
9472
+ }
9473
+ async concat() {
9474
+ if (this[k]) throw new Error("cannot concat in objectMode");
9475
+ let t = await this.collect();
9476
+ return this[L] ? t.join("") : Buffer.concat(t, t.dataLength);
9477
+ }
9478
+ async promise() {
9479
+ return new Promise((t, e) => {
9480
+ this.on(O, () => e(/* @__PURE__ */ new Error("stream destroyed"))), this.on("error", (s) => e(s)), this.on("end", () => t());
9481
+ });
9482
+ }
9483
+ [Symbol.asyncIterator]() {
9484
+ this[D] = !1;
9485
+ let t = !1, e = async () => (this.pause(), t = !0, {
9486
+ value: void 0,
9487
+ done: !0
9488
+ });
9489
+ return {
9490
+ next: () => {
9491
+ if (t) return e();
9492
+ let i = this.read();
9493
+ if (i !== null) return Promise.resolve({
9494
+ done: !1,
9495
+ value: i
9496
+ });
9497
+ if (this[$]) return e();
9498
+ let r, h, o = (c) => {
9499
+ this.off("data", a), this.off("end", l), this.off(O, f), e(), h(c);
9500
+ }, a = (c) => {
9501
+ this.off("error", o), this.off("end", l), this.off(O, f), this.pause(), r({
9502
+ value: c,
9503
+ done: !!this[$]
9504
+ });
9505
+ }, l = () => {
9506
+ this.off("error", o), this.off("data", a), this.off(O, f), e(), r({
9507
+ done: !0,
9508
+ value: void 0
9509
+ });
9510
+ }, f = () => o(/* @__PURE__ */ new Error("stream destroyed"));
9511
+ return new Promise((c, d) => {
9512
+ h = d, r = c, this.once(O, f), this.once("error", o), this.once("end", l), this.once("data", a);
9513
+ });
9514
+ },
9515
+ throw: e,
9516
+ return: e,
9517
+ [Symbol.asyncIterator]() {
9518
+ return this;
9519
+ },
9520
+ [Symbol.asyncDispose]: async () => {}
9521
+ };
9522
+ }
9523
+ [Symbol.iterator]() {
9524
+ this[D] = !1;
9525
+ let t = !1, e = () => (this.pause(), this.off(be, e), this.off(O, e), this.off("end", e), t = !0, {
9526
+ done: !0,
9527
+ value: void 0
9528
+ }), s = () => {
9529
+ if (t) return e();
9530
+ let i = this.read();
9531
+ return i === null ? e() : {
9532
+ done: !1,
9533
+ value: i
9534
+ };
9535
+ };
9536
+ return this.once("end", e), this.once(be, e), this.once(O, e), {
9537
+ next: s,
9538
+ throw: e,
9539
+ return: e,
9540
+ [Symbol.iterator]() {
9541
+ return this;
9542
+ },
9543
+ [Symbol.dispose]: () => {}
9544
+ };
9545
+ }
9546
+ destroy(t) {
9547
+ if (this[O]) return t ? this.emit("error", t) : this.emit(O), this;
9548
+ this[O] = !0, this[D] = !0, this[T].length = 0, this[C] = 0;
9549
+ let e = this;
9550
+ return typeof e.close == "function" && !this[It] && e.close(), t ? this.emit("error", t) : this.emit(O), this;
9551
+ }
9552
+ static get isStream() {
9553
+ return P.isStream;
9554
+ }
9555
+ };
9556
+ P.Minipass = qt;
9557
+ });
9558
+ var Ms = R((_) => {
9559
+ "use strict";
9560
+ var gr = _ && _.__createBinding || (Object.create ? (function(n, t, e, s) {
9561
+ s === void 0 && (s = e);
9562
+ var i = Object.getOwnPropertyDescriptor(t, e);
9563
+ (!i || ("get" in i ? !t.__esModule : i.writable || i.configurable)) && (i = {
9564
+ enumerable: !0,
9565
+ get: function() {
9566
+ return t[e];
9567
+ }
9568
+ }), Object.defineProperty(n, s, i);
9569
+ }) : (function(n, t, e, s) {
9570
+ s === void 0 && (s = e), n[s] = t[e];
9571
+ })), wr = _ && _.__setModuleDefault || (Object.create ? (function(n, t) {
9572
+ Object.defineProperty(n, "default", {
9573
+ enumerable: !0,
9574
+ value: t
9575
+ });
9576
+ }) : function(n, t) {
9577
+ n.default = t;
9578
+ }), br = _ && _.__importStar || function(n) {
9579
+ if (n && n.__esModule) return n;
9580
+ var t = {};
9581
+ if (n != null) for (var e in n) e !== "default" && Object.prototype.hasOwnProperty.call(n, e) && gr(t, n, e);
9582
+ return wr(t, n), t;
9583
+ };
9584
+ Object.defineProperty(_, "__esModule", { value: !0 });
9585
+ _.PathScurry = _.Path = _.PathScurryDarwin = _.PathScurryPosix = _.PathScurryWin32 = _.PathScurryBase = _.PathPosix = _.PathWin32 = _.PathBase = _.ChildrenCache = _.ResolveCache = void 0;
9586
+ var Qt = fs(), Yt = require("node:path"), yr = require("node:url"), pt = require("fs"), Sr = br(require("node:fs")), vr = pt.realpathSync.native, Ht = require("node:fs/promises"), bs = Oe(), mt = {
9587
+ lstatSync: pt.lstatSync,
9588
+ readdir: pt.readdir,
9589
+ readdirSync: pt.readdirSync,
9590
+ readlinkSync: pt.readlinkSync,
9591
+ realpathSync: vr,
9592
+ promises: {
9593
+ lstat: Ht.lstat,
9594
+ readdir: Ht.readdir,
9595
+ readlink: Ht.readlink,
9596
+ realpath: Ht.realpath
9597
+ }
9598
+ }, _s = (n) => !n || n === mt || n === Sr ? mt : {
9599
+ ...mt,
9600
+ ...n,
9601
+ promises: {
9602
+ ...mt.promises,
9603
+ ...n.promises || {}
9604
+ }
9605
+ }, Os = /^\\\\\?\\([a-z]:)\\?$/i, Er = (n) => n.replace(/\//g, "\\").replace(Os, "$1\\"), _r = /[\\\/]/, N = 0, xs = 1, Ts = 2, G = 4, Cs = 6, Rs = 8, Q = 10, As = 12, j = 15, dt = ~j, xe = 16, ys = 32, gt = 64, W = 128, Vt = 256, Xt = 512, Ss = gt | W | Xt, Or = 1023, Te = (n) => n.isFile() ? Rs : n.isDirectory() ? G : n.isSymbolicLink() ? Q : n.isCharacterDevice() ? Ts : n.isBlockDevice() ? Cs : n.isSocket() ? As : n.isFIFO() ? xs : N, vs = new Qt.LRUCache({ max: 2 ** 12 }), wt = (n) => {
9606
+ let t = vs.get(n);
9607
+ if (t) return t;
9608
+ let e = n.normalize("NFKD");
9609
+ return vs.set(n, e), e;
9610
+ }, Es = new Qt.LRUCache({ max: 2 ** 12 }), Kt = (n) => {
9611
+ let t = Es.get(n);
9612
+ if (t) return t;
9613
+ let e = wt(n.toLowerCase());
9614
+ return Es.set(n, e), e;
9615
+ }, bt = class extends Qt.LRUCache {
9616
+ constructor() {
9617
+ super({ max: 256 });
9618
+ }
9619
+ };
9620
+ _.ResolveCache = bt;
9621
+ var Jt = class extends Qt.LRUCache {
9622
+ constructor(t = 16 * 1024) {
9623
+ super({
9624
+ maxSize: t,
9625
+ sizeCalculation: (e) => e.length + 1
9626
+ });
9627
+ }
9628
+ };
9629
+ _.ChildrenCache = Jt;
9630
+ var ks = Symbol("PathScurry setAsCwd"), A = class {
9631
+ name;
9632
+ root;
9633
+ roots;
9634
+ parent;
9635
+ nocase;
9636
+ isCWD = !1;
9637
+ #t;
9638
+ #s;
9639
+ get dev() {
9640
+ return this.#s;
9641
+ }
9642
+ #n;
9643
+ get mode() {
9644
+ return this.#n;
9645
+ }
9646
+ #r;
9647
+ get nlink() {
9648
+ return this.#r;
9649
+ }
9650
+ #h;
9651
+ get uid() {
9652
+ return this.#h;
9653
+ }
9654
+ #S;
9655
+ get gid() {
9656
+ return this.#S;
9657
+ }
9658
+ #w;
9659
+ get rdev() {
9660
+ return this.#w;
9661
+ }
9662
+ #c;
9663
+ get blksize() {
9664
+ return this.#c;
9665
+ }
9666
+ #o;
9667
+ get ino() {
9668
+ return this.#o;
9669
+ }
9670
+ #f;
9671
+ get size() {
9672
+ return this.#f;
9673
+ }
9674
+ #u;
9675
+ get blocks() {
9676
+ return this.#u;
9677
+ }
9678
+ #a;
9679
+ get atimeMs() {
9680
+ return this.#a;
9681
+ }
9682
+ #i;
9683
+ get mtimeMs() {
9684
+ return this.#i;
9685
+ }
9686
+ #d;
9687
+ get ctimeMs() {
9688
+ return this.#d;
9689
+ }
9690
+ #v;
9691
+ get birthtimeMs() {
9692
+ return this.#v;
9693
+ }
9694
+ #y;
9695
+ get atime() {
9696
+ return this.#y;
9697
+ }
9698
+ #p;
9699
+ get mtime() {
9700
+ return this.#p;
9701
+ }
9702
+ #R;
9703
+ get ctime() {
9704
+ return this.#R;
9705
+ }
9706
+ #m;
9707
+ get birthtime() {
9708
+ return this.#m;
9709
+ }
9710
+ #O;
9711
+ #x;
9712
+ #g;
9713
+ #b;
9714
+ #E;
9715
+ #T;
9716
+ #e;
9717
+ #F;
9718
+ #P;
9719
+ #C;
9720
+ get parentPath() {
9721
+ return (this.parent || this).fullpath();
9722
+ }
9723
+ get path() {
9724
+ return this.parentPath;
9725
+ }
9726
+ constructor(t, e = N, s, i, r, h, o) {
9727
+ this.name = t, this.#O = r ? Kt(t) : wt(t), this.#e = e & Or, this.nocase = r, this.roots = i, this.root = s || this, this.#F = h, this.#g = o.fullpath, this.#E = o.relative, this.#T = o.relativePosix, this.parent = o.parent, this.parent ? this.#t = this.parent.#t : this.#t = _s(o.fs);
9728
+ }
9729
+ depth() {
9730
+ return this.#x !== void 0 ? this.#x : this.parent ? this.#x = this.parent.depth() + 1 : this.#x = 0;
9731
+ }
9732
+ childrenCache() {
9733
+ return this.#F;
9734
+ }
9735
+ resolve(t) {
9736
+ if (!t) return this;
9737
+ let e = this.getRootString(t), i = t.substring(e.length).split(this.splitSep);
9738
+ return e ? this.getRoot(e).#D(i) : this.#D(i);
9739
+ }
9740
+ #D(t) {
9741
+ let e = this;
9742
+ for (let s of t) e = e.child(s);
9743
+ return e;
9744
+ }
9745
+ children() {
9746
+ let t = this.#F.get(this);
9747
+ if (t) return t;
9748
+ let e = Object.assign([], { provisional: 0 });
9749
+ return this.#F.set(this, e), this.#e &= ~xe, e;
9750
+ }
9751
+ child(t, e) {
9752
+ if (t === "" || t === ".") return this;
9753
+ if (t === "..") return this.parent || this;
9754
+ let s = this.children(), i = this.nocase ? Kt(t) : wt(t);
9755
+ for (let a of s) if (a.#O === i) return a;
9756
+ let r = this.parent ? this.sep : "", h = this.#g ? this.#g + r + t : void 0, o = this.newChild(t, N, {
9757
+ ...e,
9758
+ parent: this,
9759
+ fullpath: h
9760
+ });
9761
+ return this.canReaddir() || (o.#e |= W), s.push(o), o;
9762
+ }
9763
+ relative() {
9764
+ if (this.isCWD) return "";
9765
+ if (this.#E !== void 0) return this.#E;
9766
+ let t = this.name, e = this.parent;
9767
+ if (!e) return this.#E = this.name;
9768
+ let s = e.relative();
9769
+ return s + (!s || !e.parent ? "" : this.sep) + t;
9770
+ }
9771
+ relativePosix() {
9772
+ if (this.sep === "/") return this.relative();
9773
+ if (this.isCWD) return "";
9774
+ if (this.#T !== void 0) return this.#T;
9775
+ let t = this.name, e = this.parent;
9776
+ if (!e) return this.#T = this.fullpathPosix();
9777
+ let s = e.relativePosix();
9778
+ return s + (!s || !e.parent ? "" : "/") + t;
9779
+ }
9780
+ fullpath() {
9781
+ if (this.#g !== void 0) return this.#g;
9782
+ let t = this.name, e = this.parent;
9783
+ if (!e) return this.#g = this.name;
9784
+ return this.#g = e.fullpath() + (e.parent ? this.sep : "") + t;
9785
+ }
9786
+ fullpathPosix() {
9787
+ if (this.#b !== void 0) return this.#b;
9788
+ if (this.sep === "/") return this.#b = this.fullpath();
9789
+ if (!this.parent) {
9790
+ let i = this.fullpath().replace(/\\/g, "/");
9791
+ return /^[a-z]:\//i.test(i) ? this.#b = `//?/${i}` : this.#b = i;
9792
+ }
9793
+ let t = this.parent, e = t.fullpathPosix();
9794
+ return this.#b = e + (!e || !t.parent ? "" : "/") + this.name;
9795
+ }
9796
+ isUnknown() {
9797
+ return (this.#e & j) === N;
9798
+ }
9799
+ isType(t) {
9800
+ return this[`is${t}`]();
9801
+ }
9802
+ getType() {
9803
+ return this.isUnknown() ? "Unknown" : this.isDirectory() ? "Directory" : this.isFile() ? "File" : this.isSymbolicLink() ? "SymbolicLink" : this.isFIFO() ? "FIFO" : this.isCharacterDevice() ? "CharacterDevice" : this.isBlockDevice() ? "BlockDevice" : this.isSocket() ? "Socket" : "Unknown";
9804
+ }
9805
+ isFile() {
9806
+ return (this.#e & j) === Rs;
9807
+ }
9808
+ isDirectory() {
9809
+ return (this.#e & j) === G;
9810
+ }
9811
+ isCharacterDevice() {
9812
+ return (this.#e & j) === Ts;
9813
+ }
9814
+ isBlockDevice() {
9815
+ return (this.#e & j) === Cs;
9816
+ }
9817
+ isFIFO() {
9818
+ return (this.#e & j) === xs;
9819
+ }
9820
+ isSocket() {
9821
+ return (this.#e & j) === As;
9822
+ }
9823
+ isSymbolicLink() {
9824
+ return (this.#e & Q) === Q;
9825
+ }
9826
+ lstatCached() {
9827
+ return this.#e & ys ? this : void 0;
9828
+ }
9829
+ readlinkCached() {
9830
+ return this.#P;
9831
+ }
9832
+ realpathCached() {
9833
+ return this.#C;
9834
+ }
9835
+ readdirCached() {
9836
+ let t = this.children();
9837
+ return t.slice(0, t.provisional);
9838
+ }
9839
+ canReadlink() {
9840
+ if (this.#P) return !0;
9841
+ if (!this.parent) return !1;
9842
+ let t = this.#e & j;
9843
+ return !(t !== N && t !== Q || this.#e & Vt || this.#e & W);
9844
+ }
9845
+ calledReaddir() {
9846
+ return !!(this.#e & xe);
9847
+ }
9848
+ isENOENT() {
9849
+ return !!(this.#e & W);
9850
+ }
9851
+ isNamed(t) {
9852
+ return this.nocase ? this.#O === Kt(t) : this.#O === wt(t);
9853
+ }
9854
+ async readlink() {
9855
+ let t = this.#P;
9856
+ if (t) return t;
9857
+ if (this.canReadlink() && this.parent) try {
9858
+ let e = await this.#t.promises.readlink(this.fullpath()), s = (await this.parent.realpath())?.resolve(e);
9859
+ if (s) return this.#P = s;
9860
+ } catch (e) {
9861
+ this.#M(e.code);
9862
+ return;
9863
+ }
9864
+ }
9865
+ readlinkSync() {
9866
+ let t = this.#P;
9867
+ if (t) return t;
9868
+ if (this.canReadlink() && this.parent) try {
9869
+ let e = this.#t.readlinkSync(this.fullpath()), s = this.parent.realpathSync()?.resolve(e);
9870
+ if (s) return this.#P = s;
9871
+ } catch (e) {
9872
+ this.#M(e.code);
9873
+ return;
9874
+ }
9875
+ }
9876
+ #W(t) {
9877
+ this.#e |= xe;
9878
+ for (let e = t.provisional; e < t.length; e++) {
9879
+ let s = t[e];
9880
+ s && s.#_();
9881
+ }
9882
+ }
9883
+ #_() {
9884
+ this.#e & W || (this.#e = (this.#e | W) & dt, this.#$());
9885
+ }
9886
+ #$() {
9887
+ let t = this.children();
9888
+ t.provisional = 0;
9889
+ for (let e of t) e.#_();
9890
+ }
9891
+ #L() {
9892
+ this.#e |= Xt, this.#j();
9893
+ }
9894
+ #j() {
9895
+ if (this.#e & gt) return;
9896
+ let t = this.#e;
9897
+ (t & j) === G && (t &= dt), this.#e = t | gt, this.#$();
9898
+ }
9899
+ #B(t = "") {
9900
+ t === "ENOTDIR" || t === "EPERM" ? this.#j() : t === "ENOENT" ? this.#_() : this.children().provisional = 0;
9901
+ }
9902
+ #k(t = "") {
9903
+ t === "ENOTDIR" ? this.parent.#j() : t === "ENOENT" && this.#_();
9904
+ }
9905
+ #M(t = "") {
9906
+ let e = this.#e;
9907
+ e |= Vt, t === "ENOENT" && (e |= W), (t === "EINVAL" || t === "UNKNOWN") && (e &= dt), this.#e = e, t === "ENOTDIR" && this.parent && this.parent.#j();
9908
+ }
9909
+ #I(t, e) {
9910
+ return this.#z(t, e) || this.#G(t, e);
9911
+ }
9912
+ #G(t, e) {
9913
+ let s = Te(t), i = this.newChild(t.name, s, { parent: this }), r = i.#e & j;
9914
+ return r !== G && r !== Q && r !== N && (i.#e |= gt), e.unshift(i), e.provisional++, i;
9915
+ }
9916
+ #z(t, e) {
9917
+ for (let s = e.provisional; s < e.length; s++) {
9918
+ let i = e[s];
9919
+ if ((this.nocase ? Kt(t.name) : wt(t.name)) === i.#O) return this.#l(t, i, s, e);
9920
+ }
9921
+ }
9922
+ #l(t, e, s, i) {
9923
+ let r = e.name;
9924
+ return e.#e = e.#e & dt | Te(t), r !== t.name && (e.name = t.name), s !== i.provisional && (s === i.length - 1 ? i.pop() : i.splice(s, 1), i.unshift(e)), i.provisional++, e;
9925
+ }
9926
+ async lstat() {
9927
+ if ((this.#e & W) === 0) try {
9928
+ return this.#U(await this.#t.promises.lstat(this.fullpath())), this;
9929
+ } catch (t) {
9930
+ this.#k(t.code);
9931
+ }
9932
+ }
9933
+ lstatSync() {
9934
+ if ((this.#e & W) === 0) try {
9935
+ return this.#U(this.#t.lstatSync(this.fullpath())), this;
9936
+ } catch (t) {
9937
+ this.#k(t.code);
9938
+ }
9939
+ }
9940
+ #U(t) {
9941
+ let { atime: e, atimeMs: s, birthtime: i, birthtimeMs: r, blksize: h, blocks: o, ctime: a, ctimeMs: l, dev: f, gid: c, ino: d, mode: u, mtime: m, mtimeMs: p, nlink: b, rdev: w, size: v, uid: E } = t;
9942
+ this.#y = e, this.#a = s, this.#m = i, this.#v = r, this.#c = h, this.#u = o, this.#R = a, this.#d = l, this.#s = f, this.#S = c, this.#o = d, this.#n = u, this.#p = m, this.#i = p, this.#r = b, this.#w = w, this.#f = v, this.#h = E;
9943
+ let y = Te(t);
9944
+ this.#e = this.#e & dt | y | ys, y !== N && y !== G && y !== Q && (this.#e |= gt);
9945
+ }
9946
+ #N = [];
9947
+ #A = !1;
9948
+ #q(t) {
9949
+ this.#A = !1;
9950
+ let e = this.#N.slice();
9951
+ this.#N.length = 0, e.forEach((s) => s(null, t));
9952
+ }
9953
+ readdirCB(t, e = !1) {
9954
+ if (!this.canReaddir()) {
9955
+ e ? t(null, []) : queueMicrotask(() => t(null, []));
9956
+ return;
9957
+ }
9958
+ let s = this.children();
9959
+ if (this.calledReaddir()) {
9960
+ let r = s.slice(0, s.provisional);
9961
+ e ? t(null, r) : queueMicrotask(() => t(null, r));
9962
+ return;
9963
+ }
9964
+ if (this.#N.push(t), this.#A) return;
9965
+ this.#A = !0;
9966
+ let i = this.fullpath();
9967
+ this.#t.readdir(i, { withFileTypes: !0 }, (r, h) => {
9968
+ if (r) this.#B(r.code), s.provisional = 0;
9969
+ else {
9970
+ for (let o of h) this.#I(o, s);
9971
+ this.#W(s);
9972
+ }
9973
+ this.#q(s.slice(0, s.provisional));
9974
+ });
9975
+ }
9976
+ #H;
9977
+ async readdir() {
9978
+ if (!this.canReaddir()) return [];
9979
+ let t = this.children();
9980
+ if (this.calledReaddir()) return t.slice(0, t.provisional);
9981
+ let e = this.fullpath();
9982
+ if (this.#H) await this.#H;
9983
+ else {
9984
+ let s = () => {};
9985
+ this.#H = new Promise((i) => s = i);
9986
+ try {
9987
+ for (let i of await this.#t.promises.readdir(e, { withFileTypes: !0 })) this.#I(i, t);
9988
+ this.#W(t);
9989
+ } catch (i) {
9990
+ this.#B(i.code), t.provisional = 0;
9991
+ }
9992
+ this.#H = void 0, s();
9993
+ }
9994
+ return t.slice(0, t.provisional);
9995
+ }
9996
+ readdirSync() {
9997
+ if (!this.canReaddir()) return [];
9998
+ let t = this.children();
9999
+ if (this.calledReaddir()) return t.slice(0, t.provisional);
10000
+ let e = this.fullpath();
10001
+ try {
10002
+ for (let s of this.#t.readdirSync(e, { withFileTypes: !0 })) this.#I(s, t);
10003
+ this.#W(t);
10004
+ } catch (s) {
10005
+ this.#B(s.code), t.provisional = 0;
10006
+ }
10007
+ return t.slice(0, t.provisional);
10008
+ }
10009
+ canReaddir() {
10010
+ if (this.#e & Ss) return !1;
10011
+ let t = j & this.#e;
10012
+ return t === N || t === G || t === Q;
10013
+ }
10014
+ shouldWalk(t, e) {
10015
+ return (this.#e & G) === G && !(this.#e & Ss) && !t.has(this) && (!e || e(this));
10016
+ }
10017
+ async realpath() {
10018
+ if (this.#C) return this.#C;
10019
+ if (!((Xt | Vt | W) & this.#e)) try {
10020
+ let t = await this.#t.promises.realpath(this.fullpath());
10021
+ return this.#C = this.resolve(t);
10022
+ } catch {
10023
+ this.#L();
10024
+ }
10025
+ }
10026
+ realpathSync() {
10027
+ if (this.#C) return this.#C;
10028
+ if (!((Xt | Vt | W) & this.#e)) try {
10029
+ let t = this.#t.realpathSync(this.fullpath());
10030
+ return this.#C = this.resolve(t);
10031
+ } catch {
10032
+ this.#L();
10033
+ }
10034
+ }
10035
+ [ks](t) {
10036
+ if (t === this) return;
10037
+ t.isCWD = !1, this.isCWD = !0;
10038
+ let e = /* @__PURE__ */ new Set([]), s = [], i = this;
10039
+ for (; i && i.parent;) e.add(i), i.#E = s.join(this.sep), i.#T = s.join("/"), i = i.parent, s.push("..");
10040
+ for (i = t; i && i.parent && !e.has(i);) i.#E = void 0, i.#T = void 0, i = i.parent;
10041
+ }
10042
+ };
10043
+ _.PathBase = A;
10044
+ var yt = class n extends A {
10045
+ sep = "\\";
10046
+ splitSep = _r;
10047
+ constructor(t, e = N, s, i, r, h, o) {
10048
+ super(t, e, s, i, r, h, o);
10049
+ }
10050
+ newChild(t, e = N, s = {}) {
10051
+ return new n(t, e, this.root, this.roots, this.nocase, this.childrenCache(), s);
10052
+ }
10053
+ getRootString(t) {
10054
+ return Yt.win32.parse(t).root;
10055
+ }
10056
+ getRoot(t) {
10057
+ if (t = Er(t.toUpperCase()), t === this.root.name) return this.root;
10058
+ for (let [e, s] of Object.entries(this.roots)) if (this.sameRoot(t, e)) return this.roots[t] = s;
10059
+ return this.roots[t] = new Et(t, this).root;
10060
+ }
10061
+ sameRoot(t, e = this.root.name) {
10062
+ return t = t.toUpperCase().replace(/\//g, "\\").replace(Os, "$1\\"), t === e;
10063
+ }
10064
+ };
10065
+ _.PathWin32 = yt;
10066
+ var St = class n extends A {
10067
+ splitSep = "/";
10068
+ sep = "/";
10069
+ constructor(t, e = N, s, i, r, h, o) {
10070
+ super(t, e, s, i, r, h, o);
10071
+ }
10072
+ getRootString(t) {
10073
+ return t.startsWith("/") ? "/" : "";
10074
+ }
10075
+ getRoot(t) {
10076
+ return this.root;
10077
+ }
10078
+ newChild(t, e = N, s = {}) {
10079
+ return new n(t, e, this.root, this.roots, this.nocase, this.childrenCache(), s);
10080
+ }
10081
+ };
10082
+ _.PathPosix = St;
10083
+ var vt = class {
10084
+ root;
10085
+ rootPath;
10086
+ roots;
10087
+ cwd;
10088
+ #t;
10089
+ #s;
10090
+ #n;
10091
+ nocase;
10092
+ #r;
10093
+ constructor(t = process.cwd(), e, s, { nocase: i, childrenCacheSize: r = 16 * 1024, fs: h = mt } = {}) {
10094
+ this.#r = _s(h), (t instanceof URL || t.startsWith("file://")) && (t = (0, yr.fileURLToPath)(t));
10095
+ let o = e.resolve(t);
10096
+ this.roots = Object.create(null), this.rootPath = this.parseRootPath(o), this.#t = new bt(), this.#s = new bt(), this.#n = new Jt(r);
10097
+ let a = o.substring(this.rootPath.length).split(s);
10098
+ if (a.length === 1 && !a[0] && a.pop(), i === void 0) throw new TypeError("must provide nocase setting to PathScurryBase ctor");
10099
+ this.nocase = i, this.root = this.newRoot(this.#r), this.roots[this.rootPath] = this.root;
10100
+ let l = this.root, f = a.length - 1, c = e.sep, d = this.rootPath, u = !1;
10101
+ for (let m of a) {
10102
+ let p = f--;
10103
+ l = l.child(m, {
10104
+ relative: new Array(p).fill("..").join(c),
10105
+ relativePosix: new Array(p).fill("..").join("/"),
10106
+ fullpath: d += (u ? "" : c) + m
10107
+ }), u = !0;
10108
+ }
10109
+ this.cwd = l;
10110
+ }
10111
+ depth(t = this.cwd) {
10112
+ return typeof t == "string" && (t = this.cwd.resolve(t)), t.depth();
10113
+ }
10114
+ childrenCache() {
10115
+ return this.#n;
10116
+ }
10117
+ resolve(...t) {
10118
+ let e = "";
10119
+ for (let r = t.length - 1; r >= 0; r--) {
10120
+ let h = t[r];
10121
+ if (!(!h || h === ".") && (e = e ? `${h}/${e}` : h, this.isAbsolute(h))) break;
10122
+ }
10123
+ let s = this.#t.get(e);
10124
+ if (s !== void 0) return s;
10125
+ let i = this.cwd.resolve(e).fullpath();
10126
+ return this.#t.set(e, i), i;
10127
+ }
10128
+ resolvePosix(...t) {
10129
+ let e = "";
10130
+ for (let r = t.length - 1; r >= 0; r--) {
10131
+ let h = t[r];
10132
+ if (!(!h || h === ".") && (e = e ? `${h}/${e}` : h, this.isAbsolute(h))) break;
10133
+ }
10134
+ let s = this.#s.get(e);
10135
+ if (s !== void 0) return s;
10136
+ let i = this.cwd.resolve(e).fullpathPosix();
10137
+ return this.#s.set(e, i), i;
10138
+ }
10139
+ relative(t = this.cwd) {
10140
+ return typeof t == "string" && (t = this.cwd.resolve(t)), t.relative();
10141
+ }
10142
+ relativePosix(t = this.cwd) {
10143
+ return typeof t == "string" && (t = this.cwd.resolve(t)), t.relativePosix();
10144
+ }
10145
+ basename(t = this.cwd) {
10146
+ return typeof t == "string" && (t = this.cwd.resolve(t)), t.name;
10147
+ }
10148
+ dirname(t = this.cwd) {
10149
+ return typeof t == "string" && (t = this.cwd.resolve(t)), (t.parent || t).fullpath();
10150
+ }
10151
+ async readdir(t = this.cwd, e = { withFileTypes: !0 }) {
10152
+ typeof t == "string" ? t = this.cwd.resolve(t) : t instanceof A || (e = t, t = this.cwd);
10153
+ let { withFileTypes: s } = e;
10154
+ if (t.canReaddir()) {
10155
+ let i = await t.readdir();
10156
+ return s ? i : i.map((r) => r.name);
10157
+ } else return [];
10158
+ }
10159
+ readdirSync(t = this.cwd, e = { withFileTypes: !0 }) {
10160
+ typeof t == "string" ? t = this.cwd.resolve(t) : t instanceof A || (e = t, t = this.cwd);
10161
+ let { withFileTypes: s = !0 } = e;
10162
+ return t.canReaddir() ? s ? t.readdirSync() : t.readdirSync().map((i) => i.name) : [];
10163
+ }
10164
+ async lstat(t = this.cwd) {
10165
+ return typeof t == "string" && (t = this.cwd.resolve(t)), t.lstat();
10166
+ }
10167
+ lstatSync(t = this.cwd) {
10168
+ return typeof t == "string" && (t = this.cwd.resolve(t)), t.lstatSync();
10169
+ }
10170
+ async readlink(t = this.cwd, { withFileTypes: e } = { withFileTypes: !1 }) {
10171
+ typeof t == "string" ? t = this.cwd.resolve(t) : t instanceof A || (e = t.withFileTypes, t = this.cwd);
10172
+ let s = await t.readlink();
10173
+ return e ? s : s?.fullpath();
10174
+ }
10175
+ readlinkSync(t = this.cwd, { withFileTypes: e } = { withFileTypes: !1 }) {
10176
+ typeof t == "string" ? t = this.cwd.resolve(t) : t instanceof A || (e = t.withFileTypes, t = this.cwd);
10177
+ let s = t.readlinkSync();
10178
+ return e ? s : s?.fullpath();
10179
+ }
10180
+ async realpath(t = this.cwd, { withFileTypes: e } = { withFileTypes: !1 }) {
10181
+ typeof t == "string" ? t = this.cwd.resolve(t) : t instanceof A || (e = t.withFileTypes, t = this.cwd);
10182
+ let s = await t.realpath();
10183
+ return e ? s : s?.fullpath();
10184
+ }
10185
+ realpathSync(t = this.cwd, { withFileTypes: e } = { withFileTypes: !1 }) {
10186
+ typeof t == "string" ? t = this.cwd.resolve(t) : t instanceof A || (e = t.withFileTypes, t = this.cwd);
10187
+ let s = t.realpathSync();
10188
+ return e ? s : s?.fullpath();
10189
+ }
10190
+ async walk(t = this.cwd, e = {}) {
10191
+ typeof t == "string" ? t = this.cwd.resolve(t) : t instanceof A || (e = t, t = this.cwd);
10192
+ let { withFileTypes: s = !0, follow: i = !1, filter: r, walkFilter: h } = e, o = [];
10193
+ (!r || r(t)) && o.push(s ? t : t.fullpath());
10194
+ let a = /* @__PURE__ */ new Set(), l = (c, d) => {
10195
+ a.add(c), c.readdirCB((u, m) => {
10196
+ if (u) return d(u);
10197
+ let p = m.length;
10198
+ if (!p) return d();
10199
+ let b = () => {
10200
+ --p === 0 && d();
10201
+ };
10202
+ for (let w of m) (!r || r(w)) && o.push(s ? w : w.fullpath()), i && w.isSymbolicLink() ? w.realpath().then((v) => v?.isUnknown() ? v.lstat() : v).then((v) => v?.shouldWalk(a, h) ? l(v, b) : b()) : w.shouldWalk(a, h) ? l(w, b) : b();
10203
+ }, !0);
10204
+ }, f = t;
10205
+ return new Promise((c, d) => {
10206
+ l(f, (u) => {
10207
+ if (u) return d(u);
10208
+ c(o);
10209
+ });
10210
+ });
10211
+ }
10212
+ walkSync(t = this.cwd, e = {}) {
10213
+ typeof t == "string" ? t = this.cwd.resolve(t) : t instanceof A || (e = t, t = this.cwd);
10214
+ let { withFileTypes: s = !0, follow: i = !1, filter: r, walkFilter: h } = e, o = [];
10215
+ (!r || r(t)) && o.push(s ? t : t.fullpath());
10216
+ let a = new Set([t]);
10217
+ for (let l of a) {
10218
+ let f = l.readdirSync();
10219
+ for (let c of f) {
10220
+ (!r || r(c)) && o.push(s ? c : c.fullpath());
10221
+ let d = c;
10222
+ if (c.isSymbolicLink()) {
10223
+ if (!(i && (d = c.realpathSync()))) continue;
10224
+ d.isUnknown() && d.lstatSync();
10225
+ }
10226
+ d.shouldWalk(a, h) && a.add(d);
10227
+ }
10228
+ }
10229
+ return o;
10230
+ }
10231
+ [Symbol.asyncIterator]() {
10232
+ return this.iterate();
10233
+ }
10234
+ iterate(t = this.cwd, e = {}) {
10235
+ return typeof t == "string" ? t = this.cwd.resolve(t) : t instanceof A || (e = t, t = this.cwd), this.stream(t, e)[Symbol.asyncIterator]();
10236
+ }
10237
+ [Symbol.iterator]() {
10238
+ return this.iterateSync();
10239
+ }
10240
+ *iterateSync(t = this.cwd, e = {}) {
10241
+ typeof t == "string" ? t = this.cwd.resolve(t) : t instanceof A || (e = t, t = this.cwd);
10242
+ let { withFileTypes: s = !0, follow: i = !1, filter: r, walkFilter: h } = e;
10243
+ (!r || r(t)) && (yield s ? t : t.fullpath());
10244
+ let o = new Set([t]);
10245
+ for (let a of o) {
10246
+ let l = a.readdirSync();
10247
+ for (let f of l) {
10248
+ (!r || r(f)) && (yield s ? f : f.fullpath());
10249
+ let c = f;
10250
+ if (f.isSymbolicLink()) {
10251
+ if (!(i && (c = f.realpathSync()))) continue;
10252
+ c.isUnknown() && c.lstatSync();
10253
+ }
10254
+ c.shouldWalk(o, h) && o.add(c);
10255
+ }
10256
+ }
10257
+ }
10258
+ stream(t = this.cwd, e = {}) {
10259
+ typeof t == "string" ? t = this.cwd.resolve(t) : t instanceof A || (e = t, t = this.cwd);
10260
+ let { withFileTypes: s = !0, follow: i = !1, filter: r, walkFilter: h } = e, o = new bs.Minipass({ objectMode: !0 });
10261
+ (!r || r(t)) && o.write(s ? t : t.fullpath());
10262
+ let a = /* @__PURE__ */ new Set(), l = [t], f = 0, c = () => {
10263
+ let d = !1;
10264
+ for (; !d;) {
10265
+ let u = l.shift();
10266
+ if (!u) {
10267
+ f === 0 && o.end();
10268
+ return;
10269
+ }
10270
+ f++, a.add(u);
10271
+ let m = (b, w, v = !1) => {
10272
+ if (b) return o.emit("error", b);
10273
+ if (i && !v) {
10274
+ let E = [];
10275
+ for (let y of w) y.isSymbolicLink() && E.push(y.realpath().then((S) => S?.isUnknown() ? S.lstat() : S));
10276
+ if (E.length) {
10277
+ Promise.all(E).then(() => m(null, w, !0));
10278
+ return;
10279
+ }
10280
+ }
10281
+ for (let E of w) E && (!r || r(E)) && (o.write(s ? E : E.fullpath()) || (d = !0));
10282
+ f--;
10283
+ for (let E of w) {
10284
+ let y = E.realpathCached() || E;
10285
+ y.shouldWalk(a, h) && l.push(y);
10286
+ }
10287
+ d && !o.flowing ? o.once("drain", c) : p || c();
10288
+ }, p = !0;
10289
+ u.readdirCB(m, !0), p = !1;
10290
+ }
10291
+ };
10292
+ return c(), o;
10293
+ }
10294
+ streamSync(t = this.cwd, e = {}) {
10295
+ typeof t == "string" ? t = this.cwd.resolve(t) : t instanceof A || (e = t, t = this.cwd);
10296
+ let { withFileTypes: s = !0, follow: i = !1, filter: r, walkFilter: h } = e, o = new bs.Minipass({ objectMode: !0 }), a = /* @__PURE__ */ new Set();
10297
+ (!r || r(t)) && o.write(s ? t : t.fullpath());
10298
+ let l = [t], f = 0, c = () => {
10299
+ let d = !1;
10300
+ for (; !d;) {
10301
+ let u = l.shift();
10302
+ if (!u) {
10303
+ f === 0 && o.end();
10304
+ return;
10305
+ }
10306
+ f++, a.add(u);
10307
+ let m = u.readdirSync();
10308
+ for (let p of m) (!r || r(p)) && (o.write(s ? p : p.fullpath()) || (d = !0));
10309
+ f--;
10310
+ for (let p of m) {
10311
+ let b = p;
10312
+ if (p.isSymbolicLink()) {
10313
+ if (!(i && (b = p.realpathSync()))) continue;
10314
+ b.isUnknown() && b.lstatSync();
10315
+ }
10316
+ b.shouldWalk(a, h) && l.push(b);
10317
+ }
10318
+ }
10319
+ d && !o.flowing && o.once("drain", c);
10320
+ };
10321
+ return c(), o;
10322
+ }
10323
+ chdir(t = this.cwd) {
10324
+ let e = this.cwd;
10325
+ this.cwd = typeof t == "string" ? this.cwd.resolve(t) : t, this.cwd[ks](e);
10326
+ }
10327
+ };
10328
+ _.PathScurryBase = vt;
10329
+ var Et = class extends vt {
10330
+ sep = "\\";
10331
+ constructor(t = process.cwd(), e = {}) {
10332
+ let { nocase: s = !0 } = e;
10333
+ super(t, Yt.win32, "\\", {
10334
+ ...e,
10335
+ nocase: s
10336
+ }), this.nocase = s;
10337
+ for (let i = this.cwd; i; i = i.parent) i.nocase = this.nocase;
10338
+ }
10339
+ parseRootPath(t) {
10340
+ return Yt.win32.parse(t).root.toUpperCase();
10341
+ }
10342
+ newRoot(t) {
10343
+ return new yt(this.rootPath, G, void 0, this.roots, this.nocase, this.childrenCache(), { fs: t });
10344
+ }
10345
+ isAbsolute(t) {
10346
+ return t.startsWith("/") || t.startsWith("\\") || /^[a-z]:(\/|\\)/i.test(t);
10347
+ }
10348
+ };
10349
+ _.PathScurryWin32 = Et;
10350
+ var _t = class extends vt {
10351
+ sep = "/";
10352
+ constructor(t = process.cwd(), e = {}) {
10353
+ let { nocase: s = !1 } = e;
10354
+ super(t, Yt.posix, "/", {
10355
+ ...e,
10356
+ nocase: s
10357
+ }), this.nocase = s;
10358
+ }
10359
+ parseRootPath(t) {
10360
+ return "/";
10361
+ }
10362
+ newRoot(t) {
10363
+ return new St(this.rootPath, G, void 0, this.roots, this.nocase, this.childrenCache(), { fs: t });
10364
+ }
10365
+ isAbsolute(t) {
10366
+ return t.startsWith("/");
10367
+ }
10368
+ };
10369
+ _.PathScurryPosix = _t;
10370
+ var Zt = class extends _t {
10371
+ constructor(t = process.cwd(), e = {}) {
10372
+ let { nocase: s = !0 } = e;
10373
+ super(t, {
10374
+ ...e,
10375
+ nocase: s
10376
+ });
10377
+ }
10378
+ };
10379
+ _.PathScurryDarwin = Zt;
10380
+ _.Path = process.platform === "win32" ? yt : St;
10381
+ _.PathScurry = process.platform === "win32" ? Et : process.platform === "darwin" ? Zt : _t;
10382
+ });
10383
+ var Re = R((te) => {
10384
+ "use strict";
10385
+ Object.defineProperty(te, "__esModule", { value: !0 });
10386
+ te.Pattern = void 0;
10387
+ var xr = H(), Tr = (n) => n.length >= 1, Cr = (n) => n.length >= 1, Rr = Symbol.for("nodejs.util.inspect.custom");
10388
+ te.Pattern = class n {
10389
+ #t;
10390
+ #s;
10391
+ #n;
10392
+ length;
10393
+ #r;
10394
+ #h;
10395
+ #S;
10396
+ #w;
10397
+ #c;
10398
+ #o;
10399
+ #f = !0;
10400
+ constructor(t, e, s, i) {
10401
+ if (!Tr(t)) throw new TypeError("empty pattern list");
10402
+ if (!Cr(e)) throw new TypeError("empty glob list");
10403
+ if (e.length !== t.length) throw new TypeError("mismatched pattern list and glob list lengths");
10404
+ if (this.length = t.length, s < 0 || s >= this.length) throw new TypeError("index out of range");
10405
+ if (this.#t = t, this.#s = e, this.#n = s, this.#r = i, this.#n === 0) {
10406
+ if (this.isUNC()) {
10407
+ let [r, h, o, a, ...l] = this.#t, [f, c, d, u, ...m] = this.#s;
10408
+ l[0] === "" && (l.shift(), m.shift());
10409
+ let p = [
10410
+ r,
10411
+ h,
10412
+ o,
10413
+ a,
10414
+ ""
10415
+ ].join("/"), b = [
10416
+ f,
10417
+ c,
10418
+ d,
10419
+ u,
10420
+ ""
10421
+ ].join("/");
10422
+ this.#t = [p, ...l], this.#s = [b, ...m], this.length = this.#t.length;
10423
+ } else if (this.isDrive() || this.isAbsolute()) {
10424
+ let [r, ...h] = this.#t, [o, ...a] = this.#s;
10425
+ h[0] === "" && (h.shift(), a.shift());
10426
+ let l = r + "/", f = o + "/";
10427
+ this.#t = [l, ...h], this.#s = [f, ...a], this.length = this.#t.length;
10428
+ }
10429
+ }
10430
+ }
10431
+ [Rr]() {
10432
+ return "Pattern <" + this.#s.slice(this.#n).join("/") + ">";
10433
+ }
10434
+ pattern() {
10435
+ return this.#t[this.#n];
10436
+ }
10437
+ isString() {
10438
+ return typeof this.#t[this.#n] == "string";
10439
+ }
10440
+ isGlobstar() {
10441
+ return this.#t[this.#n] === xr.GLOBSTAR;
10442
+ }
10443
+ isRegExp() {
10444
+ return this.#t[this.#n] instanceof RegExp;
10445
+ }
10446
+ globString() {
10447
+ return this.#S = this.#S || (this.#n === 0 ? this.isAbsolute() ? this.#s[0] + this.#s.slice(1).join("/") : this.#s.join("/") : this.#s.slice(this.#n).join("/"));
10448
+ }
10449
+ hasMore() {
10450
+ return this.length > this.#n + 1;
10451
+ }
10452
+ rest() {
10453
+ return this.#h !== void 0 ? this.#h : this.hasMore() ? (this.#h = new n(this.#t, this.#s, this.#n + 1, this.#r), this.#h.#o = this.#o, this.#h.#c = this.#c, this.#h.#w = this.#w, this.#h) : this.#h = null;
10454
+ }
10455
+ isUNC() {
10456
+ let t = this.#t;
10457
+ return this.#c !== void 0 ? this.#c : this.#c = this.#r === "win32" && this.#n === 0 && t[0] === "" && t[1] === "" && typeof t[2] == "string" && !!t[2] && typeof t[3] == "string" && !!t[3];
10458
+ }
10459
+ isDrive() {
10460
+ let t = this.#t;
10461
+ return this.#w !== void 0 ? this.#w : this.#w = this.#r === "win32" && this.#n === 0 && this.length > 1 && typeof t[0] == "string" && /^[a-z]:$/i.test(t[0]);
10462
+ }
10463
+ isAbsolute() {
10464
+ let t = this.#t;
10465
+ return this.#o !== void 0 ? this.#o : this.#o = t[0] === "" && t.length > 1 || this.isDrive() || this.isUNC();
10466
+ }
10467
+ root() {
10468
+ let t = this.#t[0];
10469
+ return typeof t == "string" && this.isAbsolute() && this.#n === 0 ? t : "";
10470
+ }
10471
+ checkFollowGlobstar() {
10472
+ return !(this.#n === 0 || !this.isGlobstar() || !this.#f);
10473
+ }
10474
+ markFollowGlobstar() {
10475
+ return this.#n === 0 || !this.isGlobstar() || !this.#f ? !1 : (this.#f = !1, !0);
10476
+ }
10477
+ };
10478
+ });
10479
+ var ke = R((ee) => {
10480
+ "use strict";
10481
+ Object.defineProperty(ee, "__esModule", { value: !0 });
10482
+ ee.Ignore = void 0;
10483
+ var Ps = H(), Ar = Re(), kr = typeof process == "object" && process && typeof process.platform == "string" ? process.platform : "linux", Ae = class {
10484
+ relative;
10485
+ relativeChildren;
10486
+ absolute;
10487
+ absoluteChildren;
10488
+ platform;
10489
+ mmopts;
10490
+ constructor(t, { nobrace: e, nocase: s, noext: i, noglobstar: r, platform: h = kr }) {
10491
+ this.relative = [], this.absolute = [], this.relativeChildren = [], this.absoluteChildren = [], this.platform = h, this.mmopts = {
10492
+ dot: !0,
10493
+ nobrace: e,
10494
+ nocase: s,
10495
+ noext: i,
10496
+ noglobstar: r,
10497
+ optimizationLevel: 2,
10498
+ platform: h,
10499
+ nocomment: !0,
10500
+ nonegate: !0
10501
+ };
10502
+ for (let o of t) this.add(o);
10503
+ }
10504
+ add(t) {
10505
+ let e = new Ps.Minimatch(t, this.mmopts);
10506
+ for (let s = 0; s < e.set.length; s++) {
10507
+ let i = e.set[s], r = e.globParts[s];
10508
+ if (!i || !r) throw new Error("invalid pattern object");
10509
+ for (; i[0] === "." && r[0] === ".";) i.shift(), r.shift();
10510
+ let h = new Ar.Pattern(i, r, 0, this.platform), o = new Ps.Minimatch(h.globString(), this.mmopts), a = r[r.length - 1] === "**", l = h.isAbsolute();
10511
+ l ? this.absolute.push(o) : this.relative.push(o), a && (l ? this.absoluteChildren.push(o) : this.relativeChildren.push(o));
10512
+ }
10513
+ }
10514
+ ignored(t) {
10515
+ let e = t.fullpath(), s = `${e}/`, i = t.relative() || ".", r = `${i}/`;
10516
+ for (let h of this.relative) if (h.match(i) || h.match(r)) return !0;
10517
+ for (let h of this.absolute) if (h.match(e) || h.match(s)) return !0;
10518
+ return !1;
10519
+ }
10520
+ childrenIgnored(t) {
10521
+ let e = t.fullpath() + "/", s = (t.relative() || ".") + "/";
10522
+ for (let i of this.relativeChildren) if (i.match(s)) return !0;
10523
+ for (let i of this.absoluteChildren) if (i.match(e)) return !0;
10524
+ return !1;
10525
+ }
10526
+ };
10527
+ ee.Ignore = Ae;
10528
+ });
10529
+ var Fs = R((z) => {
10530
+ "use strict";
10531
+ Object.defineProperty(z, "__esModule", { value: !0 });
10532
+ z.Processor = z.SubWalks = z.MatchRecord = z.HasWalkedCache = void 0;
10533
+ var Ds = H(), se = class n {
10534
+ store;
10535
+ constructor(t = /* @__PURE__ */ new Map()) {
10536
+ this.store = t;
10537
+ }
10538
+ copy() {
10539
+ return new n(new Map(this.store));
10540
+ }
10541
+ hasWalked(t, e) {
10542
+ return this.store.get(t.fullpath())?.has(e.globString());
10543
+ }
10544
+ storeWalked(t, e) {
10545
+ let s = t.fullpath(), i = this.store.get(s);
10546
+ i ? i.add(e.globString()) : this.store.set(s, new Set([e.globString()]));
10547
+ }
10548
+ };
10549
+ z.HasWalkedCache = se;
10550
+ var ie = class {
10551
+ store = /* @__PURE__ */ new Map();
10552
+ add(t, e, s) {
10553
+ let i = (e ? 2 : 0) | (s ? 1 : 0), r = this.store.get(t);
10554
+ this.store.set(t, r === void 0 ? i : i & r);
10555
+ }
10556
+ entries() {
10557
+ return [...this.store.entries()].map(([t, e]) => [
10558
+ t,
10559
+ !!(e & 2),
10560
+ !!(e & 1)
10561
+ ]);
10562
+ }
10563
+ };
10564
+ z.MatchRecord = ie;
10565
+ var re = class {
10566
+ store = /* @__PURE__ */ new Map();
10567
+ add(t, e) {
10568
+ if (!t.canReaddir()) return;
10569
+ let s = this.store.get(t);
10570
+ s ? s.find((i) => i.globString() === e.globString()) || s.push(e) : this.store.set(t, [e]);
10571
+ }
10572
+ get(t) {
10573
+ let e = this.store.get(t);
10574
+ if (!e) throw new Error("attempting to walk unknown path");
10575
+ return e;
10576
+ }
10577
+ entries() {
10578
+ return this.keys().map((t) => [t, this.store.get(t)]);
10579
+ }
10580
+ keys() {
10581
+ return [...this.store.keys()].filter((t) => t.canReaddir());
10582
+ }
10583
+ };
10584
+ z.SubWalks = re;
10585
+ z.Processor = class n {
10586
+ hasWalkedCache;
10587
+ matches = new ie();
10588
+ subwalks = new re();
10589
+ patterns;
10590
+ follow;
10591
+ dot;
10592
+ opts;
10593
+ constructor(t, e) {
10594
+ this.opts = t, this.follow = !!t.follow, this.dot = !!t.dot, this.hasWalkedCache = e ? e.copy() : new se();
10595
+ }
10596
+ processPatterns(t, e) {
10597
+ this.patterns = e;
10598
+ let s = e.map((i) => [t, i]);
10599
+ for (let [i, r] of s) {
10600
+ this.hasWalkedCache.storeWalked(i, r);
10601
+ let h = r.root(), o = r.isAbsolute() && this.opts.absolute !== !1;
10602
+ if (h) {
10603
+ i = i.resolve(h === "/" && this.opts.root !== void 0 ? this.opts.root : h);
10604
+ let c = r.rest();
10605
+ if (c) r = c;
10606
+ else {
10607
+ this.matches.add(i, !0, !1);
10608
+ continue;
10609
+ }
10610
+ }
10611
+ if (i.isENOENT()) continue;
10612
+ let a, l, f = !1;
10613
+ for (; typeof (a = r.pattern()) == "string" && (l = r.rest());) i = i.resolve(a), r = l, f = !0;
10614
+ if (a = r.pattern(), l = r.rest(), f) {
10615
+ if (this.hasWalkedCache.hasWalked(i, r)) continue;
10616
+ this.hasWalkedCache.storeWalked(i, r);
10617
+ }
10618
+ if (typeof a == "string") {
10619
+ let c = a === ".." || a === "" || a === ".";
10620
+ this.matches.add(i.resolve(a), o, c);
10621
+ continue;
10622
+ } else if (a === Ds.GLOBSTAR) {
10623
+ (!i.isSymbolicLink() || this.follow || r.checkFollowGlobstar()) && this.subwalks.add(i, r);
10624
+ let c = l?.pattern(), d = l?.rest();
10625
+ if (!l || (c === "" || c === ".") && !d) this.matches.add(i, o, c === "" || c === ".");
10626
+ else if (c === "..") {
10627
+ let u = i.parent || i;
10628
+ d ? this.hasWalkedCache.hasWalked(u, d) || this.subwalks.add(u, d) : this.matches.add(u, o, !0);
10629
+ }
10630
+ } else a instanceof RegExp && this.subwalks.add(i, r);
10631
+ }
10632
+ return this;
10633
+ }
10634
+ subwalkTargets() {
10635
+ return this.subwalks.keys();
10636
+ }
10637
+ child() {
10638
+ return new n(this.opts, this.hasWalkedCache);
10639
+ }
10640
+ filterEntries(t, e) {
10641
+ let s = this.subwalks.get(t), i = this.child();
10642
+ for (let r of e) for (let h of s) {
10643
+ let o = h.isAbsolute(), a = h.pattern(), l = h.rest();
10644
+ a === Ds.GLOBSTAR ? i.testGlobstar(r, h, l, o) : a instanceof RegExp ? i.testRegExp(r, a, l, o) : i.testString(r, a, l, o);
10645
+ }
10646
+ return i;
10647
+ }
10648
+ testGlobstar(t, e, s, i) {
10649
+ if ((this.dot || !t.name.startsWith(".")) && (e.hasMore() || this.matches.add(t, i, !1), t.canReaddir() && (this.follow || !t.isSymbolicLink() ? this.subwalks.add(t, e) : t.isSymbolicLink() && (s && e.checkFollowGlobstar() ? this.subwalks.add(t, s) : e.markFollowGlobstar() && this.subwalks.add(t, e)))), s) {
10650
+ let r = s.pattern();
10651
+ if (typeof r == "string" && r !== ".." && r !== "" && r !== ".") this.testString(t, r, s.rest(), i);
10652
+ else if (r === "..") {
10653
+ let h = t.parent || t;
10654
+ this.subwalks.add(h, s);
10655
+ } else r instanceof RegExp && this.testRegExp(t, r, s.rest(), i);
10656
+ }
10657
+ }
10658
+ testRegExp(t, e, s, i) {
10659
+ e.test(t.name) && (s ? this.subwalks.add(t, s) : this.matches.add(t, i, !1));
10660
+ }
10661
+ testString(t, e, s, i) {
10662
+ t.isNamed(e) && (s ? this.subwalks.add(t, s) : this.matches.add(t, i, !1));
10663
+ }
10664
+ };
10665
+ });
10666
+ var Ls = R((X) => {
10667
+ "use strict";
10668
+ Object.defineProperty(X, "__esModule", { value: !0 });
10669
+ X.GlobStream = X.GlobWalker = X.GlobUtil = void 0;
10670
+ var Mr = Oe(), js = ke(), Ns = Fs(), Pr = (n, t) => typeof n == "string" ? new js.Ignore([n], t) : Array.isArray(n) ? new js.Ignore(n, t) : n, Ot = class {
10671
+ path;
10672
+ patterns;
10673
+ opts;
10674
+ seen = /* @__PURE__ */ new Set();
10675
+ paused = !1;
10676
+ aborted = !1;
10677
+ #t = [];
10678
+ #s;
10679
+ #n;
10680
+ signal;
10681
+ maxDepth;
10682
+ includeChildMatches;
10683
+ constructor(t, e, s) {
10684
+ if (this.patterns = t, this.path = e, this.opts = s, this.#n = !s.posix && s.platform === "win32" ? "\\" : "/", this.includeChildMatches = s.includeChildMatches !== !1, (s.ignore || !this.includeChildMatches) && (this.#s = Pr(s.ignore ?? [], s), !this.includeChildMatches && typeof this.#s.add != "function")) throw new Error("cannot ignore child matches, ignore lacks add() method.");
10685
+ this.maxDepth = s.maxDepth || Infinity, s.signal && (this.signal = s.signal, this.signal.addEventListener("abort", () => {
10686
+ this.#t.length = 0;
10687
+ }));
10688
+ }
10689
+ #r(t) {
10690
+ return this.seen.has(t) || !!this.#s?.ignored?.(t);
10691
+ }
10692
+ #h(t) {
10693
+ return !!this.#s?.childrenIgnored?.(t);
10694
+ }
10695
+ pause() {
10696
+ this.paused = !0;
10697
+ }
10698
+ resume() {
10699
+ if (this.signal?.aborted) return;
10700
+ this.paused = !1;
10701
+ let t;
10702
+ for (; !this.paused && (t = this.#t.shift());) t();
10703
+ }
10704
+ onResume(t) {
10705
+ this.signal?.aborted || (this.paused ? this.#t.push(t) : t());
10706
+ }
10707
+ async matchCheck(t, e) {
10708
+ if (e && this.opts.nodir) return;
10709
+ let s;
10710
+ if (this.opts.realpath) {
10711
+ if (s = t.realpathCached() || await t.realpath(), !s) return;
10712
+ t = s;
10713
+ }
10714
+ let r = t.isUnknown() || this.opts.stat ? await t.lstat() : t;
10715
+ if (this.opts.follow && this.opts.nodir && r?.isSymbolicLink()) {
10716
+ let h = await r.realpath();
10717
+ h && (h.isUnknown() || this.opts.stat) && await h.lstat();
10718
+ }
10719
+ return this.matchCheckTest(r, e);
10720
+ }
10721
+ matchCheckTest(t, e) {
10722
+ return t && (this.maxDepth === Infinity || t.depth() <= this.maxDepth) && (!e || t.canReaddir()) && (!this.opts.nodir || !t.isDirectory()) && (!this.opts.nodir || !this.opts.follow || !t.isSymbolicLink() || !t.realpathCached()?.isDirectory()) && !this.#r(t) ? t : void 0;
10723
+ }
10724
+ matchCheckSync(t, e) {
10725
+ if (e && this.opts.nodir) return;
10726
+ let s;
10727
+ if (this.opts.realpath) {
10728
+ if (s = t.realpathCached() || t.realpathSync(), !s) return;
10729
+ t = s;
10730
+ }
10731
+ let r = t.isUnknown() || this.opts.stat ? t.lstatSync() : t;
10732
+ if (this.opts.follow && this.opts.nodir && r?.isSymbolicLink()) {
10733
+ let h = r.realpathSync();
10734
+ h && (h?.isUnknown() || this.opts.stat) && h.lstatSync();
10735
+ }
10736
+ return this.matchCheckTest(r, e);
10737
+ }
10738
+ matchFinish(t, e) {
10739
+ if (this.#r(t)) return;
10740
+ if (!this.includeChildMatches && this.#s?.add) {
10741
+ let r = `${t.relativePosix()}/**`;
10742
+ this.#s.add(r);
10743
+ }
10744
+ let s = this.opts.absolute === void 0 ? e : this.opts.absolute;
10745
+ this.seen.add(t);
10746
+ let i = this.opts.mark && t.isDirectory() ? this.#n : "";
10747
+ if (this.opts.withFileTypes) this.matchEmit(t);
10748
+ else if (s) {
10749
+ let r = this.opts.posix ? t.fullpathPosix() : t.fullpath();
10750
+ this.matchEmit(r + i);
10751
+ } else {
10752
+ let r = this.opts.posix ? t.relativePosix() : t.relative(), h = this.opts.dotRelative && !r.startsWith(".." + this.#n) ? "." + this.#n : "";
10753
+ this.matchEmit(r ? h + r + i : "." + i);
10754
+ }
10755
+ }
10756
+ async match(t, e, s) {
10757
+ let i = await this.matchCheck(t, s);
10758
+ i && this.matchFinish(i, e);
10759
+ }
10760
+ matchSync(t, e, s) {
10761
+ let i = this.matchCheckSync(t, s);
10762
+ i && this.matchFinish(i, e);
10763
+ }
10764
+ walkCB(t, e, s) {
10765
+ this.signal?.aborted && s(), this.walkCB2(t, e, new Ns.Processor(this.opts), s);
10766
+ }
10767
+ walkCB2(t, e, s, i) {
10768
+ if (this.#h(t)) return i();
10769
+ if (this.signal?.aborted && i(), this.paused) {
10770
+ this.onResume(() => this.walkCB2(t, e, s, i));
10771
+ return;
10772
+ }
10773
+ s.processPatterns(t, e);
10774
+ let r = 1, h = () => {
10775
+ --r === 0 && i();
10776
+ };
10777
+ for (let [o, a, l] of s.matches.entries()) this.#r(o) || (r++, this.match(o, a, l).then(() => h()));
10778
+ for (let o of s.subwalkTargets()) {
10779
+ if (this.maxDepth !== Infinity && o.depth() >= this.maxDepth) continue;
10780
+ r++;
10781
+ let a = o.readdirCached();
10782
+ o.calledReaddir() ? this.walkCB3(o, a, s, h) : o.readdirCB((l, f) => this.walkCB3(o, f, s, h), !0);
10783
+ }
10784
+ h();
10785
+ }
10786
+ walkCB3(t, e, s, i) {
10787
+ s = s.filterEntries(t, e);
10788
+ let r = 1, h = () => {
10789
+ --r === 0 && i();
10790
+ };
10791
+ for (let [o, a, l] of s.matches.entries()) this.#r(o) || (r++, this.match(o, a, l).then(() => h()));
10792
+ for (let [o, a] of s.subwalks.entries()) r++, this.walkCB2(o, a, s.child(), h);
10793
+ h();
10794
+ }
10795
+ walkCBSync(t, e, s) {
10796
+ this.signal?.aborted && s(), this.walkCB2Sync(t, e, new Ns.Processor(this.opts), s);
10797
+ }
10798
+ walkCB2Sync(t, e, s, i) {
10799
+ if (this.#h(t)) return i();
10800
+ if (this.signal?.aborted && i(), this.paused) {
10801
+ this.onResume(() => this.walkCB2Sync(t, e, s, i));
10802
+ return;
10803
+ }
10804
+ s.processPatterns(t, e);
10805
+ let r = 1, h = () => {
10806
+ --r === 0 && i();
10807
+ };
10808
+ for (let [o, a, l] of s.matches.entries()) this.#r(o) || this.matchSync(o, a, l);
10809
+ for (let o of s.subwalkTargets()) {
10810
+ if (this.maxDepth !== Infinity && o.depth() >= this.maxDepth) continue;
10811
+ r++;
10812
+ let a = o.readdirSync();
10813
+ this.walkCB3Sync(o, a, s, h);
10814
+ }
10815
+ h();
10816
+ }
10817
+ walkCB3Sync(t, e, s, i) {
10818
+ s = s.filterEntries(t, e);
10819
+ let r = 1, h = () => {
10820
+ --r === 0 && i();
10821
+ };
10822
+ for (let [o, a, l] of s.matches.entries()) this.#r(o) || this.matchSync(o, a, l);
10823
+ for (let [o, a] of s.subwalks.entries()) r++, this.walkCB2Sync(o, a, s.child(), h);
10824
+ h();
10825
+ }
10826
+ };
10827
+ X.GlobUtil = Ot;
10828
+ var Pe = class extends Ot {
10829
+ matches = /* @__PURE__ */ new Set();
10830
+ constructor(t, e, s) {
10831
+ super(t, e, s);
10832
+ }
10833
+ matchEmit(t) {
10834
+ this.matches.add(t);
10835
+ }
10836
+ async walk() {
10837
+ if (this.signal?.aborted) throw this.signal.reason;
10838
+ return this.path.isUnknown() && await this.path.lstat(), await new Promise((t, e) => {
10839
+ this.walkCB(this.path, this.patterns, () => {
10840
+ this.signal?.aborted ? e(this.signal.reason) : t(this.matches);
10841
+ });
10842
+ }), this.matches;
10843
+ }
10844
+ walkSync() {
10845
+ if (this.signal?.aborted) throw this.signal.reason;
10846
+ return this.path.isUnknown() && this.path.lstatSync(), this.walkCBSync(this.path, this.patterns, () => {
10847
+ if (this.signal?.aborted) throw this.signal.reason;
10848
+ }), this.matches;
10849
+ }
10850
+ };
10851
+ X.GlobWalker = Pe;
10852
+ var De = class extends Ot {
10853
+ results;
10854
+ constructor(t, e, s) {
10855
+ super(t, e, s), this.results = new Mr.Minipass({
10856
+ signal: this.signal,
10857
+ objectMode: !0
10858
+ }), this.results.on("drain", () => this.resume()), this.results.on("resume", () => this.resume());
10859
+ }
10860
+ matchEmit(t) {
10861
+ this.results.write(t), this.results.flowing || this.pause();
10862
+ }
10863
+ stream() {
10864
+ let t = this.path;
10865
+ return t.isUnknown() ? t.lstat().then(() => {
10866
+ this.walkCB(t, this.patterns, () => this.results.end());
10867
+ }) : this.walkCB(t, this.patterns, () => this.results.end()), this.results;
10868
+ }
10869
+ streamSync() {
10870
+ return this.path.isUnknown() && this.path.lstatSync(), this.walkCBSync(this.path, this.patterns, () => this.results.end()), this.results;
10871
+ }
10872
+ };
10873
+ X.GlobStream = De;
10874
+ });
10875
+ var je = R((oe) => {
10876
+ "use strict";
10877
+ Object.defineProperty(oe, "__esModule", { value: !0 });
10878
+ oe.Glob = void 0;
10879
+ var Dr = H(), Fr = require("node:url"), ne = Ms(), jr = Re(), he = Ls(), Nr = typeof process == "object" && process && typeof process.platform == "string" ? process.platform : "linux", Fe = class {
10880
+ absolute;
10881
+ cwd;
10882
+ root;
10883
+ dot;
10884
+ dotRelative;
10885
+ follow;
10886
+ ignore;
10887
+ magicalBraces;
10888
+ mark;
10889
+ matchBase;
10890
+ maxDepth;
10891
+ nobrace;
10892
+ nocase;
10893
+ nodir;
10894
+ noext;
10895
+ noglobstar;
10896
+ pattern;
10897
+ platform;
10898
+ realpath;
10899
+ scurry;
10900
+ stat;
10901
+ signal;
10902
+ windowsPathsNoEscape;
10903
+ withFileTypes;
10904
+ includeChildMatches;
10905
+ opts;
10906
+ patterns;
10907
+ constructor(t, e) {
10908
+ if (!e) throw new TypeError("glob options required");
10909
+ if (this.withFileTypes = !!e.withFileTypes, this.signal = e.signal, this.follow = !!e.follow, this.dot = !!e.dot, this.dotRelative = !!e.dotRelative, this.nodir = !!e.nodir, this.mark = !!e.mark, e.cwd ? (e.cwd instanceof URL || e.cwd.startsWith("file://")) && (e.cwd = (0, Fr.fileURLToPath)(e.cwd)) : this.cwd = "", this.cwd = e.cwd || "", this.root = e.root, this.magicalBraces = !!e.magicalBraces, this.nobrace = !!e.nobrace, this.noext = !!e.noext, this.realpath = !!e.realpath, this.absolute = e.absolute, this.includeChildMatches = e.includeChildMatches !== !1, this.noglobstar = !!e.noglobstar, this.matchBase = !!e.matchBase, this.maxDepth = typeof e.maxDepth == "number" ? e.maxDepth : Infinity, this.stat = !!e.stat, this.ignore = e.ignore, this.withFileTypes && this.absolute !== void 0) throw new Error("cannot set absolute and withFileTypes:true");
10910
+ if (typeof t == "string" && (t = [t]), this.windowsPathsNoEscape = !!e.windowsPathsNoEscape || e.allowWindowsEscape === !1, this.windowsPathsNoEscape && (t = t.map((a) => a.replace(/\\/g, "/"))), this.matchBase) {
10911
+ if (e.noglobstar) throw new TypeError("base matching requires globstar");
10912
+ t = t.map((a) => a.includes("/") ? a : `./**/${a}`);
10913
+ }
10914
+ if (this.pattern = t, this.platform = e.platform || Nr, this.opts = {
10915
+ ...e,
10916
+ platform: this.platform
10917
+ }, e.scurry) {
10918
+ if (this.scurry = e.scurry, e.nocase !== void 0 && e.nocase !== e.scurry.nocase) throw new Error("nocase option contradicts provided scurry option");
10919
+ } else this.scurry = new (e.platform === "win32" ? ne.PathScurryWin32 : e.platform === "darwin" ? ne.PathScurryDarwin : e.platform ? ne.PathScurryPosix : ne.PathScurry)(this.cwd, {
10920
+ nocase: e.nocase,
10921
+ fs: e.fs
10922
+ });
10923
+ this.nocase = this.scurry.nocase;
10924
+ let s = this.platform === "darwin" || this.platform === "win32", i = {
10925
+ braceExpandMax: 1e4,
10926
+ ...e,
10927
+ dot: this.dot,
10928
+ matchBase: this.matchBase,
10929
+ nobrace: this.nobrace,
10930
+ nocase: this.nocase,
10931
+ nocaseMagicOnly: s,
10932
+ nocomment: !0,
10933
+ noext: this.noext,
10934
+ nonegate: !0,
10935
+ optimizationLevel: 2,
10936
+ platform: this.platform,
10937
+ windowsPathsNoEscape: this.windowsPathsNoEscape,
10938
+ debug: !!this.opts.debug
10939
+ }, [h, o] = this.pattern.map((a) => new Dr.Minimatch(a, i)).reduce((a, l) => (a[0].push(...l.set), a[1].push(...l.globParts), a), [[], []]);
10940
+ this.patterns = h.map((a, l) => {
10941
+ let f = o[l];
10942
+ if (!f) throw new Error("invalid pattern object");
10943
+ return new jr.Pattern(a, f, 0, this.platform);
10944
+ });
10945
+ }
10946
+ async walk() {
10947
+ return [...await new he.GlobWalker(this.patterns, this.scurry.cwd, {
10948
+ ...this.opts,
10949
+ maxDepth: this.maxDepth !== Infinity ? this.maxDepth + this.scurry.cwd.depth() : Infinity,
10950
+ platform: this.platform,
10951
+ nocase: this.nocase,
10952
+ includeChildMatches: this.includeChildMatches
10953
+ }).walk()];
10954
+ }
10955
+ walkSync() {
10956
+ return [...new he.GlobWalker(this.patterns, this.scurry.cwd, {
10957
+ ...this.opts,
10958
+ maxDepth: this.maxDepth !== Infinity ? this.maxDepth + this.scurry.cwd.depth() : Infinity,
10959
+ platform: this.platform,
10960
+ nocase: this.nocase,
10961
+ includeChildMatches: this.includeChildMatches
10962
+ }).walkSync()];
10963
+ }
10964
+ stream() {
10965
+ return new he.GlobStream(this.patterns, this.scurry.cwd, {
10966
+ ...this.opts,
10967
+ maxDepth: this.maxDepth !== Infinity ? this.maxDepth + this.scurry.cwd.depth() : Infinity,
10968
+ platform: this.platform,
10969
+ nocase: this.nocase,
10970
+ includeChildMatches: this.includeChildMatches
10971
+ }).stream();
10972
+ }
10973
+ streamSync() {
10974
+ return new he.GlobStream(this.patterns, this.scurry.cwd, {
10975
+ ...this.opts,
10976
+ maxDepth: this.maxDepth !== Infinity ? this.maxDepth + this.scurry.cwd.depth() : Infinity,
10977
+ platform: this.platform,
10978
+ nocase: this.nocase,
10979
+ includeChildMatches: this.includeChildMatches
10980
+ }).streamSync();
10981
+ }
10982
+ iterateSync() {
10983
+ return this.streamSync()[Symbol.iterator]();
10984
+ }
10985
+ [Symbol.iterator]() {
10986
+ return this.iterateSync();
10987
+ }
10988
+ iterate() {
10989
+ return this.stream()[Symbol.asyncIterator]();
10990
+ }
10991
+ [Symbol.asyncIterator]() {
10992
+ return this.iterate();
10993
+ }
10994
+ };
10995
+ oe.Glob = Fe;
10996
+ });
10997
+ var Ne = R((ae) => {
10998
+ "use strict";
10999
+ Object.defineProperty(ae, "__esModule", { value: !0 });
11000
+ ae.hasMagic = void 0;
11001
+ var Lr = H(), Wr = (n, t = {}) => {
11002
+ Array.isArray(n) || (n = [n]);
11003
+ for (let e of n) if (new Lr.Minimatch(e, t).hasMagic()) return !0;
11004
+ return !1;
11005
+ };
11006
+ ae.hasMagic = Wr;
11007
+ });
11008
+ Object.defineProperty(exports, "__esModule", { value: !0 });
11009
+ exports.glob = exports.sync = exports.iterate = exports.iterateSync = exports.stream = exports.streamSync = exports.Ignore = exports.hasMagic = exports.Glob = exports.unescape = exports.escape = void 0;
11010
+ exports.globStreamSync = xt;
11011
+ exports.globStream = Le;
11012
+ exports.globSync = We;
11013
+ exports.globIterateSync = Tt;
11014
+ exports.globIterate = Be;
11015
+ var Ws = H(), tt = je(), Br = Ne(), Is = H();
11016
+ Object.defineProperty(exports, "escape", {
11017
+ enumerable: !0,
11018
+ get: function() {
11019
+ return Is.escape;
11020
+ }
11021
+ });
11022
+ Object.defineProperty(exports, "unescape", {
11023
+ enumerable: !0,
11024
+ get: function() {
11025
+ return Is.unescape;
11026
+ }
11027
+ });
11028
+ var Ir = je();
11029
+ Object.defineProperty(exports, "Glob", {
11030
+ enumerable: !0,
11031
+ get: function() {
11032
+ return Ir.Glob;
11033
+ }
11034
+ });
11035
+ var Gr = Ne();
11036
+ Object.defineProperty(exports, "hasMagic", {
11037
+ enumerable: !0,
11038
+ get: function() {
11039
+ return Gr.hasMagic;
11040
+ }
11041
+ });
11042
+ var zr = ke();
11043
+ Object.defineProperty(exports, "Ignore", {
11044
+ enumerable: !0,
11045
+ get: function() {
11046
+ return zr.Ignore;
11047
+ }
11048
+ });
11049
+ function xt(n, t = {}) {
11050
+ return new tt.Glob(n, t).streamSync();
11051
+ }
11052
+ function Le(n, t = {}) {
11053
+ return new tt.Glob(n, t).stream();
11054
+ }
11055
+ function We(n, t = {}) {
11056
+ return new tt.Glob(n, t).walkSync();
11057
+ }
11058
+ async function Bs(n, t = {}) {
11059
+ return new tt.Glob(n, t).walk();
11060
+ }
11061
+ function Tt(n, t = {}) {
11062
+ return new tt.Glob(n, t).iterateSync();
11063
+ }
11064
+ function Be(n, t = {}) {
11065
+ return new tt.Glob(n, t).iterate();
11066
+ }
11067
+ exports.streamSync = xt;
11068
+ exports.stream = Object.assign(Le, { sync: xt });
11069
+ exports.iterateSync = Tt;
11070
+ exports.iterate = Object.assign(Be, { sync: Tt });
11071
+ exports.sync = Object.assign(We, {
11072
+ stream: xt,
11073
+ iterate: Tt
11074
+ });
11075
+ exports.glob = Object.assign(Bs, {
11076
+ glob: Bs,
11077
+ globSync: We,
11078
+ sync: exports.sync,
11079
+ globStream: Le,
11080
+ stream: exports.stream,
11081
+ globStreamSync: xt,
11082
+ streamSync: exports.streamSync,
11083
+ globIterate: Be,
11084
+ iterate: exports.iterate,
11085
+ globIterateSync: Tt,
11086
+ iterateSync: exports.iterateSync,
11087
+ Glob: tt.Glob,
11088
+ hasMagic: Br.hasMagic,
11089
+ escape: Ws.escape,
11090
+ unescape: Ws.unescape
11091
+ });
11092
+ exports.glob.glob = exports.glob;
11093
+ }));
11094
+ //#endregion
11095
+ //#region ../base/dist/helpers/glob.js
11096
+ var require_glob = /* @__PURE__ */ __commonJSMin(((exports) => {
11097
+ var __createBinding = exports && exports.__createBinding || (Object.create ? (function(o, m, k, k2) {
11098
+ if (k2 === void 0) k2 = k;
11099
+ var desc = Object.getOwnPropertyDescriptor(m, k);
11100
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) desc = {
11101
+ enumerable: true,
11102
+ get: function() {
11103
+ return m[k];
11104
+ }
11105
+ };
11106
+ Object.defineProperty(o, k2, desc);
11107
+ }) : (function(o, m, k, k2) {
11108
+ if (k2 === void 0) k2 = k;
11109
+ o[k2] = m[k];
11110
+ }));
11111
+ var __setModuleDefault = exports && exports.__setModuleDefault || (Object.create ? (function(o, v) {
11112
+ Object.defineProperty(o, "default", {
11113
+ enumerable: true,
11114
+ value: v
11115
+ });
11116
+ }) : function(o, v) {
11117
+ o["default"] = v;
11118
+ });
11119
+ var __importStar = exports && exports.__importStar || function(mod) {
11120
+ if (mod && mod.__esModule) return mod;
11121
+ var result = {};
11122
+ if (mod != null) {
11123
+ for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
11124
+ }
11125
+ __setModuleDefault(result, mod);
11126
+ return result;
11127
+ };
11128
+ var __awaiter = exports && exports.__awaiter || function(thisArg, _arguments, P, generator) {
11129
+ function adopt(value) {
11130
+ return value instanceof P ? value : new P(function(resolve) {
11131
+ resolve(value);
11132
+ });
11133
+ }
11134
+ return new (P || (P = Promise))(function(resolve, reject) {
11135
+ function fulfilled(value) {
11136
+ try {
11137
+ step(generator.next(value));
11138
+ } catch (e) {
11139
+ reject(e);
11140
+ }
11141
+ }
11142
+ function rejected(value) {
11143
+ try {
11144
+ step(generator["throw"](value));
11145
+ } catch (e) {
11146
+ reject(e);
11147
+ }
11148
+ }
11149
+ function step(result) {
11150
+ result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected);
11151
+ }
11152
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
11153
+ });
11154
+ };
11155
+ var __importDefault = exports && exports.__importDefault || function(mod) {
11156
+ return mod && mod.__esModule ? mod : { "default": mod };
11157
+ };
11158
+ Object.defineProperty(exports, "__esModule", { value: true });
11159
+ exports.parsePathsList = exports.globAsync = exports.globSync = exports.hasMagic = void 0;
11160
+ const globModule = __importStar(require_index_min());
11161
+ const upath_1 = __importDefault(require_upath());
11162
+ const { hasMagic } = globModule;
11163
+ exports.hasMagic = hasMagic;
11164
+ /**
11165
+ * Synchronous form of `glob` which returns `upath`-normalized paths.
11166
+ */
11167
+ const globSync = (pattern, opts) => {
11168
+ return globModule.sync(pattern, Object.assign({}, opts)).map((path) => upath_1.default.normalizeSafe(path));
11169
+ };
11170
+ exports.globSync = globSync;
11171
+ /**
11172
+ * Asynchronous form of `glob` which returns `upath`-normalized paths.
11173
+ */
11174
+ const globAsync = (pattern, opts) => __awaiter(void 0, void 0, void 0, function* () {
11175
+ return (yield globModule.glob(pattern, Object.assign({}, opts))).map((path) => upath_1.default.normalizeSafe(path));
11176
+ });
11177
+ exports.globAsync = globAsync;
11178
+ const parsePathsList = (paths) => {
11179
+ if (!paths) return [];
11180
+ return paths.split(",").flatMap((path) => globModule.hasMagic(path) ? (0, exports.globSync)(path, { dotRelative: true }) : [path]).map((path) => path.endsWith("/") ? path.slice(0, -1) : path);
11181
+ };
11182
+ exports.parsePathsList = parsePathsList;
11183
+ }));
11184
+ //#endregion
7738
11185
  //#region ../base/package.json
7739
11186
  var require_package$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
7740
11187
  module.exports = {
7741
11188
  "name": "@datadog/datadog-ci-base",
7742
- "version": "5.13.1",
11189
+ "version": "5.14.0",
7743
11190
  "description": "Base package for Datadog CI",
7744
11191
  "license": "Apache-2.0",
7745
11192
  "keywords": ["datadog", "datadog-ci"],
@@ -7769,6 +11216,10 @@ var require_package$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
7769
11216
  "development": "./src/constants.ts",
7770
11217
  "default": "./dist/constants.js"
7771
11218
  },
11219
+ "./helpers/request/*": {
11220
+ "development": "./src/helpers/request/*.ts",
11221
+ "default": "./dist/helpers/request/*.js"
11222
+ },
7772
11223
  "./helpers/*": {
7773
11224
  "development": "./src/helpers/*.ts",
7774
11225
  "default": "./dist/helpers/*.js"
@@ -43170,177 +46621,6 @@ var require_dist$1 = /* @__PURE__ */ __commonJSMin(((exports) => {
43170
46621
  exports.ProxyAgent = ProxyAgent;
43171
46622
  }));
43172
46623
  //#endregion
43173
- //#region ../../node_modules/ansi-escapes/index.js
43174
- var require_ansi_escapes = /* @__PURE__ */ __commonJSMin(((exports, module) => {
43175
- const ansiEscapes = module.exports;
43176
- module.exports.default = ansiEscapes;
43177
- const ESC = "\x1B[";
43178
- const OSC = "\x1B]";
43179
- const BEL = "\x07";
43180
- const SEP = ";";
43181
- const isTerminalApp = process.env.TERM_PROGRAM === "Apple_Terminal";
43182
- ansiEscapes.cursorTo = (x, y) => {
43183
- if (typeof x !== "number") throw new TypeError("The `x` argument is required");
43184
- if (typeof y !== "number") return ESC + (x + 1) + "G";
43185
- return ESC + (y + 1) + ";" + (x + 1) + "H";
43186
- };
43187
- ansiEscapes.cursorMove = (x, y) => {
43188
- if (typeof x !== "number") throw new TypeError("The `x` argument is required");
43189
- let ret = "";
43190
- if (x < 0) ret += ESC + -x + "D";
43191
- else if (x > 0) ret += ESC + x + "C";
43192
- if (y < 0) ret += ESC + -y + "A";
43193
- else if (y > 0) ret += ESC + y + "B";
43194
- return ret;
43195
- };
43196
- ansiEscapes.cursorUp = (count = 1) => ESC + count + "A";
43197
- ansiEscapes.cursorDown = (count = 1) => ESC + count + "B";
43198
- ansiEscapes.cursorForward = (count = 1) => ESC + count + "C";
43199
- ansiEscapes.cursorBackward = (count = 1) => ESC + count + "D";
43200
- ansiEscapes.cursorLeft = ESC + "G";
43201
- ansiEscapes.cursorSavePosition = isTerminalApp ? "\x1B7" : ESC + "s";
43202
- ansiEscapes.cursorRestorePosition = isTerminalApp ? "\x1B8" : ESC + "u";
43203
- ansiEscapes.cursorGetPosition = ESC + "6n";
43204
- ansiEscapes.cursorNextLine = ESC + "E";
43205
- ansiEscapes.cursorPrevLine = ESC + "F";
43206
- ansiEscapes.cursorHide = ESC + "?25l";
43207
- ansiEscapes.cursorShow = ESC + "?25h";
43208
- ansiEscapes.eraseLines = (count) => {
43209
- let clear = "";
43210
- for (let i = 0; i < count; i++) clear += ansiEscapes.eraseLine + (i < count - 1 ? ansiEscapes.cursorUp() : "");
43211
- if (count) clear += ansiEscapes.cursorLeft;
43212
- return clear;
43213
- };
43214
- ansiEscapes.eraseEndLine = ESC + "K";
43215
- ansiEscapes.eraseStartLine = ESC + "1K";
43216
- ansiEscapes.eraseLine = ESC + "2K";
43217
- ansiEscapes.eraseDown = ESC + "J";
43218
- ansiEscapes.eraseUp = ESC + "1J";
43219
- ansiEscapes.eraseScreen = ESC + "2J";
43220
- ansiEscapes.scrollUp = ESC + "S";
43221
- ansiEscapes.scrollDown = ESC + "T";
43222
- ansiEscapes.clearScreen = "\x1Bc";
43223
- ansiEscapes.clearTerminal = process.platform === "win32" ? `${ansiEscapes.eraseScreen}${ESC}0f` : `${ansiEscapes.eraseScreen}${ESC}3J${ESC}H`;
43224
- ansiEscapes.beep = BEL;
43225
- ansiEscapes.link = (text, url) => {
43226
- return [
43227
- OSC,
43228
- "8",
43229
- SEP,
43230
- SEP,
43231
- url,
43232
- BEL,
43233
- text,
43234
- OSC,
43235
- "8",
43236
- SEP,
43237
- SEP,
43238
- BEL
43239
- ].join("");
43240
- };
43241
- ansiEscapes.image = (buffer, options = {}) => {
43242
- let ret = `${OSC}1337;File=inline=1`;
43243
- if (options.width) ret += `;width=${options.width}`;
43244
- if (options.height) ret += `;height=${options.height}`;
43245
- if (options.preserveAspectRatio === false) ret += ";preserveAspectRatio=0";
43246
- return ret + ":" + buffer.toString("base64") + BEL;
43247
- };
43248
- ansiEscapes.iTerm = {
43249
- setCwd: (cwd = process.cwd()) => `${OSC}50;CurrentDir=${cwd}${BEL}`,
43250
- annotation: (message, options = {}) => {
43251
- let ret = `${OSC}1337;`;
43252
- const hasX = typeof options.x !== "undefined";
43253
- const hasY = typeof options.y !== "undefined";
43254
- if ((hasX || hasY) && !(hasX && hasY && typeof options.length !== "undefined")) throw new Error("`x`, `y` and `length` must be defined when `x` or `y` is defined");
43255
- message = message.replace(/\|/g, "");
43256
- ret += options.isHidden ? "AddHiddenAnnotation=" : "AddAnnotation=";
43257
- if (options.length > 0) ret += (hasX ? [
43258
- message,
43259
- options.length,
43260
- options.x,
43261
- options.y
43262
- ] : [options.length, message]).join("|");
43263
- else ret += message;
43264
- return ret + BEL;
43265
- }
43266
- };
43267
- }));
43268
- //#endregion
43269
- //#region ../../node_modules/supports-hyperlinks/index.js
43270
- var require_supports_hyperlinks = /* @__PURE__ */ __commonJSMin(((exports, module) => {
43271
- const supportsColor = require_supports_color();
43272
- const hasFlag = require_has_flag();
43273
- function parseVersion(versionString) {
43274
- if (/^\d{3,4}$/.test(versionString)) {
43275
- const m = /(\d{1,2})(\d{2})/.exec(versionString);
43276
- return {
43277
- major: 0,
43278
- minor: parseInt(m[1], 10),
43279
- patch: parseInt(m[2], 10)
43280
- };
43281
- }
43282
- const versions = (versionString || "").split(".").map((n) => parseInt(n, 10));
43283
- return {
43284
- major: versions[0],
43285
- minor: versions[1],
43286
- patch: versions[2]
43287
- };
43288
- }
43289
- function supportsHyperlink(stream) {
43290
- const { env } = process;
43291
- if ("FORCE_HYPERLINK" in env) return !(env.FORCE_HYPERLINK.length > 0 && parseInt(env.FORCE_HYPERLINK, 10) === 0);
43292
- if (hasFlag("no-hyperlink") || hasFlag("no-hyperlinks") || hasFlag("hyperlink=false") || hasFlag("hyperlink=never")) return false;
43293
- if (hasFlag("hyperlink=true") || hasFlag("hyperlink=always")) return true;
43294
- if ("NETLIFY" in env) return true;
43295
- if (!supportsColor.supportsColor(stream)) return false;
43296
- if (stream && !stream.isTTY) return false;
43297
- if (process.platform === "win32") return false;
43298
- if ("CI" in env) return false;
43299
- if ("TEAMCITY_VERSION" in env) return false;
43300
- if ("TERM_PROGRAM" in env) {
43301
- const version = parseVersion(env.TERM_PROGRAM_VERSION);
43302
- switch (env.TERM_PROGRAM) {
43303
- case "iTerm.app":
43304
- if (version.major === 3) return version.minor >= 1;
43305
- return version.major > 3;
43306
- case "WezTerm": return version.major >= 20200620;
43307
- case "vscode": return version.major > 1 || version.major === 1 && version.minor >= 72;
43308
- }
43309
- }
43310
- if ("VTE_VERSION" in env) {
43311
- if (env.VTE_VERSION === "0.50.0") return false;
43312
- const version = parseVersion(env.VTE_VERSION);
43313
- return version.major > 0 || version.minor >= 50;
43314
- }
43315
- return false;
43316
- }
43317
- module.exports = {
43318
- supportsHyperlink,
43319
- stdout: supportsHyperlink(process.stdout),
43320
- stderr: supportsHyperlink(process.stderr)
43321
- };
43322
- }));
43323
- //#endregion
43324
- //#region ../../node_modules/terminal-link/index.js
43325
- var require_terminal_link = /* @__PURE__ */ __commonJSMin(((exports, module) => {
43326
- const ansiEscapes = require_ansi_escapes();
43327
- const supportsHyperlinks = require_supports_hyperlinks();
43328
- const terminalLink = (text, url, { target = "stdout", ...options } = {}) => {
43329
- if (!supportsHyperlinks[target]) {
43330
- if (options.fallback === false) return text;
43331
- return typeof options.fallback === "function" ? options.fallback(text, url) : `${text} (\u200B${url}\u200B)`;
43332
- }
43333
- return ansiEscapes.link(text, url);
43334
- };
43335
- module.exports = (text, url, options = {}) => terminalLink(text, url, options);
43336
- module.exports.stderr = (text, url, options = {}) => terminalLink(text, url, {
43337
- target: "stderr",
43338
- ...options
43339
- });
43340
- module.exports.isSupported = supportsHyperlinks.stdout;
43341
- module.exports.stderr.isSupported = supportsHyperlinks.stderr;
43342
- }));
43343
- //#endregion
43344
46624
  //#region ../../node_modules/undici/lib/core/symbols.js
43345
46625
  var require_symbols = /* @__PURE__ */ __commonJSMin(((exports, module) => {
43346
46626
  module.exports = {
@@ -65024,20 +68304,15 @@ var require_utils = /* @__PURE__ */ __commonJSMin(((exports) => {
65024
68304
  return mod && mod.__esModule ? mod : { "default": mod };
65025
68305
  };
65026
68306
  Object.defineProperty(exports, "__esModule", { value: true });
65027
- exports.isFile = exports.getGitHubEventPayload = exports.execute = exports.maskString = exports.formatBytes = exports.timedExecAsync = exports.filterAndFormatGithubRemote = exports.filterSensitiveInfoFromRepository = exports.performSubCommand = exports.pluralize = exports.normalizeRef = exports.recursivelyRemoveUndefinedValues = exports.removeUndefinedValues = exports.removeEmptyValues = exports.buildPath = exports.getApiHostForSite = exports.getProxyAgent = exports.getRequestBuilder = exports.getProxyUrl = exports.resolveConfigFromFile = exports.resolveConfigFromFileAndEnvironment = exports.getConfig = exports.pick = exports.makeTerminalLink = exports.DEFAULT_CONFIG_PATHS = void 0;
68307
+ exports.isFile = exports.getGitHubEventPayload = exports.execute = exports.maskString = exports.formatBytes = exports.timedExecAsync = exports.filterAndFormatGithubRemote = exports.filterSensitiveInfoFromRepository = exports.performSubCommand = exports.pluralize = exports.normalizeRef = exports.recursivelyRemoveUndefinedValues = exports.removeUndefinedValues = exports.removeEmptyValues = exports.buildPath = exports.getApiHostForSite = exports.getProxyAgent = exports.getRequestBuilder = exports.getProxyUrl = exports.resolveConfigFromFile = exports.resolveConfigFromFileAndEnvironment = exports.getConfig = exports.pick = exports.DEFAULT_CONFIG_PATHS = void 0;
65028
68308
  const child_process_1$1 = require("child_process");
65029
68309
  const fs_1$4 = require("fs");
65030
68310
  const util_1 = require("util");
65031
68311
  const clipanion_1 = require_advanced();
65032
68312
  const deep_extend_1 = __importDefault(require_deep_extend());
65033
68313
  const proxy_agent_1 = require_dist$1();
65034
- const terminal_link_1 = __importDefault(require_terminal_link());
65035
68314
  const request_1 = require_request();
65036
68315
  exports.DEFAULT_CONFIG_PATHS = ["datadog-ci.json"];
65037
- const makeTerminalLink = (url) => {
65038
- return ((strings) => (0, terminal_link_1.default)(strings[0], url));
65039
- };
65040
- exports.makeTerminalLink = makeTerminalLink;
65041
68316
  const pick = (base, keys) => {
65042
68317
  const definedKeys = keys.filter((key) => !!base[key]);
65043
68318
  const pickedObject = {};
@@ -65729,10 +69004,11 @@ var require_ci = /* @__PURE__ */ __commonJSMin(((exports) => {
65729
69004
  return mod && mod.__esModule ? mod : { "default": mod };
65730
69005
  };
65731
69006
  Object.defineProperty(exports, "__esModule", { value: true });
65732
- exports.getGithubJobIDFromLogs = exports.getGithubStepInfoFromLogs = exports.enrichCIEnvFromGithubLogs = exports.getGithubJobNameFromLogs = exports.isGithubWindowsRunner = exports.shouldGetGithubJobID = exports.shouldGetGithubJobDisplayName = exports.isInteractive = exports.getCIProvider = exports.isCI = exports.getCIEnv = exports.getCIMetadata = exports.getCISpanTags = exports.githubWellKnownDiagnosticDirsWin = exports.githubWellKnownDiagnosticDirsUnix = exports.validateLevel = exports.LEVEL_TO_NUMBER = exports.VALID_LEVELS = exports.CI_LEVELS = exports.envDDGithubStepIndex = exports.envDDGithubJobName = exports.CI_ENGINES = void 0;
69007
+ exports.getGithubJobIDFromLogs = exports.getGithubStepInfoFromLogs = exports.enrichCIEnvFromGithubLogs = exports.getGithubJobNameFromLogs = exports.isGithubWindowsRunner = exports.shouldGetGithubJobID = exports.shouldGetGithubJobDisplayName = exports.isInteractive = exports.getCIProvider = exports.isCI = exports.getCIEnv = exports.getCIMetadata = exports.getCISpanTags = exports.githubWellKnownDiagnosticDirPatternsWin = exports.githubWellKnownDiagnosticDirPatternsUnix = exports.githubWellKnownDiagnosticDirsWin = exports.githubWellKnownDiagnosticDirsUnix = exports.validateLevel = exports.LEVEL_TO_NUMBER = exports.VALID_LEVELS = exports.CI_LEVELS = exports.envDDGithubStepIndex = exports.envDDGithubJobName = exports.CI_ENGINES = void 0;
65733
69008
  const fs_1$2 = __importDefault(require("fs"));
65734
69009
  const chalk_1 = __importDefault(require_source());
65735
69010
  const upath_1 = __importDefault(require_upath());
69011
+ const glob_1 = require_glob();
65736
69012
  const tags_1 = require_tags();
65737
69013
  const user_provided_git_1 = require_user_provided_git();
65738
69014
  const utils_1 = require_utils();
@@ -65786,12 +69062,10 @@ var require_ci = /* @__PURE__ */ __commonJSMin(((exports) => {
65786
69062
  if (level === exports.CI_LEVELS.STEP && provider !== exports.CI_ENGINES.GITHUB) return `Level '${exports.CI_LEVELS.STEP}' is only supported for provider [${exports.CI_ENGINES.GITHUB}]`;
65787
69063
  };
65788
69064
  exports.validateLevel = validateLevel;
65789
- exports.githubWellKnownDiagnosticDirsUnix = [
65790
- "/home/runner/actions-runner/cached/_diag",
65791
- "/home/runner/actions-runner/_diag",
65792
- "/opt/actions-runner/_diag"
65793
- ];
65794
- exports.githubWellKnownDiagnosticDirsWin = ["C:/actions-runner/cached/_diag", "C:/actions-runner/_diag"];
69065
+ exports.githubWellKnownDiagnosticDirsUnix = ["/home/runner/actions-runner/_diag", "/opt/actions-runner/_diag"];
69066
+ exports.githubWellKnownDiagnosticDirsWin = ["C:/actions-runner/_diag"];
69067
+ exports.githubWellKnownDiagnosticDirPatternsUnix = ["/home/runner/actions-runner/*/_diag", "/home/runner/actions-runner/*/*/_diag"];
69068
+ exports.githubWellKnownDiagnosticDirPatternsWin = ["C:/actions-runner/*/_diag", "C:/actions-runner/*/*/_diag"];
65795
69069
  const githubJobDisplayNameRegex = /"jobDisplayName":\s*"((?:[^"\\]|\\.)*)"/;
65796
69070
  const githubJodIDRegex = /"job":\s*{[\s\S]*?"v"\s*:\s*(\d+)(?:\.0)?/;
65797
69071
  /**
@@ -65822,13 +69096,27 @@ var require_ci = /* @__PURE__ */ __commonJSMin(((exports) => {
65822
69096
  const runnerTemp = process.env.RUNNER_TEMP;
65823
69097
  if (runnerTemp) {
65824
69098
  const runnerRoot = upath_1.default.resolve(runnerTemp, "..", "..");
65825
- dirs.push(upath_1.default.join(runnerRoot, "cached", "_diag"));
69099
+ dirs.push(`${runnerRoot}/*/_diag`);
69100
+ dirs.push(`${runnerRoot}/*/*/_diag`);
65826
69101
  dirs.push(upath_1.default.join(runnerRoot, "_diag"));
65827
- dirs.push(upath_1.default.join(runnerRoot, "actions-runner", "cached", "_diag"));
69102
+ dirs.push(`${runnerRoot}/actions-runner/*/_diag`);
69103
+ dirs.push(`${runnerRoot}/actions-runner/*/*/_diag`);
65828
69104
  dirs.push(upath_1.default.join(runnerRoot, "actions-runner", "_diag"));
65829
69105
  }
65830
69106
  return uniq(dirs.filter(Boolean));
65831
69107
  };
69108
+ /**
69109
+ * Expands a mixed list of literal directories and glob patterns into concrete
69110
+ * directories. Literals pass through unchanged (existence is checked later).
69111
+ */
69112
+ const expandDiagnosticDirCandidates = (candidates) => {
69113
+ const expanded = [];
69114
+ for (const candidate of candidates) if ((0, glob_1.hasMagic)(candidate)) try {
69115
+ expanded.push(...(0, glob_1.globSync)(candidate));
69116
+ } catch (_a) {}
69117
+ else expanded.push(candidate);
69118
+ return uniq(expanded);
69119
+ };
65832
69120
  const parseEmailAndName = (emailAndName) => {
65833
69121
  if (!emailAndName) return {
65834
69122
  name: "",
@@ -66420,8 +69708,16 @@ var require_ci = /* @__PURE__ */ __commonJSMin(((exports) => {
66420
69708
  const getGithubWorkerLogFiles = (context) => {
66421
69709
  let foundDiagDir = "";
66422
69710
  let workerLogFiles = [];
66423
- let wellKnownDirs = uniq([...getGithubDiagnosticDirsFromEnv(), ...exports.githubWellKnownDiagnosticDirsUnix]);
66424
- if ((0, exports.isGithubWindowsRunner)()) wellKnownDirs = uniq([...getGithubDiagnosticDirsFromEnv(), ...exports.githubWellKnownDiagnosticDirsWin]);
69711
+ let wellKnownDirs = expandDiagnosticDirCandidates([
69712
+ ...getGithubDiagnosticDirsFromEnv(),
69713
+ ...exports.githubWellKnownDiagnosticDirPatternsUnix,
69714
+ ...exports.githubWellKnownDiagnosticDirsUnix
69715
+ ]);
69716
+ if ((0, exports.isGithubWindowsRunner)()) wellKnownDirs = expandDiagnosticDirCandidates([
69717
+ ...getGithubDiagnosticDirsFromEnv(),
69718
+ ...exports.githubWellKnownDiagnosticDirPatternsWin,
69719
+ ...exports.githubWellKnownDiagnosticDirsWin
69720
+ ]);
66425
69721
  for (const currentDir of wellKnownDirs) try {
66426
69722
  const potentialLogs = fs_1$2.default.readdirSync(currentDir, { withFileTypes: true }).filter((file) => file.isFile() && file.name.startsWith("Worker_") && file.name.endsWith(".log")).map((file) => file.name);
66427
69723
  if (potentialLogs.length > 0) {
@@ -66444,38 +69740,43 @@ var require_ci = /* @__PURE__ */ __commonJSMin(((exports) => {
66444
69740
  return [foundDiagDir, workerLogFiles];
66445
69741
  };
66446
69742
  /**
66447
- * Narrows the list of Worker log files to check by using ACTIONS_ORCHESTRATION_ID
66448
- * to identify the correct log for the current job on non-ephemeral runners.
69743
+ * Narrows the list of Worker log files to the one belonging to the current job.
69744
+ *
69745
+ * Worker log filenames contain a timestamp (Worker_YYYYMMDD-HHMMSS-utc.log), so
69746
+ * alphabetical order equals chronological order. Logs are always returned
69747
+ * newest-first so that the caller's iteration naturally encounters the current
69748
+ * job's log before any earlier ones — correct on both ephemeral and non-ephemeral
69749
+ * (multi) runners regardless of the strategy used.
66449
69750
  *
66450
- * ACTIONS_ORCHESTRATION_ID format: <planId>.<jobId>.__default
69751
+ * Primary strategy (runner >= v2.331.0, feature-flag gated):
69752
+ * ACTIONS_ORCHESTRATION_ID is set by the runner from the system.orchestrationId
69753
+ * variable in the job request message. That variable is serialized into the Worker
69754
+ * log as part of the job message JSON. planId is a GUID shared by all jobs in the
69755
+ * same workflow run, so the full orchestration ID is needed for a unique match:
69756
+ * Non-matrix job: <planId>.<yaml-job-key>.__default
69757
+ * Single-dimension matrix: <planId>.<yaml-job-key>.<matrix-value>
69758
+ * Multi-dimension matrix: <planId>.<yaml-job-key>.<val1>.<val2>[...]
66451
69759
  *
66452
- * All jobs in the same GitHub Actions workflow run share the same planId.
66453
- * On multi-runners (non-ephemeral runners processing sequential jobs), multiple
66454
- * Worker log files can exist from different jobs of the same workflow run,
66455
- * all containing the same planId. Matching only on planId causes the first
66456
- * (chronologically oldest) log to be selected, which may belong to a previous
66457
- * job. The jobId (second segment of ACTIONS_ORCHESTRATION_ID) is unique per job
66458
- * and is serialized as "jobId" in the Worker log's job message JSON, allowing
66459
- * unambiguous identification of the current job's log.
69760
+ * Fallback (runner < v2.331.0 or ACTIONS_ORCHESTRATION_ID absent/unmatched):
69761
+ * Return all logs newest-first. The caller iterates until it finds a jobDisplayName,
69762
+ * which on a single-job runner is immediate, and on a multi-runner is the current
69763
+ * job's (most recent) log.
66460
69764
  */
66461
69765
  const getTargetWorkerLogFiles = (context, foundDiagDir, workerLogFiles) => {
69766
+ const sortedNewestFirst = [...workerLogFiles].sort().reverse();
66462
69767
  const orchestrationId = process.env.ACTIONS_ORCHESTRATION_ID;
66463
- if (!orchestrationId) return workerLogFiles;
66464
- const parts = orchestrationId.split(".");
66465
- const planId = parts[0];
66466
- const jobId = parts[1];
66467
- for (const logFile of workerLogFiles) {
66468
- const filePath = upath_1.default.join(foundDiagDir, logFile);
66469
- const content = fs_1$2.default.readFileSync(filePath, "utf-8");
66470
- const matchesPlanId = content.includes(`"planId": "${planId}"`);
66471
- const matchesJobId = !jobId || content.includes(`"jobId": "${jobId}"`);
66472
- if (matchesPlanId && matchesJobId) {
66473
- context.stdout.write(`Found Worker log for planId ${planId}, jobId ${jobId !== null && jobId !== void 0 ? jobId : "N/A"}: ${logFile}\n`);
66474
- return [logFile];
69768
+ if (orchestrationId) {
69769
+ for (const logFile of sortedNewestFirst) {
69770
+ const filePath = upath_1.default.join(foundDiagDir, logFile);
69771
+ const content = fs_1$2.default.readFileSync(filePath, "utf-8");
69772
+ if (content.includes("\"system.orchestrationId\":") && content.includes(`"${orchestrationId}"`)) {
69773
+ context.stdout.write(`Found Worker log via system.orchestrationId for ${orchestrationId}: ${logFile}\n`);
69774
+ return [logFile];
69775
+ }
66475
69776
  }
69777
+ context.stderr.write(`${chalk_1.default.yellow.bold("[WARNING]")} Could not find Worker log via system.orchestrationId for ${orchestrationId}, checking all logs\n`);
66476
69778
  }
66477
- context.stderr.write(`${chalk_1.default.yellow.bold("[WARNING]")} Could not find Worker log for planId ${planId}, jobId ${jobId !== null && jobId !== void 0 ? jobId : "N/A"}, checking all logs\n`);
66478
- return workerLogFiles;
69779
+ return sortedNewestFirst;
66479
69780
  };
66480
69781
  const getGithubJobAttributeFromLogFiles = (context, foundDiagDir, workerLogFiles, jobAttributeRegex) => {
66481
69782
  const logsToCheck = getTargetWorkerLogFiles(context, foundDiagDir, workerLogFiles);
@@ -76827,6 +80128,66 @@ var require_semver = /* @__PURE__ */ __commonJSMin(((exports, module) => {
76827
80128
  };
76828
80129
  }));
76829
80130
  //#endregion
80131
+ //#region ../base/dist/helpers/request/datadog-route.js
80132
+ var require_datadog_route = /* @__PURE__ */ __commonJSMin(((exports) => {
80133
+ Object.defineProperty(exports, "__esModule", { value: true });
80134
+ exports.datadogRoute = exports.DATADOG_ROUTE_PATHS = void 0;
80135
+ /**
80136
+ * List of all Datadog API routes used by datadog-ci.
80137
+ *
80138
+ * Only those routes are accepted by {@link datadogRoute}.
80139
+ */
80140
+ exports.DATADOG_ROUTE_PATHS = [
80141
+ "/api/intake/ci/custom_spans",
80142
+ "/api/ui/support/serverless/flare",
80143
+ "/api/unstable/deployments/gates/evaluation",
80144
+ "/api/unstable/deployments/gates/evaluation/:evaluationId",
80145
+ "/api/v1/validate",
80146
+ "/api/v2/ci/deployments/correlate-image",
80147
+ "/api/v2/ci/deployments/correlate",
80148
+ "/api/v2/ci/pipeline/metrics",
80149
+ "/api/v2/ci/pipeline/tags",
80150
+ "/api/v2/cicodescan",
80151
+ "/api/v2/cicovreprt",
80152
+ "/api/v2/ciiac",
80153
+ "/api/v2/cireport",
80154
+ "/api/v2/dora/deployment",
80155
+ "/api/v2/git/repository/packfile",
80156
+ "/api/v2/git/repository/search_commits",
80157
+ "/api/v2/quality-gates/evaluate",
80158
+ "/api/v2/srcmap",
80159
+ "/api/v2/static-analysis-sca/dependencies",
80160
+ "/synthetics/ci/batch/:batchId",
80161
+ "/synthetics/ci/tunnel",
80162
+ "/synthetics/mobile/applications/:applicationId/multipart-presigned-urls",
80163
+ "/synthetics/mobile/applications/:applicationId/multipart-upload-complete",
80164
+ "/synthetics/mobile/applications/validation-job-status/:jobId",
80165
+ "/synthetics/settings",
80166
+ "/synthetics/tests/:testId",
80167
+ "/synthetics/tests/:testId/version_history/:version?only_check_existence=true",
80168
+ "/synthetics/tests/:testType/:testId",
80169
+ "/synthetics/tests/poll_results",
80170
+ "/synthetics/tests/search",
80171
+ "/synthetics/tests/trigger/ci",
80172
+ "/v1/input"
80173
+ ];
80174
+ /**
80175
+ * Format a Datadog API route with optional parameters.
80176
+ *
80177
+ * @example
80178
+ * ```ts
80179
+ * const route = datadogRoute('/api/v2/resources/:resourceId', {
80180
+ * resourceId: '123',
80181
+ * })
80182
+ * ```
80183
+ */
80184
+ const datadogRoute = (route, ...[params]) => {
80185
+ if (!params) return route;
80186
+ return route.replace(/:([A-Za-z0-9_]+)/g, (_, key) => encodeURIComponent(String(params[key])));
80187
+ };
80188
+ exports.datadogRoute = datadogRoute;
80189
+ }));
80190
+ //#endregion
76830
80191
  //#region ../../node_modules/retry/lib/retry_operation.js
76831
80192
  var require_retry_operation = /* @__PURE__ */ __commonJSMin(((exports, module) => {
76832
80193
  function RetryOperation(timeouts, options) {
@@ -77140,6 +80501,7 @@ var require_gitdb = /* @__PURE__ */ __commonJSMin(((exports) => {
77140
80501
  const semver_1 = require_semver();
77141
80502
  const upath_1 = __importDefault(require_upath());
77142
80503
  const get_git_data_1 = require_get_git_data();
80504
+ const datadog_route_1 = require_datadog_route();
77143
80505
  const retry_1 = require_retry();
77144
80506
  const API_TIMEOUT = 15e3;
77145
80507
  const MAX_HISTORY = {
@@ -77293,7 +80655,7 @@ var require_gitdb = /* @__PURE__ */ __commonJSMin(((exports) => {
77293
80655
  }))
77294
80656
  });
77295
80657
  const response = yield runRequest(log, "search_commits", () => request({
77296
- url: "/api/v2/git/repository/search_commits",
80658
+ url: (0, datadog_route_1.datadogRoute)("/api/v2/git/repository/search_commits"),
77297
80659
  headers: { "Content-Type": "application/json" },
77298
80660
  data: localCommitData,
77299
80661
  method: "POST",
@@ -77370,7 +80732,7 @@ var require_gitdb = /* @__PURE__ */ __commonJSMin(((exports) => {
77370
80732
  contentType: "application/octet-stream"
77371
80733
  });
77372
80734
  return runRequest(log, "packfile", () => request({
77373
- url: "/api/v2/git/repository/packfile",
80735
+ url: (0, datadog_route_1.datadogRoute)("/api/v2/git/repository/packfile"),
77374
80736
  headers: Object.assign({}, form.getHeaders()),
77375
80737
  timeout: API_TIMEOUT,
77376
80738
  data: form,
@@ -77436,6 +80798,7 @@ var require_apikey = /* @__PURE__ */ __commonJSMin(((exports) => {
77436
80798
  const chalk_1 = __importDefault(require_source());
77437
80799
  const errors_1 = require_errors();
77438
80800
  const request_1 = require_request();
80801
+ const datadog_route_1 = require_datadog_route();
77439
80802
  const newApiKeyValidator = (params) => new ApiKeyValidatorImplem(params.apiKey, params.datadogSite, params.metricsLogger);
77440
80803
  exports.newApiKeyValidator = newApiKeyValidator;
77441
80804
  /** ApiKeyValidator is an helper class to interpret Datadog error responses and possibly check the
@@ -77472,7 +80835,8 @@ var require_apikey = /* @__PURE__ */ __commonJSMin(((exports) => {
77472
80835
  return (yield (0, request_1.httpRequest)({
77473
80836
  headers: { "DD-API-KEY": this.apiKey },
77474
80837
  method: "GET",
77475
- url: this.getApiKeyValidationURL()
80838
+ baseURL: `https://api.${this.datadogSite}`,
80839
+ url: (0, datadog_route_1.datadogRoute)("/api/v1/validate")
77476
80840
  })).data.valid;
77477
80841
  } catch (error) {
77478
80842
  if ((0, request_1.isRequestError)(error) && error.response && error.response.status === 403) return false;
@@ -77480,9 +80844,6 @@ var require_apikey = /* @__PURE__ */ __commonJSMin(((exports) => {
77480
80844
  }
77481
80845
  });
77482
80846
  }
77483
- getApiKeyValidationURL() {
77484
- return `https://api.${this.datadogSite}/api/v1/validate`;
77485
- }
77486
80847
  isApiKeyValid() {
77487
80848
  return __awaiter(this, void 0, void 0, function* () {
77488
80849
  if (this.isValid === void 0) this.isValid = yield this.validateApiKey();
@@ -77574,6 +80935,7 @@ var require_upload$1 = /* @__PURE__ */ __commonJSMin(((exports) => {
77574
80935
  const fs_1 = __importDefault(require("fs"));
77575
80936
  const zlib_1 = require("zlib");
77576
80937
  const form_data_1 = __importDefault(require_form_data());
80938
+ const datadog_route_1 = require_datadog_route();
77577
80939
  const retry_1 = require_retry();
77578
80940
  var UploadStatus;
77579
80941
  (function(UploadStatus) {
@@ -77627,7 +80989,7 @@ var require_upload$1 = /* @__PURE__ */ __commonJSMin(((exports) => {
77627
80989
  data,
77628
80990
  headers,
77629
80991
  method: "POST",
77630
- url: "v1/input"
80992
+ url: (0, datadog_route_1.datadogRoute)("/v1/input")
77631
80993
  });
77632
80994
  });
77633
80995
  }));
@@ -77665,6 +81027,7 @@ var require_library = /* @__PURE__ */ __commonJSMin(((exports) => {
77665
81027
  exports.uploadRepository = exports.uploadGitCommitHash = exports.getGitCommitInfo = exports.isGitRepo = void 0;
77666
81028
  const apikey_1 = require_apikey();
77667
81029
  const logger_1 = require_logger();
81030
+ const datadog_route_1 = require_datadog_route();
77668
81031
  const upload_1 = require_upload$1();
77669
81032
  const utils_1 = require_utils();
77670
81033
  const version_1 = require_version$1();
@@ -77708,7 +81071,7 @@ var require_library = /* @__PURE__ */ __commonJSMin(((exports) => {
77708
81071
  apiKey,
77709
81072
  baseUrl: "https://sourcemap-intake." + datadogSite,
77710
81073
  headers: new Map([["DD-EVP-ORIGIN", "datadog-ci_sci"], ["DD-EVP-ORIGIN-VERSION", version_1.cliVersion]]),
77711
- overrideUrl: "api/v2/srcmap"
81074
+ overrideUrl: (0, datadog_route_1.datadogRoute)("/api/v2/srcmap")
77712
81075
  });
77713
81076
  if ((yield (0, exports.uploadRepository)(requestBuilder, version_1.cliVersion)(payload, {
77714
81077
  apiKeyValidator,
@@ -79784,6 +83147,7 @@ var import_env = require_env();
79784
83147
  var import_fips = require_fips();
79785
83148
  var import_id = /* @__PURE__ */ __toESM(require_id());
79786
83149
  var import_api = require_api();
83150
+ var import_datadog_route = require_datadog_route();
79787
83151
  var import_utils = require_utils();
79788
83152
  var import_form_data = /* @__PURE__ */ __toESM(require_form_data());
79789
83153
  const intakeUrl = (0, import_api.getIntakeUrl)("ci-intake");
@@ -79811,7 +83175,7 @@ const uploadTerraformArtifact = (request) => async (payload) => {
79811
83175
  data: form,
79812
83176
  headers: form.getHeaders(),
79813
83177
  method: "POST",
79814
- url: "api/v2/ciiac"
83178
+ url: (0, import_datadog_route.datadogRoute)("/api/v2/ciiac")
79815
83179
  });
79816
83180
  };
79817
83181
  const gzipContent = (content) => {