opfs-worker 1.3.1 → 2.0.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.
Files changed (62) hide show
  1. package/README.md +89 -106
  2. package/dist/{facade.d.ts → OPFSFacade.d.ts} +26 -9
  3. package/dist/OPFSFacade.d.ts.map +1 -0
  4. package/dist/{worker.d.ts → OPFSWorker.d.ts} +11 -11
  5. package/dist/OPFSWorker.d.ts.map +1 -0
  6. package/dist/assets/worker.entry-DUlEoroc.js.map +1 -0
  7. package/dist/createOPFSWorker.d.ts +17 -0
  8. package/dist/createOPFSWorker.d.ts.map +1 -0
  9. package/dist/helpers-DNj8ZoMu.cjs +4 -0
  10. package/dist/helpers-DNj8ZoMu.cjs.map +1 -0
  11. package/dist/{helpers-CKOebsbw.js → helpers-WY2jfbOT.js} +257 -253
  12. package/dist/helpers-WY2jfbOT.js.map +1 -0
  13. package/dist/index.cjs +349 -329
  14. package/dist/index.cjs.map +1 -1
  15. package/dist/index.d.ts +3 -9
  16. package/dist/index.d.ts.map +1 -1
  17. package/dist/index.js +428 -382
  18. package/dist/index.js.map +1 -1
  19. package/dist/index.pure.cjs +2 -0
  20. package/dist/index.pure.cjs.map +1 -0
  21. package/dist/index.pure.d.ts +6 -0
  22. package/dist/index.pure.d.ts.map +1 -0
  23. package/dist/{raw.js → index.pure.js} +248 -188
  24. package/dist/index.pure.js.map +1 -0
  25. package/dist/types.d.ts +1 -1
  26. package/dist/types.d.ts.map +1 -1
  27. package/dist/utils/errors.d.ts +14 -6
  28. package/dist/utils/errors.d.ts.map +1 -1
  29. package/dist/utils/helpers.d.ts +15 -3
  30. package/dist/utils/helpers.d.ts.map +1 -1
  31. package/dist/worker.entry.d.ts +2 -0
  32. package/dist/worker.entry.d.ts.map +1 -0
  33. package/docs/api-reference.md +815 -0
  34. package/docs/file-descriptors.md +696 -0
  35. package/docs/types.md +232 -0
  36. package/package.json +15 -9
  37. package/src/OPFSFacade.ts +460 -0
  38. package/src/OPFSWorker.ts +1544 -0
  39. package/src/createOPFSWorker.ts +57 -0
  40. package/src/index.pure.ts +7 -0
  41. package/src/index.ts +15 -0
  42. package/src/types.ts +99 -0
  43. package/src/utils/encoder.ts +205 -0
  44. package/src/utils/errors.ts +297 -0
  45. package/src/utils/helpers.ts +465 -0
  46. package/src/worker.entry.ts +6 -0
  47. package/dist/assets/worker-1Wh1cr7P.js.map +0 -1
  48. package/dist/assets/worker-BeJaVyBV.js.map +0 -1
  49. package/dist/facade.d.ts.map +0 -1
  50. package/dist/helpers-BuGfPAg0.js +0 -1439
  51. package/dist/helpers-BuGfPAg0.js.map +0 -1
  52. package/dist/helpers-CF7A2WQG.cjs +0 -4
  53. package/dist/helpers-CF7A2WQG.cjs.map +0 -1
  54. package/dist/helpers-CIiblZ8d.cjs +0 -4
  55. package/dist/helpers-CIiblZ8d.cjs.map +0 -1
  56. package/dist/helpers-CKOebsbw.js.map +0 -1
  57. package/dist/raw.cjs +0 -2
  58. package/dist/raw.cjs.map +0 -1
  59. package/dist/raw.d.ts +0 -13
  60. package/dist/raw.d.ts.map +0 -1
  61. package/dist/raw.js.map +0 -1
  62. package/dist/worker.d.ts.map +0 -1
package/dist/index.js CHANGED
@@ -1,12 +1,12 @@
1
+ import { i as h, d as l, e as c } from "./helpers-WY2jfbOT.js";
2
+ import { A as F, M as A, D as T, E as R, F as C, j as I, c as D, I as $, h as _, O as N, a as k, f as z, g as M, P as j, b as W, S as L, V as U, W as H, o as B, B as G, z as q, K as Y, l as V, C as Z, y as J, k as X, L as K, p as Q, x as nn, u as tn, n as en, m as rn, t as sn, r as an, q as on, G as cn, v as hn, J as ln, s as pn, H as fn, w as dn } from "./helpers-WY2jfbOT.js";
1
3
  import { wrap as u } from "comlink";
