@shopware-ag/dive 1.18.5-beta.1 → 1.18.5-beta.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.
- package/build/{AR-B6LRgTEL.js → AR-B-g0updz.js} +293 -325
- package/build/AR-B-g0updz.js.map +1 -0
- package/build/AR-BWQebw6-.cjs +153 -0
- package/build/AR-BWQebw6-.cjs.map +1 -0
- package/build/IO-BgiJzKrU.js +1257 -0
- package/build/IO-BgiJzKrU.js.map +1 -0
- package/build/IO-CuYml7Y5.cjs +2 -0
- package/build/IO-CuYml7Y5.cjs.map +1 -0
- package/build/MediaCreator-4zmvmUWH.js +22 -0
- package/build/MediaCreator-4zmvmUWH.js.map +1 -0
- package/build/MediaCreator-BNxZVYyZ.cjs +2 -0
- package/build/MediaCreator-BNxZVYyZ.cjs.map +1 -0
- package/build/TextureUtils-CxpuVgwF.js +38 -0
- package/build/TextureUtils-CxpuVgwF.js.map +1 -0
- package/build/TextureUtils-DNG-yR77.cjs +19 -0
- package/build/TextureUtils-DNG-yR77.cjs.map +1 -0
- package/build/{dive-BmDCwQRo.js → dive-Mi8g8Khn.js} +2755 -2714
- package/build/{dive-BmDCwQRo.js.map → dive-Mi8g8Khn.js.map} +1 -1
- package/build/{dive-C-5_QywE.cjs → dive-_-yiZbhn.cjs} +184 -184
- package/build/{dive-C-5_QywE.cjs.map → dive-_-yiZbhn.cjs.map} +1 -1
- package/build/dive.cjs +1 -1
- package/build/dive.js +3 -3
- package/build/src/com/actions/media/generatemedia.d.ts +2 -3
- package/package.json +1 -1
- package/src/ar/arquicklook/ARQuickLook.ts +3 -1
- package/src/ar/arquicklook/__test__/ARQuickLook.test.ts +1 -1
- package/src/com/Communication.ts +53 -23
- package/src/com/__test__/Communication.test.ts +16 -8
- package/src/com/actions/media/generatemedia.ts +2 -3
- package/build/AR-B6LRgTEL.js.map +0 -1
- package/build/AR-YJZL1lm5.cjs +0 -170
- package/build/AR-YJZL1lm5.cjs.map +0 -1
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import { c as Jt, N as Kt, O as wt, o as te, p as ee, q as kt, M as dt, V as k, r as ie, Q as et, s as Z, t as st, W as se } from "./dive-Mi8g8Khn.js";
|
|
2
|
+
import { d as re } from "./TextureUtils-CxpuVgwF.js";
|
|
3
|
+
function ne(e, t) {
|
|
3
4
|
return e ? t in e : !1;
|
|
4
5
|
}
|
|
5
|
-
function
|
|
6
|
+
function Lt(e, t) {
|
|
6
7
|
if (e)
|
|
7
|
-
return
|
|
8
|
+
return ne(e, t) ? e : Lt(e.parent, t);
|
|
8
9
|
}
|
|
9
10
|
/*!
|
|
10
11
|
fflate - fast JavaScript compression/decompression
|
|
@@ -12,7 +13,7 @@ fflate - fast JavaScript compression/decompression
|
|
|
12
13
|
Licensed under MIT. https://github.com/101arrowz/fflate/blob/master/LICENSE
|
|
13
14
|
version 0.8.2
|
|
14
15
|
*/
|
|
15
|
-
var T = Uint8Array, I = Uint16Array,
|
|
16
|
+
var T = Uint8Array, I = Uint16Array, yt = Int32Array, xt = new T([
|
|
16
17
|
0,
|
|
17
18
|
0,
|
|
18
19
|
0,
|
|
@@ -47,7 +48,7 @@ var T = Uint8Array, I = Uint16Array, Et = Int32Array, Ct = new T([
|
|
|
47
48
|
0,
|
|
48
49
|
/* impossible */
|
|
49
50
|
0
|
|
50
|
-
]),
|
|
51
|
+
]), Mt = new T([
|
|
51
52
|
0,
|
|
52
53
|
0,
|
|
53
54
|
0,
|
|
@@ -81,55 +82,55 @@ var T = Uint8Array, I = Uint16Array, Et = Int32Array, Ct = new T([
|
|
|
81
82
|
/* unused */
|
|
82
83
|
0,
|
|
83
84
|
0
|
|
84
|
-
]),
|
|
85
|
+
]), Pt = new T([16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15]), zt = function(e, t) {
|
|
85
86
|
for (var i = new I(31), s = 0; s < 31; ++s)
|
|
86
87
|
i[s] = t += 1 << e[s - 1];
|
|
87
|
-
for (var r = new
|
|
88
|
+
for (var r = new yt(i[30]), s = 1; s < 30; ++s)
|
|
88
89
|
for (var n = i[s]; n < i[s + 1]; ++n)
|
|
89
90
|
r[n] = n - i[s] << 5 | s;
|
|
90
91
|
return { b: i, r };
|
|
91
|
-
},
|
|
92
|
-
|
|
93
|
-
var
|
|
92
|
+
}, Bt = zt(xt, 2), oe = Bt.b, _t = Bt.r;
|
|
93
|
+
oe[28] = 258, _t[258] = 28;
|
|
94
|
+
var ae = zt(Mt, 0), Ht = ae.r, pt = new I(32768);
|
|
94
95
|
for (var m = 0; m < 32768; ++m) {
|
|
95
|
-
var
|
|
96
|
-
|
|
96
|
+
var W = (m & 43690) >> 1 | (m & 21845) << 1;
|
|
97
|
+
W = (W & 52428) >> 2 | (W & 13107) << 2, W = (W & 61680) >> 4 | (W & 3855) << 4, pt[m] = ((W & 65280) >> 8 | (W & 255) << 8) >> 1;
|
|
97
98
|
}
|
|
98
|
-
var
|
|
99
|
+
var it = function(e, t, i) {
|
|
99
100
|
for (var s = e.length, r = 0, n = new I(t); r < s; ++r)
|
|
100
101
|
e[r] && ++n[e[r] - 1];
|
|
101
102
|
var o = new I(t);
|
|
102
103
|
for (r = 1; r < t; ++r)
|
|
103
104
|
o[r] = o[r - 1] + n[r - 1] << 1;
|
|
104
|
-
var
|
|
105
|
+
var h;
|
|
105
106
|
if (i) {
|
|
106
|
-
|
|
107
|
-
var
|
|
107
|
+
h = new I(1 << t);
|
|
108
|
+
var c = 15 - t;
|
|
108
109
|
for (r = 0; r < s; ++r)
|
|
109
110
|
if (e[r])
|
|
110
|
-
for (var
|
|
111
|
-
|
|
111
|
+
for (var u = r << 4 | e[r], a = t - e[r], l = o[e[r] - 1]++ << a, d = l | (1 << a) - 1; l <= d; ++l)
|
|
112
|
+
h[pt[l] >> c] = u;
|
|
112
113
|
} else
|
|
113
|
-
for (
|
|
114
|
-
e[r] && (
|
|
115
|
-
return
|
|
116
|
-
},
|
|
114
|
+
for (h = new I(s), r = 0; r < s; ++r)
|
|
115
|
+
e[r] && (h[r] = pt[o[e[r] - 1]++] >> 15 - e[r]);
|
|
116
|
+
return h;
|
|
117
|
+
}, F = new T(288);
|
|
117
118
|
for (var m = 0; m < 144; ++m)
|
|
118
|
-
|
|
119
|
+
F[m] = 8;
|
|
119
120
|
for (var m = 144; m < 256; ++m)
|
|
120
|
-
|
|
121
|
+
F[m] = 9;
|
|
121
122
|
for (var m = 256; m < 280; ++m)
|
|
122
|
-
|
|
123
|
+
F[m] = 7;
|
|
123
124
|
for (var m = 280; m < 288; ++m)
|
|
124
|
-
|
|
125
|
-
var
|
|
125
|
+
F[m] = 8;
|
|
126
|
+
var nt = new T(32);
|
|
126
127
|
for (var m = 0; m < 32; ++m)
|
|
127
|
-
|
|
128
|
-
var
|
|
128
|
+
nt[m] = 5;
|
|
129
|
+
var ce = /* @__PURE__ */ it(F, 9, 0), he = /* @__PURE__ */ it(nt, 5, 0), Vt = function(e) {
|
|
129
130
|
return (e + 7) / 8 | 0;
|
|
130
|
-
},
|
|
131
|
+
}, Nt = function(e, t, i) {
|
|
131
132
|
return (i == null || i > e.length) && (i = e.length), new T(e.subarray(t, i));
|
|
132
|
-
},
|
|
133
|
+
}, le = [
|
|
133
134
|
"unexpected EOF",
|
|
134
135
|
"invalid block type",
|
|
135
136
|
"invalid length/literal",
|
|
@@ -145,52 +146,52 @@ var Re = /* @__PURE__ */ rt(W, 9, 0), Se = /* @__PURE__ */ rt(ct, 5, 0), Wt = fu
|
|
|
145
146
|
"stream finishing",
|
|
146
147
|
"invalid zip data"
|
|
147
148
|
// determined by unknown compression method
|
|
148
|
-
],
|
|
149
|
-
var s = new Error(t ||
|
|
150
|
-
if (s.code = e, Error.captureStackTrace && Error.captureStackTrace(s,
|
|
149
|
+
], at = function(e, t, i) {
|
|
150
|
+
var s = new Error(t || le[e]);
|
|
151
|
+
if (s.code = e, Error.captureStackTrace && Error.captureStackTrace(s, at), !i)
|
|
151
152
|
throw s;
|
|
152
153
|
return s;
|
|
153
|
-
},
|
|
154
|
+
}, N = function(e, t, i) {
|
|
154
155
|
i <<= t & 7;
|
|
155
156
|
var s = t / 8 | 0;
|
|
156
157
|
e[s] |= i, e[s + 1] |= i >> 8;
|
|
157
|
-
},
|
|
158
|
+
}, K = function(e, t, i) {
|
|
158
159
|
i <<= t & 7;
|
|
159
160
|
var s = t / 8 | 0;
|
|
160
161
|
e[s] |= i, e[s + 1] |= i >> 8, e[s + 2] |= i >> 16;
|
|
161
|
-
},
|
|
162
|
+
}, ft = function(e, t) {
|
|
162
163
|
for (var i = [], s = 0; s < e.length; ++s)
|
|
163
164
|
e[s] && i.push({ s, f: e[s] });
|
|
164
165
|
var r = i.length, n = i.slice();
|
|
165
166
|
if (!r)
|
|
166
|
-
return { t:
|
|
167
|
+
return { t: Wt, l: 0 };
|
|
167
168
|
if (r == 1) {
|
|
168
169
|
var o = new T(i[0].s + 1);
|
|
169
170
|
return o[i[0].s] = 1, { t: o, l: 1 };
|
|
170
171
|
}
|
|
171
|
-
i.sort(function(
|
|
172
|
-
return
|
|
172
|
+
i.sort(function($, P) {
|
|
173
|
+
return $.f - P.f;
|
|
173
174
|
}), i.push({ s: -1, f: 25001 });
|
|
174
|
-
var
|
|
175
|
-
for (i[0] = { s: -1, f:
|
|
176
|
-
|
|
175
|
+
var h = i[0], c = i[1], u = 0, a = 1, l = 2;
|
|
176
|
+
for (i[0] = { s: -1, f: h.f + c.f, l: h, r: c }; a != r - 1; )
|
|
177
|
+
h = i[i[u].f < i[l].f ? u++ : l++], c = i[u != a && i[u].f < i[l].f ? u++ : l++], i[a++] = { s: -1, f: h.f + c.f, l: h, r: c };
|
|
177
178
|
for (var d = n[0].s, s = 1; s < r; ++s)
|
|
178
179
|
n[s].s > d && (d = n[s].s);
|
|
179
|
-
var f = new I(d + 1), p =
|
|
180
|
+
var f = new I(d + 1), p = vt(i[a - 1], f, 0);
|
|
180
181
|
if (p > t) {
|
|
181
|
-
var s = 0, g = 0, S = p - t,
|
|
182
|
+
var s = 0, g = 0, S = p - t, C = 1 << S;
|
|
182
183
|
for (n.sort(function(P, R) {
|
|
183
184
|
return f[R.s] - f[P.s] || P.f - R.f;
|
|
184
185
|
}); s < r; ++s) {
|
|
185
|
-
var
|
|
186
|
-
if (f[
|
|
187
|
-
g +=
|
|
186
|
+
var O = n[s].s;
|
|
187
|
+
if (f[O] > t)
|
|
188
|
+
g += C - (1 << p - f[O]), f[O] = t;
|
|
188
189
|
else
|
|
189
190
|
break;
|
|
190
191
|
}
|
|
191
192
|
for (g >>= S; g > 0; ) {
|
|
192
|
-
var
|
|
193
|
-
f[
|
|
193
|
+
var L = n[s].s;
|
|
194
|
+
f[L] < t ? g -= 1 << t - f[L]++ - 1 : ++s;
|
|
194
195
|
}
|
|
195
196
|
for (; s >= 0 && g; --s) {
|
|
196
197
|
var w = n[s].s;
|
|
@@ -199,15 +200,15 @@ var Re = /* @__PURE__ */ rt(W, 9, 0), Se = /* @__PURE__ */ rt(ct, 5, 0), Wt = fu
|
|
|
199
200
|
p = t;
|
|
200
201
|
}
|
|
201
202
|
return { t: new T(f), l: p };
|
|
202
|
-
},
|
|
203
|
-
return e.s == -1 ? Math.max(
|
|
204
|
-
},
|
|
203
|
+
}, vt = function(e, t, i) {
|
|
204
|
+
return e.s == -1 ? Math.max(vt(e.l, t, i + 1), vt(e.r, t, i + 1)) : t[e.s] = i;
|
|
205
|
+
}, At = function(e) {
|
|
205
206
|
for (var t = e.length; t && !e[--t]; )
|
|
206
207
|
;
|
|
207
|
-
for (var i = new I(++t), s = 0, r = e[0], n = 1, o = function(
|
|
208
|
-
i[s++] =
|
|
209
|
-
},
|
|
210
|
-
if (e[
|
|
208
|
+
for (var i = new I(++t), s = 0, r = e[0], n = 1, o = function(c) {
|
|
209
|
+
i[s++] = c;
|
|
210
|
+
}, h = 1; h <= t; ++h)
|
|
211
|
+
if (e[h] == r && h != t)
|
|
211
212
|
++n;
|
|
212
213
|
else {
|
|
213
214
|
if (!r && n > 2) {
|
|
@@ -221,135 +222,135 @@ var Re = /* @__PURE__ */ rt(W, 9, 0), Se = /* @__PURE__ */ rt(ct, 5, 0), Wt = fu
|
|
|
221
222
|
}
|
|
222
223
|
for (; n--; )
|
|
223
224
|
o(r);
|
|
224
|
-
n = 1, r = e[
|
|
225
|
+
n = 1, r = e[h];
|
|
225
226
|
}
|
|
226
227
|
return { c: i.subarray(0, s), n: t };
|
|
227
|
-
},
|
|
228
|
+
}, tt = function(e, t) {
|
|
228
229
|
for (var i = 0, s = 0; s < t.length; ++s)
|
|
229
230
|
i += e[s] * t[s];
|
|
230
231
|
return i;
|
|
231
|
-
},
|
|
232
|
-
var s = i.length, r =
|
|
232
|
+
}, jt = function(e, t, i) {
|
|
233
|
+
var s = i.length, r = Vt(t + 2);
|
|
233
234
|
e[r] = s & 255, e[r + 1] = s >> 8, e[r + 2] = e[r] ^ 255, e[r + 3] = e[r + 1] ^ 255;
|
|
234
235
|
for (var n = 0; n < s; ++n)
|
|
235
236
|
e[r + n + 4] = i[n];
|
|
236
237
|
return (r + 4 + s) * 8;
|
|
237
|
-
},
|
|
238
|
-
|
|
239
|
-
for (var
|
|
240
|
-
++R[
|
|
241
|
-
for (var v = 0; v <
|
|
242
|
-
++R[
|
|
243
|
-
for (var _ =
|
|
238
|
+
}, It = function(e, t, i, s, r, n, o, h, c, u, a) {
|
|
239
|
+
N(t, a++, i), ++r[256];
|
|
240
|
+
for (var l = ft(r, 15), d = l.t, f = l.l, p = ft(n, 15), g = p.t, S = p.l, C = At(d), O = C.c, L = C.n, w = At(g), $ = w.c, P = w.n, R = new I(19), v = 0; v < O.length; ++v)
|
|
241
|
+
++R[O[v] & 31];
|
|
242
|
+
for (var v = 0; v < $.length; ++v)
|
|
243
|
+
++R[$[v] & 31];
|
|
244
|
+
for (var _ = ft(R, 7), H = _.t, q = _.l, A = 19; A > 4 && !H[Pt[A - 1]]; --A)
|
|
244
245
|
;
|
|
245
|
-
var G =
|
|
246
|
-
if (
|
|
247
|
-
return
|
|
248
|
-
var z, y, U,
|
|
249
|
-
if (
|
|
250
|
-
z =
|
|
251
|
-
var
|
|
252
|
-
|
|
246
|
+
var G = u + 5 << 3, D = tt(r, F) + tt(n, nt) + o, X = tt(r, d) + tt(n, g) + o + 14 + 3 * A + tt(R, H) + 2 * R[16] + 3 * R[17] + 7 * R[18];
|
|
247
|
+
if (c >= 0 && G <= D && G <= X)
|
|
248
|
+
return jt(t, a, e.subarray(c, c + u));
|
|
249
|
+
var z, y, U, j;
|
|
250
|
+
if (N(t, a, 1 + (X < D)), a += 2, X < D) {
|
|
251
|
+
z = it(d, f, 0), y = d, U = it(g, S, 0), j = g;
|
|
252
|
+
var ct = it(H, q, 0);
|
|
253
|
+
N(t, a, L - 257), N(t, a + 5, P - 1), N(t, a + 10, A - 4), a += 14;
|
|
253
254
|
for (var v = 0; v < A; ++v)
|
|
254
|
-
|
|
255
|
+
N(t, a + 3 * v, H[Pt[v]]);
|
|
255
256
|
a += 3 * A;
|
|
256
|
-
for (var B = [
|
|
257
|
-
for (var Q = B[
|
|
257
|
+
for (var B = [O, $], J = 0; J < 2; ++J)
|
|
258
|
+
for (var Q = B[J], v = 0; v < Q.length; ++v) {
|
|
258
259
|
var V = Q[v] & 31;
|
|
259
|
-
|
|
260
|
+
N(t, a, ct[V]), a += H[V], V > 15 && (N(t, a, Q[v] >> 5 & 127), a += Q[v] >> 12);
|
|
260
261
|
}
|
|
261
262
|
} else
|
|
262
|
-
z =
|
|
263
|
-
for (var v = 0; v <
|
|
263
|
+
z = ce, y = F, U = he, j = nt;
|
|
264
|
+
for (var v = 0; v < h; ++v) {
|
|
264
265
|
var M = s[v];
|
|
265
266
|
if (M > 255) {
|
|
266
267
|
var V = M >> 18 & 31;
|
|
267
|
-
|
|
268
|
+
K(t, a, z[V + 257]), a += y[V + 257], V > 7 && (N(t, a, M >> 23 & 31), a += xt[V]);
|
|
268
269
|
var Y = M & 31;
|
|
269
|
-
|
|
270
|
+
K(t, a, U[Y]), a += j[Y], Y > 3 && (K(t, a, M >> 5 & 8191), a += Mt[Y]);
|
|
270
271
|
} else
|
|
271
|
-
|
|
272
|
+
K(t, a, z[M]), a += y[M];
|
|
272
273
|
}
|
|
273
|
-
return
|
|
274
|
-
},
|
|
275
|
-
var o = n.z || e.length,
|
|
274
|
+
return K(t, a, z[256]), a + y[256];
|
|
275
|
+
}, ue = /* @__PURE__ */ new yt([65540, 131080, 131088, 131104, 262176, 1048704, 1048832, 2114560, 2117632]), Wt = /* @__PURE__ */ new T(0), fe = function(e, t, i, s, r, n) {
|
|
276
|
+
var o = n.z || e.length, h = new T(s + o + 5 * (1 + Math.ceil(o / 7e3)) + r), c = h.subarray(s, h.length - r), u = n.l, a = (n.r || 0) & 7;
|
|
276
277
|
if (t) {
|
|
277
|
-
a && (
|
|
278
|
-
for (var
|
|
279
|
-
return (e[
|
|
280
|
-
}, w = new
|
|
281
|
-
var G =
|
|
282
|
-
if (g[
|
|
278
|
+
a && (c[0] = n.r >> 3);
|
|
279
|
+
for (var l = ue[t - 1], d = l >> 13, f = l & 8191, p = (1 << i) - 1, g = n.p || new I(32768), S = n.h || new I(p + 1), C = Math.ceil(i / 3), O = 2 * C, L = function(ut) {
|
|
280
|
+
return (e[ut] ^ e[ut + 1] << C ^ e[ut + 2] << O) & p;
|
|
281
|
+
}, w = new yt(25e3), $ = new I(288), P = new I(32), R = 0, v = 0, _ = n.i || 0, H = 0, q = n.w || 0, A = 0; _ + 2 < o; ++_) {
|
|
282
|
+
var G = L(_), D = _ & 32767, X = S[G];
|
|
283
|
+
if (g[D] = X, S[G] = D, q <= _) {
|
|
283
284
|
var z = o - _;
|
|
284
|
-
if ((R > 7e3 || H > 24576) && (z > 423 || !
|
|
285
|
-
a =
|
|
285
|
+
if ((R > 7e3 || H > 24576) && (z > 423 || !u)) {
|
|
286
|
+
a = It(e, c, 0, w, $, P, v, H, A, _ - A, a), H = R = v = 0, A = _;
|
|
286
287
|
for (var y = 0; y < 286; ++y)
|
|
287
|
-
|
|
288
|
+
$[y] = 0;
|
|
288
289
|
for (var y = 0; y < 30; ++y)
|
|
289
290
|
P[y] = 0;
|
|
290
291
|
}
|
|
291
|
-
var U = 2,
|
|
292
|
-
if (z > 2 && G ==
|
|
293
|
-
for (var
|
|
292
|
+
var U = 2, j = 0, ct = f, B = D - X & 32767;
|
|
293
|
+
if (z > 2 && G == L(_ - B))
|
|
294
|
+
for (var J = Math.min(d, z) - 1, Q = Math.min(32767, _), V = Math.min(258, z); B <= Q && --ct && D != X; ) {
|
|
294
295
|
if (e[_ + U] == e[_ + U - B]) {
|
|
295
296
|
for (var M = 0; M < V && e[_ + M] == e[_ + M - B]; ++M)
|
|
296
297
|
;
|
|
297
298
|
if (M > U) {
|
|
298
|
-
if (U = M,
|
|
299
|
+
if (U = M, j = B, M > J)
|
|
299
300
|
break;
|
|
300
|
-
for (var Y = Math.min(B, M - 2),
|
|
301
|
-
var
|
|
302
|
-
|
|
301
|
+
for (var Y = Math.min(B, M - 2), Tt = 0, y = 0; y < Y; ++y) {
|
|
302
|
+
var ht = _ - B + y & 32767, Zt = g[ht], Et = ht - Zt & 32767;
|
|
303
|
+
Et > Tt && (Tt = Et, X = ht);
|
|
303
304
|
}
|
|
304
305
|
}
|
|
305
306
|
}
|
|
306
|
-
|
|
307
|
+
D = X, X = g[D], B += D - X & 32767;
|
|
307
308
|
}
|
|
308
|
-
if (
|
|
309
|
-
w[H++] = 268435456 |
|
|
310
|
-
var
|
|
311
|
-
v +=
|
|
309
|
+
if (j) {
|
|
310
|
+
w[H++] = 268435456 | _t[U] << 18 | Ht[j];
|
|
311
|
+
var $t = _t[U] & 31, Ct = Ht[j] & 31;
|
|
312
|
+
v += xt[$t] + Mt[Ct], ++$[257 + $t], ++P[Ct], q = _ + U, ++R;
|
|
312
313
|
} else
|
|
313
|
-
w[H++] = e[_],
|
|
314
|
+
w[H++] = e[_], ++$[e[_]];
|
|
314
315
|
}
|
|
315
316
|
}
|
|
316
317
|
for (_ = Math.max(_, q); _ < o; ++_)
|
|
317
|
-
w[H++] = e[_],
|
|
318
|
-
a =
|
|
318
|
+
w[H++] = e[_], ++$[e[_]];
|
|
319
|
+
a = It(e, c, u, w, $, P, v, H, A, _ - A, a), u || (n.r = a & 7 | c[a / 8 | 0] << 3, a -= 7, n.h = S, n.p = g, n.i = _, n.w = q);
|
|
319
320
|
} else {
|
|
320
|
-
for (var _ = n.w || 0; _ < o +
|
|
321
|
-
var
|
|
322
|
-
|
|
321
|
+
for (var _ = n.w || 0; _ < o + u; _ += 65535) {
|
|
322
|
+
var lt = _ + 65535;
|
|
323
|
+
lt >= o && (c[a / 8 | 0] = u, lt = o), a = jt(c, a + 1, e.subarray(_, lt));
|
|
323
324
|
}
|
|
324
325
|
n.i = o;
|
|
325
326
|
}
|
|
326
|
-
return
|
|
327
|
-
},
|
|
327
|
+
return Nt(h, 0, s + Vt(a) + r);
|
|
328
|
+
}, de = /* @__PURE__ */ function() {
|
|
328
329
|
for (var e = new Int32Array(256), t = 0; t < 256; ++t) {
|
|
329
330
|
for (var i = t, s = 9; --s; )
|
|
330
331
|
i = (i & 1 && -306674912) ^ i >>> 1;
|
|
331
332
|
e[t] = i;
|
|
332
333
|
}
|
|
333
334
|
return e;
|
|
334
|
-
}(),
|
|
335
|
+
}(), _e = function() {
|
|
335
336
|
var e = -1;
|
|
336
337
|
return {
|
|
337
338
|
p: function(t) {
|
|
338
339
|
for (var i = e, s = 0; s < t.length; ++s)
|
|
339
|
-
i =
|
|
340
|
+
i = de[i & 255 ^ t[s]] ^ i >>> 8;
|
|
340
341
|
e = i;
|
|
341
342
|
},
|
|
342
343
|
d: function() {
|
|
343
344
|
return ~e;
|
|
344
345
|
}
|
|
345
346
|
};
|
|
346
|
-
},
|
|
347
|
+
}, pe = function(e, t, i, s, r) {
|
|
347
348
|
if (!r && (r = { l: 1 }, t.dictionary)) {
|
|
348
349
|
var n = t.dictionary.subarray(-32768), o = new T(n.length + e.length);
|
|
349
350
|
o.set(n), o.set(e, n.length), e = o, r.w = n.length;
|
|
350
351
|
}
|
|
351
|
-
return
|
|
352
|
-
},
|
|
352
|
+
return fe(e, t.level == null ? 6 : t.level, t.mem == null ? r.l ? Math.ceil(Math.max(8, Math.min(13, Math.log(e.length))) * 1.5) : 20 : 12 + t.mem, i, s, r);
|
|
353
|
+
}, Ft = function(e, t) {
|
|
353
354
|
var i = {};
|
|
354
355
|
for (var s in e)
|
|
355
356
|
i[s] = e[s];
|
|
@@ -360,118 +361,85 @@ var Re = /* @__PURE__ */ rt(W, 9, 0), Se = /* @__PURE__ */ rt(ct, 5, 0), Wt = fu
|
|
|
360
361
|
for (; i; ++t)
|
|
361
362
|
e[t] = i, i >>>= 8;
|
|
362
363
|
};
|
|
363
|
-
function
|
|
364
|
-
return
|
|
364
|
+
function ve(e, t) {
|
|
365
|
+
return pe(e, t || {}, 0, 0);
|
|
365
366
|
}
|
|
366
|
-
var
|
|
367
|
+
var qt = function(e, t, i, s) {
|
|
367
368
|
for (var r in e) {
|
|
368
|
-
var n = e[r], o = t + r,
|
|
369
|
-
Array.isArray(n) && (
|
|
369
|
+
var n = e[r], o = t + r, h = s;
|
|
370
|
+
Array.isArray(n) && (h = Ft(s, n[1]), n = n[0]), n instanceof T ? i[o] = [n, h] : (i[o += "/"] = [new T(0), h], qt(n, o, i, s));
|
|
370
371
|
}
|
|
371
|
-
},
|
|
372
|
+
}, Ot = typeof TextEncoder < "u" && /* @__PURE__ */ new TextEncoder(), ge = typeof TextDecoder < "u" && /* @__PURE__ */ new TextDecoder(), me = 0;
|
|
372
373
|
try {
|
|
373
|
-
|
|
374
|
+
ge.decode(Wt, { stream: !0 }), me = 1;
|
|
374
375
|
} catch {
|
|
375
376
|
}
|
|
376
|
-
function
|
|
377
|
+
function ot(e, t) {
|
|
377
378
|
var i;
|
|
378
|
-
if (
|
|
379
|
-
return
|
|
380
|
-
for (var s = e.length, r = new T(e.length + (e.length >> 1)), n = 0, o = function(
|
|
381
|
-
r[n++] =
|
|
379
|
+
if (Ot)
|
|
380
|
+
return Ot.encode(e);
|
|
381
|
+
for (var s = e.length, r = new T(e.length + (e.length >> 1)), n = 0, o = function(u) {
|
|
382
|
+
r[n++] = u;
|
|
382
383
|
}, i = 0; i < s; ++i) {
|
|
383
384
|
if (n + 5 > r.length) {
|
|
384
|
-
var
|
|
385
|
-
|
|
385
|
+
var h = new T(n + 8 + (s - i << 1));
|
|
386
|
+
h.set(r), r = h;
|
|
386
387
|
}
|
|
387
|
-
var
|
|
388
|
-
|
|
388
|
+
var c = e.charCodeAt(i);
|
|
389
|
+
c < 128 || t ? o(c) : c < 2048 ? (o(192 | c >> 6), o(128 | c & 63)) : c > 55295 && c < 57344 ? (c = 65536 + (c & 1047552) | e.charCodeAt(++i) & 1023, o(240 | c >> 18), o(128 | c >> 12 & 63), o(128 | c >> 6 & 63), o(128 | c & 63)) : (o(224 | c >> 12), o(128 | c >> 6 & 63), o(128 | c & 63));
|
|
389
390
|
}
|
|
390
|
-
return
|
|
391
|
+
return Nt(r, 0, n);
|
|
391
392
|
}
|
|
392
|
-
var
|
|
393
|
+
var gt = function(e) {
|
|
393
394
|
var t = 0;
|
|
394
395
|
if (e)
|
|
395
396
|
for (var i in e) {
|
|
396
397
|
var s = e[i].length;
|
|
397
|
-
s > 65535 &&
|
|
398
|
+
s > 65535 && at(9), t += s + 4;
|
|
398
399
|
}
|
|
399
400
|
return t;
|
|
400
|
-
},
|
|
401
|
-
var
|
|
401
|
+
}, Dt = function(e, t, i, s, r, n, o, h) {
|
|
402
|
+
var c = s.length, u = i.extra, a = h && h.length, l = gt(u);
|
|
402
403
|
x(e, t, o != null ? 33639248 : 67324752), t += 4, o != null && (e[t++] = 20, e[t++] = i.os), e[t] = 20, t += 2, e[t++] = i.flag << 1 | (n < 0 && 8), e[t++] = r && 8, e[t++] = i.compression & 255, e[t++] = i.compression >> 8;
|
|
403
404
|
var d = new Date(i.mtime == null ? Date.now() : i.mtime), f = d.getFullYear() - 1980;
|
|
404
|
-
if ((f < 0 || f > 119) &&
|
|
405
|
-
for (var p in
|
|
406
|
-
var g =
|
|
405
|
+
if ((f < 0 || f > 119) && at(10), x(e, t, f << 25 | d.getMonth() + 1 << 21 | d.getDate() << 16 | d.getHours() << 11 | d.getMinutes() << 5 | d.getSeconds() >> 1), t += 4, n != -1 && (x(e, t, i.crc), x(e, t + 4, n < 0 ? -n - 2 : n), x(e, t + 8, i.size)), x(e, t + 12, c), x(e, t + 14, l), t += 16, o != null && (x(e, t, a), x(e, t + 6, i.attrs), x(e, t + 10, o), t += 14), e.set(s, t), t += c, l)
|
|
406
|
+
for (var p in u) {
|
|
407
|
+
var g = u[p], S = g.length;
|
|
407
408
|
x(e, t, +p), x(e, t + 2, S), e.set(g, t + 4), t += 4 + S;
|
|
408
409
|
}
|
|
409
|
-
return a && (e.set(
|
|
410
|
-
},
|
|
410
|
+
return a && (e.set(h, t), t += a), t;
|
|
411
|
+
}, Re = function(e, t, i, s, r) {
|
|
411
412
|
x(e, t, 101010256), x(e, t + 8, i), x(e, t + 10, i), x(e, t + 12, s), x(e, t + 16, r);
|
|
412
413
|
};
|
|
413
|
-
function
|
|
414
|
+
function Se(e, t) {
|
|
414
415
|
t || (t = {});
|
|
415
416
|
var i = {}, s = [];
|
|
416
|
-
|
|
417
|
+
qt(e, "", i, t);
|
|
417
418
|
var r = 0, n = 0;
|
|
418
419
|
for (var o in i) {
|
|
419
|
-
var
|
|
420
|
-
d > 65535 &&
|
|
421
|
-
var
|
|
422
|
-
|
|
423
|
-
size:
|
|
424
|
-
crc:
|
|
425
|
-
c:
|
|
426
|
-
f:
|
|
420
|
+
var h = i[o], c = h[0], u = h[1], a = u.level == 0 ? 0 : 8, l = ot(o), d = l.length, f = u.comment, p = f && ot(f), g = p && p.length, S = gt(u.extra);
|
|
421
|
+
d > 65535 && at(11);
|
|
422
|
+
var C = a ? ve(c, u) : c, O = C.length, L = _e();
|
|
423
|
+
L.p(c), s.push(Ft(u, {
|
|
424
|
+
size: c.length,
|
|
425
|
+
crc: L.d(),
|
|
426
|
+
c: C,
|
|
427
|
+
f: l,
|
|
427
428
|
m: p,
|
|
428
429
|
u: d != o.length || p && f.length != g,
|
|
429
430
|
o: r,
|
|
430
431
|
compression: a
|
|
431
|
-
})), r += 30 + d + S +
|
|
432
|
+
})), r += 30 + d + S + O, n += 76 + 2 * (d + S) + (g || 0) + O;
|
|
432
433
|
}
|
|
433
|
-
for (var w = new T(n + 22),
|
|
434
|
-
var
|
|
435
|
-
|
|
436
|
-
var v = 30 +
|
|
437
|
-
w.set(
|
|
434
|
+
for (var w = new T(n + 22), $ = r, P = n - r, R = 0; R < s.length; ++R) {
|
|
435
|
+
var l = s[R];
|
|
436
|
+
Dt(w, l.o, l, l.f, l.u, l.c.length);
|
|
437
|
+
var v = 30 + l.f.length + gt(l.extra);
|
|
438
|
+
w.set(l.c, l.o + v), Dt(w, r, l, l.f, l.u, l.c.length, l.o, l.m), r += 16 + v + (l.m ? l.m.length : 0);
|
|
438
439
|
}
|
|
439
|
-
return
|
|
440
|
-
}
|
|
441
|
-
let it, vt, J, ot;
|
|
442
|
-
function Ae(e, t = 1 / 0, i = null) {
|
|
443
|
-
vt || (vt = new ie(2, 2, 1, 1)), J || (J = new se({
|
|
444
|
-
uniforms: { blitTexture: new re(e) },
|
|
445
|
-
vertexShader: `
|
|
446
|
-
varying vec2 vUv;
|
|
447
|
-
void main(){
|
|
448
|
-
vUv = uv;
|
|
449
|
-
gl_Position = vec4(position.xy * 1.0,0.,.999999);
|
|
450
|
-
}`,
|
|
451
|
-
fragmentShader: `
|
|
452
|
-
uniform sampler2D blitTexture;
|
|
453
|
-
varying vec2 vUv;
|
|
454
|
-
|
|
455
|
-
void main(){
|
|
456
|
-
gl_FragColor = vec4(vUv.xy, 0, 1);
|
|
457
|
-
|
|
458
|
-
#ifdef IS_SRGB
|
|
459
|
-
gl_FragColor = LinearTosRGB( texture2D( blitTexture, vUv) );
|
|
460
|
-
#else
|
|
461
|
-
gl_FragColor = texture2D( blitTexture, vUv);
|
|
462
|
-
#endif
|
|
463
|
-
}`
|
|
464
|
-
})), J.uniforms.blitTexture.value = e, J.defines.IS_SRGB = e.colorSpace == ne, J.needsUpdate = !0, ot || (ot = new bt(vt, J), ot.frustumCulled = !1);
|
|
465
|
-
const s = new oe(), r = new ae();
|
|
466
|
-
r.add(ot), i === null && (i = it = new ce({ antialias: !1 }));
|
|
467
|
-
const n = Math.min(e.image.width, t), o = Math.min(e.image.height, t);
|
|
468
|
-
i.setSize(n, o), i.clear(), i.render(r, s);
|
|
469
|
-
const c = document.createElement("canvas"), h = c.getContext("2d");
|
|
470
|
-
c.width = n, c.height = o, h.drawImage(i.domElement, 0, 0, n, o);
|
|
471
|
-
const l = new he(c);
|
|
472
|
-
return l.minFilter = e.minFilter, l.magFilter = e.magFilter, l.wrapS = e.wrapS, l.wrapT = e.wrapT, l.name = e.name, it && (it.forceContextLoss(), it.dispose(), it = null), l;
|
|
440
|
+
return Re(w, r, s.length, P, $), w;
|
|
473
441
|
}
|
|
474
|
-
class
|
|
442
|
+
class we {
|
|
475
443
|
async parse(t, i = {}) {
|
|
476
444
|
i = Object.assign({
|
|
477
445
|
ar: {
|
|
@@ -483,44 +451,44 @@ class Ie {
|
|
|
483
451
|
}, i);
|
|
484
452
|
const s = {}, r = "model.usda";
|
|
485
453
|
s[r] = null;
|
|
486
|
-
let n =
|
|
487
|
-
n +=
|
|
488
|
-
const o = {},
|
|
489
|
-
t.traverseVisible((
|
|
490
|
-
if (
|
|
491
|
-
const a =
|
|
492
|
-
if (
|
|
454
|
+
let n = Gt();
|
|
455
|
+
n += xe(i);
|
|
456
|
+
const o = {}, h = {};
|
|
457
|
+
t.traverseVisible((u) => {
|
|
458
|
+
if (u.isMesh) {
|
|
459
|
+
const a = u.geometry, l = u.material;
|
|
460
|
+
if (l.isMeshStandardMaterial) {
|
|
493
461
|
const d = "geometries/Geometry_" + a.id + ".usda";
|
|
494
462
|
if (!(d in s)) {
|
|
495
|
-
const f =
|
|
496
|
-
s[d] =
|
|
463
|
+
const f = Ee(a);
|
|
464
|
+
s[d] = be(f);
|
|
497
465
|
}
|
|
498
|
-
|
|
466
|
+
l.uuid in o || (o[l.uuid] = l), n += Te(u, a, l);
|
|
499
467
|
} else
|
|
500
|
-
console.warn("THREE.USDZExporter: Unsupported material type (USDZ only supports MeshStandardMaterial)",
|
|
501
|
-
} else
|
|
502
|
-
}), n +=
|
|
503
|
-
for (const
|
|
504
|
-
let a =
|
|
505
|
-
a.isCompressedTexture === !0 && (a =
|
|
506
|
-
const
|
|
507
|
-
s[`textures/Texture_${
|
|
468
|
+
console.warn("THREE.USDZExporter: Unsupported material type (USDZ only supports MeshStandardMaterial)", u);
|
|
469
|
+
} else u.isCamera && (n += Xe(u));
|
|
470
|
+
}), n += Me(), n += Ie(o, h, i.quickLookCompatible), s[r] = ot(n), n = null;
|
|
471
|
+
for (const u in h) {
|
|
472
|
+
let a = h[u];
|
|
473
|
+
a.isCompressedTexture === !0 && (a = re(a));
|
|
474
|
+
const l = ye(a.image, a.flipY, i.maxTextureSize), d = await new Promise((f) => l.toBlob(f, "image/png", 1));
|
|
475
|
+
s[`textures/Texture_${u}.png`] = new Uint8Array(await d.arrayBuffer());
|
|
508
476
|
}
|
|
509
|
-
let
|
|
510
|
-
for (const
|
|
511
|
-
const a = s[
|
|
512
|
-
|
|
513
|
-
const d =
|
|
477
|
+
let c = 0;
|
|
478
|
+
for (const u in s) {
|
|
479
|
+
const a = s[u], l = 34 + u.length;
|
|
480
|
+
c += l;
|
|
481
|
+
const d = c & 63;
|
|
514
482
|
if (d !== 4) {
|
|
515
483
|
const f = 64 - d, p = new Uint8Array(f);
|
|
516
|
-
s[
|
|
484
|
+
s[u] = [a, { extra: { 12345: p } }];
|
|
517
485
|
}
|
|
518
|
-
|
|
486
|
+
c = a.length;
|
|
519
487
|
}
|
|
520
|
-
return
|
|
488
|
+
return Se(s, { level: 0 });
|
|
521
489
|
}
|
|
522
490
|
}
|
|
523
|
-
function
|
|
491
|
+
function ye(e, t, i) {
|
|
524
492
|
if (typeof HTMLImageElement < "u" && e instanceof HTMLImageElement || typeof HTMLCanvasElement < "u" && e instanceof HTMLCanvasElement || typeof OffscreenCanvas < "u" && e instanceof OffscreenCanvas || typeof ImageBitmap < "u" && e instanceof ImageBitmap) {
|
|
525
493
|
const s = i / Math.max(e.width, e.height), r = document.createElement("canvas");
|
|
526
494
|
r.width = e.width * Math.min(1, s), r.height = e.height * Math.min(1, s);
|
|
@@ -530,7 +498,7 @@ function De(e, t, i) {
|
|
|
530
498
|
throw new Error("THREE.USDZExporter: No valid image data found. Unable to process texture.");
|
|
531
499
|
}
|
|
532
500
|
const b = 7;
|
|
533
|
-
function
|
|
501
|
+
function Gt() {
|
|
534
502
|
return `#usda 1.0
|
|
535
503
|
(
|
|
536
504
|
customLayerData = {
|
|
@@ -543,7 +511,7 @@ function Jt() {
|
|
|
543
511
|
|
|
544
512
|
`;
|
|
545
513
|
}
|
|
546
|
-
function
|
|
514
|
+
function xe(e) {
|
|
547
515
|
return `def Xform "Root"
|
|
548
516
|
{
|
|
549
517
|
def Scope "Scenes" (
|
|
@@ -563,7 +531,7 @@ function Oe(e) {
|
|
|
563
531
|
|
|
564
532
|
`;
|
|
565
533
|
}
|
|
566
|
-
function
|
|
534
|
+
function Me() {
|
|
567
535
|
return `
|
|
568
536
|
}
|
|
569
537
|
}
|
|
@@ -571,12 +539,12 @@ function Xe() {
|
|
|
571
539
|
|
|
572
540
|
`;
|
|
573
541
|
}
|
|
574
|
-
function
|
|
575
|
-
let t =
|
|
576
|
-
return t += e,
|
|
542
|
+
function be(e) {
|
|
543
|
+
let t = Gt();
|
|
544
|
+
return t += e, ot(t);
|
|
577
545
|
}
|
|
578
|
-
function
|
|
579
|
-
const s = "Object_" + e.id, r =
|
|
546
|
+
function Te(e, t, i) {
|
|
547
|
+
const s = "Object_" + e.id, r = Qt(e.matrixWorld);
|
|
580
548
|
return e.matrixWorld.determinant() < 0 && console.warn("THREE.USDZExporter: USDZ does not support negative scales", e), `def Xform "${s}" (
|
|
581
549
|
prepend references = @./geometries/Geometry_${t.id}.usda@</Geometry>
|
|
582
550
|
prepend apiSchemas = ["MaterialBindingAPI"]
|
|
@@ -590,42 +558,42 @@ function Le(e, t, i) {
|
|
|
590
558
|
|
|
591
559
|
`;
|
|
592
560
|
}
|
|
593
|
-
function
|
|
561
|
+
function Qt(e) {
|
|
594
562
|
const t = e.elements;
|
|
595
|
-
return `( ${
|
|
563
|
+
return `( ${rt(t, 0)}, ${rt(t, 4)}, ${rt(t, 8)}, ${rt(t, 12)} )`;
|
|
596
564
|
}
|
|
597
|
-
function
|
|
565
|
+
function rt(e, t) {
|
|
598
566
|
return `(${e[t + 0]}, ${e[t + 1]}, ${e[t + 2]}, ${e[t + 3]})`;
|
|
599
567
|
}
|
|
600
|
-
function
|
|
568
|
+
function Ee(e) {
|
|
601
569
|
return `
|
|
602
570
|
def "Geometry"
|
|
603
571
|
{
|
|
604
|
-
${
|
|
572
|
+
${$e(e)}
|
|
605
573
|
}
|
|
606
574
|
`;
|
|
607
575
|
}
|
|
608
|
-
function
|
|
576
|
+
function $e(e) {
|
|
609
577
|
const t = "Geometry", i = e.attributes, s = i.position.count;
|
|
610
578
|
return `
|
|
611
579
|
def Mesh "${t}"
|
|
612
580
|
{
|
|
613
|
-
int[] faceVertexCounts = [${
|
|
614
|
-
int[] faceVertexIndices = [${
|
|
615
|
-
normal3f[] normals = [${
|
|
581
|
+
int[] faceVertexCounts = [${Ce(e)}]
|
|
582
|
+
int[] faceVertexIndices = [${Pe(e)}]
|
|
583
|
+
normal3f[] normals = [${mt(i.normal, s)}] (
|
|
616
584
|
interpolation = "vertex"
|
|
617
585
|
)
|
|
618
|
-
point3f[] points = [${
|
|
619
|
-
${
|
|
586
|
+
point3f[] points = [${mt(i.position, s)}]
|
|
587
|
+
${Ae(i)}
|
|
620
588
|
uniform token subdivisionScheme = "none"
|
|
621
589
|
}
|
|
622
590
|
`;
|
|
623
591
|
}
|
|
624
|
-
function
|
|
592
|
+
function Ce(e) {
|
|
625
593
|
const t = e.index !== null ? e.index.count : e.attributes.position.count;
|
|
626
594
|
return Array(t / 3).fill(3).join(", ");
|
|
627
595
|
}
|
|
628
|
-
function
|
|
596
|
+
function Pe(e) {
|
|
629
597
|
const t = e.index, i = [];
|
|
630
598
|
if (t !== null)
|
|
631
599
|
for (let s = 0; s < t.count; s++)
|
|
@@ -637,7 +605,7 @@ function Ve(e) {
|
|
|
637
605
|
}
|
|
638
606
|
return i.join(", ");
|
|
639
607
|
}
|
|
640
|
-
function
|
|
608
|
+
function mt(e, t) {
|
|
641
609
|
if (e === void 0)
|
|
642
610
|
return console.warn("USDZExporter: Normals missing."), Array(t).fill("(0, 0, 0)").join(", ");
|
|
643
611
|
const i = [];
|
|
@@ -647,7 +615,7 @@ function yt(e, t) {
|
|
|
647
615
|
}
|
|
648
616
|
return i.join(", ");
|
|
649
617
|
}
|
|
650
|
-
function
|
|
618
|
+
function He(e) {
|
|
651
619
|
const t = [];
|
|
652
620
|
for (let i = 0; i < e.count; i++) {
|
|
653
621
|
const s = e.getX(i), r = e.getY(i);
|
|
@@ -655,12 +623,12 @@ function Fe(e) {
|
|
|
655
623
|
}
|
|
656
624
|
return t.join(", ");
|
|
657
625
|
}
|
|
658
|
-
function
|
|
626
|
+
function Ae(e) {
|
|
659
627
|
let t = "";
|
|
660
628
|
for (let s = 0; s < 4; s++) {
|
|
661
629
|
const r = s > 0 ? s : "", n = e["uv" + r];
|
|
662
630
|
n !== void 0 && (t += `
|
|
663
|
-
texCoord2f[] primvars:st${r} = [${
|
|
631
|
+
texCoord2f[] primvars:st${r} = [${He(n)}] (
|
|
664
632
|
interpolation = "vertex"
|
|
665
633
|
)`);
|
|
666
634
|
}
|
|
@@ -668,17 +636,17 @@ function Ne(e) {
|
|
|
668
636
|
if (i !== void 0) {
|
|
669
637
|
const s = i.count;
|
|
670
638
|
t += `
|
|
671
|
-
color3f[] primvars:displayColor = [${
|
|
639
|
+
color3f[] primvars:displayColor = [${mt(i, s)}] (
|
|
672
640
|
interpolation = "vertex"
|
|
673
641
|
)`;
|
|
674
642
|
}
|
|
675
643
|
return t;
|
|
676
644
|
}
|
|
677
|
-
function
|
|
645
|
+
function Ie(e, t, i = !1) {
|
|
678
646
|
const s = [];
|
|
679
647
|
for (const r in e) {
|
|
680
648
|
const n = e[r];
|
|
681
|
-
s.push(
|
|
649
|
+
s.push(Oe(n, t, i));
|
|
682
650
|
}
|
|
683
651
|
return `def "Materials"
|
|
684
652
|
{
|
|
@@ -687,47 +655,47 @@ ${s.join("")}
|
|
|
687
655
|
|
|
688
656
|
`;
|
|
689
657
|
}
|
|
690
|
-
function
|
|
658
|
+
function Oe(e, t, i = !1) {
|
|
691
659
|
const s = " ", r = [], n = [];
|
|
692
|
-
function o(
|
|
693
|
-
const a =
|
|
694
|
-
t[a] =
|
|
695
|
-
const
|
|
660
|
+
function o(h, c, u) {
|
|
661
|
+
const a = h.source.id + "_" + h.flipY;
|
|
662
|
+
t[a] = h;
|
|
663
|
+
const l = h.channel > 0 ? "st" + h.channel : "st", d = {
|
|
696
664
|
1e3: "repeat",
|
|
697
665
|
// RepeatWrapping
|
|
698
666
|
1001: "clamp",
|
|
699
667
|
// ClampToEdgeWrapping
|
|
700
668
|
1002: "mirror"
|
|
701
669
|
// MirroredRepeatWrapping
|
|
702
|
-
}, f =
|
|
703
|
-
return p.y = 1 - p.y - f.y, i ? (p.x = p.x / f.x, p.y = p.y / f.y, p.x += S / f.x, p.y +=
|
|
704
|
-
def Shader "PrimvarReader_${
|
|
670
|
+
}, f = h.repeat.clone(), p = h.offset.clone(), g = h.rotation, S = Math.sin(g), C = Math.cos(g);
|
|
671
|
+
return p.y = 1 - p.y - f.y, i ? (p.x = p.x / f.x, p.y = p.y / f.y, p.x += S / f.x, p.y += C - 1) : (p.x += S * f.x, p.y += (1 - C) * f.y), `
|
|
672
|
+
def Shader "PrimvarReader_${c}"
|
|
705
673
|
{
|
|
706
674
|
uniform token info:id = "UsdPrimvarReader_float2"
|
|
707
675
|
float2 inputs:fallback = (0.0, 0.0)
|
|
708
|
-
token inputs:varname = "${
|
|
676
|
+
token inputs:varname = "${l}"
|
|
709
677
|
float2 outputs:result
|
|
710
678
|
}
|
|
711
679
|
|
|
712
|
-
def Shader "Transform2d_${
|
|
680
|
+
def Shader "Transform2d_${c}"
|
|
713
681
|
{
|
|
714
682
|
uniform token info:id = "UsdTransform2d"
|
|
715
|
-
token inputs:in.connect = </Materials/Material_${e.id}/PrimvarReader_${
|
|
683
|
+
token inputs:in.connect = </Materials/Material_${e.id}/PrimvarReader_${c}.outputs:result>
|
|
716
684
|
float inputs:rotation = ${(g * (180 / Math.PI)).toFixed(b)}
|
|
717
|
-
float2 inputs:scale = ${
|
|
718
|
-
float2 inputs:translation = ${
|
|
685
|
+
float2 inputs:scale = ${Ut(f)}
|
|
686
|
+
float2 inputs:translation = ${Ut(p)}
|
|
719
687
|
float2 outputs:result
|
|
720
688
|
}
|
|
721
689
|
|
|
722
|
-
def Shader "Texture_${
|
|
690
|
+
def Shader "Texture_${h.id}_${c}"
|
|
723
691
|
{
|
|
724
692
|
uniform token info:id = "UsdUVTexture"
|
|
725
693
|
asset inputs:file = @textures/Texture_${a}.png@
|
|
726
|
-
float2 inputs:st.connect = </Materials/Material_${e.id}/Transform2d_${
|
|
727
|
-
${
|
|
728
|
-
token inputs:sourceColorSpace = "${
|
|
729
|
-
token inputs:wrapS = "${d[
|
|
730
|
-
token inputs:wrapT = "${d[
|
|
694
|
+
float2 inputs:st.connect = </Materials/Material_${e.id}/Transform2d_${c}.outputs:result>
|
|
695
|
+
${u !== void 0 ? "float4 inputs:scale = " + De(u) : ""}
|
|
696
|
+
token inputs:sourceColorSpace = "${h.colorSpace === Kt ? "raw" : "sRGB"}"
|
|
697
|
+
token inputs:wrapS = "${d[h.wrapS]}"
|
|
698
|
+
token inputs:wrapT = "${d[h.wrapT]}"
|
|
731
699
|
float outputs:r
|
|
732
700
|
float outputs:g
|
|
733
701
|
float outputs:b
|
|
@@ -735,7 +703,7 @@ function We(e, t, i = !1) {
|
|
|
735
703
|
${e.transparent || e.alphaTest > 0 ? "float outputs:a" : ""}
|
|
736
704
|
}`;
|
|
737
705
|
}
|
|
738
|
-
return e.side ===
|
|
706
|
+
return e.side === Jt && console.warn("THREE.USDZExporter: USDZ does not support double sided materials", e), e.map !== null ? (r.push(`${s}color3f inputs:diffuseColor.connect = </Materials/Material_${e.id}/Texture_${e.map.id}_diffuse.outputs:rgb>`), e.transparent ? r.push(`${s}float inputs:opacity.connect = </Materials/Material_${e.id}/Texture_${e.map.id}_diffuse.outputs:a>`) : e.alphaTest > 0 && (r.push(`${s}float inputs:opacity.connect = </Materials/Material_${e.id}/Texture_${e.map.id}_diffuse.outputs:a>`), r.push(`${s}float inputs:opacityThreshold = ${e.alphaTest}`)), n.push(o(e.map, "diffuse", e.color))) : r.push(`${s}color3f inputs:diffuseColor = ${Xt(e.color)}`), e.emissiveMap !== null ? (r.push(`${s}color3f inputs:emissiveColor.connect = </Materials/Material_${e.id}/Texture_${e.emissiveMap.id}_emissive.outputs:rgb>`), n.push(o(e.emissiveMap, "emissive"))) : e.emissive.getHex() > 0 && r.push(`${s}color3f inputs:emissiveColor = ${Xt(e.emissive)}`), e.normalMap !== null && (r.push(`${s}normal3f inputs:normal.connect = </Materials/Material_${e.id}/Texture_${e.normalMap.id}_normal.outputs:rgb>`), n.push(o(e.normalMap, "normal"))), e.aoMap !== null && (r.push(`${s}float inputs:occlusion.connect = </Materials/Material_${e.id}/Texture_${e.aoMap.id}_occlusion.outputs:r>`), n.push(o(e.aoMap, "occlusion"))), e.roughnessMap !== null && e.roughness === 1 ? (r.push(`${s}float inputs:roughness.connect = </Materials/Material_${e.id}/Texture_${e.roughnessMap.id}_roughness.outputs:g>`), n.push(o(e.roughnessMap, "roughness"))) : r.push(`${s}float inputs:roughness = ${e.roughness}`), e.metalnessMap !== null && e.metalness === 1 ? (r.push(`${s}float inputs:metallic.connect = </Materials/Material_${e.id}/Texture_${e.metalnessMap.id}_metallic.outputs:b>`), n.push(o(e.metalnessMap, "metallic"))) : r.push(`${s}float inputs:metallic = ${e.metalness}`), e.alphaMap !== null ? (r.push(`${s}float inputs:opacity.connect = </Materials/Material_${e.id}/Texture_${e.alphaMap.id}_opacity.outputs:r>`), r.push(`${s}float inputs:opacityThreshold = 0.0001`), n.push(o(e.alphaMap, "opacity"))) : r.push(`${s}float inputs:opacity = ${e.opacity}`), e.isMeshPhysicalMaterial && (r.push(`${s}float inputs:clearcoat = ${e.clearcoat}`), r.push(`${s}float inputs:clearcoatRoughness = ${e.clearcoatRoughness}`), r.push(`${s}float inputs:ior = ${e.ior}`)), `
|
|
739
707
|
def Material "Material_${e.id}"
|
|
740
708
|
{
|
|
741
709
|
def Shader "PreviewSurface"
|
|
@@ -755,17 +723,17 @@ ${n.join(`
|
|
|
755
723
|
}
|
|
756
724
|
`;
|
|
757
725
|
}
|
|
758
|
-
function
|
|
726
|
+
function Xt(e) {
|
|
759
727
|
return `(${e.r}, ${e.g}, ${e.b})`;
|
|
760
728
|
}
|
|
761
|
-
function
|
|
729
|
+
function De(e) {
|
|
762
730
|
return `(${e.r}, ${e.g}, ${e.b}, 1.0)`;
|
|
763
731
|
}
|
|
764
|
-
function
|
|
732
|
+
function Ut(e) {
|
|
765
733
|
return `(${e.x}, ${e.y})`;
|
|
766
734
|
}
|
|
767
|
-
function
|
|
768
|
-
const t = e.name ? e.name : "Camera_" + e.id, i =
|
|
735
|
+
function Xe(e) {
|
|
736
|
+
const t = e.name ? e.name : "Camera_" + e.id, i = Qt(e.matrixWorld);
|
|
769
737
|
return e.matrixWorld.determinant() < 0 && console.warn("THREE.USDZExporter: USDZ does not support negative scales", e), e.isOrthographicCamera ? `def Camera "${t}"
|
|
770
738
|
{
|
|
771
739
|
matrix4d xformOp:transform = ${i}
|
|
@@ -792,15 +760,15 @@ function Ge(e) {
|
|
|
792
760
|
|
|
793
761
|
`;
|
|
794
762
|
}
|
|
795
|
-
class
|
|
763
|
+
class Ue extends we {
|
|
796
764
|
parse(t, i) {
|
|
797
765
|
return super.parse(t, i);
|
|
798
766
|
}
|
|
799
767
|
}
|
|
800
|
-
const
|
|
768
|
+
const bt = class bt {
|
|
801
769
|
static Launch(t, i) {
|
|
802
|
-
const s = new
|
|
803
|
-
return s.add(...
|
|
770
|
+
const s = new wt(), r = t.Root.clone(!0);
|
|
771
|
+
return s.add(...r.children), this.launchARFromNode(s, i);
|
|
804
772
|
}
|
|
805
773
|
static extractModels(t) {
|
|
806
774
|
return t.Root.children;
|
|
@@ -823,9 +791,9 @@ const Pt = class Pt {
|
|
|
823
791
|
});
|
|
824
792
|
}
|
|
825
793
|
};
|
|
826
|
-
|
|
827
|
-
let
|
|
828
|
-
class
|
|
794
|
+
bt._usdzExporter = new Ue();
|
|
795
|
+
let Rt = bt;
|
|
796
|
+
class ke {
|
|
829
797
|
get Element() {
|
|
830
798
|
return this._element;
|
|
831
799
|
}
|
|
@@ -848,7 +816,7 @@ class Ye {
|
|
|
848
816
|
return i.setAttribute("width", "38"), i.setAttribute("height", "38"), i.style.position = "absolute", i.style.right = "20px", i.style.top = "20px", i.appendChild(t), i;
|
|
849
817
|
}
|
|
850
818
|
}
|
|
851
|
-
class
|
|
819
|
+
class Le extends wt {
|
|
852
820
|
set mesh(t) {
|
|
853
821
|
this.clear(), t && this.add(t);
|
|
854
822
|
}
|
|
@@ -856,16 +824,16 @@ class Ze extends Tt {
|
|
|
856
824
|
return super(), t ? this.mesh = t : this.UseDefaultMesh(), this.matrixAutoUpdate = !1, this;
|
|
857
825
|
}
|
|
858
826
|
UseDefaultMesh() {
|
|
859
|
-
const t = new
|
|
860
|
-
this.mesh = new
|
|
827
|
+
const t = new te(0.08, 0.1, 32).rotateX(-Math.PI / 2), i = new ee();
|
|
828
|
+
this.mesh = new kt(t, i);
|
|
861
829
|
}
|
|
862
830
|
UpdateFromPose(t) {
|
|
863
831
|
this.matrix.fromArray(t.transform.matrix);
|
|
864
832
|
}
|
|
865
833
|
}
|
|
866
|
-
class
|
|
834
|
+
class ze {
|
|
867
835
|
constructor(t, i) {
|
|
868
|
-
this._referenceSpaceBuffer = null, this._requesting = !1, this._initialized = !1, this._session = t, this._renderer = i, this._hitMatrixBuffer = new
|
|
836
|
+
this._referenceSpaceBuffer = null, this._requesting = !1, this._initialized = !1, this._session = t, this._renderer = i, this._hitMatrixBuffer = new dt();
|
|
869
837
|
}
|
|
870
838
|
Dispose() {
|
|
871
839
|
var t;
|
|
@@ -891,7 +859,7 @@ class Je {
|
|
|
891
859
|
if (!this._referenceSpaceBuffer || !r.results[0] || !r.results[0].getPose) return;
|
|
892
860
|
const n = r.results[0].getPose(this._referenceSpaceBuffer);
|
|
893
861
|
return n ? (this._hitMatrixBuffer.fromArray(n.transform.matrix), {
|
|
894
|
-
point: new
|
|
862
|
+
point: new k().setFromMatrixPosition(
|
|
895
863
|
this._hitMatrixBuffer
|
|
896
864
|
),
|
|
897
865
|
matrix: this._hitMatrixBuffer,
|
|
@@ -900,9 +868,9 @@ class Je {
|
|
|
900
868
|
}).filter((r) => r !== void 0);
|
|
901
869
|
}
|
|
902
870
|
}
|
|
903
|
-
class
|
|
871
|
+
class Be {
|
|
904
872
|
constructor(t, i) {
|
|
905
|
-
this._raycaster = new
|
|
873
|
+
this._raycaster = new ie(), this._renderer = t, this._scene = i, this._controller = this._renderer.xr.getController(0);
|
|
906
874
|
}
|
|
907
875
|
async Init() {
|
|
908
876
|
return console.log("DIVEWebXRRaycasterTHREE: Initialized"), Promise.resolve(this);
|
|
@@ -919,7 +887,7 @@ class Ke {
|
|
|
919
887
|
}));
|
|
920
888
|
}
|
|
921
889
|
}
|
|
922
|
-
class
|
|
890
|
+
class Yt {
|
|
923
891
|
constructor() {
|
|
924
892
|
this._listeners = /* @__PURE__ */ new Map();
|
|
925
893
|
}
|
|
@@ -938,9 +906,9 @@ class te {
|
|
|
938
906
|
s && s.forEach((r) => r(i));
|
|
939
907
|
}
|
|
940
908
|
}
|
|
941
|
-
class
|
|
909
|
+
class Ve extends Yt {
|
|
942
910
|
constructor(t, i, s) {
|
|
943
|
-
super(), this._initialized = !1, this._arHitResultBuffer = [], this._sceneHitResultBuffer = [], this._hasHit = !1, this._session = t, this._threeRaycaster = new
|
|
911
|
+
super(), this._initialized = !1, this._arHitResultBuffer = [], this._sceneHitResultBuffer = [], this._hasHit = !1, this._session = t, this._threeRaycaster = new Be(i, s), this._arRaycaster = new ze(t, i);
|
|
944
912
|
}
|
|
945
913
|
Dispose() {
|
|
946
914
|
this._initialized = !1;
|
|
@@ -971,12 +939,12 @@ class ti extends te {
|
|
|
971
939
|
this._hasHit && (this._hasHit = !1, this.dispatch("SCENE_HIT_LOST"));
|
|
972
940
|
}
|
|
973
941
|
}
|
|
974
|
-
class
|
|
942
|
+
class Ne {
|
|
975
943
|
constructor(t, i, s) {
|
|
976
944
|
this._raycastHitCounter = 0, this._originSetResolve = () => {
|
|
977
945
|
}, this._renderer = i, this._session = t, this._originSet = new Promise((r) => {
|
|
978
946
|
this._originSetResolve = r;
|
|
979
|
-
}), this._requesting = !1, this._initialized = !1, this._referenceSpaceBuffer = null, this._hitTestSource = null, this._entityTypes = s || ["plane"], this._hitTestResultBuffer = [], this._matrix = new
|
|
947
|
+
}), this._requesting = !1, this._initialized = !1, this._referenceSpaceBuffer = null, this._hitTestSource = null, this._entityTypes = s || ["plane"], this._hitTestResultBuffer = [], this._matrix = new dt(), this._position = new k(), this._quaternion = new et(), this._scale = new k(), this._originSet.then(() => {
|
|
980
948
|
this._matrix.decompose(
|
|
981
949
|
this._position,
|
|
982
950
|
this._quaternion,
|
|
@@ -1022,7 +990,7 @@ class ei {
|
|
|
1022
990
|
}
|
|
1023
991
|
Dispose() {
|
|
1024
992
|
var t;
|
|
1025
|
-
this._initialized = !1, this._requesting = !1, (t = this._hitTestSource) == null || t.cancel(), this._hitTestSource = null, this._hitTestResultBuffer = [], this._matrix = new
|
|
993
|
+
this._initialized = !1, this._requesting = !1, (t = this._hitTestSource) == null || t.cancel(), this._hitTestSource = null, this._hitTestResultBuffer = [], this._matrix = new dt(), this._position = new k(), this._quaternion = new et(), this._scale = new k();
|
|
1026
994
|
}
|
|
1027
995
|
Update(t) {
|
|
1028
996
|
if (this._initialized) {
|
|
@@ -1056,7 +1024,7 @@ class ei {
|
|
|
1056
1024
|
this._raycastHitCounter = 0;
|
|
1057
1025
|
}
|
|
1058
1026
|
}
|
|
1059
|
-
class
|
|
1027
|
+
class je extends Yt {
|
|
1060
1028
|
constructor(t) {
|
|
1061
1029
|
super(), this._touchCount = 0, this._touches = [], this._handleRotateStarted = !1, this._handleRotateMoved = !1, this._handleRotateEnded = !1, this._startAngle = 0, this._lastAngle = 0, this._angleDelta = 0, this._handlePinchStarted = !1, this._handlePinchMoved = !1, this._handlePinchEnded = !1, this._scaleDistanceStart = 0, this._currentDistance = 1, this._deltaDistance = 0, this._session = t, this._touches = [
|
|
1062
1030
|
{
|
|
@@ -1222,11 +1190,11 @@ class ii extends te {
|
|
|
1222
1190
|
this._handlePinchEnded = !0;
|
|
1223
1191
|
}
|
|
1224
1192
|
}
|
|
1225
|
-
class
|
|
1193
|
+
class We extends wt {
|
|
1226
1194
|
constructor(t, i, s) {
|
|
1227
|
-
super(), this._frameBuffer = null, this._handNodeInitialPosition = new
|
|
1195
|
+
super(), this._frameBuffer = null, this._handNodeInitialPosition = new k(), this._placed = !1, this._grabbedObject = null, this._arHitPosition = new k(), this._arHitQuaternion = new et(), this._arHitScale = new k(1, 1, 1), this._initialObjectPosition = null, this._initialRaycastHit = null, this._deltaRaycastHit = new k(), this._touchQuaterion = new et(), this._touchScale = 1, this._scaleThreshold = 0.1, this._startTouchQuaternion = new et(), this._startTouchScale = 1, this._renderer = i, this._scene = s, this._session = t, this._xrRaycaster = new Ve(t, i, s), this._origin = new Ne(this._session, this._renderer, [
|
|
1228
1196
|
"plane"
|
|
1229
|
-
]), this._crosshair = new
|
|
1197
|
+
]), this._crosshair = new Le(), this._crosshair.visible = !1, this._xrCamera = this._renderer.xr.getCamera(), this._scene.XRRoot.XRHandNode.position.set(0, -0.05, -0.25), this._handNodeInitialPosition = this._scene.XRRoot.XRHandNode.position.clone(), this._touchscreenControls = new je(
|
|
1230
1198
|
this._session
|
|
1231
1199
|
), this._touchscreenControls.Subscribe(
|
|
1232
1200
|
"TOUCH_START",
|
|
@@ -1283,7 +1251,7 @@ class si extends Tt {
|
|
|
1283
1251
|
this._grabbedObject && (this._grabbedObject.position.copy(this._arHitPosition), this._grabbedObject.quaternion.copy(
|
|
1284
1252
|
this._arHitQuaternion.clone().multiply(this._touchQuaterion)
|
|
1285
1253
|
), this._grabbedObject.scale.copy(
|
|
1286
|
-
new
|
|
1254
|
+
new k(
|
|
1287
1255
|
this._touchScale,
|
|
1288
1256
|
this._touchScale,
|
|
1289
1257
|
this._touchScale
|
|
@@ -1293,7 +1261,7 @@ class si extends Tt {
|
|
|
1293
1261
|
onTouchStart() {
|
|
1294
1262
|
const t = this._xrRaycaster.GetSceneIntersections();
|
|
1295
1263
|
if (console.log("sceneHits", t), t.length === 0 || !t[0].object) return;
|
|
1296
|
-
const i =
|
|
1264
|
+
const i = Lt(
|
|
1297
1265
|
t[0].object,
|
|
1298
1266
|
"isMovable"
|
|
1299
1267
|
);
|
|
@@ -1327,7 +1295,7 @@ class si extends Tt {
|
|
|
1327
1295
|
}
|
|
1328
1296
|
onRotateMove(t) {
|
|
1329
1297
|
this._touchQuaterion.setFromAxisAngle(
|
|
1330
|
-
new
|
|
1298
|
+
new k(0, -1, 0),
|
|
1331
1299
|
t.delta * 3
|
|
1332
1300
|
), this._touchQuaterion.multiply(this._startTouchQuaternion), this.updateObject();
|
|
1333
1301
|
}
|
|
@@ -1344,7 +1312,7 @@ class si extends Tt {
|
|
|
1344
1312
|
this._scene.Root.children.forEach((i) => {
|
|
1345
1313
|
const s = i.clone();
|
|
1346
1314
|
s.layers.enableAll(), s.traverse((r) => {
|
|
1347
|
-
r.layers.enableAll(), r instanceof
|
|
1315
|
+
r.layers.enableAll(), r instanceof kt && r.scale.set(0.1, 0.1, 0.1);
|
|
1348
1316
|
}), s.position.set(0, 0, 0), t.push(s);
|
|
1349
1317
|
}), this._scene.XRRoot.XRHandNode.add(...t);
|
|
1350
1318
|
}
|
|
@@ -1364,7 +1332,7 @@ const E = class E {
|
|
|
1364
1332
|
if (this._renderer = t, this._scene = i, this._controller = s, this._cameraPosition = this._controller.object.position.clone(), this._cameraTarget = this._controller.target.clone(), !navigator.xr)
|
|
1365
1333
|
return console.error("WebXR not supported"), Promise.reject();
|
|
1366
1334
|
if (this._renderer.xr.enabled = !0, this._scene.InitXR(t), !E._overlay) {
|
|
1367
|
-
const n = new
|
|
1335
|
+
const n = new ke();
|
|
1368
1336
|
E._overlay = n;
|
|
1369
1337
|
}
|
|
1370
1338
|
E._options.domOverlay = { root: E._overlay.Element };
|
|
@@ -1391,7 +1359,7 @@ const E = class E {
|
|
|
1391
1359
|
(t, i) => {
|
|
1392
1360
|
this.Update(t, i);
|
|
1393
1361
|
}
|
|
1394
|
-
), this._xrController = new
|
|
1362
|
+
), this._xrController = new We(
|
|
1395
1363
|
this._session,
|
|
1396
1364
|
this._renderer,
|
|
1397
1365
|
this._scene
|
|
@@ -1427,19 +1395,19 @@ E._renderCallbackId = null, E._session = null, E._referenceSpaceType = "local",
|
|
|
1427
1395
|
},
|
|
1428
1396
|
domOverlay: { root: {} }
|
|
1429
1397
|
}, E._xrController = null;
|
|
1430
|
-
let
|
|
1431
|
-
class
|
|
1398
|
+
let St = E;
|
|
1399
|
+
class Fe {
|
|
1432
1400
|
static Launch(t, i) {
|
|
1433
1401
|
const s = this.findSceneViewerSrc(t);
|
|
1434
1402
|
this.launchSceneViewer(s, i);
|
|
1435
1403
|
}
|
|
1436
1404
|
static launchSceneViewer(t, i) {
|
|
1437
|
-
const s = document.createElement("a"), r = "#model-viewer-no-ar-fallback", n = self.location.toString(), o = new URL(n),
|
|
1438
|
-
o.hash = r,
|
|
1439
|
-
const
|
|
1405
|
+
const s = document.createElement("a"), r = "#model-viewer-no-ar-fallback", n = self.location.toString(), o = new URL(n), h = new URL(t, n), c = new URLSearchParams(h.search);
|
|
1406
|
+
o.hash = r, c.set("mode", "ar_only"), (i == null ? void 0 : i.arScale) === "fixed" && c.set("resizable", "false"), (i == null ? void 0 : i.arPlacement) === "vertical" && c.set("enable_vertical_placement", "true");
|
|
1407
|
+
const u = `intent://arvr.google.com/scene-viewer/1.2?${c.toString() + "&file=" + h.toString()}#Intent;scheme=https;package=com.google.android.googlequicksearchbox;action=android.intent.action.VIEW;S.browser_fallback_url=${encodeURIComponent(
|
|
1440
1408
|
o.toString()
|
|
1441
1409
|
)};end;`;
|
|
1442
|
-
s.setAttribute("href",
|
|
1410
|
+
s.setAttribute("href", u), s.click();
|
|
1443
1411
|
}
|
|
1444
1412
|
static findSceneViewerSrc(t) {
|
|
1445
1413
|
let i = null;
|
|
@@ -1450,12 +1418,12 @@ class ri {
|
|
|
1450
1418
|
return i;
|
|
1451
1419
|
}
|
|
1452
1420
|
}
|
|
1453
|
-
class
|
|
1421
|
+
class Qe {
|
|
1454
1422
|
constructor(t, i, s) {
|
|
1455
1423
|
this._renderer = t, this._scene = i, this._controller = s;
|
|
1456
1424
|
}
|
|
1457
1425
|
async Launch(t) {
|
|
1458
|
-
const i =
|
|
1426
|
+
const i = st.GetSystem();
|
|
1459
1427
|
if (i === "iOS")
|
|
1460
1428
|
return this.tryARQuickLook();
|
|
1461
1429
|
if (i === "Android")
|
|
@@ -1465,18 +1433,18 @@ class oi {
|
|
|
1465
1433
|
);
|
|
1466
1434
|
}
|
|
1467
1435
|
async tryARQuickLook(t) {
|
|
1468
|
-
return
|
|
1436
|
+
return st.GetSupportsARQuickLook() ? (console.log("DIVE: Launching AR with ARQuickLook ..."), await Rt.Launch(this._scene, t), Promise.resolve()) : (console.log("ARQuickLook not supported"), Promise.reject());
|
|
1469
1437
|
}
|
|
1470
1438
|
async tryWebXR() {
|
|
1471
|
-
return await
|
|
1472
|
-
"WebXR not supported. Reason: " +
|
|
1439
|
+
return await st.GetSupportsWebXR() ? (console.log("DIVE: Launching AR with WebXR ..."), await St.Launch(this._renderer, this._scene, this._controller), Promise.resolve()) : (console.log(
|
|
1440
|
+
"WebXR not supported. Reason: " + se[st.GetWebXRUnsupportedReason()]
|
|
1473
1441
|
), Promise.reject());
|
|
1474
1442
|
}
|
|
1475
1443
|
async trySceneViewer(t) {
|
|
1476
|
-
return console.log("DIVE: Launching AR with SceneViewer ..."),
|
|
1444
|
+
return console.log("DIVE: Launching AR with SceneViewer ..."), Fe.Launch(this._scene, t), Promise.resolve();
|
|
1477
1445
|
}
|
|
1478
1446
|
}
|
|
1479
1447
|
export {
|
|
1480
|
-
|
|
1448
|
+
Qe as DIVEAR
|
|
1481
1449
|
};
|
|
1482
|
-
//# sourceMappingURL=AR-
|
|
1450
|
+
//# sourceMappingURL=AR-B-g0updz.js.map
|