opfs-worker 1.2.4 → 1.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,79 +1,166 @@
1
- class g extends Error {
2
- constructor(t, e, n, i) {
3
- super(t, { cause: i }), this.code = e, this.path = n, this.name = "OPFSError";
1
+ const lt = {
2
+ ENOENT: -2,
3
+ // No such file or directory
4
+ EISDIR: -21,
5
+ // Is a directory
6
+ ENOTDIR: -20,
7
+ // Not a directory
8
+ EACCES: -13,
9
+ // Permission denied
10
+ EEXIST: -17,
11
+ // File exists
12
+ ENOTEMPTY: -39,
13
+ // Directory not empty
14
+ EINVAL: -22,
15
+ // Invalid argument
16
+ EIO: -5,
17
+ // I/O error
18
+ ENOSPC: -28,
19
+ // No space left on device
20
+ EBUSY: -16,
21
+ // Device or resource busy
22
+ EINTR: -4,
23
+ // Interrupted system call
24
+ ENOTSUP: -95,
25
+ // Operation not supported
26
+ ERANGE: -34,
27
+ // Result too large
28
+ EBADF: -9,
29
+ // Bad file descriptor
30
+ EROOT: -1
31
+ // Custom: Cannot remove root directory
32
+ };
33
+ class y extends Error {
34
+ errno;
35
+ syscall;
36
+ path;
37
+ constructor(t, e, n, r, i) {
38
+ super(t, { cause: i }), this.name = e, this.errno = lt[e] || -1, this.path = n, this.syscall = r;
4
39
  }
5
40
  }
6
- class it extends g {
41
+ class ht extends y {
7
42
  constructor(t) {
8
- super("OPFS is not supported in this browser", "OPFS_NOT_SUPPORTED", void 0, t);
43
+ super("OPFS is not supported in this browser", "ENOTSUP", void 0, void 0, t);
9
44
  }
10
45
  }
11
- class we extends g {
12
- constructor(t) {
13
- super("OPFS is not mounted", "OPFS_NOT_MOUNTED", void 0, t);
46
+ class Te extends y {
47
+ constructor(t, e, n) {
48
+ super(t, "INVALID_PATH", e, "access", n);
49
+ }
50
+ }
51
+ class Z extends y {
52
+ constructor(t, e, n) {
53
+ const r = {
54
+ file: `File not found: ${e}`,
55
+ directory: `Directory not found: ${e}`,
56
+ source: `Source does not exist: ${e}`
57
+ };
58
+ super(r[t], "ENOENT", e, "access", n);
14
59
  }
15
60
  }
16
- class ye extends g {
61
+ class ut extends y {
17
62
  constructor(t, e, n) {
18
- super(t, "INVALID_PATH", e, n);
63
+ super(`Permission denied for ${e} on: ${t}`, "EACCES", t, e, n);
19
64
  }
20
65
  }
21
- class Ee extends g {
66
+ class ft extends y {
67
+ constructor(t, e, n) {
68
+ super(t, "ENOSPC", e, "write", n);
69
+ }
70
+ }
71
+ class pt extends y {
22
72
  constructor(t, e) {
23
- super(`File not found: ${t}`, "FILE_NOT_FOUND", t, e);
73
+ super(`File is busy: ${t}`, "EBUSY", t, "open", e);
74
+ }
75
+ }
76
+ class k extends y {
77
+ constructor(t, e, n) {
78
+ const r = t === "directory" ? `Is a directory: ${e}` : `Not a directory: ${e}`, i = t === "directory" ? "EISDIR" : "ENOTDIR";
79
+ super(r, i, e, "access", n);
24
80
  }
25
81
  }
26
- class Se extends g {
82
+ class b extends y {
83
+ constructor(t, e, n, r) {
84
+ const i = {
85
+ argument: "EINVAL",
86
+ format: "INVALID_FORMAT",
87
+ descriptor: "EBADF",
88
+ overflow: "ERANGE"
89
+ };
90
+ super(e, i[t], n, "validate", r);
91
+ }
92
+ }
93
+ class dt extends y {
27
94
  constructor(t, e) {
28
- super(`Directory not found: ${t}`, "DIRECTORY_NOT_FOUND", t, e);
95
+ super(`Operation aborted: ${t}`, "EINTR", t, "interrupt", e);
29
96
  }
30
97
  }
31
- class xe extends g {
98
+ class U extends y {
32
99
  constructor(t, e, n) {
33
- super(`Permission denied for ${e} on: ${t}`, "PERMISSION_DENIED", t, n);
100
+ super(t, "EIO", e, "io", n);
34
101
  }
35
102
  }
36
- class Ne extends g {
103
+ class gt extends y {
104
+ constructor(t, e) {
105
+ super(`Operation not supported: ${t}`, "ENOTSUP", t, "operation", e);
106
+ }
107
+ }
108
+ class z extends y {
37
109
  constructor(t, e, n) {
38
- super(t, "STORAGE_ERROR", e, n);
110
+ const r = {
111
+ RM_FAILED: `Failed to remove entry: ${e}`,
112
+ ENOTEMPTY: `Directory not empty: ${e}. Use recursive option to force removal.`,
113
+ EROOT: "Cannot remove root directory"
114
+ };
115
+ super(r[t] || `Directory operation failed: ${e}`, t, e, "unlink", n);
39
116
  }
40
117
  }
41
- class Oe extends g {
118
+ class Me extends y {
119
+ constructor(t, e) {
120
+ super("Failed to initialize OPFS", "INIT_FAILED", t, "init", e);
121
+ }
122
+ }
123
+ class Re extends y {
42
124
  constructor(t, e, n) {
43
- super(`Operation timed out: ${t}`, "TIMEOUT_ERROR", e, n);
125
+ super(`Failed to ${t}: ${e}`, `${t.toUpperCase()}_FAILED`, e, t, n);
126
+ }
127
+ }
128
+ class Ce extends y {
129
+ constructor(t, e) {
130
+ super(`Destination already exists: ${t}`, "EEXIST", t, "open", e);
44
131
  }
45
132
  }
46
- function be(s, t, e, n) {
47
- const i = `${s.toUpperCase()}_FAILED`;
48
- return new g(`Failed to ${s} file descriptor: ${t}`, i, e, n);
133
+ function Pe(s, t, e, n) {
134
+ const r = `${s.toUpperCase()}_FAILED`;
135
+ return new y(`Failed to ${s} file descriptor: ${t}`, r, e, s, n);
49
136
  }
50
- function rt(s, t) {
137
+ function mt(s, t) {
51
138
  const e = t?.path, n = t?.isDirectory;
52
139
  switch (s.name) {
53
140
  case "InvalidStateError":
54
- return new g(`File is busy: ${e || "unknown"}`, "EBUSY", e, s);
141
+ return new pt(e || "unknown", s);
55
142
  case "QuotaExceededError":
56
- return new g(`No space left on device: ${e || "unknown"}`, "ENOSPC", e, s);
143
+ return new ft(`No space left on device: ${e || "unknown"}`, e, s);
57
144
  case "NotFoundError":
58
- return new g(`No such file or directory: ${e || "unknown"}`, "ENOENT", e, s);
145
+ return new Z("file", e, s);
59
146
  case "TypeMismatchError":
60
- return n !== void 0 ? n ? new g(`Not a directory: ${e || "unknown"}`, "ENOTDIR", e, s) : new g(`Is a directory: ${e || "unknown"}`, "EISDIR", e, s) : new g(`Type mismatch: ${e || "unknown"}`, "EINVAL", e, s);
147
+ return n !== void 0 ? n ? new k("directory", e || "unknown", s) : new k("file", e || "unknown", s) : new b("argument", `Type mismatch: ${e || "unknown"}`, e, s);
61
148
  case "NotAllowedError":
62
149
  case "SecurityError":
63
- return new g(`Permission denied: ${e || "unknown"}`, "EACCES", e, s);
150
+ return new ut(e, "unknown", s);
64
151
  case "InvalidModificationError":
65
- return new g(`Invalid modification: ${e || "unknown"}`, "EINVAL", e, s);
152
+ return new b("argument", `Invalid modification: ${e || "unknown"}`, e, s);
66
153
  case "AbortError":
67
- return new g(`Operation aborted: ${e || "unknown"}`, "EINTR", e, s);
154
+ return new dt(e || "unknown", s);
68
155
  case "OperationError":
69
- return new g(`Operation failed: ${e || "unknown"}`, "EIO", e, s);
156
+ return new U(`Operation failed: ${e || "unknown"}`, e, s);
70
157
  case "TypeError":
71
- return new g(`Operation not supported: ${e || "unknown"}`, "ENOTSUP", e, s);
158
+ return new gt(e || "unknown", s);
72
159
  default:
73
- return new g(`I/O error: ${e || "unknown"}`, "EIO", e, s);
160
+ return new U(`I/O error: ${e || "unknown"}`, e, s);
74
161
  }
75
162
  }
76
- const ot = [
163
+ const wt = [
77
164
  // Images
78
165
  ".jpg",
79
166
  ".jpeg",
@@ -130,14 +217,14 @@ const ot = [
130
217
  ".fbx",
131
218
  ".3ds"
132
219
  ];
133
- function Ae(s) {
220
+ function Ie(s) {
134
221
  const t = s.lastIndexOf(".");
135
222
  if (t <= 0)
136
223
  return !0;
137
224
  const e = s.slice(t).toLowerCase();
138
- return ot.includes(e);
225
+ return wt.includes(e);
139
226
  }
140
- function ct(s, t = "utf-8") {
227
+ function yt(s, t = "utf-8") {
141
228
  switch (t) {
142
229
  case "utf8":
143
230
  case "utf-8":
@@ -146,24 +233,24 @@ function ct(s, t = "utf-8") {
146
233
  case "utf-16le":
147
234
  case "ucs2":
148
235
  case "ucs-2":
149
- return at(s);
236
+ return Et(s);
150
237
  case "ascii":
151
- return ut(s);
238
+ return Ot(s);
152
239
  case "latin1":
153
- return lt(s);
240
+ return St(s);
154
241
  case "binary":
155
242
  return Uint8Array.from(s, (e) => e.charCodeAt(0));
156
243
  case "base64":
157
244
  return Uint8Array.from(atob(s), (e) => e.charCodeAt(0));
158
245
  case "hex":
159
246
  if (!/^[\da-f]+$/i.test(s) || s.length % 2 !== 0)
160
- throw new g("Invalid hex string", "INVALID_HEX_FORMAT");
247
+ throw new b("format", "Invalid hex string");
161
248
  return Uint8Array.from(s.match(/.{1,2}/g).map((e) => parseInt(e, 16)));
162
249
  default:
163
250
  return console.warn("Encoding not supported, falling back to UTF-8"), new TextEncoder().encode(s);
164
251
  }
165
252
  }
166
- function ve(s, t = "utf-8") {
253
+ function De(s, t = "utf-8") {
167
254
  switch (t) {
168
255
  case "utf8":
169
256
  case "utf-8":
@@ -172,7 +259,7 @@ function ve(s, t = "utf-8") {
172
259
  case "utf-16le":
173
260
  case "ucs2":
174
261
  case "ucs-2":
175
- return ht(s);
262
+ return xt(s);
176
263
  case "latin1":
177
264
  return String.fromCharCode(...s);
178
265
  case "ascii":
@@ -185,7 +272,7 @@ function ve(s, t = "utf-8") {
185
272
  return console.warn("Unsupported encoding, falling back to UTF-8"), new TextDecoder().decode(s);
186
273
  }
187
274
  }
188
- function at(s) {
275
+ function Et(s) {
189
276
  const t = new Uint8Array(s.length * 2);
190
277
  for (let e = 0; e < s.length; e++) {
191
278
  const n = s.charCodeAt(e);
@@ -193,148 +280,148 @@ function at(s) {
193
280
  }
194
281
  return t;
195
282
  }
196
- function ht(s) {
283
+ function xt(s) {
197
284
  s.length % 2 !== 0 && (console.warn("Invalid UTF-16LE buffer length, truncating last byte"), s = s.slice(0, s.length - 1));
198
285
  const t = new Uint16Array(s.buffer, s.byteOffset, s.byteLength / 2);
199
286
  return String.fromCharCode(...t);
200
287
  }
201
- function lt(s) {
288
+ function St(s) {
202
289
  const t = new Uint8Array(s.length);
203
290
  for (let e = 0; e < s.length; e++)
204
291
  t[e] = s.charCodeAt(e) & 255;
205
292
  return t;
206
293
  }
207
- function ut(s) {
294
+ function Ot(s) {
208
295
  const t = new Uint8Array(s.length);
209
296
  for (let e = 0; e < s.length; e++)
210
297
  t[e] = s.charCodeAt(e) & 127;
211
298
  return t;
212
299
  }
213
- var ft = /* @__PURE__ */ ((s) => (s.Added = "added", s.Changed = "changed", s.Removed = "removed", s))(ft || {});
214
- const G = (s, t, e) => {
215
- const n = s instanceof RegExp ? j(s, e) : s, i = t instanceof RegExp ? j(t, e) : t, r = n !== null && i != null && pt(n, i, e);
216
- return r && {
217
- start: r[0],
218
- end: r[1],
219
- pre: e.slice(0, r[0]),
220
- body: e.slice(r[0] + n.length, r[1]),
221
- post: e.slice(r[1] + i.length)
300
+ var At = /* @__PURE__ */ ((s) => (s.Added = "added", s.Changed = "changed", s.Removed = "removed", s))(At || {});
301
+ const J = (s, t, e) => {
302
+ const n = s instanceof RegExp ? B(s, e) : s, r = t instanceof RegExp ? B(t, e) : t, i = n !== null && r != null && Nt(n, r, e);
303
+ return i && {
304
+ start: i[0],
305
+ end: i[1],
306
+ pre: e.slice(0, i[0]),
307
+ body: e.slice(i[0] + n.length, i[1]),
308
+ post: e.slice(i[1] + r.length)
222
309
  };
223
- }, j = (s, t) => {
310
+ }, B = (s, t) => {
224
311
  const e = t.match(s);
225
312
  return e ? e[0] : null;
226
- }, pt = (s, t, e) => {
227
- let n, i, r, o, a, h = e.indexOf(s), l = e.indexOf(t, h + 1), c = h;
228
- if (h >= 0 && l > 0) {
313
+ }, Nt = (s, t, e) => {
314
+ let n, r, i, o, a, l = e.indexOf(s), h = e.indexOf(t, l + 1), c = l;
315
+ if (l >= 0 && h > 0) {
229
316
  if (s === t)
230
- return [h, l];
231
- for (n = [], r = e.length; c >= 0 && !a; ) {
232
- if (c === h)
233
- n.push(c), h = e.indexOf(s, c + 1);
317
+ return [l, h];
318
+ for (n = [], i = e.length; c >= 0 && !a; ) {
319
+ if (c === l)
320
+ n.push(c), l = e.indexOf(s, c + 1);
234
321
  else if (n.length === 1) {
235
322
  const p = n.pop();
236
- p !== void 0 && (a = [p, l]);
323
+ p !== void 0 && (a = [p, h]);
237
324
  } else
238
- i = n.pop(), i !== void 0 && i < r && (r = i, o = l), l = e.indexOf(t, c + 1);
239
- c = h < l && h >= 0 ? h : l;
325
+ r = n.pop(), r !== void 0 && r < i && (i = r, o = h), h = e.indexOf(t, c + 1);
326
+ c = l < h && l >= 0 ? l : h;
240
327
  }
241
- n.length && o !== void 0 && (a = [r, o]);
328
+ n.length && o !== void 0 && (a = [i, o]);
242
329
  }
243
330
  return a;
244
- }, H = "\0SLASH" + Math.random() + "\0", V = "\0OPEN" + Math.random() + "\0", L = "\0CLOSE" + Math.random() + "\0", Z = "\0COMMA" + Math.random() + "\0", Y = "\0PERIOD" + Math.random() + "\0", dt = new RegExp(H, "g"), gt = new RegExp(V, "g"), mt = new RegExp(L, "g"), wt = new RegExp(Z, "g"), yt = new RegExp(Y, "g"), Et = /\\\\/g, St = /\\{/g, xt = /\\}/g, Nt = /\\,/g, Ot = /\\./g;
245
- function D(s) {
331
+ }, X = "\0SLASH" + Math.random() + "\0", K = "\0OPEN" + Math.random() + "\0", F = "\0CLOSE" + Math.random() + "\0", Q = "\0COMMA" + Math.random() + "\0", tt = "\0PERIOD" + Math.random() + "\0", bt = new RegExp(X, "g"), vt = new RegExp(K, "g"), $t = new RegExp(F, "g"), Tt = new RegExp(Q, "g"), Mt = new RegExp(tt, "g"), Rt = /\\\\/g, Ct = /\\{/g, Pt = /\\}/g, It = /\\,/g, Dt = /\\./g;
332
+ function L(s) {
246
333
  return isNaN(s) ? s.charCodeAt(0) : parseInt(s, 10);
247
334
  }
248
- function bt(s) {
249
- return s.replace(Et, H).replace(St, V).replace(xt, L).replace(Nt, Z).replace(Ot, Y);
335
+ function Lt(s) {
336
+ return s.replace(Rt, X).replace(Ct, K).replace(Pt, F).replace(It, Q).replace(Dt, tt);
250
337
  }
251
- function At(s) {
252
- return s.replace(dt, "\\").replace(gt, "{").replace(mt, "}").replace(wt, ",").replace(yt, ".");
338
+ function kt(s) {
339
+ return s.replace(bt, "\\").replace(vt, "{").replace($t, "}").replace(Tt, ",").replace(Mt, ".");
253
340
  }
254
- function J(s) {
341
+ function et(s) {
255
342
  if (!s)
256
343
  return [""];
257
- const t = [], e = G("{", "}", s);
344
+ const t = [], e = J("{", "}", s);
258
345
  if (!e)
259
346
  return s.split(",");
260
- const { pre: n, body: i, post: r } = e, o = n.split(",");
261
- o[o.length - 1] += "{" + i + "}";
262
- const a = J(r);
263
- return r.length && (o[o.length - 1] += a.shift(), o.push.apply(o, a)), t.push.apply(t, o), t;
347
+ const { pre: n, body: r, post: i } = e, o = n.split(",");
348
+ o[o.length - 1] += "{" + r + "}";
349
+ const a = et(i);
350
+ return i.length && (o[o.length - 1] += a.shift(), o.push.apply(o, a)), t.push.apply(t, o), t;
264
351
  }
265
- function vt(s) {
266
- return s ? (s.slice(0, 2) === "{}" && (s = "\\{\\}" + s.slice(2)), T(bt(s), !0).map(At)) : [];
352
+ function Ft(s) {
353
+ return s ? (s.slice(0, 2) === "{}" && (s = "\\{\\}" + s.slice(2)), M(Lt(s), !0).map(kt)) : [];
267
354
  }
268
- function $t(s) {
355
+ function jt(s) {
269
356
  return "{" + s + "}";
270
357
  }
271
- function Tt(s) {
358
+ function Wt(s) {
272
359
  return /^-?0\d/.test(s);
273
360
  }
274
- function Mt(s, t) {
361
+ function Ut(s, t) {
275
362
  return s <= t;
276
363
  }
277
- function Pt(s, t) {
364
+ function zt(s, t) {
278
365
  return s >= t;
279
366
  }
280
- function T(s, t) {
281
- const e = [], n = G("{", "}", s);
367
+ function M(s, t) {
368
+ const e = [], n = J("{", "}", s);
282
369
  if (!n)
283
370
  return [s];
284
- const i = n.pre, r = n.post.length ? T(n.post, !1) : [""];
371
+ const r = n.pre, i = n.post.length ? M(n.post, !1) : [""];
285
372
  if (/\$$/.test(n.pre))
286
- for (let o = 0; o < r.length; o++) {
287
- const a = i + "{" + n.body + "}" + r[o];
373
+ for (let o = 0; o < i.length; o++) {
374
+ const a = r + "{" + n.body + "}" + i[o];
288
375
  e.push(a);
289
376
  }
290
377
  else {
291
- const o = /^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(n.body), a = /^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(n.body), h = o || a, l = n.body.indexOf(",") >= 0;
292
- if (!h && !l)
293
- return n.post.match(/,(?!,).*\}/) ? (s = n.pre + "{" + n.body + L + n.post, T(s)) : [s];
378
+ const o = /^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(n.body), a = /^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(n.body), l = o || a, h = n.body.indexOf(",") >= 0;
379
+ if (!l && !h)
380
+ return n.post.match(/,(?!,).*\}/) ? (s = n.pre + "{" + n.body + F + n.post, M(s)) : [s];
294
381
  let c;
295
- if (h)
382
+ if (l)
296
383
  c = n.body.split(/\.\./);
297
- else if (c = J(n.body), c.length === 1 && c[0] !== void 0 && (c = T(c[0], !1).map($t), c.length === 1))
298
- return r.map((f) => n.pre + c[0] + f);
384
+ else if (c = et(n.body), c.length === 1 && c[0] !== void 0 && (c = M(c[0], !1).map(jt), c.length === 1))
385
+ return i.map((f) => n.pre + c[0] + f);
299
386
  let p;
300
- if (h && c[0] !== void 0 && c[1] !== void 0) {
301
- const f = D(c[0]), u = D(c[1]), m = Math.max(c[0].length, c[1].length);
302
- let d = c.length === 3 && c[2] !== void 0 ? Math.abs(D(c[2])) : 1, S = Mt;
303
- u < f && (d *= -1, S = Pt);
304
- const A = c.some(Tt);
387
+ if (l && c[0] !== void 0 && c[1] !== void 0) {
388
+ const f = L(c[0]), u = L(c[1]), g = Math.max(c[0].length, c[1].length);
389
+ let d = c.length === 3 && c[2] !== void 0 ? Math.abs(L(c[2])) : 1, x = Ut;
390
+ u < f && (d *= -1, x = zt);
391
+ const v = c.some(Wt);
305
392
  p = [];
306
- for (let x = f; S(x, u); x += d) {
307
- let w;
393
+ for (let S = f; x(S, u); S += d) {
394
+ let m;
308
395
  if (a)
309
- w = String.fromCharCode(x), w === "\\" && (w = "");
310
- else if (w = String(x), A) {
311
- const v = m - w.length;
312
- if (v > 0) {
313
- const P = new Array(v + 1).join("0");
314
- x < 0 ? w = "-" + P + w.slice(1) : w = P + w;
396
+ m = String.fromCharCode(S), m === "\\" && (m = "");
397
+ else if (m = String(S), v) {
398
+ const $ = g - m.length;
399
+ if ($ > 0) {
400
+ const C = new Array($ + 1).join("0");
401
+ S < 0 ? m = "-" + C + m.slice(1) : m = C + m;
315
402
  }
316
403
  }
317
- p.push(w);
404
+ p.push(m);
318
405
  }
319
406
  } else {
320
407
  p = [];
321
408
  for (let f = 0; f < c.length; f++)
322
- p.push.apply(p, T(c[f], !1));
409
+ p.push.apply(p, M(c[f], !1));
323
410
  }
324
411
  for (let f = 0; f < p.length; f++)
325
- for (let u = 0; u < r.length; u++) {
326
- const m = i + p[f] + r[u];
327
- (!t || h || m) && e.push(m);
412
+ for (let u = 0; u < i.length; u++) {
413
+ const g = r + p[f] + i[u];
414
+ (!t || l || g) && e.push(g);
328
415
  }
329
416
  }
330
417
  return e;
331
418
  }
332
- const Rt = 1024 * 64, C = (s) => {
419
+ const Bt = 1024 * 64, I = (s) => {
333
420
  if (typeof s != "string")
334
421
  throw new TypeError("invalid pattern");
335
- if (s.length > Rt)
422
+ if (s.length > Bt)
336
423
  throw new TypeError("pattern is too long");
337
- }, Ct = {
424
+ }, _t = {
338
425
  "[:alnum:]": ["\\p{L}\\p{Nl}\\p{Nd}", !0],
339
426
  "[:alpha:]": ["\\p{L}\\p{Nl}", !0],
340
427
  "[:ascii:]": ["\\x00-\\x7f", !1],
@@ -349,77 +436,77 @@ const Rt = 1024 * 64, C = (s) => {
349
436
  "[:upper:]": ["\\p{Lu}", !0],
350
437
  "[:word:]": ["\\p{L}\\p{Nl}\\p{Nd}\\p{Pc}", !0],
351
438
  "[:xdigit:]": ["A-Fa-f0-9", !1]
352
- }, $ = (s) => s.replace(/[[\]\\-]/g, "\\$&"), It = (s) => s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&"), U = (s) => s.join(""), Dt = (s, t) => {
439
+ }, T = (s) => s.replace(/[[\]\\-]/g, "\\$&"), qt = (s) => s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&"), _ = (s) => s.join(""), Gt = (s, t) => {
353
440
  const e = t;
354
441
  if (s.charAt(e) !== "[")
355
442
  throw new Error("not in a brace expression");
356
- const n = [], i = [];
357
- let r = e + 1, o = !1, a = !1, h = !1, l = !1, c = e, p = "";
358
- t: for (; r < s.length; ) {
359
- const d = s.charAt(r);
360
- if ((d === "!" || d === "^") && r === e + 1) {
361
- l = !0, r++;
443
+ const n = [], r = [];
444
+ let i = e + 1, o = !1, a = !1, l = !1, h = !1, c = e, p = "";
445
+ t: for (; i < s.length; ) {
446
+ const d = s.charAt(i);
447
+ if ((d === "!" || d === "^") && i === e + 1) {
448
+ h = !0, i++;
362
449
  continue;
363
450
  }
364
- if (d === "]" && o && !h) {
365
- c = r + 1;
451
+ if (d === "]" && o && !l) {
452
+ c = i + 1;
366
453
  break;
367
454
  }
368
- if (o = !0, d === "\\" && !h) {
369
- h = !0, r++;
455
+ if (o = !0, d === "\\" && !l) {
456
+ l = !0, i++;
370
457
  continue;
371
458
  }
372
- if (d === "[" && !h) {
373
- for (const [S, [b, A, x]] of Object.entries(Ct))
374
- if (s.startsWith(S, r)) {
459
+ if (d === "[" && !l) {
460
+ for (const [x, [N, v, S]] of Object.entries(_t))
461
+ if (s.startsWith(x, i)) {
375
462
  if (p)
376
463
  return ["$.", !1, s.length - e, !0];
377
- r += S.length, x ? i.push(b) : n.push(b), a = a || A;
464
+ i += x.length, S ? r.push(N) : n.push(N), a = a || v;
378
465
  continue t;
379
466
  }
380
467
  }
381
- if (h = !1, p) {
382
- d > p ? n.push($(p) + "-" + $(d)) : d === p && n.push($(d)), p = "", r++;
468
+ if (l = !1, p) {
469
+ d > p ? n.push(T(p) + "-" + T(d)) : d === p && n.push(T(d)), p = "", i++;
383
470
  continue;
384
471
  }
385
- if (s.startsWith("-]", r + 1)) {
386
- n.push($(d + "-")), r += 2;
472
+ if (s.startsWith("-]", i + 1)) {
473
+ n.push(T(d + "-")), i += 2;
387
474
  continue;
388
475
  }
389
- if (s.startsWith("-", r + 1)) {
390
- p = d, r += 2;
476
+ if (s.startsWith("-", i + 1)) {
477
+ p = d, i += 2;
391
478
  continue;
392
479
  }
393
- n.push($(d)), r++;
480
+ n.push(T(d)), i++;
394
481
  }
395
- if (c < r)
482
+ if (c < i)
396
483
  return ["", !1, 0, !1];
397
- if (!n.length && !i.length)
484
+ if (!n.length && !r.length)
398
485
  return ["$.", !1, s.length - e, !0];
399
- if (i.length === 0 && n.length === 1 && /^\\?.$/.test(n[0]) && !l) {
486
+ if (r.length === 0 && n.length === 1 && /^\\?.$/.test(n[0]) && !h) {
400
487
  const d = n[0].length === 2 ? n[0].slice(-1) : n[0];
401
- return [It(d), !1, c - e, !1];
488
+ return [qt(d), !1, c - e, !1];
402
489
  }
403
- const f = "[" + (l ? "^" : "") + U(n) + "]", u = "[" + (l ? "" : "^") + U(i) + "]";
404
- return [n.length && i.length ? "(" + f + "|" + u + ")" : n.length ? f : u, a, c - e, !0];
405
- }, M = (s, { windowsPathsNoEscape: t = !1 } = {}) => t ? s.replace(/\[([^\/\\])\]/g, "$1") : s.replace(/((?!\\).|^)\[([^\/\\])\]/g, "$1$2").replace(/\\([^\/])/g, "$1"), Lt = /* @__PURE__ */ new Set(["!", "?", "+", "*", "@"]), W = (s) => Lt.has(s), kt = "(?!(?:^|/)\\.\\.?(?:$|/))", R = "(?!\\.)", Ft = /* @__PURE__ */ new Set(["[", "."]), jt = /* @__PURE__ */ new Set(["..", "."]), Ut = new Set("().*{}+?[]^$\\!"), Wt = (s) => s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&"), k = "[^/]", z = k + "*?", _ = k + "+?";
490
+ const f = "[" + (h ? "^" : "") + _(n) + "]", u = "[" + (h ? "" : "^") + _(r) + "]";
491
+ return [n.length && r.length ? "(" + f + "|" + u + ")" : n.length ? f : u, a, c - e, !0];
492
+ }, R = (s, { windowsPathsNoEscape: t = !1 } = {}) => t ? s.replace(/\[([^\/\\])\]/g, "$1") : s.replace(/((?!\\).|^)\[([^\/\\])\]/g, "$1$2").replace(/\\([^\/])/g, "$1"), Ht = /* @__PURE__ */ new Set(["!", "?", "+", "*", "@"]), q = (s) => Ht.has(s), Vt = "(?!(?:^|/)\\.\\.?(?:$|/))", P = "(?!\\.)", Yt = /* @__PURE__ */ new Set(["[", "."]), Zt = /* @__PURE__ */ new Set(["..", "."]), Jt = new Set("().*{}+?[]^$\\!"), Xt = (s) => s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&"), j = "[^/]", G = j + "*?", H = j + "+?";
406
493
  class E {
407
494
  type;
408
495
  #s;
409
496
  #n;
410
- #r = !1;
497
+ #i = !1;
411
498
  #t = [];
412
499
  #e;
413
500
  #o;
414
501
  #a;
415
502
  #c = !1;
416
- #i;
417
- #h;
503
+ #r;
504
+ #l;
418
505
  // set to true if it's an extglob with no children
419
506
  // (which really means one child of '')
420
507
  #u = !1;
421
508
  constructor(t, e, n = {}) {
422
- this.type = t, t && (this.#n = !0), this.#e = e, this.#s = this.#e ? this.#e.#s : this, this.#i = this.#s === this ? n : this.#s.#i, this.#a = this.#s === this ? [] : this.#s.#a, t === "!" && !this.#s.#c && this.#a.push(this), this.#o = this.#e ? this.#e.#t.length : 0;
509
+ this.type = t, t && (this.#n = !0), this.#e = e, this.#s = this.#e ? this.#e.#s : this, this.#r = this.#s === this ? n : this.#s.#r, this.#a = this.#s === this ? [] : this.#s.#a, t === "!" && !this.#s.#c && this.#a.push(this), this.#o = this.#e ? this.#e.#t.length : 0;
423
510
  }
424
511
  get hasMagic() {
425
512
  if (this.#n !== void 0)
@@ -431,7 +518,7 @@ class E {
431
518
  }
432
519
  // reconstructs the pattern
433
520
  toString() {
434
- return this.#h !== void 0 ? this.#h : this.type ? this.#h = this.type + "(" + this.#t.map((t) => String(t)).join("|") + ")" : this.#h = this.#t.map((t) => String(t)).join("");
521
+ return this.#l !== void 0 ? this.#l : this.type ? this.#l = this.type + "(" + this.#t.map((t) => String(t)).join("|") + ")" : this.#l = this.#t.map((t) => String(t)).join("");
435
522
  }
436
523
  #p() {
437
524
  if (this !== this.#s)
@@ -445,11 +532,11 @@ class E {
445
532
  continue;
446
533
  let e = t, n = e.#e;
447
534
  for (; n; ) {
448
- for (let i = e.#o + 1; !n.type && i < n.#t.length; i++)
449
- for (const r of t.#t) {
450
- if (typeof r == "string")
535
+ for (let r = e.#o + 1; !n.type && r < n.#t.length; r++)
536
+ for (const i of t.#t) {
537
+ if (typeof i == "string")
451
538
  throw new Error("string part in extglob AST??");
452
- r.copyIn(n.#t[i]);
539
+ i.copyIn(n.#t[r]);
453
540
  }
454
541
  e = n, n = e.#e;
455
542
  }
@@ -502,53 +589,53 @@ class E {
502
589
  e.copyIn(n);
503
590
  return e;
504
591
  }
505
- static #l(t, e, n, i) {
506
- let r = !1, o = !1, a = -1, h = !1;
592
+ static #h(t, e, n, r) {
593
+ let i = !1, o = !1, a = -1, l = !1;
507
594
  if (e.type === null) {
508
- let u = n, m = "";
595
+ let u = n, g = "";
509
596
  for (; u < t.length; ) {
510
597
  const d = t.charAt(u++);
511
- if (r || d === "\\") {
512
- r = !r, m += d;
598
+ if (i || d === "\\") {
599
+ i = !i, g += d;
513
600
  continue;
514
601
  }
515
602
  if (o) {
516
- u === a + 1 ? (d === "^" || d === "!") && (h = !0) : d === "]" && !(u === a + 2 && h) && (o = !1), m += d;
603
+ u === a + 1 ? (d === "^" || d === "!") && (l = !0) : d === "]" && !(u === a + 2 && l) && (o = !1), g += d;
517
604
  continue;
518
605
  } else if (d === "[") {
519
- o = !0, a = u, h = !1, m += d;
606
+ o = !0, a = u, l = !1, g += d;
520
607
  continue;
521
608
  }
522
- if (!i.noext && W(d) && t.charAt(u) === "(") {
523
- e.push(m), m = "";
524
- const S = new E(d, e);
525
- u = E.#l(t, S, u, i), e.push(S);
609
+ if (!r.noext && q(d) && t.charAt(u) === "(") {
610
+ e.push(g), g = "";
611
+ const x = new E(d, e);
612
+ u = E.#h(t, x, u, r), e.push(x);
526
613
  continue;
527
614
  }
528
- m += d;
615
+ g += d;
529
616
  }
530
- return e.push(m), u;
617
+ return e.push(g), u;
531
618
  }
532
- let l = n + 1, c = new E(null, e);
619
+ let h = n + 1, c = new E(null, e);
533
620
  const p = [];
534
621
  let f = "";
535
- for (; l < t.length; ) {
536
- const u = t.charAt(l++);
537
- if (r || u === "\\") {
538
- r = !r, f += u;
622
+ for (; h < t.length; ) {
623
+ const u = t.charAt(h++);
624
+ if (i || u === "\\") {
625
+ i = !i, f += u;
539
626
  continue;
540
627
  }
541
628
  if (o) {
542
- l === a + 1 ? (u === "^" || u === "!") && (h = !0) : u === "]" && !(l === a + 2 && h) && (o = !1), f += u;
629
+ h === a + 1 ? (u === "^" || u === "!") && (l = !0) : u === "]" && !(h === a + 2 && l) && (o = !1), f += u;
543
630
  continue;
544
631
  } else if (u === "[") {
545
- o = !0, a = l, h = !1, f += u;
632
+ o = !0, a = h, l = !1, f += u;
546
633
  continue;
547
634
  }
548
- if (W(u) && t.charAt(l) === "(") {
635
+ if (q(u) && t.charAt(h) === "(") {
549
636
  c.push(f), f = "";
550
- const m = new E(u, c);
551
- c.push(m), l = E.#l(t, m, l, i);
637
+ const g = new E(u, c);
638
+ c.push(g), h = E.#h(t, g, h, r);
552
639
  continue;
553
640
  }
554
641
  if (u === "|") {
@@ -556,31 +643,31 @@ class E {
556
643
  continue;
557
644
  }
558
645
  if (u === ")")
559
- return f === "" && e.#t.length === 0 && (e.#u = !0), c.push(f), f = "", e.push(...p, c), l;
646
+ return f === "" && e.#t.length === 0 && (e.#u = !0), c.push(f), f = "", e.push(...p, c), h;
560
647
  f += u;
561
648
  }
562
- return e.type = null, e.#n = void 0, e.#t = [t.substring(n - 1)], l;
649
+ return e.type = null, e.#n = void 0, e.#t = [t.substring(n - 1)], h;
563
650
  }
564
651
  static fromGlob(t, e = {}) {
565
652
  const n = new E(null, void 0, e);
566
- return E.#l(t, n, 0, e), n;
653
+ return E.#h(t, n, 0, e), n;
567
654
  }
568
655
  // returns the regular expression if there's magic, or the unescaped
569
656
  // string if not.
570
657
  toMMPattern() {
571
658
  if (this !== this.#s)
572
659
  return this.#s.toMMPattern();
573
- const t = this.toString(), [e, n, i, r] = this.toRegExpSource();
574
- if (!(i || this.#n || this.#i.nocase && !this.#i.nocaseMagicOnly && t.toUpperCase() !== t.toLowerCase()))
660
+ const t = this.toString(), [e, n, r, i] = this.toRegExpSource();
661
+ if (!(r || this.#n || this.#r.nocase && !this.#r.nocaseMagicOnly && t.toUpperCase() !== t.toLowerCase()))
575
662
  return n;
576
- const a = (this.#i.nocase ? "i" : "") + (r ? "u" : "");
663
+ const a = (this.#r.nocase ? "i" : "") + (i ? "u" : "");
577
664
  return Object.assign(new RegExp(`^${e}$`, a), {
578
665
  _src: e,
579
666
  _glob: t
580
667
  });
581
668
  }
582
669
  get options() {
583
- return this.#i;
670
+ return this.#r;
584
671
  }
585
672
  // returns the string match, the regexp source, whether there's magic
586
673
  // in the regexp (so a regular expression is required) and whether or
@@ -652,168 +739,168 @@ class E {
652
739
  // is ^(?!\.), we can just prepend (?!\.) to the pattern (either root
653
740
  // or start or whatever) and prepend ^ or / at the Regexp construction.
654
741
  toRegExpSource(t) {
655
- const e = t ?? !!this.#i.dot;
742
+ const e = t ?? !!this.#r.dot;
656
743
  if (this.#s === this && this.#p(), !this.type) {
657
- const h = this.isStart() && this.isEnd(), l = this.#t.map((u) => {
658
- const [m, d, S, b] = typeof u == "string" ? E.#d(u, this.#n, h) : u.toRegExpSource(t);
659
- return this.#n = this.#n || S, this.#r = this.#r || b, m;
744
+ const l = this.isStart() && this.isEnd(), h = this.#t.map((u) => {
745
+ const [g, d, x, N] = typeof u == "string" ? E.#d(u, this.#n, l) : u.toRegExpSource(t);
746
+ return this.#n = this.#n || x, this.#i = this.#i || N, g;
660
747
  }).join("");
661
748
  let c = "";
662
- if (this.isStart() && typeof this.#t[0] == "string" && !(this.#t.length === 1 && jt.has(this.#t[0]))) {
663
- const m = Ft, d = (
749
+ if (this.isStart() && typeof this.#t[0] == "string" && !(this.#t.length === 1 && Zt.has(this.#t[0]))) {
750
+ const g = Yt, d = (
664
751
  // dots are allowed, and the pattern starts with [ or .
665
- e && m.has(l.charAt(0)) || // the pattern starts with \., and then [ or .
666
- l.startsWith("\\.") && m.has(l.charAt(2)) || // the pattern starts with \.\., and then [ or .
667
- l.startsWith("\\.\\.") && m.has(l.charAt(4))
668
- ), S = !e && !t && m.has(l.charAt(0));
669
- c = d ? kt : S ? R : "";
752
+ e && g.has(h.charAt(0)) || // the pattern starts with \., and then [ or .
753
+ h.startsWith("\\.") && g.has(h.charAt(2)) || // the pattern starts with \.\., and then [ or .
754
+ h.startsWith("\\.\\.") && g.has(h.charAt(4))
755
+ ), x = !e && !t && g.has(h.charAt(0));
756
+ c = d ? Vt : x ? P : "";
670
757
  }
671
758
  let p = "";
672
759
  return this.isEnd() && this.#s.#c && this.#e?.type === "!" && (p = "(?:$|\\/)"), [
673
- c + l + p,
674
- M(l),
760
+ c + h + p,
761
+ R(h),
675
762
  this.#n = !!this.#n,
676
- this.#r
763
+ this.#i
677
764
  ];
678
765
  }
679
- const n = this.type === "*" || this.type === "+", i = this.type === "!" ? "(?:(?!(?:" : "(?:";
680
- let r = this.#f(e);
681
- if (this.isStart() && this.isEnd() && !r && this.type !== "!") {
682
- const h = this.toString();
683
- return this.#t = [h], this.type = null, this.#n = void 0, [h, M(this.toString()), !1, !1];
766
+ const n = this.type === "*" || this.type === "+", r = this.type === "!" ? "(?:(?!(?:" : "(?:";
767
+ let i = this.#f(e);
768
+ if (this.isStart() && this.isEnd() && !i && this.type !== "!") {
769
+ const l = this.toString();
770
+ return this.#t = [l], this.type = null, this.#n = void 0, [l, R(this.toString()), !1, !1];
684
771
  }
685
- let o = !n || t || e || !R ? "" : this.#f(!0);
686
- o === r && (o = ""), o && (r = `(?:${r})(?:${o})*?`);
772
+ let o = !n || t || e || !P ? "" : this.#f(!0);
773
+ o === i && (o = ""), o && (i = `(?:${i})(?:${o})*?`);
687
774
  let a = "";
688
775
  if (this.type === "!" && this.#u)
689
- a = (this.isStart() && !e ? R : "") + _;
776
+ a = (this.isStart() && !e ? P : "") + H;
690
777
  else {
691
- const h = this.type === "!" ? (
778
+ const l = this.type === "!" ? (
692
779
  // !() must match something,but !(x) can match ''
693
- "))" + (this.isStart() && !e && !t ? R : "") + z + ")"
780
+ "))" + (this.isStart() && !e && !t ? P : "") + G + ")"
694
781
  ) : this.type === "@" ? ")" : this.type === "?" ? ")?" : this.type === "+" && o ? ")" : this.type === "*" && o ? ")?" : `)${this.type}`;
695
- a = i + r + h;
782
+ a = r + i + l;
696
783
  }
697
784
  return [
698
785
  a,
699
- M(r),
786
+ R(i),
700
787
  this.#n = !!this.#n,
701
- this.#r
788
+ this.#i
702
789
  ];
703
790
  }
704
791
  #f(t) {
705
792
  return this.#t.map((e) => {
706
793
  if (typeof e == "string")
707
794
  throw new Error("string type in extglob ast??");
708
- const [n, i, r, o] = e.toRegExpSource(t);
709
- return this.#r = this.#r || o, n;
795
+ const [n, r, i, o] = e.toRegExpSource(t);
796
+ return this.#i = this.#i || o, n;
710
797
  }).filter((e) => !(this.isStart() && this.isEnd()) || !!e).join("|");
711
798
  }
712
799
  static #d(t, e, n = !1) {
713
- let i = !1, r = "", o = !1;
800
+ let r = !1, i = "", o = !1;
714
801
  for (let a = 0; a < t.length; a++) {
715
- const h = t.charAt(a);
716
- if (i) {
717
- i = !1, r += (Ut.has(h) ? "\\" : "") + h;
802
+ const l = t.charAt(a);
803
+ if (r) {
804
+ r = !1, i += (Jt.has(l) ? "\\" : "") + l;
718
805
  continue;
719
806
  }
720
- if (h === "\\") {
721
- a === t.length - 1 ? r += "\\\\" : i = !0;
807
+ if (l === "\\") {
808
+ a === t.length - 1 ? i += "\\\\" : r = !0;
722
809
  continue;
723
810
  }
724
- if (h === "[") {
725
- const [l, c, p, f] = Dt(t, a);
811
+ if (l === "[") {
812
+ const [h, c, p, f] = Gt(t, a);
726
813
  if (p) {
727
- r += l, o = o || c, a += p - 1, e = e || f;
814
+ i += h, o = o || c, a += p - 1, e = e || f;
728
815
  continue;
729
816
  }
730
817
  }
731
- if (h === "*") {
732
- n && t === "*" ? r += _ : r += z, e = !0;
818
+ if (l === "*") {
819
+ n && t === "*" ? i += H : i += G, e = !0;
733
820
  continue;
734
821
  }
735
- if (h === "?") {
736
- r += k, e = !0;
822
+ if (l === "?") {
823
+ i += j, e = !0;
737
824
  continue;
738
825
  }
739
- r += Wt(h);
826
+ i += Xt(l);
740
827
  }
741
- return [r, M(t), !!e, o];
828
+ return [i, R(t), !!e, o];
742
829
  }
743
830
  }
744
- const zt = (s, { windowsPathsNoEscape: t = !1 } = {}) => t ? s.replace(/[?*()[\]]/g, "[$&]") : s.replace(/[?*()[\]\\]/g, "\\$&"), y = (s, t, e = {}) => (C(t), !e.nocomment && t.charAt(0) === "#" ? !1 : new I(t, e).match(s)), _t = /^\*+([^+@!?\*\[\(]*)$/, Bt = (s) => (t) => !t.startsWith(".") && t.endsWith(s), qt = (s) => (t) => t.endsWith(s), Gt = (s) => (s = s.toLowerCase(), (t) => !t.startsWith(".") && t.toLowerCase().endsWith(s)), Ht = (s) => (s = s.toLowerCase(), (t) => t.toLowerCase().endsWith(s)), Vt = /^\*+\.\*+$/, Zt = (s) => !s.startsWith(".") && s.includes("."), Yt = (s) => s !== "." && s !== ".." && s.includes("."), Jt = /^\.\*+$/, Xt = (s) => s !== "." && s !== ".." && s.startsWith("."), Qt = /^\*+$/, Kt = (s) => s.length !== 0 && !s.startsWith("."), te = (s) => s.length !== 0 && s !== "." && s !== "..", ee = /^\?+([^+@!?\*\[\(]*)?$/, se = ([s, t = ""]) => {
745
- const e = X([s]);
831
+ const Kt = (s, { windowsPathsNoEscape: t = !1 } = {}) => t ? s.replace(/[?*()[\]]/g, "[$&]") : s.replace(/[?*()[\]\\]/g, "\\$&"), w = (s, t, e = {}) => (I(t), !e.nocomment && t.charAt(0) === "#" ? !1 : new D(t, e).match(s)), Qt = /^\*+([^+@!?\*\[\(]*)$/, te = (s) => (t) => !t.startsWith(".") && t.endsWith(s), ee = (s) => (t) => t.endsWith(s), se = (s) => (s = s.toLowerCase(), (t) => !t.startsWith(".") && t.toLowerCase().endsWith(s)), ne = (s) => (s = s.toLowerCase(), (t) => t.toLowerCase().endsWith(s)), re = /^\*+\.\*+$/, ie = (s) => !s.startsWith(".") && s.includes("."), oe = (s) => s !== "." && s !== ".." && s.includes("."), ce = /^\.\*+$/, ae = (s) => s !== "." && s !== ".." && s.startsWith("."), le = /^\*+$/, he = (s) => s.length !== 0 && !s.startsWith("."), ue = (s) => s.length !== 0 && s !== "." && s !== "..", fe = /^\?+([^+@!?\*\[\(]*)?$/, pe = ([s, t = ""]) => {
832
+ const e = st([s]);
746
833
  return t ? (t = t.toLowerCase(), (n) => e(n) && n.toLowerCase().endsWith(t)) : e;
747
- }, ne = ([s, t = ""]) => {
748
- const e = Q([s]);
834
+ }, de = ([s, t = ""]) => {
835
+ const e = nt([s]);
749
836
  return t ? (t = t.toLowerCase(), (n) => e(n) && n.toLowerCase().endsWith(t)) : e;
750
- }, ie = ([s, t = ""]) => {
751
- const e = Q([s]);
837
+ }, ge = ([s, t = ""]) => {
838
+ const e = nt([s]);
752
839
  return t ? (n) => e(n) && n.endsWith(t) : e;
753
- }, re = ([s, t = ""]) => {
754
- const e = X([s]);
840
+ }, me = ([s, t = ""]) => {
841
+ const e = st([s]);
755
842
  return t ? (n) => e(n) && n.endsWith(t) : e;
756
- }, X = ([s]) => {
843
+ }, st = ([s]) => {
757
844
  const t = s.length;
758
845
  return (e) => e.length === t && !e.startsWith(".");
759
- }, Q = ([s]) => {
846
+ }, nt = ([s]) => {
760
847
  const t = s.length;
761
848
  return (e) => e.length === t && e !== "." && e !== "..";
762
- }, K = typeof process == "object" && process ? typeof process.env == "object" && process.env && process.env.__MINIMATCH_TESTING_PLATFORM__ || process.platform : "posix", B = {
849
+ }, rt = typeof process == "object" && process ? typeof process.env == "object" && process.env && process.env.__MINIMATCH_TESTING_PLATFORM__ || process.platform : "posix", V = {
763
850
  win32: { sep: "\\" },
764
851
  posix: { sep: "/" }
765
- }, oe = K === "win32" ? B.win32.sep : B.posix.sep;
766
- y.sep = oe;
767
- const O = Symbol("globstar **");
768
- y.GLOBSTAR = O;
769
- const ce = "[^/]", ae = ce + "*?", he = "(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?", le = "(?:(?!(?:\\/|^)\\.).)*?", ue = (s, t = {}) => (e) => y(e, s, t);
770
- y.filter = ue;
771
- const N = (s, t = {}) => Object.assign({}, s, t), fe = (s) => {
852
+ }, we = rt === "win32" ? V.win32.sep : V.posix.sep;
853
+ w.sep = we;
854
+ const A = Symbol("globstar **");
855
+ w.GLOBSTAR = A;
856
+ const ye = "[^/]", Ee = ye + "*?", xe = "(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?", Se = "(?:(?!(?:\\/|^)\\.).)*?", Oe = (s, t = {}) => (e) => w(e, s, t);
857
+ w.filter = Oe;
858
+ const O = (s, t = {}) => Object.assign({}, s, t), Ae = (s) => {
772
859
  if (!s || typeof s != "object" || !Object.keys(s).length)
773
- return y;
774
- const t = y;
775
- return Object.assign((n, i, r = {}) => t(n, i, N(s, r)), {
860
+ return w;
861
+ const t = w;
862
+ return Object.assign((n, r, i = {}) => t(n, r, O(s, i)), {
776
863
  Minimatch: class extends t.Minimatch {
777
- constructor(i, r = {}) {
778
- super(i, N(s, r));
864
+ constructor(r, i = {}) {
865
+ super(r, O(s, i));
779
866
  }
780
- static defaults(i) {
781
- return t.defaults(N(s, i)).Minimatch;
867
+ static defaults(r) {
868
+ return t.defaults(O(s, r)).Minimatch;
782
869
  }
783
870
  },
784
871
  AST: class extends t.AST {
785
872
  /* c8 ignore start */
786
- constructor(i, r, o = {}) {
787
- super(i, r, N(s, o));
873
+ constructor(r, i, o = {}) {
874
+ super(r, i, O(s, o));
788
875
  }
789
876
  /* c8 ignore stop */
790
- static fromGlob(i, r = {}) {
791
- return t.AST.fromGlob(i, N(s, r));
877
+ static fromGlob(r, i = {}) {
878
+ return t.AST.fromGlob(r, O(s, i));
792
879
  }
793
880
  },
794
- unescape: (n, i = {}) => t.unescape(n, N(s, i)),
795
- escape: (n, i = {}) => t.escape(n, N(s, i)),
796
- filter: (n, i = {}) => t.filter(n, N(s, i)),
797
- defaults: (n) => t.defaults(N(s, n)),
798
- makeRe: (n, i = {}) => t.makeRe(n, N(s, i)),
799
- braceExpand: (n, i = {}) => t.braceExpand(n, N(s, i)),
800
- match: (n, i, r = {}) => t.match(n, i, N(s, r)),
881
+ unescape: (n, r = {}) => t.unescape(n, O(s, r)),
882
+ escape: (n, r = {}) => t.escape(n, O(s, r)),
883
+ filter: (n, r = {}) => t.filter(n, O(s, r)),
884
+ defaults: (n) => t.defaults(O(s, n)),
885
+ makeRe: (n, r = {}) => t.makeRe(n, O(s, r)),
886
+ braceExpand: (n, r = {}) => t.braceExpand(n, O(s, r)),
887
+ match: (n, r, i = {}) => t.match(n, r, O(s, i)),
801
888
  sep: t.sep,
802
- GLOBSTAR: O
889
+ GLOBSTAR: A
803
890
  });
804
891
  };
805
- y.defaults = fe;
806
- const tt = (s, t = {}) => (C(s), t.nobrace || !/\{(?:(?!\{).)*\}/.test(s) ? [s] : vt(s));
807
- y.braceExpand = tt;
808
- const pe = (s, t = {}) => new I(s, t).makeRe();
809
- y.makeRe = pe;
810
- const de = (s, t, e = {}) => {
811
- const n = new I(t, e);
812
- return s = s.filter((i) => n.match(i)), n.options.nonull && !s.length && s.push(t), s;
892
+ w.defaults = Ae;
893
+ const it = (s, t = {}) => (I(s), t.nobrace || !/\{(?:(?!\{).)*\}/.test(s) ? [s] : Ft(s));
894
+ w.braceExpand = it;
895
+ const Ne = (s, t = {}) => new D(s, t).makeRe();
896
+ w.makeRe = Ne;
897
+ const be = (s, t, e = {}) => {
898
+ const n = new D(t, e);
899
+ return s = s.filter((r) => n.match(r)), n.options.nonull && !s.length && s.push(t), s;
813
900
  };
814
- y.match = de;
815
- const q = /[?*]|[+@!]\(.*?\)|\[|\]/, ge = (s) => s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&");
816
- class I {
901
+ w.match = be;
902
+ const Y = /[?*]|[+@!]\(.*?\)|\[|\]/, ve = (s) => s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&");
903
+ class D {
817
904
  options;
818
905
  set;
819
906
  pattern;
@@ -832,7 +919,7 @@ class I {
832
919
  windowsNoMagicRoot;
833
920
  regexp;
834
921
  constructor(t, e = {}) {
835
- C(t), e = e || {}, this.options = e, this.pattern = t, this.platform = e.platform || K, this.isWindows = this.platform === "win32", 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();
922
+ I(t), e = e || {}, this.options = e, this.pattern = t, this.platform = e.platform || rt, this.isWindows = this.platform === "win32", 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();
836
923
  }
837
924
  hasMagic() {
838
925
  if (this.options.magicalBraces && this.set.length > 1)
@@ -855,23 +942,23 @@ class I {
855
942
  this.empty = !0;
856
943
  return;
857
944
  }
858
- this.parseNegate(), this.globSet = [...new Set(this.braceExpand())], e.debug && (this.debug = (...r) => console.error(...r)), this.debug(this.pattern, this.globSet);
859
- const n = this.globSet.map((r) => this.slashSplit(r));
945
+ this.parseNegate(), this.globSet = [...new Set(this.braceExpand())], e.debug && (this.debug = (...i) => console.error(...i)), this.debug(this.pattern, this.globSet);
946
+ const n = this.globSet.map((i) => this.slashSplit(i));
860
947
  this.globParts = this.preprocess(n), this.debug(this.pattern, this.globParts);
861
- let i = this.globParts.map((r, o, a) => {
948
+ let r = this.globParts.map((i, o, a) => {
862
949
  if (this.isWindows && this.windowsNoMagicRoot) {
863
- const h = r[0] === "" && r[1] === "" && (r[2] === "?" || !q.test(r[2])) && !q.test(r[3]), l = /^[a-z]:/i.test(r[0]);
864
- if (h)
865
- return [...r.slice(0, 4), ...r.slice(4).map((c) => this.parse(c))];
950
+ const l = i[0] === "" && i[1] === "" && (i[2] === "?" || !Y.test(i[2])) && !Y.test(i[3]), h = /^[a-z]:/i.test(i[0]);
866
951
  if (l)
867
- return [r[0], ...r.slice(1).map((c) => this.parse(c))];
952
+ return [...i.slice(0, 4), ...i.slice(4).map((c) => this.parse(c))];
953
+ if (h)
954
+ return [i[0], ...i.slice(1).map((c) => this.parse(c))];
868
955
  }
869
- return r.map((h) => this.parse(h));
956
+ return i.map((l) => this.parse(l));
870
957
  });
871
- if (this.debug(this.pattern, i), this.set = i.filter((r) => r.indexOf(!1) === -1), this.isWindows)
872
- for (let r = 0; r < this.set.length; r++) {
873
- const o = this.set[r];
874
- o[0] === "" && o[1] === "" && this.globParts[r][2] === "?" && typeof o[3] == "string" && /^[a-z]:$/i.test(o[3]) && (o[2] = "?");
958
+ if (this.debug(this.pattern, r), this.set = r.filter((i) => i.indexOf(!1) === -1), this.isWindows)
959
+ for (let i = 0; i < this.set.length; i++) {
960
+ const o = this.set[i];
961
+ o[0] === "" && o[1] === "" && this.globParts[i][2] === "?" && typeof o[3] == "string" && /^[a-z]:$/i.test(o[3]) && (o[2] = "?");
875
962
  }
876
963
  this.debug(this.pattern, this.set);
877
964
  }
@@ -883,8 +970,8 @@ class I {
883
970
  preprocess(t) {
884
971
  if (this.options.noglobstar)
885
972
  for (let n = 0; n < t.length; n++)
886
- for (let i = 0; i < t[n].length; i++)
887
- t[n][i] === "**" && (t[n][i] = "*");
973
+ for (let r = 0; r < t[n].length; r++)
974
+ t[n][r] === "**" && (t[n][r] = "*");
888
975
  const { optimizationLevel: e = 1 } = this.options;
889
976
  return e >= 2 ? (t = this.firstPhasePreProcess(t), t = this.secondPhasePreProcess(t)) : e >= 1 ? t = this.levelOneOptimize(t) : t = this.adjascentGlobstarOptimize(t), t;
890
977
  }
@@ -893,19 +980,19 @@ class I {
893
980
  return t.map((e) => {
894
981
  let n = -1;
895
982
  for (; (n = e.indexOf("**", n + 1)) !== -1; ) {
896
- let i = n;
897
- for (; e[i + 1] === "**"; )
898
- i++;
899
- i !== n && e.splice(n, i - n);
983
+ let r = n;
984
+ for (; e[r + 1] === "**"; )
985
+ r++;
986
+ r !== n && e.splice(n, r - n);
900
987
  }
901
988
  return e;
902
989
  });
903
990
  }
904
991
  // get rid of adjascent ** and resolve .. portions
905
992
  levelOneOptimize(t) {
906
- return t.map((e) => (e = e.reduce((n, i) => {
907
- const r = n[n.length - 1];
908
- return i === "**" && r === "**" ? n : i === ".." && r && r !== ".." && r !== "." && r !== "**" ? (n.pop(), n) : (n.push(i), n);
993
+ return t.map((e) => (e = e.reduce((n, r) => {
994
+ const i = n[n.length - 1];
995
+ return r === "**" && i === "**" ? n : r === ".." && i && i !== ".." && i !== "." && i !== "**" ? (n.pop(), n) : (n.push(r), n);
909
996
  }, []), e.length === 0 ? [""] : e));
910
997
  }
911
998
  levelTwoFileOptimize(t) {
@@ -913,16 +1000,16 @@ class I {
913
1000
  let e = !1;
914
1001
  do {
915
1002
  if (e = !1, !this.preserveMultipleSlashes) {
916
- for (let i = 1; i < t.length - 1; i++) {
917
- const r = t[i];
918
- i === 1 && r === "" && t[0] === "" || (r === "." || r === "") && (e = !0, t.splice(i, 1), i--);
1003
+ for (let r = 1; r < t.length - 1; r++) {
1004
+ const i = t[r];
1005
+ r === 1 && i === "" && t[0] === "" || (i === "." || i === "") && (e = !0, t.splice(r, 1), r--);
919
1006
  }
920
1007
  t[0] === "." && t.length === 2 && (t[1] === "." || t[1] === "") && (e = !0, t.pop());
921
1008
  }
922
1009
  let n = 0;
923
1010
  for (; (n = t.indexOf("..", n + 1)) !== -1; ) {
924
- const i = t[n - 1];
925
- i && i !== "." && i !== ".." && i !== "**" && (e = !0, t.splice(n - 1, 2), n -= 2);
1011
+ const r = t[n - 1];
1012
+ r && r !== "." && r !== ".." && r !== "**" && (e = !0, t.splice(n - 1, 2), n -= 2);
926
1013
  }
927
1014
  } while (e);
928
1015
  return t.length === 0 ? [""] : t;
@@ -950,19 +1037,19 @@ class I {
950
1037
  do {
951
1038
  e = !1;
952
1039
  for (let n of t) {
953
- let i = -1;
954
- for (; (i = n.indexOf("**", i + 1)) !== -1; ) {
955
- let o = i;
1040
+ let r = -1;
1041
+ for (; (r = n.indexOf("**", r + 1)) !== -1; ) {
1042
+ let o = r;
956
1043
  for (; n[o + 1] === "**"; )
957
1044
  o++;
958
- o > i && n.splice(i + 1, o - i);
959
- let a = n[i + 1];
960
- const h = n[i + 2], l = n[i + 3];
961
- if (a !== ".." || !h || h === "." || h === ".." || !l || l === "." || l === "..")
1045
+ o > r && n.splice(r + 1, o - r);
1046
+ let a = n[r + 1];
1047
+ const l = n[r + 2], h = n[r + 3];
1048
+ if (a !== ".." || !l || l === "." || l === ".." || !h || h === "." || h === "..")
962
1049
  continue;
963
- e = !0, n.splice(i, 1);
1050
+ e = !0, n.splice(r, 1);
964
1051
  const c = n.slice(0);
965
- c[i] = "**", t.push(c), i--;
1052
+ c[r] = "**", t.push(c), r--;
966
1053
  }
967
1054
  if (!this.preserveMultipleSlashes) {
968
1055
  for (let o = 1; o < n.length - 1; o++) {
@@ -971,13 +1058,13 @@ class I {
971
1058
  }
972
1059
  n[0] === "." && n.length === 2 && (n[1] === "." || n[1] === "") && (e = !0, n.pop());
973
1060
  }
974
- let r = 0;
975
- for (; (r = n.indexOf("..", r + 1)) !== -1; ) {
976
- const o = n[r - 1];
1061
+ let i = 0;
1062
+ for (; (i = n.indexOf("..", i + 1)) !== -1; ) {
1063
+ const o = n[i - 1];
977
1064
  if (o && o !== "." && o !== ".." && o !== "**") {
978
1065
  e = !0;
979
- const h = r === 1 && n[r + 1] === "**" ? ["."] : [];
980
- n.splice(r - 1, 2, ...h), n.length === 0 && n.push(""), r -= 2;
1066
+ const l = i === 1 && n[i + 1] === "**" ? ["."] : [];
1067
+ n.splice(i - 1, 2, ...l), n.length === 0 && n.push(""), i -= 2;
981
1068
  }
982
1069
  }
983
1070
  }
@@ -994,31 +1081,31 @@ class I {
994
1081
  secondPhasePreProcess(t) {
995
1082
  for (let e = 0; e < t.length - 1; e++)
996
1083
  for (let n = e + 1; n < t.length; n++) {
997
- const i = this.partsMatch(t[e], t[n], !this.preserveMultipleSlashes);
998
- if (i) {
999
- t[e] = [], t[n] = i;
1084
+ const r = this.partsMatch(t[e], t[n], !this.preserveMultipleSlashes);
1085
+ if (r) {
1086
+ t[e] = [], t[n] = r;
1000
1087
  break;
1001
1088
  }
1002
1089
  }
1003
1090
  return t.filter((e) => e.length);
1004
1091
  }
1005
1092
  partsMatch(t, e, n = !1) {
1006
- let i = 0, r = 0, o = [], a = "";
1007
- for (; i < t.length && r < e.length; )
1008
- if (t[i] === e[r])
1009
- o.push(a === "b" ? e[r] : t[i]), i++, r++;
1010
- else if (n && t[i] === "**" && e[r] === t[i + 1])
1011
- o.push(t[i]), i++;
1012
- else if (n && e[r] === "**" && t[i] === e[r + 1])
1013
- o.push(e[r]), r++;
1014
- else if (t[i] === "*" && e[r] && (this.options.dot || !e[r].startsWith(".")) && e[r] !== "**") {
1093
+ let r = 0, i = 0, o = [], a = "";
1094
+ for (; r < t.length && i < e.length; )
1095
+ if (t[r] === e[i])
1096
+ o.push(a === "b" ? e[i] : t[r]), r++, i++;
1097
+ else if (n && t[r] === "**" && e[i] === t[r + 1])
1098
+ o.push(t[r]), r++;
1099
+ else if (n && e[i] === "**" && t[r] === e[i + 1])
1100
+ o.push(e[i]), i++;
1101
+ else if (t[r] === "*" && e[i] && (this.options.dot || !e[i].startsWith(".")) && e[i] !== "**") {
1015
1102
  if (a === "b")
1016
1103
  return !1;
1017
- a = "a", o.push(t[i]), i++, r++;
1018
- } else if (e[r] === "*" && t[i] && (this.options.dot || !t[i].startsWith(".")) && t[i] !== "**") {
1104
+ a = "a", o.push(t[r]), r++, i++;
1105
+ } else if (e[i] === "*" && t[r] && (this.options.dot || !t[r].startsWith(".")) && t[r] !== "**") {
1019
1106
  if (a === "a")
1020
1107
  return !1;
1021
- a = "b", o.push(e[r]), i++, r++;
1108
+ a = "b", o.push(e[i]), r++, i++;
1022
1109
  } else
1023
1110
  return !1;
1024
1111
  return t.length === e.length && o;
@@ -1028,7 +1115,7 @@ class I {
1028
1115
  return;
1029
1116
  const t = this.pattern;
1030
1117
  let e = !1, n = 0;
1031
- for (let i = 0; i < t.length && t.charAt(i) === "!"; i++)
1118
+ for (let r = 0; r < t.length && t.charAt(r) === "!"; r++)
1032
1119
  e = !e, n++;
1033
1120
  n && (this.pattern = t.slice(n)), this.negate = e;
1034
1121
  }
@@ -1038,70 +1125,70 @@ class I {
1038
1125
  // out of pattern, then that's fine, as long as all
1039
1126
  // the parts match.
1040
1127
  matchOne(t, e, n = !1) {
1041
- const i = this.options;
1128
+ const r = this.options;
1042
1129
  if (this.isWindows) {
1043
- const d = typeof t[0] == "string" && /^[a-z]:$/i.test(t[0]), S = !d && t[0] === "" && t[1] === "" && t[2] === "?" && /^[a-z]:$/i.test(t[3]), b = typeof e[0] == "string" && /^[a-z]:$/i.test(e[0]), A = !b && e[0] === "" && e[1] === "" && e[2] === "?" && typeof e[3] == "string" && /^[a-z]:$/i.test(e[3]), x = S ? 3 : d ? 0 : void 0, w = A ? 3 : b ? 0 : void 0;
1044
- if (typeof x == "number" && typeof w == "number") {
1045
- const [v, P] = [t[x], e[w]];
1046
- v.toLowerCase() === P.toLowerCase() && (e[w] = v, w > x ? e = e.slice(w) : x > w && (t = t.slice(x)));
1130
+ const d = typeof t[0] == "string" && /^[a-z]:$/i.test(t[0]), x = !d && t[0] === "" && t[1] === "" && t[2] === "?" && /^[a-z]:$/i.test(t[3]), N = typeof e[0] == "string" && /^[a-z]:$/i.test(e[0]), v = !N && e[0] === "" && e[1] === "" && e[2] === "?" && typeof e[3] == "string" && /^[a-z]:$/i.test(e[3]), S = x ? 3 : d ? 0 : void 0, m = v ? 3 : N ? 0 : void 0;
1131
+ if (typeof S == "number" && typeof m == "number") {
1132
+ const [$, C] = [t[S], e[m]];
1133
+ $.toLowerCase() === C.toLowerCase() && (e[m] = $, m > S ? e = e.slice(m) : S > m && (t = t.slice(S)));
1047
1134
  }
1048
1135
  }
1049
- const { optimizationLevel: r = 1 } = this.options;
1050
- r >= 2 && (t = this.levelTwoFileOptimize(t)), this.debug("matchOne", this, { file: t, pattern: e }), this.debug("matchOne", t.length, e.length);
1051
- for (var o = 0, a = 0, h = t.length, l = e.length; o < h && a < l; o++, a++) {
1136
+ const { optimizationLevel: i = 1 } = this.options;
1137
+ i >= 2 && (t = this.levelTwoFileOptimize(t)), this.debug("matchOne", this, { file: t, pattern: e }), this.debug("matchOne", t.length, e.length);
1138
+ for (var o = 0, a = 0, l = t.length, h = e.length; o < l && a < h; o++, a++) {
1052
1139
  this.debug("matchOne loop");
1053
1140
  var c = e[a], p = t[o];
1054
1141
  if (this.debug(e, c, p), c === !1)
1055
1142
  return !1;
1056
- if (c === O) {
1143
+ if (c === A) {
1057
1144
  this.debug("GLOBSTAR", [e, c, p]);
1058
1145
  var f = o, u = a + 1;
1059
- if (u === l) {
1060
- for (this.debug("** at the end"); o < h; o++)
1061
- if (t[o] === "." || t[o] === ".." || !i.dot && t[o].charAt(0) === ".")
1146
+ if (u === h) {
1147
+ for (this.debug("** at the end"); o < l; o++)
1148
+ if (t[o] === "." || t[o] === ".." || !r.dot && t[o].charAt(0) === ".")
1062
1149
  return !1;
1063
1150
  return !0;
1064
1151
  }
1065
- for (; f < h; ) {
1066
- var m = t[f];
1152
+ for (; f < l; ) {
1153
+ var g = t[f];
1067
1154
  if (this.debug(`
1068
- globstar while`, t, f, e, u, m), this.matchOne(t.slice(f), e.slice(u), n))
1069
- return this.debug("globstar found match!", f, h, m), !0;
1070
- if (m === "." || m === ".." || !i.dot && m.charAt(0) === ".") {
1155
+ globstar while`, t, f, e, u, g), this.matchOne(t.slice(f), e.slice(u), n))
1156
+ return this.debug("globstar found match!", f, l, g), !0;
1157
+ if (g === "." || g === ".." || !r.dot && g.charAt(0) === ".") {
1071
1158
  this.debug("dot detected!", t, f, e, u);
1072
1159
  break;
1073
1160
  }
1074
1161
  this.debug("globstar swallow a segment, and continue"), f++;
1075
1162
  }
1076
1163
  return !!(n && (this.debug(`
1077
- >>> no match, partial?`, t, f, e, u), f === h));
1164
+ >>> no match, partial?`, t, f, e, u), f === l));
1078
1165
  }
1079
1166
  let d;
1080
1167
  if (typeof c == "string" ? (d = p === c, this.debug("string match", c, p, d)) : (d = c.test(p), this.debug("pattern match", c, p, d)), !d)
1081
1168
  return !1;
1082
1169
  }
1083
- if (o === h && a === l)
1170
+ if (o === l && a === h)
1084
1171
  return !0;
1085
- if (o === h)
1172
+ if (o === l)
1086
1173
  return n;
1087
- if (a === l)
1088
- return o === h - 1 && t[o] === "";
1174
+ if (a === h)
1175
+ return o === l - 1 && t[o] === "";
1089
1176
  throw new Error("wtf?");
1090
1177
  }
1091
1178
  braceExpand() {
1092
- return tt(this.pattern, this.options);
1179
+ return it(this.pattern, this.options);
1093
1180
  }
1094
1181
  parse(t) {
1095
- C(t);
1182
+ I(t);
1096
1183
  const e = this.options;
1097
1184
  if (t === "**")
1098
- return O;
1185
+ return A;
1099
1186
  if (t === "")
1100
1187
  return "";
1101
- let n, i = null;
1102
- (n = t.match(Qt)) ? i = e.dot ? te : Kt : (n = t.match(_t)) ? i = (e.nocase ? e.dot ? Ht : Gt : e.dot ? qt : Bt)(n[1]) : (n = t.match(ee)) ? i = (e.nocase ? e.dot ? ne : se : e.dot ? ie : re)(n) : (n = t.match(Vt)) ? i = e.dot ? Yt : Zt : (n = t.match(Jt)) && (i = Xt);
1103
- const r = E.fromGlob(t, this.options).toMMPattern();
1104
- return i && typeof r == "object" && Reflect.defineProperty(r, "test", { value: i }), r;
1188
+ let n, r = null;
1189
+ (n = t.match(le)) ? r = e.dot ? ue : he : (n = t.match(Qt)) ? r = (e.nocase ? e.dot ? ne : se : e.dot ? ee : te)(n[1]) : (n = t.match(fe)) ? r = (e.nocase ? e.dot ? de : pe : e.dot ? ge : me)(n) : (n = t.match(re)) ? r = e.dot ? oe : ie : (n = t.match(ce)) && (r = ae);
1190
+ const i = E.fromGlob(t, this.options).toMMPattern();
1191
+ return r && typeof i == "object" && Reflect.defineProperty(i, "test", { value: r }), i;
1105
1192
  }
1106
1193
  makeRe() {
1107
1194
  if (this.regexp || this.regexp === !1)
@@ -1109,23 +1196,23 @@ globstar while`, t, f, e, u, m), this.matchOne(t.slice(f), e.slice(u), n))
1109
1196
  const t = this.set;
1110
1197
  if (!t.length)
1111
1198
  return this.regexp = !1, this.regexp;
1112
- const e = this.options, n = e.noglobstar ? ae : e.dot ? he : le, i = new Set(e.nocase ? ["i"] : []);
1113
- let r = t.map((h) => {
1114
- const l = h.map((c) => {
1199
+ const e = this.options, n = e.noglobstar ? Ee : e.dot ? xe : Se, r = new Set(e.nocase ? ["i"] : []);
1200
+ let i = t.map((l) => {
1201
+ const h = l.map((c) => {
1115
1202
  if (c instanceof RegExp)
1116
1203
  for (const p of c.flags.split(""))
1117
- i.add(p);
1118
- return typeof c == "string" ? ge(c) : c === O ? O : c._src;
1204
+ r.add(p);
1205
+ return typeof c == "string" ? ve(c) : c === A ? A : c._src;
1119
1206
  });
1120
- return l.forEach((c, p) => {
1121
- const f = l[p + 1], u = l[p - 1];
1122
- c !== O || u === O || (u === void 0 ? f !== void 0 && f !== O ? l[p + 1] = "(?:\\/|" + n + "\\/)?" + f : l[p] = n : f === void 0 ? l[p - 1] = u + "(?:\\/|" + n + ")?" : f !== O && (l[p - 1] = u + "(?:\\/|\\/" + n + "\\/)" + f, l[p + 1] = O));
1123
- }), l.filter((c) => c !== O).join("/");
1207
+ return h.forEach((c, p) => {
1208
+ const f = h[p + 1], u = h[p - 1];
1209
+ c !== A || u === A || (u === void 0 ? f !== void 0 && f !== A ? h[p + 1] = "(?:\\/|" + n + "\\/)?" + f : h[p] = n : f === void 0 ? h[p - 1] = u + "(?:\\/|" + n + ")?" : f !== A && (h[p - 1] = u + "(?:\\/|\\/" + n + "\\/)" + f, h[p + 1] = A));
1210
+ }), h.filter((c) => c !== A).join("/");
1124
1211
  }).join("|");
1125
1212
  const [o, a] = t.length > 1 ? ["(?:", ")"] : ["", ""];
1126
- r = "^" + o + r + a + "$", this.negate && (r = "^(?!" + r + ").+$");
1213
+ i = "^" + o + i + a + "$", this.negate && (i = "^(?!" + i + ").+$");
1127
1214
  try {
1128
- this.regexp = new RegExp(r, [...i].join(""));
1215
+ this.regexp = new RegExp(i, [...r].join(""));
1129
1216
  } catch {
1130
1217
  this.regexp = !1;
1131
1218
  }
@@ -1143,95 +1230,95 @@ globstar while`, t, f, e, u, m), this.matchOne(t.slice(f), e.slice(u), n))
1143
1230
  return !0;
1144
1231
  const n = this.options;
1145
1232
  this.isWindows && (t = t.split("\\").join("/"));
1146
- const i = this.slashSplit(t);
1147
- this.debug(this.pattern, "split", i);
1148
- const r = this.set;
1149
- this.debug(this.pattern, "set", r);
1150
- let o = i[i.length - 1];
1233
+ const r = this.slashSplit(t);
1234
+ this.debug(this.pattern, "split", r);
1235
+ const i = this.set;
1236
+ this.debug(this.pattern, "set", i);
1237
+ let o = r[r.length - 1];
1151
1238
  if (!o)
1152
- for (let a = i.length - 2; !o && a >= 0; a--)
1153
- o = i[a];
1154
- for (let a = 0; a < r.length; a++) {
1155
- const h = r[a];
1156
- let l = i;
1157
- if (n.matchBase && h.length === 1 && (l = [o]), this.matchOne(l, h, e))
1239
+ for (let a = r.length - 2; !o && a >= 0; a--)
1240
+ o = r[a];
1241
+ for (let a = 0; a < i.length; a++) {
1242
+ const l = i[a];
1243
+ let h = r;
1244
+ if (n.matchBase && l.length === 1 && (h = [o]), this.matchOne(h, l, e))
1158
1245
  return n.flipNegate ? !0 : !this.negate;
1159
1246
  }
1160
1247
  return n.flipNegate ? !1 : this.negate;
1161
1248
  }
1162
1249
  static defaults(t) {
1163
- return y.defaults(t).Minimatch;
1250
+ return w.defaults(t).Minimatch;
1164
1251
  }
1165
1252
  }
1166
- y.AST = E;
1167
- y.Minimatch = I;
1168
- y.escape = zt;
1169
- y.unescape = M;
1170
- function Me() {
1253
+ w.AST = E;
1254
+ w.Minimatch = D;
1255
+ w.escape = Kt;
1256
+ w.unescape = R;
1257
+ function Fe() {
1171
1258
  if (!("storage" in navigator) || !("getDirectory" in navigator.storage))
1172
- throw new it();
1259
+ throw new ht();
1173
1260
  }
1174
- async function me(s, t, e) {
1261
+ async function $e(s, t, e) {
1175
1262
  return typeof navigator < "u" && navigator.locks?.request ? navigator.locks.request(`opfs:${s.replace(/\/+/g, "/")}`, { mode: t }, e) : e();
1176
1263
  }
1177
- function F(s) {
1264
+ function W(s) {
1178
1265
  return Array.isArray(s) ? s : (s.startsWith("~/") ? s.slice(2) : s).split("/").filter(Boolean);
1179
1266
  }
1180
- function et(s) {
1267
+ function ot(s) {
1181
1268
  return typeof s == "string" ? s ?? "/" : `/${s.join("/")}`;
1182
1269
  }
1183
- function st(s) {
1184
- const t = F(s);
1270
+ function ct(s) {
1271
+ const t = W(s);
1185
1272
  return t[t.length - 1] || "";
1186
1273
  }
1187
- function Pe(s) {
1188
- const t = F(s);
1189
- return t.pop(), et(t);
1274
+ function je(s) {
1275
+ const t = W(s);
1276
+ return t.pop(), ot(t);
1190
1277
  }
1191
- function nt(s) {
1278
+ function at(s) {
1192
1279
  return !s || s === "/" ? "/" : s.startsWith("~/") ? `/${s.slice(2)}` : s.startsWith("/") ? s : `/${s}`;
1193
1280
  }
1194
- function Re(s, t = !1) {
1281
+ function We(s, t = !1) {
1195
1282
  return s = s.replace(/\/$/, ""), t && !s.includes("*") ? `${s}/**` : s;
1196
1283
  }
1197
- function Ce(s, t) {
1198
- return y(s, t, {
1284
+ function Ue(s, t) {
1285
+ return w(s, t, {
1199
1286
  dot: !0,
1200
1287
  matchBase: !0
1201
1288
  });
1202
1289
  }
1203
- function Ie(s, t) {
1290
+ function ze(s, t) {
1204
1291
  if (!t || Array.isArray(t) && t.length === 0)
1205
1292
  return !1;
1206
- const e = nt(s);
1207
- return (Array.isArray(t) ? t : [t]).some((i) => y(e, i, { dot: !0 }));
1293
+ const e = at(s);
1294
+ return (Array.isArray(t) ? t : [t]).some((r) => w(e, r, { dot: !0 }));
1208
1295
  }
1209
- function De(s) {
1210
- const t = nt(s), e = F(t), n = [];
1211
- for (const i of e)
1212
- if (!(i === "." || i === ""))
1213
- if (i === "..") {
1296
+ function Be(s) {
1297
+ const t = at(s), e = W(t), n = [];
1298
+ for (const r of e)
1299
+ if (!(r === "." || r === ""))
1300
+ if (r === "..") {
1214
1301
  if (n.length === 0)
1215
1302
  continue;
1216
1303
  n.pop();
1217
1304
  } else
1218
- n.push(i);
1219
- return et(n);
1305
+ n.push(r);
1306
+ return ot(n);
1220
1307
  }
1221
- function Le(s) {
1222
- const t = st(s), e = t.lastIndexOf(".");
1308
+ function _e(s) {
1309
+ const t = ct(s), e = t.lastIndexOf(".");
1223
1310
  return e <= 0 || e === t.length - 1 ? "" : t.slice(e);
1224
1311
  }
1225
- function ke(s, t = "utf-8") {
1226
- return typeof s == "string" ? ct(s, t) : s instanceof Uint8Array ? s : new Uint8Array(s);
1312
+ function qe(s, t = "utf-8") {
1313
+ return typeof s == "string" ? yt(s, t) : s instanceof Uint8Array ? s : new Uint8Array(s);
1227
1314
  }
1228
- async function Fe(s, t = "SHA-1", e = 50 * 1024 * 1024) {
1315
+ async function Ge(s, t = "SHA-1", e = 50 * 1024 * 1024) {
1229
1316
  if (s instanceof File && (s = await s.arrayBuffer()), s.byteLength > e)
1230
1317
  throw new Error(`File size ${s.byteLength} bytes exceeds maximum allowed size ${e} bytes`);
1231
- const n = new Uint8Array(s), i = await crypto.subtle.digest(t, n);
1232
- return Array.from(new Uint8Array(i)).map((o) => o.toString(16).padStart(2, "0")).join("");
1318
+ const n = new Uint8Array(s), r = await crypto.subtle.digest(t, n);
1319
+ return Array.from(new Uint8Array(r)).map((o) => o.toString(16).padStart(2, "0")).join("");
1233
1320
  }
1234
- function je(s, t) {
1321
+ function He(s, t) {
1235
1322
  if (s.length !== t.length)
1236
1323
  return !1;
1237
1324
  for (let e = 0; e < s.length; e++)
@@ -1239,92 +1326,98 @@ function je(s, t) {
1239
1326
  return !1;
1240
1327
  return !0;
1241
1328
  }
1242
- async function Ue(s) {
1329
+ async function Ve(s) {
1243
1330
  const t = await s.arrayBuffer();
1244
1331
  return new Uint8Array(t);
1245
1332
  }
1246
- async function We(s, t, e = {}) {
1247
- const n = st(t);
1248
- return me(t, "exclusive", async () => {
1249
- const i = e.recursive ?? !1, r = e.force ?? !1;
1250
- e.useTrash;
1333
+ async function Ye(s, t, e = {}) {
1334
+ const n = ct(t);
1335
+ return $e(t, "exclusive", async () => {
1336
+ const r = e.recursive ?? !1, i = e.force ?? !1;
1251
1337
  try {
1252
- await s.removeEntry(n, { recursive: i });
1338
+ await s.removeEntry(n, { recursive: r });
1253
1339
  } catch (o) {
1254
1340
  if (o.name === "NotFoundError") {
1255
- if (!r)
1256
- throw new g(`No such file or directory: ${t}`, "ENOENT", void 0, o);
1257
- } else throw o.name === "InvalidModificationError" ? new g(`Directory not empty: ${t}. Use recursive option to force removal.`, "ENOTEMPTY", void 0, o) : o.name === "TypeMismatchError" && !i ? new g(`Cannot remove directory without recursive option: ${t}`, "EISDIR", void 0, o) : new g(`Failed to remove entry: ${t}`, "RM_FAILED", void 0, o);
1341
+ if (!i)
1342
+ throw new Z("file", t, o);
1343
+ } else throw o.name === "InvalidModificationError" ? new z("ENOTEMPTY", t, o) : o.name === "TypeMismatchError" && !r ? new k("directory", t, o) : new z("RM_FAILED", t, o);
1258
1344
  }
1259
1345
  });
1260
1346
  }
1261
- function ze(s, t, e, n) {
1347
+ function Ze(s, t, e, n) {
1262
1348
  if (!Number.isInteger(t) || !Number.isInteger(e))
1263
- throw new g("Invalid offset or length", "EINVAL");
1349
+ throw new b("argument", "Invalid offset or length");
1264
1350
  if (t < 0 || e < 0)
1265
- throw new g("Negative offset or length not allowed", "EINVAL");
1351
+ throw new b("argument", "Negative offset or length not allowed");
1266
1352
  if (t + e > s)
1267
- throw new g("Operation would overflow buffer", "ERANGE");
1353
+ throw new b("overflow", "Operation would overflow buffer");
1268
1354
  if (n != null && (!Number.isInteger(n) || n < 0))
1269
- throw new g("Invalid position", "EINVAL");
1355
+ throw new b("argument", "Invalid position");
1270
1356
  }
1271
- function _e(s, t, e) {
1357
+ function Je(s, t, e) {
1272
1358
  try {
1273
1359
  t.flush(), t.close();
1274
1360
  } catch (n) {
1275
1361
  console.warn(`Warning: Failed to properly close file descriptor ${s} (${e}):`, n);
1276
1362
  }
1277
1363
  }
1278
- function Be(s, t, e) {
1364
+ function Xe(s, t, e) {
1279
1365
  if (s >= e)
1280
1366
  return { isEOF: !0, actualLength: 0 };
1281
1367
  const n = Math.min(t, e - s);
1282
1368
  return n <= 0 ? { isEOF: !0, actualLength: 0 } : { isEOF: !1, actualLength: n };
1283
1369
  }
1284
- async function qe(s, t) {
1370
+ async function Ke(s, t) {
1285
1371
  try {
1286
1372
  return await s.createSyncAccessHandle();
1287
1373
  } catch (e) {
1288
- throw rt(e, { path: t, isDirectory: !1 });
1374
+ throw mt(e, { path: t, isDirectory: !1 });
1289
1375
  }
1290
1376
  }
1291
1377
  export {
1292
- _e as A,
1293
- Be as B,
1294
- qe as C,
1295
- Se as D,
1296
- ot as E,
1297
- Ee as F,
1298
- g as O,
1299
- ye as P,
1300
- Ne as S,
1301
- Oe as T,
1302
- ft as W,
1303
- it as a,
1304
- we as b,
1305
- xe as c,
1306
- ve as d,
1307
- ct as e,
1308
- be as f,
1309
- Me as g,
1310
- st as h,
1311
- Ae as i,
1312
- et as j,
1378
+ Ce as A,
1379
+ He as B,
1380
+ Ve as C,
1381
+ z as D,
1382
+ Z as E,
1383
+ pt as F,
1384
+ Ye as G,
1385
+ Ze as H,
1386
+ U as I,
1387
+ Je as J,
1388
+ Xe as K,
1389
+ Ke as L,
1390
+ wt as M,
1391
+ y as O,
1392
+ Te as P,
1393
+ ft as S,
1394
+ b as V,
1395
+ At as W,
1396
+ ht as a,
1397
+ ut as b,
1398
+ k as c,
1399
+ De as d,
1400
+ yt as e,
1401
+ dt as f,
1402
+ gt as g,
1403
+ Me as h,
1404
+ Ie as i,
1405
+ Re as j,
1313
1406
  Pe as k,
1314
- Re as l,
1315
- rt as m,
1316
- nt as n,
1317
- Ce as o,
1318
- Ie as p,
1319
- Le as q,
1320
- De as r,
1321
- F as s,
1322
- ke as t,
1323
- Fe as u,
1324
- je as v,
1325
- me as w,
1326
- Ue as x,
1327
- We as y,
1328
- ze as z
1407
+ Fe as l,
1408
+ mt as m,
1409
+ ot as n,
1410
+ ct as o,
1411
+ je as p,
1412
+ at as q,
1413
+ We as r,
1414
+ W as s,
1415
+ Ue as t,
1416
+ ze as u,
1417
+ Be as v,
1418
+ $e as w,
1419
+ _e as x,
1420
+ qe as y,
1421
+ Ge as z
1329
1422
  };
1330
- //# sourceMappingURL=helpers-BXhw_-Ar.js.map
1423
+ //# sourceMappingURL=helpers-CKOebsbw.js.map