2
- import { i as h, d as l, e as c } from "./helpers-CKOebsbw.js";
3
- import { A as E, M as S, D as P, E as O, F, j as A, c as T, I as R, h as C, O as I, a as $, f as D, g as _, P as N, b as z, S as k, V as M, W as j, o as L, B as W, z as U, K as H, l as B, C as G, y as q, k as V, L as Y, p as J, x as X, u as Z, n as K, m as Q, t as nn, r as tn, q as en, G as rn, v as sn, J as an, s as on, H as cn, w as hn } from "./helpers-CKOebsbw.js";
4
4
  const f = `/**
5
5
  * @license
6
6
  * Copyright 2019 Google LLC
7
7
  * SPDX-License-Identifier: Apache-2.0
8
8
  */
9
- const bt = Symbol("Comlink.proxy"), Ht = Symbol("Comlink.endpoint"), Wt = Symbol("Comlink.releaseProxy"), J = Symbol("Comlink.finalizer"), U = Symbol("Comlink.thrown"), Ot = (s) => typeof s == "object" && s !== null || typeof s == "function", jt = {
9
+ const bt = Symbol("Comlink.proxy"), zt = Symbol("Comlink.endpoint"), Wt = Symbol("Comlink.releaseProxy"), X = Symbol("Comlink.finalizer"), j = Symbol("Comlink.thrown"), Ot = (s) => typeof s == "object" && s !== null || typeof s == "function", jt = {
10
10
  canHandle: (s) => Ot(s) && s[bt],
11
11
  serialize(s) {
12
12
  const { port1: t, port2: e } = new MessageChannel();
@@ -16,7 +16,7 @@ const bt = Symbol("Comlink.proxy"), Ht = Symbol("Comlink.endpoint"), Wt = Symbol
16
16
  return s.start(), Gt(s);
17
17
  }
18
18
  }, _t = {
19
- canHandle: (s) => Ot(s) && U in s,
19
+ canHandle: (s) => Ot(s) && j in s,
20
20
  serialize({ value: s }) {
21
21
  let t;
22
22
  return s instanceof Error ? t = {
@@ -49,30 +49,30 @@ function ot(s, t = globalThis, e = ["*"]) {
49
49
  console.warn(\`Invalid origin '\${r.origin}' for comlink proxy\`);
50
50
  return;
51
51
  }
52
- const { id: i, type: o, path: a } = Object.assign({ path: [] }, r.data), l = (r.data.argumentList || []).map(C);
52
+ const { id: i, type: o, path: a } = Object.assign({ path: [] }, r.data), c = (r.data.argumentList || []).map(C);
53
53
  let h;
54
54
  try {
55
- const c = a.slice(0, -1).reduce((u, d) => u[d], s), f = a.reduce((u, d) => u[d], s);
55
+ const l = a.slice(0, -1).reduce((u, d) => u[d], s), f = a.reduce((u, d) => u[d], s);
56
56
  switch (o) {
57
57
  case "GET":
58
58
  h = f;
59
59
  break;
60
60
  case "SET":
61
- c[a.slice(-1)[0]] = C(r.data.value), h = !0;
61
+ l[a.slice(-1)[0]] = C(r.data.value), h = !0;
62
62
  break;
63
63
  case "APPLY":
64
- h = f.apply(c, l);
64
+ h = f.apply(l, c);
65
65
  break;
66
66
  case "CONSTRUCT":
67
67
  {
68
- const u = new f(...l);
68
+ const u = new f(...c);
69
69
  h = Zt(u);
70
70
  }
71
71
  break;
72
72
  case "ENDPOINT":
73
73
  {
74
74
  const { port1: u, port2: d } = new MessageChannel();
75
- ot(s, d), h = B(u, [u]);
75
+ ot(s, d), h = _(u, [u]);
76
76
  }
77
77
  break;
78
78
  case "RELEASE":
@@ -81,16 +81,16 @@ function ot(s, t = globalThis, e = ["*"]) {
81
81
  default:
82
82
  return;
83
83
  }
84
- } catch (c) {
85
- h = { value: c, [U]: 0 };
84
+ } catch (l) {
85
+ h = { value: l, [j]: 0 };
86
86
  }
87
- Promise.resolve(h).catch((c) => ({ value: c, [U]: 0 })).then((c) => {
88
- const [f, u] = Y(c);
89
- t.postMessage(Object.assign(Object.assign({}, f), { id: i }), u), o === "RELEASE" && (t.removeEventListener("message", n), vt(t), J in s && typeof s[J] == "function" && s[J]());
90
- }).catch((c) => {
91
- const [f, u] = Y({
87
+ Promise.resolve(h).catch((l) => ({ value: l, [j]: 0 })).then((l) => {
88
+ const [f, u] = V(l);
89
+ t.postMessage(Object.assign(Object.assign({}, f), { id: i }), u), o === "RELEASE" && (t.removeEventListener("message", n), At(t), X in s && typeof s[X] == "function" && s[X]());
90
+ }).catch((l) => {
91
+ const [f, u] = V({
92
92
  value: new TypeError("Unserializable return value"),
93
- [U]: 0
93
+ [j]: 0
94
94
  });
95
95
  t.postMessage(Object.assign(Object.assign({}, f), { id: i }), u);
96
96
  });
@@ -99,7 +99,7 @@ function ot(s, t = globalThis, e = ["*"]) {
99
99
  function Bt(s) {
100
100
  return s.constructor.name === "MessagePort";
101
101
  }
102
- function vt(s) {
102
+ function At(s) {
103
103
  Bt(s) && s.close();
104
104
  }
105
105
  function Gt(s, t) {
@@ -115,82 +115,82 @@ function Gt(s, t) {
115
115
  } finally {
116
116
  e.delete(i.id);
117
117
  }
118
- }), nt(s, e, [], t);
118
+ }), st(s, e, [], t);
119
119
  }
120
- function W(s) {
120
+ function L(s) {
121
121
  if (s)
122
122
  throw new Error("Proxy has been released and is not useable");
123
123
  }
124
- function At(s) {
124
+ function vt(s) {
125
125
  return $(s, /* @__PURE__ */ new Map(), {
126
126
  type: "RELEASE"
127
127
  }).then(() => {
128
- vt(s);
128
+ At(s);
129
129
  });
130
130
  }
131
- const q = /* @__PURE__ */ new WeakMap(), V = "FinalizationRegistry" in globalThis && new FinalizationRegistry((s) => {
132
- const t = (q.get(s) || 0) - 1;
133
- q.set(s, t), t === 0 && At(s);
131
+ const G = /* @__PURE__ */ new WeakMap(), q = "FinalizationRegistry" in globalThis && new FinalizationRegistry((s) => {
132
+ const t = (G.get(s) || 0) - 1;
133
+ G.set(s, t), t === 0 && vt(s);
134
134
  });
135
135
  function qt(s, t) {
136
- const e = (q.get(t) || 0) + 1;
137
- q.set(t, e), V && V.register(s, t, s);
136
+ const e = (G.get(t) || 0) + 1;
137
+ G.set(t, e), q && q.register(s, t, s);
138
138
  }
139
139
  function Vt(s) {
140
- V && V.unregister(s);
140
+ q && q.unregister(s);
141
141
  }
142
- function nt(s, t, e = [], n = function() {
142
+ function st(s, t, e = [], n = function() {
143
143
  }) {
144
144
  let r = !1;
145
145
  const i = new Proxy(n, {
146
146
  get(o, a) {
147
- if (W(r), a === Wt)
147
+ if (L(r), a === Wt)
148
148
  return () => {
149
- Vt(i), At(s), t.clear(), r = !0;
149
+ Vt(i), vt(s), t.clear(), r = !0;
150
150
  };
151
151
  if (a === "then") {
152
152
  if (e.length === 0)
153
153
  return { then: () => i };
154
- const l = $(s, t, {
154
+ const c = $(s, t, {
155
155
  type: "GET",
156
156
  path: e.map((h) => h.toString())
157
157
  }).then(C);
158
- return l.then.bind(l);
158
+ return c.then.bind(c);
159
159
  }
160
- return nt(s, t, [...e, a]);
160
+ return st(s, t, [...e, a]);
161
161
  },
162
- set(o, a, l) {
163
- W(r);
164
- const [h, c] = Y(l);
162
+ set(o, a, c) {
163
+ L(r);
164
+ const [h, l] = V(c);
165
165
  return $(s, t, {
166
166
  type: "SET",
167
167
  path: [...e, a].map((f) => f.toString()),
168
168
  value: h
169
- }, c).then(C);
169
+ }, l).then(C);
170
170
  },
171
- apply(o, a, l) {
172
- W(r);
171
+ apply(o, a, c) {
172
+ L(r);
173
173
  const h = e[e.length - 1];
174
- if (h === Ht)
174
+ if (h === zt)
175
175
  return $(s, t, {
176
176
  type: "ENDPOINT"
177
177
  }).then(C);
178
178
  if (h === "bind")
179
- return nt(s, t, e.slice(0, -1));
180
- const [c, f] = ht(l);
179
+ return st(s, t, e.slice(0, -1));
180
+ const [l, f] = ht(c);
181
181
  return $(s, t, {
182
182
  type: "APPLY",
183
183
  path: e.map((u) => u.toString()),
184
- argumentList: c
184
+ argumentList: l
185
185
  }, f).then(C);
186
186
  },
187
187
  construct(o, a) {
188
- W(r);
189
- const [l, h] = ht(a);
188
+ L(r);
189
+ const [c, h] = ht(a);
190
190
  return $(s, t, {
191
191
  type: "CONSTRUCT",
192
- path: e.map((c) => c.toString()),
193
- argumentList: l
192
+ path: e.map((l) => l.toString()),
193
+ argumentList: c
194
194
  }, h).then(C);
195
195
  }
196
196
  });
@@ -200,17 +200,17 @@ function Yt(s) {
200
200
  return Array.prototype.concat.apply([], s);
201
201
  }
202
202
  function ht(s) {
203
- const t = s.map(Y);
203
+ const t = s.map(V);
204
204
  return [t.map((e) => e[0]), Yt(t.map((e) => e[1]))];
205
205
  }
206
206
  const Nt = /* @__PURE__ */ new WeakMap();
207
- function B(s, t) {
207
+ function _(s, t) {
208
208
  return Nt.set(s, t), s;
209
209
  }
210
210
  function Zt(s) {
211
211
  return Object.assign(s, { [bt]: !0 });
212
212
  }
213
- function Y(s) {
213
+ function V(s) {
214
214
  for (const [t, e] of Dt)
215
215
  if (e.canHandle(s)) {
216
216
  const [n, r] = e.serialize(s);
@@ -248,7 +248,7 @@ function $(s, t, e, n) {
248
248
  function Xt() {
249
249
  return new Array(4).fill(0).map(() => Math.floor(Math.random() * Number.MAX_SAFE_INTEGER).toString(16)).join("-");
250
250
  }
251
- var D = /* @__PURE__ */ ((s) => (s.Added = "added", s.Changed = "changed", s.Removed = "removed", s))(D || {});
251
+ var A = /* @__PURE__ */ ((s) => (s.Added = "added", s.Changed = "changed", s.Removed = "removed", s))(A || {});
252
252
  const Jt = {
253
253
  ENOENT: -2,
254
254
  // No such file or directory
@@ -299,7 +299,7 @@ class Kt extends w {
299
299
  super(t, "INVALID_PATH", e, "access", n);
300
300
  }
301
301
  }
302
- class F extends w {
302
+ class U extends w {
303
303
  constructor(t, e, n) {
304
304
  const r = {
305
305
  file: \`File not found: \${e}\`,
@@ -324,7 +324,7 @@ class se extends w {
324
324
  super(\`File is busy: \${t}\`, "EBUSY", t, "open", e);
325
325
  }
326
326
  }
327
- class z extends w {
327
+ class nt extends w {
328
328
  constructor(t, e, n) {
329
329
  const r = t === "directory" ? \`Is a directory: \${e}\` : \`Not a directory: \${e}\`, i = t === "directory" ? "EISDIR" : "ENOTDIR";
330
330
  super(r, i, e, "access", n);
@@ -371,36 +371,36 @@ class re extends w {
371
371
  super("Failed to initialize OPFS", "INIT_FAILED", t, "init", e);
372
372
  }
373
373
  }
374
- class Q extends w {
374
+ class J extends w {
375
375
  constructor(t, e, n) {
376
376
  super(\`Failed to \${t}: \${e}\`, \`\${t.toUpperCase()}_FAILED\`, e, t, n);
377
377
  }
378
378
  }
379
- class K extends w {
379
+ class Q extends w {
380
380
  constructor(t, e) {
381
381
  super(\`Destination already exists: \${t}\`, "EEXIST", t, "open", e);
382
382
  }
383
383
  }
384
- function j(s, t, e, n) {
384
+ function z(s, t, e, n) {
385
385
  const r = \`\${s.toUpperCase()}_FAILED\`;
386
386
  return new w(\`Failed to \${s} file descriptor: \${t}\`, r, e, s, n);
387
387
  }
388
- function A(s, t) {
389
- const e = t?.path, n = t?.isDirectory;
388
+ function O(s, t) {
389
+ const e = t?.path, n = t?.isDirectory, r = t?.existenceType ?? "file", i = t?.operation;
390
390
  switch (s.name) {
391
391
  case "InvalidStateError":
392
392
  return new se(e || "unknown", s);
393
393
  case "QuotaExceededError":
394
394
  return new ee(\`No space left on device: \${e || "unknown"}\`, e, s);
395
395
  case "NotFoundError":
396
- return new F("file", e, s);
396
+ return new U(r, e, s);
397
397
  case "TypeMismatchError":
398
- return n !== void 0 ? n ? new z("directory", e || "unknown", s) : new z("file", e || "unknown", s) : new N("argument", \`Type mismatch: \${e || "unknown"}\`, e, s);
398
+ return n !== void 0 ? n ? new nt("directory", e || "unknown", s) : new nt("file", e || "unknown", s) : new N("argument", \`Type mismatch: \${e || "unknown"}\`, e, s);
399
399
  case "NotAllowedError":
400
400
  case "SecurityError":
401
401
  return new te(e, "unknown", s);
402
402
  case "InvalidModificationError":
403
- return new N("argument", \`Invalid modification: \${e || "unknown"}\`, e, s);
403
+ return i === "remove" ? new rt("ENOTEMPTY", e, s) : new N("argument", \`Invalid modification: \${e || "unknown"}\`, e, s);
404
404
  case "AbortError":
405
405
  return new ne(e || "unknown", s);
406
406
  case "OperationError":
@@ -408,10 +408,10 @@ function A(s, t) {
408
408
  case "TypeError":
409
409
  return new Ct(e || "unknown", s);
410
410
  default:
411
- return new ut(\`I/O error: \${e || "unknown"}\`, e, s);
411
+ return i === "remove" ? new rt("RM_FAILED", e, s) : new ut(\`I/O error: \${e || "unknown"}\`, e, s);
412
412
  }
413
413
  }
414
- const Ft = (s, t, e) => {
414
+ const $t = (s, t, e) => {
415
415
  const n = s instanceof RegExp ? ft(s, e) : s, r = t instanceof RegExp ? ft(t, e) : t, i = n !== null && r != null && ie(n, r, e);
416
416
  return i && {
417
417
  start: i[0],
@@ -424,37 +424,37 @@ const Ft = (s, t, e) => {
424
424
  const e = t.match(s);
425
425
  return e ? e[0] : null;
426
426
  }, ie = (s, t, e) => {
427
- let n, r, i, o, a, l = e.indexOf(s), h = e.indexOf(t, l + 1), c = l;
428
- if (l >= 0 && h > 0) {
427
+ let n, r, i, o, a, c = e.indexOf(s), h = e.indexOf(t, c + 1), l = c;
428
+ if (c >= 0 && h > 0) {
429
429
  if (s === t)
430
- return [l, h];
431
- for (n = [], i = e.length; c >= 0 && !a; ) {
432
- if (c === l)
433
- n.push(c), l = e.indexOf(s, c + 1);
430
+ return [c, h];
431
+ for (n = [], i = e.length; l >= 0 && !a; ) {
432
+ if (l === c)
433
+ n.push(l), c = e.indexOf(s, l + 1);
434
434
  else if (n.length === 1) {
435
435
  const f = n.pop();
436
436
  f !== void 0 && (a = [f, h]);
437
437
  } else
438
- r = n.pop(), r !== void 0 && r < i && (i = r, o = h), h = e.indexOf(t, c + 1);
439
- c = l < h && l >= 0 ? l : h;
438
+ r = n.pop(), r !== void 0 && r < i && (i = r, o = h), h = e.indexOf(t, l + 1);
439
+ l = c < h && c >= 0 ? c : h;
440
440
  }
441
441
  n.length && o !== void 0 && (a = [i, o]);
442
442
  }
443
443
  return a;
444
- }, $t = "\\0SLASH" + Math.random() + "\\0", Mt = "\\0OPEN" + Math.random() + "\\0", at = "\\0CLOSE" + Math.random() + "\\0", Pt = "\\0COMMA" + Math.random() + "\\0", Tt = "\\0PERIOD" + Math.random() + "\\0", oe = new RegExp($t, "g"), ae = new RegExp(Mt, "g"), ce = new RegExp(at, "g"), le = new RegExp(Pt, "g"), he = new RegExp(Tt, "g"), ue = /\\\\\\\\/g, fe = /\\\\{/g, de = /\\\\}/g, pe = /\\\\,/g, ge = /\\\\./g;
445
- function tt(s) {
444
+ }, Ft = "\\0SLASH" + Math.random() + "\\0", Mt = "\\0OPEN" + Math.random() + "\\0", at = "\\0CLOSE" + Math.random() + "\\0", Tt = "\\0COMMA" + Math.random() + "\\0", Pt = "\\0PERIOD" + Math.random() + "\\0", oe = new RegExp(Ft, "g"), ae = new RegExp(Mt, "g"), ce = new RegExp(at, "g"), le = new RegExp(Tt, "g"), he = new RegExp(Pt, "g"), ue = /\\\\\\\\/g, fe = /\\\\{/g, de = /\\\\}/g, pe = /\\\\,/g, ge = /\\\\./g;
445
+ function K(s) {
446
446
  return isNaN(s) ? s.charCodeAt(0) : parseInt(s, 10);
447
447
  }
448
448
  function we(s) {
449
- return s.replace(ue, $t).replace(fe, Mt).replace(de, at).replace(pe, Pt).replace(ge, Tt);
449
+ return s.replace(ue, Ft).replace(fe, Mt).replace(de, at).replace(pe, Tt).replace(ge, Pt);
450
450
  }
451
- function me(s) {
451
+ function ye(s) {
452
452
  return s.replace(oe, "\\\\").replace(ae, "{").replace(ce, "}").replace(le, ",").replace(he, ".");
453
453
  }
454
454
  function Rt(s) {
455
455
  if (!s)
456
456
  return [""];
457
- const t = [], e = Ft("{", "}", s);
457
+ const t = [], e = $t("{", "}", s);
458
458
  if (!e)
459
459
  return s.split(",");
460
460
  const { pre: n, body: r, post: i } = e, o = n.split(",");
@@ -462,8 +462,8 @@ function Rt(s) {
462
462
  const a = Rt(i);
463
463
  return i.length && (o[o.length - 1] += a.shift(), o.push.apply(o, a)), t.push.apply(t, o), t;
464
464
  }
465
- function ye(s) {
466
- return s ? (s.slice(0, 2) === "{}" && (s = "\\\\{\\\\}" + s.slice(2)), I(we(s), !0).map(me)) : [];
465
+ function me(s) {
466
+ return s ? (s.slice(0, 2) === "{}" && (s = "\\\\{\\\\}" + s.slice(2)), R(we(s), !0).map(ye)) : [];
467
467
  }
468
468
  function Ee(s) {
469
469
  return "{" + s + "}";
@@ -477,59 +477,59 @@ function xe(s, t) {
477
477
  function be(s, t) {
478
478
  return s >= t;
479
479
  }
480
- function I(s, t) {
481
- const e = [], n = Ft("{", "}", s);
480
+ function R(s, t) {
481
+ const e = [], n = $t("{", "}", s);
482
482
  if (!n)
483
483
  return [s];
484
- const r = n.pre, i = n.post.length ? I(n.post, !1) : [""];
484
+ const r = n.pre, i = n.post.length ? R(n.post, !1) : [""];
485
485
  if (/\\$$/.test(n.pre))
486
486
  for (let o = 0; o < i.length; o++) {
487
487
  const a = r + "{" + n.body + "}" + i[o];
488
488
  e.push(a);
489
489
  }
490
490
  else {
491
- 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;
492
- if (!l && !h)
493
- return n.post.match(/,(?!,).*\\}/) ? (s = n.pre + "{" + n.body + at + n.post, I(s)) : [s];
494
- let c;
495
- if (l)
496
- c = n.body.split(/\\.\\./);
497
- else if (c = Rt(n.body), c.length === 1 && c[0] !== void 0 && (c = I(c[0], !1).map(Ee), c.length === 1))
498
- return i.map((u) => n.pre + c[0] + u);
491
+ const o = /^-?\\d+\\.\\.-?\\d+(?:\\.\\.-?\\d+)?$/.test(n.body), a = /^[a-zA-Z]\\.\\.[a-zA-Z](?:\\.\\.-?\\d+)?$/.test(n.body), c = o || a, h = n.body.indexOf(",") >= 0;
492
+ if (!c && !h)
493
+ return n.post.match(/,(?!,).*\\}/) ? (s = n.pre + "{" + n.body + at + n.post, R(s)) : [s];
494
+ let l;
495
+ if (c)
496
+ l = n.body.split(/\\.\\./);
497
+ else if (l = Rt(n.body), l.length === 1 && l[0] !== void 0 && (l = R(l[0], !1).map(Ee), l.length === 1))
498
+ return i.map((u) => n.pre + l[0] + u);
499
499
  let f;
500
- if (l && c[0] !== void 0 && c[1] !== void 0) {
501
- const u = tt(c[0]), d = tt(c[1]), g = Math.max(c[0].length, c[1].length);
502
- let p = c.length === 3 && c[2] !== void 0 ? Math.abs(tt(c[2])) : 1, S = xe;
500
+ if (c && l[0] !== void 0 && l[1] !== void 0) {
501
+ const u = K(l[0]), d = K(l[1]), g = Math.max(l[0].length, l[1].length);
502
+ let p = l.length === 3 && l[2] !== void 0 ? Math.abs(K(l[2])) : 1, S = xe;
503
503
  d < u && (p *= -1, S = be);
504
- const P = c.some(Se);
504
+ const M = l.some(Se);
505
505
  f = [];
506
506
  for (let x = u; S(x, d); x += p) {
507
- let m;
507
+ let y;
508
508
  if (a)
509
- m = String.fromCharCode(x), m === "\\\\" && (m = "");
510
- else if (m = String(x), P) {
511
- const T = g - m.length;
509
+ y = String.fromCharCode(x), y === "\\\\" && (y = "");
510
+ else if (y = String(x), M) {
511
+ const T = g - y.length;
512
512
  if (T > 0) {
513
513
  const H = new Array(T + 1).join("0");
514
- x < 0 ? m = "-" + H + m.slice(1) : m = H + m;
514
+ x < 0 ? y = "-" + H + y.slice(1) : y = H + y;
515
515
  }
516
516
  }
517
- f.push(m);
517
+ f.push(y);
518
518
  }
519
519
  } else {
520
520
  f = [];
521
- for (let u = 0; u < c.length; u++)
522
- f.push.apply(f, I(c[u], !1));
521
+ for (let u = 0; u < l.length; u++)
522
+ f.push.apply(f, R(l[u], !1));
523
523
  }
524
524
  for (let u = 0; u < f.length; u++)
525
525
  for (let d = 0; d < i.length; d++) {
526
526
  const g = r + f[u] + i[d];
527
- (!t || l || g) && e.push(g);
527
+ (!t || c || g) && e.push(g);
528
528
  }
529
529
  }
530
530
  return e;
531
531
  }
532
- const Oe = 1024 * 64, Z = (s) => {
532
+ const Oe = 1024 * 64, Y = (s) => {
533
533
  if (typeof s != "string")
534
534
  throw new TypeError("invalid pattern");
535
535
  if (s.length > Oe)
@@ -549,60 +549,60 @@ const Oe = 1024 * 64, Z = (s) => {
549
549
  "[:upper:]": ["\\\\p{Lu}", !0],
550
550
  "[:word:]": ["\\\\p{L}\\\\p{Nl}\\\\p{Nd}\\\\p{Pc}", !0],
551
551
  "[:xdigit:]": ["A-Fa-f0-9", !1]
552
- }, R = (s) => s.replace(/[[\\]\\\\-]/g, "\\\\$&"), ve = (s) => s.replace(/[-[\\]{}()*+?.,\\\\^$|#\\s]/g, "\\\\$&"), dt = (s) => s.join(""), Ae = (s, t) => {
552
+ }, P = (s) => s.replace(/[[\\]\\\\-]/g, "\\\\$&"), Ae = (s) => s.replace(/[-[\\]{}()*+?.,\\\\^$|#\\s]/g, "\\\\$&"), dt = (s) => s.join(""), ve = (s, t) => {
553
553
  const e = t;
554
554
  if (s.charAt(e) !== "[")
555
555
  throw new Error("not in a brace expression");
556
556
  const n = [], r = [];
557
- let i = e + 1, o = !1, a = !1, l = !1, h = !1, c = e, f = "";
557
+ let i = e + 1, o = !1, a = !1, c = !1, h = !1, l = e, f = "";
558
558
  t: for (; i < s.length; ) {
559
559
  const p = s.charAt(i);
560
560
  if ((p === "!" || p === "^") && i === e + 1) {
561
561
  h = !0, i++;
562
562
  continue;
563
563
  }
564
- if (p === "]" && o && !l) {
565
- c = i + 1;
564
+ if (p === "]" && o && !c) {
565
+ l = i + 1;
566
566
  break;
567
567
  }
568
- if (o = !0, p === "\\\\" && !l) {
569
- l = !0, i++;
568
+ if (o = !0, p === "\\\\" && !c) {
569
+ c = !0, i++;
570
570
  continue;
571
571
  }
572
- if (p === "[" && !l) {
573
- for (const [S, [v, P, x]] of Object.entries(De))
572
+ if (p === "[" && !c) {
573
+ for (const [S, [v, M, x]] of Object.entries(De))
574
574
  if (s.startsWith(S, i)) {
575
575
  if (f)
576
576
  return ["$.", !1, s.length - e, !0];
577
- i += S.length, x ? r.push(v) : n.push(v), a = a || P;
577
+ i += S.length, x ? r.push(v) : n.push(v), a = a || M;
578
578
  continue t;
579
579
  }
580
580
  }
581
- if (l = !1, f) {
582
- p > f ? n.push(R(f) + "-" + R(p)) : p === f && n.push(R(p)), f = "", i++;
581
+ if (c = !1, f) {
582
+ p > f ? n.push(P(f) + "-" + P(p)) : p === f && n.push(P(p)), f = "", i++;
583
583
  continue;
584
584
  }
585
585
  if (s.startsWith("-]", i + 1)) {
586
- n.push(R(p + "-")), i += 2;
586
+ n.push(P(p + "-")), i += 2;
587
587
  continue;
588
588
  }
589
589
  if (s.startsWith("-", i + 1)) {
590
590
  f = p, i += 2;
591
591
  continue;
592
592
  }
593
- n.push(R(p)), i++;
593
+ n.push(P(p)), i++;
594
594
  }
595
- if (c < i)
595
+ if (l < i)
596
596
  return ["", !1, 0, !1];
597
597
  if (!n.length && !r.length)
598
598
  return ["$.", !1, s.length - e, !0];
599
599
  if (r.length === 0 && n.length === 1 && /^\\\\?.$/.test(n[0]) && !h) {
600
600
  const p = n[0].length === 2 ? n[0].slice(-1) : n[0];
601
- return [ve(p), !1, c - e, !1];
601
+ return [Ae(p), !1, l - e, !1];
602
602
  }
603
603
  const u = "[" + (h ? "^" : "") + dt(n) + "]", d = "[" + (h ? "" : "^") + dt(r) + "]";
604
- return [n.length && r.length ? "(" + u + "|" + d + ")" : n.length ? u : d, a, c - e, !0];
605
- }, k = (s, { windowsPathsNoEscape: t = !1 } = {}) => t ? s.replace(/\\[([^\\/\\\\])\\]/g, "$1") : s.replace(/((?!\\\\).|^)\\[([^\\/\\\\])\\]/g, "$1$2").replace(/\\\\([^\\/])/g, "$1"), Ne = /* @__PURE__ */ new Set(["!", "?", "+", "*", "@"]), pt = (s) => Ne.has(s), Ce = "(?!(?:^|/)\\\\.\\\\.?(?:$|/))", _ = "(?!\\\\.)", Fe = /* @__PURE__ */ new Set(["[", "."]), $e = /* @__PURE__ */ new Set(["..", "."]), Me = new Set("().*{}+?[]^$\\\\!"), Pe = (s) => s.replace(/[-[\\]{}()*+?.,\\\\^$|#\\s]/g, "\\\\$&"), ct = "[^/]", gt = ct + "*?", wt = ct + "+?";
604
+ return [n.length && r.length ? "(" + u + "|" + d + ")" : n.length ? u : d, a, l - e, !0];
605
+ }, k = (s, { windowsPathsNoEscape: t = !1 } = {}) => t ? s.replace(/\\[([^\\/\\\\])\\]/g, "$1") : s.replace(/((?!\\\\).|^)\\[([^\\/\\\\])\\]/g, "$1$2").replace(/\\\\([^\\/])/g, "$1"), Ne = /* @__PURE__ */ new Set(["!", "?", "+", "*", "@"]), pt = (s) => Ne.has(s), Ce = "(?!(?:^|/)\\\\.\\\\.?(?:$|/))", W = "(?!\\\\.)", $e = /* @__PURE__ */ new Set(["[", "."]), Fe = /* @__PURE__ */ new Set(["..", "."]), Me = new Set("().*{}+?[]^$\\\\!"), Te = (s) => s.replace(/[-[\\]{}()*+?.,\\\\^$|#\\s]/g, "\\\\$&"), ct = "[^/]", gt = ct + "*?", wt = ct + "+?";
606
606
  class E {
607
607
  type;
608
608
  #s;
@@ -703,7 +703,7 @@ class E {
703
703
  return e;
704
704
  }
705
705
  static #h(t, e, n, r) {
706
- let i = !1, o = !1, a = -1, l = !1;
706
+ let i = !1, o = !1, a = -1, c = !1;
707
707
  if (e.type === null) {
708
708
  let d = n, g = "";
709
709
  for (; d < t.length; ) {
@@ -713,10 +713,10 @@ class E {
713
713
  continue;
714
714
  }
715
715
  if (o) {
716
- d === a + 1 ? (p === "^" || p === "!") && (l = !0) : p === "]" && !(d === a + 2 && l) && (o = !1), g += p;
716
+ d === a + 1 ? (p === "^" || p === "!") && (c = !0) : p === "]" && !(d === a + 2 && c) && (o = !1), g += p;
717
717
  continue;
718
718
  } else if (p === "[") {
719
- o = !0, a = d, l = !1, g += p;
719
+ o = !0, a = d, c = !1, g += p;
720
720
  continue;
721
721
  }
722
722
  if (!r.noext && pt(p) && t.charAt(d) === "(") {
@@ -729,7 +729,7 @@ class E {
729
729
  }
730
730
  return e.push(g), d;
731
731
  }
732
- let h = n + 1, c = new E(null, e);
732
+ let h = n + 1, l = new E(null, e);
733
733
  const f = [];
734
734
  let u = "";
735
735
  for (; h < t.length; ) {
@@ -739,24 +739,24 @@ class E {
739
739
  continue;
740
740
  }
741
741
  if (o) {
742
- h === a + 1 ? (d === "^" || d === "!") && (l = !0) : d === "]" && !(h === a + 2 && l) && (o = !1), u += d;
742
+ h === a + 1 ? (d === "^" || d === "!") && (c = !0) : d === "]" && !(h === a + 2 && c) && (o = !1), u += d;
743
743
  continue;
744
744
  } else if (d === "[") {
745
- o = !0, a = h, l = !1, u += d;
745
+ o = !0, a = h, c = !1, u += d;
746
746
  continue;
747
747
  }
748
748
  if (pt(d) && t.charAt(h) === "(") {
749
- c.push(u), u = "";
750
- const g = new E(d, c);
751
- c.push(g), h = E.#h(t, g, h, r);
749
+ l.push(u), u = "";
750
+ const g = new E(d, l);
751
+ l.push(g), h = E.#h(t, g, h, r);
752
752
  continue;
753
753
  }
754
754
  if (d === "|") {
755
- c.push(u), u = "", f.push(c), c = new E(null, e);
755
+ l.push(u), u = "", f.push(l), l = new E(null, e);
756
756
  continue;
757
757
  }
758
758
  if (d === ")")
759
- return u === "" && e.#t.length === 0 && (e.#u = !0), c.push(u), u = "", e.push(...f, c), h;
759
+ return u === "" && e.#t.length === 0 && (e.#u = !0), l.push(u), u = "", e.push(...f, l), h;
760
760
  u += d;
761
761
  }
762
762
  return e.type = null, e.#n = void 0, e.#t = [t.substring(n - 1)], h;
@@ -854,23 +854,23 @@ class E {
854
854
  toRegExpSource(t) {
855
855
  const e = t ?? !!this.#r.dot;
856
856
  if (this.#s === this && this.#d(), !this.type) {
857
- const l = this.isStart() && this.isEnd(), h = this.#t.map((d) => {
858
- const [g, p, S, v] = typeof d == "string" ? E.#p(d, this.#n, l) : d.toRegExpSource(t);
857
+ const c = this.isStart() && this.isEnd(), h = this.#t.map((d) => {
858
+ const [g, p, S, v] = typeof d == "string" ? E.#p(d, this.#n, c) : d.toRegExpSource(t);
859
859
  return this.#n = this.#n || S, this.#i = this.#i || v, g;
860
860
  }).join("");
861
- let c = "";
862
- if (this.isStart() && typeof this.#t[0] == "string" && !(this.#t.length === 1 && $e.has(this.#t[0]))) {
863
- const g = Fe, p = (
861
+ let l = "";
862
+ if (this.isStart() && typeof this.#t[0] == "string" && !(this.#t.length === 1 && Fe.has(this.#t[0]))) {
863
+ const g = $e, p = (
864
864
  // dots are allowed, and the pattern starts with [ or .
865
865
  e && g.has(h.charAt(0)) || // the pattern starts with \\., and then [ or .
866
866
  h.startsWith("\\\\.") && g.has(h.charAt(2)) || // the pattern starts with \\.\\., and then [ or .
867
867
  h.startsWith("\\\\.\\\\.") && g.has(h.charAt(4))
868
868
  ), S = !e && !t && g.has(h.charAt(0));
869
- c = p ? Ce : S ? _ : "";
869
+ l = p ? Ce : S ? W : "";
870
870
  }
871
871
  let f = "";
872
872
  return this.isEnd() && this.#s.#a && this.#e?.type === "!" && (f = "(?:$|\\\\/)"), [
873
- c + h + f,
873
+ l + h + f,
874
874
  k(h),
875
875
  this.#n = !!this.#n,
876
876
  this.#i
@@ -879,20 +879,20 @@ class E {
879
879
  const n = this.type === "*" || this.type === "+", r = this.type === "!" ? "(?:(?!(?:" : "(?:";
880
880
  let i = this.#f(e);
881
881
  if (this.isStart() && this.isEnd() && !i && this.type !== "!") {
882
- const l = this.toString();
883
- return this.#t = [l], this.type = null, this.#n = void 0, [l, k(this.toString()), !1, !1];
882
+ const c = this.toString();
883
+ return this.#t = [c], this.type = null, this.#n = void 0, [c, k(this.toString()), !1, !1];
884
884
  }
885
- let o = !n || t || e || !_ ? "" : this.#f(!0);
885
+ let o = !n || t || e || !W ? "" : this.#f(!0);
886
886
  o === i && (o = ""), o && (i = \`(?:\${i})(?:\${o})*?\`);
887
887
  let a = "";
888
888
  if (this.type === "!" && this.#u)
889
- a = (this.isStart() && !e ? _ : "") + wt;
889
+ a = (this.isStart() && !e ? W : "") + wt;
890
890
  else {
891
- const l = this.type === "!" ? (
891
+ const c = this.type === "!" ? (
892
892
  // !() must match something,but !(x) can match ''
893
- "))" + (this.isStart() && !e && !t ? _ : "") + gt + ")"
893
+ "))" + (this.isStart() && !e && !t ? W : "") + gt + ")"
894
894
  ) : this.type === "@" ? ")" : this.type === "?" ? ")?" : this.type === "+" && o ? ")" : this.type === "*" && o ? ")?" : \`)\${this.type}\`;
895
- a = r + i + l;
895
+ a = r + i + c;
896
896
  }
897
897
  return [
898
898
  a,
@@ -912,66 +912,66 @@ class E {
912
912
  static #p(t, e, n = !1) {
913
913
  let r = !1, i = "", o = !1;
914
914
  for (let a = 0; a < t.length; a++) {
915
- const l = t.charAt(a);
915
+ const c = t.charAt(a);
916
916
  if (r) {
917
- r = !1, i += (Me.has(l) ? "\\\\" : "") + l;
917
+ r = !1, i += (Me.has(c) ? "\\\\" : "") + c;
918
918
  continue;
919
919
  }
920
- if (l === "\\\\") {
920
+ if (c === "\\\\") {
921
921
  a === t.length - 1 ? i += "\\\\\\\\" : r = !0;
922
922
  continue;
923
923
  }
924
- if (l === "[") {
925
- const [h, c, f, u] = Ae(t, a);
924
+ if (c === "[") {
925
+ const [h, l, f, u] = ve(t, a);
926
926
  if (f) {
927
- i += h, o = o || c, a += f - 1, e = e || u;
927
+ i += h, o = o || l, a += f - 1, e = e || u;
928
928
  continue;
929
929
  }
930
930
  }
931
- if (l === "*") {
931
+ if (c === "*") {
932
932
  n && t === "*" ? i += wt : i += gt, e = !0;
933
933
  continue;
934
934
  }
935
- if (l === "?") {
935
+ if (c === "?") {
936
936
  i += ct, e = !0;
937
937
  continue;
938
938
  }
939
- i += Pe(l);
939
+ i += Te(c);
940
940
  }
941
941
  return [i, k(t), !!e, o];
942
942
  }
943
943
  }
944
- const Te = (s, { windowsPathsNoEscape: t = !1 } = {}) => t ? s.replace(/[?*()[\\]]/g, "[$&]") : s.replace(/[?*()[\\]\\\\]/g, "\\\\$&"), y = (s, t, e = {}) => (Z(t), !e.nocomment && t.charAt(0) === "#" ? !1 : new X(t, e).match(s)), Re = /^\\*+([^+@!?\\*\\[\\(]*)$/, Ie = (s) => (t) => !t.startsWith(".") && t.endsWith(s), ke = (s) => (t) => t.endsWith(s), Le = (s) => (s = s.toLowerCase(), (t) => !t.startsWith(".") && t.toLowerCase().endsWith(s)), ze = (s) => (s = s.toLowerCase(), (t) => t.toLowerCase().endsWith(s)), He = /^\\*+\\.\\*+$/, We = (s) => !s.startsWith(".") && s.includes("."), je = (s) => s !== "." && s !== ".." && s.includes("."), _e = /^\\.\\*+$/, Ue = (s) => s !== "." && s !== ".." && s.startsWith("."), Be = /^\\*+$/, Ge = (s) => s.length !== 0 && !s.startsWith("."), qe = (s) => s.length !== 0 && s !== "." && s !== "..", Ve = /^\\?+([^+@!?\\*\\[\\(]*)?$/, Ye = ([s, t = ""]) => {
945
- const e = It([s]);
944
+ const Pe = (s, { windowsPathsNoEscape: t = !1 } = {}) => t ? s.replace(/[?*()[\\]]/g, "[$&]") : s.replace(/[?*()[\\]\\\\]/g, "\\\\$&"), m = (s, t, e = {}) => (Y(t), !e.nocomment && t.charAt(0) === "#" ? !1 : new Z(t, e).match(s)), Re = /^\\*+([^+@!?\\*\\[\\(]*)$/, ke = (s) => (t) => !t.startsWith(".") && t.endsWith(s), Ie = (s) => (t) => t.endsWith(s), He = (s) => (s = s.toLowerCase(), (t) => !t.startsWith(".") && t.toLowerCase().endsWith(s)), Le = (s) => (s = s.toLowerCase(), (t) => t.toLowerCase().endsWith(s)), ze = /^\\*+\\.\\*+$/, We = (s) => !s.startsWith(".") && s.includes("."), je = (s) => s !== "." && s !== ".." && s.includes("."), _e = /^\\.\\*+$/, Ue = (s) => s !== "." && s !== ".." && s.startsWith("."), Be = /^\\*+$/, Ge = (s) => s.length !== 0 && !s.startsWith("."), qe = (s) => s.length !== 0 && s !== "." && s !== "..", Ve = /^\\?+([^+@!?\\*\\[\\(]*)?$/, Ye = ([s, t = ""]) => {
945
+ const e = kt([s]);
946
946
  return t ? (t = t.toLowerCase(), (n) => e(n) && n.toLowerCase().endsWith(t)) : e;
947
947
  }, Ze = ([s, t = ""]) => {
948
- const e = kt([s]);
948
+ const e = It([s]);
949
949
  return t ? (t = t.toLowerCase(), (n) => e(n) && n.toLowerCase().endsWith(t)) : e;
950
950
  }, Xe = ([s, t = ""]) => {
951
- const e = kt([s]);
951
+ const e = It([s]);
952
952
  return t ? (n) => e(n) && n.endsWith(t) : e;
953
953
  }, Je = ([s, t = ""]) => {
954
- const e = It([s]);
954
+ const e = kt([s]);
955
955
  return t ? (n) => e(n) && n.endsWith(t) : e;
956
- }, It = ([s]) => {
956
+ }, kt = ([s]) => {
957
957
  const t = s.length;
958
958
  return (e) => e.length === t && !e.startsWith(".");
959
- }, kt = ([s]) => {
959
+ }, It = ([s]) => {
960
960
  const t = s.length;
961
961
  return (e) => e.length === t && e !== "." && e !== "..";
962
- }, Lt = typeof process == "object" && process ? typeof process.env == "object" && process.env && process.env.__MINIMATCH_TESTING_PLATFORM__ || process.platform : "posix", mt = {
962
+ }, Ht = typeof process == "object" && process ? typeof process.env == "object" && process.env && process.env.__MINIMATCH_TESTING_PLATFORM__ || process.platform : "posix", yt = {
963
963
  win32: { sep: "\\\\" },
964
964
  posix: { sep: "/" }
965
- }, Qe = Lt === "win32" ? mt.win32.sep : mt.posix.sep;
966
- y.sep = Qe;
967
- const O = Symbol("globstar **");
968
- y.GLOBSTAR = O;
969
- const Ke = "[^/]", ts = Ke + "*?", es = "(?:(?!(?:\\\\/|^)(?:\\\\.{1,2})($|\\\\/)).)*?", ss = "(?:(?!(?:\\\\/|^)\\\\.).)*?", ns = (s, t = {}) => (e) => y(e, s, t);
970
- y.filter = ns;
965
+ }, Qe = Ht === "win32" ? yt.win32.sep : yt.posix.sep;
966
+ m.sep = Qe;
967
+ const D = Symbol("globstar **");
968
+ m.GLOBSTAR = D;
969
+ const Ke = "[^/]", ts = Ke + "*?", es = "(?:(?!(?:\\\\/|^)(?:\\\\.{1,2})($|\\\\/)).)*?", ss = "(?:(?!(?:\\\\/|^)\\\\.).)*?", ns = (s, t = {}) => (e) => m(e, s, t);
970
+ m.filter = ns;
971
971
  const b = (s, t = {}) => Object.assign({}, s, t), rs = (s) => {
972
972
  if (!s || typeof s != "object" || !Object.keys(s).length)
973
- return y;
974
- const t = y;
973
+ return m;
974
+ const t = m;
975
975
  return Object.assign((n, r, i = {}) => t(n, r, b(s, i)), {
976
976
  Minimatch: class extends t.Minimatch {
977
977
  constructor(r, i = {}) {
@@ -999,21 +999,21 @@ const b = (s, t = {}) => Object.assign({}, s, t), rs = (s) => {
999
999
  braceExpand: (n, r = {}) => t.braceExpand(n, b(s, r)),
1000
1000
  match: (n, r, i = {}) => t.match(n, r, b(s, i)),
1001
1001
  sep: t.sep,
1002
- GLOBSTAR: O
1002
+ GLOBSTAR: D
1003
1003
  });
1004
1004
  };
1005
- y.defaults = rs;
1006
- const zt = (s, t = {}) => (Z(s), t.nobrace || !/\\{(?:(?!\\{).)*\\}/.test(s) ? [s] : ye(s));
1007
- y.braceExpand = zt;
1008
- const is = (s, t = {}) => new X(s, t).makeRe();
1009
- y.makeRe = is;
1005
+ m.defaults = rs;
1006
+ const Lt = (s, t = {}) => (Y(s), t.nobrace || !/\\{(?:(?!\\{).)*\\}/.test(s) ? [s] : me(s));
1007
+ m.braceExpand = Lt;
1008
+ const is = (s, t = {}) => new Z(s, t).makeRe();
1009
+ m.makeRe = is;
1010
1010
  const os = (s, t, e = {}) => {
1011
- const n = new X(t, e);
1011
+ const n = new Z(t, e);
1012
1012
  return s = s.filter((r) => n.match(r)), n.options.nonull && !s.length && s.push(t), s;
1013
1013
  };
1014
- y.match = os;
1015
- const yt = /[?*]|[+@!]\\(.*?\\)|\\[|\\]/, as = (s) => s.replace(/[-[\\]{}()*+?.,\\\\^$|#\\s]/g, "\\\\$&");
1016
- class X {
1014
+ m.match = os;
1015
+ const mt = /[?*]|[+@!]\\(.*?\\)|\\[|\\]/, as = (s) => s.replace(/[-[\\]{}()*+?.,\\\\^$|#\\s]/g, "\\\\$&");
1016
+ class Z {
1017
1017
  options;
1018
1018
  set;
1019
1019
  pattern;
@@ -1032,7 +1032,7 @@ class X {
1032
1032
  windowsNoMagicRoot;
1033
1033
  regexp;
1034
1034
  constructor(t, e = {}) {
1035
- Z(t), e = e || {}, this.options = e, this.pattern = t, this.platform = e.platform || Lt, 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();
1035
+ Y(t), e = e || {}, this.options = e, this.pattern = t, this.platform = e.platform || Ht, 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();
1036
1036
  }
1037
1037
  hasMagic() {
1038
1038
  if (this.options.magicalBraces && this.set.length > 1)
@@ -1060,13 +1060,13 @@ class X {
1060
1060
  this.globParts = this.preprocess(n), this.debug(this.pattern, this.globParts);
1061
1061
  let r = this.globParts.map((i, o, a) => {
1062
1062
  if (this.isWindows && this.windowsNoMagicRoot) {
1063
- const l = i[0] === "" && i[1] === "" && (i[2] === "?" || !yt.test(i[2])) && !yt.test(i[3]), h = /^[a-z]:/i.test(i[0]);
1064
- if (l)
1065
- return [...i.slice(0, 4), ...i.slice(4).map((c) => this.parse(c))];
1063
+ const c = i[0] === "" && i[1] === "" && (i[2] === "?" || !mt.test(i[2])) && !mt.test(i[3]), h = /^[a-z]:/i.test(i[0]);
1064
+ if (c)
1065
+ return [...i.slice(0, 4), ...i.slice(4).map((l) => this.parse(l))];
1066
1066
  if (h)
1067
- return [i[0], ...i.slice(1).map((c) => this.parse(c))];
1067
+ return [i[0], ...i.slice(1).map((l) => this.parse(l))];
1068
1068
  }
1069
- return i.map((l) => this.parse(l));
1069
+ return i.map((c) => this.parse(c));
1070
1070
  });
1071
1071
  if (this.debug(this.pattern, r), this.set = r.filter((i) => i.indexOf(!1) === -1), this.isWindows)
1072
1072
  for (let i = 0; i < this.set.length; i++) {
@@ -1157,12 +1157,12 @@ class X {
1157
1157
  o++;
1158
1158
  o > r && n.splice(r + 1, o - r);
1159
1159
  let a = n[r + 1];
1160
- const l = n[r + 2], h = n[r + 3];
1161
- if (a !== ".." || !l || l === "." || l === ".." || !h || h === "." || h === "..")
1160
+ const c = n[r + 2], h = n[r + 3];
1161
+ if (a !== ".." || !c || c === "." || c === ".." || !h || h === "." || h === "..")
1162
1162
  continue;
1163
1163
  e = !0, n.splice(r, 1);
1164
- const c = n.slice(0);
1165
- c[r] = "**", t.push(c), r--;
1164
+ const l = n.slice(0);
1165
+ l[r] = "**", t.push(l), r--;
1166
1166
  }
1167
1167
  if (!this.preserveMultipleSlashes) {
1168
1168
  for (let o = 1; o < n.length - 1; o++) {
@@ -1176,8 +1176,8 @@ class X {
1176
1176
  const o = n[i - 1];
1177
1177
  if (o && o !== "." && o !== ".." && o !== "**") {
1178
1178
  e = !0;
1179
- const l = i === 1 && n[i + 1] === "**" ? ["."] : [];
1180
- n.splice(i - 1, 2, ...l), n.length === 0 && n.push(""), i -= 2;
1179
+ const c = i === 1 && n[i + 1] === "**" ? ["."] : [];
1180
+ n.splice(i - 1, 2, ...c), n.length === 0 && n.push(""), i -= 2;
1181
1181
  }
1182
1182
  }
1183
1183
  }
@@ -1240,33 +1240,33 @@ class X {
1240
1240
  matchOne(t, e, n = !1) {
1241
1241
  const r = this.options;
1242
1242
  if (this.isWindows) {
1243
- const p = typeof t[0] == "string" && /^[a-z]:$/i.test(t[0]), S = !p && t[0] === "" && t[1] === "" && t[2] === "?" && /^[a-z]:$/i.test(t[3]), v = typeof e[0] == "string" && /^[a-z]:$/i.test(e[0]), P = !v && e[0] === "" && e[1] === "" && e[2] === "?" && typeof e[3] == "string" && /^[a-z]:$/i.test(e[3]), x = S ? 3 : p ? 0 : void 0, m = P ? 3 : v ? 0 : void 0;
1244
- if (typeof x == "number" && typeof m == "number") {
1245
- const [T, H] = [t[x], e[m]];
1246
- T.toLowerCase() === H.toLowerCase() && (e[m] = T, m > x ? e = e.slice(m) : x > m && (t = t.slice(x)));
1243
+ const p = typeof t[0] == "string" && /^[a-z]:$/i.test(t[0]), S = !p && t[0] === "" && t[1] === "" && t[2] === "?" && /^[a-z]:$/i.test(t[3]), v = typeof e[0] == "string" && /^[a-z]:$/i.test(e[0]), M = !v && e[0] === "" && e[1] === "" && e[2] === "?" && typeof e[3] == "string" && /^[a-z]:$/i.test(e[3]), x = S ? 3 : p ? 0 : void 0, y = M ? 3 : v ? 0 : void 0;
1244
+ if (typeof x == "number" && typeof y == "number") {
1245
+ const [T, H] = [t[x], e[y]];
1246
+ T.toLowerCase() === H.toLowerCase() && (e[y] = T, y > x ? e = e.slice(y) : x > y && (t = t.slice(x)));
1247
1247
  }
1248
1248
  }
1249
1249
  const { optimizationLevel: i = 1 } = this.options;
1250
1250
  i >= 2 && (t = this.levelTwoFileOptimize(t)), this.debug("matchOne", this, { file: t, pattern: e }), this.debug("matchOne", t.length, e.length);
1251
- for (var o = 0, a = 0, l = t.length, h = e.length; o < l && a < h; o++, a++) {
1251
+ for (var o = 0, a = 0, c = t.length, h = e.length; o < c && a < h; o++, a++) {
1252
1252
  this.debug("matchOne loop");
1253
- var c = e[a], f = t[o];
1254
- if (this.debug(e, c, f), c === !1)
1253
+ var l = e[a], f = t[o];
1254
+ if (this.debug(e, l, f), l === !1)
1255
1255
  return !1;
1256
- if (c === O) {
1257
- this.debug("GLOBSTAR", [e, c, f]);
1256
+ if (l === D) {
1257
+ this.debug("GLOBSTAR", [e, l, f]);
1258
1258
  var u = o, d = a + 1;
1259
1259
  if (d === h) {
1260
- for (this.debug("** at the end"); o < l; o++)
1260
+ for (this.debug("** at the end"); o < c; o++)
1261
1261
  if (t[o] === "." || t[o] === ".." || !r.dot && t[o].charAt(0) === ".")
1262
1262
  return !1;
1263
1263
  return !0;
1264
1264
  }
1265
- for (; u < l; ) {
1265
+ for (; u < c; ) {
1266
1266
  var g = t[u];
1267
1267
  if (this.debug(\`
1268
1268
  globstar while\`, t, u, e, d, g), this.matchOne(t.slice(u), e.slice(d), n))
1269
- return this.debug("globstar found match!", u, l, g), !0;
1269
+ return this.debug("globstar found match!", u, c, g), !0;
1270
1270
  if (g === "." || g === ".." || !r.dot && g.charAt(0) === ".") {
1271
1271
  this.debug("dot detected!", t, u, e, d);
1272
1272
  break;
@@ -1274,32 +1274,32 @@ globstar while\`, t, u, e, d, g), this.matchOne(t.slice(u), e.slice(d), n))
1274
1274
  this.debug("globstar swallow a segment, and continue"), u++;
1275
1275
  }
1276
1276
  return !!(n && (this.debug(\`
1277
- >>> no match, partial?\`, t, u, e, d), u === l));
1277
+ >>> no match, partial?\`, t, u, e, d), u === c));
1278
1278
  }
1279
1279
  let p;
1280
- if (typeof c == "string" ? (p = f === c, this.debug("string match", c, f, p)) : (p = c.test(f), this.debug("pattern match", c, f, p)), !p)
1280
+ if (typeof l == "string" ? (p = f === l, this.debug("string match", l, f, p)) : (p = l.test(f), this.debug("pattern match", l, f, p)), !p)
1281
1281
  return !1;
1282
1282
  }
1283
- if (o === l && a === h)
1283
+ if (o === c && a === h)
1284
1284
  return !0;
1285
- if (o === l)
1285
+ if (o === c)
1286
1286
  return n;
1287
1287
  if (a === h)
1288
- return o === l - 1 && t[o] === "";
1288
+ return o === c - 1 && t[o] === "";
1289
1289
  throw new Error("wtf?");
1290
1290
  }
1291
1291
  braceExpand() {
1292
- return zt(this.pattern, this.options);
1292
+ return Lt(this.pattern, this.options);
1293
1293
  }
1294
1294
  parse(t) {
1295
- Z(t);
1295
+ Y(t);
1296
1296
  const e = this.options;
1297
1297
  if (t === "**")
1298
- return O;
1298
+ return D;
1299
1299
  if (t === "")
1300
1300
  return "";
1301
1301
  let n, r = null;
1302
- (n = t.match(Be)) ? r = e.dot ? qe : Ge : (n = t.match(Re)) ? r = (e.nocase ? e.dot ? ze : Le : e.dot ? ke : Ie)(n[1]) : (n = t.match(Ve)) ? r = (e.nocase ? e.dot ? Ze : Ye : e.dot ? Xe : Je)(n) : (n = t.match(He)) ? r = e.dot ? je : We : (n = t.match(_e)) && (r = Ue);
1302
+ (n = t.match(Be)) ? r = e.dot ? qe : Ge : (n = t.match(Re)) ? r = (e.nocase ? e.dot ? Le : He : e.dot ? Ie : ke)(n[1]) : (n = t.match(Ve)) ? r = (e.nocase ? e.dot ? Ze : Ye : e.dot ? Xe : Je)(n) : (n = t.match(ze)) ? r = e.dot ? je : We : (n = t.match(_e)) && (r = Ue);
1303
1303
  const i = E.fromGlob(t, this.options).toMMPattern();
1304
1304
  return r && typeof i == "object" && Reflect.defineProperty(i, "test", { value: r }), i;
1305
1305
  }
@@ -1310,17 +1310,17 @@ globstar while\`, t, u, e, d, g), this.matchOne(t.slice(u), e.slice(d), n))
1310
1310
  if (!t.length)
1311
1311
  return this.regexp = !1, this.regexp;
1312
1312
  const e = this.options, n = e.noglobstar ? ts : e.dot ? es : ss, r = new Set(e.nocase ? ["i"] : []);
1313
- let i = t.map((l) => {
1314
- const h = l.map((c) => {
1315
- if (c instanceof RegExp)
1316
- for (const f of c.flags.split(""))
1313
+ let i = t.map((c) => {
1314
+ const h = c.map((l) => {
1315
+ if (l instanceof RegExp)
1316
+ for (const f of l.flags.split(""))
1317
1317
  r.add(f);
1318
- return typeof c == "string" ? as(c) : c === O ? O : c._src;
1318
+ return typeof l == "string" ? as(l) : l === D ? D : l._src;
1319
1319
  });
1320
- return h.forEach((c, f) => {
1320
+ return h.forEach((l, f) => {
1321
1321
  const u = h[f + 1], d = h[f - 1];
1322
- c !== O || d === O || (d === void 0 ? u !== void 0 && u !== O ? h[f + 1] = "(?:\\\\/|" + n + "\\\\/)?" + u : h[f] = n : u === void 0 ? h[f - 1] = d + "(?:\\\\/|" + n + ")?" : u !== O && (h[f - 1] = d + "(?:\\\\/|\\\\/" + n + "\\\\/)" + u, h[f + 1] = O));
1323
- }), h.filter((c) => c !== O).join("/");
1322
+ l !== D || d === D || (d === void 0 ? u !== void 0 && u !== D ? h[f + 1] = "(?:\\\\/|" + n + "\\\\/)?" + u : h[f] = n : u === void 0 ? h[f - 1] = d + "(?:\\\\/|" + n + ")?" : u !== D && (h[f - 1] = d + "(?:\\\\/|\\\\/" + n + "\\\\/)" + u, h[f + 1] = D));
1323
+ }), h.filter((l) => l !== D).join("/");
1324
1324
  }).join("|");
1325
1325
  const [o, a] = t.length > 1 ? ["(?:", ")"] : ["", ""];
1326
1326
  i = "^" + o + i + a + "$", this.negate && (i = "^(?!" + i + ").+$");
@@ -1352,56 +1352,56 @@ globstar while\`, t, u, e, d, g), this.matchOne(t.slice(u), e.slice(d), n))
1352
1352
  for (let a = r.length - 2; !o && a >= 0; a--)
1353
1353
  o = r[a];
1354
1354
  for (let a = 0; a < i.length; a++) {
1355
- const l = i[a];
1355
+ const c = i[a];
1356
1356
  let h = r;
1357
- if (n.matchBase && l.length === 1 && (h = [o]), this.matchOne(h, l, e))
1357
+ if (n.matchBase && c.length === 1 && (h = [o]), this.matchOne(h, c, e))
1358
1358
  return n.flipNegate ? !0 : !this.negate;
1359
1359
  }
1360
1360
  return n.flipNegate ? !1 : this.negate;
1361
1361
  }
1362
1362
  static defaults(t) {
1363
- return y.defaults(t).Minimatch;
1363
+ return m.defaults(t).Minimatch;
1364
1364
  }
1365
1365
  }
1366
- y.AST = E;
1367
- y.Minimatch = X;
1368
- y.escape = Te;
1369
- y.unescape = k;
1366
+ m.AST = E;
1367
+ m.Minimatch = Z;
1368
+ m.escape = Pe;
1369
+ m.unescape = k;
1370
1370
  function cs() {
1371
1371
  if (!("storage" in navigator) || !("getDirectory" in navigator.storage))
1372
1372
  throw new Qt();
1373
1373
  }
1374
- async function L(s, t, e) {
1375
- return typeof navigator < "u" && navigator.locks?.request ? navigator.locks.request(\`opfs:\${s.replace(/\\/+/g, "/")}\`, { mode: t }, e) : e();
1374
+ async function I(s, t) {
1375
+ return typeof navigator < "u" && navigator.locks?.request ? navigator.locks.request(\`opfs:\${s.replace(/\\/+/g, "/")}\`, { mode: "exclusive" }, t) : t();
1376
1376
  }
1377
- function M(s) {
1377
+ function F(s) {
1378
1378
  return Array.isArray(s) ? s : (s.startsWith("~/") ? s.slice(2) : s).split("/").filter(Boolean);
1379
1379
  }
1380
1380
  function lt(s) {
1381
1381
  return typeof s == "string" ? s ?? "/" : \`/\${s.join("/")}\`;
1382
1382
  }
1383
1383
  function it(s) {
1384
- const t = M(s);
1384
+ const t = F(s);
1385
1385
  return t[t.length - 1] || "";
1386
1386
  }
1387
- function et(s) {
1388
- const t = M(s);
1387
+ function tt(s) {
1388
+ const t = F(s);
1389
1389
  return t.pop(), lt(t);
1390
1390
  }
1391
- function G(s) {
1391
+ function B(s) {
1392
1392
  return !s || s === "/" ? "/" : s.startsWith("~/") ? \`/\${s.slice(2)}\` : s.startsWith("/") ? s : \`/\${s}\`;
1393
1393
  }
1394
1394
  function ls(s, t = !1) {
1395
1395
  return s = s.replace(/\\/$/, ""), t && !s.includes("*") ? \`\${s}/**\` : s;
1396
1396
  }
1397
- function st(s, t) {
1398
- return y(s, t, {
1397
+ function et(s, t) {
1398
+ return m(s, t, {
1399
1399
  dot: !0,
1400
1400
  matchBase: !0
1401
1401
  });
1402
1402
  }
1403
1403
  function Et(s) {
1404
- const t = G(s), e = M(t), n = [];
1404
+ const t = B(s), e = F(t), n = [];
1405
1405
  for (const r of e)
1406
1406
  if (!(r === "." || r === ""))
1407
1407
  if (r === "..") {
@@ -1424,15 +1424,19 @@ async function us(s) {
1424
1424
  }
1425
1425
  async function fs(s, t, e = {}) {
1426
1426
  const n = it(t);
1427
- return L(t, "exclusive", async () => {
1427
+ return I(t, async () => {
1428
1428
  const r = e.recursive ?? !1, i = e.force ?? !1;
1429
1429
  try {
1430
1430
  await s.removeEntry(n, { recursive: r });
1431
1431
  } catch (o) {
1432
- if (o.name === "NotFoundError") {
1433
- if (!i)
1434
- throw new F("file", t, o);
1435
- } else throw o.name === "InvalidModificationError" ? new rt("ENOTEMPTY", t, o) : o.name === "TypeMismatchError" && !r ? new z("directory", t, o) : new rt("RM_FAILED", t, o);
1432
+ if (o.name === "NotFoundError" && i)
1433
+ return;
1434
+ const a = o.name === "TypeMismatchError" && !r;
1435
+ throw O(o, {
1436
+ path: t,
1437
+ operation: "remove",
1438
+ isDirectory: a
1439
+ });
1436
1440
  }
1437
1441
  });
1438
1442
  }
@@ -1463,7 +1467,7 @@ async function ps(s, t) {
1463
1467
  try {
1464
1468
  return await s.createSyncAccessHandle();
1465
1469
  } catch (e) {
1466
- throw A(e, { path: t, isDirectory: !1 });
1470
+ throw O(e, { path: t, isDirectory: !1 });
1467
1471
  }
1468
1472
  }
1469
1473
  class gs {
@@ -1483,6 +1487,8 @@ class gs {
1483
1487
  hashAlgorithm: "etag",
1484
1488
  broadcastChannel: "opfs-worker"
1485
1489
  };
1490
+ /** Shared sync handles per path (OPFS allows only one handle per file) */
1491
+ openHandles = /* @__PURE__ */ new Map();
1486
1492
  /** Map of open file descriptors to their metadata */
1487
1493
  openFiles = /* @__PURE__ */ new Map();
1488
1494
  /** Next available file descriptor number */
@@ -1503,14 +1509,13 @@ class gs {
1503
1509
  * This method is called by internal operations to notify clients about
1504
1510
  * changes, even when no specific paths are being watched.
1505
1511
  *
1506
- * @param path - The path that was changed
1507
- * @param type - The type of change (create, change, delete)
1512
+ * @param event - The event describing the change
1508
1513
  */
1509
1514
  async notifyChange(t) {
1510
1515
  if (!this.options.broadcastChannel)
1511
1516
  return;
1512
1517
  const e = t.path;
1513
- if (![...this.watchers.values()].some((i) => st(e, i.pattern) && i.include.some((o) => o && st(e, o)) && !i.exclude.some((o) => o && st(e, o))))
1518
+ if (![...this.watchers.values()].some((i) => et(e, i.pattern) && i.include.some((o) => o && et(e, o)) && !i.exclude.some((o) => o && et(e, o))))
1514
1519
  return;
1515
1520
  let r;
1516
1521
  if (this.options.hashAlgorithm)
@@ -1532,7 +1537,7 @@ class gs {
1532
1537
  }
1533
1538
  }
1534
1539
  /**
1535
- * Creates a new OPFSFileSystem instance
1540
+ * Creates a new OPFSWorker instance
1536
1541
  *
1537
1542
  * @param options - Optional configuration options
1538
1543
  * @param options.root - Root path for the file system (default: '/')
@@ -1550,13 +1555,12 @@ class gs {
1550
1555
  * This method sets up the root directory for all subsequent operations.
1551
1556
  * If no root is specified, it will use the OPFS root directory.
1552
1557
  *
1553
- * @param root - The root path for the file system (default: '/')
1554
1558
  * @returns Promise that resolves to true if initialization was successful
1555
1559
  * @throws {OPFSError} If initialization fails
1556
1560
  *
1557
1561
  * @example
1558
1562
  * \`\`\`typescript
1559
- * const fs = new OPFSFileSystem();
1563
+ * const fs = new OPFSWorker();
1560
1564
  *
1561
1565
  * // Use OPFS root (default)
1562
1566
  * await fs.mount();
@@ -1589,7 +1593,7 @@ class gs {
1589
1593
  * @param options.broadcastChannel - Custom name for the broadcast channel
1590
1594
  */
1591
1595
  async setOptions(t) {
1592
- t.hashAlgorithm !== void 0 && (this.options.hashAlgorithm = t.hashAlgorithm), t.maxFileSize !== void 0 && (this.options.maxFileSize = t.maxFileSize), t.broadcastChannel !== void 0 && (this.broadcastChannel && this.options.broadcastChannel !== t.broadcastChannel && (this.broadcastChannel.close(), this.broadcastChannel = null), this.options.broadcastChannel = t.broadcastChannel), t.namespace && (this.options.namespace = t.namespace), t.root !== void 0 && (this.options.root = G(t.root), this.options.namespace || (this.options.namespace = \`opfs-worker:\${this.options.root}\`), await this.mount());
1596
+ t.hashAlgorithm !== void 0 && (this.options.hashAlgorithm = t.hashAlgorithm), t.maxFileSize !== void 0 && (this.options.maxFileSize = t.maxFileSize), t.broadcastChannel !== void 0 && (this.broadcastChannel && this.options.broadcastChannel !== t.broadcastChannel && (this.broadcastChannel.close(), this.broadcastChannel = null), this.options.broadcastChannel = t.broadcastChannel), t.namespace && (this.options.namespace = t.namespace), t.root !== void 0 && (this.options.root = B(t.root), this.options.namespace || (this.options.namespace = \`opfs-worker:\${this.options.root}\`), await this.mount());
1593
1597
  }
1594
1598
  /**
1595
1599
  * Get a directory handle from a path
@@ -1610,7 +1614,7 @@ class gs {
1610
1614
  * \`\`\`
1611
1615
  */
1612
1616
  async getDirectoryHandle(t, e = !1, n = this.root) {
1613
- const r = Array.isArray(t) ? t : M(t);
1617
+ const r = Array.isArray(t) ? t : F(t);
1614
1618
  let i = n;
1615
1619
  for (const o of r)
1616
1620
  i = await i.getDirectoryHandle(o, { create: e });
@@ -1636,7 +1640,7 @@ class gs {
1636
1640
  * \`\`\`
1637
1641
  */
1638
1642
  async getFileHandle(t, e = !1, n = this.root) {
1639
- const r = M(t);
1643
+ const r = F(t);
1640
1644
  if (r.length === 0)
1641
1645
  throw new Kt("Path must not be empty", Array.isArray(t) ? t.join("/") : t);
1642
1646
  const i = r.pop();
@@ -1705,17 +1709,17 @@ class gs {
1705
1709
  async readFile(t) {
1706
1710
  await this.mount();
1707
1711
  try {
1708
- return await L(t, "shared", async () => {
1712
+ return await I(t, async () => {
1709
1713
  const e = await this.open(t);
1710
1714
  try {
1711
1715
  const { size: n } = await this.fstat(e), r = new Uint8Array(n);
1712
- return n > 0 && await this.read(e, r, 0, n, 0), B(r, [r.buffer]);
1716
+ return n > 0 && await this.read(e, r, 0, n, 0), _(r, [r.buffer]);
1713
1717
  } finally {
1714
1718
  await this.close(e);
1715
1719
  }
1716
1720
  });
1717
1721
  } catch (e) {
1718
- throw new F("file", t, e);
1722
+ throw e instanceof w ? e : O(e, { path: t, isDirectory: !1 });
1719
1723
  }
1720
1724
  }
1721
1725
  /**
@@ -1743,14 +1747,14 @@ class gs {
1743
1747
  async writeFile(t, e) {
1744
1748
  await this.mount();
1745
1749
  const n = e instanceof Uint8Array ? e : new Uint8Array(e);
1746
- await L(t, "exclusive", async () => {
1750
+ await I(t, async () => {
1747
1751
  const r = await this.exists(t), i = await this.open(t, { create: !0, truncate: !0 });
1748
1752
  try {
1749
1753
  await this.write(i, n, 0, n.length, null, !1), await this.fsync(i);
1750
1754
  } finally {
1751
1755
  await this.close(i);
1752
1756
  }
1753
- await this.notifyChange({ path: t, type: r ? D.Changed : D.Added, isDirectory: !1 });
1757
+ await this.notifyChange({ path: t, type: r ? A.Changed : A.Added, isDirectory: !1 });
1754
1758
  });
1755
1759
  }
1756
1760
  /**
@@ -1778,7 +1782,7 @@ class gs {
1778
1782
  async appendFile(t, e) {
1779
1783
  await this.mount();
1780
1784
  const n = e instanceof Uint8Array ? e : new Uint8Array(e);
1781
- await L(t, "exclusive", async () => {
1785
+ await I(t, async () => {
1782
1786
  const r = await this.open(t, { create: !0 });
1783
1787
  try {
1784
1788
  const { size: i } = await this.fstat(r);
@@ -1786,7 +1790,7 @@ class gs {
1786
1790
  } finally {
1787
1791
  await this.close(r);
1788
1792
  }
1789
- await this.notifyChange({ path: t, type: D.Changed, isDirectory: !1 });
1793
+ await this.notifyChange({ path: t, type: A.Changed, isDirectory: !1 });
1790
1794
  });
1791
1795
  }
1792
1796
  /**
@@ -1812,17 +1816,20 @@ class gs {
1812
1816
  */
1813
1817
  async mkdir(t, e) {
1814
1818
  await this.mount();
1815
- const n = e?.recursive ?? !1, r = M(t);
1819
+ const n = e?.recursive ?? !1, r = F(t);
1816
1820
  let i = this.root;
1817
1821
  for (let o = 0; o < r.length; o++) {
1818
1822
  const a = r[o];
1819
1823
  try {
1820
1824
  i = await i.getDirectoryHandle(a, { create: n || o === r.length - 1 });
1821
- } catch (l) {
1822
- throw l.name === "NotFoundError" ? new F("directory", lt(r.slice(0, o + 1)), l) : l.name === "TypeMismatchError" ? new z("file", a, l) : new Q("create directory", a, l);
1825
+ } catch (c) {
1826
+ throw c.name === "NotFoundError" ? O(c, {
1827
+ path: lt(r.slice(0, o + 1)),
1828
+ existenceType: "directory"
1829
+ }) : c.name === "TypeMismatchError" ? O(c, { path: a, isDirectory: !1 }) : new J("create directory", a, c);
1823
1830
  }
1824
1831
  }
1825
- await this.notifyChange({ path: t, type: D.Added, isDirectory: !0 });
1832
+ await this.notifyChange({ path: t, type: A.Added, isDirectory: !0 });
1826
1833
  }
1827
1834
  /**
1828
1835
  * Get file or directory statistics
@@ -1859,7 +1866,7 @@ class gs {
1859
1866
  const e = it(t);
1860
1867
  let n;
1861
1868
  try {
1862
- n = await this.getDirectoryHandle(et(t), !1);
1869
+ n = await this.getDirectoryHandle(tt(t), !1);
1863
1870
  const r = this.options.hashAlgorithm, o = await (await n.getFileHandle(e, { create: !1 })).getFile(), a = {
1864
1871
  kind: "file",
1865
1872
  size: o.size,
@@ -1872,17 +1879,17 @@ class gs {
1872
1879
  a.hash = \`\${o.lastModified.toString(36)}-\${o.size.toString(36)}\`;
1873
1880
  else if (typeof r == "string")
1874
1881
  try {
1875
- const l = await hs(o, r, this.options.maxFileSize);
1876
- a.hash = l;
1877
- } catch (l) {
1878
- console.warn(\`Failed to calculate hash for \${t}:\`, l);
1882
+ const c = await hs(o, r, this.options.maxFileSize);
1883
+ a.hash = c;
1884
+ } catch (c) {
1885
+ console.warn(\`Failed to calculate hash for \${t}:\`, c);
1879
1886
  }
1880
1887
  return a;
1881
1888
  } catch (r) {
1882
1889
  if (r.name === "NotFoundError")
1883
- throw new F("file", t, r);
1890
+ throw new U("file", t, r);
1884
1891
  if (r.name !== "TypeMismatchError")
1885
- throw new Q("stat", t, r);
1892
+ throw new J("stat", t, r);
1886
1893
  }
1887
1894
  try {
1888
1895
  return await n.getDirectoryHandle(e, { create: !1 }), {
@@ -1894,7 +1901,7 @@ class gs {
1894
1901
  isDirectory: !0
1895
1902
  };
1896
1903
  } catch (r) {
1897
- throw new Q("stat", t, r);
1904
+ throw new J("stat", t, r);
1898
1905
  }
1899
1906
  }
1900
1907
  /**
@@ -1949,7 +1956,7 @@ class gs {
1949
1956
  const e = it(t);
1950
1957
  let n = null;
1951
1958
  try {
1952
- n = await this.getDirectoryHandle(et(t), !1);
1959
+ n = await this.getDirectoryHandle(tt(t), !1);
1953
1960
  } catch (r) {
1954
1961
  if (n = null, r.name !== "NotFoundError" && r.name !== "TypeMismatchError")
1955
1962
  throw r;
@@ -1997,9 +2004,9 @@ class gs {
1997
2004
  const r = \`\${t === "/" ? "" : t}/\${n.name}\`;
1998
2005
  await this.remove(r, { recursive: !0 });
1999
2006
  }
2000
- await this.notifyChange({ path: t, type: D.Changed, isDirectory: !0 });
2007
+ await this.notifyChange({ path: t, type: A.Changed, isDirectory: !0 });
2001
2008
  } catch (e) {
2002
- throw e instanceof w ? e : A(e, { path: t, isDirectory: !0 });
2009
+ throw e instanceof w ? e : O(e, { path: t, isDirectory: !0 });
2003
2010
  }
2004
2011
  }
2005
2012
  /**
@@ -2029,8 +2036,8 @@ class gs {
2029
2036
  async remove(t, e) {
2030
2037
  if (await this.mount(), t === "/")
2031
2038
  throw new rt("EROOT", t);
2032
- const { recursive: n = !1, force: r = !1 } = e || {}, i = await this.getDirectoryHandle(et(t), !1), o = await this.stat(t);
2033
- await fs(i, t, { recursive: n, force: r }), await this.notifyChange({ path: t, type: D.Removed, isDirectory: o.isDirectory });
2039
+ const { recursive: n = !1, force: r = !1 } = e || {}, i = await this.getDirectoryHandle(tt(t), !1), o = await this.stat(t);
2040
+ await fs(i, t, { recursive: n, force: r }), await this.notifyChange({ path: t, type: A.Removed, isDirectory: o.isDirectory });
2034
2041
  }
2035
2042
  /**
2036
2043
  * Resolve a path to an absolute path
@@ -2055,10 +2062,10 @@ class gs {
2055
2062
  try {
2056
2063
  const e = Et(t);
2057
2064
  if (!await this.exists(e))
2058
- throw new F("file", e);
2065
+ throw new U("file", e);
2059
2066
  return e;
2060
2067
  } catch (e) {
2061
- throw e instanceof w ? e : A(e, { path: t });
2068
+ throw e instanceof w ? e : O(e, { path: t });
2062
2069
  }
2063
2070
  }
2064
2071
  /**
@@ -2088,10 +2095,10 @@ class gs {
2088
2095
  try {
2089
2096
  const r = n?.overwrite ?? !1, i = await this.stat(t);
2090
2097
  if (await this.exists(e) && !r)
2091
- throw new K(e);
2092
- await this.copy(t, e, { recursive: !0, overwrite: r }), await this.remove(t, { recursive: !0 }), await this.notifyChange({ path: t, type: D.Removed, isDirectory: i.isDirectory }), await this.notifyChange({ path: e, type: D.Added, isDirectory: i.isDirectory });
2098
+ throw new Q(e);
2099
+ await this.copy(t, e, { recursive: !0, overwrite: r }), await this.remove(t, { recursive: !0 }), await this.notifyChange({ path: t, type: A.Removed, isDirectory: i.isDirectory }), await this.notifyChange({ path: e, type: A.Added, isDirectory: i.isDirectory });
2093
2100
  } catch (r) {
2094
- throw r instanceof w ? r : A(r, { path: t });
2101
+ throw r instanceof w ? r : O(r, { path: t });
2095
2102
  }
2096
2103
  }
2097
2104
  /**
@@ -2124,24 +2131,24 @@ class gs {
2124
2131
  try {
2125
2132
  const r = n?.recursive ?? !1, i = n?.overwrite ?? !0;
2126
2133
  if (!await this.exists(t))
2127
- throw new F("source", t);
2134
+ throw new U("source", t);
2128
2135
  if (await this.exists(e) && !i)
2129
- throw new K(e);
2136
+ throw new Q(e);
2130
2137
  if ((await this.stat(t)).isFile) {
2131
2138
  const h = await this.readFile(t);
2132
2139
  await this.writeFile(e, h);
2133
2140
  } else {
2134
2141
  if (!r)
2135
- throw new z("directory", t);
2142
+ throw new nt("directory", t);
2136
2143
  await this.mkdir(e, { recursive: !0 });
2137
2144
  const h = await this.readDir(t);
2138
- for (const c of h) {
2139
- const f = \`\${t}/\${c.name}\`, u = \`\${e}/\${c.name}\`;
2145
+ for (const l of h) {
2146
+ const f = \`\${t}/\${l.name}\`, u = \`\${e}/\${l.name}\`;
2140
2147
  await this.copy(f, u, { recursive: !0, overwrite: i });
2141
2148
  }
2142
2149
  }
2143
2150
  } catch (r) {
2144
- throw r instanceof w ? r : A(r, { path: t });
2151
+ throw r instanceof w ? r : O(r, { path: t });
2145
2152
  }
2146
2153
  }
2147
2154
  /**
@@ -2214,37 +2221,50 @@ class gs {
2214
2221
  */
2215
2222
  async open(t, e) {
2216
2223
  await this.mount();
2217
- const { create: n = !1, exclusive: r = !1, truncate: i = !1 } = e || {}, o = G(Et(t));
2224
+ const { create: n = !1, exclusive: r = !1, truncate: i = !1 } = e || {}, o = B(Et(t));
2218
2225
  try {
2219
- return n && r ? await L(o, "exclusive", async () => {
2226
+ return n && r ? await I(o, async () => {
2220
2227
  if (await this.exists(o))
2221
- throw new K(o);
2228
+ throw new Q(o);
2222
2229
  return this._openFile(o, n, i);
2223
2230
  }) : await this._openFile(o, n, i);
2224
2231
  } catch (a) {
2225
- throw a instanceof w ? a : A(a, { path: o, isDirectory: !1 });
2232
+ if (a instanceof w)
2233
+ throw a;
2234
+ const c = a && a.name === "TypeMismatchError";
2235
+ throw O(a, {
2236
+ path: o,
2237
+ isDirectory: !!c
2238
+ });
2226
2239
  }
2227
2240
  }
2228
2241
  /**
2229
2242
  * Internal method to open a file (without locking)
2243
+ *
2244
+ * Multiple FDs for the same path share one sync access handle (OPFS limit),
2245
+ * with independent per-FD positions — similar to Node.js.
2230
2246
  * @private
2231
2247
  */
2232
2248
  async _openFile(t, e, n) {
2233
- const r = await this.getFileHandle(t, e);
2234
- try {
2235
- await r.getFile();
2236
- } catch (a) {
2237
- throw A(a, { path: t, isDirectory: !0 });
2249
+ let r = this.openHandles.get(t);
2250
+ if (!r) {
2251
+ const o = await this.getFileHandle(t, e);
2252
+ try {
2253
+ await o.getFile();
2254
+ } catch (c) {
2255
+ throw O(c, { path: t, isDirectory: !0 });
2256
+ }
2257
+ const a = await ps(o, t);
2258
+ r = { fileHandle: o, syncHandle: a, refCount: 0 }, this.openHandles.set(t, r);
2238
2259
  }
2239
- const i = await ps(r, t);
2240
- n && (i.truncate(0), i.flush());
2241
- const o = this.nextFd++;
2242
- return this.openFiles.set(o, {
2260
+ r.refCount++, n && (r.syncHandle.truncate(0), r.syncHandle.flush());
2261
+ const i = this.nextFd++;
2262
+ return this.openFiles.set(i, {
2243
2263
  path: t,
2244
- fileHandle: r,
2245
- syncHandle: i,
2264
+ fileHandle: r.fileHandle,
2265
+ syncHandle: r.syncHandle,
2246
2266
  position: 0
2247
- }), o;
2267
+ }), i;
2248
2268
  }
2249
2269
  /**
2250
2270
  * Close a file descriptor
@@ -2262,7 +2282,9 @@ class gs {
2262
2282
  */
2263
2283
  async close(t) {
2264
2284
  const e = this._getFileDescriptor(t);
2265
- xt(t, e.syncHandle, e.path), this.openFiles.delete(t);
2285
+ this.openFiles.delete(t);
2286
+ const n = this.openHandles.get(e.path);
2287
+ n && (n.refCount--, n.refCount <= 0 && (xt(t, n.syncHandle, e.path), this.openHandles.delete(e.path)));
2266
2288
  }
2267
2289
  /**
2268
2290
  * Read data from a file descriptor
@@ -2292,13 +2314,13 @@ class gs {
2292
2314
  const o = this._getFileDescriptor(t);
2293
2315
  St(e.length, n, r, i);
2294
2316
  try {
2295
- const a = i ?? o.position, l = o.syncHandle.getSize(), { isEOF: h, actualLength: c } = ds(a, r, l);
2317
+ const a = i ?? o.position, c = o.syncHandle.getSize(), { isEOF: h, actualLength: l } = ds(a, r, c);
2296
2318
  if (h)
2297
- return B({ bytesRead: 0, buffer: e }, [e.buffer]);
2298
- const f = e.subarray(n, n + c), u = o.syncHandle.read(f, { at: a });
2299
- return i == null && (o.position = a + u), B({ bytesRead: u, buffer: e }, [e.buffer]);
2319
+ return _({ bytesRead: 0, buffer: e }, [e.buffer]);
2320
+ const f = e.subarray(n, n + l), u = o.syncHandle.read(f, { at: a });
2321
+ return i == null && (o.position = a + u), _({ bytesRead: u, buffer: e }, [e.buffer]);
2300
2322
  } catch (a) {
2301
- throw j("read", t, o.path, a);
2323
+ throw z("read", t, o.path, a);
2302
2324
  }
2303
2325
  }
2304
2326
  /**
@@ -2323,13 +2345,13 @@ class gs {
2323
2345
  * \`\`\`
2324
2346
  */
2325
2347
  async write(t, e, n = 0, r, i, o = !0) {
2326
- const a = this._getFileDescriptor(t), l = r ?? e.length - n;
2327
- St(e.length, n, l, i);
2348
+ const a = this._getFileDescriptor(t), c = r ?? e.length - n;
2349
+ St(e.length, n, c, i);
2328
2350
  try {
2329
- const h = i ?? a.position, c = e.subarray(n, n + l), f = a.syncHandle.write(c, { at: h });
2330
- return (i == null || i === a.position) && (a.position = h + f), o && await this.notifyChange({ path: a.path, type: D.Changed, isDirectory: !1 }), f;
2351
+ const h = i ?? a.position, l = e.subarray(n, n + c), f = a.syncHandle.write(l, { at: h });
2352
+ return (i == null || i === a.position) && (a.position = h + f), o && await this.notifyChange({ path: a.path, type: A.Changed, isDirectory: !1 }), f;
2331
2353
  } catch (h) {
2332
- throw j("write", t, a.path, h);
2354
+ throw z("write", t, a.path, h);
2333
2355
  }
2334
2356
  }
2335
2357
  /**
@@ -2375,9 +2397,9 @@ class gs {
2375
2397
  if (e < 0 || !Number.isInteger(e))
2376
2398
  throw new N("argument", "Invalid size");
2377
2399
  try {
2378
- n.syncHandle.truncate(e), n.syncHandle.flush(), n.position > e && (n.position = e), await this.notifyChange({ path: n.path, type: D.Changed, isDirectory: !1 });
2400
+ n.syncHandle.truncate(e), n.syncHandle.flush(), n.position > e && (n.position = e), await this.notifyChange({ path: n.path, type: A.Changed, isDirectory: !1 });
2379
2401
  } catch (r) {
2380
- throw j("truncate", t, n.path, r);
2402
+ throw z("truncate", t, n.path, r);
2381
2403
  }
2382
2404
  }
2383
2405
  /**
@@ -2399,7 +2421,7 @@ class gs {
2399
2421
  try {
2400
2422
  e.syncHandle.flush();
2401
2423
  } catch (n) {
2402
- throw j("sync", t, e.path, n);
2424
+ throw z("sync", t, e.path, n);
2403
2425
  }
2404
2426
  }
2405
2427
  /**
@@ -2410,9 +2432,9 @@ class gs {
2410
2432
  */
2411
2433
  dispose() {
2412
2434
  this.broadcastChannel && (this.broadcastChannel.close(), this.broadcastChannel = null), this.watchers.clear();
2413
- for (const [t, e] of this.openFiles)
2414
- xt(t, e.syncHandle, e.path);
2415
- this.openFiles.clear(), this.nextFd = 1;
2435
+ for (const [t, e] of this.openHandles)
2436
+ xt(-1, e.syncHandle, t);
2437
+ this.openHandles.clear(), this.openFiles.clear(), this.nextFd = 1;
2416
2438
  }
2417
2439
  /**
2418
2440
  * Synchronize the file system with external data
@@ -2421,8 +2443,6 @@ class gs {
2421
2443
  * This is useful for importing data from external sources or syncing with remote data.
2422
2444
  *
2423
2445
  * @param entries - Array of [path, data] tuples to sync
2424
- * @param options - Options for synchronization
2425
- * @param options.cleanBefore - Whether to clear the file system before syncing (default: false)
2426
2446
  * @returns Promise that resolves when synchronization is complete
2427
2447
  * @throws {OPFSError} If the synchronization fails
2428
2448
  *
@@ -2446,17 +2466,17 @@ class gs {
2446
2466
  await this.mount();
2447
2467
  try {
2448
2468
  for (const [e, n] of t) {
2449
- const r = G(e);
2469
+ const r = B(e);
2450
2470
  let i;
2451
2471
  n instanceof Blob ? i = await us(n) : typeof n == "string" ? i = new TextEncoder().encode(n) : i = n, await this.writeFile(r, i);
2452
2472
  }
2453
2473
  } catch (e) {
2454
- throw e instanceof w ? e : A(e);
2474
+ throw e instanceof w ? e : O(e);
2455
2475
  }
2456
2476
  }
2457
2477
  }
2458
- typeof globalThis < "u" && globalThis.constructor.name === "DedicatedWorkerGlobalScope" && ot(new gs());
2459
- //# sourceMappingURL=worker-BeJaVyBV.js.map
2478
+ ot(new gs());
2479
+ //# sourceMappingURL=worker.entry-DUlEoroc.js.map
2460
2480
  `, p = typeof self < "u" && self.Blob && new Blob(["URL.revokeObjectURL(import.meta.url);", f], { type: "text/javascript;charset=utf-8" });
