diff --git "a/src/backend/gradio_model4dgs/templates/component/index.js" "b/src/backend/gradio_model4dgs/templates/component/index.js" --- "a/src/backend/gradio_model4dgs/templates/component/index.js" +++ "b/src/backend/gradio_model4dgs/templates/component/index.js" @@ -288,7 +288,7 @@ function Bu(s) { }; } function Ou(s, e, t) { - let { $$slots: n = {}, $$scope: i } = e, { height: r = void 0 } = e, { width: o = void 0 } = e, { elem_id: a = "" } = e, { elem_classes: l = [] } = e, { variant: c = "solid" } = e, { border_mode: u = "base" } = e, { padding: d = !0 } = e, { type: f = "normal" } = e, { test_id: h = void 0 } = e, { explicit_call: g = !1 } = e, { container: _ = !0 } = e, { visible: m = !0 } = e, { allow_overflow: p = !0 } = e, { scale: v = null } = e, { min_width: S = 0 } = e, y = f === "fieldset" ? "fieldset" : "div"; + let { $$slots: n = {}, $$scope: i } = e, { height: r = void 0 } = e, { width: o = void 0 } = e, { elem_id: a = "" } = e, { elem_classes: l = [] } = e, { variant: c = "solid" } = e, { border_mode: u = "base" } = e, { padding: d = !0 } = e, { type: f = "normal" } = e, { test_id: h = void 0 } = e, { explicit_call: g = !1 } = e, { container: _ = !0 } = e, { visible: p = !0 } = e, { allow_overflow: m = !0 } = e, { scale: v = null } = e, { min_width: S = 0 } = e, y = f === "fieldset" ? "fieldset" : "div"; const b = (E) => { if (E !== void 0) { if (typeof E == "number") @@ -298,7 +298,7 @@ function Ou(s, e, t) { } }; return s.$$set = (E) => { - "height" in E && t(0, r = E.height), "width" in E && t(1, o = E.width), "elem_id" in E && t(2, a = E.elem_id), "elem_classes" in E && t(3, l = E.elem_classes), "variant" in E && t(4, c = E.variant), "border_mode" in E && t(5, u = E.border_mode), "padding" in E && t(6, d = E.padding), "type" in E && t(16, f = E.type), "test_id" in E && t(7, h = E.test_id), "explicit_call" in E && t(8, g = E.explicit_call), "container" in E && t(9, _ = E.container), "visible" in E && t(10, m = E.visible), "allow_overflow" in E && t(11, p = E.allow_overflow), "scale" in E && t(12, v = E.scale), "min_width" in E && t(13, S = E.min_width), "$$scope" in E && t(17, i = E.$$scope); + "height" in E && t(0, r = E.height), "width" in E && t(1, o = E.width), "elem_id" in E && t(2, a = E.elem_id), "elem_classes" in E && t(3, l = E.elem_classes), "variant" in E && t(4, c = E.variant), "border_mode" in E && t(5, u = E.border_mode), "padding" in E && t(6, d = E.padding), "type" in E && t(16, f = E.type), "test_id" in E && t(7, h = E.test_id), "explicit_call" in E && t(8, g = E.explicit_call), "container" in E && t(9, _ = E.container), "visible" in E && t(10, p = E.visible), "allow_overflow" in E && t(11, m = E.allow_overflow), "scale" in E && t(12, v = E.scale), "min_width" in E && t(13, S = E.min_width), "$$scope" in E && t(17, i = E.$$scope); }, [ r, o, @@ -310,8 +310,8 @@ function Ou(s, e, t) { h, g, _, - m, p, + m, v, S, y, @@ -1372,8 +1372,8 @@ class Ue { return this.multiplyMatrices(e, this); } multiplyMatrices(e, t) { - const n = e.elements, i = t.elements, r = this.elements, o = n[0], a = n[3], l = n[6], c = n[1], u = n[4], d = n[7], f = n[2], h = n[5], g = n[8], _ = i[0], m = i[3], p = i[6], v = i[1], S = i[4], y = i[7], b = i[2], E = i[5], T = i[8]; - return r[0] = o * _ + a * v + l * b, r[3] = o * m + a * S + l * E, r[6] = o * p + a * y + l * T, r[1] = c * _ + u * v + d * b, r[4] = c * m + u * S + d * E, r[7] = c * p + u * y + d * T, r[2] = f * _ + h * v + g * b, r[5] = f * m + h * S + g * E, r[8] = f * p + h * y + g * T, this; + const n = e.elements, i = t.elements, r = this.elements, o = n[0], a = n[3], l = n[6], c = n[1], u = n[4], d = n[7], f = n[2], h = n[5], g = n[8], _ = i[0], p = i[3], m = i[6], v = i[1], S = i[4], y = i[7], b = i[2], E = i[5], T = i[8]; + return r[0] = o * _ + a * v + l * b, r[3] = o * p + a * S + l * E, r[6] = o * m + a * y + l * T, r[1] = c * _ + u * v + d * b, r[4] = c * p + u * S + d * E, r[7] = c * m + u * y + d * T, r[2] = f * _ + h * v + g * b, r[5] = f * p + h * S + g * E, r[8] = f * m + h * y + g * T, this; } multiplyScalar(e) { const t = this.elements; @@ -1879,16 +1879,16 @@ class _t { } setAxisAngleFromRotationMatrix(e) { let t, n, i, r; - const l = e.elements, c = l[0], u = l[4], d = l[8], f = l[1], h = l[5], g = l[9], _ = l[2], m = l[6], p = l[10]; - if (Math.abs(u - f) < 0.01 && Math.abs(d - _) < 0.01 && Math.abs(g - m) < 0.01) { - if (Math.abs(u + f) < 0.1 && Math.abs(d + _) < 0.1 && Math.abs(g + m) < 0.1 && Math.abs(c + h + p - 3) < 0.1) + const l = e.elements, c = l[0], u = l[4], d = l[8], f = l[1], h = l[5], g = l[9], _ = l[2], p = l[6], m = l[10]; + if (Math.abs(u - f) < 0.01 && Math.abs(d - _) < 0.01 && Math.abs(g - p) < 0.01) { + if (Math.abs(u + f) < 0.1 && Math.abs(d + _) < 0.1 && Math.abs(g + p) < 0.1 && Math.abs(c + h + m - 3) < 0.1) return this.set(1, 0, 0, 0), this; t = Math.PI; - const S = (c + 1) / 2, y = (h + 1) / 2, b = (p + 1) / 2, E = (u + f) / 4, T = (d + _) / 4, L = (g + m) / 4; + const S = (c + 1) / 2, y = (h + 1) / 2, b = (m + 1) / 2, E = (u + f) / 4, T = (d + _) / 4, L = (g + p) / 4; return S > y && S > b ? S < 0.01 ? (n = 0, i = 0.707106781, r = 0.707106781) : (n = Math.sqrt(S), i = E / n, r = T / n) : y > b ? y < 0.01 ? (n = 0.707106781, i = 0, r = 0.707106781) : (i = Math.sqrt(y), n = E / i, r = L / i) : b < 0.01 ? (n = 0.707106781, i = 0.707106781, r = 0) : (r = Math.sqrt(b), n = T / r, i = L / r), this.set(n, i, r, t), this; } - let v = Math.sqrt((m - g) * (m - g) + (d - _) * (d - _) + (f - u) * (f - u)); - return Math.abs(v) < 1e-3 && (v = 1), this.x = (m - g) / v, this.y = (d - _) / v, this.z = (f - u) / v, this.w = Math.acos((c + h + p - 1) / 2), this; + let v = Math.sqrt((p - g) * (p - g) + (d - _) * (d - _) + (f - u) * (f - u)); + return Math.abs(v) < 1e-3 && (v = 1), this.x = (p - g) / v, this.y = (d - _) / v, this.z = (f - u) / v, this.w = Math.acos((c + h + m - 1) / 2), this; } min(e) { return this.x = Math.min(this.x, e.x), this.y = Math.min(this.y, e.y), this.z = Math.min(this.z, e.z), this.w = Math.min(this.w, e.w), this; @@ -2045,14 +2045,14 @@ class St { return; } if (d !== _ || l !== f || c !== h || u !== g) { - let m = 1 - a; - const p = l * f + c * h + u * g + d * _, v = p >= 0 ? 1 : -1, S = 1 - p * p; + let p = 1 - a; + const m = l * f + c * h + u * g + d * _, v = m >= 0 ? 1 : -1, S = 1 - m * m; if (S > Number.EPSILON) { - const b = Math.sqrt(S), E = Math.atan2(b, p * v); - m = Math.sin(m * E) / b, a = Math.sin(a * E) / b; + const b = Math.sqrt(S), E = Math.atan2(b, m * v); + p = Math.sin(p * E) / b, a = Math.sin(a * E) / b; } const y = a * v; - if (l = l * m + f * y, c = c * m + h * y, u = u * m + g * y, d = d * m + _ * y, m === 1 - a) { + if (l = l * p + f * y, c = c * p + h * y, u = u * p + g * y, d = d * p + _ * y, p === 1 - a) { const b = 1 / Math.sqrt(l * l + c * c + u * u + d * d); l *= b, c *= b, u *= b, d *= b; } @@ -2882,7 +2882,7 @@ let Wc = class { } }; class Ge { - constructor(e, t, n, i, r, o, a, l, c, u, d, f, h, g, _, m) { + constructor(e, t, n, i, r, o, a, l, c, u, d, f, h, g, _, p) { Ge.prototype.isMatrix4 = !0, this.elements = [ 1, 0, @@ -2900,11 +2900,11 @@ class Ge { 0, 0, 1 - ], e !== void 0 && this.set(e, t, n, i, r, o, a, l, c, u, d, f, h, g, _, m); + ], e !== void 0 && this.set(e, t, n, i, r, o, a, l, c, u, d, f, h, g, _, p); } - set(e, t, n, i, r, o, a, l, c, u, d, f, h, g, _, m) { - const p = this.elements; - return p[0] = e, p[4] = t, p[8] = n, p[12] = i, p[1] = r, p[5] = o, p[9] = a, p[13] = l, p[2] = c, p[6] = u, p[10] = d, p[14] = f, p[3] = h, p[7] = g, p[11] = _, p[15] = m, this; + set(e, t, n, i, r, o, a, l, c, u, d, f, h, g, _, p) { + const m = this.elements; + return m[0] = e, m[4] = t, m[8] = n, m[12] = i, m[1] = r, m[5] = o, m[9] = a, m[13] = l, m[2] = c, m[6] = u, m[10] = d, m[14] = f, m[3] = h, m[7] = g, m[11] = _, m[15] = p, this; } identity() { return this.set( @@ -3022,16 +3022,16 @@ class Ge { return this.multiplyMatrices(e, this); } multiplyMatrices(e, t) { - const n = e.elements, i = t.elements, r = this.elements, o = n[0], a = n[4], l = n[8], c = n[12], u = n[1], d = n[5], f = n[9], h = n[13], g = n[2], _ = n[6], m = n[10], p = n[14], v = n[3], S = n[7], y = n[11], b = n[15], E = i[0], T = i[4], L = i[8], B = i[12], x = i[1], A = i[5], U = i[9], N = i[13], P = i[2], I = i[6], z = i[10], K = i[14], G = i[3], q = i[7], Q = i[11], te = i[15]; - return r[0] = o * E + a * x + l * P + c * G, r[4] = o * T + a * A + l * I + c * q, r[8] = o * L + a * U + l * z + c * Q, r[12] = o * B + a * N + l * K + c * te, r[1] = u * E + d * x + f * P + h * G, r[5] = u * T + d * A + f * I + h * q, r[9] = u * L + d * U + f * z + h * Q, r[13] = u * B + d * N + f * K + h * te, r[2] = g * E + _ * x + m * P + p * G, r[6] = g * T + _ * A + m * I + p * q, r[10] = g * L + _ * U + m * z + p * Q, r[14] = g * B + _ * N + m * K + p * te, r[3] = v * E + S * x + y * P + b * G, r[7] = v * T + S * A + y * I + b * q, r[11] = v * L + S * U + y * z + b * Q, r[15] = v * B + S * N + y * K + b * te, this; + const n = e.elements, i = t.elements, r = this.elements, o = n[0], a = n[4], l = n[8], c = n[12], u = n[1], d = n[5], f = n[9], h = n[13], g = n[2], _ = n[6], p = n[10], m = n[14], v = n[3], S = n[7], y = n[11], b = n[15], E = i[0], T = i[4], L = i[8], B = i[12], x = i[1], A = i[5], U = i[9], N = i[13], P = i[2], I = i[6], z = i[10], K = i[14], G = i[3], q = i[7], Q = i[11], te = i[15]; + return r[0] = o * E + a * x + l * P + c * G, r[4] = o * T + a * A + l * I + c * q, r[8] = o * L + a * U + l * z + c * Q, r[12] = o * B + a * N + l * K + c * te, r[1] = u * E + d * x + f * P + h * G, r[5] = u * T + d * A + f * I + h * q, r[9] = u * L + d * U + f * z + h * Q, r[13] = u * B + d * N + f * K + h * te, r[2] = g * E + _ * x + p * P + m * G, r[6] = g * T + _ * A + p * I + m * q, r[10] = g * L + _ * U + p * z + m * Q, r[14] = g * B + _ * N + p * K + m * te, r[3] = v * E + S * x + y * P + b * G, r[7] = v * T + S * A + y * I + b * q, r[11] = v * L + S * U + y * z + b * Q, r[15] = v * B + S * N + y * K + b * te, this; } multiplyScalar(e) { const t = this.elements; return t[0] *= e, t[4] *= e, t[8] *= e, t[12] *= e, t[1] *= e, t[5] *= e, t[9] *= e, t[13] *= e, t[2] *= e, t[6] *= e, t[10] *= e, t[14] *= e, t[3] *= e, t[7] *= e, t[11] *= e, t[15] *= e, this; } determinant() { - const e = this.elements, t = e[0], n = e[4], i = e[8], r = e[12], o = e[1], a = e[5], l = e[9], c = e[13], u = e[2], d = e[6], f = e[10], h = e[14], g = e[3], _ = e[7], m = e[11], p = e[15]; - return g * (+r * l * d - i * c * d - r * a * f + n * c * f + i * a * h - n * l * h) + _ * (+t * l * h - t * c * f + r * o * f - i * o * h + i * c * u - r * l * u) + m * (+t * c * d - t * a * h - r * o * d + n * o * h + r * a * u - n * c * u) + p * (-i * a * u - t * l * d + t * a * f + i * o * d - n * o * f + n * l * u); + const e = this.elements, t = e[0], n = e[4], i = e[8], r = e[12], o = e[1], a = e[5], l = e[9], c = e[13], u = e[2], d = e[6], f = e[10], h = e[14], g = e[3], _ = e[7], p = e[11], m = e[15]; + return g * (+r * l * d - i * c * d - r * a * f + n * c * f + i * a * h - n * l * h) + _ * (+t * l * h - t * c * f + r * o * f - i * o * h + i * c * u - r * l * u) + p * (+t * c * d - t * a * h - r * o * d + n * o * h + r * a * u - n * c * u) + m * (-i * a * u - t * l * d + t * a * f + i * o * d - n * o * f + n * l * u); } transpose() { const e = this.elements; @@ -3043,11 +3043,11 @@ class Ge { return e.isVector3 ? (i[12] = e.x, i[13] = e.y, i[14] = e.z) : (i[12] = e, i[13] = t, i[14] = n), this; } invert() { - const e = this.elements, t = e[0], n = e[1], i = e[2], r = e[3], o = e[4], a = e[5], l = e[6], c = e[7], u = e[8], d = e[9], f = e[10], h = e[11], g = e[12], _ = e[13], m = e[14], p = e[15], v = d * m * c - _ * f * c + _ * l * h - a * m * h - d * l * p + a * f * p, S = g * f * c - u * m * c - g * l * h + o * m * h + u * l * p - o * f * p, y = u * _ * c - g * d * c + g * a * h - o * _ * h - u * a * p + o * d * p, b = g * d * l - u * _ * l - g * a * f + o * _ * f + u * a * m - o * d * m, E = t * v + n * S + i * y + r * b; + const e = this.elements, t = e[0], n = e[1], i = e[2], r = e[3], o = e[4], a = e[5], l = e[6], c = e[7], u = e[8], d = e[9], f = e[10], h = e[11], g = e[12], _ = e[13], p = e[14], m = e[15], v = d * p * c - _ * f * c + _ * l * h - a * p * h - d * l * m + a * f * m, S = g * f * c - u * p * c - g * l * h + o * p * h + u * l * m - o * f * m, y = u * _ * c - g * d * c + g * a * h - o * _ * h - u * a * m + o * d * m, b = g * d * l - u * _ * l - g * a * f + o * _ * f + u * a * p - o * d * p, E = t * v + n * S + i * y + r * b; if (E === 0) return this.set(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); const T = 1 / E; - return e[0] = v * T, e[1] = (_ * f * r - d * m * r - _ * i * h + n * m * h + d * i * p - n * f * p) * T, e[2] = (a * m * r - _ * l * r + _ * i * c - n * m * c - a * i * p + n * l * p) * T, e[3] = (d * l * r - a * f * r - d * i * c + n * f * c + a * i * h - n * l * h) * T, e[4] = S * T, e[5] = (u * m * r - g * f * r + g * i * h - t * m * h - u * i * p + t * f * p) * T, e[6] = (g * l * r - o * m * r - g * i * c + t * m * c + o * i * p - t * l * p) * T, e[7] = (o * f * r - u * l * r + u * i * c - t * f * c - o * i * h + t * l * h) * T, e[8] = y * T, e[9] = (g * d * r - u * _ * r - g * n * h + t * _ * h + u * n * p - t * d * p) * T, e[10] = (o * _ * r - g * a * r + g * n * c - t * _ * c - o * n * p + t * a * p) * T, e[11] = (u * a * r - o * d * r - u * n * c + t * d * c + o * n * h - t * a * h) * T, e[12] = b * T, e[13] = (u * _ * i - g * d * i + g * n * f - t * _ * f - u * n * m + t * d * m) * T, e[14] = (g * a * i - o * _ * i - g * n * l + t * _ * l + o * n * m - t * a * m) * T, e[15] = (o * d * i - u * a * i + u * n * l - t * d * l - o * n * f + t * a * f) * T, this; + return e[0] = v * T, e[1] = (_ * f * r - d * p * r - _ * i * h + n * p * h + d * i * m - n * f * m) * T, e[2] = (a * p * r - _ * l * r + _ * i * c - n * p * c - a * i * m + n * l * m) * T, e[3] = (d * l * r - a * f * r - d * i * c + n * f * c + a * i * h - n * l * h) * T, e[4] = S * T, e[5] = (u * p * r - g * f * r + g * i * h - t * p * h - u * i * m + t * f * m) * T, e[6] = (g * l * r - o * p * r - g * i * c + t * p * c + o * i * m - t * l * m) * T, e[7] = (o * f * r - u * l * r + u * i * c - t * f * c - o * i * h + t * l * h) * T, e[8] = y * T, e[9] = (g * d * r - u * _ * r - g * n * h + t * _ * h + u * n * m - t * d * m) * T, e[10] = (o * _ * r - g * a * r + g * n * c - t * _ * c - o * n * m + t * a * m) * T, e[11] = (u * a * r - o * d * r - u * n * c + t * d * c + o * n * h - t * a * h) * T, e[12] = b * T, e[13] = (u * _ * i - g * d * i + g * n * f - t * _ * f - u * n * p + t * d * p) * T, e[14] = (g * a * i - o * _ * i - g * n * l + t * _ * l + o * n * p - t * a * p) * T, e[15] = (o * d * i - u * a * i + u * n * l - t * d * l - o * n * f + t * a * f) * T, this; } scale(e) { const t = this.elements, n = e.x, i = e.y, r = e.z; @@ -3219,8 +3219,8 @@ class Ge { ), this; } compose(e, t, n) { - const i = this.elements, r = t._x, o = t._y, a = t._z, l = t._w, c = r + r, u = o + o, d = a + a, f = r * c, h = r * u, g = r * d, _ = o * u, m = o * d, p = a * d, v = l * c, S = l * u, y = l * d, b = n.x, E = n.y, T = n.z; - return i[0] = (1 - (_ + p)) * b, i[1] = (h + y) * b, i[2] = (g - S) * b, i[3] = 0, i[4] = (h - y) * E, i[5] = (1 - (f + p)) * E, i[6] = (m + v) * E, i[7] = 0, i[8] = (g + S) * T, i[9] = (m - v) * T, i[10] = (1 - (f + _)) * T, i[11] = 0, i[12] = e.x, i[13] = e.y, i[14] = e.z, i[15] = 1, this; + const i = this.elements, r = t._x, o = t._y, a = t._z, l = t._w, c = r + r, u = o + o, d = a + a, f = r * c, h = r * u, g = r * d, _ = o * u, p = o * d, m = a * d, v = l * c, S = l * u, y = l * d, b = n.x, E = n.y, T = n.z; + return i[0] = (1 - (_ + m)) * b, i[1] = (h + y) * b, i[2] = (g - S) * b, i[3] = 0, i[4] = (h - y) * E, i[5] = (1 - (f + m)) * E, i[6] = (p + v) * E, i[7] = 0, i[8] = (g + S) * T, i[9] = (p - v) * T, i[10] = (1 - (f + _)) * T, i[11] = 0, i[12] = e.x, i[13] = e.y, i[14] = e.z, i[15] = 1, this; } decompose(e, t, n) { const i = this.elements; @@ -3790,11 +3790,11 @@ class _n { const _ = h * c - l * g; if (_ <= 0 && c >= 0 && g <= 0) return a = c / (c - g), t.copy(n).addScaledVector(Bi, a); - const m = u * g - h * d; - if (m <= 0 && d - u >= 0 && h - g >= 0) + const p = u * g - h * d; + if (p <= 0 && d - u >= 0 && h - g >= 0) return pl.subVectors(r, i), a = (d - u) / (d - u + (h - g)), t.copy(i).addScaledVector(pl, a); - const p = 1 / (m + _ + f); - return o = _ * p, a = f * p, t.copy(n).addScaledVector(Ui, o).addScaledVector(Bi, a); + const m = 1 / (p + _ + f); + return o = _ * m, a = f * m, t.copy(n).addScaledVector(Ui, o).addScaledVector(Bi, a); } equals(e) { return e.a.equals(this.a) && e.b.equals(this.b) && e.c.equals(this.c); @@ -4574,11 +4574,11 @@ class sn extends Ti { const o = this.getAttribute("tangent"), a = [], l = []; for (let L = 0; L < n.count; L++) a[L] = new D(), l[L] = new D(); - const c = new D(), u = new D(), d = new D(), f = new Ee(), h = new Ee(), g = new Ee(), _ = new D(), m = new D(); - function p(L, B, x) { + const c = new D(), u = new D(), d = new D(), f = new Ee(), h = new Ee(), g = new Ee(), _ = new D(), p = new D(); + function m(L, B, x) { c.fromBufferAttribute(n, L), u.fromBufferAttribute(n, B), d.fromBufferAttribute(n, x), f.fromBufferAttribute(r, L), h.fromBufferAttribute(r, B), g.fromBufferAttribute(r, x), u.sub(c), d.sub(c), h.sub(f), g.sub(f); const A = 1 / (h.x * g.y - g.x * h.y); - isFinite(A) && (_.copy(u).multiplyScalar(g.y).addScaledVector(d, -h.y).multiplyScalar(A), m.copy(d).multiplyScalar(h.x).addScaledVector(u, -g.x).multiplyScalar(A), a[L].add(_), a[B].add(_), a[x].add(_), l[L].add(m), l[B].add(m), l[x].add(m)); + isFinite(A) && (_.copy(u).multiplyScalar(g.y).addScaledVector(d, -h.y).multiplyScalar(A), p.copy(d).multiplyScalar(h.x).addScaledVector(u, -g.x).multiplyScalar(A), a[L].add(_), a[B].add(_), a[x].add(_), l[L].add(p), l[B].add(p), l[x].add(p)); } let v = this.groups; v.length === 0 && (v = [{ @@ -4588,7 +4588,7 @@ class sn extends Ti { for (let L = 0, B = v.length; L < B; ++L) { const x = v[L], A = x.start, U = x.count; for (let N = A, P = A + U; N < P; N += 3) - p( + m( e.getX(N + 0), e.getX(N + 1), e.getX(N + 2) @@ -4620,8 +4620,8 @@ class sn extends Ti { const i = new D(), r = new D(), o = new D(), a = new D(), l = new D(), c = new D(), u = new D(), d = new D(); if (e) for (let f = 0, h = e.count; f < h; f += 3) { - const g = e.getX(f + 0), _ = e.getX(f + 1), m = e.getX(f + 2); - i.fromBufferAttribute(t, g), r.fromBufferAttribute(t, _), o.fromBufferAttribute(t, m), u.subVectors(o, r), d.subVectors(i, r), u.cross(d), a.fromBufferAttribute(n, g), l.fromBufferAttribute(n, _), c.fromBufferAttribute(n, m), a.add(u), l.add(u), c.add(u), n.setXYZ(g, a.x, a.y, a.z), n.setXYZ(_, l.x, l.y, l.z), n.setXYZ(m, c.x, c.y, c.z); + const g = e.getX(f + 0), _ = e.getX(f + 1), p = e.getX(f + 2); + i.fromBufferAttribute(t, g), r.fromBufferAttribute(t, _), o.fromBufferAttribute(t, p), u.subVectors(o, r), d.subVectors(i, r), u.cross(d), a.fromBufferAttribute(n, g), l.fromBufferAttribute(n, _), c.fromBufferAttribute(n, p), a.add(u), l.add(u), c.add(u), n.setXYZ(g, a.x, a.y, a.z), n.setXYZ(_, l.x, l.y, l.z), n.setXYZ(p, c.x, c.y, c.z); } else for (let f = 0, h = t.count; f < h; f += 3) @@ -4638,9 +4638,9 @@ class sn extends Ti { function e(a, l) { const c = a.array, u = a.itemSize, d = a.normalized, f = new c.constructor(l.length * u); let h = 0, g = 0; - for (let _ = 0, m = l.length; _ < m; _++) { + for (let _ = 0, p = l.length; _ < p; _++) { a.isInterleavedBufferAttribute ? h = l[_] * a.data.stride + a.offset : h = l[_] * u; - for (let p = 0; p < u; p++) + for (let m = 0; m < u; m++) f[g++] = c[h++]; } return new en(f, u, d); @@ -4794,33 +4794,33 @@ class pt extends Et { if (a !== null) if (Array.isArray(o)) for (let g = 0, _ = f.length; g < _; g++) { - const m = f[g], p = o[m.materialIndex], v = Math.max(m.start, h.start), S = Math.min(a.count, Math.min(m.start + m.count, h.start + h.count)); + const p = f[g], m = o[p.materialIndex], v = Math.max(p.start, h.start), S = Math.min(a.count, Math.min(p.start + p.count, h.start + h.count)); for (let y = v, b = S; y < b; y += 3) { const E = a.getX(y), T = a.getX(y + 1), L = a.getX(y + 2); - i = nr(this, p, e, n, c, u, d, E, T, L), i && (i.faceIndex = Math.floor(y / 3), i.face.materialIndex = m.materialIndex, t.push(i)); + i = nr(this, m, e, n, c, u, d, E, T, L), i && (i.faceIndex = Math.floor(y / 3), i.face.materialIndex = p.materialIndex, t.push(i)); } } else { const g = Math.max(0, h.start), _ = Math.min(a.count, h.start + h.count); - for (let m = g, p = _; m < p; m += 3) { - const v = a.getX(m), S = a.getX(m + 1), y = a.getX(m + 2); - i = nr(this, o, e, n, c, u, d, v, S, y), i && (i.faceIndex = Math.floor(m / 3), t.push(i)); + for (let p = g, m = _; p < m; p += 3) { + const v = a.getX(p), S = a.getX(p + 1), y = a.getX(p + 2); + i = nr(this, o, e, n, c, u, d, v, S, y), i && (i.faceIndex = Math.floor(p / 3), t.push(i)); } } else if (l !== void 0) if (Array.isArray(o)) for (let g = 0, _ = f.length; g < _; g++) { - const m = f[g], p = o[m.materialIndex], v = Math.max(m.start, h.start), S = Math.min(l.count, Math.min(m.start + m.count, h.start + h.count)); + const p = f[g], m = o[p.materialIndex], v = Math.max(p.start, h.start), S = Math.min(l.count, Math.min(p.start + p.count, h.start + h.count)); for (let y = v, b = S; y < b; y += 3) { const E = y, T = y + 1, L = y + 2; - i = nr(this, p, e, n, c, u, d, E, T, L), i && (i.faceIndex = Math.floor(y / 3), i.face.materialIndex = m.materialIndex, t.push(i)); + i = nr(this, m, e, n, c, u, d, E, T, L), i && (i.faceIndex = Math.floor(y / 3), i.face.materialIndex = p.materialIndex, t.push(i)); } } else { const g = Math.max(0, h.start), _ = Math.min(l.count, h.start + h.count); - for (let m = g, p = _; m < p; m += 3) { - const v = m, S = m + 1, y = m + 2; - i = nr(this, o, e, n, c, u, d, v, S, y), i && (i.faceIndex = Math.floor(m / 3), t.push(i)); + for (let p = g, m = _; p < m; p += 3) { + const v = p, S = p + 1, y = p + 2; + i = nr(this, o, e, n, c, u, d, v, S, y), i && (i.faceIndex = Math.floor(p / 3), t.push(i)); } } } @@ -4868,7 +4868,7 @@ class gs extends sn { const l = [], c = [], u = [], d = []; let f = 0, h = 0; g("z", "y", "x", -1, -1, n, t, e, o, r, 0), g("z", "y", "x", 1, -1, n, t, -e, o, r, 1), g("x", "z", "y", 1, 1, e, n, t, i, o, 2), g("x", "z", "y", 1, -1, e, n, -t, i, o, 3), g("x", "y", "z", 1, -1, e, t, n, i, r, 4), g("x", "y", "z", -1, -1, e, t, -n, i, r, 5), this.setIndex(l), this.setAttribute("position", new Yt(c, 3)), this.setAttribute("normal", new Yt(u, 3)), this.setAttribute("uv", new Yt(d, 2)); - function g(_, m, p, v, S, y, b, E, T, L, B) { + function g(_, p, m, v, S, y, b, E, T, L, B) { const x = y / T, A = b / L, U = y / 2, N = b / 2, P = E / 2, I = T + 1, z = L + 1; let K = 0, G = 0; const q = new D(); @@ -4876,7 +4876,7 @@ class gs extends sn { const te = Q * A - N; for (let fe = 0; fe < I; fe++) { const ne = fe * x - U; - q[_] = ne * v, q[m] = te * S, q[p] = P, c.push(q.x, q.y, q.z), q[_] = 0, q[m] = 0, q[p] = E > 0 ? 1 : -1, u.push(q.x, q.y, q.z), d.push(fe / T), d.push(1 - Q / L), K += 1; + q[_] = ne * v, q[p] = te * S, q[m] = P, c.push(q.x, q.y, q.z), q[_] = 0, q[p] = 0, q[m] = E > 0 ? 1 : -1, u.push(q.x, q.y, q.z), d.push(fe / T), d.push(1 - Q / L), K += 1; } } for (let Q = 0; Q < L; Q++) @@ -5339,9 +5339,9 @@ class Jc { return this; } setFromProjectionMatrix(e, t = Dn) { - const n = this.planes, i = e.elements, r = i[0], o = i[1], a = i[2], l = i[3], c = i[4], u = i[5], d = i[6], f = i[7], h = i[8], g = i[9], _ = i[10], m = i[11], p = i[12], v = i[13], S = i[14], y = i[15]; - if (n[0].setComponents(l - r, f - c, m - h, y - p).normalize(), n[1].setComponents(l + r, f + c, m + h, y + p).normalize(), n[2].setComponents(l + o, f + u, m + g, y + v).normalize(), n[3].setComponents(l - o, f - u, m - g, y - v).normalize(), n[4].setComponents(l - a, f - d, m - _, y - S).normalize(), t === Dn) - n[5].setComponents(l + a, f + d, m + _, y + S).normalize(); + const n = this.planes, i = e.elements, r = i[0], o = i[1], a = i[2], l = i[3], c = i[4], u = i[5], d = i[6], f = i[7], h = i[8], g = i[9], _ = i[10], p = i[11], m = i[12], v = i[13], S = i[14], y = i[15]; + if (n[0].setComponents(l - r, f - c, p - h, y - m).normalize(), n[1].setComponents(l + r, f + c, p + h, y + m).normalize(), n[2].setComponents(l + o, f + u, p + g, y + v).normalize(), n[3].setComponents(l - o, f - u, p - g, y - v).normalize(), n[4].setComponents(l - a, f - d, p - _, y - S).normalize(), t === Dn) + n[5].setComponents(l + a, f + d, p + _, y + S).normalize(); else if (t === Er) n[5].setComponents(a, d, _, S).normalize(); else @@ -5448,18 +5448,18 @@ function hh(s, e) { function r(c, u, d) { const f = u.array, h = u._updateRange, g = u.updateRanges; if (s.bindBuffer(d, c), h.count === -1 && g.length === 0 && s.bufferSubData(d, 0, f), g.length !== 0) { - for (let _ = 0, m = g.length; _ < m; _++) { - const p = g[_]; + for (let _ = 0, p = g.length; _ < p; _++) { + const m = g[_]; t ? s.bufferSubData( d, - p.start * f.BYTES_PER_ELEMENT, + m.start * f.BYTES_PER_ELEMENT, f, - p.start, - p.count + m.start, + m.count ) : s.bufferSubData( d, - p.start * f.BYTES_PER_ELEMENT, - f.subarray(p.start, p.start + p.count) + m.start * f.BYTES_PER_ELEMENT, + f.subarray(m.start, m.start + m.count) ); } u.clearUpdateRanges(); @@ -5519,20 +5519,20 @@ class ds extends sn { widthSegments: n, heightSegments: i }; - const r = e / 2, o = t / 2, a = Math.floor(n), l = Math.floor(i), c = a + 1, u = l + 1, d = e / a, f = t / l, h = [], g = [], _ = [], m = []; - for (let p = 0; p < u; p++) { - const v = p * f - o; + const r = e / 2, o = t / 2, a = Math.floor(n), l = Math.floor(i), c = a + 1, u = l + 1, d = e / a, f = t / l, h = [], g = [], _ = [], p = []; + for (let m = 0; m < u; m++) { + const v = m * f - o; for (let S = 0; S < c; S++) { const y = S * d - r; - g.push(y, -v, 0), _.push(0, 0, 1), m.push(S / a), m.push(1 - p / l); + g.push(y, -v, 0), _.push(0, 0, 1), p.push(S / a), p.push(1 - m / l); } } - for (let p = 0; p < l; p++) + for (let m = 0; m < l; m++) for (let v = 0; v < a; v++) { - const S = v + c * p, y = v + c * (p + 1), b = v + 1 + c * (p + 1), E = v + 1 + c * p; + const S = v + c * m, y = v + c * (m + 1), b = v + 1 + c * (m + 1), E = v + 1 + c * m; h.push(S, y, E), h.push(y, b, E); } - this.setIndex(h), this.setAttribute("position", new Yt(g, 3)), this.setAttribute("normal", new Yt(_, 3)), this.setAttribute("uv", new Yt(m, 2)); + this.setIndex(h), this.setAttribute("position", new Yt(g, 3)), this.setAttribute("normal", new Yt(_, 3)), this.setAttribute("uv", new Yt(p, 2)); } copy(e) { return super.copy(e), this.parameters = Object.assign({}, e.parameters), this; @@ -9631,9 +9631,9 @@ const sr = { r: 0, b: 0, g: 0 }, ci = /* @__PURE__ */ new Nn(), jm = /* @__PURE_ function Km(s, e, t, n, i, r, o) { const a = new et(0); let l = r === !0 ? 0 : 1, c, u, d = null, f = 0, h = null; - function g(m, p) { - let v = !1, S = p.isScene === !0 ? p.background : null; - S && S.isTexture && (S = (p.backgroundBlurriness > 0 ? t : e).get(S)), S === null ? _(a, l) : S && S.isColor && (_(S, 1), v = !0); + function g(p, m) { + let v = !1, S = m.isScene === !0 ? m.background : null; + S && S.isTexture && (S = (m.backgroundBlurriness > 0 ? t : e).get(S)), S === null ? _(a, l) : S && S.isColor && (_(S, 1), v = !0); const y = s.xr.getEnvironmentBlendMode(); y === "additive" ? n.buffers.color.setClear(0, 0, 0, 1, o) : y === "alpha-blend" && n.buffers.color.setClear(0, 0, 0, 0, o), (s.autoClear || v) && s.clear(s.autoClearColor, s.autoClearDepth, s.autoClearStencil), S && (S.isCubeTexture || S.mapping === Fr) ? (u === void 0 && (u = new pt( new gs(1, 1, 1), @@ -9653,7 +9653,7 @@ function Km(s, e, t, n, i, r, o) { get: function() { return this.uniforms.envMap.value; } - }), i.update(u)), ci.copy(p.backgroundRotation), ci.x *= -1, ci.y *= -1, ci.z *= -1, S.isCubeTexture && S.isRenderTargetTexture === !1 && (ci.y *= -1, ci.z *= -1), u.material.uniforms.envMap.value = S, u.material.uniforms.flipEnvMap.value = S.isCubeTexture && S.isRenderTargetTexture === !1 ? -1 : 1, u.material.uniforms.backgroundBlurriness.value = p.backgroundBlurriness, u.material.uniforms.backgroundIntensity.value = p.backgroundIntensity, u.material.uniforms.backgroundRotation.value.setFromMatrix4(jm.makeRotationFromEuler(ci)), u.material.toneMapped = tt.getTransfer(S.colorSpace) !== at, (d !== S || f !== S.version || h !== s.toneMapping) && (u.material.needsUpdate = !0, d = S, f = S.version, h = s.toneMapping), u.layers.enableAll(), m.unshift(u, u.geometry, u.material, 0, 0, null)) : S && S.isTexture && (c === void 0 && (c = new pt( + }), i.update(u)), ci.copy(m.backgroundRotation), ci.x *= -1, ci.y *= -1, ci.z *= -1, S.isCubeTexture && S.isRenderTargetTexture === !1 && (ci.y *= -1, ci.z *= -1), u.material.uniforms.envMap.value = S, u.material.uniforms.flipEnvMap.value = S.isCubeTexture && S.isRenderTargetTexture === !1 ? -1 : 1, u.material.uniforms.backgroundBlurriness.value = m.backgroundBlurriness, u.material.uniforms.backgroundIntensity.value = m.backgroundIntensity, u.material.uniforms.backgroundRotation.value.setFromMatrix4(jm.makeRotationFromEuler(ci)), u.material.toneMapped = tt.getTransfer(S.colorSpace) !== at, (d !== S || f !== S.version || h !== s.toneMapping) && (u.material.needsUpdate = !0, d = S, f = S.version, h = s.toneMapping), u.layers.enableAll(), p.unshift(u, u.geometry, u.material, 0, 0, null)) : S && S.isTexture && (c === void 0 && (c = new pt( new ds(2, 2), new tn({ name: "BackgroundMaterial", @@ -9669,35 +9669,35 @@ function Km(s, e, t, n, i, r, o) { get: function() { return this.uniforms.t2D.value; } - }), i.update(c)), c.material.uniforms.t2D.value = S, c.material.uniforms.backgroundIntensity.value = p.backgroundIntensity, c.material.toneMapped = tt.getTransfer(S.colorSpace) !== at, S.matrixAutoUpdate === !0 && S.updateMatrix(), c.material.uniforms.uvTransform.value.copy(S.matrix), (d !== S || f !== S.version || h !== s.toneMapping) && (c.material.needsUpdate = !0, d = S, f = S.version, h = s.toneMapping), c.layers.enableAll(), m.unshift(c, c.geometry, c.material, 0, 0, null)); + }), i.update(c)), c.material.uniforms.t2D.value = S, c.material.uniforms.backgroundIntensity.value = m.backgroundIntensity, c.material.toneMapped = tt.getTransfer(S.colorSpace) !== at, S.matrixAutoUpdate === !0 && S.updateMatrix(), c.material.uniforms.uvTransform.value.copy(S.matrix), (d !== S || f !== S.version || h !== s.toneMapping) && (c.material.needsUpdate = !0, d = S, f = S.version, h = s.toneMapping), c.layers.enableAll(), p.unshift(c, c.geometry, c.material, 0, 0, null)); } - function _(m, p) { - m.getRGB(sr, Kc(s)), n.buffers.color.setClear(sr.r, sr.g, sr.b, p, o); + function _(p, m) { + p.getRGB(sr, Kc(s)), n.buffers.color.setClear(sr.r, sr.g, sr.b, m, o); } return { getClearColor: function() { return a; }, - setClearColor: function(m, p = 1) { - a.set(m), l = p, _(a, l); + setClearColor: function(p, m = 1) { + a.set(p), l = m, _(a, l); }, getClearAlpha: function() { return l; }, - setClearAlpha: function(m) { - l = m, _(a, l); + setClearAlpha: function(p) { + l = p, _(a, l); }, render: g }; } function Zm(s, e, t, n) { - const i = s.getParameter(s.MAX_VERTEX_ATTRIBS), r = n.isWebGL2 ? null : e.get("OES_vertex_array_object"), o = n.isWebGL2 || r !== null, a = {}, l = m(null); + const i = s.getParameter(s.MAX_VERTEX_ATTRIBS), r = n.isWebGL2 ? null : e.get("OES_vertex_array_object"), o = n.isWebGL2 || r !== null, a = {}, l = p(null); let c = l, u = !1; function d(P, I, z, K, G) { let q = !1; if (o) { const Q = _(K, z, I); - c !== Q && (c = Q, h(c.object)), q = p(P, K, z, G), q && v(P, K, z, G); + c !== Q && (c = Q, h(c.object)), q = m(P, K, z, G), q && v(P, K, z, G); } else { const Q = I.wireframe === !0; (c.geometry !== K.id || c.program !== z.id || c.wireframe !== Q) && (c.geometry = K.id, c.program = z.id, c.wireframe = Q, q = !0); @@ -9720,9 +9720,9 @@ function Zm(s, e, t, n) { let q = G[I.id]; q === void 0 && (q = {}, G[I.id] = q); let Q = q[K]; - return Q === void 0 && (Q = m(f()), q[K] = Q), Q; + return Q === void 0 && (Q = p(f()), q[K] = Q), Q; } - function m(P) { + function p(P) { const I = [], z = [], K = []; for (let G = 0; G < i; G++) I[G] = 0, z[G] = 0, K[G] = 0; @@ -9739,7 +9739,7 @@ function Zm(s, e, t, n) { index: null }; } - function p(P, I, z, K) { + function m(P, I, z, K) { const G = c.attributes, q = I.attributes; let Q = 0; const te = z.getAttributes(); @@ -9977,7 +9977,7 @@ function Jm(s, e, t) { let a = t.precision !== void 0 ? t.precision : "highp"; const l = r(a); l !== a && (console.warn("THREE.WebGLRenderer:", a, "not supported, using", l, "instead."), a = l); - const c = o || e.has("WEBGL_draw_buffers"), u = t.logarithmicDepthBuffer === !0, d = s.getParameter(s.MAX_TEXTURE_IMAGE_UNITS), f = s.getParameter(s.MAX_VERTEX_TEXTURE_IMAGE_UNITS), h = s.getParameter(s.MAX_TEXTURE_SIZE), g = s.getParameter(s.MAX_CUBE_MAP_TEXTURE_SIZE), _ = s.getParameter(s.MAX_VERTEX_ATTRIBS), m = s.getParameter(s.MAX_VERTEX_UNIFORM_VECTORS), p = s.getParameter(s.MAX_VARYING_VECTORS), v = s.getParameter(s.MAX_FRAGMENT_UNIFORM_VECTORS), S = f > 0, y = o || e.has("OES_texture_float"), b = S && y, E = o ? s.getParameter(s.MAX_SAMPLES) : 0; + const c = o || e.has("WEBGL_draw_buffers"), u = t.logarithmicDepthBuffer === !0, d = s.getParameter(s.MAX_TEXTURE_IMAGE_UNITS), f = s.getParameter(s.MAX_VERTEX_TEXTURE_IMAGE_UNITS), h = s.getParameter(s.MAX_TEXTURE_SIZE), g = s.getParameter(s.MAX_CUBE_MAP_TEXTURE_SIZE), _ = s.getParameter(s.MAX_VERTEX_ATTRIBS), p = s.getParameter(s.MAX_VERTEX_UNIFORM_VECTORS), m = s.getParameter(s.MAX_VARYING_VECTORS), v = s.getParameter(s.MAX_FRAGMENT_UNIFORM_VECTORS), S = f > 0, y = o || e.has("OES_texture_float"), b = S && y, E = o ? s.getParameter(s.MAX_SAMPLES) : 0; return { isWebGL2: o, drawBuffers: c, @@ -9990,8 +9990,8 @@ function Jm(s, e, t) { maxTextureSize: h, maxCubemapSize: g, maxAttributes: _, - maxVertexUniforms: m, - maxVaryings: p, + maxVertexUniforms: p, + maxVaryings: m, maxFragmentUniforms: v, vertexTextures: S, floatFragmentTextures: y, @@ -10015,16 +10015,16 @@ function $m(s) { }, this.setGlobalState = function(d, f) { t = u(d, f, 0); }, this.setState = function(d, f, h) { - const g = d.clippingPlanes, _ = d.clipIntersection, m = d.clipShadows, p = s.get(d); - if (!i || g === null || g.length === 0 || r && !m) + const g = d.clippingPlanes, _ = d.clipIntersection, p = d.clipShadows, m = s.get(d); + if (!i || g === null || g.length === 0 || r && !p) r ? u(null) : c(); else { const v = r ? 0 : n, S = v * 4; - let y = p.clippingState || null; + let y = m.clippingState || null; l.value = y, y = u(g, f, S, h); for (let b = 0; b !== S; ++b) y[b] = t[b]; - p.clippingState = y, this.numIntersection = _ ? this.numPlanes : 0, this.numPlanes += v; + m.clippingState = y, this.numIntersection = _ ? this.numPlanes : 0, this.numPlanes += v; } }; function c() { @@ -10032,17 +10032,17 @@ function $m(s) { } function u(d, f, h, g) { const _ = d !== null ? d.length : 0; - let m = null; + let p = null; if (_ !== 0) { - if (m = l.value, g !== !0 || m === null) { - const p = h + _ * 4, v = f.matrixWorldInverse; - a.getNormalMatrix(v), (m === null || m.length < p) && (m = new Float32Array(p)); + if (p = l.value, g !== !0 || p === null) { + const m = h + _ * 4, v = f.matrixWorldInverse; + a.getNormalMatrix(v), (p === null || p.length < m) && (p = new Float32Array(m)); for (let S = 0, y = h; S !== _; ++S, y += 4) - o.copy(d[S]).applyMatrix4(v, a), o.normal.toArray(m, y), m[y + 3] = o.constant; + o.copy(d[S]).applyMatrix4(v, a), o.normal.toArray(p, y), p[y + 3] = o.constant; } - l.value = m, l.needsUpdate = !0; + l.value = p, l.needsUpdate = !0; } - return e.numPlanes = _, e.numIntersection = 0, m; + return e.numPlanes = _, e.numIntersection = 0, p; } } function eg(s) { @@ -10235,15 +10235,15 @@ class Tl { depthTest: !1 }), g = new pt(new gs(), h); let _ = !1; - const m = e.background; - m ? m.isColor && (h.color.copy(m), e.background = null, _ = !0) : (h.color.copy(El), _ = !0); - for (let p = 0; p < 6; p++) { - const v = p % 3; - v === 0 ? (a.up.set(0, l[p], 0), a.lookAt(c[p], 0, 0)) : v === 1 ? (a.up.set(0, 0, l[p]), a.lookAt(0, c[p], 0)) : (a.up.set(0, l[p], 0), a.lookAt(0, 0, c[p])); + const p = e.background; + p ? p.isColor && (h.color.copy(p), e.background = null, _ = !0) : (h.color.copy(El), _ = !0); + for (let m = 0; m < 6; m++) { + const v = m % 3; + v === 0 ? (a.up.set(0, l[m], 0), a.lookAt(c[m], 0, 0)) : v === 1 ? (a.up.set(0, 0, l[m]), a.lookAt(0, c[m], 0)) : (a.up.set(0, l[m], 0), a.lookAt(0, 0, c[m])); const S = this._cubeSize; - rr(i, v * S, p > 2 ? S : 0, S, S), u.setRenderTarget(i), _ && u.render(g, a), u.render(e, a); + rr(i, v * S, m > 2 ? S : 0, S, S), u.setRenderTarget(i), _ && u.render(g, a), u.render(e, a); } - g.geometry.dispose(), g.material.dispose(), u.toneMapping = f, u.autoClear = d, e.background = m; + g.geometry.dispose(), g.material.dispose(), u.toneMapping = f, u.autoClear = d, e.background = p; } _textureToCubeUV(e, t) { const n = this._renderer, i = e.mapping === os || e.mapping === ls; @@ -10294,17 +10294,17 @@ class Tl { o !== "latitudinal" && o !== "longitudinal" && console.error( "blur direction must be either latitudinal or longitudinal!" ); - const u = 3, d = new pt(this._lodPlanes[i], c), f = c.uniforms, h = this._sizeLods[n] - 1, g = isFinite(r) ? Math.PI / (2 * h) : 2 * Math.PI / (2 * hi - 1), _ = r / g, m = isFinite(r) ? 1 + Math.floor(u * _) : hi; - m > hi && console.warn(`sigmaRadians, ${r}, is too large and will clip, as it requested ${m} samples when the maximum is set to ${hi}`); - const p = []; + const u = 3, d = new pt(this._lodPlanes[i], c), f = c.uniforms, h = this._sizeLods[n] - 1, g = isFinite(r) ? Math.PI / (2 * h) : 2 * Math.PI / (2 * hi - 1), _ = r / g, p = isFinite(r) ? 1 + Math.floor(u * _) : hi; + p > hi && console.warn(`sigmaRadians, ${r}, is too large and will clip, as it requested ${p} samples when the maximum is set to ${hi}`); + const m = []; let v = 0; for (let T = 0; T < hi; ++T) { const L = T / _, B = Math.exp(-L * L / 2); - p.push(B), T === 0 ? v += B : T < m && (v += 2 * B); + m.push(B), T === 0 ? v += B : T < p && (v += 2 * B); } - for (let T = 0; T < p.length; T++) - p[T] = p[T] / v; - f.envMap.value = e.texture, f.samples.value = m, f.weights.value = p, f.latitudinal.value = o === "latitudinal", a && (f.poleAxis.value = a); + for (let T = 0; T < m.length; T++) + m[T] = m[T] / v; + f.envMap.value = e.texture, f.samples.value = p, f.weights.value = m, f.latitudinal.value = o === "latitudinal", a && (f.poleAxis.value = a); const { _lodMax: S } = this; f.dTheta.value = g, f.mipInt.value = S - n; const y = this._sizeLods[i], b = 3 * y * (i > S - Qi ? i - S + Qi : 0), E = 4 * (this._cubeSize - y); @@ -10320,7 +10320,7 @@ function tg(s) { t.push(a); let l = 1 / a; o > s - Qi ? l = Ml[o - s + Qi - 1] : o === 0 && (l = 0), n.push(l); - const c = 1 / (a - 2), u = -c, d = 1 + c, f = [u, u, d, u, d, d, u, u, d, d, u, d], h = 6, g = 6, _ = 3, m = 2, p = 1, v = new Float32Array(_ * g * h), S = new Float32Array(m * g * h), y = new Float32Array(p * g * h); + const c = 1 / (a - 2), u = -c, d = 1 + c, f = [u, u, d, u, d, d, u, u, d, d, u, d], h = 6, g = 6, _ = 3, p = 2, m = 1, v = new Float32Array(_ * g * h), S = new Float32Array(p * g * h), y = new Float32Array(m * g * h); for (let E = 0; E < h; E++) { const T = E % 3 * 2 / 3 - 1, L = E > 2 ? 0 : -1, B = [ T, @@ -10342,12 +10342,12 @@ function tg(s) { L + 1, 0 ]; - v.set(B, _ * g * E), S.set(f, m * g * E); + v.set(B, _ * g * E), S.set(f, p * g * E); const x = [E, E, E, E, E, E]; - y.set(x, p * g * E); + y.set(x, m * g * E); } const b = new sn(); - b.setAttribute("position", new en(v, _)), b.setAttribute("uv", new en(S, m)), b.setAttribute("faceIndex", new en(y, p)), e.push(b), i > Qi && i--; + b.setAttribute("position", new en(v, _)), b.setAttribute("uv", new en(S, p)), b.setAttribute("faceIndex", new en(y, m)), e.push(b), i > Qi && i--; } return { lodPlanes: e, sizeLods: t, sigmas: n }; } @@ -10669,8 +10669,8 @@ function rg(s, e, t, n) { e.remove(f.attributes[g]); for (const g in f.morphAttributes) { const _ = f.morphAttributes[g]; - for (let m = 0, p = _.length; m < p; m++) - e.remove(_[m]); + for (let p = 0, m = _.length; p < m; p++) + e.remove(_[p]); } f.removeEventListener("dispose", o), delete i[f.id]; const h = r.get(f); @@ -10686,8 +10686,8 @@ function rg(s, e, t, n) { const h = d.morphAttributes; for (const g in h) { const _ = h[g]; - for (let m = 0, p = _.length; m < p; m++) - e.update(_[m], s.ARRAY_BUFFER); + for (let p = 0, m = _.length; p < m; p++) + e.update(_[p], s.ARRAY_BUFFER); } } function c(d) { @@ -10709,10 +10709,10 @@ function rg(s, e, t, n) { } } else return; - const m = new (zc(f) ? jc : Yc)(f, 1); - m.version = _; - const p = r.get(d); - p && e.remove(p), r.set(d, m); + const p = new (zc(f) ? jc : Yc)(f, 1); + p.version = _; + const m = r.get(d); + m && e.remove(m), r.set(d, p); } function u(d) { const f = r.get(d); @@ -10745,28 +10745,28 @@ function ag(s, e, t, n) { function d(h, g, _) { if (_ === 0) return; - let m, p; + let p, m; if (i) - m = s, p = "drawElementsInstanced"; - else if (m = e.get("ANGLE_instanced_arrays"), p = "drawElementsInstancedANGLE", m === null) { + p = s, m = "drawElementsInstanced"; + else if (p = e.get("ANGLE_instanced_arrays"), m = "drawElementsInstancedANGLE", p === null) { console.error("THREE.WebGLIndexedBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays."); return; } - m[p](r, g, a, h * l, _), t.update(g, r, _); + p[m](r, g, a, h * l, _), t.update(g, r, _); } function f(h, g, _) { if (_ === 0) return; - const m = e.get("WEBGL_multi_draw"); - if (m === null) - for (let p = 0; p < _; p++) - this.render(h[p] / l, g[p]); + const p = e.get("WEBGL_multi_draw"); + if (p === null) + for (let m = 0; m < _; m++) + this.render(h[m] / l, g[m]); else { - m.multiDrawElementsWEBGL(r, g, 0, a, h, 0, _); - let p = 0; + p.multiDrawElementsWEBGL(r, g, 0, a, h, 0, _); + let m = 0; for (let v = 0; v < _; v++) - p += g[v]; - t.update(p, r, 1); + m += g[v]; + t.update(m, r, 1); } } this.setMode = o, this.setIndex = c, this.render = u, this.renderInstances = d, this.renderMultiDraw = f; @@ -10836,9 +10836,9 @@ function ug(s, e, t) { x.dispose(), r.delete(u), u.removeEventListener("dispose", U); }; _ !== void 0 && _.texture.dispose(); - const m = u.morphAttributes.position !== void 0, p = u.morphAttributes.normal !== void 0, v = u.morphAttributes.color !== void 0, S = u.morphAttributes.position || [], y = u.morphAttributes.normal || [], b = u.morphAttributes.color || []; + const p = u.morphAttributes.position !== void 0, m = u.morphAttributes.normal !== void 0, v = u.morphAttributes.color !== void 0, S = u.morphAttributes.position || [], y = u.morphAttributes.normal || [], b = u.morphAttributes.color || []; let E = 0; - m === !0 && (E = 1), p === !0 && (E = 2), v === !0 && (E = 3); + p === !0 && (E = 1), m === !0 && (E = 2), v === !0 && (E = 3); let T = u.attributes.position.count * E, L = 1; T > e.maxTextureSize && (L = Math.ceil(T / e.maxTextureSize), T = e.maxTextureSize); const B = new Float32Array(T * L * 4 * g), x = new Vc(B, T, L, g); @@ -10848,7 +10848,7 @@ function ug(s, e, t) { const P = S[N], I = y[N], z = b[N], K = T * L * 4 * N; for (let G = 0; G < P.count; G++) { const q = G * A; - m === !0 && (o.fromBufferAttribute(P, G), B[K + q + 0] = o.x, B[K + q + 1] = o.y, B[K + q + 2] = o.z, B[K + q + 3] = 0), p === !0 && (o.fromBufferAttribute(I, G), B[K + q + 4] = o.x, B[K + q + 5] = o.y, B[K + q + 6] = o.z, B[K + q + 7] = 0), v === !0 && (o.fromBufferAttribute(z, G), B[K + q + 8] = o.x, B[K + q + 9] = o.y, B[K + q + 10] = o.z, B[K + q + 11] = z.itemSize === 4 ? o.w : 1); + p === !0 && (o.fromBufferAttribute(P, G), B[K + q + 0] = o.x, B[K + q + 1] = o.y, B[K + q + 2] = o.z, B[K + q + 3] = 0), m === !0 && (o.fromBufferAttribute(I, G), B[K + q + 4] = o.x, B[K + q + 5] = o.y, B[K + q + 6] = o.z, B[K + q + 7] = 0), v === !0 && (o.fromBufferAttribute(z, G), B[K + q + 8] = o.x, B[K + q + 9] = o.y, B[K + q + 10] = o.z, B[K + q + 11] = z.itemSize === 4 ? o.w : 1); } } _ = { @@ -10860,11 +10860,11 @@ function ug(s, e, t) { if (c.isInstancedMesh === !0 && c.morphTexture !== null) d.getUniforms().setValue(s, "morphTexture", c.morphTexture, t); else { - let m = 0; + let p = 0; for (let v = 0; v < f.length; v++) - m += f[v]; - const p = u.morphTargetsRelative ? 1 : 1 - m; - d.getUniforms().setValue(s, "morphTargetBaseInfluence", p), d.getUniforms().setValue(s, "morphTargetInfluences", f); + p += f[v]; + const m = u.morphTargetsRelative ? 1 : 1 - p; + d.getUniforms().setValue(s, "morphTargetBaseInfluence", m), d.getUniforms().setValue(s, "morphTargetInfluences", f); } d.getUniforms().setValue(s, "morphTargetsTexture", _.texture, t), d.getUniforms().setValue(s, "morphTargetsTextureSize", _.size); } else { @@ -10884,13 +10884,13 @@ function ug(s, e, t) { for (let S = 0; S < 8; S++) S < h && g[S][1] ? (a[S][0] = g[S][0], a[S][1] = g[S][1]) : (a[S][0] = Number.MAX_SAFE_INTEGER, a[S][1] = 0); a.sort(lg); - const _ = u.morphAttributes.position, m = u.morphAttributes.normal; - let p = 0; + const _ = u.morphAttributes.position, p = u.morphAttributes.normal; + let m = 0; for (let S = 0; S < 8; S++) { const y = a[S], b = y[0], E = y[1]; - b !== Number.MAX_SAFE_INTEGER && E ? (_ && u.getAttribute("morphTarget" + S) !== _[b] && u.setAttribute("morphTarget" + S, _[b]), m && u.getAttribute("morphNormal" + S) !== m[b] && u.setAttribute("morphNormal" + S, m[b]), i[S] = E, p += E) : (_ && u.hasAttribute("morphTarget" + S) === !0 && u.deleteAttribute("morphTarget" + S), m && u.hasAttribute("morphNormal" + S) === !0 && u.deleteAttribute("morphNormal" + S), i[S] = 0); + b !== Number.MAX_SAFE_INTEGER && E ? (_ && u.getAttribute("morphTarget" + S) !== _[b] && u.setAttribute("morphTarget" + S, _[b]), p && u.getAttribute("morphNormal" + S) !== p[b] && u.setAttribute("morphNormal" + S, p[b]), i[S] = E, m += E) : (_ && u.hasAttribute("morphTarget" + S) === !0 && u.deleteAttribute("morphTarget" + S), p && u.hasAttribute("morphNormal" + S) === !0 && u.deleteAttribute("morphNormal" + S), i[S] = 0); } - const v = u.morphTargetsRelative ? 1 : 1 - p; + const v = u.morphTargetsRelative ? 1 : 1 - m; d.getUniforms().setValue(s, "morphTargetBaseInfluence", v), d.getUniforms().setValue(s, "morphTargetInfluences", i); } } @@ -11628,15 +11628,15 @@ function y0(s) { function M0(s, e, t, n) { const i = s.getContext(), r = t.defines; let o = t.vertexShader, a = t.fragmentShader; - const l = _0(t), c = S0(t), u = v0(t), d = x0(t), f = y0(t), h = t.isWebGL2 ? "" : l0(t), g = c0(t), _ = u0(r), m = i.createProgram(); - let p, v, S = t.glslVersion ? "#version " + t.glslVersion + ` + const l = _0(t), c = S0(t), u = v0(t), d = x0(t), f = y0(t), h = t.isWebGL2 ? "" : l0(t), g = c0(t), _ = u0(r), p = i.createProgram(); + let m, v, S = t.glslVersion ? "#version " + t.glslVersion + ` ` : ""; - t.isRawShaderMaterial ? (p = [ + t.isRawShaderMaterial ? (m = [ "#define SHADER_TYPE " + t.shaderType, "#define SHADER_NAME " + t.shaderName, _ ].filter(Ji).join(` -`), p.length > 0 && (p += ` +`), m.length > 0 && (m += ` `), v = [ h, "#define SHADER_TYPE " + t.shaderType, @@ -11644,7 +11644,7 @@ function M0(s, e, t, n) { _ ].filter(Ji).join(` `), v.length > 0 && (v += ` -`)) : (p = [ +`)) : (m = [ zl(t), "#define SHADER_TYPE " + t.shaderType, "#define SHADER_NAME " + t.shaderName, @@ -11879,7 +11879,7 @@ function M0(s, e, t, n) { ` ].filter(Ji).join(` `)), o = ka(o), o = Ol(o, t), o = Nl(o, t), a = ka(a), a = Ol(a, t), a = Nl(a, t), o = kl(o), a = kl(a), t.isWebGL2 && t.isRawShaderMaterial !== !0 && (S = `#version 300 es -`, p = [ +`, m = [ g, "precision mediump sampler2DArray;", "#define attribute in", @@ -11887,7 +11887,7 @@ function M0(s, e, t, n) { "#define texture2D texture" ].join(` `) + ` -` + p, v = [ +` + m, v = [ "precision mediump sampler2DArray;", "#define varying in", t.glslVersion === nl ? "" : "layout(location = 0) out highp vec4 pc_fragColor;", @@ -11905,19 +11905,19 @@ function M0(s, e, t, n) { ].join(` `) + ` ` + v); - const y = S + p + o, b = S + v + a, E = Ul(i, i.VERTEX_SHADER, y), T = Ul(i, i.FRAGMENT_SHADER, b); - i.attachShader(m, E), i.attachShader(m, T), t.index0AttributeName !== void 0 ? i.bindAttribLocation(m, 0, t.index0AttributeName) : t.morphTargets === !0 && i.bindAttribLocation(m, 0, "position"), i.linkProgram(m); + const y = S + m + o, b = S + v + a, E = Ul(i, i.VERTEX_SHADER, y), T = Ul(i, i.FRAGMENT_SHADER, b); + i.attachShader(p, E), i.attachShader(p, T), t.index0AttributeName !== void 0 ? i.bindAttribLocation(p, 0, t.index0AttributeName) : t.morphTargets === !0 && i.bindAttribLocation(p, 0, "position"), i.linkProgram(p); function L(U) { if (s.debug.checkShaderErrors) { - const N = i.getProgramInfoLog(m).trim(), P = i.getShaderInfoLog(E).trim(), I = i.getShaderInfoLog(T).trim(); + const N = i.getProgramInfoLog(p).trim(), P = i.getShaderInfoLog(E).trim(), I = i.getShaderInfoLog(T).trim(); let z = !0, K = !0; - if (i.getProgramParameter(m, i.LINK_STATUS) === !1) + if (i.getProgramParameter(p, i.LINK_STATUS) === !1) if (z = !1, typeof s.debug.onShaderError == "function") - s.debug.onShaderError(i, m, E, T); + s.debug.onShaderError(i, p, E, T); else { const G = Bl(i, E, "vertex"), q = Bl(i, T, "fragment"); console.error( - "THREE.WebGLProgram: Shader Error " + i.getError() + " - VALIDATE_STATUS " + i.getProgramParameter(m, i.VALIDATE_STATUS) + ` + "THREE.WebGLProgram: Shader Error " + i.getError() + " - VALIDATE_STATUS " + i.getProgramParameter(p, i.VALIDATE_STATUS) + ` Material Name: ` + U.name + ` Material Type: ` + U.type + ` @@ -11934,7 +11934,7 @@ Program Info Log: ` + N + ` programLog: N, vertexShader: { log: P, - prefix: p + prefix: m }, fragmentShader: { log: I, @@ -11942,7 +11942,7 @@ Program Info Log: ` + N + ` } }); } - i.deleteShader(E), i.deleteShader(T), B = new hr(i, m), x = d0(i, m); + i.deleteShader(E), i.deleteShader(T), B = new hr(i, p), x = d0(i, p); } let B; this.getUniforms = function() { @@ -11954,10 +11954,10 @@ Program Info Log: ` + N + ` }; let A = t.rendererExtensionParallelShaderCompile === !1; return this.isReady = function() { - return A === !1 && (A = i.getProgramParameter(m, n0)), A; + return A === !1 && (A = i.getProgramParameter(p, n0)), A; }, this.destroy = function() { - n.releaseStatesOfProgram(this), i.deleteProgram(m), this.program = void 0; - }, this.type = t.shaderType, this.name = t.shaderName, this.id = i0++, this.cacheKey = e, this.usedTimes = 1, this.program = m, this.vertexShader = E, this.fragmentShader = T, this; + n.releaseStatesOfProgram(this), i.deleteProgram(p), this.program = void 0; + }, this.type = t.shaderType, this.name = t.shaderName, this.id = i0++, this.cacheKey = e, this.usedTimes = 1, this.program = p, this.vertexShader = E, this.fragmentShader = T, this; } let E0 = 0; class A0 { @@ -12019,10 +12019,10 @@ function b0(s, e, t, n, i, r, o) { ShadowMaterial: "shadow", SpriteMaterial: "sprite" }; - function m(x) { + function p(x) { return c.add(x), x === 0 ? "uv" : `uv${x}`; } - function p(x, A, U, N, P) { + function m(x, A, U, N, P) { const I = N.fog, z = P.geometry, K = x.isMeshStandardMaterial ? N.environment : null, G = (x.isMeshStandardMaterial ? t : e).get(x.envMap || K), q = G && G.mapping === Fr ? G.image.height : null, Q = _[x.type]; x.precision !== null && (g = i.getMaxPrecision(x.precision), g !== x.precision && console.warn("THREE.WebGLProgram.getParameters:", x.precision, "not supported, using", g, "instead.")); const te = z.morphAttributes.position || z.morphAttributes.normal || z.morphAttributes.color, fe = te !== void 0 ? te.length : 0; @@ -12097,29 +12097,29 @@ function b0(s, e, t, n, i, r, o) { alphaHash: W, combine: x.combine, // - mapUv: Re && m(x.map.channel), - aoMapUv: Te && m(x.aoMap.channel), - lightMapUv: Ie && m(x.lightMap.channel), - bumpMapUv: Me && m(x.bumpMap.channel), - normalMapUv: ze && m(x.normalMap.channel), - displacementMapUv: Oe && m(x.displacementMap.channel), - emissiveMapUv: we && m(x.emissiveMap.channel), - metalnessMapUv: Ke && m(x.metalnessMap.channel), - roughnessMapUv: w && m(x.roughnessMap.channel), - anisotropyMapUv: Be && m(x.anisotropyMap.channel), - clearcoatMapUv: Pe && m(x.clearcoatMap.channel), - clearcoatNormalMapUv: oe && m(x.clearcoatNormalMap.channel), - clearcoatRoughnessMapUv: de && m(x.clearcoatRoughnessMap.channel), - iridescenceMapUv: De && m(x.iridescenceMap.channel), - iridescenceThicknessMapUv: R && m(x.iridescenceThicknessMap.channel), - sheenColorMapUv: ue && m(x.sheenColorMap.channel), - sheenRoughnessMapUv: Se && m(x.sheenRoughnessMap.channel), - specularMapUv: me && m(x.specularMap.channel), - specularColorMapUv: _e && m(x.specularColorMap.channel), - specularIntensityMapUv: ve && m(x.specularIntensityMap.channel), - transmissionMapUv: Le && m(x.transmissionMap.channel), - thicknessMapUv: Ne && m(x.thicknessMap.channel), - alphaMapUv: F && m(x.alphaMap.channel), + mapUv: Re && p(x.map.channel), + aoMapUv: Te && p(x.aoMap.channel), + lightMapUv: Ie && p(x.lightMap.channel), + bumpMapUv: Me && p(x.bumpMap.channel), + normalMapUv: ze && p(x.normalMap.channel), + displacementMapUv: Oe && p(x.displacementMap.channel), + emissiveMapUv: we && p(x.emissiveMap.channel), + metalnessMapUv: Ke && p(x.metalnessMap.channel), + roughnessMapUv: w && p(x.roughnessMap.channel), + anisotropyMapUv: Be && p(x.anisotropyMap.channel), + clearcoatMapUv: Pe && p(x.clearcoatMap.channel), + clearcoatNormalMapUv: oe && p(x.clearcoatNormalMap.channel), + clearcoatRoughnessMapUv: de && p(x.clearcoatRoughnessMap.channel), + iridescenceMapUv: De && p(x.iridescenceMap.channel), + iridescenceThicknessMapUv: R && p(x.iridescenceThicknessMap.channel), + sheenColorMapUv: ue && p(x.sheenColorMap.channel), + sheenRoughnessMapUv: Se && p(x.sheenRoughnessMap.channel), + specularMapUv: me && p(x.specularMap.channel), + specularColorMapUv: _e && p(x.specularColorMap.channel), + specularIntensityMapUv: ve && p(x.specularIntensityMap.channel), + transmissionMapUv: Le && p(x.transmissionMap.channel), + thicknessMapUv: Ne && p(x.thicknessMap.channel), + alphaMapUv: F && p(x.alphaMap.channel), // vertexTangents: !!z.attributes.tangent && (ze || M), vertexColors: x.vertexColors, @@ -12223,7 +12223,7 @@ function b0(s, e, t, n, i, r, o) { l.dispose(); } return { - getParameters: p, + getParameters: m, getProgramCacheKey: v, getUniforms: b, acquireProgram: E, @@ -12269,9 +12269,9 @@ function Gl() { function r() { e = 0, t.length = 0, n.length = 0, i.length = 0; } - function o(d, f, h, g, _, m) { - let p = s[e]; - return p === void 0 ? (p = { + function o(d, f, h, g, _, p) { + let m = s[e]; + return m === void 0 ? (m = { id: d.id, object: d, geometry: f, @@ -12279,16 +12279,16 @@ function Gl() { groupOrder: g, renderOrder: d.renderOrder, z: _, - group: m - }, s[e] = p) : (p.id = d.id, p.object = d, p.geometry = f, p.material = h, p.groupOrder = g, p.renderOrder = d.renderOrder, p.z = _, p.group = m), e++, p; + group: p + }, s[e] = m) : (m.id = d.id, m.object = d, m.geometry = f, m.material = h, m.groupOrder = g, m.renderOrder = d.renderOrder, m.z = _, m.group = p), e++, m; } - function a(d, f, h, g, _, m) { - const p = o(d, f, h, g, _, m); - h.transmission > 0 ? n.push(p) : h.transparent === !0 ? i.push(p) : t.push(p); + function a(d, f, h, g, _, p) { + const m = o(d, f, h, g, _, p); + h.transmission > 0 ? n.push(m) : h.transparent === !0 ? i.push(m) : t.push(m); } - function l(d, f, h, g, _, m) { - const p = o(d, f, h, g, _, m); - h.transmission > 0 ? n.unshift(p) : h.transparent === !0 ? i.unshift(p) : t.unshift(p); + function l(d, f, h, g, _, p) { + const m = o(d, f, h, g, _, p); + h.transmission > 0 ? n.unshift(m) : h.transparent === !0 ? i.unshift(m) : t.unshift(m); } function c(d, f) { t.length > 1 && t.sort(d || w0), n.length > 1 && n.sort(f || Hl), i.length > 1 && i.sort(f || Hl); @@ -12467,7 +12467,7 @@ function I0(s, e) { let f = 0, h = 0, g = 0; for (let U = 0; U < 9; U++) i.probe[U].set(0, 0, 0); - let _ = 0, m = 0, p = 0, v = 0, S = 0, y = 0, b = 0, E = 0, T = 0, L = 0, B = 0; + let _ = 0, p = 0, m = 0, v = 0, S = 0, y = 0, b = 0, E = 0, T = 0, L = 0, B = 0; u.sort(F0); const x = d === !0 ? Math.PI : 1; for (let U = 0, N = u.length; U < N; U++) { @@ -12487,13 +12487,13 @@ function I0(s, e) { i.directional[_] = q, _++; } else if (P.isSpotLight) { const q = t.get(P); - q.position.setFromMatrixPosition(P.matrixWorld), q.color.copy(I).multiplyScalar(z * x), q.distance = K, q.coneCos = Math.cos(P.angle), q.penumbraCos = Math.cos(P.angle * (1 - P.penumbra)), q.decay = P.decay, i.spot[p] = q; + q.position.setFromMatrixPosition(P.matrixWorld), q.color.copy(I).multiplyScalar(z * x), q.distance = K, q.coneCos = Math.cos(P.angle), q.penumbraCos = Math.cos(P.angle * (1 - P.penumbra)), q.decay = P.decay, i.spot[m] = q; const Q = P.shadow; - if (P.map && (i.spotLightMap[T] = P.map, T++, Q.updateMatrices(P), P.castShadow && L++), i.spotLightMatrix[p] = Q.matrix, P.castShadow) { + if (P.map && (i.spotLightMap[T] = P.map, T++, Q.updateMatrices(P), P.castShadow && L++), i.spotLightMatrix[m] = Q.matrix, P.castShadow) { const te = n.get(P); - te.shadowBias = Q.bias, te.shadowNormalBias = Q.normalBias, te.shadowRadius = Q.radius, te.shadowMapSize = Q.mapSize, i.spotShadow[p] = te, i.spotShadowMap[p] = G, E++; + te.shadowBias = Q.bias, te.shadowNormalBias = Q.normalBias, te.shadowRadius = Q.radius, te.shadowMapSize = Q.mapSize, i.spotShadow[m] = te, i.spotShadowMap[m] = G, E++; } - p++; + m++; } else if (P.isRectAreaLight) { const q = t.get(P); q.color.copy(I).multiplyScalar(z), q.halfWidth.set(P.width * 0.5, 0, 0), q.halfHeight.set(0, P.height * 0.5, 0), i.rectArea[v] = q, v++; @@ -12501,9 +12501,9 @@ function I0(s, e) { const q = t.get(P); if (q.color.copy(P.color).multiplyScalar(P.intensity * x), q.distance = P.distance, q.decay = P.decay, P.castShadow) { const Q = P.shadow, te = n.get(P); - te.shadowBias = Q.bias, te.shadowNormalBias = Q.normalBias, te.shadowRadius = Q.radius, te.shadowMapSize = Q.mapSize, te.shadowCameraNear = Q.camera.near, te.shadowCameraFar = Q.camera.far, i.pointShadow[m] = te, i.pointShadowMap[m] = G, i.pointShadowMatrix[m] = P.shadow.matrix, b++; + te.shadowBias = Q.bias, te.shadowNormalBias = Q.normalBias, te.shadowRadius = Q.radius, te.shadowMapSize = Q.mapSize, te.shadowCameraNear = Q.camera.near, te.shadowCameraFar = Q.camera.far, i.pointShadow[p] = te, i.pointShadowMap[p] = G, i.pointShadowMatrix[p] = P.shadow.matrix, b++; } - i.point[m] = q, m++; + i.point[p] = q, p++; } else if (P.isHemisphereLight) { const q = t.get(P); q.skyColor.copy(P.color).multiplyScalar(z * x), q.groundColor.copy(P.groundColor).multiplyScalar(z * x), i.hemi[S] = q, S++; @@ -12511,28 +12511,28 @@ function I0(s, e) { } v > 0 && (e.isWebGL2 ? s.has("OES_texture_float_linear") === !0 ? (i.rectAreaLTC1 = he.LTC_FLOAT_1, i.rectAreaLTC2 = he.LTC_FLOAT_2) : (i.rectAreaLTC1 = he.LTC_HALF_1, i.rectAreaLTC2 = he.LTC_HALF_2) : s.has("OES_texture_float_linear") === !0 ? (i.rectAreaLTC1 = he.LTC_FLOAT_1, i.rectAreaLTC2 = he.LTC_FLOAT_2) : s.has("OES_texture_half_float_linear") === !0 ? (i.rectAreaLTC1 = he.LTC_HALF_1, i.rectAreaLTC2 = he.LTC_HALF_2) : console.error("THREE.WebGLRenderer: Unable to use RectAreaLight. Missing WebGL extensions.")), i.ambient[0] = f, i.ambient[1] = h, i.ambient[2] = g; const A = i.hash; - (A.directionalLength !== _ || A.pointLength !== m || A.spotLength !== p || A.rectAreaLength !== v || A.hemiLength !== S || A.numDirectionalShadows !== y || A.numPointShadows !== b || A.numSpotShadows !== E || A.numSpotMaps !== T || A.numLightProbes !== B) && (i.directional.length = _, i.spot.length = p, i.rectArea.length = v, i.point.length = m, i.hemi.length = S, i.directionalShadow.length = y, i.directionalShadowMap.length = y, i.pointShadow.length = b, i.pointShadowMap.length = b, i.spotShadow.length = E, i.spotShadowMap.length = E, i.directionalShadowMatrix.length = y, i.pointShadowMatrix.length = b, i.spotLightMatrix.length = E + T - L, i.spotLightMap.length = T, i.numSpotLightShadowsWithMaps = L, i.numLightProbes = B, A.directionalLength = _, A.pointLength = m, A.spotLength = p, A.rectAreaLength = v, A.hemiLength = S, A.numDirectionalShadows = y, A.numPointShadows = b, A.numSpotShadows = E, A.numSpotMaps = T, A.numLightProbes = B, i.version = L0++); + (A.directionalLength !== _ || A.pointLength !== p || A.spotLength !== m || A.rectAreaLength !== v || A.hemiLength !== S || A.numDirectionalShadows !== y || A.numPointShadows !== b || A.numSpotShadows !== E || A.numSpotMaps !== T || A.numLightProbes !== B) && (i.directional.length = _, i.spot.length = m, i.rectArea.length = v, i.point.length = p, i.hemi.length = S, i.directionalShadow.length = y, i.directionalShadowMap.length = y, i.pointShadow.length = b, i.pointShadowMap.length = b, i.spotShadow.length = E, i.spotShadowMap.length = E, i.directionalShadowMatrix.length = y, i.pointShadowMatrix.length = b, i.spotLightMatrix.length = E + T - L, i.spotLightMap.length = T, i.numSpotLightShadowsWithMaps = L, i.numLightProbes = B, A.directionalLength = _, A.pointLength = p, A.spotLength = m, A.rectAreaLength = v, A.hemiLength = S, A.numDirectionalShadows = y, A.numPointShadows = b, A.numSpotShadows = E, A.numSpotMaps = T, A.numLightProbes = B, i.version = L0++); } function c(u, d) { - let f = 0, h = 0, g = 0, _ = 0, m = 0; - const p = d.matrixWorldInverse; + let f = 0, h = 0, g = 0, _ = 0, p = 0; + const m = d.matrixWorldInverse; for (let v = 0, S = u.length; v < S; v++) { const y = u[v]; if (y.isDirectionalLight) { const b = i.directional[f]; - b.direction.setFromMatrixPosition(y.matrixWorld), r.setFromMatrixPosition(y.target.matrixWorld), b.direction.sub(r), b.direction.transformDirection(p), f++; + b.direction.setFromMatrixPosition(y.matrixWorld), r.setFromMatrixPosition(y.target.matrixWorld), b.direction.sub(r), b.direction.transformDirection(m), f++; } else if (y.isSpotLight) { const b = i.spot[g]; - b.position.setFromMatrixPosition(y.matrixWorld), b.position.applyMatrix4(p), b.direction.setFromMatrixPosition(y.matrixWorld), r.setFromMatrixPosition(y.target.matrixWorld), b.direction.sub(r), b.direction.transformDirection(p), g++; + b.position.setFromMatrixPosition(y.matrixWorld), b.position.applyMatrix4(m), b.direction.setFromMatrixPosition(y.matrixWorld), r.setFromMatrixPosition(y.target.matrixWorld), b.direction.sub(r), b.direction.transformDirection(m), g++; } else if (y.isRectAreaLight) { const b = i.rectArea[_]; - b.position.setFromMatrixPosition(y.matrixWorld), b.position.applyMatrix4(p), a.identity(), o.copy(y.matrixWorld), o.premultiply(p), a.extractRotation(o), b.halfWidth.set(y.width * 0.5, 0, 0), b.halfHeight.set(0, y.height * 0.5, 0), b.halfWidth.applyMatrix4(a), b.halfHeight.applyMatrix4(a), _++; + b.position.setFromMatrixPosition(y.matrixWorld), b.position.applyMatrix4(m), a.identity(), o.copy(y.matrixWorld), o.premultiply(m), a.extractRotation(o), b.halfWidth.set(y.width * 0.5, 0, 0), b.halfHeight.set(0, y.height * 0.5, 0), b.halfWidth.applyMatrix4(a), b.halfHeight.applyMatrix4(a), _++; } else if (y.isPointLight) { const b = i.point[h]; - b.position.setFromMatrixPosition(y.matrixWorld), b.position.applyMatrix4(p), h++; + b.position.setFromMatrixPosition(y.matrixWorld), b.position.applyMatrix4(m), h++; } else if (y.isHemisphereLight) { - const b = i.hemi[m]; - b.direction.setFromMatrixPosition(y.matrixWorld), b.direction.transformDirection(p), m++; + const b = i.hemi[p]; + b.direction.setFromMatrixPosition(y.matrixWorld), b.direction.transformDirection(m), p++; } } } @@ -12655,15 +12655,15 @@ function z0(s, e, t) { 3 ) ); - const _ = new pt(g, f), m = this; + const _ = new pt(g, f), p = this; this.enabled = !1, this.autoUpdate = !0, this.needsUpdate = !1, this.type = Rc; - let p = this.type; + let m = this.type; this.render = function(E, T, L) { - if (m.enabled === !1 || m.autoUpdate === !1 && m.needsUpdate === !1 || E.length === 0) + if (p.enabled === !1 || p.autoUpdate === !1 && p.needsUpdate === !1 || E.length === 0) return; const B = s.getRenderTarget(), x = s.getActiveCubeFace(), A = s.getActiveMipmapLevel(), U = s.state; U.setBlending(Jn), U.buffers.color.setClear(1, 1, 1, 1), U.buffers.depth.setTest(!0), U.setScissorTest(!1); - const N = p !== wn && this.type === wn, P = p === wn && this.type !== wn; + const N = m !== wn && this.type === wn, P = m === wn && this.type !== wn; for (let I = 0, z = E.length; I < z; I++) { const K = E[I], G = K.shadow; if (G === void 0) { @@ -12691,7 +12691,7 @@ function z0(s, e, t) { } G.isPointLightShadow !== !0 && this.type === wn && v(G, L), G.needsUpdate = !1; } - p = this.type, m.needsUpdate = !1, s.setRenderTarget(B, x, A); + m = this.type, p.needsUpdate = !1, s.setRenderTarget(B, x, A); }; function v(E, T) { const L = e.update(_); @@ -12849,7 +12849,7 @@ function H0(s, e, t) { }; } const a = new i(), l = new r(), c = new o(), u = /* @__PURE__ */ new WeakMap(), d = /* @__PURE__ */ new WeakMap(); - let f = {}, h = {}, g = /* @__PURE__ */ new WeakMap(), _ = [], m = null, p = !1, v = null, S = null, y = null, b = null, E = null, T = null, L = null, B = new et(0, 0, 0), x = 0, A = !1, U = null, N = null, P = null, I = null, z = null; + let f = {}, h = {}, g = /* @__PURE__ */ new WeakMap(), _ = [], p = null, m = !1, v = null, S = null, y = null, b = null, E = null, T = null, L = null, B = new et(0, 0, 0), x = 0, A = !1, U = null, N = null, P = null, I = null, z = null; const K = s.getParameter(s.MAX_COMBINED_TEXTURE_IMAGE_UNITS); let G = !1, q = 0; const Q = s.getParameter(s.VERSION); @@ -12895,7 +12895,7 @@ function H0(s, e, t) { throw new Error("THREE.WebGLState: Usage of gl.drawBuffers() require WebGL2 or WEBGL_draw_buffers extension"); } function Je(F) { - return m !== F ? (s.useProgram(F), m = F, !0) : !1; + return p !== F ? (s.useProgram(F), p = F, !0) : !1; } const Te = { [fi]: s.FUNC_ADD, @@ -12927,10 +12927,10 @@ function H0(s, e, t) { }; function Me(F, ce, W, ae, pe, Ve, it, At, jt, st) { if (F === Jn) { - p === !0 && (Qe(s.BLEND), p = !1); + m === !0 && (Qe(s.BLEND), m = !1); return; } - if (p === !1 && (ge(s.BLEND), p = !0), F !== Pc) { + if (m === !1 && (ge(s.BLEND), m = !0), F !== Pc) { if (F !== v || st !== A) { if ((S !== fi || E !== fi) && (s.blendEquation(s.FUNC_ADD), S = fi, E = fi), st) switch (F) { @@ -13095,7 +13095,7 @@ function H0(s, e, t) { u.get(ce) !== ae && (s.uniformBlockBinding(ce, ae, F.__bindingPointIndex), u.set(ce, ae)); } function nt() { - s.disable(s.BLEND), s.disable(s.CULL_FACE), s.disable(s.DEPTH_TEST), s.disable(s.POLYGON_OFFSET_FILL), s.disable(s.SCISSOR_TEST), s.disable(s.STENCIL_TEST), s.disable(s.SAMPLE_ALPHA_TO_COVERAGE), s.blendEquation(s.FUNC_ADD), s.blendFunc(s.ONE, s.ZERO), s.blendFuncSeparate(s.ONE, s.ZERO, s.ONE, s.ZERO), s.blendColor(0, 0, 0, 0), s.colorMask(!0, !0, !0, !0), s.clearColor(0, 0, 0, 0), s.depthMask(!0), s.depthFunc(s.LESS), s.clearDepth(1), s.stencilMask(4294967295), s.stencilFunc(s.ALWAYS, 0, 4294967295), s.stencilOp(s.KEEP, s.KEEP, s.KEEP), s.clearStencil(0), s.cullFace(s.BACK), s.frontFace(s.CCW), s.polygonOffset(0, 0), s.activeTexture(s.TEXTURE0), s.bindFramebuffer(s.FRAMEBUFFER, null), n === !0 && (s.bindFramebuffer(s.DRAW_FRAMEBUFFER, null), s.bindFramebuffer(s.READ_FRAMEBUFFER, null)), s.useProgram(null), s.lineWidth(1), s.scissor(0, 0, s.canvas.width, s.canvas.height), s.viewport(0, 0, s.canvas.width, s.canvas.height), f = {}, te = null, fe = {}, h = {}, g = /* @__PURE__ */ new WeakMap(), _ = [], m = null, p = !1, v = null, S = null, y = null, b = null, E = null, T = null, L = null, B = new et(0, 0, 0), x = 0, A = !1, U = null, N = null, P = null, I = null, z = null, J.set(0, 0, s.canvas.width, s.canvas.height), se.set(0, 0, s.canvas.width, s.canvas.height), a.reset(), l.reset(), c.reset(); + s.disable(s.BLEND), s.disable(s.CULL_FACE), s.disable(s.DEPTH_TEST), s.disable(s.POLYGON_OFFSET_FILL), s.disable(s.SCISSOR_TEST), s.disable(s.STENCIL_TEST), s.disable(s.SAMPLE_ALPHA_TO_COVERAGE), s.blendEquation(s.FUNC_ADD), s.blendFunc(s.ONE, s.ZERO), s.blendFuncSeparate(s.ONE, s.ZERO, s.ONE, s.ZERO), s.blendColor(0, 0, 0, 0), s.colorMask(!0, !0, !0, !0), s.clearColor(0, 0, 0, 0), s.depthMask(!0), s.depthFunc(s.LESS), s.clearDepth(1), s.stencilMask(4294967295), s.stencilFunc(s.ALWAYS, 0, 4294967295), s.stencilOp(s.KEEP, s.KEEP, s.KEEP), s.clearStencil(0), s.cullFace(s.BACK), s.frontFace(s.CCW), s.polygonOffset(0, 0), s.activeTexture(s.TEXTURE0), s.bindFramebuffer(s.FRAMEBUFFER, null), n === !0 && (s.bindFramebuffer(s.DRAW_FRAMEBUFFER, null), s.bindFramebuffer(s.READ_FRAMEBUFFER, null)), s.useProgram(null), s.lineWidth(1), s.scissor(0, 0, s.canvas.width, s.canvas.height), s.viewport(0, 0, s.canvas.width, s.canvas.height), f = {}, te = null, fe = {}, h = {}, g = /* @__PURE__ */ new WeakMap(), _ = [], p = null, m = !1, v = null, S = null, y = null, b = null, E = null, T = null, L = null, B = new et(0, 0, 0), x = 0, A = !1, U = null, N = null, P = null, I = null, z = null, J.set(0, 0, s.canvas.width, s.canvas.height), se.set(0, 0, s.canvas.width, s.canvas.height), a.reset(), l.reset(), c.reset(); } return { buffers: { @@ -13150,7 +13150,7 @@ function G0(s, e, t, n, i, r, o) { new OffscreenCanvas(w, M) ) : Tr("canvas"); } - function m(w, M, k, Z) { + function p(w, M, k, Z) { let re = 1; const ie = Ke(w); if ((ie.width > Z || ie.height > Z) && (re = Z / Math.max(ie.width, ie.height)), re < 1 || M === !0) @@ -13163,7 +13163,7 @@ function G0(s, e, t, n, i, r, o) { return "data" in w && console.warn("THREE.WebGLRenderer: Image in DataTexture is too big (" + ie.width + "x" + ie.height + ")."), w; return w; } - function p(w) { + function m(w) { const M = Ke(w); return Na(M.width) && Na(M.height); } @@ -13360,10 +13360,10 @@ function G0(s, e, t, n, i, r, o) { t.activeTexture(s.TEXTURE0 + k); const Pe = tt.getPrimaries(tt.workingColorSpace), oe = M.colorSpace === Zn ? null : tt.getPrimaries(M.colorSpace), de = M.colorSpace === Zn || Pe === oe ? s.NONE : s.BROWSER_DEFAULT_WEBGL; s.pixelStorei(s.UNPACK_FLIP_Y_WEBGL, M.flipY), s.pixelStorei(s.UNPACK_PREMULTIPLY_ALPHA_WEBGL, M.premultiplyAlpha), s.pixelStorei(s.UNPACK_ALIGNMENT, M.unpackAlignment), s.pixelStorei(s.UNPACK_COLORSPACE_CONVERSION_WEBGL, de); - const De = v(M) && p(M.image) === !1; - let R = m(M.image, De, !1, i.maxTextureSize); + const De = v(M) && m(M.image) === !1; + let R = p(M.image, De, !1, i.maxTextureSize); R = we(M, R); - const ue = p(R) || a, Se = r.convert(M.format, M.colorSpace); + const ue = m(R) || a, Se = r.convert(M.format, M.colorSpace); let me = r.convert(M.type), _e = b(M.internalFormat, Se, me, M.colorSpace, M.isVideoTexture); V(Z, M, ue); let ve; @@ -13433,8 +13433,8 @@ function G0(s, e, t, n, i, r, o) { s.pixelStorei(s.UNPACK_FLIP_Y_WEBGL, M.flipY), s.pixelStorei(s.UNPACK_PREMULTIPLY_ALPHA_WEBGL, M.premultiplyAlpha), s.pixelStorei(s.UNPACK_ALIGNMENT, M.unpackAlignment), s.pixelStorei(s.UNPACK_COLORSPACE_CONVERSION_WEBGL, oe); const de = M.isCompressedTexture || M.image[0].isCompressedTexture, De = M.image[0] && M.image[0].isDataTexture, R = []; for (let W = 0; W < 6; W++) - !de && !De ? R[W] = m(M.image[W], !1, !0, i.maxCubemapSize) : R[W] = De ? M.image[W].image : M.image[W], R[W] = we(M, R[W]); - const ue = R[0], Se = p(ue) || a, me = r.convert(M.format, M.colorSpace), _e = r.convert(M.type), ve = b(M.internalFormat, me, _e, M.colorSpace), Le = a && M.isVideoTexture !== !0, Ne = ie.__version === void 0 || Z === !0, nt = re.dataReady; + !de && !De ? R[W] = p(M.image[W], !1, !0, i.maxCubemapSize) : R[W] = De ? M.image[W].image : M.image[W], R[W] = we(M, R[W]); + const ue = R[0], Se = m(ue) || a, me = r.convert(M.format, M.colorSpace), _e = r.convert(M.type), ve = b(M.internalFormat, me, _e, M.colorSpace), Le = a && M.isVideoTexture !== !0, Ne = ie.__version === void 0 || Z === !0, nt = re.dataReady; let F = E(M, ue, Se); V(s.TEXTURE_CUBE_MAP, M, Se); let ce; @@ -13538,7 +13538,7 @@ function G0(s, e, t, n, i, r, o) { function Je(w) { const M = w.texture, k = n.get(w), Z = n.get(M); w.addEventListener("dispose", B); - const re = w.textures, ie = w.isWebGLCubeRenderTarget === !0, Be = re.length > 1, Pe = p(w) || a; + const re = w.textures, ie = w.isWebGLCubeRenderTarget === !0, Be = re.length > 1, Pe = m(w) || a; if (Be || (Z.__webglTexture === void 0 && (Z.__webglTexture = s.createTexture()), Z.__version = M.version, o.memory.textures++), ie) { k.__webglFramebuffer = []; for (let oe = 0; oe < 6; oe++) @@ -13601,7 +13601,7 @@ function G0(s, e, t, n, i, r, o) { w.depthBuffer && Re(w); } function Te(w) { - const M = p(w) || a, k = w.textures; + const M = m(w) || a, k = w.textures; for (let Z = 0, re = k.length; Z < re; Z++) { const ie = k[Z]; if (S(ie, M)) { @@ -13856,8 +13856,8 @@ class Ea { if (c && e.hand) { o = !0; for (const _ of e.hand.values()) { - const m = t.getJointPose(_, n), p = this._getHandJoint(c, _); - m !== null && (p.matrix.fromArray(m.transform.matrix), p.matrix.decompose(p.position, p.rotation, p.scale), p.matrixWorldNeedsUpdate = !0, p.jointRadius = m.radius), p.visible = m !== null; + const p = t.getJointPose(_, n), m = this._getHandJoint(c, _); + p !== null && (m.matrix.fromArray(p.transform.matrix), m.matrix.decompose(m.position, m.rotation, m.scale), m.matrixWorldNeedsUpdate = !0, m.jointRadius = p.radius), m.visible = p !== null; } const u = c.joints["index-finger-tip"], d = c.joints["thumb-tip"], f = u.position.distanceTo(d.position), h = 0.02, g = 5e-3; c.inputState.pinching && f > h + g ? (c.inputState.pinching = !1, this.dispatchEvent({ @@ -13946,8 +13946,8 @@ class j0 extends Ti { super(); const n = this; let i = null, r = 1, o = null, a = "local-floor", l = 1, c = null, u = null, d = null, f = null, h = null, g = null; - const _ = new Y0(), m = t.getContextAttributes(); - let p = null, v = null; + const _ = new Y0(), p = t.getContextAttributes(); + let m = null, v = null; const S = [], y = [], b = new Ee(); let E = null; const T = new $t(); @@ -13980,7 +13980,7 @@ class j0 extends Ti { const J = y[V]; J !== null && (y[V] = null, S[V].disconnect(J)); } - A = null, U = null, _.reset(), e.setRenderTarget(p), h = null, f = null, d = null, i = null, v = null, ne.stop(), n.isPresenting = !1, e.setPixelRatio(E), e.setSize(b.width, b.height, !1), n.dispatchEvent({ type: "sessionend" }); + A = null, U = null, _.reset(), e.setRenderTarget(m), h = null, f = null, d = null, i = null, v = null, ne.stop(), n.isPresenting = !1, e.setPixelRatio(E), e.setSize(b.width, b.height, !1), n.dispatchEvent({ type: "sessionend" }); } this.setFramebufferScaleFactor = function(V) { r = V, n.isPresenting === !0 && console.warn("THREE.WebXRManager: Cannot change framebuffer scale while presenting."); @@ -14000,12 +14000,12 @@ class j0 extends Ti { return i; }, this.setSession = async function(V) { if (i = V, i !== null) { - if (p = e.getRenderTarget(), i.addEventListener("select", N), i.addEventListener("selectstart", N), i.addEventListener("selectend", N), i.addEventListener("squeeze", N), i.addEventListener("squeezestart", N), i.addEventListener("squeezeend", N), i.addEventListener("end", P), i.addEventListener("inputsourceschange", I), m.xrCompatible !== !0 && await t.makeXRCompatible(), E = e.getPixelRatio(), e.getSize(b), i.renderState.layers === void 0 || e.capabilities.isWebGL2 === !1) { + if (m = e.getRenderTarget(), i.addEventListener("select", N), i.addEventListener("selectstart", N), i.addEventListener("selectend", N), i.addEventListener("squeeze", N), i.addEventListener("squeezestart", N), i.addEventListener("squeezeend", N), i.addEventListener("end", P), i.addEventListener("inputsourceschange", I), p.xrCompatible !== !0 && await t.makeXRCompatible(), E = e.getPixelRatio(), e.getSize(b), i.renderState.layers === void 0 || e.capabilities.isWebGL2 === !1) { const J = { - antialias: i.renderState.layers === void 0 ? m.antialias : !0, + antialias: i.renderState.layers === void 0 ? p.antialias : !0, alpha: !0, - depth: m.depth, - stencil: m.stencil, + depth: p.depth, + stencil: p.stencil, framebufferScaleFactor: r }; h = new XRWebGLLayer(i, t, J), i.updateRenderState({ baseLayer: h }), e.setPixelRatio(1), e.setSize(h.framebufferWidth, h.framebufferHeight, !1), v = new ti( @@ -14015,12 +14015,12 @@ class j0 extends Ti { format: kt, type: In, colorSpace: e.outputColorSpace, - stencilBuffer: m.stencil + stencilBuffer: p.stencil } ); } else { let J = null, se = null, Ae = null; - m.depth && (Ae = m.stencil ? t.DEPTH24_STENCIL8 : t.DEPTH_COMPONENT24, J = m.stencil ? cs : ei, se = m.stencil ? vi : fn); + p.depth && (Ae = p.stencil ? t.DEPTH24_STENCIL8 : t.DEPTH_COMPONENT24, J = p.stencil ? cs : ei, se = p.stencil ? vi : fn); const xe = { colorFormat: t.RGBA8, depthFormat: Ae, @@ -14033,9 +14033,9 @@ class j0 extends Ti { format: kt, type: In, depthTexture: new no(f.textureWidth, f.textureHeight, se, void 0, void 0, void 0, void 0, void 0, void 0, J), - stencilBuffer: m.stencil, + stencilBuffer: p.stencil, colorSpace: e.outputColorSpace, - samples: m.antialias ? 4 : 0 + samples: p.antialias ? 4 : 0 } ); const ge = e.properties.get(v); @@ -14152,55 +14152,55 @@ class j0 extends Ti { } const ui = /* @__PURE__ */ new Nn(), K0 = /* @__PURE__ */ new Ge(); function Z0(s, e) { - function t(m, p) { - m.matrixAutoUpdate === !0 && m.updateMatrix(), p.value.copy(m.matrix); + function t(p, m) { + p.matrixAutoUpdate === !0 && p.updateMatrix(), m.value.copy(p.matrix); } - function n(m, p) { - p.color.getRGB(m.fogColor.value, Kc(s)), p.isFog ? (m.fogNear.value = p.near, m.fogFar.value = p.far) : p.isFogExp2 && (m.fogDensity.value = p.density); + function n(p, m) { + m.color.getRGB(p.fogColor.value, Kc(s)), m.isFog ? (p.fogNear.value = m.near, p.fogFar.value = m.far) : m.isFogExp2 && (p.fogDensity.value = m.density); } - function i(m, p, v, S, y) { - p.isMeshBasicMaterial || p.isMeshLambertMaterial ? r(m, p) : p.isMeshToonMaterial ? (r(m, p), d(m, p)) : p.isMeshPhongMaterial ? (r(m, p), u(m, p)) : p.isMeshStandardMaterial ? (r(m, p), f(m, p), p.isMeshPhysicalMaterial && h(m, p, y)) : p.isMeshMatcapMaterial ? (r(m, p), g(m, p)) : p.isMeshDepthMaterial ? r(m, p) : p.isMeshDistanceMaterial ? (r(m, p), _(m, p)) : p.isMeshNormalMaterial ? r(m, p) : p.isLineBasicMaterial ? (o(m, p), p.isLineDashedMaterial && a(m, p)) : p.isPointsMaterial ? l(m, p, v, S) : p.isSpriteMaterial ? c(m, p) : p.isShadowMaterial ? (m.color.value.copy(p.color), m.opacity.value = p.opacity) : p.isShaderMaterial && (p.uniformsNeedUpdate = !1); + function i(p, m, v, S, y) { + m.isMeshBasicMaterial || m.isMeshLambertMaterial ? r(p, m) : m.isMeshToonMaterial ? (r(p, m), d(p, m)) : m.isMeshPhongMaterial ? (r(p, m), u(p, m)) : m.isMeshStandardMaterial ? (r(p, m), f(p, m), m.isMeshPhysicalMaterial && h(p, m, y)) : m.isMeshMatcapMaterial ? (r(p, m), g(p, m)) : m.isMeshDepthMaterial ? r(p, m) : m.isMeshDistanceMaterial ? (r(p, m), _(p, m)) : m.isMeshNormalMaterial ? r(p, m) : m.isLineBasicMaterial ? (o(p, m), m.isLineDashedMaterial && a(p, m)) : m.isPointsMaterial ? l(p, m, v, S) : m.isSpriteMaterial ? c(p, m) : m.isShadowMaterial ? (p.color.value.copy(m.color), p.opacity.value = m.opacity) : m.isShaderMaterial && (m.uniformsNeedUpdate = !1); } - function r(m, p) { - m.opacity.value = p.opacity, p.color && m.diffuse.value.copy(p.color), p.emissive && m.emissive.value.copy(p.emissive).multiplyScalar(p.emissiveIntensity), p.map && (m.map.value = p.map, t(p.map, m.mapTransform)), p.alphaMap && (m.alphaMap.value = p.alphaMap, t(p.alphaMap, m.alphaMapTransform)), p.bumpMap && (m.bumpMap.value = p.bumpMap, t(p.bumpMap, m.bumpMapTransform), m.bumpScale.value = p.bumpScale, p.side === zt && (m.bumpScale.value *= -1)), p.normalMap && (m.normalMap.value = p.normalMap, t(p.normalMap, m.normalMapTransform), m.normalScale.value.copy(p.normalScale), p.side === zt && m.normalScale.value.negate()), p.displacementMap && (m.displacementMap.value = p.displacementMap, t(p.displacementMap, m.displacementMapTransform), m.displacementScale.value = p.displacementScale, m.displacementBias.value = p.displacementBias), p.emissiveMap && (m.emissiveMap.value = p.emissiveMap, t(p.emissiveMap, m.emissiveMapTransform)), p.specularMap && (m.specularMap.value = p.specularMap, t(p.specularMap, m.specularMapTransform)), p.alphaTest > 0 && (m.alphaTest.value = p.alphaTest); - const v = e.get(p), S = v.envMap, y = v.envMapRotation; - if (S && (m.envMap.value = S, ui.copy(y), ui.x *= -1, ui.y *= -1, ui.z *= -1, S.isCubeTexture && S.isRenderTargetTexture === !1 && (ui.y *= -1, ui.z *= -1), m.envMapRotation.value.setFromMatrix4(K0.makeRotationFromEuler(ui)), m.flipEnvMap.value = S.isCubeTexture && S.isRenderTargetTexture === !1 ? -1 : 1, m.reflectivity.value = p.reflectivity, m.ior.value = p.ior, m.refractionRatio.value = p.refractionRatio), p.lightMap) { - m.lightMap.value = p.lightMap; + function r(p, m) { + p.opacity.value = m.opacity, m.color && p.diffuse.value.copy(m.color), m.emissive && p.emissive.value.copy(m.emissive).multiplyScalar(m.emissiveIntensity), m.map && (p.map.value = m.map, t(m.map, p.mapTransform)), m.alphaMap && (p.alphaMap.value = m.alphaMap, t(m.alphaMap, p.alphaMapTransform)), m.bumpMap && (p.bumpMap.value = m.bumpMap, t(m.bumpMap, p.bumpMapTransform), p.bumpScale.value = m.bumpScale, m.side === zt && (p.bumpScale.value *= -1)), m.normalMap && (p.normalMap.value = m.normalMap, t(m.normalMap, p.normalMapTransform), p.normalScale.value.copy(m.normalScale), m.side === zt && p.normalScale.value.negate()), m.displacementMap && (p.displacementMap.value = m.displacementMap, t(m.displacementMap, p.displacementMapTransform), p.displacementScale.value = m.displacementScale, p.displacementBias.value = m.displacementBias), m.emissiveMap && (p.emissiveMap.value = m.emissiveMap, t(m.emissiveMap, p.emissiveMapTransform)), m.specularMap && (p.specularMap.value = m.specularMap, t(m.specularMap, p.specularMapTransform)), m.alphaTest > 0 && (p.alphaTest.value = m.alphaTest); + const v = e.get(m), S = v.envMap, y = v.envMapRotation; + if (S && (p.envMap.value = S, ui.copy(y), ui.x *= -1, ui.y *= -1, ui.z *= -1, S.isCubeTexture && S.isRenderTargetTexture === !1 && (ui.y *= -1, ui.z *= -1), p.envMapRotation.value.setFromMatrix4(K0.makeRotationFromEuler(ui)), p.flipEnvMap.value = S.isCubeTexture && S.isRenderTargetTexture === !1 ? -1 : 1, p.reflectivity.value = m.reflectivity, p.ior.value = m.ior, p.refractionRatio.value = m.refractionRatio), m.lightMap) { + p.lightMap.value = m.lightMap; const b = s._useLegacyLights === !0 ? Math.PI : 1; - m.lightMapIntensity.value = p.lightMapIntensity * b, t(p.lightMap, m.lightMapTransform); + p.lightMapIntensity.value = m.lightMapIntensity * b, t(m.lightMap, p.lightMapTransform); } - p.aoMap && (m.aoMap.value = p.aoMap, m.aoMapIntensity.value = p.aoMapIntensity, t(p.aoMap, m.aoMapTransform)); + m.aoMap && (p.aoMap.value = m.aoMap, p.aoMapIntensity.value = m.aoMapIntensity, t(m.aoMap, p.aoMapTransform)); } - function o(m, p) { - m.diffuse.value.copy(p.color), m.opacity.value = p.opacity, p.map && (m.map.value = p.map, t(p.map, m.mapTransform)); + function o(p, m) { + p.diffuse.value.copy(m.color), p.opacity.value = m.opacity, m.map && (p.map.value = m.map, t(m.map, p.mapTransform)); } - function a(m, p) { - m.dashSize.value = p.dashSize, m.totalSize.value = p.dashSize + p.gapSize, m.scale.value = p.scale; + function a(p, m) { + p.dashSize.value = m.dashSize, p.totalSize.value = m.dashSize + m.gapSize, p.scale.value = m.scale; } - function l(m, p, v, S) { - m.diffuse.value.copy(p.color), m.opacity.value = p.opacity, m.size.value = p.size * v, m.scale.value = S * 0.5, p.map && (m.map.value = p.map, t(p.map, m.uvTransform)), p.alphaMap && (m.alphaMap.value = p.alphaMap, t(p.alphaMap, m.alphaMapTransform)), p.alphaTest > 0 && (m.alphaTest.value = p.alphaTest); + function l(p, m, v, S) { + p.diffuse.value.copy(m.color), p.opacity.value = m.opacity, p.size.value = m.size * v, p.scale.value = S * 0.5, m.map && (p.map.value = m.map, t(m.map, p.uvTransform)), m.alphaMap && (p.alphaMap.value = m.alphaMap, t(m.alphaMap, p.alphaMapTransform)), m.alphaTest > 0 && (p.alphaTest.value = m.alphaTest); } - function c(m, p) { - m.diffuse.value.copy(p.color), m.opacity.value = p.opacity, m.rotation.value = p.rotation, p.map && (m.map.value = p.map, t(p.map, m.mapTransform)), p.alphaMap && (m.alphaMap.value = p.alphaMap, t(p.alphaMap, m.alphaMapTransform)), p.alphaTest > 0 && (m.alphaTest.value = p.alphaTest); + function c(p, m) { + p.diffuse.value.copy(m.color), p.opacity.value = m.opacity, p.rotation.value = m.rotation, m.map && (p.map.value = m.map, t(m.map, p.mapTransform)), m.alphaMap && (p.alphaMap.value = m.alphaMap, t(m.alphaMap, p.alphaMapTransform)), m.alphaTest > 0 && (p.alphaTest.value = m.alphaTest); } - function u(m, p) { - m.specular.value.copy(p.specular), m.shininess.value = Math.max(p.shininess, 1e-4); + function u(p, m) { + p.specular.value.copy(m.specular), p.shininess.value = Math.max(m.shininess, 1e-4); } - function d(m, p) { - p.gradientMap && (m.gradientMap.value = p.gradientMap); + function d(p, m) { + m.gradientMap && (p.gradientMap.value = m.gradientMap); } - function f(m, p) { - m.metalness.value = p.metalness, p.metalnessMap && (m.metalnessMap.value = p.metalnessMap, t(p.metalnessMap, m.metalnessMapTransform)), m.roughness.value = p.roughness, p.roughnessMap && (m.roughnessMap.value = p.roughnessMap, t(p.roughnessMap, m.roughnessMapTransform)), e.get(p).envMap && (m.envMapIntensity.value = p.envMapIntensity); + function f(p, m) { + p.metalness.value = m.metalness, m.metalnessMap && (p.metalnessMap.value = m.metalnessMap, t(m.metalnessMap, p.metalnessMapTransform)), p.roughness.value = m.roughness, m.roughnessMap && (p.roughnessMap.value = m.roughnessMap, t(m.roughnessMap, p.roughnessMapTransform)), e.get(m).envMap && (p.envMapIntensity.value = m.envMapIntensity); } - function h(m, p, v) { - m.ior.value = p.ior, p.sheen > 0 && (m.sheenColor.value.copy(p.sheenColor).multiplyScalar(p.sheen), m.sheenRoughness.value = p.sheenRoughness, p.sheenColorMap && (m.sheenColorMap.value = p.sheenColorMap, t(p.sheenColorMap, m.sheenColorMapTransform)), p.sheenRoughnessMap && (m.sheenRoughnessMap.value = p.sheenRoughnessMap, t(p.sheenRoughnessMap, m.sheenRoughnessMapTransform))), p.clearcoat > 0 && (m.clearcoat.value = p.clearcoat, m.clearcoatRoughness.value = p.clearcoatRoughness, p.clearcoatMap && (m.clearcoatMap.value = p.clearcoatMap, t(p.clearcoatMap, m.clearcoatMapTransform)), p.clearcoatRoughnessMap && (m.clearcoatRoughnessMap.value = p.clearcoatRoughnessMap, t(p.clearcoatRoughnessMap, m.clearcoatRoughnessMapTransform)), p.clearcoatNormalMap && (m.clearcoatNormalMap.value = p.clearcoatNormalMap, t(p.clearcoatNormalMap, m.clearcoatNormalMapTransform), m.clearcoatNormalScale.value.copy(p.clearcoatNormalScale), p.side === zt && m.clearcoatNormalScale.value.negate())), p.iridescence > 0 && (m.iridescence.value = p.iridescence, m.iridescenceIOR.value = p.iridescenceIOR, m.iridescenceThicknessMinimum.value = p.iridescenceThicknessRange[0], m.iridescenceThicknessMaximum.value = p.iridescenceThicknessRange[1], p.iridescenceMap && (m.iridescenceMap.value = p.iridescenceMap, t(p.iridescenceMap, m.iridescenceMapTransform)), p.iridescenceThicknessMap && (m.iridescenceThicknessMap.value = p.iridescenceThicknessMap, t(p.iridescenceThicknessMap, m.iridescenceThicknessMapTransform))), p.transmission > 0 && (m.transmission.value = p.transmission, m.transmissionSamplerMap.value = v.texture, m.transmissionSamplerSize.value.set(v.width, v.height), p.transmissionMap && (m.transmissionMap.value = p.transmissionMap, t(p.transmissionMap, m.transmissionMapTransform)), m.thickness.value = p.thickness, p.thicknessMap && (m.thicknessMap.value = p.thicknessMap, t(p.thicknessMap, m.thicknessMapTransform)), m.attenuationDistance.value = p.attenuationDistance, m.attenuationColor.value.copy(p.attenuationColor)), p.anisotropy > 0 && (m.anisotropyVector.value.set(p.anisotropy * Math.cos(p.anisotropyRotation), p.anisotropy * Math.sin(p.anisotropyRotation)), p.anisotropyMap && (m.anisotropyMap.value = p.anisotropyMap, t(p.anisotropyMap, m.anisotropyMapTransform))), m.specularIntensity.value = p.specularIntensity, m.specularColor.value.copy(p.specularColor), p.specularColorMap && (m.specularColorMap.value = p.specularColorMap, t(p.specularColorMap, m.specularColorMapTransform)), p.specularIntensityMap && (m.specularIntensityMap.value = p.specularIntensityMap, t(p.specularIntensityMap, m.specularIntensityMapTransform)); + function h(p, m, v) { + p.ior.value = m.ior, m.sheen > 0 && (p.sheenColor.value.copy(m.sheenColor).multiplyScalar(m.sheen), p.sheenRoughness.value = m.sheenRoughness, m.sheenColorMap && (p.sheenColorMap.value = m.sheenColorMap, t(m.sheenColorMap, p.sheenColorMapTransform)), m.sheenRoughnessMap && (p.sheenRoughnessMap.value = m.sheenRoughnessMap, t(m.sheenRoughnessMap, p.sheenRoughnessMapTransform))), m.clearcoat > 0 && (p.clearcoat.value = m.clearcoat, p.clearcoatRoughness.value = m.clearcoatRoughness, m.clearcoatMap && (p.clearcoatMap.value = m.clearcoatMap, t(m.clearcoatMap, p.clearcoatMapTransform)), m.clearcoatRoughnessMap && (p.clearcoatRoughnessMap.value = m.clearcoatRoughnessMap, t(m.clearcoatRoughnessMap, p.clearcoatRoughnessMapTransform)), m.clearcoatNormalMap && (p.clearcoatNormalMap.value = m.clearcoatNormalMap, t(m.clearcoatNormalMap, p.clearcoatNormalMapTransform), p.clearcoatNormalScale.value.copy(m.clearcoatNormalScale), m.side === zt && p.clearcoatNormalScale.value.negate())), m.iridescence > 0 && (p.iridescence.value = m.iridescence, p.iridescenceIOR.value = m.iridescenceIOR, p.iridescenceThicknessMinimum.value = m.iridescenceThicknessRange[0], p.iridescenceThicknessMaximum.value = m.iridescenceThicknessRange[1], m.iridescenceMap && (p.iridescenceMap.value = m.iridescenceMap, t(m.iridescenceMap, p.iridescenceMapTransform)), m.iridescenceThicknessMap && (p.iridescenceThicknessMap.value = m.iridescenceThicknessMap, t(m.iridescenceThicknessMap, p.iridescenceThicknessMapTransform))), m.transmission > 0 && (p.transmission.value = m.transmission, p.transmissionSamplerMap.value = v.texture, p.transmissionSamplerSize.value.set(v.width, v.height), m.transmissionMap && (p.transmissionMap.value = m.transmissionMap, t(m.transmissionMap, p.transmissionMapTransform)), p.thickness.value = m.thickness, m.thicknessMap && (p.thicknessMap.value = m.thicknessMap, t(m.thicknessMap, p.thicknessMapTransform)), p.attenuationDistance.value = m.attenuationDistance, p.attenuationColor.value.copy(m.attenuationColor)), m.anisotropy > 0 && (p.anisotropyVector.value.set(m.anisotropy * Math.cos(m.anisotropyRotation), m.anisotropy * Math.sin(m.anisotropyRotation)), m.anisotropyMap && (p.anisotropyMap.value = m.anisotropyMap, t(m.anisotropyMap, p.anisotropyMapTransform))), p.specularIntensity.value = m.specularIntensity, p.specularColor.value.copy(m.specularColor), m.specularColorMap && (p.specularColorMap.value = m.specularColorMap, t(m.specularColorMap, p.specularColorMapTransform)), m.specularIntensityMap && (p.specularIntensityMap.value = m.specularIntensityMap, t(m.specularIntensityMap, p.specularIntensityMapTransform)); } - function g(m, p) { - p.matcap && (m.matcap.value = p.matcap); + function g(p, m) { + m.matcap && (p.matcap.value = m.matcap); } - function _(m, p) { - const v = e.get(p).light; - m.referencePosition.value.setFromMatrixPosition(v.matrixWorld), m.nearDistance.value = v.shadow.camera.near, m.farDistance.value = v.shadow.camera.far; + function _(p, m) { + const v = e.get(m).light; + p.referencePosition.value.setFromMatrixPosition(v.matrixWorld), p.nearDistance.value = v.shadow.camera.near, p.farDistance.value = v.shadow.camera.far; } return { refreshFogUniforms: n, @@ -14216,7 +14216,7 @@ function Q0(s, e, t, n) { } function c(v, S) { let y = i[v.id]; - y === void 0 && (g(v), y = u(v), i[v.id] = y, v.addEventListener("dispose", m)); + y === void 0 && (g(v), y = u(v), i[v.id] = y, v.addEventListener("dispose", p)); const b = S.program; n.updateUBOMapping(v, b); const E = e.render.frame; @@ -14294,13 +14294,13 @@ function Q0(s, e, t, n) { }; return typeof v == "number" || typeof v == "boolean" ? (S.boundary = 4, S.storage = 4) : v.isVector2 ? (S.boundary = 8, S.storage = 8) : v.isVector3 || v.isColor ? (S.boundary = 16, S.storage = 12) : v.isVector4 ? (S.boundary = 16, S.storage = 16) : v.isMatrix3 ? (S.boundary = 48, S.storage = 48) : v.isMatrix4 ? (S.boundary = 64, S.storage = 64) : v.isTexture ? console.warn("THREE.WebGLRenderer: Texture samplers can not be part of an uniforms group.") : console.warn("THREE.WebGLRenderer: Unsupported uniform value type.", v), S; } - function m(v) { + function p(v) { const S = v.target; - S.removeEventListener("dispose", m); + S.removeEventListener("dispose", p); const y = o.indexOf(S.__bindingPointIndex); o.splice(y, 1), s.deleteBuffer(i[S.id]), delete i[S.id], delete r[S.id]; } - function p() { + function m() { for (const v in i) s.deleteBuffer(i[v]); o = [], i = {}, r = {}; @@ -14308,7 +14308,7 @@ function Q0(s, e, t, n) { return { bind: l, update: c, - dispose: p + dispose: m }; } class au { @@ -14329,8 +14329,8 @@ class au { let f; n !== null ? f = n.getContextAttributes().alpha : f = o; const h = new Uint32Array(4), g = new Int32Array(4); - let _ = null, m = null; - const p = [], v = []; + let _ = null, p = null; + const m = [], v = []; this.domElement = t, this.debug = { /** * Enables error checking and reporting when shader programs are being compiled @@ -14533,11 +14533,11 @@ class au { C.transparent === !0 && C.side === un && C.forceSinglePass === !1 ? (C.side = zt, C.needsUpdate = !0, Os(C, H, Y), C.side = yn, C.needsUpdate = !0, Os(C, H, Y), C.side = un) : Os(C, H, Y); } this.compile = function(C, H, Y = null) { - Y === null && (Y = C), m = Pe.get(Y), m.init(), v.push(m), Y.traverseVisible(function(X) { - X.isLight && X.layers.test(H.layers) && (m.pushLight(X), X.castShadow && m.pushShadow(X)); + Y === null && (Y = C), p = Pe.get(Y), p.init(), v.push(p), Y.traverseVisible(function(X) { + X.isLight && X.layers.test(H.layers) && (p.pushLight(X), X.castShadow && p.pushShadow(X)); }), C !== Y && C.traverseVisible(function(X) { - X.isLight && X.layers.test(H.layers) && (m.pushLight(X), X.castShadow && m.pushShadow(X)); - }), m.setupLights(S._useLegacyLights); + X.isLight && X.layers.test(H.layers) && (p.pushLight(X), X.castShadow && p.pushShadow(X)); + }), p.setupLights(S._useLegacyLights); const j = /* @__PURE__ */ new Set(); return C.traverse(function(X) { const ye = X.material; @@ -14549,7 +14549,7 @@ class au { } else Ve(ye, Y, X), j.add(ye); - }), v.pop(), m = null, j; + }), v.pop(), p = null, j; }, this.compileAsync = function(C, H, Y = null) { const j = this.compile(C, H, Y); return new Promise((X) => { @@ -14585,9 +14585,9 @@ class au { } if (y === !0) return; - C.matrixWorldAutoUpdate === !0 && C.updateMatrixWorld(), H.parent === null && H.matrixWorldAutoUpdate === !0 && H.updateMatrixWorld(), Ne.enabled === !0 && Ne.isPresenting === !0 && (Ne.cameraAutoUpdate === !0 && Ne.updateCamera(H), H = Ne.getCamera()), C.isScene === !0 && C.onBeforeRender(S, C, H, T), m = Pe.get(C, v.length), m.init(), v.push(m), Ae.multiplyMatrices(H.projectionMatrix, H.matrixWorldInverse), ne.setFromProjectionMatrix(Ae), J = this.localClippingEnabled, V = oe.init(this.clippingPlanes, J), _ = Be.get(C, p.length), _.init(), p.push(_), hn(C, H, 0, S.sortObjects), _.finish(), S.sortObjects === !0 && _.sort(G, q), this.info.render.frame++, V === !0 && oe.beginShadows(); - const Y = m.state.shadowsArray; - if (de.render(Y, C, H), V === !0 && oe.endShadows(), this.info.autoReset === !0 && this.info.reset(), (Ne.enabled === !1 || Ne.isPresenting === !1 || Ne.hasDepthSensing() === !1) && De.render(_, C), m.setupLights(S._useLegacyLights), H.isArrayCamera) { + C.matrixWorldAutoUpdate === !0 && C.updateMatrixWorld(), H.parent === null && H.matrixWorldAutoUpdate === !0 && H.updateMatrixWorld(), Ne.enabled === !0 && Ne.isPresenting === !0 && (Ne.cameraAutoUpdate === !0 && Ne.updateCamera(H), H = Ne.getCamera()), C.isScene === !0 && C.onBeforeRender(S, C, H, T), p = Pe.get(C, v.length), p.init(), v.push(p), Ae.multiplyMatrices(H.projectionMatrix, H.matrixWorldInverse), ne.setFromProjectionMatrix(Ae), J = this.localClippingEnabled, V = oe.init(this.clippingPlanes, J), _ = Be.get(C, m.length), _.init(), m.push(_), hn(C, H, 0, S.sortObjects), _.finish(), S.sortObjects === !0 && _.sort(G, q), this.info.render.frame++, V === !0 && oe.beginShadows(); + const Y = p.state.shadowsArray; + if (de.render(Y, C, H), V === !0 && oe.endShadows(), this.info.autoReset === !0 && this.info.reset(), (Ne.enabled === !1 || Ne.isPresenting === !1 || Ne.hasDepthSensing() === !1) && De.render(_, C), p.setupLights(S._useLegacyLights), H.isArrayCamera) { const j = H.cameras; for (let X = 0, ye = j.length; X < ye; X++) { const Ce = j[X]; @@ -14595,7 +14595,7 @@ class au { } } else uo(_, C, H); - T !== null && (we.updateMultisampleRenderTarget(T), we.updateRenderTargetMipmap(T)), C.isScene === !0 && C.onAfterRender(S, C, H), _e.resetDefaultState(), L = -1, B = null, v.pop(), v.length > 0 ? m = v[v.length - 1] : m = null, p.pop(), p.length > 0 ? _ = p[p.length - 1] : _ = null; + T !== null && (we.updateMultisampleRenderTarget(T), we.updateRenderTargetMipmap(T)), C.isScene === !0 && C.onAfterRender(S, C, H), _e.resetDefaultState(), L = -1, B = null, v.pop(), v.length > 0 ? p = v[v.length - 1] : p = null, m.pop(), m.length > 0 ? _ = m[m.length - 1] : _ = null; }; function hn(C, H, Y, j) { if (C.visible === !1) @@ -14606,7 +14606,7 @@ class au { else if (C.isLOD) C.autoUpdate === !0 && C.update(H); else if (C.isLight) - m.pushLight(C), C.castShadow && m.pushShadow(C); + p.pushLight(C), C.castShadow && p.pushShadow(C); else if (C.isSprite) { if (!C.frustumCulled || ne.intersectsSprite(C)) { j && ge.setFromMatrixPosition(C.matrixWorld).applyMatrix4(Ae); @@ -14631,7 +14631,7 @@ class au { } function uo(C, H, Y, j) { const X = C.opaque, ye = C.transmissive, Ce = C.transparent; - m.setupLightsView(Y), V === !0 && oe.setGlobalState(S.clippingPlanes, Y), ye.length > 0 && pu(X, ye, H, Y), j && Me.viewport(x.copy(j)), X.length > 0 && Bs(X, H, Y), ye.length > 0 && Bs(ye, H, Y), Ce.length > 0 && Bs(Ce, H, Y), Me.buffers.depth.setTest(!0), Me.buffers.depth.setMask(!0), Me.buffers.color.setMask(!0), Me.setPolygonOffset(!1); + p.setupLightsView(Y), V === !0 && oe.setGlobalState(S.clippingPlanes, Y), ye.length > 0 && pu(X, ye, H, Y), j && Me.viewport(x.copy(j)), X.length > 0 && Bs(X, H, Y), ye.length > 0 && Bs(ye, H, Y), Ce.length > 0 && Bs(Ce, H, Y), Me.buffers.depth.setTest(!0), Me.buffers.depth.setMask(!0), Me.buffers.color.setMask(!0), Me.setPolygonOffset(!1); } function pu(C, H, Y, j) { if ((Y.isScene === !0 ? Y.overrideMaterial : null) !== null) @@ -14669,7 +14669,7 @@ class au { } function Os(C, H, Y) { H.isScene !== !0 && (H = Qe); - const j = Oe.get(C), X = m.state.lights, ye = m.state.shadowsArray, Ce = X.state.version, Fe = re.getParameters(C, X.state, ye, H, Y), ke = re.getProgramCacheKey(Fe); + const j = Oe.get(C), X = p.state.lights, ye = p.state.shadowsArray, Ce = X.state.version, Fe = re.getParameters(C, X.state, ye, H, Y), ke = re.getProgramCacheKey(Fe); let Ze = j.programs; j.environment = C.isMeshStandardMaterial ? H.environment : null, j.fog = H.fog, j.envMap = (C.isMeshStandardMaterial ? w : Ke).get(C.envMap || j.environment), j.envMapRotation = j.environment !== null && C.envMap === null ? H.environmentRotation : C.envMapRotation, Ze === void 0 && (C.addEventListener("dispose", W), Ze = /* @__PURE__ */ new Map(), j.programs = Ze); let He = Ze.get(ke); @@ -14697,7 +14697,7 @@ class au { const ye = H.fog, Ce = j.isMeshStandardMaterial ? H.environment : null, Fe = T === null ? S.outputColorSpace : T.isXRRenderTarget === !0 ? T.texture.colorSpace : ni, ke = (j.isMeshStandardMaterial ? w : Ke).get(j.envMap || Ce), Ze = j.vertexColors === !0 && !!Y.attributes.color && Y.attributes.color.itemSize === 4, He = !!Y.attributes.tangent && (!!j.normalMap || j.anisotropy > 0), We = !!Y.morphAttributes.position, ht = !!Y.morphAttributes.normal, Ht = !!Y.morphAttributes.color; let yt = $n; j.toneMapped && (T === null || T.isXRRenderTarget === !0) && (yt = S.toneMapping); - const Mn = Y.morphAttributes.position || Y.morphAttributes.normal || Y.morphAttributes.color, lt = Mn !== void 0 ? Mn.length : 0, Ye = Oe.get(j), Nr = m.state.lights; + const Mn = Y.morphAttributes.position || Y.morphAttributes.normal || Y.morphAttributes.color, lt = Mn !== void 0 ? Mn.length : 0, Ye = Oe.get(j), Nr = p.state.lights; if (V === !0 && (J === !0 || C !== B)) { const Kt = C === B && j.id === L; oe.setState(j, C, Kt); @@ -14897,8 +14897,8 @@ class Is extends sn { i = Math.floor(i), r = Math.floor(r); const u = [], d = [], f = [], h = []; let g = 0; - const _ = [], m = n / 2; - let p = 0; + const _ = [], p = n / 2; + let m = 0; v(), o === !1 && (e > 0 && S(!0), t > 0 && S(!1)), this.setIndex(u), this.setAttribute("position", new Yt(d, 3)), this.setAttribute("normal", new Yt(f, 3)), this.setAttribute("uv", new Yt(h, 2)); function v() { const y = new D(), b = new D(); @@ -14908,7 +14908,7 @@ class Is extends sn { const B = [], x = L / r, A = x * (t - e) + e; for (let U = 0; U <= i; U++) { const N = U / i, P = N * l + a, I = Math.sin(P), z = Math.cos(P); - b.x = A * I, b.y = -x * n + m, b.z = A * z, d.push(b.x, b.y, b.z), y.set(I, T, z).normalize(), f.push(y.x, y.y, y.z), h.push(N, 1 - x), B.push(g++); + b.x = A * I, b.y = -x * n + p, b.z = A * z, d.push(b.x, b.y, b.z), y.set(I, T, z).normalize(), f.push(y.x, y.y, y.z), h.push(N, 1 - x), B.push(g++); } _.push(B); } @@ -14917,24 +14917,24 @@ class Is extends sn { const x = _[B][L], A = _[B + 1][L], U = _[B + 1][L + 1], N = _[B][L + 1]; u.push(x, A, N), u.push(A, U, N), E += 6; } - c.addGroup(p, E, 0), p += E; + c.addGroup(m, E, 0), m += E; } function S(y) { const b = g, E = new Ee(), T = new D(); let L = 0; const B = y === !0 ? e : t, x = y === !0 ? 1 : -1; for (let U = 1; U <= i; U++) - d.push(0, m * x, 0), f.push(0, x, 0), h.push(0.5, 0.5), g++; + d.push(0, p * x, 0), f.push(0, x, 0), h.push(0.5, 0.5), g++; const A = g; for (let U = 0; U <= i; U++) { const P = U / i * l + a, I = Math.cos(P), z = Math.sin(P); - T.x = B * z, T.y = m * x, T.z = B * I, d.push(T.x, T.y, T.z), f.push(0, x, 0), E.x = I * 0.5 + 0.5, E.y = z * 0.5 * x + 0.5, h.push(E.x, E.y), g++; + T.x = B * z, T.y = p * x, T.z = B * I, d.push(T.x, T.y, T.z), f.push(0, x, 0), E.x = I * 0.5 + 0.5, E.y = z * 0.5 * x + 0.5, h.push(E.x, E.y), g++; } for (let U = 0; U < i; U++) { const N = b + U, P = A + U; y === !0 ? u.push(P, P + 1, N) : u.push(P + 1, P, N), L += 3; } - c.addGroup(p, L, y === !0 ? 1 : 2), p += L; + c.addGroup(m, L, y === !0 ? 1 : 2), m += L; } } copy(e) { @@ -14973,23 +14973,23 @@ class br extends sn { }, t = Math.max(3, Math.floor(t)), n = Math.max(2, Math.floor(n)); const l = Math.min(o + a, Math.PI); let c = 0; - const u = [], d = new D(), f = new D(), h = [], g = [], _ = [], m = []; - for (let p = 0; p <= n; p++) { - const v = [], S = p / n; + const u = [], d = new D(), f = new D(), h = [], g = [], _ = [], p = []; + for (let m = 0; m <= n; m++) { + const v = [], S = m / n; let y = 0; - p === 0 && o === 0 ? y = 0.5 / t : p === n && l === Math.PI && (y = -0.5 / t); + m === 0 && o === 0 ? y = 0.5 / t : m === n && l === Math.PI && (y = -0.5 / t); for (let b = 0; b <= t; b++) { const E = b / t; - d.x = -e * Math.cos(i + E * r) * Math.sin(o + S * a), d.y = e * Math.cos(o + S * a), d.z = e * Math.sin(i + E * r) * Math.sin(o + S * a), g.push(d.x, d.y, d.z), f.copy(d).normalize(), _.push(f.x, f.y, f.z), m.push(E + y, 1 - S), v.push(c++); + d.x = -e * Math.cos(i + E * r) * Math.sin(o + S * a), d.y = e * Math.cos(o + S * a), d.z = e * Math.sin(i + E * r) * Math.sin(o + S * a), g.push(d.x, d.y, d.z), f.copy(d).normalize(), _.push(f.x, f.y, f.z), p.push(E + y, 1 - S), v.push(c++); } u.push(v); } - for (let p = 0; p < n; p++) + for (let m = 0; m < n; m++) for (let v = 0; v < t; v++) { - const S = u[p][v + 1], y = u[p][v], b = u[p + 1][v], E = u[p + 1][v + 1]; - (p !== 0 || o > 0) && h.push(S, y, E), (p !== n - 1 || l < Math.PI) && h.push(y, b, E); + const S = u[m][v + 1], y = u[m][v], b = u[m + 1][v], E = u[m + 1][v + 1]; + (m !== 0 || o > 0) && h.push(S, y, E), (m !== n - 1 || l < Math.PI) && h.push(y, b, E); } - this.setIndex(h), this.setAttribute("position", new Yt(g, 3)), this.setAttribute("normal", new Yt(_, 3)), this.setAttribute("uv", new Yt(m, 2)); + this.setIndex(h), this.setAttribute("position", new Yt(g, 3)), this.setAttribute("normal", new Yt(_, 3)), this.setAttribute("uv", new Yt(p, 2)); } copy(e) { return super.copy(e), this.parameters = Object.assign({}, e.parameters), this; @@ -15111,20 +15111,20 @@ const Aa = function() { const _ = []; for (; !r; ) try { - const { value: m, done: p } = await d.read(); - if (p) { - if (e && e(100, "100%", m, g), t) { + const { value: p, done: m } = await d.read(); + if (m) { + if (e && e(100, "100%", p, g), t) { const y = new Blob(_).arrayBuffer(); l(y); } else l(); break; } - f += m.length; + f += p.length; let v, S; - g !== void 0 && (v = f / g * 100, S = `${v.toFixed(2)}%`), t && _.push(m), e && e(v, S, m, g) && (t = !1); - } catch (m) { - c(m); + g !== void 0 && (v = f / g * 100, S = `${v.toFixed(2)}%`), t && _.push(p), e && e(v, S, p, g) && (t = !1); + } catch (p) { + c(p); break; } }); @@ -15171,10 +15171,10 @@ const Aa = function() { return this.addSplat(e), e; } addSplatFromComonents(e, t, n, i, r, o, a, l, c, u, d, f, h, g, ..._) { - const m = [e, t, n, i, r, o, a, l, c, u, d, f, h, g, ...this.defaultSphericalHarmonics]; - for (let p = 0; p < _.length && p < this.sphericalHarmonicsCount; p++) - m[p] = _[p]; - return this.addSplat(m), m; + const p = [e, t, n, i, r, o, a, l, c, u, d, f, h, g, ...this.defaultSphericalHarmonics]; + for (let m = 0; m < _.length && m < this.sphericalHarmonicsCount; m++) + p[m] = _[m]; + return this.addSplat(p), p; } addSplatFromArray(e, t) { const n = e.splats[t], i = Rs.createSplat(this.sphericalHarmonicsDegree); @@ -15255,7 +15255,7 @@ const mr = rt.SphericalHarmonics8BitCompressionRange / 2, gt = Fs.toHalfFloat.bi le(this, "fillSphericalHarmonicsArray", function() { for (let x = 0; x < 15; x++) new D(); - const e = new Ue(), t = [], n = [], i = [], r = [], o = [], a = [], l = [], c = [], u = [], d = [], f = [], h = [], g = [], _ = [], m = [], p = [], v = [], S = [], y = (x) => x, b = (x, A, U, N) => { + const e = new Ue(), t = [], n = [], i = [], r = [], o = [], a = [], l = [], c = [], u = [], d = [], f = [], h = [], g = [], _ = [], p = [], m = [], v = [], S = [], y = (x) => x, b = (x, A, U, N) => { x[0] = A, x[1] = U, x[2] = N; }, E = (x, A, U, N, P) => { x[0] = ct(A, N, P, !0), x[1] = ct(A, N + U, P, !0), x[2] = ct(A, N + U + U, P, !0); @@ -15272,7 +15272,7 @@ const mr = rt.SphericalHarmonics8BitCompressionRange / 2, gt = Fs.toHalfFloat.bi A = Math.min(A, Q.sphericalHarmonicsDegree); const te = Us(A), fe = G - Q.splatCountOffset, ne = Q.bytesPerSplat * fe + $.CompressionLevels[this.compressionLevel].SphericalHarmonicsOffsetBytes, V = new DataView(this.bufferData, Q.dataBase + ne), J = (G - N + I) * te; let se = U ? 0 : this.compressionLevel, Ae = y; - se !== z && (se === 1 ? z === 0 ? Ae = ou : z == 2 && (Ae = r_) : se === 0 && (z === 1 ? Ae = gt : z == 2 && (Ae = gr))), A >= 1 && (E(u, V, 3, 0, this.compressionLevel), E(d, V, 3, 1, this.compressionLevel), E(f, V, 3, 2, this.compressionLevel), U ? (B(u, u, this.compressionLevel), B(d, d, this.compressionLevel), B(f, f, this.compressionLevel), $.rotateSphericalHarmonics3(u, d, f, t, n, i, _, m, p)) : (T(u, _), T(d, m), T(f, p)), L(_, x, J, Ae), L(m, x, J + 3, Ae), L(p, x, J + 6, Ae), A >= 2 && (E(u, V, 5, 9, this.compressionLevel), E(d, V, 5, 10, this.compressionLevel), E(f, V, 5, 11, this.compressionLevel), E(h, V, 5, 12, this.compressionLevel), E(g, V, 5, 13, this.compressionLevel), U ? (B(u, u, this.compressionLevel), B(d, d, this.compressionLevel), B(f, f, this.compressionLevel), B(h, h, this.compressionLevel), B(g, g, this.compressionLevel), $.rotateSphericalHarmonics5( + se !== z && (se === 1 ? z === 0 ? Ae = ou : z == 2 && (Ae = r_) : se === 0 && (z === 1 ? Ae = gt : z == 2 && (Ae = gr))), A >= 1 && (E(u, V, 3, 0, this.compressionLevel), E(d, V, 3, 1, this.compressionLevel), E(f, V, 3, 2, this.compressionLevel), U ? (B(u, u, this.compressionLevel), B(d, d, this.compressionLevel), B(f, f, this.compressionLevel), $.rotateSphericalHarmonics3(u, d, f, t, n, i, _, p, m)) : (T(u, _), T(d, p), T(f, m)), L(_, x, J, Ae), L(p, x, J + 3, Ae), L(m, x, J + 6, Ae), A >= 2 && (E(u, V, 5, 9, this.compressionLevel), E(d, V, 5, 10, this.compressionLevel), E(f, V, 5, 11, this.compressionLevel), E(h, V, 5, 12, this.compressionLevel), E(g, V, 5, 13, this.compressionLevel), U ? (B(u, u, this.compressionLevel), B(d, d, this.compressionLevel), B(f, f, this.compressionLevel), B(h, h, this.compressionLevel), B(g, g, this.compressionLevel), $.rotateSphericalHarmonics5( u, d, f, @@ -15287,11 +15287,11 @@ const mr = rt.SphericalHarmonics8BitCompressionRange / 2, gt = Fs.toHalfFloat.bi l, c, _, - m, p, + m, v, S - )) : (T(u, _), T(d, m), T(f, p), T(h, v), T(g, S)), L(_, x, J + 9, Ae), L(m, x, J + 12, Ae), L(p, x, J + 15, Ae), L(v, x, J + 18, Ae), L(S, x, J + 21, Ae))); + )) : (T(u, _), T(d, p), T(f, m), T(h, v), T(g, S)), L(_, x, J + 9, Ae), L(p, x, J + 12, Ae), L(m, x, J + 15, Ae), L(v, x, J + 18, Ae), L(S, x, J + 21, Ae))); } }; }()); @@ -15352,12 +15352,12 @@ const mr = rt.SphericalHarmonics8BitCompressionRange / 2, gt = Fs.toHalfFloat.bi n = n || 0, i = i || o - 1, r === void 0 && (r = n); const a = new D(); for (let l = n; l <= i; l++) { - const c = this.globalSplatIndexToSectionMap[l], u = this.sections[c], d = l - u.splatCountOffset, f = (l - n + r) * $.CenterComponentCount, h = u.bytesPerSplat * d, g = new DataView(this.bufferData, u.dataBase + h), _ = ct(g, 0, this.compressionLevel), m = ct(g, 1, this.compressionLevel), p = ct(g, 2, this.compressionLevel); + const c = this.globalSplatIndexToSectionMap[l], u = this.sections[c], d = l - u.splatCountOffset, f = (l - n + r) * $.CenterComponentCount, h = u.bytesPerSplat * d, g = new DataView(this.bufferData, u.dataBase + h), _ = ct(g, 0, this.compressionLevel), p = ct(g, 1, this.compressionLevel), m = ct(g, 2, this.compressionLevel); if (this.compressionLevel >= 1) { const S = this.getBucketIndex(u, d) * $.BucketStorageSizeFloats, y = u.compressionScaleFactor, b = u.compressionScaleRange; - a.x = (_ - b) * y + u.bucketArray[S], a.y = (m - b) * y + u.bucketArray[S + 1], a.z = (p - b) * y + u.bucketArray[S + 2]; + a.x = (_ - b) * y + u.bucketArray[S], a.y = (p - b) * y + u.bucketArray[S + 1], a.z = (m - b) * y + u.bucketArray[S + 2]; } else - a.x = _, a.y = m, a.z = p; + a.x = _, a.y = p, a.z = m; t && a.applyMatrix4(t), e[f] = a.x, e[f + 1] = a.y, e[f + 2] = a.z; } } @@ -15365,16 +15365,16 @@ const mr = rt.SphericalHarmonics8BitCompressionRange / 2, gt = Fs.toHalfFloat.bi const a = this.splatCount, l = new D(), c = new St(); n = n || 0, i = i || a - 1, r === void 0 && (r = n); for (let u = n; u <= i; u++) { - const d = this.globalSplatIndexToSectionMap[u], f = this.sections[d], h = u - f.splatCountOffset, g = (u - n + r) * $.CovarianceComponentCount, _ = f.bytesPerSplat * h + $.CompressionLevels[this.compressionLevel].ScaleOffsetBytes, m = new DataView(this.bufferData, f.dataBase + _); + const d = this.globalSplatIndexToSectionMap[u], f = this.sections[d], h = u - f.splatCountOffset, g = (u - n + r) * $.CovarianceComponentCount, _ = f.bytesPerSplat * h + $.CompressionLevels[this.compressionLevel].ScaleOffsetBytes, p = new DataView(this.bufferData, f.dataBase + _); l.set( - Tt(ct(m, 0, this.compressionLevel), this.compressionLevel), - Tt(ct(m, 1, this.compressionLevel), this.compressionLevel), - Tt(ct(m, 2, this.compressionLevel), this.compressionLevel) + Tt(ct(p, 0, this.compressionLevel), this.compressionLevel), + Tt(ct(p, 1, this.compressionLevel), this.compressionLevel), + Tt(ct(p, 2, this.compressionLevel), this.compressionLevel) ), c.set( - Tt(ct(m, 4, this.compressionLevel), this.compressionLevel), - Tt(ct(m, 5, this.compressionLevel), this.compressionLevel), - Tt(ct(m, 6, this.compressionLevel), this.compressionLevel), - Tt(ct(m, 3, this.compressionLevel), this.compressionLevel) + Tt(ct(p, 4, this.compressionLevel), this.compressionLevel), + Tt(ct(p, 5, this.compressionLevel), this.compressionLevel), + Tt(ct(p, 6, this.compressionLevel), this.compressionLevel), + Tt(ct(p, 3, this.compressionLevel), this.compressionLevel) ), $.computeCovariance(l, c, t, e, g, o); } } @@ -15411,12 +15411,12 @@ const mr = rt.SphericalHarmonics8BitCompressionRange / 2, gt = Fs.toHalfFloat.bi static parseSectionHeaders(e, t, n = 0, i) { const r = e.compressionLevel, o = e.maxSectionCount, a = new Uint16Array(t, n, o * $.SectionHeaderSizeBytes / 2), l = new Uint32Array(t, n, o * $.SectionHeaderSizeBytes / 4), c = new Float32Array(t, n, o * $.SectionHeaderSizeBytes / 4), u = []; let d = 0, f = d / 2, h = d / 4, g = $.HeaderSizeBytes + e.maxSectionCount * $.SectionHeaderSizeBytes, _ = 0; - for (let m = 0; m < o; m++) { - const p = l[h + 1], v = l[h + 2], S = l[h + 3], y = c[h + 4], b = y / 2, E = a[f + 10], T = l[h + 6] || $.CompressionLevels[r].ScaleRange, L = l[h + 8], B = l[h + 9], x = B * 4, A = E * S + x, U = a[f + 20], { bytesPerSplat: N } = $.calculateComponentStorage(r, U), P = N * p, I = P + A, z = { + for (let p = 0; p < o; p++) { + const m = l[h + 1], v = l[h + 2], S = l[h + 3], y = c[h + 4], b = y / 2, E = a[f + 10], T = l[h + 6] || $.CompressionLevels[r].ScaleRange, L = l[h + 8], B = l[h + 9], x = B * 4, A = E * S + x, U = a[f + 20], { bytesPerSplat: N } = $.calculateComponentStorage(r, U), P = N * m, I = P + A, z = { bytesPerSplat: N, splatCountOffset: _, - splatCount: i ? p : 0, - maxSplatCount: p, + splatCount: i ? m : 0, + maxSplatCount: m, bucketSize: v, bucketCount: S, bucketBlockSize: y, @@ -15434,7 +15434,7 @@ const mr = rt.SphericalHarmonics8BitCompressionRange / 2, gt = Fs.toHalfFloat.bi partiallyFilledBucketCount: B, sphericalHarmonicsDegree: U }; - u[m] = z, g += I, d += $.SectionHeaderSizeBytes, f = d / 2, h = d / 4, _ += p; + u[p] = z, g += I, d += $.SectionHeaderSizeBytes, f = d / 2, h = d / 4, _ += m; } return u; } @@ -15519,8 +15519,8 @@ const mr = rt.SphericalHarmonics8BitCompressionRange / 2, gt = Fs.toHalfFloat.bi bytesPerColor: h, sphericalHarmonicsComponentsPerSplat: g, sphericalHarmonicsBytesPerSplat: _, - bytesPerSplat: m - } = $.calculateComponentStorage(n, c), p = $.CompressionLevels[n].ScaleRange, v = [], S = []; + bytesPerSplat: p + } = $.calculateComponentStorage(n, c), m = $.CompressionLevels[n].ScaleRange, v = [], S = []; let y = 0; const b = new St(); for (let A = 0; A < e.length; A++) { @@ -15530,14 +15530,14 @@ const mr = rt.SphericalHarmonics8BitCompressionRange / 2, gt = Fs.toHalfFloat.bi let w; Ke[ee.OFFSET.OPACITY] ? w = Ke[ee.OFFSET.OPACITY] : w = 255, w >= t && z.addSplat(Ke); } - const K = $.computeBucketsForUncompressedSplatArray(z, P, I), G = K.fullBuckets.length, q = K.partiallyFullBuckets.map((we) => we.splats.length), Q = q.length, te = [...K.fullBuckets, ...K.partiallyFullBuckets], fe = z.splats.length * m, ne = Q * 4, V = n >= 1 ? te.length * $.BucketStorageSizeBytes + ne : 0, J = fe + V, se = new ArrayBuffer(J), Ae = P / 2, xe = p / Ae, ge = p * 2 + 1, Qe = new ArrayBuffer(u), Re = new ArrayBuffer(d), O = new ArrayBuffer(f), Je = new ArrayBuffer(h), Te = new ArrayBuffer(_), Ie = new D(), Me = new D(); + const K = $.computeBucketsForUncompressedSplatArray(z, P, I), G = K.fullBuckets.length, q = K.partiallyFullBuckets.map((we) => we.splats.length), Q = q.length, te = [...K.fullBuckets, ...K.partiallyFullBuckets], fe = z.splats.length * p, ne = Q * 4, V = n >= 1 ? te.length * $.BucketStorageSizeBytes + ne : 0, J = fe + V, se = new ArrayBuffer(J), Ae = P / 2, xe = m / Ae, ge = m * 2 + 1, Qe = new ArrayBuffer(u), Re = new ArrayBuffer(d), O = new ArrayBuffer(f), Je = new ArrayBuffer(h), Te = new ArrayBuffer(_), Ie = new D(), Me = new D(); let ze = 0; for (let we = 0; we < te.length; we++) { const Ke = te[we]; Ie.fromArray(Ke.center); for (let w = 0; w < Ke.splats.length; w++) { let M = Ke.splats[w]; - const k = z.splats[M], Z = V + ze * m, re = Z + u, ie = re + d, Be = ie + f, Pe = Be + h; + const k = z.splats[M], Z = V + ze * p, re = Z + u, ie = re + d, Be = ie + f, Pe = Be + h; if (n === 0) { const de = new Float32Array(se, Z, $.CenterComponentCount), De = new Float32Array(se, ie, $.RotationComponentCount), R = new Float32Array(se, re, $.ScaleComponentCount); if (k[ee.OFFSET.SCALE0] !== void 0 ? (b.set( @@ -15583,7 +15583,7 @@ const mr = rt.SphericalHarmonics8BitCompressionRange / 2, gt = Fs.toHalfFloat.bi k[ee.OFFSET.X], k[ee.OFFSET.Y], k[ee.OFFSET.Z] - ).sub(Ie), Me.x = Math.round(Me.x * xe) + p, Me.x = qt(Me.x, 0, ge), Me.y = Math.round(Me.y * xe) + p, Me.y = qt(Me.y, 0, ge), Me.z = Math.round(Me.z * xe) + p, Me.z = qt(Me.z, 0, ge), de.set([Me.x, Me.y, Me.z]), c > 0) { + ).sub(Ie), Me.x = Math.round(Me.x * xe) + m, Me.x = qt(Me.x, 0, ge), Me.y = Math.round(Me.y * xe) + m, Me.y = qt(Me.y, 0, ge), Me.z = Math.round(Me.z * xe) + m, Me.z = qt(Me.z, 0, ge), de.set([Me.x, Me.y, Me.z]), c > 0) { const ue = n === 1 ? Uint16Array : Uint8Array, Se = n === 1 ? 2 : 1, me = new ue(Te, 0, g); if (c >= 1) { for (let ve = 0; ve < 9; ve++) { @@ -15639,7 +15639,7 @@ const mr = rt.SphericalHarmonics8BitCompressionRange / 2, gt = Fs.toHalfFloat.bi bucketSize: I, bucketCount: te.length, bucketBlockSize: P, - compressionScaleRange: p, + compressionScaleRange: m, storageSizeBytes: J, fullBucketCount: G, partiallyFilledBucketCount: Q, @@ -15671,20 +15671,20 @@ const mr = rt.SphericalHarmonics8BitCompressionRange / 2, gt = Fs.toHalfFloat.bi let i = e.splatCount; const r = t / 2, o = new D(), a = new D(); for (let _ = 0; _ < i; _++) { - const m = e.splats[_], p = [ - m[ee.OFFSET.X], - m[ee.OFFSET.Y], - m[ee.OFFSET.Z] + const p = e.splats[_], m = [ + p[ee.OFFSET.X], + p[ee.OFFSET.Y], + p[ee.OFFSET.Z] ]; - (_ === 0 || p[0] < o.x) && (o.x = p[0]), (_ === 0 || p[0] > a.x) && (a.x = p[0]), (_ === 0 || p[1] < o.y) && (o.y = p[1]), (_ === 0 || p[1] > a.y) && (a.y = p[1]), (_ === 0 || p[2] < o.z) && (o.z = p[2]), (_ === 0 || p[2] > a.z) && (a.z = p[2]); + (_ === 0 || m[0] < o.x) && (o.x = m[0]), (_ === 0 || m[0] > a.x) && (a.x = m[0]), (_ === 0 || m[1] < o.y) && (o.y = m[1]), (_ === 0 || m[1] > a.y) && (a.y = m[1]), (_ === 0 || m[2] < o.z) && (o.z = m[2]), (_ === 0 || m[2] > a.z) && (a.z = m[2]); } const l = new D().copy(a).sub(o), c = Math.ceil(l.y / t), u = Math.ceil(l.z / t), d = new D(), f = [], h = {}; for (let _ = 0; _ < i; _++) { - const m = e.splats[_], p = [ - m[ee.OFFSET.X], - m[ee.OFFSET.Y], - m[ee.OFFSET.Z] - ], v = Math.floor((p[0] - o.x) / t), S = Math.floor((p[1] - o.y) / t), y = Math.floor((p[2] - o.z) / t); + const p = e.splats[_], m = [ + p[ee.OFFSET.X], + p[ee.OFFSET.Y], + p[ee.OFFSET.Z] + ], v = Math.floor((m[0] - o.x) / t), S = Math.floor((m[1] - o.y) / t), y = Math.floor((m[2] - o.z) / t); d.x = v * t + o.x + r, d.y = S * t + o.y + r, d.z = y * t + o.z + r; const b = v * (c * u) + S * u + y; let E = h[b]; @@ -15696,8 +15696,8 @@ const mr = rt.SphericalHarmonics8BitCompressionRange / 2, gt = Fs.toHalfFloat.bi const g = []; for (let _ in h) if (h.hasOwnProperty(_)) { - const m = h[_]; - m && g.push(m); + const p = h[_]; + p && g.push(p); } return { fullBuckets: f, @@ -15777,9 +15777,9 @@ le($, "CurrentMajorVersion", 0), le($, "CurrentMinorVersion", 1), le($, "CenterC $.addInto3(e[0] * l, e[1] * l, e[2] * l, a), $.addInto3(t[0] * c, t[1] * c, t[2] * c, a), $.addInto3(n[0] * u, n[1] * u, n[2] * u, a), $.addInto3(i[0] * d, i[1] * d, i[2] * d, a), $.addInto3(r[0] * f, r[1] * f, r[2] * f, a); }), le($, "rotateSphericalHarmonics3", (e, t, n, i, r, o, a, l, c) => { $.dot3(e, t, n, i, a), $.dot3(e, t, n, r, l), $.dot3(e, t, n, o, c); -}), le($, "rotateSphericalHarmonics5", (e, t, n, i, r, o, a, l, c, u, d, f, h, g, _, m, p, v) => { +}), le($, "rotateSphericalHarmonics5", (e, t, n, i, r, o, a, l, c, u, d, f, h, g, _, p, m, v) => { const S = Math.sqrt(0.25), y = Math.sqrt(3 / 4), b = Math.sqrt(1 / 3), E = Math.sqrt(4 / 3), T = Math.sqrt(1 / 12); - c[0] = S * (l[2] * o[0] + l[0] * o[2] + (o[2] * l[0] + o[0] * l[2])), c[1] = l[1] * o[0] + o[1] * l[0], c[2] = y * (l[1] * o[1] + o[1] * l[1]), c[3] = l[1] * o[2] + o[1] * l[2], c[4] = S * (l[2] * o[2] - l[0] * o[0] + (o[2] * l[2] - o[0] * l[0])), $.dot5(e, t, n, i, r, c, g), u[0] = S * (a[2] * o[0] + a[0] * o[2] + (o[2] * a[0] + o[0] * a[2])), u[1] = a[1] * o[0] + o[1] * a[0], u[2] = y * (a[1] * o[1] + o[1] * a[1]), u[3] = a[1] * o[2] + o[1] * a[2], u[4] = S * (a[2] * o[2] - a[0] * o[0] + (o[2] * a[2] - o[0] * a[0])), $.dot5(e, t, n, i, r, u, _), d[0] = b * (a[2] * a[0] + a[0] * a[2]) + -T * (l[2] * l[0] + l[0] * l[2] + (o[2] * o[0] + o[0] * o[2])), d[1] = E * a[1] * a[0] + -b * (l[1] * l[0] + o[1] * o[0]), d[2] = a[1] * a[1] + -S * (l[1] * l[1] + o[1] * o[1]), d[3] = E * a[1] * a[2] + -b * (l[1] * l[2] + o[1] * o[2]), d[4] = b * (a[2] * a[2] - a[0] * a[0]) + -T * (l[2] * l[2] - l[0] * l[0] + (o[2] * o[2] - o[0] * o[0])), $.dot5(e, t, n, i, r, d, m), f[0] = S * (a[2] * l[0] + a[0] * l[2] + (l[2] * a[0] + l[0] * a[2])), f[1] = a[1] * l[0] + l[1] * a[0], f[2] = y * (a[1] * l[1] + l[1] * a[1]), f[3] = a[1] * l[2] + l[1] * a[2], f[4] = S * (a[2] * l[2] - a[0] * l[0] + (l[2] * a[2] - l[0] * a[0])), $.dot5(e, t, n, i, r, f, p), h[0] = S * (l[2] * l[0] + l[0] * l[2] - (o[2] * o[0] + o[0] * o[2])), h[1] = l[1] * l[0] - o[1] * o[0], h[2] = y * (l[1] * l[1] - o[1] * o[1]), h[3] = l[1] * l[2] - o[1] * o[2], h[4] = S * (l[2] * l[2] - l[0] * l[0] - (o[2] * o[2] - o[0] * o[0])), $.dot5(e, t, n, i, r, h, v); + c[0] = S * (l[2] * o[0] + l[0] * o[2] + (o[2] * l[0] + o[0] * l[2])), c[1] = l[1] * o[0] + o[1] * l[0], c[2] = y * (l[1] * o[1] + o[1] * l[1]), c[3] = l[1] * o[2] + o[1] * l[2], c[4] = S * (l[2] * o[2] - l[0] * o[0] + (o[2] * l[2] - o[0] * l[0])), $.dot5(e, t, n, i, r, c, g), u[0] = S * (a[2] * o[0] + a[0] * o[2] + (o[2] * a[0] + o[0] * a[2])), u[1] = a[1] * o[0] + o[1] * a[0], u[2] = y * (a[1] * o[1] + o[1] * a[1]), u[3] = a[1] * o[2] + o[1] * a[2], u[4] = S * (a[2] * o[2] - a[0] * o[0] + (o[2] * a[2] - o[0] * a[0])), $.dot5(e, t, n, i, r, u, _), d[0] = b * (a[2] * a[0] + a[0] * a[2]) + -T * (l[2] * l[0] + l[0] * l[2] + (o[2] * o[0] + o[0] * o[2])), d[1] = E * a[1] * a[0] + -b * (l[1] * l[0] + o[1] * o[0]), d[2] = a[1] * a[1] + -S * (l[1] * l[1] + o[1] * o[1]), d[3] = E * a[1] * a[2] + -b * (l[1] * l[2] + o[1] * o[2]), d[4] = b * (a[2] * a[2] - a[0] * a[0]) + -T * (l[2] * l[2] - l[0] * l[0] + (o[2] * o[2] - o[0] * o[0])), $.dot5(e, t, n, i, r, d, p), f[0] = S * (a[2] * l[0] + a[0] * l[2] + (l[2] * a[0] + l[0] * a[2])), f[1] = a[1] * l[0] + l[1] * a[0], f[2] = y * (a[1] * l[1] + l[1] * a[1]), f[3] = a[1] * l[2] + l[1] * a[2], f[4] = S * (a[2] * l[2] - a[0] * l[0] + (l[2] * a[2] - l[0] * a[0])), $.dot5(e, t, n, i, r, f, m), h[0] = S * (l[2] * l[0] + l[0] * l[2] - (o[2] * o[0] + o[0] * o[2])), h[1] = l[1] * l[0] - o[1] * o[0], h[2] = y * (l[1] * l[1] - o[1] * o[1]), h[3] = l[1] * l[2] - o[1] * o[2], h[4] = S * (l[2] * l[2] - l[0] * l[0] - (o[2] * o[2] - o[0] * o[0])), $.dot5(e, t, n, i, r, h, v); }); let be = $; const Xl = new Uint8Array([112, 108, 121, 10]), ql = new Uint8Array([10, 101, 110, 100, 95, 104, 101, 97, 100, 101, 114, 10]), Ta = "end_header", ba = /* @__PURE__ */ new Map([ @@ -15951,7 +15951,7 @@ const Xl = new Uint8Array([112, 108, 121, 10]), ql = new Uint8Array([10, 101, 11 }; } static getElementStorageArrays(e, t) { - const n = Dt(e, "min_x"), i = Dt(e, "min_y"), r = Dt(e, "min_z"), o = Dt(e, "max_x"), a = Dt(e, "max_y"), l = Dt(e, "max_z"), c = Dt(e, "min_scale_x"), u = Dt(e, "min_scale_y"), d = Dt(e, "min_scale_z"), f = Dt(e, "max_scale_x"), h = Dt(e, "max_scale_y"), g = Dt(e, "max_scale_z"), _ = Dt(t, "packed_position"), m = Dt(t, "packed_rotation"), p = Dt(t, "packed_scale"), v = Dt(t, "packed_color"); + const n = Dt(e, "min_x"), i = Dt(e, "min_y"), r = Dt(e, "min_z"), o = Dt(e, "max_x"), a = Dt(e, "max_y"), l = Dt(e, "max_z"), c = Dt(e, "min_scale_x"), u = Dt(e, "min_scale_y"), d = Dt(e, "min_scale_z"), f = Dt(e, "max_scale_x"), h = Dt(e, "max_scale_y"), g = Dt(e, "max_scale_z"), _ = Dt(t, "packed_position"), p = Dt(t, "packed_rotation"), m = Dt(t, "packed_scale"), v = Dt(t, "packed_color"); return { positionExtremes: { minX: n, @@ -15970,22 +15970,22 @@ const Xl = new Uint8Array([112, 108, 121, 10]), ql = new Uint8Array([10, 101, 11 maxScaleZ: g }, position: _, - rotation: m, - scale: p, + rotation: p, + scale: m, color: v }; } static parseToUncompressedSplatBufferSection(e, t, n, i, r, o, a, l, c, u = null) { Xt.readElementData(t, o, a, n, i, u); - const d = be.CompressionLevels[0].BytesPerCenter, f = be.CompressionLevels[0].BytesPerScale, h = be.CompressionLevels[0].BytesPerRotation, g = be.CompressionLevels[0].SphericalHarmonicsDegrees[0].BytesPerSplat, { positionExtremes: _, scaleExtremes: m, position: p, rotation: v, scale: S, color: y } = Xt.getElementStorageArrays(e, t), b = ee.OFFSET, E = ee.createSplat(); + const d = be.CompressionLevels[0].BytesPerCenter, f = be.CompressionLevels[0].BytesPerScale, h = be.CompressionLevels[0].BytesPerRotation, g = be.CompressionLevels[0].SphericalHarmonicsDegrees[0].BytesPerSplat, { positionExtremes: _, scaleExtremes: p, position: m, rotation: v, scale: S, color: y } = Xt.getElementStorageArrays(e, t), b = ee.OFFSET, E = ee.createSplat(); for (let T = n; T <= i; ++T) { Xt.decompressSplat( T, r, - p, + m, _, S, - m, + p, v, y, E @@ -16025,20 +16025,20 @@ const ut = class ut { const t = e.split(` `), n = []; let i = 0, r = {}, o = !1; - for (let m = 0; m < t.length; m++) { - const p = t[m].trim(); - if (n.push(p), p.startsWith("element chunk") || p.match(/[A-Za-z]*packed_[A-Za-z]*/)) + for (let p = 0; p < t.length; p++) { + const m = t[p].trim(); + if (n.push(m), m.startsWith("element chunk") || m.match(/[A-Za-z]*packed_[A-Za-z]*/)) o = !0; - else if (p.startsWith("element vertex")) { - const v = p.match(/\d+/); + else if (m.startsWith("element vertex")) { + const v = m.match(/\d+/); v && (i = parseInt(v[0])); - } else if (p.startsWith("property")) { - const v = p.match(/(\w+)\s+(\w+)\s+(\w+)/); + } else if (m.startsWith("property")) { + const v = m.match(/(\w+)\s+(\w+)\s+(\w+)/); if (v) { const S = v[2], y = v[3]; r[y] = S; } - } else if (p === ut.HeaderEndToken) + } else if (m === ut.HeaderEndToken) break; } let a = 0, l = {}; @@ -16051,28 +16051,28 @@ const ut = class ut { ushort: 2, uchar: 1 }, u = []; - for (let m in r) - if (r.hasOwnProperty(m)) { - u.push(m); - const p = r[m]; - l[m] = a, a += c[p]; + for (let p in r) + if (r.hasOwnProperty(p)) { + u.push(p); + const m = r[p]; + l[p] = a, a += c[m]; } let d = 0, f = 0; - for (let m of u) - m.startsWith("f_rest") && d++; + for (let p of u) + p.startsWith("f_rest") && d++; f = d / 3; let h = 0; f >= 3 && (h = 1), f >= 8 && (h = 2); let g = []; if (h >= 1) - for (let m = 0; m < 3; m++) - for (let p = 0; p < 3; p++) - g.push("f_rest_" + (p + f * m)); + for (let p = 0; p < 3; p++) + for (let m = 0; m < 3; m++) + g.push("f_rest_" + (m + f * p)); let _ = []; if (h >= 2) - for (let m = 0; m < 3; m++) - for (let p = 0; p < 5; p++) - _.push("f_rest_" + (p + f * m + 3)); + for (let p = 0; p < 3; p++) + for (let m = 0; m < 5; m++) + _.push("f_rest_" + (m + f * p + 3)); return { splatCount: i, propertyTypes: r, @@ -16115,11 +16115,11 @@ const ut = class ut { l = Math.min(l, e.sphericalHarmonicsDegree); const c = be.CompressionLevels[0].BytesPerCenter, u = be.CompressionLevels[0].BytesPerScale, d = be.CompressionLevels[0].BytesPerRotation, f = be.CompressionLevels[0].BytesPerColor, h = be.CompressionLevels[0].SphericalHarmonicsDegrees[l].BytesPerSplat; for (let g = t; g <= n; g++) { - const _ = ut.parseToUncompressedSplat(i, g, e, r, l), m = g * h + a, p = new Float32Array(o, m, 3), v = new Float32Array(o, m + c, 3), S = new Float32Array(o, m + c + u, 4), y = new Uint8Array(o, m + c + u + d, 4); - if (p[0] = _[ee.OFFSET.X], p[1] = _[ee.OFFSET.Y], p[2] = _[ee.OFFSET.Z], v[0] = _[ee.OFFSET.SCALE0], v[1] = _[ee.OFFSET.SCALE1], v[2] = _[ee.OFFSET.SCALE2], S[0] = _[ee.OFFSET.ROTATION0], S[1] = _[ee.OFFSET.ROTATION1], S[2] = _[ee.OFFSET.ROTATION2], S[3] = _[ee.OFFSET.ROTATION3], y[0] = _[ee.OFFSET.FDC0], y[1] = _[ee.OFFSET.FDC1], y[2] = _[ee.OFFSET.FDC2], y[3] = _[ee.OFFSET.OPACITY], l >= 1) { + const _ = ut.parseToUncompressedSplat(i, g, e, r, l), p = g * h + a, m = new Float32Array(o, p, 3), v = new Float32Array(o, p + c, 3), S = new Float32Array(o, p + c + u, 4), y = new Uint8Array(o, p + c + u + d, 4); + if (m[0] = _[ee.OFFSET.X], m[1] = _[ee.OFFSET.Y], m[2] = _[ee.OFFSET.Z], v[0] = _[ee.OFFSET.SCALE0], v[1] = _[ee.OFFSET.SCALE1], v[2] = _[ee.OFFSET.SCALE2], S[0] = _[ee.OFFSET.ROTATION0], S[1] = _[ee.OFFSET.ROTATION1], S[2] = _[ee.OFFSET.ROTATION2], S[3] = _[ee.OFFSET.ROTATION3], y[0] = _[ee.OFFSET.FDC0], y[1] = _[ee.OFFSET.FDC1], y[2] = _[ee.OFFSET.FDC2], y[3] = _[ee.OFFSET.OPACITY], l >= 1) { const b = new Float32Array( o, - m + c + u + d + f, + p + c + u + d + f, _.sphericalHarmonicsCount ); for (let E = 0; E <= 8; E++) @@ -16222,28 +16222,28 @@ class ro { const a = new D(), l = new D(), c = 0.5, u = (_) => { _.x = Math.floor(_.x / c) * c, _.y = Math.floor(_.y / c) * c, _.z = Math.floor(_.z / c) * c; }; - o.splats.sort((_, m) => { + o.splats.sort((_, p) => { a.set( _[ee.OFFSET.X], _[ee.OFFSET.Y], _[ee.OFFSET.Z] ).sub(t), u(a); - const p = a.lengthSq(); + const m = a.lengthSq(); l.set( - m[ee.OFFSET.X], - m[ee.OFFSET.Y], - m[ee.OFFSET.Z] + p[ee.OFFSET.X], + p[ee.OFFSET.Y], + p[ee.OFFSET.Z] ).sub(t), u(l); const v = l.lengthSq(); - return p > v ? 1 : -1; + return m > v ? 1 : -1; }); const d = [], f = []; e = Math.min(o.splatCount, e); const h = Math.ceil(o.splatCount / e); let g = 0; for (let _ = 0; _ < h; _++) { - let m = g; - d.push((p) => p >= m && p < m + e), f.push({ + let p = g; + d.push((m) => m >= p && m < p + e), f.push({ blocksSize: n, bucketSize: i }), g += e; @@ -16304,7 +16304,7 @@ function jl(s, e) { class ao { static loadFromURL(e, t, n, i, r, o, a = 0, l, c, u, d) { const f = rt.StreamingSectionSize, h = be.HeaderSizeBytes + be.SectionHeaderSizeBytes, g = 1; - let _, m, p, v, S = 0, y = 0, b = !1, E = !1, T = !1, L, B = new Promise((G) => { + let _, p, m, v, S = 0, y = 0, b = !1, E = !1, T = !1, L, B = new Promise((G) => { L = G; }), x = 0, A = 0, U = 0, N = "", P = null, I = []; const z = new TextDecoder(); @@ -16324,7 +16324,7 @@ class ao { } else if (N += z.decode(Q), $i.checkTextForEndHeader(N)) { P = $i.decodeHeaderText(N), a = Math.min(a, P.sphericalHarmonicsDegree), T = P.compressed, T ? (P = ss.decodeHeaderText(N), S = P.vertexElement.count) : (S = P.splatCount, E = !0); const fe = be.CompressionLevels[0].SphericalHarmonicsDegrees[a], ne = h + fe.BytesPerSplat * S; - m = new ArrayBuffer(ne), be.writeHeaderToBuffer({ + p = new ArrayBuffer(ne), be.writeHeaderToBuffer({ versionMajor: be.CurrentMajorVersion, versionMinor: be.CurrentMinorVersion, maxSectionCount: g, @@ -16333,7 +16333,7 @@ class ao { splatCount: y, compressionLevel: 0, sceneCenter: new D() - }, m), x = P.headerSizeBytes, A = P.headerSizeBytes, b = !0; + }, p), x = P.headerSizeBytes, A = P.headerSizeBytes, b = !0; } if (b && E) { if (I.length > 0 && (_ = jl(I, _), U - x > f || te)) { @@ -16346,7 +16346,7 @@ class ao { y, ge, 0, - m, + p, Re ) : $i.parseToUncompressedSplatBufferSection( P, @@ -16354,10 +16354,10 @@ class ao { V - 1, ge, 0, - m, + p, Re, a - ), y = Ae, p || (be.writeSectionHeaderToBuffer({ + ), y = Ae, m || (be.writeSectionHeaderToBuffer({ maxSplatCount: S, splatCount: y, bucketSize: 0, @@ -16368,7 +16368,7 @@ class ao { fullBucketCount: 0, partiallyFilledBucketCount: 0, sphericalHarmonicsDegree: a - }, 0, m, be.HeaderSizeBytes), p = new be(m, !1)), p.updateLoadedCounts(1, y), i(p, te), x += f, A += J, se === 0) + }, 0, p, be.HeaderSizeBytes), m = new be(p, !1)), m.updateLoadedCounts(1, y), i(m, te), x += f, A += J, se === 0) I = []; else { let O = [], Je = 0; @@ -16380,7 +16380,7 @@ class ao { I = O; } } - te && L(p); + te && L(m); } } t && t(G, q, Lt.Downloading); @@ -16410,15 +16410,15 @@ const ft = class ft { static parseToUncompressedSplatBufferSection(e, t, n, i, r, o) { const a = be.CompressionLevels[0].BytesPerCenter, l = be.CompressionLevels[0].BytesPerScale, c = be.CompressionLevels[0].BytesPerRotation, u = be.CompressionLevels[0].SphericalHarmonicsDegrees[0].BytesPerSplat; for (let d = e; d <= t; d++) { - const f = d * ft.RowSizeBytes + i, h = new Float32Array(n, f, 3), g = new Float32Array(n, f + ft.CenterSizeBytes, 3), _ = new Uint8Array(n, f + ft.CenterSizeBytes + ft.ScaleSizeBytes, 4), m = new Uint8Array(n, f + ft.CenterSizeBytes + ft.ScaleSizeBytes + ft.RotationSizeBytes, 4), p = new St( - (m[1] - 128) / 128, - (m[2] - 128) / 128, - (m[3] - 128) / 128, - (m[0] - 128) / 128 + const f = d * ft.RowSizeBytes + i, h = new Float32Array(n, f, 3), g = new Float32Array(n, f + ft.CenterSizeBytes, 3), _ = new Uint8Array(n, f + ft.CenterSizeBytes + ft.ScaleSizeBytes, 4), p = new Uint8Array(n, f + ft.CenterSizeBytes + ft.ScaleSizeBytes + ft.RotationSizeBytes, 4), m = new St( + (p[1] - 128) / 128, + (p[2] - 128) / 128, + (p[3] - 128) / 128, + (p[0] - 128) / 128 ); - p.normalize(); + m.normalize(); const v = d * u + o, S = new Float32Array(r, v, 3), y = new Float32Array(r, v + a, 3), b = new Float32Array(r, v + a + l, 4), E = new Uint8Array(r, v + a + l + c, 4); - S[0] = h[0], S[1] = h[1], S[2] = h[2], y[0] = g[0], y[1] = g[1], y[2] = g[2], b[0] = p.w, b[1] = p.x, b[2] = p.y, b[3] = p.z, E[0] = _[0], E[1] = _[1], E[2] = _[2], E[3] = _[3]; + S[0] = h[0], S[1] = h[1], S[2] = h[2], y[0] = g[0], y[1] = g[1], y[2] = g[2], b[0] = m.w, b[1] = m.x, b[2] = m.y, b[3] = m.z, E[0] = _[0], E[1] = _[1], E[2] = _[2], E[3] = _[3]; } } static parseStandardSplatToUncompressedSplatArray(e) { @@ -16455,7 +16455,7 @@ let es = ft; class oo { static loadFromURL(e, t, n, i, r, o, a, l, c, u, d) { const f = be.HeaderSizeBytes + be.SectionHeaderSizeBytes, h = rt.StreamingSectionSize, g = 1; - let _, m, p, v = 0, S = 0, y, b = new Promise((B) => { + let _, p, m, v = 0, S = 0, y, b = new Promise((B) => { y = B; }), E = 0, T = 0; return so(e, (B, x, A, U) => { @@ -16464,7 +16464,7 @@ class oo { if (!_) { v = U / es.RowSizeBytes, _ = new ArrayBuffer(U); const P = be.CompressionLevels[0].SphericalHarmonicsDegrees[0].BytesPerSplat, I = f + P * v; - m = new ArrayBuffer(I), be.writeHeaderToBuffer({ + p = new ArrayBuffer(I), be.writeHeaderToBuffer({ versionMajor: be.CurrentMajorVersion, versionMinor: be.CurrentMinorVersion, maxSectionCount: g, @@ -16473,7 +16473,7 @@ class oo { splatCount: S, compressionLevel: 0, sceneCenter: new D() - }, m); + }, p); } if (A) { new Uint8Array(_, T, A.byteLength).set(new Uint8Array(A)), T += A.byteLength; @@ -16485,9 +16485,9 @@ class oo { K - 1, _, 0, - m, + p, f - ), S = K, p || (be.writeSectionHeaderToBuffer({ + ), S = K, m || (be.writeSectionHeaderToBuffer({ maxSplatCount: v, splatCount: S, bucketSize: 0, @@ -16497,10 +16497,10 @@ class oo { storageSizeBytes: 0, fullBucketCount: 0, partiallyFilledBucketCount: 0 - }, 0, m, be.HeaderSizeBytes), p = new be(m, !1)), p.updateLoadedCounts(1, S), i(p, N), E += h; + }, 0, p, be.HeaderSizeBytes), m = new be(p, !1)), m.updateLoadedCounts(1, S), i(m, N), E += h; } } - N && y(p); + N && y(m); } return t && t(B, x, Lt.Downloading), n; }, !0).then((B) => (t && t(0, "0%", Lt.Processing), (n ? b : oo.loadFromFileData( @@ -16536,7 +16536,7 @@ const ns = class ns { throw new Error(`KSplat version not supported: v${i.versionMajor}.${i.versionMinor}. Minimum required: v${t}.${n}`); } static loadFromURL(e, t, n, i) { - let r, o, a, l, c = !1, u = !1, d, f = [], h = !1, g = !1, _ = 0, m = 0, p = rt.StreamingSectionSize, v = 0, S = !1, y = [], b, E = new Promise((N) => { + let r, o, a, l, c = !1, u = !1, d, f = [], h = !1, g = !1, _ = 0, p = 0, m = rt.StreamingSectionSize, v = 0, S = !1, y = [], b, E = new Promise((N) => { b = N; }); const T = () => { @@ -16582,8 +16582,8 @@ const ns = class ns { if (h) { if (S) return; - if (S = _ >= v, _ - m > p || S) { - m = _, o || (o = new be(r, !1)); + if (S = _ >= v, _ - p > m || S) { + p = _, o || (o = new be(r, !1)); const P = be.HeaderSizeBytes + be.SectionHeaderSizeBytes * l.maxSectionCount; let I = 0, z = 0, K = 0; for (let G = 0; G < l.maxSectionCount; G++) { @@ -16688,7 +16688,7 @@ class cr extends Ti { let r = i.NONE; const o = 1e-6, a = new Wl(), l = new Wl(); let c = 1; - const u = new D(), d = new Ee(), f = new Ee(), h = new Ee(), g = new Ee(), _ = new Ee(), m = new Ee(), p = new Ee(), v = new Ee(), S = new Ee(), y = new D(), b = new Ee(); + const u = new D(), d = new Ee(), f = new Ee(), h = new Ee(), g = new Ee(), _ = new Ee(), p = new Ee(), m = new Ee(), v = new Ee(), S = new Ee(), y = new D(), b = new Ee(); let E = !1; const T = [], L = {}; function B() { @@ -16746,7 +16746,7 @@ class cr extends Ti { d.set(R.clientX, R.clientY); } function te(R) { - G(R), p.set(R.clientX, R.clientY); + G(R), m.set(R.clientX, R.clientY); } function fe(R) { g.set(R.clientX, R.clientY); @@ -16757,10 +16757,10 @@ class cr extends Ti { A(2 * Math.PI * h.x / ue.clientHeight), U(2 * Math.PI * h.y / ue.clientHeight), d.copy(f), n.update(); } function V(R) { - v.set(R.clientX, R.clientY), S.subVectors(v, p), S.y > 0 ? z(x()) : S.y < 0 && K(x()), p.copy(v), n.update(); + v.set(R.clientX, R.clientY), S.subVectors(v, m), S.y > 0 ? z(x()) : S.y < 0 && K(x()), m.copy(v), n.update(); } function J(R) { - _.set(R.clientX, R.clientY), m.subVectors(_, g).multiplyScalar(n.panSpeed), I(m.x, m.y), g.copy(_), n.update(); + _.set(R.clientX, R.clientY), p.subVectors(_, g).multiplyScalar(n.panSpeed), I(p.x, p.y), g.copy(_), n.update(); } function se(R) { G(R), R.deltaY < 0 ? K(x()) : R.deltaY > 0 && z(x()), n.update(); @@ -16801,7 +16801,7 @@ class cr extends Ti { } function Qe() { const R = T[0].pageX - T[1].pageX, ue = T[0].pageY - T[1].pageY, Se = Math.sqrt(R * R + ue * ue); - p.set(0, Se); + m.set(0, Se); } function Re() { n.enableZoom && Qe(), n.enablePan && ge(); @@ -16827,11 +16827,11 @@ class cr extends Ti { const ue = De(R), Se = 0.5 * (R.pageX + ue.x), me = 0.5 * (R.pageY + ue.y); _.set(Se, me); } - m.subVectors(_, g).multiplyScalar(n.panSpeed), I(m.x, m.y), g.copy(_); + p.subVectors(_, g).multiplyScalar(n.panSpeed), I(p.x, p.y), g.copy(_); } function Ie(R) { const ue = De(R), Se = R.pageX - ue.x, me = R.pageY - ue.y, _e = Math.sqrt(Se * Se + me * me); - v.set(0, _e), S.set(0, Math.pow(v.y / p.y, n.zoomSpeed)), z(S.y), p.copy(v); + v.set(0, _e), S.set(0, Math.pow(v.y / m.y, n.zoomSpeed)), z(S.y), m.copy(v); } function Me(R) { n.enableZoom && Ie(R), n.enablePan && Te(R); @@ -17254,12 +17254,12 @@ class f_ { le(this, "update", function(e, t, n, i, r, o, a, l, c, u, d, f, h, g) { const _ = `${t.x.toFixed(5)}, ${t.y.toFixed(5)}, ${t.z.toFixed(5)}`; if (this.infoCells.cameraPosition.innerHTML !== _ && (this.infoCells.cameraPosition.innerHTML = _), n) { - const p = n, v = `${p.x.toFixed(5)}, ${p.y.toFixed(5)}, ${p.z.toFixed(5)}`; + const m = n, v = `${m.x.toFixed(5)}, ${m.y.toFixed(5)}, ${m.z.toFixed(5)}`; this.infoCells.cameraLookAt.innerHTML !== v && (this.infoCells.cameraLookAt.innerHTML = v); } - const m = `${i.x.toFixed(5)}, ${i.y.toFixed(5)}, ${i.z.toFixed(5)}`; - if (this.infoCells.cameraUp.innerHTML !== m && (this.infoCells.cameraUp.innerHTML = m), this.infoCells.orthographicCamera.innerHTML = r ? "Orthographic" : "Perspective", o) { - const p = o, v = `${p.x.toFixed(5)}, ${p.y.toFixed(5)}, ${p.z.toFixed(5)}`; + const p = `${i.x.toFixed(5)}, ${i.y.toFixed(5)}, ${i.z.toFixed(5)}`; + if (this.infoCells.cameraUp.innerHTML !== p && (this.infoCells.cameraUp.innerHTML = p), this.infoCells.orthographicCamera.innerHTML = r ? "Orthographic" : "Perspective", o) { + const m = o, v = `${m.x.toFixed(5)}, ${m.y.toFixed(5)}, ${m.z.toFixed(5)}`; this.infoCells.cursorPosition.innerHTML = v; } else this.infoCells.cursorPosition.innerHTML = "N/A"; @@ -17753,31 +17753,31 @@ class __ { }()); le(this, "castRayAtSplatTreeNode", function() { const e = new _t(), t = new D(), n = new D(), i = new St(), r = new lo(), o = 1e-7, a = new D(0, 0, 0), l = new Ge(), c = new Ge(), u = new Ge(), d = new Ge(), f = new Ge(), h = new wa(); - return function(g, _, m, p = []) { - if (g.intersectBox(m.boundingBox)) { - if (m.data && m.data.indexes && m.data.indexes.length > 0) - for (let v = 0; v < m.data.indexes.length; v++) { - const S = m.data.indexes[v]; + return function(g, _, p, m = []) { + if (g.intersectBox(p.boundingBox)) { + if (p.data && p.data.indexes && p.data.indexes.length > 0) + for (let v = 0; v < p.data.indexes.length; v++) { + const S = p.data.indexes[v]; if (_.splatMesh.getSplatColor(S, e), _.splatMesh.getSplatCenter(S, t), _.splatMesh.getSplatScaleAndRotation(S, n, i), !(n.x <= o || n.y <= o || n.z <= o)) if (this.raycastAgainstTrueSplatEllipsoid) { c.makeScale(n.x, n.y, n.z), u.makeRotationFromQuaternion(i); const y = Math.log10(e.w) * 2; if (l.makeScale(y, y, y), f.copy(l).multiply(u).multiply(c), d.copy(f).invert(), h.origin.copy(g.origin).sub(t).applyMatrix4(d), h.direction.copy(g.origin).add(g.direction).sub(t), h.direction.applyMatrix4(d).sub(h.origin).normalize(), h.intersectSphere(a, 1, r)) { const b = r.clone(); - b.splatIndex = S, b.origin.applyMatrix4(f).add(t), p.push(b); + b.splatIndex = S, b.origin.applyMatrix4(f).add(t), m.push(b); } } else { const y = (n.x + n.y + n.z) / 3; if (g.intersectSphere(t, y, r)) { const b = r.clone(); - b.splatIndex = S, p.push(b); + b.splatIndex = S, m.push(b); } } } - if (m.children && m.children.length > 0) - for (let v of m.children) - this.castRayAtSplatTreeNode(g, _, v, p); - return p; + if (p.children && p.children.length > 0) + for (let v of p.children) + this.castRayAtSplatTreeNode(g, _, v, m); + return m; } }; }()); @@ -17913,20 +17913,20 @@ function v_(s) { [g[0] - h[0], g[1] - h[1], g[2]], [g[0], g[1], g[2] + h[2]] ) - ], m = []; + ], p = []; for (let v = 0; v < _.length; v++) - m[v] = []; - const p = [0, 0, 0]; + p[v] = []; + const m = [0, 0, 0]; for (let v = 0; v < d; v++) { const S = l.data.indexes[v], y = c[S]; - p[0] = u[y], p[1] = u[y + 1], p[2] = u[y + 2]; + m[0] = u[y], m[1] = u[y + 1], m[2] = u[y + 2]; for (let b = 0; b < _.length; b++) - _[b].containsPoint(p) && m[b].push(S); + _[b].containsPoint(m) && p[b].push(S); } for (let v = 0; v < _.length; v++) { const S = new i(_[v].min, _[v].max, l.depth + 1); S.data = { - indexes: m[v] + indexes: p[v] }, l.children.push(S); } l.data = {}; @@ -17936,8 +17936,8 @@ function v_(s) { const r = (a, l, c) => { const u = [0, 0, 0], d = [0, 0, 0], f = [], h = Math.floor(a.length / 4); for (let _ = 0; _ < h; _++) { - const m = _ * 4, p = a[m], v = a[m + 1], S = a[m + 2], y = Math.round(a[m + 3]); - (_ === 0 || p < u[0]) && (u[0] = p), (_ === 0 || p > d[0]) && (d[0] = p), (_ === 0 || v < u[1]) && (u[1] = v), (_ === 0 || v > d[1]) && (d[1] = v), (_ === 0 || S < u[2]) && (u[2] = S), (_ === 0 || S > d[2]) && (d[2] = S), f.push(y); + const p = _ * 4, m = a[p], v = a[p + 1], S = a[p + 2], y = Math.round(a[p + 3]); + (_ === 0 || m < u[0]) && (u[0] = m), (_ === 0 || m > d[0]) && (d[0] = m), (_ === 0 || v < u[1]) && (u[1] = v), (_ === 0 || v > d[1]) && (d[1] = v), (_ === 0 || S < u[2]) && (u[2] = S), (_ === 0 || S > d[2]) && (d[2] = S), f.push(y); } const g = new n(l, c); return g.sceneMin = u, g.sceneMax = d, g.rootNode = new i(g.sceneMin, g.sceneMax, 0), g.rootNode.data = { @@ -17949,8 +17949,8 @@ function v_(s) { for (let f of a) { const h = Math.floor(f.length / 4); for (let g = 0; g < h; g++) { - const _ = g * 4, m = Math.round(f[_ + 3]); - u[m] = _; + const _ = g * 4, p = Math.round(f[_ + 3]); + u[p] = _; } } const d = []; @@ -18135,7 +18135,7 @@ function A_(s, e, t) { let a = t.precision !== void 0 ? t.precision : "highp"; const l = r(a); l !== a && (console.warn("THREE.WebGLRenderer:", a, "not supported, using", l, "instead."), a = l); - const c = o || e.has("WEBGL_draw_buffers"), u = t.logarithmicDepthBuffer === !0, d = s.getParameter(s.MAX_TEXTURE_IMAGE_UNITS), f = s.getParameter(s.MAX_VERTEX_TEXTURE_IMAGE_UNITS), h = s.getParameter(s.MAX_TEXTURE_SIZE), g = s.getParameter(s.MAX_CUBE_MAP_TEXTURE_SIZE), _ = s.getParameter(s.MAX_VERTEX_ATTRIBS), m = s.getParameter(s.MAX_VERTEX_UNIFORM_VECTORS), p = s.getParameter(s.MAX_VARYING_VECTORS), v = s.getParameter(s.MAX_FRAGMENT_UNIFORM_VECTORS), S = f > 0, y = o || e.has("OES_texture_float"), b = S && y, E = o ? s.getParameter(s.MAX_SAMPLES) : 0; + const c = o || e.has("WEBGL_draw_buffers"), u = t.logarithmicDepthBuffer === !0, d = s.getParameter(s.MAX_TEXTURE_IMAGE_UNITS), f = s.getParameter(s.MAX_VERTEX_TEXTURE_IMAGE_UNITS), h = s.getParameter(s.MAX_TEXTURE_SIZE), g = s.getParameter(s.MAX_CUBE_MAP_TEXTURE_SIZE), _ = s.getParameter(s.MAX_VERTEX_ATTRIBS), p = s.getParameter(s.MAX_VERTEX_UNIFORM_VECTORS), m = s.getParameter(s.MAX_VARYING_VECTORS), v = s.getParameter(s.MAX_FRAGMENT_UNIFORM_VECTORS), S = f > 0, y = o || e.has("OES_texture_float"), b = S && y, E = o ? s.getParameter(s.MAX_SAMPLES) : 0; return { isWebGL2: o, drawBuffers: c, @@ -18148,8 +18148,8 @@ function A_(s, e, t) { maxTextureSize: h, maxCubemapSize: g, maxAttributes: _, - maxVertexUniforms: m, - maxVaryings: p, + maxVertexUniforms: p, + maxVaryings: m, maxFragmentUniforms: v, vertexTextures: S, floatFragmentTextures: y, @@ -18228,16 +18228,16 @@ class Bt extends pt { return; i ? this.disposeDistancesComputationGPUResources() : r && this.disposeDistancesComputationGPUBufferResources(); const o = this.renderer.getContext(), a = (h, g, _) => { - const m = h.createShader(g); - if (!m) + const p = h.createShader(g); + if (!p) return console.error("Fatal error: gl could not create a shader object."), null; - if (h.shaderSource(m, _), h.compileShader(m), !h.getShaderParameter(m, h.COMPILE_STATUS)) { + if (h.shaderSource(p, _), h.compileShader(p), !h.getShaderParameter(p, h.COMPILE_STATUS)) { let v = "unknown"; g === h.VERTEX_SHADER ? v = "vertex shader" : g === h.FRAGMENT_SHADER && (v = "fragement shader"); - const S = h.getShaderInfoLog(m); - return console.error("Failed to compile " + v + " with these errors:" + S), h.deleteShader(m), null; + const S = h.getShaderInfoLog(p); + return console.error("Failed to compile " + v + " with these errors:" + S), h.deleteShader(p), null; } - return m; + return p; }; let l; this.integerBasedDistancesComputation ? (l = `#version 300 es @@ -18279,8 +18279,8 @@ class Bt extends pt { if (!g || !_) throw new Error("Could not compile shaders for distances computation on GPU."); if (o.attachShader(h, g), o.attachShader(h, _), o.transformFeedbackVaryings(h, ["distance"], o.SEPARATE_ATTRIBS), o.linkProgram(h), !o.getProgramParameter(h, o.LINK_STATUS)) { - const p = o.getProgramInfoLog(h); - throw console.error("Fatal error: Failed to link program: " + p), o.deleteProgram(h), o.deleteShader(_), o.deleteShader(g), new Error("Could not link shaders for distances computation on GPU."); + const m = o.getProgramInfoLog(h); + throw console.error("Fatal error: Failed to link program: " + m), o.deleteProgram(h), o.deleteShader(_), o.deleteShader(g), new Error("Could not link shaders for distances computation on GPU."); } this.distancesTransformFeedback.program = h, this.distancesTransformFeedback.vertexShader = g, this.distancesTransformFeedback.vertexShader = _; } @@ -18350,8 +18350,8 @@ class Bt extends pt { throw new Error("should never get here"); default: this.computeDistancesOnGPUSyncTimeout = null, r.deleteSync(c); - const m = r.getParameter(r.VERTEX_ARRAY_BINDING); - r.bindVertexArray(this.distancesTransformFeedback.vao), r.bindBuffer(r.ARRAY_BUFFER, this.distancesTransformFeedback.outDistancesBuffer), r.getBufferSubData(r.ARRAY_BUFFER, 0, i), r.bindBuffer(r.ARRAY_BUFFER, null), m && r.bindVertexArray(m), d(); + const p = r.getParameter(r.VERTEX_ARRAY_BINDING); + r.bindVertexArray(this.distancesTransformFeedback.vao), r.bindBuffer(r.ARRAY_BUFFER, this.distancesTransformFeedback.outDistancesBuffer), r.getBufferSubData(r.ARRAY_BUFFER, 0, i), r.bindBuffer(r.ARRAY_BUFFER, null), p && r.bindVertexArray(p), d(); } }; this.computeDistancesOnGPUSyncTimeout = setTimeout(f); @@ -18969,14 +18969,14 @@ class Bt extends pt { const l = Bt.getTotalMaxSplatCountForSplatBuffers(t), c = Bt.buildScenes(t, n); if (i) for (let _ = 0; _ < this.scenes.length && _ < c.length; _++) { - const m = c[_], p = this.getScene(_); - m.copyTransformData(p); + const p = c[_], m = this.getScene(_); + p.copyTransformData(m); } this.scenes = c; let u = 3; for (let _ of t) { - const m = _.getMinSphericalHarmonicsDegree(); - m < u && (u = m); + const p = _.getMinSphericalHarmonicsDegree(); + p < u && (u = p); } this.minSphericalHarmonicsDegree = Math.min(u, this.sphericalHarmonicsDegree); let d = !1; @@ -19128,10 +19128,10 @@ class Bt extends pt { o ); const g = i(Ra, 6); - let _ = r >= 1 ? Uint16Array : Float32Array, m = r >= 1 ? xi : gn; - const p = new _(g.x * g.y * Ra); - p.set(a); - const v = new or(p, g.x, g.y, kt, m); + let _ = r >= 1 ? Uint16Array : Float32Array, p = r >= 1 ? xi : gn; + const m = new _(g.x * g.y * Ra); + m.set(a); + const v = new or(m, g.x, g.y, kt, p); v.needsUpdate = !0, this.material.uniforms.covariancesTexture.value = v, this.material.uniforms.covariancesTextureSize.value.copy(g); const S = i(Pa, 4), y = new Uint32Array(S.x * S.y * Pa); Bt.updateCenterColorsPaddedData(0, n, l, c, y); @@ -19150,7 +19150,7 @@ class Bt extends pt { sphericalHarmonics: h }, covariances: { - data: p, + data: m, texture: v, size: g, compressionLevel: r @@ -19219,22 +19219,22 @@ class Bt extends pt { this.lastBuildSplatCount ); const o = this.splatDataTextures.covariances, a = o.data, l = o.texture, c = this.lastBuildSplatCount * ur, u = t * ur; - for (let m = c; m < u; m++) { - const p = this.splatDataTextures.baseData.covariances[m]; - a[m] = p; + for (let p = c; p < u; p++) { + const m = this.splatDataTextures.baseData.covariances[p]; + a[p] = m; } const d = this.renderer ? this.renderer.properties.get(l) : null; if (!d || !d.__webglTexture) l.needsUpdate = !0; else { - const m = n ? 2 : 4; + const p = n ? 2 : 4; this.updateDataTexture( a, o, d, Ra, ur, - m, + p, this.lastBuildSplatCount, t - 1 ); @@ -19258,10 +19258,10 @@ class Bt extends pt { this.lastBuildSplatCount, t - 1 ), this.splatDataTextures.baseData.sphericalHarmonics) { - const m = i.componentCount, p = i.paddedComponentCount, v = i.data; + const p = i.componentCount, m = i.paddedComponentCount, v = i.data; for (let b = this.lastBuildSplatCount; b < t; b++) { - const E = m * b, T = p * b; - for (let L = 0; L < m; L++) + const E = p * b, T = m * b; + for (let L = 0; L < p; L++) v[T + L] = this.splatDataTextures.baseData.sphericalHarmonics[E + L]; } const S = i.texture, y = this.renderer ? this.renderer.properties.get(S) : null; @@ -19274,7 +19274,7 @@ class Bt extends pt { i, y, 4, - p, + m, E, this.lastBuildSplatCount, t - 1 @@ -19282,13 +19282,13 @@ class Bt extends pt { } } if (this.dynamicMode) { - const m = this.splatDataTextures.tansformIndexes, p = m.data; + const p = this.splatDataTextures.tansformIndexes, m = p.data; for (let y = this.lastBuildSplatCount; y < t; y++) - p[y] = this.globalSplatIndexToSceneIndexMap[y]; - const v = m.texture, S = this.renderer ? this.renderer.properties.get(v) : null; + m[y] = this.globalSplatIndexToSceneIndexMap[y]; + const v = p.texture, S = this.renderer ? this.renderer.properties.get(v) : null; !S || !S.__webglTexture ? v.needsUpdate = !0 : this.updateDataTexture( - p, m, + p, S, 1, 1, @@ -19334,7 +19334,7 @@ class Bt extends pt { t.buffer, d.dataStart * a, f - ), g = d.endRow - d.startRow + 1, _ = n.texture, m = this.webGLUtils.convert(_.type), p = this.webGLUtils.convert(_.format, _.colorSpace), v = u.getParameter(u.TEXTURE_BINDING_2D); + ), g = d.endRow - d.startRow + 1, _ = n.texture, p = this.webGLUtils.convert(_.type), m = this.webGLUtils.convert(_.format, _.colorSpace), v = u.getParameter(u.TEXTURE_BINDING_2D); u.bindTexture(u.TEXTURE_2D, i.__webglTexture), u.texSubImage2D( u.TEXTURE_2D, 0, @@ -19342,8 +19342,8 @@ class Bt extends pt { d.startRow, n.size.x, g, - p, m, + p, h ), u.bindTexture(u.TEXTURE_2D, v); } @@ -19649,7 +19649,7 @@ class Bt extends pt { } var R_ = "AGFzbQEAAAAADAZkeWxpbmsAAAAAAAEbA2AAAGAQf39/f39/f39/f39/f39/fwBgAAF/AhIBA2VudgZtZW1vcnkCAwCAgAQDBAMAAQIHOQMRX193YXNtX2NhbGxfY3RvcnMAAAtzb3J0SW5kZXhlcwABE2Vtc2NyaXB0ZW5fdGxzX2luaXQAAgrHEAMDAAELuxAFAXwDewJ/A30CfiALIAprIQwCQCAOBEAgDQRAQfj///8HIQ5BiICAgHghDSALIAxNDQIgDCEBA0AgAyABQQJ0IgVqIAIgACAFaigCAEECdGooAgAiBTYCACAFIA4gBSAOSBshDiAFIA0gBSANShshDSABQQFqIgEgC0cNAAsMAgsgDwRAQfj///8HIQ5BiICAgHghDSALIAxNDQJBfyEPIAwhAgNAIA8gByAAIAJBAnQiFGooAgAiFUECdGooAgAiCkcEQAJ+IAX9CQIIIAggCkEGdGoiD/0JAgAgDyoCEP0gASAPKgIg/SACIA8qAjD9IAP95gEgBf0JAhggD/0JAgQgDyoCFP0gASAPKgIk/SACIA8qAjT9IAP95gH95AEgBf0JAiggD/0JAgggDyoCGP0gASAPKgIo/SACIA8qAjj9IAP95gH95AEgBf0JAjggD/0JAgwgDyoCHP0gASAPKgIs/SACIA8qAjz9IAP95gH95AEiEf0fArv9FCAR/R8Du/0iAf0MAAAAAABAj0AAAAAAAECPQCIS/fIBIhP9IQEiEJlEAAAAAAAA4ENjBEAgELAMAQtCgICAgICAgICAfwshGQJ+IBP9IQAiEJlEAAAAAAAA4ENjBEAgELAMAQtCgICAgICAgICAfwv9EiETAn4gEf0fALv9FCAR/R8Bu/0iASAS/fIBIhH9IQEiEJlEAAAAAAAA4ENjBEAgELAMAQtCgICAgICAgICAfwshGiATIBn9HgEhEgJ+IBH9IQAiEJlEAAAAAAAA4ENjBEAgELAMAQtCgICAgICAgICAfwv9EiAa/R4BIBL9DQABAgMICQoLEBESExgZGhshEiAKIQ8LIAMgFGogASAVQQR0av0AAAAgEv21ASIR/RsAIBH9GwFqIBH9GwJqIBH9GwNqIgo2AgAgCiAOIAogDkgbIQ4gCiANIAogDUobIQ0gAkEBaiICIAtHDQALDAILAn8gBSoCGLtEAAAAAABAj0CiIhCZRAAAAAAAAOBBYwRAIBCqDAELQYCAgIB4CyEKAn8gBSoCCLtEAAAAAABAj0CiIhCZRAAAAAAAAOBBYwRAIBCqDAELQYCAgIB4CyECAn8gBSoCKLtEAAAAAABAj0CiIhCZRAAAAAAAAOBBYwRAIBCqDAELQYCAgIB4CyEFQfj///8HIQ5BiICAgHghDSALIAxNDQEgAv0RIAr9HAEgBf0cAiESIAwhBQNAIAMgBUECdCICaiABIAAgAmooAgBBBHRq/QAAACAS/bUBIhH9GwAgEf0bAWogEf0bAmoiAjYCACACIA4gAiAOSBshDiACIA0gAiANShshDSAFQQFqIgUgC0cNAAsMAQsgDQRAQfj///8HIQ5BiICAgHghDSALIAxNDQEgDCEBA0AgAyABQQJ0IgVqAn8gAiAAIAVqKAIAQQJ0aioCALtEAAAAAAAAsECiIhCZRAAAAAAAAOBBYwRAIBCqDAELQYCAgIB4CyIKNgIAIAogDiAKIA5IGyEOIAogDSAKIA1KGyENIAFBAWoiASALRw0ACwwBCwJAIA9FBEAgCyAMSw0BQYiAgIB4IQ1B+P///wchDgwCC0H4////ByEOQYiAgIB4IQ0gCyAMTQ0BQX8hDyAMIQIDQCAPIAcgACACQQJ0IhRqKAIAQQJ0IhVqKAIAIgpHBEAgBf0JAgggCCAKQQZ0aiIP/QkCACAPKgIQ/SABIA8qAiD9IAIgDyoCMP0gA/3mASAF/QkCGCAP/QkCBCAPKgIU/SABIA8qAiT9IAIgDyoCNP0gA/3mAf3kASAF/QkCKCAP/QkCCCAPKgIY/SABIA8qAij9IAIgDyoCOP0gA/3mAf3kASAF/QkCOCAP/QkCDCAPKgIc/SABIA8qAiz9IAIgDyoCPP0gA/3mAf3kASERIAohDwsgAyAUagJ/IBEgASAVQQJ0IgpqKQIA/RL95gEiEv0fACAS/R8BkiARIBH9DQgJCgsMDQ4PAAAAAAAAAAAgASAKQQhyaikCAP0S/eYBIhL9HwCSIBL9HwGSu0QAAAAAAACwQKIiEJlEAAAAAAAA4EFjBEAgEKoMAQtBgICAgHgLIgo2AgAgCiAOIAogDkgbIQ4gCiANIAogDUobIQ0gAkEBaiICIAtHDQALDAELIAUqAighFiAFKgIYIRcgBSoCCCEYQfj///8HIQ5BiICAgHghDSAMIQUDQAJ/IBggASAAIAVBAnQiB2ooAgBBBHRqIgIqAgCUIBcgAioCBJSSIBYgAioCCJSSu0QAAAAAAACwQKIiEJlEAAAAAAAA4EFjBEAgEKoMAQtBgICAgHgLIQogAyAHaiAKNgIAIAogDiAKIA5IGyEOIAogDSAKIA1KGyENIAVBAWoiBSALRw0ACwsgCyAMSwRAIAlBAWuzIA2yIA6yk5UhFiAMIQ0DQAJ/IBYgAyANQQJ0aiIBKAIAIA5rspQiF4tDAAAAT10EQCAXqAwBC0GAgICAeAshCiABIAo2AgAgBCAKQQJ0aiIBIAEoAgBBAWo2AgAgDUEBaiINIAtHDQALCyAJQQJPBEAgBCgCACENQQEhDgNAIAQgDkECdGoiASABKAIAIA1qIg02AgAgDkEBaiIOIAlHDQALCyAMQQBKBEAgDCEOA0AgBiAOQQFrIgFBAnQiAmogACACaigCADYCACAOQQFKIQIgASEOIAINAAsLIAsgDEoEQCALIQ4DQCAGIAsgBCADIA5BAWsiDkECdCIBaigCAEECdGoiAigCACIFa0ECdGogACABaigCADYCACACIAVBAWs2AgAgDCAOSA0ACwsLBABBAAs="; function P_(s) { - let e, t, n, i, r, o, a, l, c, u, d, f, h, g, _, m, p, v; + let e, t, n, i, r, o, a, l, c, u, d, f, h, g, _, p, m, v; function S(y, b, E, T, L, B, x) { const A = performance.now(); if (!n && (new Uint32Array(t, a, L.byteLength / v.BytesPerInt).set(L), new Float32Array(t, u, x.byteLength / v.BytesPerFloat).set(x), T)) { @@ -19664,7 +19664,7 @@ function P_(s) { B.byteLength / v.BytesPerFloat ), z.set(B); } - m || (m = new Uint32Array(v.DepthMapRange)), new Float32Array(t, _, 16).set(E), new Uint32Array(t, h, v.DepthMapRange).set(m), e.exports.sortIndexes( + p || (p = new Uint32Array(v.DepthMapRange)), new Float32Array(t, _, 16).set(E), new Uint32Array(t, h, v.DepthMapRange).set(p), e.exports.sortIndexes( a, g, d, @@ -19690,7 +19690,7 @@ function P_(s) { }; if (!n) { const P = new Uint32Array(t, l, b); - (!p || p.length < b) && (p = new Uint32Array(b)), p.set(P), U.sortedIndexes = p; + (!m || m.length < b) && (m = new Uint32Array(b)), m.set(P), U.sortedIndexes = m; } const N = performance.now(); U.sortTime = N - A, s.postMessage(U); @@ -20157,8 +20157,8 @@ const Da = { this.sortRunning = !0; const { splatRenderCount: g, shouldSortAll: _ } = this.gatherSceneNodesForSort(); this.splatRenderCount = g, e.copy(this.camera.matrixWorld).invert(); - const m = this.perspectiveCamera || this.camera; - if (e.premultiply(m.projectionMatrix), e.multiply(this.splatMesh.matrixWorld), this.gpuAcceleratedSort && (a.length <= 1 || a.length % 2 === 0) && await this.splatMesh.computeDistancesOnGPU(e, this.sortWorkerPrecomputedDistances), this.splatMesh.dynamicMode || _) + const p = this.perspectiveCamera || this.camera; + if (e.premultiply(p.projectionMatrix), e.multiply(this.splatMesh.matrixWorld), this.gpuAcceleratedSort && (a.length <= 1 || a.length % 2 === 0) && await this.splatMesh.computeDistancesOnGPU(e, this.sortWorkerPrecomputedDistances), this.splatMesh.dynamicMode || _) a.push(this.splatRenderCount); else if (a.length === 0) { for (let S of l) @@ -20169,13 +20169,13 @@ const Da = { } a.push(this.splatRenderCount); } - let p = Math.min(a.shift(), this.splatRenderCount); + let m = Math.min(a.shift(), this.splatRenderCount); t[0] = this.camera.position.x, t[1] = this.camera.position.y, t[2] = this.camera.position.z; const v = { modelViewProj: e.elements, cameraPosition: t, splatRenderCount: this.splatRenderCount, - splatSortCount: p, + splatSortCount: m, usePrecomputedDistances: this.gpuAcceleratedSort }; this.splatMesh.dynamicMode && this.splatMesh.fillTransformsArray(this.sortWorkerTransforms), this.sharedMemoryForWorkers || (v.indexesToSort = this.sortWorkerIndexesToSort, v.transforms = this.sortWorkerTransforms, this.gpuAcceleratedSort && (v.precomputedDistances = this.sortWorkerPrecomputedDistances)), this.sortPromise = new Promise((S) => { @@ -20194,7 +20194,7 @@ const Da = { const n = new D(), i = new D(), r = new D(), o = new Ge(), a = new Ge(), l = new Ge(), c = new D(), u = new D(0, 0, -1), d = new D(), f = (h) => d.copy(h.max).sub(h.min).length(); return function(h = !1) { this.getRenderDimensions(c); - const g = c.y / 2 / Math.tan(this.camera.fov / 2 * kc.DEG2RAD), _ = Math.atan(c.x / 2 / g), m = Math.atan(c.y / 2 / g), p = Math.cos(_), v = Math.cos(m), S = this.splatMesh.getSplatTree(); + const g = c.y / 2 / Math.tan(this.camera.fov / 2 * kc.DEG2RAD), _ = Math.atan(c.x / 2 / g), p = Math.atan(c.y / 2 / g), m = Math.cos(_), v = Math.cos(p), S = this.splatMesh.getSplatTree(); if (S) { a.copy(this.camera.matrixWorld).invert(), a.multiply(this.splatMesh.matrixWorld); let y = 0, b = 0; @@ -20209,7 +20209,7 @@ const Da = { r.copy(A.center).applyMatrix4(o); const U = r.length(); r.normalize(), n.copy(r).setX(0).normalize(), i.copy(r).setY(0).normalize(); - const N = u.dot(i), P = u.dot(n), I = f(A), z = P < v - 0.6, K = N < p - 0.6; + const N = u.dot(i), P = u.dot(n), I = f(A), z = P < v - 0.6, K = N < m - 0.6; !h && (K || z) && U > I || (b += A.data.indexes.length, e[y] = A, A.data.distanceToNode = U, y++); } } @@ -20385,28 +20385,28 @@ const Da = { r && (this.loadingSpinner.removeAllTasks(), o = this.loadingSpinner.addTask("Downloading...")); const a = () => { this.loadingProgressBar.hide(), this.loadingSpinner.removeAllTasks(); - }, l = (_, m, p) => { + }, l = (_, p, m) => { if (r) - if (p === Lt.Downloading) + if (m === Lt.Downloading) if (_ == 100) this.loadingSpinner.setMessageForTask(o, "Download complete!"); else if (i) this.loadingSpinner.setMessageForTask(o, "Downloading splats..."); else { - const v = m ? `: ${m}` : "..."; + const v = p ? `: ${p}` : "..."; this.loadingSpinner.setMessageForTask(o, `Downloading${v}`); } else - p === Lt.Processing ? this.loadingSpinner.setMessageForTask(o, "Processing splats...") : this.loadingSpinner.setMessageForTask(o, "Ready!"); + m === Lt.Processing ? this.loadingSpinner.setMessageForTask(o, "Processing splats...") : this.loadingSpinner.setMessageForTask(o, "Ready!"); }; let c = !1, u = 0; - const d = (_, m) => { - r && ((_ && i || m && !i) && this.runAfterFirstSort.push(() => { - this.loadingSpinner.removeTask(o), !m && !c && this.loadingProgressBar.show(); - }), i && (m ? (c = !0, this.loadingProgressBar.hide()) : this.loadingProgressBar.setProgress(u))); - }, f = (_, m, p) => { - u = _, l(_, m, p), t.onProgress && t.onProgress(_, m, p); - }, h = (_, m, p) => { + const d = (_, p) => { + r && ((_ && i || p && !i) && this.runAfterFirstSort.push(() => { + this.loadingSpinner.removeTask(o), !p && !c && this.loadingProgressBar.show(); + }), i && (p ? (c = !0, this.loadingProgressBar.hide()) : this.loadingProgressBar.setProgress(u))); + }, f = (_, p, m) => { + u = _, l(_, p, m), t.onProgress && t.onProgress(_, p, m); + }, h = (_, p, m) => { !i && t.onProgress && t.onProgress(0, "0%", Lt.Processing); const v = { rotation: t.rotation || t.orientation, @@ -20417,11 +20417,11 @@ const Da = { return this.addSplatBuffers( [_], [v], - p, - m && r, + m, + p && r, r ).then(() => { - !i && t.onProgress && t.onProgress(100, "100%", Lt.Processing), d(m, p); + !i && t.onProgress && t.onProgress(100, "100%", Lt.Processing), d(p, m); }); }; return (i ? this.downloadAndBuildSingleSplatSceneStreaming.bind(this) : this.downloadAndBuildSingleSplatSceneNonStreaming.bind(this))(e, n, t.splatAlphaRemovalThreshold, h.bind(this), f, a.bind(this)); @@ -20476,7 +20476,7 @@ const Da = { finalBuild: y }), d++, g()); }; - let m = this.downloadSplatSceneToSplatBuffer( + let p = this.downloadSplatSceneToSplatBuffer( e, n, r, @@ -20484,16 +20484,16 @@ const Da = { _, t ); - const p = new gi((S, y) => { + const m = new gi((S, y) => { a = S, l = y; - }, m.abortHandler), v = new gi((S, y) => { + }, p.abortHandler), v = new gi((S, y) => { c = S, u = y; }); - return this.addSplatSceneDownloadPromise(m), this.setSplatSceneDownloadAndBuildPromise(v), m.then(() => { - this.removeSplatSceneDownloadPromise(m); + return this.addSplatSceneDownloadPromise(p), this.setSplatSceneDownloadAndBuildPromise(v), p.then(() => { + this.removeSplatSceneDownloadPromise(p); }).catch((S) => { - this.clearSplatSceneDownloadAndBuildPromise(), this.removeSplatSceneDownloadPromise(m), S instanceof pr || (u(S), l && l(S), o && o(S)); - }), p; + this.clearSplatSceneDownloadAndBuildPromise(), this.removeSplatSceneDownloadPromise(p), S instanceof pr || (u(S), l && l(S), o && o(S)); + }), m; } /** * Add multiple splat scenes to the viewer and display any loading UI if appropriate. @@ -20860,40 +20860,40 @@ function Q_(s) { }; } function J_(s, e, t) { - let { value: n } = e, { root: i } = e, { proxy_url: r } = e, { label: o = "" } = e, { show_label: a } = e, { i18n: l } = e, c = 0, u = 1; - var d = []; - const f = new D(1.25, 1.25, 1.25), h = new D(0.01, 0.01, 0.01); + let { value: n } = e, { root: i } = e, { proxy_url: r } = e, { label: o = "" } = e, { show_label: a } = e, { i18n: l } = e, { fps: c = 8 } = e, u = 0, d = 1; + var f = []; + const h = new D(1.25, 1.25, 1.25), g = new D(0.01, 0.01, 0.01); return Z_(() => { if (n != null && n.files != null) { - const g = document.querySelector(".model4DGS"), _ = new Va({ + const _ = document.querySelector(".model4DGS"), p = new Va({ cameraUp: [0, 1, 0], initialCameraPosition: [0, 0, 4], initialCameraLookAt: [0, 0, -1], dynamicScene: !0, sharedMemoryForWorkers: !1, - rootElement: g + rootElement: _ }); - u = n.files.length; + d = n.files.length; let m = n.files; - for (let p = 0; p < m.length; p++) { - let v = { - path: bc(m[p], i, r).url, - scale: [h, h, h] + for (let v = 0; v < m.length; v++) { + let S = { + path: bc(m[v], i, r).url, + scale: [g, g, g] }; - d.push(v); + f.push(S); } - _.addSplatScenes(d, !0).then(() => { - _.start(); - let p = performance.now(); - requestAnimationFrame(v); - function v() { - requestAnimationFrame(v), performance.now() - p > 150 && (_.getSplatScene(c).scale.copy(h), p = performance.now(), c++, c >= u && (c = 0), _.getSplatScene(c).scale.copy(f)); + p.addSplatScenes(f, !0).then(() => { + p.start(); + let v = performance.now(); + requestAnimationFrame(S); + function S() { + requestAnimationFrame(S), performance.now() - v > 1e3 / c && (p.getSplatScene(u).scale.copy(g), v = performance.now(), u++, u >= d && (u = 0), p.getSplatScene(u).scale.copy(h)); } }); } - }), s.$$set = (g) => { - "value" in g && t(3, n = g.value), "root" in g && t(4, i = g.root), "proxy_url" in g && t(5, r = g.proxy_url), "label" in g && t(0, o = g.label), "show_label" in g && t(1, a = g.show_label), "i18n" in g && t(2, l = g.i18n); - }, [o, a, l, n, i, r]; + }), s.$$set = (_) => { + "value" in _ && t(3, n = _.value), "root" in _ && t(4, i = _.root), "proxy_url" in _ && t(5, r = _.proxy_url), "label" in _ && t(0, o = _.label), "show_label" in _ && t(1, a = _.show_label), "i18n" in _ && t(2, l = _.i18n), "fps" in _ && t(6, c = _.fps); + }, [o, a, l, n, i, r, c]; } class $_ extends k_ { constructor(e) { @@ -20903,7 +20903,8 @@ class $_ extends k_ { proxy_url: 5, label: 0, show_label: 1, - i18n: 2 + i18n: 2, + fps: 6 }); } } @@ -20989,10 +20990,10 @@ function Wa(s, e, t, n) { function ac(s, e = {}) { const t = nS(s), { stiffness: n = 0.15, damping: i = 0.8, precision: r = 0.01 } = e; let o, a, l, c = s, u = s, d = 1, f = 0, h = !1; - function g(m, p = {}) { - u = m; + function g(p, m = {}) { + u = p; const v = l = {}; - return s == null || p.hard || _.stiffness >= 1 && _.damping >= 1 ? (h = !0, o = sc(), c = m, t.set(s = u), Promise.resolve()) : (p.soft && (f = 1 / ((p.soft === !0 ? 0.5 : +p.soft) * 60), d = 0), a || (o = sc(), h = !1, a = tS((S) => { + return s == null || m.hard || _.stiffness >= 1 && _.damping >= 1 ? (h = !0, o = sc(), c = p, t.set(s = u), Promise.resolve()) : (m.soft && (f = 1 / ((m.soft === !0 ? 0.5 : +m.soft) * 60), d = 0), a || (o = sc(), h = !1, a = tS((S) => { if (h) return h = !1, a = null, !1; d = Math.min(d + f, 1); @@ -21011,7 +21012,7 @@ function ac(s, e = {}) { } const _ = { set: g, - update: (m, p) => g(m(u, s), p), + update: (p, m) => g(p(u, s), m), subscribe: t.subscribe, stiffness: n, damping: i, @@ -21076,8 +21077,8 @@ function uS(s) { } function dS(s, e, t) { let n, i; - var r = this && this.__awaiter || function(h, g, _, m) { - function p(v) { + var r = this && this.__awaiter || function(h, g, _, p) { + function m(v) { return v instanceof _ ? v : new _(function(S) { S(v); }); @@ -21085,22 +21086,22 @@ function dS(s, e, t) { return new (_ || (_ = Promise))(function(v, S) { function y(T) { try { - E(m.next(T)); + E(p.next(T)); } catch (L) { S(L); } } function b(T) { try { - E(m.throw(T)); + E(p.throw(T)); } catch (L) { S(L); } } function E(T) { - T.done ? v(T.value) : p(T.value).then(y, b); + T.done ? v(T.value) : m(T.value).then(y, b); } - E((m = m.apply(h, g || [])).next()); + E((p = p.apply(h, g || [])).next()); }); }; let { margin: o = !0 } = e; @@ -21258,8 +21259,8 @@ function CS(s) { /*timer*/ s[5] && _c(s) ); - const _ = [IS, FS], m = []; - function p(S, y) { + const _ = [IS, FS], p = []; + function m(S, y) { return ( /*last_progress_level*/ S[15] != null ? 0 : ( @@ -21268,7 +21269,7 @@ function CS(s) { ) ); } - ~(r = p(s)) && (o = m[r] = _[r](s)); + ~(r = m(s)) && (o = p[r] = _[r](s)); let v = !/*timer*/ s[5] && Ac(s); return { @@ -21286,7 +21287,7 @@ function CS(s) { ); }, m(S, y) { - u && u.m(S, y), qe(S, e, y), qe(S, t, y), h && h.m(t, null), _i(t, n), g && g.m(t, null), qe(S, i, y), ~r && m[r].m(S, y), qe(S, a, y), v && v.m(S, y), qe(S, l, y), c = !0; + u && u.m(S, y), qe(S, e, y), qe(S, t, y), h && h.m(t, null), _i(t, n), g && g.m(t, null), qe(S, i, y), ~r && p[r].m(S, y), qe(S, a, y), v && v.m(S, y), qe(S, l, y), c = !0; }, p(S, y) { /*variant*/ @@ -21307,9 +21308,9 @@ function CS(s) { S[8] === "default" ); let b = r; - r = p(S), r === b ? ~r && m[r].p(S, y) : (o && (hu(), ps(m[b], 1, 1, () => { - m[b] = null; - }), du()), ~r ? (o = m[r], o ? o.p(S, y) : (o = m[r] = _[r](S), o.c()), hs(o, 1), o.m(a.parentNode, a)) : o = null), /*timer*/ + r = m(S), r === b ? ~r && p[r].p(S, y) : (o && (hu(), ps(p[b], 1, 1, () => { + p[b] = null; + }), du()), ~r ? (o = p[r], o ? o.p(S, y) : (o = p[r] = _[r](S), o.c()), hs(o, 1), o.m(a.parentNode, a)) : o = null), /*timer*/ S[5] ? v && (v.d(1), v = null) : v ? v.p(S, y) : (v = Ac(S), v.c(), v.m(l.parentNode, l)); }, i(S) { @@ -21319,7 +21320,7 @@ function CS(s) { ps(o), c = !1; }, d(S) { - S && (Xe(e), Xe(t), Xe(i), Xe(a), Xe(l)), u && u.d(S), h && h.d(), g && g.d(), ~r && m[r].d(S), v && v.d(S); + S && (Xe(e), Xe(t), Xe(i), Xe(a), Xe(l)), u && u.d(S), h && h.d(), g && g.d(), ~r && p[r].d(S), v && v.d(S); } }; } @@ -21996,7 +21997,7 @@ function NS(s) { function kS(s, e, t) { let n, { $$slots: i = {}, $$scope: r } = e; this && this.__awaiter; - let { i18n: o } = e, { eta: a = null } = e, { queue_position: l } = e, { queue_size: c } = e, { status: u } = e, { scroll_to_output: d = !1 } = e, { timer: f = !0 } = e, { show_progress: h = "full" } = e, { message: g = null } = e, { progress: _ = null } = e, { variant: m = "default" } = e, { loading_text: p = "Loading..." } = e, { absolute: v = !0 } = e, { translucent: S = !1 } = e, { border: y = !1 } = e, { autoscroll: b } = e, E, T = !1, L = 0, B = 0, x = null, A = null, U = 0, N = null, P, I = null, z = !0; + let { i18n: o } = e, { eta: a = null } = e, { queue_position: l } = e, { queue_size: c } = e, { status: u } = e, { scroll_to_output: d = !1 } = e, { timer: f = !0 } = e, { show_progress: h = "full" } = e, { message: g = null } = e, { progress: _ = null } = e, { variant: p = "default" } = e, { loading_text: m = "Loading..." } = e, { absolute: v = !0 } = e, { translucent: S = !1 } = e, { border: y = !1 } = e, { autoscroll: b } = e, E, T = !1, L = 0, B = 0, x = null, A = null, U = 0, N = null, P, I = null, z = !0; const K = () => { t(0, a = t(26, x = t(19, Q = null))), t(24, L = performance.now()), t(25, B = 0), T = !0, G(); }; @@ -22023,7 +22024,7 @@ function kS(s, e, t) { }); } return s.$$set = (ne) => { - "i18n" in ne && t(1, o = ne.i18n), "eta" in ne && t(0, a = ne.eta), "queue_position" in ne && t(2, l = ne.queue_position), "queue_size" in ne && t(3, c = ne.queue_size), "status" in ne && t(4, u = ne.status), "scroll_to_output" in ne && t(21, d = ne.scroll_to_output), "timer" in ne && t(5, f = ne.timer), "show_progress" in ne && t(6, h = ne.show_progress), "message" in ne && t(22, g = ne.message), "progress" in ne && t(7, _ = ne.progress), "variant" in ne && t(8, m = ne.variant), "loading_text" in ne && t(9, p = ne.loading_text), "absolute" in ne && t(10, v = ne.absolute), "translucent" in ne && t(11, S = ne.translucent), "border" in ne && t(12, y = ne.border), "autoscroll" in ne && t(23, b = ne.autoscroll), "$$scope" in ne && t(28, r = ne.$$scope); + "i18n" in ne && t(1, o = ne.i18n), "eta" in ne && t(0, a = ne.eta), "queue_position" in ne && t(2, l = ne.queue_position), "queue_size" in ne && t(3, c = ne.queue_size), "status" in ne && t(4, u = ne.status), "scroll_to_output" in ne && t(21, d = ne.scroll_to_output), "timer" in ne && t(5, f = ne.timer), "show_progress" in ne && t(6, h = ne.show_progress), "message" in ne && t(22, g = ne.message), "progress" in ne && t(7, _ = ne.progress), "variant" in ne && t(8, p = ne.variant), "loading_text" in ne && t(9, m = ne.loading_text), "absolute" in ne && t(10, v = ne.absolute), "translucent" in ne && t(11, S = ne.translucent), "border" in ne && t(12, y = ne.border), "autoscroll" in ne && t(23, b = ne.autoscroll), "$$scope" in ne && t(28, r = ne.$$scope); }, s.$$.update = () => { s.$$.dirty[0] & /*eta, old_eta, timer_start, eta_from_start*/ 218103809 && (a === null && t(0, a = x), a != null && x !== a && (t(27, A = (performance.now() - L) / 1e3 + a), t(19, Q = A.toFixed(1)), t(26, x = a))), s.$$.dirty[0] & /*eta_from_start, timer_diff*/ @@ -22048,8 +22049,8 @@ function kS(s, e, t) { f, h, _, - m, p, + m, v, S, y, @@ -22249,7 +22250,7 @@ function dv(s) { r[7] || "Splat"), e.$set(a); const l = {}; o & /*$$scope*/ - 32768 && (l.$$scope = { dirty: o, ctx: r }), n.$set(l); + 65536 && (l.$$scope = { dirty: o, ctx: r }), n.$set(l); }, i(r) { i || (Bn(e.$$.fragment, r), Bn(n.$$.fragment, r), i = !0); @@ -22278,7 +22279,7 @@ function fv(s) { } }); function o(l) { - s[14](l); + s[15](l); } let a = { i18n: ( @@ -22300,6 +22301,10 @@ function fv(s) { proxy_url: ( /*proxy_url*/ s[5] + ), + fps: ( + /*fps*/ + s[14] ) }; return ( @@ -22330,7 +22335,9 @@ function fv(s) { 16 && (d.root = /*root*/ l[4]), c & /*proxy_url*/ 32 && (d.proxy_url = /*proxy_url*/ - l[5]), !i && c & /*value*/ + l[5]), c & /*fps*/ + 16384 && (d.fps = /*fps*/ + l[14]), !i && c & /*value*/ 1 && (i = !0, d.value = /*value*/ l[0], ev(() => i = !1)), n.$set(d); }, @@ -22504,8 +22511,8 @@ function mv(s) { 2048 && (r.min_width = /*min_width*/ n[11]), i & /*height*/ 8192 && (r.height = /*height*/ - n[13]), i & /*$$scope, gradio, label, show_label, root, proxy_url, value, loading_status*/ - 37361 && (r.$$scope = { dirty: i, ctx: n }), e.$set(r); + n[13]), i & /*$$scope, gradio, label, show_label, root, proxy_url, fps, value, loading_status*/ + 86513 && (r.$$scope = { dirty: i, ctx: n }), e.$set(r); }, i(n) { t || (Bn(e.$$.fragment, n), t = !0); @@ -22519,12 +22526,12 @@ function mv(s) { }; } function gv(s, e, t) { - let { elem_id: n = "" } = e, { elem_classes: i = [] } = e, { visible: r = !0 } = e, { value: o = null } = e, { root: a } = e, { proxy_url: l } = e, { loading_status: c } = e, { label: u } = e, { show_label: d } = e, { container: f = !0 } = e, { scale: h = null } = e, { min_width: g = void 0 } = e, { gradio: _ } = e, { height: m = void 0 } = e; - function p(v) { - o = v, t(0, o); + let { elem_id: n = "" } = e, { elem_classes: i = [] } = e, { visible: r = !0 } = e, { value: o = null } = e, { root: a } = e, { proxy_url: l } = e, { loading_status: c } = e, { label: u } = e, { show_label: d } = e, { container: f = !0 } = e, { scale: h = null } = e, { min_width: g = void 0 } = e, { gradio: _ } = e, { height: p = void 0 } = e, { fps: m = 8 } = e; + function v(S) { + o = S, t(0, o); } - return s.$$set = (v) => { - "elem_id" in v && t(1, n = v.elem_id), "elem_classes" in v && t(2, i = v.elem_classes), "visible" in v && t(3, r = v.visible), "value" in v && t(0, o = v.value), "root" in v && t(4, a = v.root), "proxy_url" in v && t(5, l = v.proxy_url), "loading_status" in v && t(6, c = v.loading_status), "label" in v && t(7, u = v.label), "show_label" in v && t(8, d = v.show_label), "container" in v && t(9, f = v.container), "scale" in v && t(10, h = v.scale), "min_width" in v && t(11, g = v.min_width), "gradio" in v && t(12, _ = v.gradio), "height" in v && t(13, m = v.height); + return s.$$set = (S) => { + "elem_id" in S && t(1, n = S.elem_id), "elem_classes" in S && t(2, i = S.elem_classes), "visible" in S && t(3, r = S.visible), "value" in S && t(0, o = S.value), "root" in S && t(4, a = S.root), "proxy_url" in S && t(5, l = S.proxy_url), "loading_status" in S && t(6, c = S.loading_status), "label" in S && t(7, u = S.label), "show_label" in S && t(8, d = S.show_label), "container" in S && t(9, f = S.container), "scale" in S && t(10, h = S.scale), "min_width" in S && t(11, g = S.min_width), "gradio" in S && t(12, _ = S.gradio), "height" in S && t(13, p = S.height), "fps" in S && t(14, m = S.fps); }, [ o, n, @@ -22539,8 +22546,9 @@ function gv(s, e, t) { h, g, _, + p, m, - p + v ]; } class xv extends $S { @@ -22559,7 +22567,8 @@ class xv extends $S { scale: 10, min_width: 11, gradio: 12, - height: 13 + height: 13, + fps: 14 }); } }