@nebula-spatial/viewer 0.5.13 → 0.5.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +45 -0
- package/README.md +32 -34
- package/dist/assets/types.d.ts +10 -1
- package/dist/assets/{usd-worker-CPCXyXkl.js → usd-worker-DU-u_iJN.js} +558 -502
- package/dist/{collision-debug-Aey5D_9r.js → collision-debug-1-acufd9.js} +55 -53
- package/dist/{index-DbJbq4N_.js → index-YdnQRm_T.js} +850 -836
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/{mjcf-visual-B3UBh_gG.js → mjcf-visual-DTO5j9bm.js} +1 -1
- package/dist/{mujoco-runtime-BPCq2bmg.js → mujoco-runtime-gqyaQh9L.js} +1 -1
- package/dist/runtime-paths-Dj0itY6G.js +8 -0
- package/dist/{session-52jx0mHi.js → session-AUG5EJBJ.js} +7 -7
- package/dist/{session-C0KFNp50.js → session-mJGcCljH.js} +132 -129
- package/dist/simulation/usd-preload.d.ts +2 -0
- package/dist/simulation/usd-prewarm.d.ts +6 -0
- package/dist/{stage-PhbBBoMY.js → stage-BVdJLgsW.js} +1 -1
- package/dist/{urdf-session-DPOKRNNw.js → urdf-session-oLRIcAw1.js} +5 -5
- package/dist/{usd-session-Co9oFkxC.js → usd-session-Dexv9ijX.js} +1861 -1807
- package/dist/version.d.ts +1 -1
- package/dist/{xacro-B50iFe4M.js → xacro-BjsYN_8k.js} +1 -1
- package/draco/draco_decoder.wasm +0 -0
- package/draco/draco_wasm_wrapper.js +117 -0
- package/openusd/openusd-runtime-manifest.json +3 -3
- package/openusd/openusd_probe.wasm +0 -0
- package/package.json +28 -4
- package/runtime-assets.d.mts +9 -0
- package/runtime-assets.mjs +11 -0
- package/vite.d.mts +7 -0
- package/vite.mjs +115 -0
|
@@ -3,7 +3,7 @@ var On = (n, t, e) => t in n ? Cn(n, t, { enumerable: !0, configurable: !0, writ
|
|
|
3
3
|
var K = (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-
|
|
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-YdnQRm_T.js";
|
|
7
7
|
const Zn = /* @__PURE__ */ new Set([
|
|
8
8
|
"E_MJCF_INCLUDE_CYCLE",
|
|
9
9
|
"E_MJCF_PARSE",
|
|
@@ -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,
|
|
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
|
|
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 +
|
|
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 +
|
|
634
|
+
const { left: r, right: a, splitAxis: c } = t, d = n + W;
|
|
635
635
|
let f = Ue(d, r);
|
|
636
|
-
const l = n /
|
|
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(
|
|
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 =
|
|
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
|
|
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
|
|
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 /
|
|
806
|
+
), pe.clearBuffer(), c += o[p].byteLength / W, !r); p++)
|
|
807
807
|
;
|
|
808
|
-
if (dt.releasePrimitive(u), jt.clearBuffer(), a += s[f].byteLength /
|
|
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
|
-
|
|
820
|
+
Y(t, I),
|
|
821
821
|
X(t * 2, m),
|
|
822
|
-
|
|
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
|
-
|
|
829
|
+
Y(n, S),
|
|
830
830
|
X(n * 2, P),
|
|
831
|
-
|
|
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 /
|
|
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 /
|
|
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 =
|
|
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 /
|
|
1111
|
+
d += p.byteLength / W;
|
|
1112
1112
|
}
|
|
1113
1113
|
return c;
|
|
1114
1114
|
}
|
|
@@ -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 _ =
|
|
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 /
|
|
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 =
|
|
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 =
|
|
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 =
|
|
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 _ =
|
|
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 /
|
|
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 =
|
|
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 =
|
|
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 =
|
|
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 /
|
|
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
|
}
|
|
@@ -2588,7 +2588,7 @@ class Rs {
|
|
|
2588
2588
|
this.source = t;
|
|
2589
2589
|
const e = t.original;
|
|
2590
2590
|
if (ys(e))
|
|
2591
|
-
for (const i of e.files) this.entries.set(
|
|
2591
|
+
for (const i of e.files) this.entries.set(H(i.path), i.file);
|
|
2592
2592
|
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
2593
|
}
|
|
2594
2594
|
paths() {
|
|
@@ -2598,7 +2598,7 @@ class Rs {
|
|
|
2598
2598
|
return this.entries.size > 0;
|
|
2599
2599
|
}
|
|
2600
2600
|
put(t, e) {
|
|
2601
|
-
this.entries.set(
|
|
2601
|
+
this.entries.set(H(t), e);
|
|
2602
2602
|
}
|
|
2603
2603
|
relativePaths(t = "", e = !1) {
|
|
2604
2604
|
return [...this.relativeEntries(t, e)].map(([i]) => i);
|
|
@@ -2607,7 +2607,7 @@ class Rs {
|
|
|
2607
2607
|
return Object.fromEntries(this.relativeEntries(t, e));
|
|
2608
2608
|
}
|
|
2609
2609
|
*relativeEntries(t = "", e = !1) {
|
|
2610
|
-
const i =
|
|
2610
|
+
const i = H(t), s = i ? `${i}/` : "";
|
|
2611
2611
|
for (const [o, r] of this.entries)
|
|
2612
2612
|
if (!s || o.startsWith(s)) yield [s ? o.slice(s.length) : o, r];
|
|
2613
2613
|
else if (e) {
|
|
@@ -2620,15 +2620,15 @@ class Rs {
|
|
|
2620
2620
|
resolve(t, e = "") {
|
|
2621
2621
|
const i = this.find(t, e);
|
|
2622
2622
|
if (i) return i;
|
|
2623
|
-
const s =
|
|
2624
|
-
if (this.source.url) return
|
|
2623
|
+
const s = H(e).split("/").slice(0, -1).join("/");
|
|
2624
|
+
if (this.source.url) return H(`${s}/${t.replace(/^package:\/\//, "")}`);
|
|
2625
2625
|
throw ft(`Simulation resource not found: ${t}`, "E_ASSET_RESOURCE_NOT_FOUND");
|
|
2626
2626
|
}
|
|
2627
2627
|
find(t, e = "") {
|
|
2628
|
-
const i =
|
|
2628
|
+
const i = H(t.replace(/^package:\/\//, ""));
|
|
2629
2629
|
if (Nt(i)) return this.entries.has(i) ? i : null;
|
|
2630
|
-
const s =
|
|
2631
|
-
for (const r of [
|
|
2630
|
+
const s = H(e).split("/").slice(0, -1).join("/");
|
|
2631
|
+
for (const r of [H(`${s}/${t.replace(/^package:\/\//, "")}`), i])
|
|
2632
2632
|
if (this.entries.has(r)) return r;
|
|
2633
2633
|
const o = this.paths().filter(
|
|
2634
2634
|
(r) => !Nt(r) && (r === i || r.endsWith(`/${i}`) || i.endsWith(`/${r}`))
|
|
@@ -2654,7 +2654,7 @@ class Rs {
|
|
|
2654
2654
|
}
|
|
2655
2655
|
async ensure(t, e = this.source.signal) {
|
|
2656
2656
|
if (Lt(e), this.disposed) throw new DOMException("The resource package was disposed.", "AbortError");
|
|
2657
|
-
const i =
|
|
2657
|
+
const i = H(t);
|
|
2658
2658
|
if (this.entries.has(i)) return;
|
|
2659
2659
|
const s = this.failures.get(i);
|
|
2660
2660
|
if (s) throw s;
|
|
@@ -2711,7 +2711,7 @@ class Rs {
|
|
|
2711
2711
|
}
|
|
2712
2712
|
/** The recorded failure for a resource, if a previous read already failed. */
|
|
2713
2713
|
failureOf(t) {
|
|
2714
|
-
return this.failures.get(
|
|
2714
|
+
return this.failures.get(H(t));
|
|
2715
2715
|
}
|
|
2716
2716
|
objectUrl(t) {
|
|
2717
2717
|
const e = this.resolve(t);
|
|
@@ -2740,7 +2740,7 @@ class Rs {
|
|
|
2740
2740
|
* entry directory does not contain falls back to the whole package.
|
|
2741
2741
|
*/
|
|
2742
2742
|
texturesUnderEntryDirectory(t) {
|
|
2743
|
-
const e =
|
|
2743
|
+
const e = H(t);
|
|
2744
2744
|
return e ? this.paths().filter((i) => i.startsWith(`${e}/`) && /\d{4}\.[^/]*$/i.test(i)) : [];
|
|
2745
2745
|
}
|
|
2746
2746
|
objectUrlIfPresent(t, e = "") {
|
|
@@ -2750,15 +2750,17 @@ class Rs {
|
|
|
2750
2750
|
findPresent(t, e = "") {
|
|
2751
2751
|
if (Nt(t)) {
|
|
2752
2752
|
if (this.entries.has(t)) return t;
|
|
2753
|
-
const
|
|
2754
|
-
return
|
|
2755
|
-
}
|
|
2756
|
-
const i =
|
|
2757
|
-
|
|
2758
|
-
|
|
2759
|
-
|
|
2753
|
+
const c = this.bindPackageReference(t, e);
|
|
2754
|
+
return c === t ? null : this.findPresent(c, e);
|
|
2755
|
+
}
|
|
2756
|
+
const i = H(e), s = i ? `${i}/` : "", o = H(t), r = H(s ? `${s}${o}` : o);
|
|
2757
|
+
if (this.entries.has(r)) return r;
|
|
2758
|
+
const a = s ? this.paths().filter((c) => {
|
|
2759
|
+
if (!c.startsWith(s)) return !1;
|
|
2760
|
+
const d = c.slice(s.length);
|
|
2761
|
+
return d === o || o.endsWith(`/${d}`);
|
|
2760
2762
|
}) : [];
|
|
2761
|
-
return
|
|
2763
|
+
return a.length === 1 ? a[0] : this.find(t);
|
|
2762
2764
|
}
|
|
2763
2765
|
/**
|
|
2764
2766
|
* Rewrites a protocol reference (`https://bucket/asset/textures/a.png`,
|
|
@@ -2769,7 +2771,7 @@ class Rs {
|
|
|
2769
2771
|
* References that are not URLs, or that bind to nothing, are returned as-is.
|
|
2770
2772
|
*/
|
|
2771
2773
|
bindPackageReference(t, e = "") {
|
|
2772
|
-
const i =
|
|
2774
|
+
const i = H(e), s = i ? `${i}/` : "", o = hs(t).flatMap((a) => a.split("/")).filter(Boolean);
|
|
2773
2775
|
if (!o.length) return t;
|
|
2774
2776
|
let r = null;
|
|
2775
2777
|
for (const a of this.paths()) {
|
|
@@ -2796,9 +2798,9 @@ async function Ds(n, t) {
|
|
|
2796
2798
|
return e.text();
|
|
2797
2799
|
}
|
|
2798
2800
|
function Cs(n) {
|
|
2799
|
-
return
|
|
2801
|
+
return H(n);
|
|
2800
2802
|
}
|
|
2801
|
-
function
|
|
2803
|
+
function H(n) {
|
|
2802
2804
|
if (Nt(n)) return n;
|
|
2803
2805
|
const t = [];
|
|
2804
2806
|
for (const e of n.replaceAll("\\", "/").split("/"))
|