2461
2481
  function m(a) {
2462
2482
  let n;
@@ -2479,14 +2499,36 @@ function m(a) {
2479
2499
  );
2480
2500
  }
2481
2501
  }
2502
+ const y = m;
2503
+ function w(a, n) {
2504
+ n && (n.broadcastChannel instanceof BroadcastChannel && (n.broadcastChannel = n.broadcastChannel.name), a.setOptions(n));
2505
+ }
2506
+ function g(a) {
2507
+ const n = new y(), t = u(n);
2508
+ return w(t, a), {
2509
+ fs: t,
2510
+ worker: n,
2511
+ dispose() {
2512
+ (async () => {
2513
+ try {
2514
+ await t.dispose();
2515
+ } finally {
2516
+ n.terminate();
2517
+ }
2518
+ })();
2519
+ }
2520
+ };
2521
+ }
2482
2522
  function i(a) {
2483
2523
  return a instanceof URL ? a.pathname : a;
2484
2524
  }
2485
- class y {
2525
+ class b {
2486
2526
  #n;
2527
+ #t;
2487
2528
  promises = this;
2488
2529
  constructor(n) {
2489
- this.#n = u(new m()), n && (n.broadcastChannel && n.broadcastChannel instanceof BroadcastChannel && (n.broadcastChannel = n.broadcastChannel.name), this.setOptions(n));
2530
+ const t = g(n);
2531
+ this.#n = t.fs, this.#t = t.dispose;
2490
2532
  }
2491
2533
  /**
2492
2534
  * Start watching a file or directory for changes
@@ -2696,12 +2738,6 @@ class y {
2696
2738
  async fsync(n) {
2697
2739
  return this.#n.fsync(n);
2698
2740
  }
2699
- /**
2700
- * Dispose of resources and clean up the file system instance
2701
- */
2702
- dispose() {
2703
- this.#n.dispose();
2704
- }
2705
2741
  /**
2706
2742
  * Synchronize the file system with external data
2707
2743
  */
@@ -2730,56 +2766,66 @@ class y {
2730
2766
  const r = i(n), s = c(t, e);
2731
2767
  return this.#n.appendFile(r, s);
2732
2768
  }
2769
+ /**
2770
+ * Dispose of resources, detach the worker and clean up the file system instance
2771
+ */
2772
+ dispose() {
2773
+ this.#t();
2774
+ }
2733
2775
  }
2734
- function b(a) {
2735
- return new y(a);
2776
+ function v(a) {
2777
+ return new b(a);
2736
2778
  }
2779
+ const S = v;
2737
2780
  export {
2738
- E as AlreadyExistsError,
2739
- S as BINARY_FILE_EXTENSIONS,
2740
- P as DirectoryOperationError,
2741
- O as ExistenceError,
2742
- F as FileBusyError,
2743
- A as FileSystemOperationError,
2744
- T as FileTypeError,
2745
- R as IOError,
2746
- C as InitializationFailedError,
2747
- I as OPFSError,
2748
- y as OPFSFileSystem,
2749
- $ as OPFSNotSupportedError,
2750
- D as OperationAbortedError,
2751
- _ as OperationNotSupportedError,
2752
- N as PathError,
2753
- z as PermissionError,
2754
- k as StorageError,
2755
- M as ValidationError,
2756
- j as WatchEventType,
2757
- L as basename,
2758
- W as buffersEqual,
2759
- U as calculateFileHash,
2760
- H as calculateReadLength,
2761
- B as checkOPFSSupport,
2762
- G as convertBlobToUint8Array,
2763
- q as createBuffer,
2764
- V as createFDError,
2765
- Y as createSyncHandleSafe,
2766
- b as createWorker,
2781
+ F as AlreadyExistsError,
2782
+ A as BINARY_FILE_EXTENSIONS,
2783
+ T as DirectoryOperationError,
2784
+ R as ExistenceError,
2785
+ C as FileBusyError,
2786
+ I as FileSystemOperationError,
2787
+ D as FileTypeError,
2788
+ $ as IOError,
2789
+ _ as InitializationFailedError,
2790
+ N as OPFSError,
2791
+ b as OPFSFacade,
2792
+ b as OPFSFileSystem,
2793
+ k as OPFSNotSupportedError,
2794
+ z as OperationAbortedError,
2795
+ M as OperationNotSupportedError,
2796
+ j as PathError,
2797
+ W as PermissionError,
2798
+ L as StorageError,
2799
+ U as ValidationError,
2800
+ H as WatchEventType,
2801
+ B as basename,
2802
+ G as buffersEqual,
2803
+ q as calculateFileHash,
2804
+ Y as calculateReadLength,
2805
+ V as checkOPFSSupport,
2806
+ Z as convertBlobToUint8Array,
2807
+ J as createBuffer,
2808
+ X as createFDError,
2809
+ v as createOPFS,
2810
+ g as createOPFSWorker,
2811
+ K as createSyncHandleSafe,
2812
+ S as createWorker,
2767
2813
  l as decodeBuffer,
2768
- J as dirname,
2814
+ Q as dirname,
2769
2815
  c as encodeString,
2770
- X as extname,
2816
+ nn as extname,
2771
2817
  h as isBinaryFileExtension,
2772
- Z as isPathExcluded,
2773
- K as joinPath,
2774
- Q as mapDomError,
2775
- nn as matchMinimatch,
2776
- tn as normalizeMinimatch,
2777
- en as normalizePath,
2778
- rn as removeEntry,
2779
- sn as resolvePath,
2780
- an as safeCloseSyncHandle,
2781
- on as splitPath,
2782
- cn as validateReadWriteArgs,
2783
- hn as withLock
2818
+ tn as isPathExcluded,
2819
+ en as joinPath,
2820
+ rn as mapDomError,
2821
+ sn as matchMinimatch,
2822
+ an as normalizeMinimatch,
2823
+ on as normalizePath,
2824
+ cn as removeEntry,
2825
+ hn as resolvePath,
2826
+ ln as safeCloseSyncHandle,
2827
+ pn as splitPath,
2828
+ fn as validateReadWriteArgs,
2829
+ dn as withLock
2784
2830
  };
2785
2831
  //# sourceMappingURL=index.js.map