@nebula-spatial/viewer 0.6.0 → 0.6.2

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,20 +1,20 @@
1
- function Ie(e, t) {
2
- return /^https?:$/.test(t.protocol) && e.origin === t.origin && !e.username && !e.password && ge(e.pathname).startsWith(ge(new URL(".", t).pathname));
1
+ function Re(e, t) {
2
+ return /^https?:$/.test(t.protocol) && e.origin === t.origin && !e.username && !e.password && ye(e.pathname).startsWith(ye(new URL(".", t).pathname));
3
3
  }
4
- function ge(e) {
4
+ function ye(e) {
5
5
  return e.endsWith("/") ? e : e.slice(0, e.lastIndexOf("/") + 1);
6
6
  }
7
- function Be(e, t) {
7
+ function ze(e, t) {
8
8
  for (const n of e) for (const s of n.shaders) for (const a of Object.values(s.inputs)) {
9
9
  if (!a || typeof a != "object" || Array.isArray(a)) continue;
10
10
  const o = a, r = [o.path, o.url, o.resolvedPath].find((c) => typeof c == "string" && c);
11
11
  !r || /^(?:data|blob):/i.test(r) || /\.mdl(?:[?#].*)?$/i.test(r) || t(o, r);
12
12
  }
13
13
  }
14
- function Fe(e, t, n) {
14
+ function We(e, t, n) {
15
15
  const s = [];
16
16
  try {
17
- return Be(e, (a, o) => {
17
+ return ze(e, (a, o) => {
18
18
  if (t(o)) return;
19
19
  const r = {};
20
20
  for (const c of ["path", "resolvedPath", "url"])
@@ -25,7 +25,7 @@ function Fe(e, t, n) {
25
25
  for (const { asset: a, values: o } of s) Object.assign(a, o);
26
26
  }
27
27
  }
28
- const ze = "E_ASSET_RESOURCE_NOT_FOUND", Ae = "E_ASSET_RESOURCE_INVALID", We = "E_ASSET_FETCH", He = "E_ASSET_EXTERNAL_DENIED", Xe = "E_ASSET_AUTH", Je = /* @__PURE__ */ new Set([
28
+ const He = "E_ASSET_RESOURCE_NOT_FOUND", Ne = "E_ASSET_RESOURCE_INVALID", Je = "E_ASSET_FETCH", Xe = "E_ASSET_EXTERNAL_DENIED", qe = "E_ASSET_AUTH", Ze = /* @__PURE__ */ new Set([
29
29
  "png",
30
30
  "jpg",
31
31
  "jpeg",
@@ -38,72 +38,72 @@ const ze = "E_ASSET_RESOURCE_NOT_FOUND", Ae = "E_ASSET_RESOURCE_INVALID", We = "
38
38
  "hdr",
39
39
  "exr",
40
40
  "ktx2"
41
- ]), qe = /* @__PURE__ */ new Set(["usd", "usda", "usdc", "usdz"]);
42
- function Ze(e) {
41
+ ]), Ye = /* @__PURE__ */ new Set(["usd", "usda", "usdc", "usdz"]);
42
+ function Ke(e) {
43
43
  var n;
44
44
  return ((n = (e.split(/[?#]/, 1)[0] ?? e).split(".").pop()) == null ? void 0 : n.toLowerCase()) ?? "";
45
45
  }
46
- function Ye(e) {
47
- const t = Ze(e);
48
- return Je.has(t) && !qe.has(t);
46
+ function Qe(e) {
47
+ const t = Ke(e);
48
+ return Ze.has(t) && !Ye.has(t);
49
49
  }
50
- function Ke(e, t) {
50
+ function et(e, t) {
51
51
  return Object.assign(new Error(e), { code: t });
52
52
  }
53
- function Qe(e) {
53
+ function tt(e) {
54
54
  var s;
55
55
  if (e instanceof Error && e.name === "AbortError") return "aborted";
56
56
  const t = e == null ? void 0 : e.code;
57
- if (t === ze) return "missing";
58
- if (t === Ae) return "invalid";
59
- if (t === We) return "unavailable";
60
- if (t === Xe || t === He) return "denied";
57
+ if (t === He) return "missing";
58
+ if (t === Ne) return "invalid";
59
+ if (t === Je) return "unavailable";
60
+ if (t === qe || t === Xe) return "denied";
61
61
  const n = (s = /\((\d{3})\)/.exec(e instanceof Error ? e.message : "")) == null ? void 0 : s[1];
62
62
  return n === "404" || n === "410" ? "missing" : n === "401" || n === "403" ? "denied" : n != null && n.startsWith("5") ? "unavailable" : "unknown";
63
63
  }
64
- function et(e) {
65
- const t = Qe(e);
64
+ function nt(e) {
65
+ const t = tt(e);
66
66
  return t === "missing" || t === "invalid" || t === "unavailable";
67
67
  }
68
- function tt(e, t) {
68
+ function rt(e, t) {
69
69
  return e && /\bhtml\b/i.test(e) ? `返回 HTML 页面(${e})` : e && !/^text\//i.test(e) ? null : /^\uFEFF?\s*(?:<!doctype\s+html|<html|<\?xml[^>]*\bhtml)/i.test(t) ? "返回 HTML 兜底页" : null;
70
70
  }
71
- function nt(e, t) {
72
- return t.byteLength ? tt(e, new TextDecoder().decode(t.subarray(0, 512))) : "响应内容为空";
73
- }
74
- const rt = /<UDIM>/i;
75
71
  function st(e, t) {
76
- const n = me(e).replaceAll("\\", "/");
77
- if (!rt.test(n)) return null;
78
- const s = we(n), a = s.split("/").at(-1);
72
+ return t.byteLength ? rt(e, new TextDecoder().decode(t.subarray(0, 512))) : "响应内容为空";
73
+ }
74
+ const ot = /<UDIM>/i;
75
+ function at(e, t) {
76
+ const n = we(e).replaceAll("\\", "/");
77
+ if (!ot.test(n)) return null;
78
+ const s = _e(n), a = s.split("/").at(-1);
79
79
  if (!a) return { paths: [], tiles: [] };
80
- const o = ot(a);
80
+ const o = it(a);
81
81
  if (!o) return { paths: [], tiles: [] };
82
82
  const r = [];
83
- for (const l of new Set(t)) {
84
- const p = me(l).replaceAll("\\", "/"), g = we(p), u = g.split("/").at(-1);
83
+ for (const f of new Set(t)) {
84
+ const p = we(f).replaceAll("\\", "/"), y = _e(p), l = y.split("/").at(-1);
85
+ if (!l) continue;
86
+ const u = o.exec(l);
85
87
  if (!u) continue;
86
- const f = o.exec(u);
87
- if (!f) continue;
88
- const h = Number(f[1]);
88
+ const h = Number(u[1]);
89
89
  !Number.isInteger(h) || h < 1001 || h > 9999 || r.push({
90
- path: l,
90
+ path: f,
91
91
  tile: h,
92
- score: at(s, g)
92
+ score: ct(s, y)
93
93
  });
94
94
  }
95
95
  if (!r.length) return { paths: [], tiles: [] };
96
- const c = Math.max(...r.map((l) => l.score)), i = r.filter((l) => l.score === c).sort((l, p) => l.tile - p.tile || l.path.localeCompare(p.path));
96
+ const c = Math.max(...r.map((f) => f.score)), i = r.filter((f) => f.score === c).sort((f, p) => f.tile - p.tile || f.path.localeCompare(p.path));
97
97
  return {
98
- paths: i.map((l) => l.path),
99
- tiles: i.map((l) => l.tile)
98
+ paths: i.map((f) => f.path),
99
+ tiles: i.map((f) => f.tile)
100
100
  };
101
101
  }
102
- function ot(e) {
102
+ function it(e) {
103
103
  const t = e.split(/<UDIM>/i);
104
- return t.length !== 2 ? null : new RegExp(`^${ye(t[0])}(\\d{4})${ye(t[1])}$`, "i");
104
+ return t.length !== 2 ? null : new RegExp(`^${be(t[0])}(\\d{4})${be(t[1])}$`, "i");
105
105
  }
106
- function at(e, t) {
106
+ function ct(e, t) {
107
107
  const n = e.split("/").slice(0, -1).filter(Boolean), s = t.split("/").slice(0, -1).filter(Boolean);
108
108
  let a = 0;
109
109
  for (; a < n.length && a < s.length; ) {
@@ -113,7 +113,7 @@ function at(e, t) {
113
113
  }
114
114
  return a;
115
115
  }
116
- function me(e) {
116
+ function we(e) {
117
117
  const t = e.replace(/%3CUDIM%3E/gi, "<UDIM>");
118
118
  try {
119
119
  return decodeURIComponent(t);
@@ -121,39 +121,39 @@ function me(e) {
121
121
  return t;
122
122
  }
123
123
  }
124
- function we(e) {
124
+ function _e(e) {
125
125
  const t = e.search(/[?#]/);
126
126
  return t < 0 ? e : e.slice(0, t);
127
127
  }
128
- function ye(e) {
128
+ function be(e) {
129
129
  return e.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
130
130
  }
131
- const it = 67324752, ct = 33639248, ut = 101010256, ie = 4294967295, lt = /* @__PURE__ */ new Set(["png", "jpg", "jpeg", "webp"]);
132
- function ft(e) {
131
+ const lt = 67324752, ut = 33639248, ft = 101010256, ce = 4294967295, dt = /* @__PURE__ */ new Set(["png", "jpg", "jpeg", "webp"]);
132
+ function ht(e) {
133
133
  return e.length > 3 && e[0] === 80 && e[1] === 75;
134
134
  }
135
- async function dt(e, t = {}) {
136
- const n = new DataView(e.buffer, e.byteOffset, e.byteLength), s = yt(n);
135
+ async function pt(e, t = {}) {
136
+ const n = new DataView(e.buffer, e.byteOffset, e.byteLength), s = bt(n);
137
137
  if (s < 0) throw new Error("Not a zip package: end of central directory not found.");
138
138
  const a = n.getUint16(s + 10, !0);
139
139
  let o = n.getUint32(s + 16, !0);
140
- if (a === 65535 || o === ie) throw new Error("ZIP64 usdz packages are not supported.");
140
+ if (a === 65535 || o === ce) throw new Error("ZIP64 usdz packages are not supported.");
141
141
  const r = /* @__PURE__ */ new Map(), c = [];
142
142
  for (let i = 0; i < a; i += 1) {
143
- if (o + 46 > n.byteLength || n.getUint32(o, !0) !== ct)
143
+ if (o + 46 > n.byteLength || n.getUint32(o, !0) !== ut)
144
144
  throw new Error(`Corrupt zip central directory at entry ${i}.`);
145
- const l = n.getUint16(o + 10, !0), p = n.getUint32(o + 20, !0), g = n.getUint16(o + 28, !0), u = n.getUint16(o + 30, !0), f = n.getUint16(o + 32, !0), h = n.getUint32(o + 42, !0);
146
- if (p === ie || h === ie)
145
+ const f = n.getUint16(o + 10, !0), p = n.getUint32(o + 20, !0), y = n.getUint16(o + 28, !0), l = n.getUint16(o + 30, !0), u = n.getUint16(o + 32, !0), h = n.getUint32(o + 42, !0);
146
+ if (p === ce || h === ce)
147
147
  throw new Error("ZIP64 usdz packages are not supported.");
148
- const y = new TextDecoder().decode(e.subarray(o + 46, o + 46 + g));
149
- o += 46 + g + u + f, !y.endsWith("/") && (t.include && !t.include(y) || c.push(pt(e, n, h, p, l).then((w) => ({ name: y, data: w }))));
148
+ const w = new TextDecoder().decode(e.subarray(o + 46, o + 46 + y));
149
+ o += 46 + y + l + u, !w.endsWith("/") && (t.include && !t.include(w) || c.push(mt(e, n, h, p, f).then((g) => ({ name: w, data: g }))));
150
150
  }
151
- for (const { name: i, data: l } of await Promise.all(c)) r.set(i, l);
151
+ for (const { name: i, data: f } of await Promise.all(c)) r.set(i, f);
152
152
  return r;
153
153
  }
154
- function ht(e) {
154
+ function gt(e) {
155
155
  if (typeof URL > "u" || typeof URL.createObjectURL != "function") return null;
156
- const t = new Map([...e].filter(([r]) => Re(r)));
156
+ const t = new Map([...e].filter(([r]) => De(r)));
157
157
  if (t.size === 0) return null;
158
158
  const n = /* @__PURE__ */ new Map();
159
159
  for (const r of t.keys()) {
@@ -164,18 +164,18 @@ function ht(e) {
164
164
  let c = s.get(r);
165
165
  if (!c) {
166
166
  const i = t.get(r);
167
- c = URL.createObjectURL(new Blob([new Uint8Array(i)], { type: wt(r) })), s.set(r, c);
167
+ c = URL.createObjectURL(new Blob([new Uint8Array(i)], { type: _t(r) })), s.set(r, c);
168
168
  }
169
169
  return c;
170
170
  }, o = (r) => {
171
171
  if (!r) return null;
172
- const c = mt(gt(r));
172
+ const c = wt(yt(r));
173
173
  if (!c) return null;
174
174
  if (t.has(c)) return a(c);
175
- const i = [...t.keys()].filter((g) => g.endsWith(`/${c}`));
175
+ const i = [...t.keys()].filter((y) => y.endsWith(`/${c}`));
176
176
  if (i.length === 1) return a(i[0]);
177
- const l = [...t.keys()].filter((g) => c.endsWith(`/${g}`));
178
- if (l.length === 1) return a(l[0]);
177
+ const f = [...t.keys()].filter((y) => c.endsWith(`/${y}`));
178
+ if (f.length === 1) return a(f[0]);
179
179
  const p = n.get(c.split("/").pop() ?? "");
180
180
  return p ? a(p) : null;
181
181
  };
@@ -189,22 +189,22 @@ function ht(e) {
189
189
  }
190
190
  };
191
191
  }
192
- function Re(e) {
193
- return lt.has(Me(e));
192
+ function De(e) {
193
+ return dt.has(Me(e));
194
194
  }
195
- async function pt(e, t, n, s, a) {
196
- if (t.getUint32(n, !0) !== it) throw new Error("Corrupt zip local file header.");
195
+ async function mt(e, t, n, s, a) {
196
+ if (t.getUint32(n, !0) !== lt) throw new Error("Corrupt zip local file header.");
197
197
  const o = t.getUint16(n + 26, !0), r = t.getUint16(n + 28, !0), c = n + 30 + o + r, i = e.subarray(c, c + s);
198
198
  if (a === 0) return i.slice();
199
199
  if (a !== 8) throw new Error(`Unsupported zip compression method ${a}.`);
200
- const l = new Blob([new Uint8Array(i)]).stream().pipeThrough(new DecompressionStream("deflate-raw"));
201
- return new Uint8Array(await new Response(l).arrayBuffer());
200
+ const f = new Blob([new Uint8Array(i)]).stream().pipeThrough(new DecompressionStream("deflate-raw"));
201
+ return new Uint8Array(await new Response(f).arrayBuffer());
202
202
  }
203
- function gt(e) {
203
+ function yt(e) {
204
204
  const t = e.indexOf("[");
205
205
  return t >= 0 && e.endsWith("]") ? e.slice(t + 1, -1) : e;
206
206
  }
207
- function mt(e) {
207
+ function wt(e) {
208
208
  const t = [];
209
209
  for (const n of e.replaceAll("\\", "/").split("/"))
210
210
  !n || n === "." || (n === ".." ? t.pop() : t.push(n));
@@ -214,7 +214,7 @@ function Me(e) {
214
214
  const t = e.split(/[?#]/)[0] ?? e, n = t.lastIndexOf(".");
215
215
  return n < 0 ? "" : t.slice(n + 1).toLowerCase();
216
216
  }
217
- function wt(e) {
217
+ function _t(e) {
218
218
  switch (Me(e)) {
219
219
  case "png":
220
220
  return "image/png";
@@ -227,30 +227,30 @@ function wt(e) {
227
227
  return "application/octet-stream";
228
228
  }
229
229
  }
230
- function yt(e) {
230
+ function bt(e) {
231
231
  const t = Math.max(0, e.byteLength - 65535 - 22);
232
232
  for (let n = e.byteLength - 22; n >= t; n -= 1)
233
- if (e.getUint32(n, !0) === ut) return n;
233
+ if (e.getUint32(n, !0) === ft) return n;
234
234
  return -1;
235
235
  }
236
- const _t = 1, St = 5, bt = "6f5df5c5901df72d6c87", Et = {
236
+ const St = 1, Et = 7, Ut = "90b2e18f482065617fe7", vt = {
237
237
  file: "openusd_probe.js",
238
- sha256: "f89019f6a03661e6aa6403e8b6b694fa00c92ba1c0c7e09620e25ea8efbe6bc2",
239
- bytes: 97833
240
- }, Ut = {
238
+ sha256: "729ce6e77c5c1f81a1c95597800de55d902d46b4f86bc04474c43f411ab520c7",
239
+ bytes: 98305
240
+ }, At = {
241
241
  file: "openusd_probe.wasm",
242
- sha256: "1170d1ae548f51e5e9d65931df001d8fcd627e8b69b85d9447494c24402893f7",
243
- bytes: 10744656
242
+ sha256: "a58c888a8ff2b17c6b9b1618067d4b7e700e14eb8f8a1c9f996512abe1f56f9e",
243
+ bytes: 10863027
244
244
  };
245
- var vt = {
246
- schemaVersion: _t,
247
- apiVersion: St,
248
- runtimeId: bt,
249
- js: Et,
250
- wasm: Ut
245
+ var It = {
246
+ schemaVersion: St,
247
+ apiVersion: Et,
248
+ runtimeId: Ut,
249
+ js: vt,
250
+ wasm: At
251
251
  };
252
- const Pt = It(vt);
253
- function It(e) {
252
+ const Pt = Rt(It);
253
+ function Rt(e) {
254
254
  if (!e || typeof e != "object") throw new Error("OpenUSD runtime manifest is missing.");
255
255
  const t = e;
256
256
  if (t.schemaVersion !== 1 || !Number.isInteger(t.apiVersion) || Number(t.apiVersion) < 1 || typeof t.runtimeId != "string" || !/^[0-9a-f]{20}$/.test(t.runtimeId))
@@ -259,11 +259,11 @@ function It(e) {
259
259
  schemaVersion: t.schemaVersion,
260
260
  apiVersion: Number(t.apiVersion),
261
261
  runtimeId: t.runtimeId,
262
- js: _e(t.js, "openusd_probe.js"),
263
- wasm: _e(t.wasm, "openusd_probe.wasm")
262
+ js: Se(t.js, "openusd_probe.js"),
263
+ wasm: Se(t.wasm, "openusd_probe.wasm")
264
264
  });
265
265
  }
266
- function _e(e, t) {
266
+ function Se(e, t) {
267
267
  if (!e || typeof e != "object") throw new Error(`OpenUSD runtime manifest omits ${t}.`);
268
268
  const n = e;
269
269
  if (n.file !== t || typeof n.sha256 != "string" || !/^[0-9a-f]{64}$/.test(n.sha256) || !Number.isInteger(n.bytes) || Number(n.bytes) < 1)
@@ -274,7 +274,7 @@ function _e(e, t) {
274
274
  bytes: Number(n.bytes)
275
275
  });
276
276
  }
277
- function At(e, t, n) {
277
+ function Nt(e, t, n) {
278
278
  return WebAssembly.instantiate(e, t).then(
279
279
  (s) => n(s, e),
280
280
  (s) => {
@@ -284,7 +284,7 @@ function At(e, t, n) {
284
284
  }
285
285
  ), {};
286
286
  }
287
- function Ne(e, t) {
287
+ function xe(e, t) {
288
288
  const n = async (o, r) => {
289
289
  var i;
290
290
  const c = e.GetPrimAtPath(o);
@@ -294,18 +294,18 @@ function Ne(e, t) {
294
294
  (i = c == null ? void 0 : c.delete) == null || i.call(c);
295
295
  }
296
296
  }, s = (o, r) => {
297
- var i, l, p, g;
297
+ var i, f, p, y;
298
298
  const c = (i = o == null ? void 0 : o.GetAttribute) == null ? void 0 : i.call(o, r);
299
299
  if (!c) return [];
300
300
  try {
301
- return ((l = c.IsValid) == null ? void 0 : l.call(c)) !== !0 ? [] : (((p = c.GetConnections) == null ? void 0 : p.call(c)) ?? []).map((u) => {
302
- var h, y;
303
- if (typeof u == "string") return u;
304
- const f = String(((h = u.GetString) == null ? void 0 : h.call(u)) ?? u.path ?? "");
305
- return (y = u.delete) == null || y.call(u), f;
301
+ return ((f = c.IsValid) == null ? void 0 : f.call(c)) !== !0 ? [] : (((p = c.GetConnections) == null ? void 0 : p.call(c)) ?? []).map((l) => {
302
+ var h, w;
303
+ if (typeof l == "string") return l;
304
+ const u = String(((h = l.GetString) == null ? void 0 : h.call(l)) ?? l.path ?? "");
305
+ return (w = l.delete) == null || w.call(l), u;
306
306
  }).filter(Boolean);
307
307
  } finally {
308
- (g = c.delete) == null || g.call(c);
308
+ (y = c.delete) == null || y.call(c);
309
309
  }
310
310
  }, a = (o) => {
311
311
  var c;
@@ -330,12 +330,12 @@ function Ne(e, t) {
330
330
  },
331
331
  async primInfo(o) {
332
332
  return n(o, (r) => {
333
- var c, i, l, p;
333
+ var c, i, f, p;
334
334
  return {
335
335
  valid: !!r && ((c = r.IsValid) == null ? void 0 : c.call(r)) !== !1,
336
336
  name: String(((i = r.GetName) == null ? void 0 : i.call(r)) ?? o.split("/").pop() ?? ""),
337
337
  path: o,
338
- typeName: String(((l = r.GetTypeName) == null ? void 0 : l.call(r)) ?? ""),
338
+ typeName: String(((f = r.GetTypeName) == null ? void 0 : f.call(r)) ?? ""),
339
339
  instance: ((p = r.IsInstance) == null ? void 0 : p.call(r)) === !0
340
340
  };
341
341
  });
@@ -344,9 +344,9 @@ function Ne(e, t) {
344
344
  return n(o, (r) => {
345
345
  var c;
346
346
  return (((c = r.GetChildren) == null ? void 0 : c.call(r)) ?? []).map((i) => {
347
- var p, g;
348
- const l = String(i.__path ?? ((p = i.GetPath) == null ? void 0 : p.call(i)) ?? "");
349
- return (g = i.delete) == null || g.call(i), l;
347
+ var p, y;
348
+ const f = String(i.__path ?? ((p = i.GetPath) == null ? void 0 : p.call(i)) ?? "");
349
+ return (y = i.delete) == null || y.call(i), f;
350
350
  });
351
351
  });
352
352
  },
@@ -358,53 +358,53 @@ function Ne(e, t) {
358
358
  return n(o, (r) => {
359
359
  var c;
360
360
  return (((c = r.GetAttributes) == null ? void 0 : c.call(r)) ?? []).map((i) => {
361
- var p, g;
362
- const l = String(((p = i.GetName) == null ? void 0 : p.call(i)) ?? "");
363
- return (g = i.delete) == null || g.call(i), l;
361
+ var p, y;
362
+ const f = String(((p = i.GetName) == null ? void 0 : p.call(i)) ?? "");
363
+ return (y = i.delete) == null || y.call(i), f;
364
364
  });
365
365
  });
366
366
  },
367
367
  async primMetadata(o, r) {
368
368
  return n(o, (c) => {
369
369
  var p;
370
- const i = (p = c == null ? void 0 : c.GetMetadata) == null ? void 0 : p.call(c, r), l = typeof i == "string" ? i : i && typeof i == "object" && typeof i.string == "string" ? String(i.string) : void 0;
370
+ const i = (p = c == null ? void 0 : c.GetMetadata) == null ? void 0 : p.call(c, r), f = typeof i == "string" ? i : i && typeof i == "object" && typeof i.string == "string" ? String(i.string) : void 0;
371
371
  return {
372
372
  valid: !0,
373
373
  found: i != null,
374
374
  ...i != null ? { value: i } : {},
375
- ...l !== void 0 ? { text: l } : {}
375
+ ...f !== void 0 ? { text: f } : {}
376
376
  };
377
377
  });
378
378
  },
379
379
  async relationshipTargets(o, r) {
380
380
  return n(o, (c) => {
381
- var l, p, g;
382
- const i = (l = c == null ? void 0 : c.GetRelationship) == null ? void 0 : l.call(c, r);
381
+ var f, p, y;
382
+ const i = (f = c == null ? void 0 : c.GetRelationship) == null ? void 0 : f.call(c, r);
383
383
  if (!i) return [];
384
384
  try {
385
- return (((p = i.GetTargets) == null ? void 0 : p.call(i)) ?? []).map((u) => {
386
- var f;
387
- return typeof u == "string" ? u : String(((f = u.GetString) == null ? void 0 : f.call(u)) ?? u.path ?? "");
385
+ return (((p = i.GetTargets) == null ? void 0 : p.call(i)) ?? []).map((l) => {
386
+ var u;
387
+ return typeof l == "string" ? l : String(((u = l.GetString) == null ? void 0 : u.call(l)) ?? l.path ?? "");
388
388
  }).filter(Boolean);
389
389
  } finally {
390
- (g = i.delete) == null || g.call(i);
390
+ (y = i.delete) == null || y.call(i);
391
391
  }
392
392
  });
393
393
  },
394
394
  async attributeValue(o, r) {
395
395
  return n(o, (c) => {
396
- var l, p, g, u;
397
- const i = (l = c == null ? void 0 : c.GetAttribute) == null ? void 0 : l.call(c, r);
396
+ var f, p, y, l;
397
+ const i = (f = c == null ? void 0 : c.GetAttribute) == null ? void 0 : f.call(c, r);
398
398
  if (!i) return { valid: !1, authored: !1, value: null };
399
399
  try {
400
- const f = ((p = i.IsValid) == null ? void 0 : p.call(i)) === !0;
400
+ const u = ((p = i.IsValid) == null ? void 0 : p.call(i)) === !0;
401
401
  return {
402
- valid: f,
403
- authored: f && ((g = i.HasAuthoredValue) == null ? void 0 : g.call(i)) === !0,
404
- value: f ? i.Get() : null
402
+ valid: u,
403
+ authored: u && ((y = i.HasAuthoredValue) == null ? void 0 : y.call(i)) === !0,
404
+ value: u ? i.Get() : null
405
405
  };
406
406
  } finally {
407
- (u = i.delete) == null || u.call(i);
407
+ (l = i.delete) == null || l.call(i);
408
408
  }
409
409
  });
410
410
  },
@@ -412,16 +412,16 @@ function Ne(e, t) {
412
412
  const r = {};
413
413
  for (const c of o)
414
414
  r[c.path] = await n(c.path, (i) => Object.fromEntries(
415
- c.names.map((l) => {
416
- var g, u, f, h;
417
- const p = (g = i == null ? void 0 : i.GetAttribute) == null ? void 0 : g.call(i, l);
418
- if (!p) return [l, { valid: !1, authored: !1, value: null }];
415
+ c.names.map((f) => {
416
+ var y, l, u, h;
417
+ const p = (y = i == null ? void 0 : i.GetAttribute) == null ? void 0 : y.call(i, f);
418
+ if (!p) return [f, { valid: !1, authored: !1, value: null }];
419
419
  try {
420
- const y = ((u = p.IsValid) == null ? void 0 : u.call(p)) === !0;
421
- return [l, {
422
- valid: y,
423
- authored: y && ((f = p.HasAuthoredValue) == null ? void 0 : f.call(p)) === !0,
424
- value: y ? p.Get() : null
420
+ const w = ((l = p.IsValid) == null ? void 0 : l.call(p)) === !0;
421
+ return [f, {
422
+ valid: w,
423
+ authored: w && ((u = p.HasAuthoredValue) == null ? void 0 : u.call(p)) === !0,
424
+ value: w ? p.Get() : null
425
425
  }];
426
426
  } finally {
427
427
  (h = p.delete) == null || h.call(p);
@@ -432,19 +432,19 @@ function Ne(e, t) {
432
432
  },
433
433
  async attributeMetadata(o, r, c) {
434
434
  return n(o, (i) => {
435
- var p, g, u;
436
- const l = (p = i == null ? void 0 : i.GetAttribute) == null ? void 0 : p.call(i, r);
437
- if (!l) return { valid: !1, found: !1 };
435
+ var p, y, l;
436
+ const f = (p = i == null ? void 0 : i.GetAttribute) == null ? void 0 : p.call(i, r);
437
+ if (!f) return { valid: !1, found: !1 };
438
438
  try {
439
- if (((g = l.IsValid) == null ? void 0 : g.call(l)) !== !0) return { valid: !1, found: !1 };
440
- const f = l.GetMetadata(c);
439
+ if (((y = f.IsValid) == null ? void 0 : y.call(f)) !== !0) return { valid: !1, found: !1 };
440
+ const u = f.GetMetadata(c);
441
441
  return {
442
442
  valid: !0,
443
- found: f != null,
444
- ...f != null ? { value: f } : {}
443
+ found: u != null,
444
+ ...u != null ? { value: u } : {}
445
445
  };
446
446
  } finally {
447
- (u = l.delete) == null || u.call(l);
447
+ (l = f.delete) == null || l.call(f);
448
448
  }
449
449
  });
450
450
  },
@@ -456,16 +456,16 @@ function Ne(e, t) {
456
456
  }
457
457
  };
458
458
  }
459
- const Rt = /^physics$/i, Mt = /^(newton|mjc|mujoco)(?:[_-]|$)/i, Nt = /^(physx|newton|mjc|mujoco)(?:[_-]|)/i;
460
- function Dt(e, t = []) {
461
- const n = new Set(t.map(Se)), s = [];
459
+ const Dt = /^physics$/i, Mt = /^(newton|mjc|mujoco)(?:[_-]|$)/i, xt = /^(physx|newton|mjc|mujoco)(?:[_-]|)/i;
460
+ function kt(e, t = []) {
461
+ const n = new Set(t.map(Ee)), s = [];
462
462
  for (const a of e) {
463
- if (!Rt.test(a.setName) || n.has(Se(a))) continue;
464
- const o = a.variantNames.map((i, l) => ({ selection: i, index: l, rank: kt(i) })).filter((i) => i.rank !== null);
463
+ if (!Dt.test(a.setName) || n.has(Ee(a))) continue;
464
+ const o = a.variantNames.map((i, f) => ({ selection: i, index: f, rank: Ot(i) })).filter((i) => i.rank !== null);
465
465
  if (o.length === 0 || a.selection && Mt.test(a.selection)) continue;
466
- const r = ce(a.selection), c = [...o].sort((i, l) => {
467
- const p = r !== null && ce(i.selection) === r, g = r !== null && ce(l.selection) === r;
468
- return Number(g) - Number(p) || i.rank - l.rank || i.index - l.index;
466
+ const r = le(a.selection), c = [...o].sort((i, f) => {
467
+ const p = r !== null && le(i.selection) === r, y = r !== null && le(f.selection) === r;
468
+ return Number(y) - Number(p) || i.rank - f.rank || i.index - f.index;
469
469
  })[0];
470
470
  s.push({
471
471
  primPath: a.primPath,
@@ -475,16 +475,16 @@ function Dt(e, t = []) {
475
475
  }
476
476
  return s;
477
477
  }
478
- function kt(e) {
478
+ function Ot(e) {
479
479
  return /^newton(?:[_-]|$)/i.test(e) ? 0 : /^mjc(?:[_-]|$)/i.test(e) ? 1 : /^mujoco(?:[_-]|$)/i.test(e) ? 2 : null;
480
480
  }
481
- function ce(e) {
482
- return e && e.replace(Nt, "").toLowerCase() || null;
481
+ function le(e) {
482
+ return e && e.replace(xt, "").toLowerCase() || null;
483
483
  }
484
- function Se(e) {
484
+ function Ee(e) {
485
485
  return `${e.primPath}\0${e.setName}`;
486
486
  }
487
- function xt(e) {
487
+ function Tt(e) {
488
488
  let t = 0;
489
489
  const n = () => {
490
490
  for (; t < e.length; ) {
@@ -499,17 +499,17 @@ function xt(e) {
499
499
  continue;
500
500
  }
501
501
  if (i === '"' || i === "@" || i === "<") {
502
- const p = i === "<" ? ">" : i, g = i === '"' && e.slice(t, t + 3) === '"""';
503
- t += g ? 3 : 1;
504
- const u = t;
502
+ const p = i === "<" ? ">" : i, y = i === '"' && e.slice(t, t + 3) === '"""';
503
+ t += y ? 3 : 1;
504
+ const l = t;
505
505
  for (; t < e.length; ) {
506
506
  if (e[t] === "\\") {
507
507
  t += 2;
508
508
  continue;
509
509
  }
510
- if (g ? e.slice(t, t + 3) === '"""' : e[t] === p) {
511
- const f = e.slice(u, t);
512
- return t += g ? 3 : 1, { kind: i === "<" ? "path" : "string", value: f };
510
+ if (y ? e.slice(t, t + 3) === '"""' : e[t] === p) {
511
+ const u = e.slice(l, t);
512
+ return t += y ? 3 : 1, { kind: i === "<" ? "path" : "string", value: u };
513
513
  }
514
514
  t++;
515
515
  }
@@ -517,23 +517,23 @@ function xt(e) {
517
517
  }
518
518
  if ("{}()[]=,".includes(i))
519
519
  return t++, { kind: "symbol", value: i };
520
- const l = t;
520
+ const f = t;
521
521
  for (; t < e.length && !/[\s{}()\[\]=,<>"@#]/.test(e[t]); ) t++;
522
- if (l === t) {
522
+ if (f === t) {
523
523
  t++;
524
524
  continue;
525
525
  }
526
- return { kind: "word", value: e.slice(l, t) };
526
+ return { kind: "word", value: e.slice(f, t) };
527
527
  }
528
528
  }, s = () => {
529
- let i = 1, l;
530
- for (; i && (l = n()); )
531
- l.value === "[" && l.kind === "symbol" ? i++ : l.value === "]" && l.kind === "symbol" && i--;
529
+ let i = 1, f;
530
+ for (; i && (f = n()); )
531
+ f.value === "[" && f.kind === "symbol" ? i++ : f.value === "]" && f.kind === "symbol" && i--;
532
532
  if (i) throw new Error("Unterminated USDA list");
533
533
  }, a = () => {
534
- let i = 1, l;
535
- for (; i && (l = n()); )
536
- l.value === "{" && l.kind === "symbol" ? i++ : l.value === "}" && l.kind === "symbol" && i--;
534
+ let i = 1, f;
535
+ for (; i && (f = n()); )
536
+ f.value === "{" && f.kind === "symbol" ? i++ : f.value === "}" && f.kind === "symbol" && i--;
537
537
  if (i) throw new Error("Unterminated USDA dictionary");
538
538
  }, o = /* @__PURE__ */ new Map(), r = [];
539
539
  let c;
@@ -543,9 +543,9 @@ function xt(e) {
543
543
  continue;
544
544
  }
545
545
  if (["def", "over", "class"].includes(c.value)) {
546
- const u = n(), f = (u == null ? void 0 : u.kind) === "string" ? u : n();
547
- if (!f || f.kind !== "string") throw new Error("Invalid USDA prim header");
548
- const h = [...r].reverse().find(Boolean), y = `${(h == null ? void 0 : h.path) ?? ""}/${f.value}`, w = { schemas: [], relationships: /* @__PURE__ */ new Map() };
546
+ const l = n(), u = (l == null ? void 0 : l.kind) === "string" ? l : n();
547
+ if (!u || u.kind !== "string") throw new Error("Invalid USDA prim header");
548
+ const h = [...r].reverse().find(Boolean), w = `${(h == null ? void 0 : h.path) ?? ""}/${u.value}`, g = { schemas: [], relationships: /* @__PURE__ */ new Map() };
549
549
  let d, m = 0;
550
550
  for (; (d = n()) && !(d.kind === "symbol" && d.value === "{" && m === 0); ) {
551
551
  if (d.kind === "symbol" && d.value === "(") m++;
@@ -555,36 +555,36 @@ function xt(e) {
555
555
  continue;
556
556
  }
557
557
  if (d.kind === "word" && d.value === "apiSchemas") {
558
- const S = n(), _ = n();
559
- if ((S == null ? void 0 : S.value) !== "=") throw new Error("Invalid USDA apiSchemas");
558
+ const b = n(), _ = n();
559
+ if ((b == null ? void 0 : b.value) !== "=") throw new Error("Invalid USDA apiSchemas");
560
560
  if ((_ == null ? void 0 : _.kind) === "word" && _.value === "None") continue;
561
- if ((_ == null ? void 0 : _.value) !== "[") throw new Error(`Invalid USDA apiSchemas at ${y}: ${_ == null ? void 0 : _.value}`);
561
+ if ((_ == null ? void 0 : _.value) !== "[") throw new Error(`Invalid USDA apiSchemas at ${w}: ${_ == null ? void 0 : _.value}`);
562
562
  for (; (d = n()) && d.value !== "]"; )
563
- d.kind === "string" && d.value.startsWith("PhysxMimicJointAPI:") && w.schemas.push(d.value);
563
+ d.kind === "string" && d.value.startsWith("PhysxMimicJointAPI:") && g.schemas.push(d.value);
564
564
  if (!d) throw new Error("Unterminated USDA apiSchemas");
565
565
  } else d.value === "[" && d.kind === "symbol" && s();
566
566
  }
567
567
  if (!d) throw new Error("Unterminated USDA prim header");
568
- o.set(y, w), r.push({ path: y, prim: w });
568
+ o.set(w, g), r.push({ path: w, prim: g });
569
569
  continue;
570
570
  }
571
571
  if (c.value !== "rel" || !r.at(-1)) continue;
572
572
  const i = n();
573
573
  if (!i || i.kind !== "word" || !/^physxMimicJoint:[^:]+:referenceJoint$/.test(i.value)) continue;
574
- const l = n(), p = n();
575
- if ((l == null ? void 0 : l.value) !== "=" || !p) continue;
576
- const g = [];
577
- if (p.kind === "path") g.push(p.value);
574
+ const f = n(), p = n();
575
+ if ((f == null ? void 0 : f.value) !== "=" || !p) continue;
576
+ const y = [];
577
+ if (p.kind === "path") y.push(p.value);
578
578
  else if (p.value === "[") {
579
- let u;
580
- for (; (u = n()) && u.value !== "]"; ) u.kind === "path" && g.push(u.value);
581
- if (!u) throw new Error("Unterminated USDA relationship");
579
+ let l;
580
+ for (; (l = n()) && l.value !== "]"; ) l.kind === "path" && y.push(l.value);
581
+ if (!l) throw new Error("Unterminated USDA relationship");
582
582
  }
583
- r.at(-1).prim.relationships.set(i.value, g);
583
+ r.at(-1).prim.relationships.set(i.value, y);
584
584
  }
585
585
  return new Map([...o].filter(([, i]) => i.schemas.length || i.relationships.size));
586
586
  }
587
- const Ot = [
587
+ const $t = [
588
588
  1,
589
589
  0,
590
590
  0,
@@ -602,33 +602,33 @@ const Ot = [
602
602
  0,
603
603
  1
604
604
  ];
605
- function Tt(e) {
605
+ function Ct(e) {
606
606
  const t = new Map(e.map((o) => [o.path, o])), n = /* @__PURE__ */ new Map(), s = /* @__PURE__ */ new Set(), a = (o) => {
607
607
  const r = n.get(o.path);
608
608
  if (r) return r;
609
- if (s.has(o.path)) return be(o.localMatrix);
609
+ if (s.has(o.path)) return Ue(o.localMatrix);
610
610
  s.add(o.path);
611
- const c = be(o.localMatrix), i = o.parentPath ? t.get(o.parentPath) : void 0, l = !i || o.resetsXformStack ? c : Ee(c, a(i));
612
- return s.delete(o.path), n.set(o.path, l), l;
611
+ const c = Ue(o.localMatrix), i = o.parentPath ? t.get(o.parentPath) : void 0, f = !i || o.resetsXformStack ? c : ve(c, a(i));
612
+ return s.delete(o.path), n.set(o.path, f), f;
613
613
  };
614
614
  return e.map((o) => {
615
615
  if (!o.resetsXformStack || !o.parentPath) return o;
616
616
  const r = t.get(o.parentPath);
617
617
  if (!r) return o;
618
- const c = a(r), i = Lt(c);
618
+ const c = a(r), i = Ft(c);
619
619
  return i ? {
620
620
  ...o,
621
- localMatrix: Ee(a(o), i)
621
+ localMatrix: ve(a(o), i)
622
622
  } : o;
623
623
  });
624
624
  }
625
- function be(e) {
626
- return $t(e) ? e : Ot;
625
+ function Ue(e) {
626
+ return Lt(e) ? e : $t;
627
627
  }
628
- function $t(e) {
628
+ function Lt(e) {
629
629
  return (e == null ? void 0 : e.length) === 16 && e.every(Number.isFinite);
630
630
  }
631
- function Ee(e, t) {
631
+ function ve(e, t) {
632
632
  const n = new Array(16);
633
633
  for (let s = 0; s < 4; s++)
634
634
  for (let a = 0; a < 4; a++) {
@@ -639,7 +639,7 @@ function Ee(e, t) {
639
639
  }
640
640
  return n;
641
641
  }
642
- function Lt(e) {
642
+ function Ft(e) {
643
643
  const [
644
644
  t,
645
645
  n,
@@ -651,53 +651,55 @@ function Lt(e) {
651
651
  ,
652
652
  c,
653
653
  i,
654
- l,
654
+ f,
655
655
  ,
656
656
  p,
657
- g,
658
- u
659
- ] = e, f = o * l - r * i, h = s * i - n * l, y = n * r - s * o, w = t * f + a * h + c * y, d = Math.max(
660
- Math.abs(t * o * l),
657
+ y,
658
+ l
659
+ ] = e, u = o * f - r * i, h = s * i - n * f, w = n * r - s * o, g = t * u + a * h + c * w, d = Math.max(
660
+ Math.abs(t * o * f),
661
661
  Math.abs(t * r * i),
662
- Math.abs(n * a * l),
662
+ Math.abs(n * a * f),
663
663
  Math.abs(n * r * c),
664
664
  Math.abs(s * a * i),
665
665
  Math.abs(s * o * c),
666
666
  1
667
667
  );
668
- if (!Number.isFinite(w) || Math.abs(w) <= Number.EPSILON * d * 16)
668
+ if (!Number.isFinite(g) || Math.abs(g) <= Number.EPSILON * d * 16)
669
669
  return null;
670
- const m = 1 / w, S = f * m, _ = h * m, O = y * m, B = (r * c - a * l) * m, j = (t * l - s * c) * m, F = (s * a - t * r) * m, H = (a * i - o * c) * m, J = (n * c - t * i) * m, V = (t * o - n * a) * m;
670
+ const m = 1 / g, b = u * m, _ = h * m, R = w * m, x = (r * c - a * f) * m, O = (t * f - s * c) * m, F = (s * a - t * r) * m, j = (a * i - o * c) * m, H = (n * c - t * i) * m, z = (t * o - n * a) * m;
671
671
  return [
672
- S,
672
+ b,
673
673
  _,
674
- O,
674
+ R,
675
675
  0,
676
- B,
677
- j,
676
+ x,
677
+ O,
678
678
  F,
679
679
  0,
680
+ j,
680
681
  H,
681
- J,
682
- V,
682
+ z,
683
683
  0,
684
- -(p * S + g * B + u * H),
685
- -(p * _ + g * j + u * J),
686
- -(p * O + g * F + u * V),
684
+ -(p * b + y * x + l * j),
685
+ -(p * _ + y * O + l * H),
686
+ -(p * R + y * F + l * z),
687
687
  1
688
688
  ];
689
689
  }
690
- function Ct(e, t = []) {
690
+ function jt(e, t = []) {
691
691
  return {
692
692
  stage: e.stage,
693
693
  view: {
694
694
  ...e.view,
695
- prims: Tt(e.view.prims)
695
+ prims: Ct(e.view.prims)
696
696
  },
697
697
  elements: e.elements,
698
+ pointClouds: e.pointClouds,
699
+ gaussianSplats: e.gaussianSplats,
698
700
  materials: e.materials,
699
701
  materialAliases: e.materialAliases,
700
- physics: Vt(),
702
+ physics: Gt(),
701
703
  joints: [],
702
704
  cameras: [],
703
705
  lights: [],
@@ -706,10 +708,10 @@ function Ct(e, t = []) {
706
708
  variants: t
707
709
  };
708
710
  }
709
- function jt(e, t) {
711
+ function Vt(e, t) {
710
712
  e.physics = t.physics, e.joints = t.joints;
711
713
  }
712
- function Vt() {
714
+ function Gt() {
713
715
  return {
714
716
  scenes: [],
715
717
  rigidBodies: [],
@@ -718,17 +720,17 @@ function Vt() {
718
720
  articulationRoots: []
719
721
  };
720
722
  }
721
- const Gt = /^(Warning|Error|Fatal|Info|Runtime Error|Coding Error):\s+in\s+(\S+)\s+at line \d+ of .*?\s+--\s+([\s\S]*)$/s, Bt = /(^|[\s(\[])(?:[A-Za-z]:[\\/]|\/)(?:[^ \t\r\n()'"]+[\\/])*[^ \t\r\n()'"]+\.(?:cpp|cxx|cc|hpp|c|h|mjs|js|ts)(?::\d+)*/gi, Ft = /<0x[0-9a-f]+>/gi, zt = /* @__PURE__ */ new Set([
723
+ const Bt = /^(Warning|Error|Fatal|Info|Runtime Error|Coding Error):\s+in\s+(\S+)\s+at line \d+ of .*?\s+--\s+([\s\S]*)$/s, zt = /(^|[\s(\[])(?:[A-Za-z]:[\\/]|\/)(?:[^ \t\r\n()'"]+[\\/])*[^ \t\r\n()'"]+\.(?:cpp|cxx|cc|hpp|c|h|mjs|js|ts)(?::\d+)*/gi, Wt = /<0x[0-9a-f]+>/gi, Ht = /* @__PURE__ */ new Set([
722
724
  "USD_MATERIAL_BINDING_API_MISSING",
723
725
  "USD_EXTERNAL_REFERENCE_UNRESOLVED"
724
726
  ]);
725
- function Wt(e) {
726
- const t = Gt.exec(e);
727
- return (t ? `${t[1]}: ${t[2]} -- ${t[3]}` : e).replace(Bt, "$1<OpenUSD source>").replace(Ft, "<stage>").trim();
727
+ function Jt(e) {
728
+ const t = Bt.exec(e);
729
+ return (t ? `${t[1]}: ${t[2]} -- ${t[3]}` : e).replace(zt, "$1<OpenUSD source>").replace(Wt, "<stage>").trim();
728
730
  }
729
- function Ht(e) {
731
+ function Xt(e) {
730
732
  if (!e || /^(?:Info|Status):/.test(e)) return null;
731
- const t = Wt(e);
733
+ const t = Jt(e);
732
734
  if (!t) return null;
733
735
  if (/Found material bindings on prim at path .* but MaterialBindingAPI is not applied/.test(t))
734
736
  return { severity: "warning", code: "USD_MATERIAL_BINDING_API_MISSING", message: t };
@@ -748,7 +750,7 @@ function Ht(e) {
748
750
  message: t
749
751
  };
750
752
  }
751
- function Ue(e = {}) {
753
+ function Ae(e = {}) {
752
754
  const t = e.console ?? console, n = /* @__PURE__ */ new Set(), s = Math.max(1, e.maxUniqueDiagnostics ?? 64);
753
755
  let a = !1;
754
756
  const o = (r) => {
@@ -761,19 +763,19 @@ function Ue(e = {}) {
761
763
  ));
762
764
  return;
763
765
  }
764
- n.add(c), (i = e.onDiagnostic) == null || i.call(e, r), !e.onDiagnostic && (zt.has(r.code) || (r.severity === "error" ? t.error(r.message) : t.warn(r.message)));
766
+ n.add(c), (i = e.onDiagnostic) == null || i.call(e, r), !e.onDiagnostic && (Ht.has(r.code) || (r.severity === "error" ? t.error(r.message) : t.warn(r.message)));
765
767
  }
766
768
  };
767
769
  return (r) => {
768
770
  const c = String(r ?? "");
769
771
  for (const i of c.split(/\r?\n/)) {
770
- const l = Ht(i.trim());
771
- l && o(l);
772
+ const f = Xt(i.trim());
773
+ f && o(f);
772
774
  }
773
775
  };
774
776
  }
775
- const ue = "[USD material] ", Xt = /* @__PURE__ */ new WeakMap();
776
- function Jt(e) {
777
+ const ue = "[USD material] ", qt = /* @__PURE__ */ new WeakMap();
778
+ function Zt(e) {
777
779
  const t = [], n = console.warn;
778
780
  console.warn = (...s) => {
779
781
  const a = s.length === 1 && typeof s[0] == "string" && s[0].startsWith(ue) ? s[0].slice(ue.length) : null;
@@ -793,21 +795,21 @@ function Jt(e) {
793
795
  console.warn = n;
794
796
  }
795
797
  }
796
- function qt(e, t) {
797
- t.length && Xt.set(e, Object.freeze([...t]));
798
+ function Yt(e, t) {
799
+ t.length && qt.set(e, Object.freeze([...t]));
798
800
  }
799
- const Zt = /* @__PURE__ */ new Set(["usd", "usda", "usdc", "usdz"]);
800
- async function Yt(e) {
801
+ const Kt = /* @__PURE__ */ new Set(["usd", "usda", "usdc", "usdz"]);
802
+ async function Qt(e) {
801
803
  const t = await import(
802
804
  /* @vite-ignore */
803
805
  e.moduleUrl
804
806
  ), n = t.default ?? t.createOpenUsdProbe, s = e.wasmModule ? {
805
- printErr: Ue({ onDiagnostic: e.onRuntimeDiagnostic }),
806
- instantiateWasm(w, d) {
807
- return At(e.wasmModule, w, d);
807
+ printErr: Ae({ onDiagnostic: e.onRuntimeDiagnostic }),
808
+ instantiateWasm(g, d) {
809
+ return Nt(e.wasmModule, g, d);
808
810
  }
809
811
  } : {
810
- printErr: Ue({ onDiagnostic: e.onRuntimeDiagnostic }),
812
+ printErr: Ae({ onDiagnostic: e.onRuntimeDiagnostic }),
811
813
  wasmBinary: await (typeof e.wasmBinary == "function" ? e.wasmBinary() : e.wasmBinary ?? an(e.wasmUrl))
812
814
  }, a = await n(s), o = e.apiVersion ?? Pt.apiVersion, r = Number(a.ccall("usd_probe_api_version", "number", [], []));
813
815
  if (r !== o)
@@ -815,108 +817,108 @@ async function Yt(e) {
815
817
  new Error(`OpenUSD runtime API mismatch: expected ${o}, received ${r}.`),
816
818
  { code: "E_USD_RUNTIME_VERSION" }
817
819
  );
818
- const c = e.memfsRoot ?? "/asset", i = e.fetchBytes ?? (async (w) => {
819
- const d = await fetch(w);
820
- if (!d.ok) throw Object.assign(new Error(`USD resource request failed (${d.status}): ${w}`), {
820
+ const c = e.memfsRoot ?? "/asset", i = e.fetchBytes ?? (async (g) => {
821
+ const d = await fetch(g);
822
+ if (!d.ok) throw Object.assign(new Error(`USD resource request failed (${d.status}): ${g}`), {
821
823
  code: d.status === 401 || d.status === 403 ? "E_ASSET_AUTH" : "E_ASSET_FETCH"
822
824
  });
823
- const m = new Uint8Array(await d.arrayBuffer()), S = nt(d.headers.get("content-type"), m);
824
- if (S) throw Ke(`USD resource is not usable (${S}): ${w}`, Ae);
825
+ const m = new Uint8Array(await d.arrayBuffer()), b = st(d.headers.get("content-type"), m);
826
+ if (b) throw et(`USD resource is not usable (${b}): ${g}`, Ne);
825
827
  return m;
826
- }), l = (w, d, m) => JSON.parse(a.ccall(w, "string", d, m)), p = /* @__PURE__ */ new Set(), g = ve(a);
827
- let u = 0, f = null;
828
+ }), f = (g, d, m) => JSON.parse(a.ccall(g, "string", d, m)), p = /* @__PURE__ */ new Set(), y = Ie(a);
829
+ let l = 0, u = null;
828
830
  async function h() {
829
- return f || (f = (async () => {
830
- const w = `${c}/__viewer_warmup__`, d = `${w}/empty.usda`;
831
- a.FS.mkdirTree(w), a.FS.writeFile(d, new TextEncoder().encode(`#usda 1.0
831
+ return u || (u = (async () => {
832
+ const g = `${c}/__viewer_warmup__`, d = `${g}/empty.usda`;
833
+ a.FS.mkdirTree(g), a.FS.writeFile(d, new TextEncoder().encode(`#usda 1.0
832
834
  `));
833
835
  let m;
834
836
  try {
835
- const S = l("usd_probe_stage_open", ["string"], [d]);
836
- if (S.ok !== !0 || S.stageId === void 0)
837
- throw new Error(S.error ?? "Failed to initialize the USD Stage runtime.");
838
- m = S.stageId;
837
+ const b = f("usd_probe_stage_open", ["string"], [d]);
838
+ if (b.ok !== !0 || b.stageId === void 0)
839
+ throw new Error(b.error ?? "Failed to initialize the USD Stage runtime.");
840
+ m = b.stageId;
839
841
  } finally {
840
- m !== void 0 && l("usd_probe_stage_release", ["number"], [m]), a.FS.analyzePath(d, !0).exists && a.FS.unlink(d);
842
+ m !== void 0 && f("usd_probe_stage_release", ["number"], [m]), a.FS.analyzePath(d, !0).exists && a.FS.unlink(d);
841
843
  }
842
- })(), f);
844
+ })(), u);
843
845
  }
844
- async function y(w, d) {
845
- const m = new URL(d.sourcePath, "file:///"), S = `${c}/load-${++u}`, _ = q(m.href, S), O = /* @__PURE__ */ new Set(), B = /* @__PURE__ */ new Map(), j = /* @__PURE__ */ new Map(), F = d.readTextureBytes ?? !0, H = d.collectTextureUrls ?? !F, J = H || F ? ke : sn, V = /* @__PURE__ */ new Map();
846
- let b, M = null, U = null;
847
- const R = () => {
848
- b !== void 0 && p.delete(b) && l("usd_probe_stage_release", ["number"], [b]), M == null || M.dispose(), Ce(a.FS, S);
846
+ async function w(g, d) {
847
+ const m = new URL(d.sourcePath, "file:///"), b = `${c}/load-${++l}`, _ = Z(m.href, b), R = /* @__PURE__ */ new Set(), x = /* @__PURE__ */ new Map(), O = /* @__PURE__ */ new Map(), F = d.readTextureBytes ?? !0, j = d.collectTextureUrls ?? !F, H = j || F ? Oe : sn, z = /* @__PURE__ */ new Map();
848
+ let S, D = null, U = null;
849
+ const N = () => {
850
+ S !== void 0 && p.delete(S) && f("usd_probe_stage_release", ["number"], [S]), D == null || D.dispose(), je(a.FS, b);
849
851
  };
850
852
  try {
851
- const A = await Pe(w);
852
- fe(a, _, A, O), B.set(_, J(A));
853
- for (const [E, $] of Object.entries(d.files ?? {})) {
854
- const X = q(new URL(E, m).href, S), W = await Pe($);
855
- O.has(X) || B.set(X, J(W)), fe(a, X, W, O);
853
+ const P = await Pe(g);
854
+ he(a, _, P, R), x.set(_, H(P));
855
+ for (const [E, L] of Object.entries(d.files ?? {})) {
856
+ const q = Z(new URL(E, m).href, b), X = await Pe(L);
857
+ R.has(q) || x.set(q, H(X)), he(a, q, X, R);
856
858
  }
857
- const k = new Set(O);
859
+ const T = new Set(R);
858
860
  for (const E of d.packagePaths ?? [])
859
- k.add(q(new URL(E, m).href, S));
860
- const v = d.externalReferenceMode ?? "complete", I = ft(A) ? await dt(A, { include: Re }) : null;
861
- let P = {}, D, N;
861
+ T.add(Z(new URL(E, m).href, b));
862
+ const v = d.externalReferenceMode ?? "complete", I = ht(P) ? await pt(P, { include: De }) : null;
863
+ let A = {}, k, M;
862
864
  if (!I && d.autoResolveAssets !== !1) {
863
- const E = d.resolveBytes ?? ((X) => i(X)), $ = await tn(
865
+ const E = d.resolveBytes ?? ((q) => i(q)), L = await tn(
864
866
  a,
865
867
  m,
866
- S,
868
+ b,
867
869
  E,
868
- l,
869
- O,
870
- V,
871
- H ? j : null,
872
- B,
870
+ f,
871
+ R,
872
+ z,
873
+ j ? O : null,
874
+ x,
873
875
  d.maxFiles ?? 1024,
874
876
  d.maxDepth ?? 8,
875
877
  d.maxConcurrency ?? 1,
876
878
  v,
877
- k,
879
+ T,
878
880
  F,
879
881
  d,
880
882
  d.onReferenceSkipped,
881
883
  d.onResourceFailed
882
884
  );
883
- P = $.mappings, D = $.opened, N = $.variantConfiguration;
885
+ A = L.mappings, k = L.opened, M = L.variantConfiguration;
884
886
  } else {
885
- if (D = Object.keys(P).length > 0 ? l("usd_probe_stage_open_mapped", ["string", "string"], [_, JSON.stringify(P)]) : l("usd_probe_stage_open", ["string"], [_]), !D.ok) throw new Error(D.error ?? `Failed to open ${_}`);
886
- N = De(a, D, d, !0);
887
+ if (k = Object.keys(A).length > 0 ? f("usd_probe_stage_open_mapped", ["string", "string"], [_, JSON.stringify(A)]) : f("usd_probe_stage_open", ["string"], [_]), !k.ok) throw new Error(k.error ?? `Failed to open ${_}`);
888
+ M = ke(a, k, d, !0);
887
889
  }
888
- M = I ? ht(I) : null;
889
- const x = d.textureResolver || M ? (E) => {
890
- var $;
891
- return (($ = d.textureResolver) == null ? void 0 : $.call(d, E)) ?? (M == null ? void 0 : M.resolve(E)) ?? null;
890
+ D = I ? gt(I) : null;
891
+ const $ = d.textureResolver || D ? (E) => {
892
+ var L;
893
+ return ((L = d.textureResolver) == null ? void 0 : L.call(d, E)) ?? (D == null ? void 0 : D.resolve(E)) ?? null;
892
894
  } : void 0;
893
- b = D.stageId, p.add(D.stageId);
894
- const { discoveredVariants: T, selections: z } = N, G = ve(a, V, _), L = G.openStage(D.stageId), oe = await Kt(a, D.stageId, _, {
895
+ S = k.stageId, p.add(k.stageId);
896
+ const { discoveredVariants: C, selections: J } = M, W = Ie(a, z, _), V = W.openStage(k.stageId), ae = await en(a, k.stageId, _, {
895
897
  batchSize: d.geometryBatchSize,
896
898
  onProgress: d.onGeometryProgress
897
899
  });
898
- Le(oe.materials, V, m), $e(oe.materials, V);
899
- const je = new Map(z.map((E) => [
900
+ Fe(ae.materials, z, m), Le(ae.materials, z);
901
+ const Ve = new Map(J.map((E) => [
900
902
  `${E.primPath}\0${E.setName}`,
901
903
  E.selection
902
- ])), Ve = T.map((E) => ({
904
+ ])), Ge = C.map((E) => ({
903
905
  ...E,
904
- selection: je.get(`${E.primPath}\0${E.setName}`) ?? E.selection
905
- })), ae = Ct(oe, Ve), de = d.isTextureAllowed ?? (v === "package" ? (E) => {
906
- const $ = new URL(E, m);
907
- return k.has(q($.href, S)) || Ie($, m);
908
- } : void 0), he = I ? void 0 : de ? (E) => j.has(E) || de(E) : j.size > 0 ? (E) => j.has(E) : void 0;
906
+ selection: Ve.get(`${E.primPath}\0${E.setName}`) ?? E.selection
907
+ })), ie = jt(ae, Ge), pe = d.isTextureAllowed ?? (v === "package" ? (E) => {
908
+ const L = new URL(E, m);
909
+ return T.has(Z(L.href, b)) || Re(L, m);
910
+ } : void 0), ge = I ? void 0 : pe ? (E) => O.has(E) || pe(E) : O.size > 0 ? (E) => O.has(E) : void 0;
909
911
  return {
910
- data: ae,
911
- pxr: G,
912
- stage: L,
912
+ data: ie,
913
+ pxr: W,
914
+ stage: V,
913
915
  entryPath: _,
914
- textureURLs: j,
915
- ...M ? { packageTextures: M } : {},
916
+ textureURLs: O,
917
+ ...D ? { packageTextures: D } : {},
916
918
  buildModel: async () => {
917
- const { createUSDLoadedModel: E } = await import("@openusd-wasm/three-loader"), $ = () => E(
918
- ae,
919
- G,
919
+ const { createUSDLoadedModel: E } = await import("@openusd-wasm/three-loader"), L = () => E(
920
+ ie,
921
+ W,
920
922
  _,
921
923
  {
922
924
  sourcePath: d.sourcePath,
@@ -928,24 +930,24 @@ async function Yt(e) {
928
930
  loadTextures: d.loadTextures ?? !0,
929
931
  ...d.textureLoader ? { textureLoader: d.textureLoader } : {},
930
932
  ...d.textureCache ? { textureCache: d.textureCache } : {},
931
- ...x ? { textureResolver: x } : {}
933
+ ...$ ? { textureResolver: $ } : {}
932
934
  },
933
- L,
935
+ V,
934
936
  {
935
937
  // Keep package texture identities on the model so the visual adapter
936
938
  // can resolve textures referenced by unsupported-but-known MDL nodes.
937
- usdzTextureURLs: (M == null ? void 0 : M.urls) ?? /* @__PURE__ */ new Map(),
939
+ usdzTextureURLs: (D == null ? void 0 : D.urls) ?? /* @__PURE__ */ new Map(),
938
940
  autoTextureURLs: /* @__PURE__ */ new Map()
939
941
  }
940
- ), X = Jt(
941
- () => he ? Fe(ae.materials, he, $) : $()
942
- ), W = X.value;
943
- qt(W, X.warnings), W.usdQuery = Ne(L, G);
944
- const Ge = W.dispose.bind(W);
945
- let pe = !1;
946
- return W.dispose = () => {
947
- pe || (pe = !0, Ge(), R());
948
- }, W;
942
+ ), q = Zt(
943
+ () => ge ? We(ie.materials, ge, L) : L()
944
+ ), X = q.value;
945
+ Yt(X, q.warnings), X.usdQuery = xe(V, W);
946
+ const Be = X.dispose.bind(X);
947
+ let me = !1;
948
+ return X.dispose = () => {
949
+ me || (me = !0, Be(), N());
950
+ }, X;
949
951
  },
950
952
  readPhysics() {
951
953
  return U || (U = (async () => {
@@ -954,39 +956,39 @@ async function Yt(e) {
954
956
  new Error("USD physics phase requires the matching packaged openusd_probe runtime."),
955
957
  { code: "E_USD_RUNTIME_VERSION" }
956
958
  );
957
- const E = l("usd_probe_scene_physics", ["number"], [D.stageId]);
959
+ const E = f("usd_probe_scene_physics", ["number"], [k.stageId]);
958
960
  if (E.ok !== !0) throw new Error(String(E.error ?? "Failed to extract USD physics."));
959
961
  return E;
960
962
  })(), U);
961
963
  },
962
- release: R
964
+ release: N
963
965
  };
964
- } catch (A) {
965
- throw R(), A;
966
+ } catch (P) {
967
+ throw N(), P;
966
968
  }
967
969
  }
968
970
  return {
969
971
  runtime: a,
970
- pxr: g,
972
+ pxr: y,
971
973
  warmup: h,
972
- async parseAsync(w, d) {
973
- const m = await y(w, d);
974
+ async parseAsync(g, d) {
975
+ const m = await w(g, d);
974
976
  try {
975
- return jt(m.data, await m.readPhysics()), await m.buildModel();
976
- } catch (S) {
977
- throw m.release(), S;
977
+ return Vt(m.data, await m.readPhysics()), await m.buildModel();
978
+ } catch (b) {
979
+ throw m.release(), b;
978
980
  }
979
981
  },
980
- async parseVisualSceneAsync(w, d) {
981
- return await y(w, d);
982
+ async parseVisualSceneAsync(g, d) {
983
+ return await w(g, d);
982
984
  }
983
985
  };
984
986
  }
985
- function ve(e, t = /* @__PURE__ */ new Map(), n) {
986
- const s = (u, f, h) => JSON.parse(e.ccall(u, "string", f, h));
987
+ function Ie(e, t = /* @__PURE__ */ new Map(), n) {
988
+ const s = (l, u, h) => JSON.parse(e.ccall(l, "string", u, h));
987
989
  class a {
988
- constructor(f) {
989
- this.path = f;
990
+ constructor(u) {
991
+ this.path = u;
990
992
  }
991
993
  GetString() {
992
994
  return this.path;
@@ -995,146 +997,146 @@ function ve(e, t = /* @__PURE__ */ new Map(), n) {
995
997
  }
996
998
  }
997
999
  let o;
998
- const r = /* @__PURE__ */ new Map(), c = (u, f) => {
1000
+ const r = /* @__PURE__ */ new Map(), c = (l, u) => {
999
1001
  if (!o) {
1000
- const S = e._usd_probe_flatten_stage;
1001
- if (n && typeof S == "function") {
1002
+ const b = e._usd_probe_flatten_stage;
1003
+ if (n && typeof b == "function") {
1002
1004
  const _ = e.ccall("usd_probe_flatten_stage", "string", ["string"], [n]);
1003
1005
  if (typeof _ != "string" || !_.startsWith("#usda")) throw new Error("Unable to read flattened USD joint metadata");
1004
- o = xt(_);
1006
+ o = Tt(_);
1005
1007
  } else
1006
1008
  o = /* @__PURE__ */ new Map();
1007
1009
  }
1008
- const h = o.get(f);
1009
- if (h || r.has(f)) return h ?? r.get(f);
1010
- const y = ["rotX", "rotY", "rotZ", "transX", "transY", "transZ", "X", "Y", "Z"], w = [], d = /* @__PURE__ */ new Map();
1011
- for (const S of y) {
1012
- const _ = `physxMimicJoint:${S}:referenceJoint`, O = s("usd_probe_relationship_targets", ["number", "string", "string"], [u, f, _]).paths ?? [];
1013
- O.length && (w.push(`PhysxMimicJointAPI:${S}`), d.set(_, O));
1010
+ const h = o.get(u);
1011
+ if (h || r.has(u)) return h ?? r.get(u);
1012
+ const w = ["rotX", "rotY", "rotZ", "transX", "transY", "transZ", "X", "Y", "Z"], g = [], d = /* @__PURE__ */ new Map();
1013
+ for (const b of w) {
1014
+ const _ = `physxMimicJoint:${b}:referenceJoint`, R = s("usd_probe_relationship_targets", ["number", "string", "string"], [l, u, _]).paths ?? [];
1015
+ R.length && (g.push(`PhysxMimicJointAPI:${b}`), d.set(_, R));
1014
1016
  }
1015
- const m = w.length ? { schemas: w, relationships: d } : void 0;
1016
- return m && r.set(f, m), m;
1017
- }, i = (u, f, h) => {
1018
- let y = null;
1019
- const w = () => y ?? (y = s(
1017
+ const m = g.length ? { schemas: g, relationships: d } : void 0;
1018
+ return m && r.set(u, m), m;
1019
+ }, i = (l, u, h) => {
1020
+ let w = null;
1021
+ const g = () => w ?? (w = s(
1020
1022
  "usd_probe_attribute_value",
1021
1023
  ["number", "string", "string"],
1022
- [u, f, h]
1024
+ [l, u, h]
1023
1025
  ));
1024
1026
  return {
1025
- IsValid: () => w().valid === !0,
1027
+ IsValid: () => g().valid === !0,
1026
1028
  Get: () => {
1027
- const d = w();
1029
+ const d = g();
1028
1030
  return d.valid === !0 ? typeof d.value == "string" ? t.get(d.value) ?? d.value : d.value : null;
1029
1031
  },
1030
- HasAuthoredValue: () => w().authored === !0,
1032
+ HasAuthoredValue: () => g().authored === !0,
1031
1033
  GetName: () => h,
1032
1034
  GetMetadata: (d) => {
1033
- const m = s("usd_probe_attribute_metadata", ["number", "string", "string", "string"], [u, f, h, d]);
1035
+ const m = s("usd_probe_attribute_metadata", ["number", "string", "string", "string"], [l, u, h, d]);
1034
1036
  return m.valid === !0 && m.found === !0 ? m.value ?? null : null;
1035
1037
  },
1036
1038
  // The viewer accepts either plain strings or objects with GetString().
1037
- GetConnections: () => s("usd_probe_attribute_connections", ["number", "string", "string"], [u, f, h]).paths ?? [],
1039
+ GetConnections: () => s("usd_probe_attribute_connections", ["number", "string", "string"], [l, u, h]).paths ?? [],
1038
1040
  delete: () => {
1039
1041
  }
1040
1042
  };
1041
- }, l = (u, f) => ({
1042
- __path: f,
1043
- __stageId: u,
1044
- IsValid: () => s("usd_probe_prim_info", ["number", "string"], [u, f]).valid === !0,
1045
- GetName: () => String(f.split("/").pop() ?? ""),
1046
- GetPath: () => new a(f),
1047
- GetTypeName: () => String(s("usd_probe_prim_info", ["number", "string"], [u, f]).typeName ?? ""),
1048
- IsInstance: () => s("usd_probe_prim_info", ["number", "string"], [u, f]).instance === !0,
1043
+ }, f = (l, u) => ({
1044
+ __path: u,
1045
+ __stageId: l,
1046
+ IsValid: () => s("usd_probe_prim_info", ["number", "string"], [l, u]).valid === !0,
1047
+ GetName: () => String(u.split("/").pop() ?? ""),
1048
+ GetPath: () => new a(u),
1049
+ GetTypeName: () => String(s("usd_probe_prim_info", ["number", "string"], [l, u]).typeName ?? ""),
1050
+ IsInstance: () => s("usd_probe_prim_info", ["number", "string"], [l, u]).instance === !0,
1049
1051
  GetAppliedSchemas: () => {
1050
1052
  var h;
1051
- return ((h = c(u, f)) == null ? void 0 : h.schemas) ?? [];
1053
+ return ((h = c(l, u)) == null ? void 0 : h.schemas) ?? [];
1052
1054
  },
1053
1055
  GetRelationships: () => {
1054
1056
  var h;
1055
- return [...((h = c(u, f)) == null ? void 0 : h.relationships) ?? []].map(([y, w]) => ({
1056
- GetName: () => y,
1057
- GetTargets: () => w.map((d) => new a(d)),
1057
+ return [...((h = c(l, u)) == null ? void 0 : h.relationships) ?? []].map(([w, g]) => ({
1058
+ GetName: () => w,
1059
+ GetTargets: () => g.map((d) => new a(d)),
1058
1060
  delete: () => {
1059
1061
  }
1060
1062
  }));
1061
1063
  },
1062
- GetAttribute: (h) => i(u, f, h),
1063
- GetAttributes: () => (s("usd_probe_prim_attributes", ["number", "string"], [u, f]).names ?? []).map((h) => i(u, f, h)),
1064
- GetChildren: () => (s("usd_probe_prim_children", ["number", "string"], [u, f]).paths ?? []).map((h) => l(u, h)),
1064
+ GetAttribute: (h) => i(l, u, h),
1065
+ GetAttributes: () => (s("usd_probe_prim_attributes", ["number", "string"], [l, u]).names ?? []).map((h) => i(l, u, h)),
1066
+ GetChildren: () => (s("usd_probe_prim_children", ["number", "string"], [l, u]).paths ?? []).map((h) => f(l, h)),
1065
1067
  GetRelationship: (h) => {
1066
- const y = s(
1068
+ const w = s(
1067
1069
  "usd_probe_relationship_targets",
1068
1070
  ["number", "string", "string"],
1069
- [u, f, h]
1071
+ [l, u, h]
1070
1072
  ).paths ?? [];
1071
1073
  return {
1072
1074
  GetName: () => h,
1073
- GetTargets: () => y.map((w) => new a(w)),
1075
+ GetTargets: () => w.map((g) => new a(g)),
1074
1076
  delete: () => {
1075
1077
  }
1076
1078
  };
1077
1079
  },
1078
1080
  GetMetadata: (h) => {
1079
- const y = s("usd_probe_prim_metadata", ["number", "string", "string"], [u, f, h]);
1080
- return y.valid !== !0 ? null : typeof y.text == "string" ? y.text : y.found === !0 ? y.value : null;
1081
+ const w = s("usd_probe_prim_metadata", ["number", "string", "string"], [l, u, h]);
1082
+ return w.valid !== !0 ? null : typeof w.text == "string" ? w.text : w.found === !0 ? w.value : null;
1081
1083
  },
1082
1084
  delete: () => {
1083
1085
  }
1084
- }), p = (u) => ({
1085
- GetPrimAtPath: (f) => l(u, typeof f == "string" ? f : f.path),
1086
- GetPseudoRoot: () => Object.assign(l(u, "/"), {
1086
+ }), p = (l) => ({
1087
+ GetPrimAtPath: (u) => f(l, typeof u == "string" ? u : u.path),
1088
+ GetPseudoRoot: () => Object.assign(f(l, "/"), {
1087
1089
  // Stage-level metadata (metersPerUnit, upAxis, defaultPrim) is authored on
1088
1090
  // the layer, not composed onto the pseudo-root prim.
1089
- GetMetadata: (f) => {
1090
- const h = s("usd_probe_stage_metadata", ["number", "string"], [u, f]);
1091
+ GetMetadata: (u) => {
1092
+ const h = s("usd_probe_stage_metadata", ["number", "string"], [l, u]);
1091
1093
  return h.found === !0 ? h.value : null;
1092
1094
  },
1093
1095
  GetName: () => "",
1094
1096
  IsValid: () => !0
1095
1097
  }),
1096
- GetDescendants: (f, h = "") => s(
1098
+ GetDescendants: (u, h = "") => s(
1097
1099
  "usd_probe_prim_descendants",
1098
1100
  ["number", "string", "string"],
1099
- [u, f, h]
1101
+ [l, u, h]
1100
1102
  ).paths ?? [],
1101
1103
  delete: () => {
1102
1104
  }
1103
- }), { FS: g } = e;
1105
+ }), { FS: y } = e;
1104
1106
  return {
1105
1107
  FS: {
1106
- createDir: (u) => g.mkdirTree(u),
1107
- writeFile: (u, f) => g.writeFile(u, f),
1108
- exists: (u) => g.analyzePath(u, !0).exists,
1109
- listDir: (u) => g.readdir(u).filter((f) => f !== "." && f !== "..").map((f) => {
1110
- const h = `${u.replace(/\/+$/, "")}/${f}`;
1111
- return { path: h, name: f, isDir: g.isDir(g.stat(h).mode) };
1108
+ createDir: (l) => y.mkdirTree(l),
1109
+ writeFile: (l, u) => y.writeFile(l, u),
1110
+ exists: (l) => y.analyzePath(l, !0).exists,
1111
+ listDir: (l) => y.readdir(l).filter((u) => u !== "." && u !== "..").map((u) => {
1112
+ const h = `${l.replace(/\/+$/, "")}/${u}`;
1113
+ return { path: h, name: u, isDir: y.isDir(y.stat(h).mode) };
1112
1114
  }),
1113
- deleteFile: (u) => g.unlink(u),
1114
- deleteDir: (u) => g.rmdir(u)
1115
+ deleteFile: (l) => y.unlink(l),
1116
+ deleteDir: (l) => y.rmdir(l)
1115
1117
  },
1116
1118
  Sdf: { Path: a },
1117
1119
  Usd: { TimeCode: { Default: () => ({ delete: () => {
1118
1120
  } }) } },
1119
1121
  UsdShade: {
1120
- ComputeBoundMaterialPath: (u) => {
1121
- const f = s("usd_probe_bound_material", ["number", "string"], [u.__stageId, u.__path]);
1122
- return f.found !== !0 ? null : {
1123
- materialPath: String(f.materialPath ?? ""),
1124
- resolvedTargetPath: String(f.resolvedTargetPath ?? ""),
1125
- bindingRelationshipPath: String(f.bindingRelationshipPath ?? "")
1122
+ ComputeBoundMaterialPath: (l) => {
1123
+ const u = s("usd_probe_bound_material", ["number", "string"], [l.__stageId, l.__path]);
1124
+ return u.found !== !0 ? null : {
1125
+ materialPath: String(u.materialPath ?? ""),
1126
+ resolvedTargetPath: String(u.resolvedTargetPath ?? ""),
1127
+ bindingRelationshipPath: String(u.bindingRelationshipPath ?? "")
1126
1128
  };
1127
1129
  }
1128
1130
  },
1129
1131
  UsdUtils: {
1130
- ExtractSanitizedExternalReferences: (u) => s("usd_probe_external_references", ["string"], [u]).paths ?? []
1132
+ ExtractSanitizedExternalReferences: (l) => s("usd_probe_external_references", ["string"], [l]).paths ?? []
1131
1133
  },
1132
1134
  openStage: p
1133
1135
  };
1134
1136
  }
1135
- async function Kt(e, t, n, s = {}) {
1136
- var c;
1137
- if (typeof e._usd_probe_scene_visual != "function" || typeof e._usd_probe_scene_geometry != "function" || typeof e._usd_probe_scene_geometry_end != "function")
1137
+ async function en(e, t, n, s = {}) {
1138
+ var f, p, y;
1139
+ if (typeof e._usd_probe_scene_visual != "function" || typeof e._usd_probe_scene_geometry != "function" || typeof e._usd_probe_scene_geometry_end != "function" || typeof e._usd_probe_scene_point_cloud != "function" || typeof e._usd_probe_scene_point_clouds_end != "function" || typeof e._usd_probe_scene_gaussian != "function" || typeof e._usd_probe_scene_gaussians_end != "function")
1138
1140
  throw Object.assign(
1139
1141
  new Error("USD visual phases require the matching packaged openusd_probe runtime."),
1140
1142
  { code: "E_USD_RUNTIME_VERSION" }
@@ -1148,36 +1150,101 @@ async function Kt(e, t, n, s = {}) {
1148
1150
  if (a.error) throw new Error(a.error);
1149
1151
  const o = a, r = Math.max(1, Math.floor(s.batchSize ?? 8));
1150
1152
  try {
1151
- for (const [i, l] of o.elements.entries()) {
1152
- const g = l.geometry.streamIndex;
1153
- if (!Number.isInteger(g))
1154
- throw new Error(`USD scene geometry is missing a stream index for ${l.path}`);
1155
- const u = JSON.parse(e.ccall(
1153
+ for (const [l, u] of o.elements.entries()) {
1154
+ const w = u.geometry.streamIndex;
1155
+ if (!Number.isInteger(w))
1156
+ throw new Error(`USD scene geometry is missing a stream index for ${u.path}`);
1157
+ const g = JSON.parse(e.ccall(
1156
1158
  "usd_probe_scene_geometry",
1157
1159
  "string",
1158
1160
  ["number", "number"],
1159
- [t, g]
1161
+ [t, w]
1160
1162
  ));
1161
- if (!u.ok) throw new Error(u.error ?? `Failed to stream USD geometry for ${l.path}`);
1162
- l.geometry = Object.fromEntries(
1163
- Object.entries(u.geometry ?? {}).map(([f, h]) => [f, en(e, h)])
1164
- ), (c = s.onProgress) == null || c.call(s, i + 1, o.elements.length, l.path), (i + 1) % r === 0 && await Qt();
1163
+ if (!g.ok) throw new Error(g.error ?? `Failed to stream USD geometry for ${u.path}`);
1164
+ u.geometry = Object.fromEntries(
1165
+ Object.entries(g.geometry ?? {}).map(([d, m]) => [d, G(e, m)])
1166
+ ), (f = s.onProgress) == null || f.call(s, l + 1, o.elements.length, u.path), (l + 1) % r === 0 && await fe();
1165
1167
  }
1166
1168
  } finally {
1167
1169
  e.ccall("usd_probe_scene_geometry_end", "string", ["number"], [t]);
1168
1170
  }
1169
- return o;
1171
+ const c = [];
1172
+ try {
1173
+ for (const [l, u] of o.pointClouds.entries()) {
1174
+ const h = u.geometry.streamIndex;
1175
+ if (!Number.isInteger(h))
1176
+ throw new Error(`USD point-cloud geometry is missing a stream index for ${u.path}`);
1177
+ const w = JSON.parse(e.ccall(
1178
+ "usd_probe_scene_point_cloud",
1179
+ "string",
1180
+ ["number", "number"],
1181
+ [t, h]
1182
+ ));
1183
+ if (!w.ok)
1184
+ throw new Error(w.error ?? `Failed to stream USD point-cloud geometry for ${u.path}`);
1185
+ const g = w.geometry ?? {}, d = G(e, g.positions), m = G(e, g.widths), b = G(e, g.normals), _ = G(e, g.intensities), R = G(e, g.displayColor), x = G(e, g.displayOpacity);
1186
+ if (!(d instanceof Float32Array) || !(m instanceof Float32Array) || b !== null && !(b instanceof Float32Array) || _ !== null && !(_ instanceof Float32Array) || x !== null && !(x instanceof Float32Array) || R !== null && !(R instanceof Float32Array))
1187
+ throw new Error(`USD point-cloud geometry has invalid typed buffers: ${u.path}`);
1188
+ c.push({ path: u.path, positions: d, widths: m, normals: b, intensities: _, displayColor: R, displayOpacity: x }), (p = s.onProgress) == null || p.call(
1189
+ s,
1190
+ o.elements.length + l + 1,
1191
+ o.elements.length + o.pointClouds.length,
1192
+ u.path
1193
+ ), (l + 1) % r === 0 && await fe();
1194
+ }
1195
+ } finally {
1196
+ e.ccall("usd_probe_scene_point_clouds_end", "string", ["number"], [t]);
1197
+ }
1198
+ const i = [];
1199
+ try {
1200
+ for (const [l, u] of o.gaussianSplats.entries()) {
1201
+ const h = u.geometry.streamIndex;
1202
+ if (!Number.isInteger(h))
1203
+ throw new Error(`USD Gaussian geometry is missing a stream index for ${u.path}`);
1204
+ const w = JSON.parse(e.ccall(
1205
+ "usd_probe_scene_gaussian",
1206
+ "string",
1207
+ ["number", "number"],
1208
+ [t, h]
1209
+ ));
1210
+ if (!w.ok)
1211
+ throw new Error(w.error ?? `Failed to stream USD Gaussian geometry for ${u.path}`);
1212
+ const g = w.geometry ?? {}, d = G(e, g.positions), m = G(e, g.scales), b = G(e, g.orientations), _ = G(e, g.opacities), R = G(e, g.sphericalHarmonics), x = G(e, g.displayColor), O = Number(g.splatCount), F = Number(g.shDegree), j = g.worldMatrix;
1213
+ if (!Number.isSafeInteger(O) || O <= 0 || ![0, 1, 2, 3].includes(F) || !(d instanceof Float32Array) || !(m instanceof Float32Array) || !(b instanceof Float32Array) || !(_ instanceof Float32Array) || !(R instanceof Float32Array) || x !== null && !(x instanceof Float32Array) || !Array.isArray(j) || j.length !== 16 || j.some((H) => typeof H != "number" || !Number.isFinite(H)))
1214
+ throw new Error(`USD Gaussian geometry has invalid typed buffers: ${u.path}`);
1215
+ i.push({
1216
+ path: u.path,
1217
+ splatCount: O,
1218
+ shDegree: F,
1219
+ positions: d,
1220
+ scales: m,
1221
+ orientations: b,
1222
+ opacities: _,
1223
+ sphericalHarmonics: R,
1224
+ displayColor: x,
1225
+ worldMatrix: j
1226
+ }), (y = s.onProgress) == null || y.call(
1227
+ s,
1228
+ o.elements.length + o.pointClouds.length + l + 1,
1229
+ o.elements.length + o.pointClouds.length + o.gaussianSplats.length,
1230
+ u.path
1231
+ ), (l + 1) % r === 0 && await fe();
1232
+ }
1233
+ } finally {
1234
+ e.ccall("usd_probe_scene_gaussians_end", "string", ["number"], [t]);
1235
+ }
1236
+ return { ...o, pointClouds: c, gaussianSplats: i };
1170
1237
  }
1171
- function Qt() {
1238
+ function fe() {
1172
1239
  return new Promise((e) => setTimeout(e, 0));
1173
1240
  }
1174
- function en(e, t) {
1241
+ function G(e, t) {
1175
1242
  if (!t || typeof t != "object") return t ?? null;
1176
1243
  const { ptr: n, length: s, kind: a } = t;
1177
1244
  return typeof n != "number" ? t : s ? (a === "i32" ? new Int32Array(e.HEAP32.buffer, n, s) : new Float32Array(e.HEAPF32.buffer, n, s)).slice() : a === "i32" ? new Int32Array() : new Float32Array();
1178
1245
  }
1179
- function De(e, t, n, s) {
1180
- const a = (u, f, h) => JSON.parse(e.ccall(u, "string", f, h)), o = [...n.variantSelections ?? []];
1246
+ function ke(e, t, n, s) {
1247
+ const a = (l, u, h) => JSON.parse(e.ccall(l, "string", u, h)), o = [...n.variantSelections ?? []];
1181
1248
  let r = [];
1182
1249
  if (n.selectMuJoCoPhysicsVariant !== !1) {
1183
1250
  if (typeof e._usd_probe_stage_variants != "function")
@@ -1185,33 +1252,33 @@ function De(e, t, n, s) {
1185
1252
  new Error("USD variant discovery requires the matching packaged openusd_probe runtime."),
1186
1253
  { code: "E_USD_RUNTIME_VERSION" }
1187
1254
  );
1188
- const u = a("usd_probe_stage_variants", ["number"], [t.stageId]);
1189
- if (u.ok !== !0)
1190
- throw new Error(String(u.error ?? "Failed to enumerate USD variants."));
1191
- r = u.variants ?? [];
1255
+ const l = a("usd_probe_stage_variants", ["number"], [t.stageId]);
1256
+ if (l.ok !== !0)
1257
+ throw new Error(String(l.error ?? "Failed to enumerate USD variants."));
1258
+ r = l.variants ?? [];
1192
1259
  }
1193
- const c = new Set(r.map(Z)), i = s || r.length === 0 ? o : o.filter((u) => c.has(Z(u))), l = n.selectMuJoCoPhysicsVariant === !1 ? [] : Dt(r, i), p = /* @__PURE__ */ new Map();
1194
- for (const u of [...i, ...l])
1195
- p.set(Z(u), u);
1196
- let g = [];
1197
- for (const u of p.values()) {
1198
- const f = a(
1260
+ const c = new Set(r.map(Y)), i = s || r.length === 0 ? o : o.filter((l) => c.has(Y(l))), f = n.selectMuJoCoPhysicsVariant === !1 ? [] : kt(r, i), p = /* @__PURE__ */ new Map();
1261
+ for (const l of [...i, ...f])
1262
+ p.set(Y(l), l);
1263
+ let y = [];
1264
+ for (const l of p.values()) {
1265
+ const u = a(
1199
1266
  "usd_probe_stage_set_variant",
1200
1267
  ["number", "string", "string", "string"],
1201
- [t.stageId, u.primPath, u.setName, u.selection]
1268
+ [t.stageId, l.primPath, l.setName, l.selection]
1202
1269
  );
1203
- if (f.ok === !0)
1204
- g.push(u);
1270
+ if (u.ok === !0)
1271
+ y.push(l);
1205
1272
  else if (s)
1206
- throw new Error(String(f.error ?? `Failed to select USD variant ${u.primPath}:${u.setName}=${u.selection}`));
1273
+ throw new Error(String(u.error ?? `Failed to select USD variant ${l.primPath}:${l.setName}=${l.selection}`));
1207
1274
  }
1208
1275
  if (n.selectMuJoCoPhysicsVariant !== !1) {
1209
- const u = new Set(i.map(Z)), f = /* @__PURE__ */ new Set();
1210
- for (const h of g) {
1211
- const y = Z(h);
1212
- if (u.has(y)) continue;
1213
- const w = r.find((S) => S.primPath === h.primPath && S.setName === h.setName);
1214
- if (!(w != null && w.selection) || w.selection === h.selection) continue;
1276
+ const l = new Set(i.map(Y)), u = /* @__PURE__ */ new Set();
1277
+ for (const h of y) {
1278
+ const w = Y(h);
1279
+ if (l.has(w)) continue;
1280
+ const g = r.find((b) => b.primPath === h.primPath && b.setName === h.setName);
1281
+ if (!(g != null && g.selection) || g.selection === h.selection) continue;
1215
1282
  const d = a(
1216
1283
  "usd_probe_prim_descendants",
1217
1284
  ["number", "string", "string"],
@@ -1225,146 +1292,146 @@ function De(e, t, n, s) {
1225
1292
  const m = a(
1226
1293
  "usd_probe_stage_set_variant",
1227
1294
  ["number", "string", "string", "string"],
1228
- [t.stageId, h.primPath, h.setName, w.selection]
1295
+ [t.stageId, h.primPath, h.setName, g.selection]
1229
1296
  );
1230
1297
  if (m.ok !== !0)
1231
- throw new Error(String(m.error ?? `Failed to restore authored USD variant ${h.primPath}:${h.setName}=${w.selection}`));
1232
- f.add(y);
1298
+ throw new Error(String(m.error ?? `Failed to restore authored USD variant ${h.primPath}:${h.setName}=${g.selection}`));
1299
+ u.add(w);
1233
1300
  }
1234
- f.size > 0 && (g = g.filter((h) => !f.has(Z(h))));
1301
+ u.size > 0 && (y = y.filter((h) => !u.has(Y(h))));
1235
1302
  }
1236
- return { discoveredVariants: r, selections: g };
1237
- }
1238
- async function tn(e, t, n, s, a, o, r, c, i, l, p, g, u, f, h, y, w, d) {
1239
- const m = {}, S = [...f], _ = q(t.href, n), O = Oe(t.href, t), B = /* @__PURE__ */ new Set([O]), j = /* @__PURE__ */ new Map([[_, 0]]), F = /* @__PURE__ */ new Set([_]);
1240
- r.set(_, O);
1241
- const H = /* @__PURE__ */ new Set(), J = () => {
1242
- const b = Object.keys(m).length > 0;
1243
- if (b && typeof e._usd_probe_stage_open_mapped != "function")
1303
+ return { discoveredVariants: r, selections: y };
1304
+ }
1305
+ async function tn(e, t, n, s, a, o, r, c, i, f, p, y, l, u, h, w, g, d) {
1306
+ const m = {}, b = [...u], _ = Z(t.href, n), R = $e(t.href, t), x = /* @__PURE__ */ new Set([R]), O = /* @__PURE__ */ new Map([[_, 0]]), F = /* @__PURE__ */ new Set([_]);
1307
+ r.set(_, R);
1308
+ const j = /* @__PURE__ */ new Set(), H = () => {
1309
+ const S = Object.keys(m).length > 0;
1310
+ if (S && typeof e._usd_probe_stage_open_mapped != "function")
1244
1311
  throw Object.assign(
1245
1312
  new Error("USD dependency mapping requires the matching packaged openusd_probe.js and .wasm runtime."),
1246
1313
  { code: "E_USD_RUNTIME_VERSION" }
1247
1314
  );
1248
- return b ? a("usd_probe_stage_open_mapped", ["string", "string"], [_, JSON.stringify(m)]) : a("usd_probe_stage_open", ["string"], [_]);
1249
- }, V = (b) => {
1250
- var z, G;
1251
- const M = r.get(b.layer);
1252
- if (M === void 0)
1253
- throw new Error(`Missing USD layer identity for ${b.layer}`);
1254
- const U = ((z = Object.entries(m[b.layer] ?? {}).find(([, L]) => L === b.path)) == null ? void 0 : z[0]) ?? b.path;
1315
+ return S ? a("usd_probe_stage_open_mapped", ["string", "string"], [_, JSON.stringify(m)]) : a("usd_probe_stage_open", ["string"], [_]);
1316
+ }, z = (S) => {
1317
+ var J, W;
1318
+ const D = r.get(S.layer);
1319
+ if (D === void 0)
1320
+ throw new Error(`Missing USD layer identity for ${S.layer}`);
1321
+ const U = ((J = Object.entries(m[S.layer] ?? {}).find(([, V]) => V === S.path)) == null ? void 0 : J[0]) ?? S.path;
1255
1322
  if (!U || /^(?:data|blob):/i.test(U) || /\.mdl(?:[?#].*)?$/i.test(U))
1256
1323
  return null;
1257
- const R = Te(U, M, t);
1258
- if (!R) return null;
1259
- const { resolved: A, absolute: k, childIdentifier: v } = R, I = q(A.href, n), P = st(I, S), D = (P == null ? void 0 : P.paths.length) === 1 ? P.paths[0] : null, N = D ?? I, x = b.kind !== "resource" || rn(A.pathname), T = (j.get(b.layer) ?? 0) + 1;
1260
- if (D && r.set(D, v), m[G = b.layer] ?? (m[G] = {}), b.kind === "resource" && u === "package" && P && P.paths.length > 1) {
1261
- const L = `${n}/__deferred_udim__/${encodeURIComponent(v)}`;
1262
- return m[b.layer][U] = L, r.set(L, v), null;
1324
+ const N = Ce(U, D, t);
1325
+ if (!N) return null;
1326
+ const { resolved: P, absolute: T, childIdentifier: v } = N, I = Z(P.href, n), A = at(I, b), k = (A == null ? void 0 : A.paths.length) === 1 ? A.paths[0] : null, M = k ?? I, $ = S.kind !== "resource" || rn(P.pathname), C = (O.get(S.layer) ?? 0) + 1;
1327
+ if (k && r.set(k, v), m[W = S.layer] ?? (m[W] = {}), S.kind === "resource" && l === "package" && A && A.paths.length > 1) {
1328
+ const V = `${n}/__deferred_udim__/${encodeURIComponent(v)}`;
1329
+ return m[S.layer][U] = V, r.set(V, v), null;
1263
1330
  }
1264
- if (u === "package" && !f.has(N) && !Ie(A, t)) {
1265
- const L = `${n}/__skipped__/${encodeURIComponent(v)}`;
1266
- return m[b.layer][U] = L, r.set(L, v), H.has(v) || (H.add(v), w == null || w(v)), null;
1331
+ if (l === "package" && !u.has(M) && !Re(P, t)) {
1332
+ const V = `${n}/__skipped__/${encodeURIComponent(v)}`;
1333
+ return m[S.layer][U] = V, r.set(V, v), j.has(v) || (j.add(v), g == null || g(v)), null;
1267
1334
  }
1268
- if (!x && c && (c.set(v, A.href), c.set(U, A.href)), !x && !h)
1269
- return m[b.layer][U] = N, r.set(N, v), null;
1270
- if (m[b.layer][U] = N, o.has(N))
1271
- return r.set(N, v), j.set(N, T), x && F.add(N), null;
1272
- if (B.has(v)) return null;
1273
- if (T > p)
1335
+ if (!$ && c && (c.set(v, P.href), c.set(U, P.href)), !$ && !h)
1336
+ return m[S.layer][U] = M, r.set(M, v), null;
1337
+ if (m[S.layer][U] = M, o.has(M))
1338
+ return r.set(M, v), O.set(M, C), $ && F.add(M), null;
1339
+ if (x.has(v)) return null;
1340
+ if (C > p)
1274
1341
  throw new Error(`USD dependency depth limit exceeded (${p}): ${v}`);
1275
- if (B.size >= l)
1276
- throw new Error(`USD dependency limit exceeded (${l}).`);
1277
- return B.add(v), j.set(N, T), {
1342
+ if (x.size >= f)
1343
+ throw new Error(`USD dependency limit exceeded (${f}).`);
1344
+ return x.add(v), O.set(M, C), {
1278
1345
  item: {
1279
- url: A,
1280
- depth: T,
1281
- recurse: x,
1282
- absolute: k,
1283
- resource: b.kind === "resource",
1284
- owner: { path: b.layer, reference: U }
1346
+ url: P,
1347
+ depth: C,
1348
+ recurse: $,
1349
+ absolute: T,
1350
+ resource: S.kind === "resource",
1351
+ owner: { path: S.layer, reference: U }
1285
1352
  },
1286
1353
  identifier: v
1287
1354
  };
1288
1355
  };
1289
1356
  for (; ; ) {
1290
- const b = J();
1291
- if (!b.ok) throw new Error(b.error ?? `Failed to open ${_}`);
1292
- let M, U = [];
1357
+ const S = H();
1358
+ if (!S.ok) throw new Error(S.error ?? `Failed to open ${_}`);
1359
+ let D, U = [];
1293
1360
  try {
1294
- if (M = De(e, b, y, !1), typeof e._usd_probe_stage_external_references != "function")
1361
+ if (D = ke(e, S, w, !1), typeof e._usd_probe_stage_external_references != "function")
1295
1362
  throw Object.assign(
1296
1363
  new Error("Variant-aware USD dependency discovery requires the matching packaged openusd_probe runtime."),
1297
1364
  { code: "E_USD_RUNTIME_VERSION" }
1298
1365
  );
1299
- const R = a("usd_probe_stage_external_references", ["number"], [b.stageId]);
1300
- if (R.ok !== !0)
1301
- throw new Error(String(R.error ?? "Failed to enumerate active USD dependencies."));
1302
- const A = R.dependencies ?? [], k = /* @__PURE__ */ new Set();
1303
- for (const v of A) {
1304
- const I = V(v);
1366
+ const N = a("usd_probe_stage_external_references", ["number"], [S.stageId]);
1367
+ if (N.ok !== !0)
1368
+ throw new Error(String(N.error ?? "Failed to enumerate active USD dependencies."));
1369
+ const P = N.dependencies ?? [], T = /* @__PURE__ */ new Set();
1370
+ for (const v of P) {
1371
+ const I = z(v);
1305
1372
  if (!I) continue;
1306
- const P = `${I.item.url.href}\0${I.identifier}`;
1307
- k.has(P) || (k.add(P), U.push(I));
1373
+ const A = `${I.item.url.href}\0${I.identifier}`;
1374
+ T.has(A) || (T.add(A), U.push(I));
1308
1375
  }
1309
1376
  if (U.length === 0) {
1310
1377
  const v = /* @__PURE__ */ new Map();
1311
1378
  for (const I of F) {
1312
1379
  if (i.get(I) === !1) continue;
1313
- const P = a("usd_probe_external_references", ["string"], [I]);
1314
- if (v.set(I, P), P.hasVariantSets !== !1) continue;
1315
- const D = new Set(
1316
- P.compositionPaths ?? []
1380
+ const A = a("usd_probe_external_references", ["string"], [I]);
1381
+ if (v.set(I, A), A.hasVariantSets !== !1) continue;
1382
+ const k = new Set(
1383
+ A.compositionPaths ?? []
1317
1384
  );
1318
- for (const x of P.subLayers ?? []) {
1319
- if (!x) continue;
1320
- const T = V({ kind: "sublayer", layer: I, path: x });
1321
- T && !U.some((z) => z.identifier === T.identifier) && U.push(T);
1385
+ for (const $ of A.subLayers ?? []) {
1386
+ if (!$) continue;
1387
+ const C = z({ kind: "sublayer", layer: I, path: $ });
1388
+ C && !U.some((J) => J.identifier === C.identifier) && U.push(C);
1322
1389
  }
1323
- const N = [
1324
- ["reference", P.references],
1325
- ["payload", P.payloads]
1390
+ const M = [
1391
+ ["reference", A.references],
1392
+ ["payload", A.payloads]
1326
1393
  ];
1327
- for (const [x, T] of N)
1328
- for (const z of T ?? []) {
1329
- if (!z || !D.has(z)) continue;
1330
- const G = V({ kind: x, layer: I, path: z });
1331
- G && !U.some((L) => L.identifier === G.identifier) && U.push(G);
1394
+ for (const [$, C] of M)
1395
+ for (const J of C ?? []) {
1396
+ if (!J || !k.has(J)) continue;
1397
+ const W = z({ kind: $, layer: I, path: J });
1398
+ W && !U.some((V) => V.identifier === W.identifier) && U.push(W);
1332
1399
  }
1333
1400
  }
1334
1401
  if (U.length === 0)
1335
- for (const [I, P] of v) {
1336
- const D = new Set(
1337
- P.compositionPaths ?? []
1402
+ for (const [I, A] of v) {
1403
+ const k = new Set(
1404
+ A.compositionPaths ?? []
1338
1405
  );
1339
- for (const N of P.paths ?? []) {
1340
- if (!N || D.has(N)) continue;
1341
- const x = V({ kind: "resource", layer: I, path: N });
1342
- x && !U.some((T) => T.identifier === x.identifier) && U.push(x);
1406
+ for (const M of A.paths ?? []) {
1407
+ if (!M || k.has(M)) continue;
1408
+ const $ = z({ kind: "resource", layer: I, path: M });
1409
+ $ && !U.some((C) => C.identifier === $.identifier) && U.push($);
1343
1410
  }
1344
1411
  }
1345
1412
  }
1346
- } catch (R) {
1347
- throw a("usd_probe_stage_release", ["number"], [b.stageId]), R;
1413
+ } catch (N) {
1414
+ throw a("usd_probe_stage_release", ["number"], [S.stageId]), N;
1348
1415
  }
1349
1416
  if (U.length === 0)
1350
- return { mappings: m, opened: b, variantConfiguration: M };
1351
- a("usd_probe_stage_release", ["number"], [b.stageId]), await nn(
1417
+ return { mappings: m, opened: S, variantConfiguration: D };
1418
+ a("usd_probe_stage_release", ["number"], [S.stageId]), await nn(
1352
1419
  U,
1353
- Math.max(1, g),
1354
- async ({ item: R, identifier: A }) => {
1355
- if (!R.recurse && !h) return;
1356
- const k = q(R.url.href, n);
1420
+ Math.max(1, y),
1421
+ async ({ item: N, identifier: P }) => {
1422
+ if (!N.recurse && !h) return;
1423
+ const T = Z(N.url.href, n);
1357
1424
  let v;
1358
1425
  try {
1359
- v = await s(R.url, A);
1426
+ v = await s(N.url, P);
1360
1427
  } catch (I) {
1361
- if (!R.resource || !Ye(A) || !et(I))
1428
+ if (!N.resource || !Qe(P) || !nt(I))
1362
1429
  throw I;
1363
- const P = `${n}/__unavailable__/${encodeURIComponent(A)}`;
1364
- R.owner && (m[R.owner.path][R.owner.reference] = P), r.set(P, A), d == null || d(A, I);
1430
+ const A = `${n}/__unavailable__/${encodeURIComponent(P)}`;
1431
+ N.owner && (m[N.owner.path][N.owner.reference] = A), r.set(A, P), d == null || d(P, I);
1365
1432
  return;
1366
1433
  }
1367
- i.set(k, ke(v)), fe(e, k, v, o), r.set(k, A), R.recurse && (m[k] ?? (m[k] = {}), F.add(k));
1434
+ i.set(T, Oe(v)), he(e, T, v, o), r.set(T, P), N.recurse && (m[T] ?? (m[T] = {}), F.add(T));
1368
1435
  }
1369
1436
  );
1370
1437
  }
@@ -1383,13 +1450,13 @@ async function nn(e, t, n) {
1383
1450
  function rn(e) {
1384
1451
  var n, s;
1385
1452
  const t = (s = (n = e.split(/[?#]/, 1)[0]) == null ? void 0 : n.split(".").pop()) == null ? void 0 : s.toLowerCase();
1386
- return t != null && Zt.has(t);
1453
+ return t != null && Kt.has(t);
1387
1454
  }
1388
- function ke(e) {
1389
- return xe(e) ? e.includes(64) : !0;
1455
+ function Oe(e) {
1456
+ return Te(e) ? e.includes(64) : !0;
1390
1457
  }
1391
1458
  function sn(e) {
1392
- return xe(e) ? on(e, [
1459
+ return Te(e) ? on(e, [
1393
1460
  "subLayers",
1394
1461
  "references",
1395
1462
  "payload",
@@ -1397,7 +1464,7 @@ function sn(e) {
1397
1464
  "clipAssetPaths"
1398
1465
  ]) : !0;
1399
1466
  }
1400
- function xe(e) {
1467
+ function Te(e) {
1401
1468
  let t = e[0] === 239 && e[1] === 187 && e[2] === 191 ? 3 : 0;
1402
1469
  for (; t < e.length && t < 64 && /\s/.test(String.fromCharCode(e[t])); ) t += 1;
1403
1470
  return e[t] === 35 && e[t + 1] === 117 && e[t + 2] === 115 && e[t + 3] === 100 && e[t + 4] === 97;
@@ -1415,8 +1482,8 @@ function on(e, t) {
1415
1482
  if (r)
1416
1483
  for (const c of r) {
1417
1484
  let i = !0;
1418
- for (let l = 1; l < c.length; ++l)
1419
- if (e[o + l] !== c.charCodeAt(l)) {
1485
+ for (let f = 1; f < c.length; ++f)
1486
+ if (e[o + f] !== c.charCodeAt(f)) {
1420
1487
  i = !1;
1421
1488
  break;
1422
1489
  }
@@ -1425,7 +1492,7 @@ function on(e, t) {
1425
1492
  }
1426
1493
  return !1;
1427
1494
  }
1428
- function Oe(e, t) {
1495
+ function $e(e, t) {
1429
1496
  const n = new URL(e);
1430
1497
  if (n.protocol !== t.protocol || n.host !== t.host) return n.href;
1431
1498
  const s = new URL(".", t).pathname.split("/").filter(Boolean), a = n.pathname.split("/").filter(Boolean);
@@ -1434,7 +1501,7 @@ function Oe(e, t) {
1434
1501
  const r = [...s.slice(o).map(() => ".."), ...a.slice(o)].join("/");
1435
1502
  return decodeURIComponent(r) + n.search + n.hash;
1436
1503
  }
1437
- function Te(e, t, n) {
1504
+ function Ce(e, t, n) {
1438
1505
  let s;
1439
1506
  try {
1440
1507
  s = new URL(e, new URL(t, n));
@@ -1445,10 +1512,10 @@ function Te(e, t, n) {
1445
1512
  return {
1446
1513
  resolved: s,
1447
1514
  absolute: r,
1448
- childIdentifier: r ? s.href : Oe(s.href, n)
1515
+ childIdentifier: r ? s.href : $e(s.href, n)
1449
1516
  };
1450
1517
  }
1451
- function q(e, t) {
1518
+ function Z(e, t) {
1452
1519
  const n = new URL(e), s = encodeURIComponent(`${n.protocol}//${n.host}`);
1453
1520
  let a = n.pathname.split("/").map((o) => decodeURIComponent(o).replaceAll("/", "%2F").replaceAll("\\", "%5C")).join("/");
1454
1521
  if (n.search || n.hash) {
@@ -1457,7 +1524,7 @@ function q(e, t) {
1457
1524
  }
1458
1525
  return `${t}/${s}${a}`;
1459
1526
  }
1460
- function $e(e, t) {
1527
+ function Le(e, t) {
1461
1528
  if (!e || typeof e != "object" || ArrayBuffer.isView(e)) return;
1462
1529
  const n = e;
1463
1530
  if (typeof n.path == "string" && typeof n.resolvedPath == "string") {
@@ -1467,9 +1534,9 @@ function $e(e, t) {
1467
1534
  }
1468
1535
  return;
1469
1536
  }
1470
- for (const s of Object.values(e)) $e(s, t);
1537
+ for (const s of Object.values(e)) Le(s, t);
1471
1538
  }
1472
- function Le(e, t, n) {
1539
+ function Fe(e, t, n) {
1473
1540
  if (!e || typeof e != "object" || ArrayBuffer.isView(e)) return;
1474
1541
  const s = e;
1475
1542
  if (typeof s.path == "string" && typeof s.ownerLayer == "string") {
@@ -1479,29 +1546,29 @@ function Le(e, t, n) {
1479
1546
  else {
1480
1547
  const o = t.get(s.ownerLayer);
1481
1548
  if (o) {
1482
- const r = Te(s.path, o, n);
1549
+ const r = Ce(s.path, o, n);
1483
1550
  r && (s.path = r.childIdentifier, s.resolvedPath = r.childIdentifier);
1484
1551
  }
1485
1552
  }
1486
1553
  delete s.ownerLayer;
1487
1554
  return;
1488
1555
  }
1489
- for (const a of Object.values(e)) Le(a, t, n);
1556
+ for (const a of Object.values(e)) Fe(a, t, n);
1490
1557
  }
1491
- function Ce(e, t) {
1558
+ function je(e, t) {
1492
1559
  if (e.analyzePath(t).exists) {
1493
1560
  for (const n of e.readdir(t)) {
1494
1561
  if (n === "." || n === "..") continue;
1495
1562
  const s = `${t}/${n}`;
1496
- e.isDir(e.stat(s).mode) ? Ce(e, s) : e.unlink(s);
1563
+ e.isDir(e.stat(s).mode) ? je(e, s) : e.unlink(s);
1497
1564
  }
1498
1565
  e.rmdir(t);
1499
1566
  }
1500
1567
  }
1501
- function fe(e, t, n, s) {
1568
+ function he(e, t, n, s) {
1502
1569
  s.has(t) || (e.FS.mkdirTree(t.split("/").slice(0, -1).join("/") || "/"), e.FS.writeFile(t, n), s.add(t));
1503
1570
  }
1504
- function Z(e) {
1571
+ function Y(e) {
1505
1572
  return `${e.primPath}\0${e.setName}`;
1506
1573
  }
1507
1574
  async function Pe(e) {
@@ -1519,14 +1586,14 @@ function cn(e) {
1519
1586
  return !0;
1520
1587
  };
1521
1588
  if (e[0] === 137 && n(1, "PNG") && n(12, "IHDR"))
1522
- return K(t.getUint32(16), t.getUint32(20));
1589
+ return Q(t.getUint32(16), t.getUint32(20));
1523
1590
  if (e[0] === 255 && e[1] === 216) {
1524
1591
  let s = 2;
1525
1592
  for (; s + 9 < e.length; ) {
1526
1593
  if (e[s] !== 255) return null;
1527
1594
  const a = e[s + 1], o = e[s + 2] << 8 | e[s + 3];
1528
1595
  if (a >= 192 && a <= 207 && a !== 196 && a !== 200 && a !== 204)
1529
- return K(
1596
+ return Q(
1530
1597
  e[s + 7] << 8 | e[s + 8],
1531
1598
  e[s + 5] << 8 | e[s + 6]
1532
1599
  );
@@ -1537,22 +1604,22 @@ function cn(e) {
1537
1604
  }
1538
1605
  if (n(0, "RIFF") && n(8, "WEBP")) {
1539
1606
  if (n(12, "VP8 "))
1540
- return K(
1607
+ return Q(
1541
1608
  t.getUint16(26, !0) & 16383,
1542
1609
  t.getUint16(28, !0) & 16383
1543
1610
  );
1544
1611
  if (n(12, "VP8L")) {
1545
1612
  const s = t.getUint32(21, !0);
1546
- return K((s & 16383) + 1, (s >>> 14 & 16383) + 1);
1613
+ return Q((s & 16383) + 1, (s >>> 14 & 16383) + 1);
1547
1614
  }
1548
1615
  if (n(12, "VP8X")) {
1549
1616
  const s = (a) => e[a] | e[a + 1] << 8 | e[a + 2] << 16;
1550
- return K(s(24) + 1, s(27) + 1);
1617
+ return Q(s(24) + 1, s(27) + 1);
1551
1618
  }
1552
1619
  }
1553
1620
  return null;
1554
1621
  }
1555
- function un(e, t) {
1622
+ function ln(e, t) {
1556
1623
  const n = Math.max(e.width, e.height);
1557
1624
  if (t <= 0 || n <= t) return e;
1558
1625
  const s = t / n;
@@ -1561,10 +1628,10 @@ function un(e, t) {
1561
1628
  height: Math.max(1, Math.round(e.height * s))
1562
1629
  };
1563
1630
  }
1564
- function K(e, t) {
1631
+ function Q(e, t) {
1565
1632
  return e > 0 && t > 0 ? { width: e, height: t } : null;
1566
1633
  }
1567
- function Y(e) {
1634
+ function K(e) {
1568
1635
  return e instanceof Error ? {
1569
1636
  name: e.name,
1570
1637
  message: e.message,
@@ -1572,32 +1639,52 @@ function Y(e) {
1572
1639
  ...e.stack ? { stack: e.stack } : {}
1573
1640
  } : { name: "Error", message: String(e) };
1574
1641
  }
1575
- const ee = globalThis;
1576
- let ne = null, Q = null, re = null, se = null, le = !1, ln = 1;
1577
- const te = /* @__PURE__ */ new Map();
1578
- function C(e, t) {
1579
- ee.postMessage(e, t);
1642
+ const te = globalThis;
1643
+ let re = null, ee = null, se = null, oe = null, de = !1, un = 1;
1644
+ const ne = /* @__PURE__ */ new Map();
1645
+ function B(e, t) {
1646
+ te.postMessage(e, t);
1580
1647
  }
1581
1648
  function fn(e, t) {
1582
- const n = ln++;
1649
+ const n = un++;
1583
1650
  return new Promise((s, a) => {
1584
- te.set(n, { resolve: s, reject: a }), C({ type: "resource-request", id: n, url: e.href, identifier: t });
1651
+ ne.set(n, { resolve: s, reject: a }), B({ type: "resource-request", id: n, url: e.href, identifier: t });
1585
1652
  });
1586
1653
  }
1587
1654
  function dn(e) {
1588
- return ne ?? (ne = Yt(e)), ne;
1655
+ return re ?? (re = Qt(e)), re;
1589
1656
  }
1590
1657
  function hn(e) {
1591
1658
  const t = /* @__PURE__ */ new Set();
1592
1659
  for (const n of e.elements)
1593
1660
  for (const s of Object.values(n.geometry ?? {}))
1594
1661
  ArrayBuffer.isView(s) && t.add(s.buffer);
1662
+ for (const n of e.pointClouds)
1663
+ for (const s of [
1664
+ n.positions,
1665
+ n.widths,
1666
+ n.normals,
1667
+ n.intensities,
1668
+ n.displayColor,
1669
+ n.displayOpacity
1670
+ ])
1671
+ s && t.add(s.buffer);
1672
+ for (const n of e.gaussianSplats)
1673
+ for (const s of [
1674
+ n.positions,
1675
+ n.scales,
1676
+ n.orientations,
1677
+ n.opacities,
1678
+ n.sphericalHarmonics,
1679
+ n.displayColor
1680
+ ])
1681
+ s && t.add(s.buffer);
1595
1682
  return [...t];
1596
1683
  }
1597
1684
  async function pn(e) {
1598
- if (!re) throw new Error("USD worker has no live stage");
1599
- const t = re[e.method];
1600
- return { type: "query-result", id: e.id, value: await t.apply(re, e.args) };
1685
+ if (!se) throw new Error("USD worker has no live stage");
1686
+ const t = se[e.method];
1687
+ return { type: "query-result", id: e.id, value: await t.apply(se, e.args) };
1601
1688
  }
1602
1689
  async function gn(e, t) {
1603
1690
  if (typeof createImageBitmap != "function")
@@ -1610,17 +1697,17 @@ async function gn(e, t) {
1610
1697
  colorSpaceConversion: "none"
1611
1698
  };
1612
1699
  if (a) {
1613
- const r = t > 0 ? un(a, t) : a;
1700
+ const r = t > 0 ? ln(a, t) : a;
1614
1701
  (r.width !== a.width || r.height !== a.height) && (o.resizeWidth = r.width, o.resizeHeight = r.height, o.resizeQuality = "high");
1615
1702
  }
1616
1703
  return createImageBitmap(new Blob([s]), o);
1617
1704
  }
1618
- ee.onmessage = async (e) => {
1705
+ te.onmessage = async (e) => {
1619
1706
  const t = e.data;
1620
1707
  if (t.type === "resource-result") {
1621
- const n = te.get(t.id);
1708
+ const n = ne.get(t.id);
1622
1709
  if (!n) return;
1623
- te.delete(t.id), t.error ? n.reject(Object.assign(new Error(t.error.message), {
1710
+ ne.delete(t.id), t.error ? n.reject(Object.assign(new Error(t.error.message), {
1624
1711
  name: t.error.name,
1625
1712
  ...t.error.code ? { code: t.error.code } : {}
1626
1713
  })) : n.resolve(t.bytes ?? new Uint8Array());
@@ -1628,16 +1715,16 @@ ee.onmessage = async (e) => {
1628
1715
  }
1629
1716
  if (t.type === "query") {
1630
1717
  try {
1631
- C(await pn(t));
1718
+ B(await pn(t));
1632
1719
  } catch (n) {
1633
- C({ type: "error", id: t.id, error: Y(n) });
1720
+ B({ type: "error", id: t.id, error: K(n) });
1634
1721
  }
1635
1722
  return;
1636
1723
  }
1637
1724
  if (t.type === "decode-texture") {
1638
1725
  try {
1639
1726
  const n = await gn(t.url, t.maxDimension);
1640
- C({
1727
+ B({
1641
1728
  type: "texture-decoded",
1642
1729
  id: t.id,
1643
1730
  bitmap: n,
@@ -1645,37 +1732,37 @@ ee.onmessage = async (e) => {
1645
1732
  height: n.height
1646
1733
  }, [n]);
1647
1734
  } catch (n) {
1648
- C({ type: "error", id: t.id, error: Y(n) });
1735
+ B({ type: "error", id: t.id, error: K(n) });
1649
1736
  }
1650
1737
  return;
1651
1738
  }
1652
1739
  if (t.type === "dispose") {
1653
- for (const n of te.values()) n.reject(new Error("USD worker disposed"));
1654
- te.clear(), Q == null || Q(), re = null, se = null, le = !1, ne = null, Q = null, ee.close();
1740
+ for (const n of ne.values()) n.reject(new Error("USD worker disposed"));
1741
+ ne.clear(), ee == null || ee(), se = null, oe = null, de = !1, re = null, ee = null, te.close();
1655
1742
  return;
1656
1743
  }
1657
1744
  if (t.type === "extract-physics") {
1658
- if (le || !se) return;
1659
- le = !0;
1745
+ if (de || !oe) return;
1746
+ de = !0;
1660
1747
  try {
1661
- C({ type: "physics-ready", phase: await se() });
1748
+ B({ type: "physics-ready", phase: await oe() });
1662
1749
  } catch (n) {
1663
- C({ type: "physics-failed", error: Y(n) });
1750
+ B({ type: "physics-failed", error: K(n) });
1664
1751
  }
1665
1752
  return;
1666
1753
  }
1667
1754
  if (t.type === "prepare") {
1668
1755
  try {
1669
1756
  const n = await dn(t.runtime);
1670
- t.warmup && await n.warmup(), C({ type: "worker-ready" });
1757
+ t.warmup && await n.warmup(), B({ type: "worker-ready" });
1671
1758
  } catch (n) {
1672
- C({ type: "error", error: Y(n) }), ee.close();
1759
+ B({ type: "error", error: K(n) }), te.close();
1673
1760
  }
1674
1761
  return;
1675
1762
  }
1676
1763
  try {
1677
- if (!ne) throw new Error("USD worker was not prepared before load");
1678
- const s = await (await ne).parseVisualSceneAsync(t.input, {
1764
+ if (!re) throw new Error("USD worker was not prepared before load");
1765
+ const s = await (await re).parseVisualSceneAsync(t.input, {
1679
1766
  ...t.options,
1680
1767
  packagePaths: t.options.packagePaths,
1681
1768
  readTextureBytes: t.options.readTextureBytes ?? !1,
@@ -1683,17 +1770,17 @@ ee.onmessage = async (e) => {
1683
1770
  convertZUp: !1,
1684
1771
  loadLights: !1,
1685
1772
  resolveBytes: fn,
1686
- onReferenceSkipped: (r) => C({ type: "event", event: "reference-skipped", identifier: r }),
1687
- onResourceFailed: (r, c) => C({ type: "event", event: "resource-failed", identifier: r, error: Y(c) })
1773
+ onReferenceSkipped: (r) => B({ type: "event", event: "reference-skipped", identifier: r }),
1774
+ onResourceFailed: (r, c) => B({ type: "event", event: "resource-failed", identifier: r, error: K(c) })
1688
1775
  });
1689
- Q = s.release, re = Ne(s.stage, s.pxr), se = s.readPhysics;
1776
+ ee = s.release, se = xe(s.stage, s.pxr), oe = s.readPhysics;
1690
1777
  const a = s.data, o = hn(a);
1691
- C({
1778
+ B({
1692
1779
  type: "visual-ready",
1693
1780
  data: a,
1694
1781
  textureURLs: [...s.textureURLs ?? []]
1695
1782
  }, o);
1696
1783
  } catch (n) {
1697
- C({ type: "error", error: Y(n) }), ee.close();
1784
+ B({ type: "error", error: K(n) }), te.close();
1698
1785
  }
1699
1786
  };