@nebula-spatial/viewer 0.5.14 → 0.5.16

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,9 +1,9 @@
1
1
  var Cn = Object.defineProperty;
2
2
  var On = (n, t, e) => t in n ? Cn(n, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : n[t] = e;
3
- var K = (n, t, e) => On(n, typeof t != "symbol" ? t + "" : t, e);
3
+ var Z = (n, t, e) => On(n, typeof t != "symbol" ? t + "" : t, e);
4
4
  import { Vector3 as U, Box3 as st, Matrix4 as mt, BufferAttribute as bn, Line3 as ct, Plane as An, Vector2 as ht, Triangle as Et, BackSide as Fn, DoubleSide as _n, REVISION as Sn, Ray as zn, FrontSide as He, Mesh as $t, LineSegments as Ve, LineLoop as Bn, Line as Tn, Points as Pn, Sphere as Vn, BatchedMesh as jn, LineBasicMaterial as $n, MeshBasicMaterial as kn, WireframeGeometry as qn, EdgesGeometry as we } from "three";
5
5
  import { disposeModelResources as Jn } from "./resources-CHhCm2f7.js";
6
- import { t as Lt, u as We, v as Hn, w as Wn, x as Yn, U as Xn, p as Gn } from "./index-BSDalKkd.js";
6
+ import { t as Lt, u as We, v as Hn, w as Wn, x as Yn, U as Xn, p as Gn } from "./index-D9-UMnkK.js";
7
7
  const Zn = /* @__PURE__ */ new Set([
8
8
  "E_MJCF_INCLUDE_CYCLE",
9
9
  "E_MJCF_PARSE",
@@ -298,10 +298,10 @@ function ii(n, t, e, i, s) {
298
298
  if (M[R] !== r.mjtTrn.mjTRN_JOINT.value || v[R * 2] !== T) continue;
299
299
  const j = Number(o.actuator_gear[R * 6]);
300
300
  if (!Number.isFinite(j)) continue;
301
- const q = o.actuator_biastype[R] === r.mjtBias.mjBIAS_AFFINE.value, et = o.actuator_gaintype[R] === r.mjtGain.mjGAIN_FIXED.value, C = q ? -Number(L == null ? void 0 : L[R * 10 + 1]) + 0 : void 0, Z = q ? -Number(L == null ? void 0 : L[R * 10 + 2]) + 0 : void 0, Ut = Number(o.actuator_gainprm[R * 10]), lt = {
302
- type: et && q && C != null && C > 0 && Ut === C ? "position" : et && q && C === 0 && Z != null && Z > 0 && Ut === Z ? "velocity" : et && o.actuator_biastype[R] === r.mjtBias.mjBIAS_NONE.value ? "motor" : "general",
301
+ const q = o.actuator_biastype[R] === r.mjtBias.mjBIAS_AFFINE.value, et = o.actuator_gaintype[R] === r.mjtGain.mjGAIN_FIXED.value, C = q ? -Number(L == null ? void 0 : L[R * 10 + 1]) + 0 : void 0, K = q ? -Number(L == null ? void 0 : L[R * 10 + 2]) + 0 : void 0, Ut = Number(o.actuator_gainprm[R * 10]), lt = {
302
+ type: et && q && C != null && C > 0 && Ut === C ? "position" : et && q && C === 0 && K != null && K > 0 && Ut === K ? "velocity" : et && o.actuator_biastype[R] === r.mjtBias.mjBIAS_NONE.value ? "motor" : "general",
303
303
  ...Number.isFinite(C) ? { stiffness: C * j * j } : {},
304
- ...Number.isFinite(Z) ? { damping: Z * j * j } : {}
304
+ ...Number.isFinite(K) ? { damping: K * j * j } : {}
305
305
  }, kt = o.actuator(R);
306
306
  let qt;
307
307
  try {
@@ -323,7 +323,7 @@ function ii(n, t, e, i, s) {
323
323
  if (!v) continue;
324
324
  const N = o.jnt_bodyid[T], L = o.body_parentid[N], R = o.jnt(T);
325
325
  try {
326
- const j = (h = s == null ? void 0 : s.mimics) == null ? void 0 : h.get(v), q = p(T), et = Number((A = o.body_mass) == null ? void 0 : A[N]), C = (B = s == null ? void 0 : s.metadata) == null ? void 0 : B.get(v), Z = ((b = s == null ? void 0 : s.limits) == null ? void 0 : b.get(v)) ?? (R.limited ? { lower: o.jnt_range[T * 2], upper: o.jnt_range[T * 2 + 1] } : void 0);
326
+ const j = (h = s == null ? void 0 : s.mimics) == null ? void 0 : h.get(v), q = p(T), et = Number((A = o.body_mass) == null ? void 0 : A[N]), C = (B = s == null ? void 0 : s.metadata) == null ? void 0 : B.get(v), K = ((b = s == null ? void 0 : s.limits) == null ? void 0 : b.get(v)) ?? (R.limited ? { lower: o.jnt_range[T * 2], upper: o.jnt_range[T * 2 + 1] } : void 0);
327
327
  c.push({
328
328
  id: v,
329
329
  name: v.split("/").pop() || v,
@@ -333,7 +333,7 @@ function ii(n, t, e, i, s) {
333
333
  axis: Array.from(o.jnt_axis.slice(T * 3, T * 3 + 3)),
334
334
  unit: M ? "rad" : "m",
335
335
  defaultValue: a.qpos[o.jnt_qposadr[T]],
336
- ...Z ? { limits: Z } : {},
336
+ ...K ? { limits: K } : {},
337
337
  ...(C == null ? void 0 : C.movingMass) != null ? { movingMass: C.movingMass } : Number.isFinite(et) && et > 0 ? { movingMass: et } : {},
338
338
  ...C != null && C.drive ? { drive: C.drive } : q.drive ? { drive: q.drive } : {},
339
339
  ...(C == null ? void 0 : C.maxEffort) != null ? { maxEffort: C.maxEffort } : q.maxEffort != null ? { maxEffort: q.maxEffort } : {},
@@ -412,7 +412,7 @@ function ii(n, t, e, i, s) {
412
412
  }
413
413
  };
414
414
  }
415
- const En = 0, si = 1, ri = 2, Ye = 2, xe = 1.25, Xe = 1, H = 6 * 4 + 4 + 4, z = H / 4, Mn = 65535, fe = Math.pow(2, -24), je = Symbol("SKIP_GENERATION"), vn = {
415
+ const En = 0, si = 1, ri = 2, Ye = 2, xe = 1.25, Xe = 1, W = 6 * 4 + 4 + 4, z = W / 4, Mn = 65535, fe = Math.pow(2, -24), je = Symbol("SKIP_GENERATION"), vn = {
416
416
  strategy: En,
417
417
  maxDepth: 40,
418
418
  maxLeafSize: 10,
@@ -458,7 +458,7 @@ function Rt(n) {
458
458
  function V(n, t) {
459
459
  return t[n + 15] === Mn;
460
460
  }
461
- function W(n, t) {
461
+ function Y(n, t) {
462
462
  return t[n + 6];
463
463
  }
464
464
  function X(n, t) {
@@ -629,11 +629,11 @@ function Ue(n, t) {
629
629
  for (let r = 0; r < 6; r++)
630
630
  Nn[e + r] = o[r];
631
631
  if (s)
632
- return t.buffer ? (Un.set(new Uint8Array(t.buffer), n), n + t.buffer.byteLength) : (de[e + 6] = t.offset, ve[i + 14] = t.count, ve[i + 15] = Mn, n + H);
632
+ return t.buffer ? (Un.set(new Uint8Array(t.buffer), n), n + t.buffer.byteLength) : (de[e + 6] = t.offset, ve[i + 14] = t.count, ve[i + 15] = Mn, n + W);
633
633
  {
634
- const { left: r, right: a, splitAxis: c } = t, d = n + H;
634
+ const { left: r, right: a, splitAxis: c } = t, d = n + W;
635
635
  let f = Ue(d, r);
636
- const l = n / H, p = f / H - l;
636
+ const l = n / W, p = f / W - l;
637
637
  if (p > ui)
638
638
  throw new Error("MeshBVH: Cannot store relative child node offset greater than 32 bits.");
639
639
  return de[e + 6] = p, de[e + 7] = c, Ue(f, a);
@@ -678,7 +678,7 @@ function pi(n, t) {
678
678
  count: o.offset + o.count - s.offset
679
679
  }, a = new Float32Array(6 * r.count);
680
680
  a.offset = r.offset, n.computePrimitiveBounds(r.offset, r.count, a), n._roots = i.map((c) => {
681
- const d = di(n, a, c.offset, c.count, t, r), f = Ne(d), l = new e(H * f);
681
+ const d = di(n, a, c.offset, c.count, t, r), f = Ne(d), l = new e(W * f);
682
682
  return fi(0, d, l), l;
683
683
  });
684
684
  }
@@ -720,7 +720,7 @@ function Le(n, t, e, i, s = null, o = 0, r = 0) {
720
720
  const { float32Array: a, uint16Array: c, uint32Array: d } = D;
721
721
  let f = n * 2;
722
722
  if (V(f, c)) {
723
- const u = W(n, d), p = X(f, c);
723
+ const u = Y(n, d), p = X(f, c);
724
724
  return O(n, a, pt), i(u, p, !1, r, o + n / z, pt);
725
725
  } else {
726
726
  let b = function(x) {
@@ -728,13 +728,13 @@ function Le(n, t, e, i, s = null, o = 0, r = 0) {
728
728
  let N = x * 2;
729
729
  for (; !V(N, M); )
730
730
  x = $(x), N = x * 2;
731
- return W(x, v);
731
+ return Y(x, v);
732
732
  }, T = function(x) {
733
733
  const { uint16Array: M, uint32Array: v } = D;
734
734
  let N = x * 2;
735
735
  for (; !V(N, M); )
736
736
  x = k(x, v), N = x * 2;
737
- return W(x, v) + X(N, M);
737
+ return Y(x, v) + X(N, M);
738
738
  };
739
739
  const u = $(n), p = k(n, d);
740
740
  let S = u, P = p, _, I, m, g;
@@ -803,9 +803,9 @@ function yi(n, t, e, i) {
803
803
  0,
804
804
  0,
805
805
  u
806
- ), pe.clearBuffer(), c += o[p].byteLength / H, !r); p++)
806
+ ), pe.clearBuffer(), c += o[p].byteLength / W, !r); p++)
807
807
  ;
808
- if (dt.releasePrimitive(u), jt.clearBuffer(), a += s[f].byteLength / H, r)
808
+ if (dt.releasePrimitive(u), jt.clearBuffer(), a += s[f].byteLength / W, r)
809
809
  break;
810
810
  }
811
811
  return Be = !1, r;
@@ -817,18 +817,18 @@ function nt(n, t, e, i, s, o = 0, r = 0, a = 0, c = 0, d = null, f = !1) {
817
817
  let h = !1;
818
818
  if (E && w)
819
819
  f ? h = s(
820
- W(t, I),
820
+ Y(t, I),
821
821
  X(t * 2, m),
822
- W(n, S),
822
+ Y(n, S),
823
823
  X(n * 2, P),
824
824
  c,
825
825
  r + t / z,
826
826
  a,
827
827
  o + n / z
828
828
  ) : h = s(
829
- W(n, S),
829
+ Y(n, S),
830
830
  X(n * 2, P),
831
- W(t, I),
831
+ Y(t, I),
832
832
  X(t * 2, m),
833
833
  a,
834
834
  o + n / z,
@@ -1040,7 +1040,7 @@ class gi {
1040
1040
  else {
1041
1041
  const i = this._roots;
1042
1042
  for (let s = 0; s < i.length; s++) {
1043
- const o = i[s], r = new Uint32Array(o), a = new Uint16Array(o), c = o.byteLength / H;
1043
+ const o = i[s], r = new Uint32Array(o), a = new Uint16Array(o), c = o.byteLength / W;
1044
1044
  for (let d = 0; d < c; d++) {
1045
1045
  const f = z * d, l = 2 * f;
1046
1046
  V(l, a) && (r[f + 6] += t);
@@ -1065,11 +1065,11 @@ class gi {
1065
1065
  refit() {
1066
1066
  const t = this._roots;
1067
1067
  for (let e = 0, i = t.length; e < i; e++) {
1068
- const s = t[e], o = new Uint32Array(s), r = new Uint16Array(s), a = new Float32Array(s), c = s.byteLength / H;
1068
+ const s = t[e], o = new Uint32Array(s), r = new Uint16Array(s), a = new Float32Array(s), c = s.byteLength / W;
1069
1069
  for (let d = c - 1; d >= 0; d--) {
1070
1070
  const f = d * z, l = f * 2;
1071
1071
  if (V(l, r)) {
1072
- const p = W(f, o), S = X(l, r);
1072
+ const p = Y(f, o), S = X(l, r);
1073
1073
  this.writePrimitiveRangeBounds(p, S, St, 0), a.set(St, f);
1074
1074
  } else {
1075
1075
  const p = $(f), S = k(f, o);
@@ -1108,7 +1108,7 @@ class gi {
1108
1108
  const p = f[l];
1109
1109
  if (c = hi(this, l, i, s, e, d), c)
1110
1110
  break;
1111
- d += p.byteLength / H;
1111
+ d += p.byteLength / W;
1112
1112
  }
1113
1113
  return c;
1114
1114
  }
@@ -1441,9 +1441,9 @@ it.prototype.intersectsTriangle = /* @__PURE__ */ function() {
1441
1441
  return !1;
1442
1442
  s.copy(A.normal), o.copy(B.normal);
1443
1443
  const et = s.cross(o);
1444
- let C = 0, Z = Math.abs(et.x);
1444
+ let C = 0, K = Math.abs(et.x);
1445
1445
  const Ut = Math.abs(et.y);
1446
- Ut > Z && (Z = Ut, C = 1), Math.abs(et.z) > Z && (C = 2);
1446
+ Ut > K && (K = Ut, C = 1), Math.abs(et.z) > K && (C = 2);
1447
1447
  const lt = Ii[C], kt = this.a[lt], qt = this.b[lt], Jt = this.c[lt], Ht = y.a[lt], Wt = y.b[lt], Dn = y.c[lt];
1448
1448
  if (S(this, kt, qt, Jt, M, v, b, T, x, f, a))
1449
1449
  return u(this, y, w, E);
@@ -1751,7 +1751,7 @@ function Di(n, t = null) {
1751
1751
  function l(u, p, S = !1) {
1752
1752
  const P = u * 2;
1753
1753
  if (V(P, a)) {
1754
- const _ = W(u, r), I = X(P, a);
1754
+ const _ = Y(u, r), I = X(P, a);
1755
1755
  let m = 1 / 0, g = 1 / 0, y = 1 / 0, w = -1 / 0, E = -1 / 0, h = -1 / 0;
1756
1756
  for (let A = 3 * _, B = 3 * (_ + I); A < B; A++) {
1757
1757
  let b = i[A];
@@ -1764,7 +1764,7 @@ function Di(n, t = null) {
1764
1764
  let m = S, g = !1, y = !1;
1765
1765
  if (t) {
1766
1766
  if (!m) {
1767
- const b = _ / z + p / H, T = I / z + p / H;
1767
+ const b = _ / z + p / W, T = I / z + p / W;
1768
1768
  g = t.has(b), y = t.has(T), m = !g && !y;
1769
1769
  }
1770
1770
  } else
@@ -1821,7 +1821,7 @@ function zi(n, t, e, i, s, o, r) {
1821
1821
  function Re(n, t, e, i, s, o, r) {
1822
1822
  const { float32Array: a, uint16Array: c, uint32Array: d } = D, f = n * 2;
1823
1823
  if (V(f, c)) {
1824
- const u = W(n, d), p = X(f, c);
1824
+ const u = Y(n, d), p = X(f, c);
1825
1825
  Ui(t, e, i, u, p, s, o, r);
1826
1826
  } else {
1827
1827
  const u = $(n);
@@ -1840,7 +1840,7 @@ function De(n, t, e, i, s, o) {
1840
1840
  const { float32Array: r, uint16Array: a, uint32Array: c } = D;
1841
1841
  let d = n * 2;
1842
1842
  if (V(d, a)) {
1843
- const l = W(n, c), u = X(d, a);
1843
+ const l = Y(n, c), u = X(d, a);
1844
1844
  return Li(t, e, i, l, u, s, o);
1845
1845
  } else {
1846
1846
  const l = $e(n, c), u = Vi[l], S = i.direction[u] >= 0;
@@ -1869,7 +1869,7 @@ function Ce(n, t, e, i, s = null) {
1869
1869
  const { float32Array: o, uint16Array: r, uint32Array: a } = D;
1870
1870
  let c = n * 2;
1871
1871
  if (s === null && (e.boundingBox || e.computeBoundingBox(), an.set(e.boundingBox.min, e.boundingBox.max, i), s = an), V(c, r)) {
1872
- const f = t.geometry, l = f.index, u = f.attributes.position, p = e.index, S = e.attributes.position, P = W(n, a), _ = X(c, r);
1872
+ const f = t.geometry, l = f.index, u = f.attributes.position, p = e.index, S = e.attributes.position, P = Y(n, a), _ = X(c, r);
1873
1873
  if (Ot.copy(i).invert(), e.boundsTree)
1874
1874
  return O(n, o, ne), ne.matrix.copy(Ot), ne.needsUpdate = !0, e.boundsTree.shapecast({
1875
1875
  intersectsBounds: (m) => ne.intersectsBox(m),
@@ -1949,7 +1949,7 @@ function Yi(n, t = null) {
1949
1949
  function l(u, p, S = !1) {
1950
1950
  const P = u * 2;
1951
1951
  if (V(P, a)) {
1952
- const _ = W(u, r), I = X(P, a);
1952
+ const _ = Y(u, r), I = X(P, a);
1953
1953
  let m = 1 / 0, g = 1 / 0, y = 1 / 0, w = -1 / 0, E = -1 / 0, h = -1 / 0;
1954
1954
  for (let A = _, B = _ + I; A < B; A++) {
1955
1955
  const b = 3 * n.resolveTriangleIndex(A);
@@ -1966,7 +1966,7 @@ function Yi(n, t = null) {
1966
1966
  let m = S, g = !1, y = !1;
1967
1967
  if (t) {
1968
1968
  if (!m) {
1969
- const b = _ / z + p / H, T = I / z + p / H;
1969
+ const b = _ / z + p / W, T = I / z + p / W;
1970
1970
  g = t.has(b), y = t.has(T), m = !g && !y;
1971
1971
  }
1972
1972
  } else
@@ -1992,7 +1992,7 @@ function Xi(n, t, e, i, s, o, r) {
1992
1992
  function Oe(n, t, e, i, s, o, r) {
1993
1993
  const { float32Array: a, uint16Array: c, uint32Array: d } = D, f = n * 2;
1994
1994
  if (V(f, c)) {
1995
- const u = W(n, d), p = X(f, c);
1995
+ const u = Y(n, d), p = X(f, c);
1996
1996
  Ci(t, e, i, u, p, s, o, r);
1997
1997
  } else {
1998
1998
  const u = $(n);
@@ -2011,7 +2011,7 @@ function Fe(n, t, e, i, s, o) {
2011
2011
  const { float32Array: r, uint16Array: a, uint32Array: c } = D;
2012
2012
  let d = n * 2;
2013
2013
  if (V(d, a)) {
2014
- const l = W(n, c), u = X(d, a);
2014
+ const l = Y(n, c), u = X(d, a);
2015
2015
  return Oi(t, e, i, l, u, s, o);
2016
2016
  } else {
2017
2017
  const l = $e(n, c), u = Gi[l], S = i.direction[u] >= 0;
@@ -2040,7 +2040,7 @@ function ze(n, t, e, i, s = null) {
2040
2040
  const { float32Array: o, uint16Array: r, uint32Array: a } = D;
2041
2041
  let c = n * 2;
2042
2042
  if (s === null && (e.boundingBox || e.computeBoundingBox(), ln.set(e.boundingBox.min, e.boundingBox.max, i), s = ln), V(c, r)) {
2043
- const f = t.geometry, l = f.index, u = f.attributes.position, p = e.index, S = e.attributes.position, P = W(n, a), _ = X(c, r);
2043
+ const f = t.geometry, l = f.index, u = f.attributes.position, p = e.index, S = e.attributes.position, P = Y(n, a), _ = X(c, r);
2044
2044
  if (zt.copy(i).invert(), e.boundsTree)
2045
2045
  return O(n, o, re), re.matrix.copy(zt), re.needsUpdate = !0, e.boundsTree.shapecast({
2046
2046
  intersectsBounds: (m) => re.intersectsBox(m),
@@ -2155,7 +2155,7 @@ class me extends Bi {
2155
2155
  function c(d) {
2156
2156
  for (let f = 0; f < d.length; f++) {
2157
2157
  const l = d[f], u = new Uint32Array(l), p = new Uint16Array(l);
2158
- for (let S = 0, P = l.byteLength / H; S < P; S++) {
2158
+ for (let S = 0, P = l.byteLength / W; S < P; S++) {
2159
2159
  const _ = z * S, I = 2 * _;
2160
2160
  V(I, p) || (u[_ + 6] = u[_ + 6] / z - S);
2161
2161
  }
@@ -2459,11 +2459,11 @@ function cs(n) {
2459
2459
  }
2460
2460
  class Us {
2461
2461
  constructor(t, e, i = {}) {
2462
- K(this, "root");
2463
- K(this, "bodies", /* @__PURE__ */ new Map());
2464
- K(this, "links", /* @__PURE__ */ new Map());
2465
- K(this, "raycastAcceleration");
2466
- K(this, "disposed", !1);
2462
+ Z(this, "root");
2463
+ Z(this, "bodies", /* @__PURE__ */ new Map());
2464
+ Z(this, "links", /* @__PURE__ */ new Map());
2465
+ Z(this, "raycastAcceleration");
2466
+ Z(this, "disposed", !1);
2467
2467
  this.runtime = t, this.root = e.root, this.raycastAcceleration = i.accelerateRaycast === !1 ? null : os([this.root]);
2468
2468
  const s = t.mujoco, o = t.model;
2469
2469
  for (const [r, a] of e.bindings) {
@@ -2575,30 +2575,40 @@ function wn(n) {
2575
2575
  }
2576
2576
  class Rs {
2577
2577
  constructor(t) {
2578
- K(this, "entries", /* @__PURE__ */ new Map());
2579
- K(this, "objectUrls", /* @__PURE__ */ new Map());
2580
- K(this, "objectUrlPaths", /* @__PURE__ */ new Map());
2578
+ Z(this, "entries", /* @__PURE__ */ new Map());
2579
+ Z(this, "manifestPaths", /* @__PURE__ */ new Set());
2580
+ Z(this, "objectUrls", /* @__PURE__ */ new Map());
2581
+ Z(this, "objectUrlPaths", /* @__PURE__ */ new Map());
2581
2582
  /**
2582
2583
  * Reads that already failed, so a missing resource is not requested again by
2583
2584
  * the visual adapter after the reference prefetch has recorded it.
2584
2585
  */
2585
- K(this, "failures", /* @__PURE__ */ new Map());
2586
- K(this, "pending", /* @__PURE__ */ new Map());
2587
- K(this, "disposed", !1);
2586
+ Z(this, "failures", /* @__PURE__ */ new Map());
2587
+ Z(this, "pending", /* @__PURE__ */ new Map());
2588
+ Z(this, "disposed", !1);
2588
2589
  this.source = t;
2590
+ for (const i of t.resourcePaths ?? []) {
2591
+ const s = H(i);
2592
+ s && this.manifestPaths.add(s);
2593
+ }
2589
2594
  const e = t.original;
2590
2595
  if (ys(e))
2591
- for (const i of e.files) this.entries.set(Y(i.path), i.file);
2596
+ for (const i of e.files) this.entries.set(H(i.path), i.file);
2592
2597
  else typeof Blob < "u" && e instanceof Blob ? this.entries.set(t.entryPath ?? t.filename ?? "asset", e) : e instanceof ArrayBuffer ? this.entries.set(t.entryPath ?? t.filename ?? "asset", new Blob([e])) : typeof e == "object" && e !== null && "kind" in e && e.kind === "buffer" && this.entries.set(t.entryPath ?? t.filename ?? "asset", new Blob([e.buffer]));
2593
2598
  }
2594
2599
  paths() {
2595
- return [...this.entries.keys()];
2600
+ return [.../* @__PURE__ */ new Set([...this.entries.keys(), ...this.manifestPaths])];
2596
2601
  }
2597
2602
  hasLocalFiles() {
2598
2603
  return this.entries.size > 0;
2599
2604
  }
2600
2605
  put(t, e) {
2601
- this.entries.set(Y(t), e);
2606
+ const i = H(t);
2607
+ this.entries.set(i, e), this.manifestPaths.add(i);
2608
+ }
2609
+ hasBlob(t) {
2610
+ const e = this.find(t);
2611
+ return e !== null && this.entries.has(e);
2602
2612
  }
2603
2613
  relativePaths(t = "", e = !1) {
2604
2614
  return [...this.relativeEntries(t, e)].map(([i]) => i);
@@ -2607,7 +2617,7 @@ class Rs {
2607
2617
  return Object.fromEntries(this.relativeEntries(t, e));
2608
2618
  }
2609
2619
  *relativeEntries(t = "", e = !1) {
2610
- const i = Y(t), s = i ? `${i}/` : "";
2620
+ const i = H(t), s = i ? `${i}/` : "";
2611
2621
  for (const [o, r] of this.entries)
2612
2622
  if (!s || o.startsWith(s)) yield [s ? o.slice(s.length) : o, r];
2613
2623
  else if (e) {
@@ -2620,15 +2630,15 @@ class Rs {
2620
2630
  resolve(t, e = "") {
2621
2631
  const i = this.find(t, e);
2622
2632
  if (i) return i;
2623
- const s = Y(e).split("/").slice(0, -1).join("/");
2624
- if (this.source.url) return Y(`${s}/${t.replace(/^package:\/\//, "")}`);
2633
+ const s = H(e).split("/").slice(0, -1).join("/");
2634
+ if (this.source.url) return H(`${s}/${t.replace(/^package:\/\//, "")}`);
2625
2635
  throw ft(`Simulation resource not found: ${t}`, "E_ASSET_RESOURCE_NOT_FOUND");
2626
2636
  }
2627
2637
  find(t, e = "") {
2628
- const i = Y(t.replace(/^package:\/\//, ""));
2638
+ const i = H(t.replace(/^package:\/\//, ""));
2629
2639
  if (Nt(i)) return this.entries.has(i) ? i : null;
2630
- const s = Y(e).split("/").slice(0, -1).join("/");
2631
- for (const r of [Y(`${s}/${t.replace(/^package:\/\//, "")}`), i])
2640
+ const s = H(e).split("/").slice(0, -1).join("/");
2641
+ for (const r of [H(`${s}/${t.replace(/^package:\/\//, "")}`), i])
2632
2642
  if (this.entries.has(r)) return r;
2633
2643
  const o = this.paths().filter(
2634
2644
  (r) => !Nt(r) && (r === i || r.endsWith(`/${i}`) || i.endsWith(`/${r}`))
@@ -2654,7 +2664,7 @@ class Rs {
2654
2664
  }
2655
2665
  async ensure(t, e = this.source.signal) {
2656
2666
  if (Lt(e), this.disposed) throw new DOMException("The resource package was disposed.", "AbortError");
2657
- const i = Y(t);
2667
+ const i = H(t);
2658
2668
  if (this.entries.has(i)) return;
2659
2669
  const s = this.failures.get(i);
2660
2670
  if (s) throw s;
@@ -2711,7 +2721,7 @@ class Rs {
2711
2721
  }
2712
2722
  /** The recorded failure for a resource, if a previous read already failed. */
2713
2723
  failureOf(t) {
2714
- return this.failures.get(Y(t));
2724
+ return this.failures.get(H(t));
2715
2725
  }
2716
2726
  objectUrl(t) {
2717
2727
  const e = this.resolve(t);
@@ -2740,25 +2750,27 @@ class Rs {
2740
2750
  * entry directory does not contain falls back to the whole package.
2741
2751
  */
2742
2752
  texturesUnderEntryDirectory(t) {
2743
- const e = Y(t);
2753
+ const e = H(t);
2744
2754
  return e ? this.paths().filter((i) => i.startsWith(`${e}/`) && /\d{4}\.[^/]*$/i.test(i)) : [];
2745
2755
  }
2746
2756
  objectUrlIfPresent(t, e = "") {
2747
2757
  const i = this.findTexture(t, e);
2748
- return i ? this.objectUrl(i) : null;
2758
+ return i && this.entries.has(i) ? this.objectUrl(i) : null;
2749
2759
  }
2750
2760
  findPresent(t, e = "") {
2751
2761
  if (Nt(t)) {
2752
2762
  if (this.entries.has(t)) return t;
2753
- const a = this.bindPackageReference(t, e);
2754
- return a === t ? null : this.findPresent(a, e);
2755
- }
2756
- const i = Y(e), s = i ? `${i}/` : "", o = Y(t), r = s ? this.paths().filter((a) => {
2757
- if (!a.startsWith(s)) return !1;
2758
- const c = a.slice(s.length);
2759
- return c === o || o.endsWith(`/${c}`);
2763
+ const c = this.bindPackageReference(t, e);
2764
+ return c === t ? null : this.findPresent(c, e);
2765
+ }
2766
+ const i = H(e), s = i ? `${i}/` : "", o = H(t), r = H(s ? `${s}${o}` : o);
2767
+ if (this.entries.has(r)) return r;
2768
+ const a = s ? this.paths().filter((c) => {
2769
+ if (!c.startsWith(s)) return !1;
2770
+ const d = c.slice(s.length);
2771
+ return d === o || o.endsWith(`/${d}`);
2760
2772
  }) : [];
2761
- return r.length === 1 ? r[0] : this.find(t);
2773
+ return a.length === 1 ? a[0] : this.find(t);
2762
2774
  }
2763
2775
  /**
2764
2776
  * Rewrites a protocol reference (`https://bucket/asset/textures/a.png`,
@@ -2769,7 +2781,7 @@ class Rs {
2769
2781
  * References that are not URLs, or that bind to nothing, are returned as-is.
2770
2782
  */
2771
2783
  bindPackageReference(t, e = "") {
2772
- const i = Y(e), s = i ? `${i}/` : "", o = hs(t).flatMap((a) => a.split("/")).filter(Boolean);
2784
+ const i = H(e), s = i ? `${i}/` : "", o = hs(t).flatMap((a) => a.split("/")).filter(Boolean);
2773
2785
  if (!o.length) return t;
2774
2786
  let r = null;
2775
2787
  for (const a of this.paths()) {
@@ -2786,7 +2798,7 @@ class Rs {
2786
2798
  for (const t of this.pending.values()) t.controller.abort();
2787
2799
  this.pending.clear();
2788
2800
  for (const t of this.objectUrls.values()) URL.revokeObjectURL(t);
2789
- this.objectUrls.clear(), this.objectUrlPaths.clear(), this.entries.clear(), this.failures.clear();
2801
+ this.objectUrls.clear(), this.objectUrlPaths.clear(), this.entries.clear(), this.manifestPaths.clear(), this.failures.clear();
2790
2802
  }
2791
2803
  }
2792
2804
  async function Ds(n, t) {
@@ -2796,9 +2808,9 @@ async function Ds(n, t) {
2796
2808
  return e.text();
2797
2809
  }
2798
2810
  function Cs(n) {
2799
- return Y(n);
2811
+ return H(n);
2800
2812
  }
2801
- function Y(n) {
2813
+ function H(n) {
2802
2814
  if (Nt(n)) return n;
2803
2815
  const t = [];
2804
2816
  for (const e of n.replaceAll("\\", "/").split("/"))