!(function () {
function e(e) {
if (null != e) {
var t = e[('function' == typeof Symbol && Symbol.iterator) || '@@iterator'],
n = 0
if (t) return t.call(e)
if ('function' == typeof e.next) return e
if (!isNaN(e.length))
return {
next: function () {
return (e && n >= e.length && (e = void 0), { value: e && e[n++], done: !e })
},
}
}
throw new TypeError(P(e) + ' is not iterable')
}
function t(e) {
var t = Object(e),
n = []
for (var r in t) n.unshift(r)
return function e() {
for (; n.length; ) if ((r = n.pop()) in t) return ((e.value = r), (e.done = !1), e)
return ((e.done = !0), e)
}
}
function n(e, t, n, i) {
var a = r(b(1 & i ? e.prototype : e), t, n)
return 2 & i && 'function' == typeof a
? function (e) {
return a.apply(n, e)
}
: a
}
function r() {
return (
(r =
'undefined' != typeof Reflect && Reflect.get
? Reflect.get.bind()
: function (e, t, n) {
var r = (function (e, t) {
for (; !{}.hasOwnProperty.call(e, t) && null !== (e = b(e)); );
return e
})(e, t)
if (r) {
var i = Object.getOwnPropertyDescriptor(r, t)
return i.get ? i.get.call(arguments.length < 3 ? e : n) : i.value
}
}),
r.apply(null, arguments)
)
}
function i(e, t, n) {
return n(h(e, t))
}
function a(e, t, n) {
return (e.set(h(e, t), n), n)
}
function o(e, t) {
var n = Object.keys(e)
if (Object.getOwnPropertySymbols) {
var r = Object.getOwnPropertySymbols(e)
;(t &&
(r = r.filter(function (t) {
return Object.getOwnPropertyDescriptor(e, t).enumerable
})),
n.push.apply(n, r))
}
return n
}
function s(e) {
for (var t = 1; t < arguments.length; t++) {
var n = null != arguments[t] ? arguments[t] : {}
t % 2
? o(Object(n), !0).forEach(function (t) {
M(e, t, n[t])
})
: Object.getOwnPropertyDescriptors
? Object.defineProperties(e, Object.getOwnPropertyDescriptors(n))
: o(Object(n)).forEach(function (t) {
Object.defineProperty(e, t, Object.getOwnPropertyDescriptor(n, t))
})
}
return e
}
function u(e, t, n) {
;(l(e, t), t.set(e, n))
}
function l(e, t) {
if (t.has(e))
throw new TypeError('Cannot initialize the same private elements twice on an object')
}
function c(e, t) {
return e.get(h(e, t))
}
function h(e, t, n) {
if ('function' == typeof e ? e === t : e.has(t)) return arguments.length < 3 ? t : n
throw new TypeError('Private element is not present on this object')
}
function d() {
/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */ var e,
t,
n = 'function' == typeof Symbol ? Symbol : {},
r = n.iterator || '@@iterator',
i = n.toStringTag || '@@toStringTag'
function a(n, r, i, a) {
var u = r && r.prototype instanceof s ? r : s,
l = Object.create(u.prototype)
return (
f(
l,
'_invoke',
(function (n, r, i) {
var a,
s,
u,
l = 0,
c = i || [],
h = !1,
d = {
p: 0,
n: 0,
v: e,
a: f,
f: f.bind(e, 4),
d: function (t, n) {
return ((a = t), (s = 0), (u = e), (d.n = n), o)
},
}
function f(n, r) {
for (s = n, u = r, t = 0; !h && l && !i && t < c.length; t++) {
var i,
a = c[t],
f = d.p,
p = a[2]
n > 3
? (i = p === r) && ((u = a[(s = a[4]) ? 5 : ((s = 3), 3)]), (a[4] = a[5] = e))
: a[0] <= f &&
((i = n < 2 && f < a[1])
? ((s = 0), (d.v = r), (d.n = a[1]))
: f < p &&
(i = n < 3 || a[0] > r || r > p) &&
((a[4] = n), (a[5] = r), (d.n = p), (s = 0)))
}
if (i || n > 1) return o
throw ((h = !0), r)
}
return function (i, c, p) {
if (l > 1) throw TypeError('Generator is already running')
for (h && 1 === c && f(c, p), s = c, u = p; (t = s < 2 ? e : u) || !h; ) {
a || (s ? (s < 3 ? (s > 1 && (d.n = -1), f(s, u)) : (d.n = u)) : (d.v = u))
try {
if (((l = 2), a)) {
if ((s || (i = 'next'), (t = a[i]))) {
if (!(t = t.call(a, u))) throw TypeError('iterator result is not an object')
if (!t.done) return t
;((u = t.value), s < 2 && (s = 0))
} else
(1 === s && (t = a.return) && t.call(a),
s < 2 &&
((u = TypeError("The iterator does not provide a '" + i + "' method")),
(s = 1)))
a = e
} else if ((t = (h = d.n < 0) ? u : n.call(r, d)) !== o) break
} catch (t) {
;((a = e), (s = 1), (u = t))
} finally {
l = 1
}
}
return { value: t, done: h }
}
})(n, i, a),
!0
),
l
)
}
var o = {}
function s() {}
function u() {}
function l() {}
t = Object.getPrototypeOf
var c = [][r]
? t(t([][r]()))
: (f((t = {}), r, function () {
return this
}),
t),
h = (l.prototype = s.prototype = Object.create(c))
function p(e) {
return (
Object.setPrototypeOf
? Object.setPrototypeOf(e, l)
: ((e.__proto__ = l), f(e, i, 'GeneratorFunction')),
(e.prototype = Object.create(h)),
e
)
}
return (
(u.prototype = l),
f(h, 'constructor', l),
f(l, 'constructor', u),
(u.displayName = 'GeneratorFunction'),
f(l, i, 'GeneratorFunction'),
f(h),
f(h, i, 'Generator'),
f(h, r, function () {
return this
}),
f(h, 'toString', function () {
return '[object Generator]'
}),
(d = function () {
return { w: a, m: p }
})()
)
}
function f(e, t, n, r) {
var i = Object.defineProperty
try {
i({}, '', {})
} catch (e) {
i = 0
}
;((f = function (e, t, n, r) {
if (t) i ? i(e, t, { value: n, enumerable: !r, configurable: !r, writable: !r }) : (e[t] = n)
else {
function a(t, n) {
f(e, t, function (e) {
return this._invoke(t, n, e)
})
}
;(a('next', 0), a('throw', 1), a('return', 2))
}
}),
f(e, t, n, r))
}
function p(e, t, n, r, i, a, o) {
try {
var s = e[a](o),
u = s.value
} catch (e) {
return void n(e)
}
s.done ? t(u) : Promise.resolve(u).then(r, i)
}
function v(e) {
return function () {
var t = this,
n = arguments
return new Promise(function (r, i) {
var a = e.apply(t, n)
function o(e) {
p(a, r, i, o, s, 'next', e)
}
function s(e) {
p(a, r, i, o, s, 'throw', e)
}
o(void 0)
})
}
}
function m(e) {
var t = 'function' == typeof Map ? new Map() : void 0
return (
(m = function (e) {
if (
null === e ||
!(function (e) {
try {
return -1 !== Function.toString.call(e).indexOf('[native code]')
} catch (t) {
return 'function' == typeof e
}
})(e)
)
return e
if ('function' != typeof e)
throw new TypeError('Super expression must either be null or a function')
if (void 0 !== t) {
if (t.has(e)) return t.get(e)
t.set(e, n)
}
function n() {
return g(e, arguments, b(this).constructor)
}
return (
(n.prototype = Object.create(e.prototype, {
constructor: { value: n, enumerable: !1, writable: !0, configurable: !0 },
})),
S(n, e)
)
}),
m(e)
)
}
function g(e, t, n) {
if (_()) return Reflect.construct.apply(null, arguments)
var r = [null]
r.push.apply(r, t)
var i = new (e.bind.apply(e, r))()
return (n && S(i, n.prototype), i)
}
function y(e, t, n) {
return (
(t = b(t)),
(function (e, t) {
if (t && ('object' == P(t) || 'function' == typeof t)) return t
if (void 0 !== t)
throw new TypeError('Derived constructors may only return object or undefined')
return (function (e) {
if (void 0 === e)
throw new ReferenceError("this hasn't been initialised - super() hasn't been called")
return e
})(e)
})(e, _() ? Reflect.construct(t, n || [], b(e).constructor) : t.apply(e, n))
)
}
function _() {
try {
var e = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}))
} catch (e) {}
return (_ = function () {
return !!e
})()
}
function b(e) {
return (
(b = Object.setPrototypeOf
? Object.getPrototypeOf.bind()
: function (e) {
return e.__proto__ || Object.getPrototypeOf(e)
}),
b(e)
)
}
function x(e, t) {
if ('function' != typeof t && null !== t)
throw new TypeError('Super expression must either be null or a function')
;((e.prototype = Object.create(t && t.prototype, {
constructor: { value: e, writable: !0, configurable: !0 },
})),
Object.defineProperty(e, 'prototype', { writable: !1 }),
t && S(e, t))
}
function S(e, t) {
return (
(S = Object.setPrototypeOf
? Object.setPrototypeOf.bind()
: function (e, t) {
return ((e.__proto__ = t), e)
}),
S(e, t)
)
}
function A(e, t) {
if (!(e instanceof t)) throw new TypeError('Cannot call a class as a function')
}
function w(e, t) {
for (var n = 0; n < t.length; n++) {
var r = t[n]
;((r.enumerable = r.enumerable || !1),
(r.configurable = !0),
'value' in r && (r.writable = !0),
Object.defineProperty(e, E(r.key), r))
}
}
function T(e, t, n) {
return (
t && w(e.prototype, t),
n && w(e, n),
Object.defineProperty(e, 'prototype', { writable: !1 }),
e
)
}
function M(e, t, n) {
return (
(t = E(t)) in e
? Object.defineProperty(e, t, { value: n, enumerable: !0, configurable: !0, writable: !0 })
: (e[t] = n),
e
)
}
function E(e) {
var t = (function (e, t) {
if ('object' != P(e) || !e) return e
var n = e[Symbol.toPrimitive]
if (void 0 !== n) {
var r = n.call(e, t || 'default')
if ('object' != P(r)) return r
throw new TypeError('@@toPrimitive must return a primitive value.')
}
return ('string' === t ? String : Number)(e)
})(e, 'string')
return 'symbol' == P(t) ? t : t + ''
}
function C(e, t) {
return (
R(e) ||
(function (e, t) {
var n =
null == e ? null : ('undefined' != typeof Symbol && e[Symbol.iterator]) || e['@@iterator']
if (null != n) {
var r,
i,
a,
o,
s = [],
u = !0,
l = !1
try {
if (((a = (n = n.call(e)).next), 0 === t)) {
if (Object(n) !== n) return
u = !1
} else for (; !(u = (r = a.call(n)).done) && (s.push(r.value), s.length !== t); u = !0);
} catch (e) {
;((l = !0), (i = e))
} finally {
try {
if (!u && null != n.return && ((o = n.return()), Object(o) !== o)) return
} finally {
if (l) throw i
}
}
return s
}
})(e, t) ||
D(e, t) ||
k()
)
}
function k() {
throw new TypeError(
'Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.'
)
}
function R(e) {
if (Array.isArray(e)) return e
}
function I(e) {
return (
(function (e) {
if (Array.isArray(e)) return O(e)
})(e) ||
N(e) ||
D(e) ||
(function () {
throw new TypeError(
'Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.'
)
})()
)
}
function N(e) {
if (('undefined' != typeof Symbol && null != e[Symbol.iterator]) || null != e['@@iterator'])
return Array.from(e)
}
function P(e) {
return (
(P =
'function' == typeof Symbol && 'symbol' == typeof Symbol.iterator
? function (e) {
return typeof e
}
: function (e) {
return e &&
'function' == typeof Symbol &&
e.constructor === Symbol &&
e !== Symbol.prototype
? 'symbol'
: typeof e
}),
P(e)
)
}
function L(e, t) {
var n = ('undefined' != typeof Symbol && e[Symbol.iterator]) || e['@@iterator']
if (!n) {
if (Array.isArray(e) || (n = D(e)) || (t && e && 'number' == typeof e.length)) {
n && (e = n)
var r = 0,
i = function () {}
return {
s: i,
n: function () {
return r >= e.length ? { done: !0 } : { done: !1, value: e[r++] }
},
e: function (e) {
throw e
},
f: i,
}
}
throw new TypeError(
'Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.'
)
}
var a,
o = !0,
s = !1
return {
s: function () {
n = n.call(e)
},
n: function () {
var e = n.next()
return ((o = e.done), e)
},
e: function (e) {
;((s = !0), (a = e))
},
f: function () {
try {
o || null == n.return || n.return()
} finally {
if (s) throw a
}
},
}
}
function D(e, t) {
if (e) {
if ('string' == typeof e) return O(e, t)
var n = {}.toString.call(e).slice(8, -1)
return (
'Object' === n && e.constructor && (n = e.constructor.name),
'Map' === n || 'Set' === n
? Array.from(e)
: 'Arguments' === n || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)
? O(e, t)
: void 0
)
}
}
function O(e, t) {
;(null == t || t > e.length) && (t = e.length)
for (var n = 0, r = Array(t); n < t; n++) r[n] = e[n]
return r
}
function F(e) {
return function () {
return new B(e.apply(this, arguments))
}
}
function B(e) {
var t, n
function r(t, n) {
try {
var a = e[t](n),
o = a.value,
s = o instanceof V
Promise.resolve(s ? o.v : o).then(
function (n) {
if (s) {
var u = 'return' === t ? 'return' : 'next'
if (!o.k || n.done) return r(u, n)
n = e[u](n).value
}
i(a.done ? 'return' : 'normal', n)
},
function (e) {
r('throw', e)
}
)
} catch (e) {
i('throw', e)
}
}
function i(e, i) {
switch (e) {
case 'return':
t.resolve({ value: i, done: !0 })
break
case 'throw':
t.reject(i)
break
default:
t.resolve({ value: i, done: !1 })
}
;(t = t.next) ? r(t.key, t.arg) : (n = null)
}
;((this._invoke = function (e, i) {
return new Promise(function (a, o) {
var s = { key: e, arg: i, resolve: a, reject: o, next: null }
n ? (n = n.next = s) : ((t = n = s), r(e, i))
})
}),
'function' != typeof e.return && (this.return = void 0))
}
function U(e) {
return new V(e, 0)
}
function z(e) {
var t = {},
n = !1
function r(t, r) {
return (
(n = !0),
(r = new Promise(function (n) {
n(e[t](r))
})),
{ done: !1, value: new V(r, 1) }
)
}
return (
(t[('undefined' != typeof Symbol && Symbol.iterator) || '@@iterator'] = function () {
return this
}),
(t.next = function (e) {
return n ? ((n = !1), e) : r('next', e)
}),
'function' == typeof e.throw &&
(t.throw = function (e) {
if (n) throw ((n = !1), e)
return r('throw', e)
}),
'function' == typeof e.return &&
(t.return = function (e) {
return n ? ((n = !1), e) : r('return', e)
}),
t
)
}
function V(e, t) {
;((this.v = e), (this.k = t))
}
function H(e) {
var t,
n,
r,
i = 2
for (
'undefined' != typeof Symbol && ((n = Symbol.asyncIterator), (r = Symbol.iterator));
i--;
) {
if (n && null != (t = e[n])) return t.call(e)
if (r && null != (t = e[r])) return new W(t.call(e))
;((n = '@@asyncIterator'), (r = '@@iterator'))
}
throw new TypeError('Object is not async iterable')
}
function W(e) {
function t(e) {
if (Object(e) !== e) return Promise.reject(new TypeError(e + ' is not an object.'))
var t = e.done
return Promise.resolve(e.value).then(function (e) {
return { value: e, done: t }
})
}
return (
(W = function (e) {
;((this.s = e), (this.n = e.next))
}),
(W.prototype = {
s: null,
n: null,
next: function () {
return t(this.n.apply(this.s, arguments))
},
return: function (e) {
var n = this.s.return
return void 0 === n
? Promise.resolve({ value: e, done: !0 })
: t(n.apply(this.s, arguments))
},
throw: function (e) {
var n = this.s.return
return void 0 === n ? Promise.reject(e) : t(n.apply(this.s, arguments))
},
}),
new W(e)
)
}
;((B.prototype[('function' == typeof Symbol && Symbol.asyncIterator) || '@@asyncIterator'] =
function () {
return this
}),
(B.prototype.next = function (e) {
return this._invoke('next', e)
}),
(B.prototype.throw = function (e) {
return this._invoke('throw', e)
}),
(B.prototype.return = function (e) {
return this._invoke('return', e)
}),
System.register([], function (r, o) {
'use strict'
return {
execute: function () {
var r,
f,
p,
_,
b = document.createElement('style')
/**
* @vue/shared v3.5.17
* (c) 2018-present Yuxi (Evan) You and Vue contributors
* @license MIT
**/
/*! #__NO_SIDE_EFFECTS__ */
function S(e) {
var t,
n = Object.create(null),
r = L(e.split(','))
try {
for (r.s(); !(t = r.n()).done; ) {
var i = t.value
n[i] = 1
}
} catch (a) {
r.e(a)
} finally {
r.f()
}
return function (e) {
return e in n
}
}
;((b.textContent =
'body{margin:0;overflow-y:auto}*{box-sizing:border-box;-webkit-touch-callout:none;-webkit-user-select:none;user-select:none;-webkit-tap-highlight-color:transparent!important}img{pointer-events:none}#app{width:100vw;height:100vh}.access-wrap[data-v-3e18f301]{position:absolute;top:0;left:0;width:100%;height:100%;display:flex;flex-direction:column;align-items:center;justify-content:center}.icon-wrap[data-v-3e18f301]{width:30px;font-size:40px}.icon[data-v-91f3cb32]{width:1em;height:1em;vertical-align:-.15em;fill:currentColor;overflow:hidden;color:inherit;font-size:inherit}.action-group[data-v-628a9c05]{border-radius:12px;background:rgba(88,87,87,.5);padding:2px;backdrop-filter:blur(8px)}.action-group .action[data-v-628a9c05]{cursor:pointer;width:42px;height:42px;border-radius:8px;font-size:20px;display:flex;align-items:center;justify-content:center;position:relative;color:#fff}.action-group .action .corner[data-v-628a9c05]{position:absolute;right:0;bottom:0;padding:3px}.action-group .action .corner .corner-inner[data-v-628a9c05]{width:6px;height:6px;border-top:3px transparent solid;border-left:3px transparent solid;border-bottom:3px #fff solid;border-right:3px #fff solid}.action-group .action .selectors[data-v-628a9c05]{position:absolute;top:0;left:100%;margin-left:3px;max-height:150px;border-radius:12px;width:max-content;overflow:hidden;overflow:auto;background:rgba(90,90,90,.5);backdrop-filter:blur(8px)}.action-group .action .selectors.left[data-v-628a9c05]{left:0;margin-left:-3px;transform:translate(-100%)}.action-group .action .selectors .selector[data-v-628a9c05]{max-width:250px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;position:relative;cursor:pointer;height:42px;line-height:42px;color:#fff;font-size:14px;padding-left:15px;padding-right:50px}.action-group .action .selectors .selector[data-v-628a9c05]:hover{background:#67666a}.action-group .action .selectors .selector .active-icon[data-v-628a9c05]{position:absolute;right:10px;width:40px;height:40px;display:flex;align-items:center;justify-content:center;top:0}.action-group .action[data-v-628a9c05]:hover{background:#67666a}.action-group+.action-group[data-v-628a9c05]{margin-top:10px}.gradio-webrtc-waveContainer[data-v-ba6f2cef]{position:relative;display:flex;min-height:100px;max-height:128px;justify-content:center;align-items:center}.gradio-webrtc-boxContainer[data-v-ba6f2cef]{display:flex;justify-content:space-between;height:64px;--boxSize: 4px;--gutter: 4px}.split-container[data-v-ba6f2cef]{width:80px}.gradio-webrtc-box[data-v-ba6f2cef]{height:100%;width:var(--boxSize);background:var(--color-accent);border-radius:8px;transition:transform .05s ease}.gradio-webrtc-icon-container[data-v-ba6f2cef]{position:relative;width:128px;height:128px;display:flex;justify-content:center;align-items:center}.gradio-webrtc-icon[data-v-ba6f2cef]{position:relative;width:48px;height:48px;border-radius:50%;transition:transform .1s ease;display:flex;justify-content:center;align-items:center;z-index:2}.icon-image[data-v-ba6f2cef]{width:32px;height:32px;object-fit:contain;filter:brightness(0) invert(1)}.pulse-ring[data-v-ba6f2cef]{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);width:48px;height:48px;border-radius:50%;animation:pulse-ba6f2cef 2s cubic-bezier(.4,0,.6,1) infinite;opacity:.5}@keyframes pulse-ba6f2cef{0%{transform:translate(-50%,-50%) scale(1);opacity:.5}to{transform:translate(-50%,-50%) scale(var(--max-scale, 3));opacity:0}}.dots[data-v-ba6f2cef]{display:flex;gap:8px;align-items:center;height:64px}.dot[data-v-ba6f2cef]{width:12px;height:12px;border-radius:50%;opacity:.5;animation:pulse-ba6f2cef 1.5s infinite}.dot[data-v-ba6f2cef]:nth-child(2){animation-delay:.2s}.dot[data-v-ba6f2cef]:nth-child(3){animation-delay:.4s}@keyframes pulse-ba6f2cef{0%,to{opacity:.4;transform:scale(1)}50%{opacity:1;transform:scale(1.1)}}.player-controls[data-v-58c5790e]{height:15%;position:relative;display:flex;justify-content:center;align-items:center;min-height:84px}.player-controls .chat-btn[data-v-58c5790e]{height:64px;width:296px;display:flex;justify-content:center;align-items:center;border-radius:999px;opacity:1;background:linear-gradient(180deg,#7873f6,#524de1);transition:all .3s;z-index:2;cursor:pointer}.player-controls .start-chat[data-v-58c5790e]{font-size:16px;font-weight:500;text-align:center;color:#fff}.player-controls .waiting-icon-text[data-v-58c5790e]{width:80px;align-items:center;font-size:16px;font-weight:500;color:#fff;margin:0 var(--spacing-sm);display:flex;justify-content:space-evenly;gap:var(--size-1)}.player-controls .waiting-icon-text .icon[data-v-58c5790e]{width:25px;height:25px;fill:#fff;stroke:#fff;color:#fff}.player-controls .waiting-icon-text .spin-icon[data-v-58c5790e]{color:#fff}.ant-spin-dot-item{background-color:#fff!important}.player-controls .stop-chat[data-v-58c5790e]{width:64px}.player-controls .stop-chat .stop-chat-inner[data-v-58c5790e]{width:25px;height:25px;border-radius:6.25px;background:#fafafa}.player-controls .input-audio-wave[data-v-58c5790e]{position:absolute}.chat-input-container[data-v-32a58abc]{height:15%;position:relative;display:flex;justify-content:center;align-items:center;min-height:84px;width:calc(100% - 140px);margin:auto}.chat-input-container .chat-input-inner[data-v-32a58abc]{padding:0 12px;background-color:#fff;height:64px;flex:1;display:flex;align-items:center;border:1px solid #e8eaf2;border-radius:20px;box-shadow:0 12px 24px -16px rgba(54,54,73,.04),0 12px 40px rgba(51,51,71,.08),0 0 1px rgba(44,44,54,.02)}.chat-input-container .chat-input-inner .chat-input-wrapper[data-v-32a58abc]{flex:1;position:relative;display:flex;align-items:center}.chat-input-container .chat-input-inner .chat-input-wrapper .chat-input[data-v-32a58abc]{width:100%;border:none;outline:none;color:#26244c;font-size:16px;font-weight:400;resize:none;padding:0;margin:8px 0;line-height:24px;max-height:48px;min-height:24px}.chat-input-container .chat-input-inner .chat-input-wrapper .rowsDiv[data-v-32a58abc]{position:absolute;left:0;right:0;z-index:-1;visibility:hidden;font-size:16px;font-weight:400;line-height:24px;white-space:pre-wrap;word-wrap:break-word}.chat-input-container .chat-input-inner .send-btn[data-v-32a58abc],.chat-input-container .chat-input-inner .interrupt-btn[data-v-32a58abc]{border:none;flex:0 0 auto;background:#615ced;border-radius:20px;height:28px;width:28px;display:flex;align-items:center;justify-content:center;margin-left:16px;cursor:pointer}.chat-input-container .chat-input-inner .interrupt-btn[data-v-32a58abc]:after{content:" ";width:12px;height:12px;border-radius:2px;background:#fafafa}.chat-input-container .stop-chat-btn[data-v-32a58abc]{cursor:pointer;margin-right:12px;height:28px;width:28px;display:flex;justify-content:center;align-items:center;border-radius:999px;opacity:1;background:linear-gradient(180deg,#7873f6,#524de1)}.chat-input-container .stop-chat-btn[data-v-32a58abc]:after{content:" ";width:12px;height:12px;border-radius:2px;background:#fafafa}.answer-message-container[data-v-dde1c5d3]{padding:6px 12px;background:rgba(255,255,255,.8);border-radius:12px;color:#26244c}.answer-message-container.human[data-v-dde1c5d3]{background:rgba(221,221,221,.6);margin-right:0}.answer-message-container.avatar[data-v-dde1c5d3]{background:#9189fa;color:#fff}.chat-records{width:100%;height:100%;overflow-y:auto}.chat-records::-webkit-scrollbar{display:none}.chat-records-inner{display:flex;flex-direction:column;align-items:flex-end;justify-content:end;width:100%;height:auto;min-height:100%}.chat-records-inner .chat-message{margin-bottom:12px;max-width:80%}.chat-records-inner .chat-message.human{align-self:flex-end}.chat-records-inner .chat-message.avatar{align-self:flex-start}.chat-records-inner .chat-message:last-child{margin-bottom:0}.chat-input-wrapper[data-v-269b506f]{margin:0 70px;transition:width .1s ease}.page-container[data-v-269b506f]{height:100%;width:100%;padding:32px;overflow:hidden;display:flex;align-items:flex-start;justify-content:center}.content-container[data-v-269b506f]{height:100%;max-width:100%}.video-container[data-v-269b506f]{position:relative;aspect-ratio:9 / 16;max-width:calc(100% - 134px);height:85%;margin:0 70px}.video-container .local-video-container[data-v-269b506f]{position:absolute;top:0;left:0;width:100%;height:100%;border-radius:32px;overflow:hidden;display:flex;align-items:center;justify-content:center;z-index:1;background:#fff;transition:all .3s ease}.video-container .local-video-container.scaled[data-v-269b506f]{top:auto;left:12px;bottom:12px;width:calc(50% - 12px);height:auto}.video-container .remote-video-container[data-v-269b506f]{width:100%;height:100%;overflow:hidden;border-radius:32px;transition:all .3s linear;background:#fff}.video-container .local-video[data-v-269b506f]{width:100%;height:auto;object-fit:contain;object-position:center center}.video-container .remote-video[data-v-269b506f]{width:101%;height:100%;object-fit:cover}.video-container .remote-canvas[data-v-269b506f]{width:100%;height:100%}.actions[data-v-269b506f]{position:absolute;z-index:2;left:calc(100% + 12px);bottom:0}.chat-records-container[data-v-269b506f]{height:85%;overflow:auto;aspect-ratio:9 / 16;z-index:1}.chat-records-container.inline[data-v-269b506f]{position:absolute;bottom:0;right:0;width:50%;padding:10px}.wrap[data-v-45f9c857]{background-image:url(' +
new URL('background.png', o.meta.url).href +
');height:max(80vh,100%);background-size:100% 100%;background-repeat:no-repeat;position:relative}.wrap[data-v-45f9c857] *::-webkit-scrollbar{display:none}\n/*$vite$:1*/'),
document.head.appendChild(b))
var w,
E = {},
O = [],
B = function () {},
V = function () {
return !1
},
W = function (e) {
return (
111 === e.charCodeAt(0) &&
110 === e.charCodeAt(1) &&
(e.charCodeAt(2) > 122 || e.charCodeAt(2) < 97)
)
},
G = function (e) {
return e.startsWith('onUpdate:')
},
j = Object.assign,
Q = function (e, t) {
var n = e.indexOf(t)
n > -1 && e.splice(n, 1)
},
q = Object.prototype.hasOwnProperty,
X = function (e, t) {
return q.call(e, t)
},
Y = Array.isArray,
K = function (e) {
return '[object Map]' === ie(e)
},
Z = function (e) {
return '[object Set]' === ie(e)
},
J = function (e) {
return 'function' == typeof e
},
$ = function (e) {
return 'string' == typeof e
},
ee = function (e) {
return 'symbol' === P(e)
},
te = function (e) {
return null !== e && 'object' === P(e)
},
ne = function (e) {
return (te(e) || J(e)) && J(e.then) && J(e.catch)
},
re = Object.prototype.toString,
ie = function (e) {
return re.call(e)
},
ae = function (e) {
return '[object Object]' === ie(e)
},
oe = function (e) {
return $(e) && 'NaN' !== e && '-' !== e[0] && '' + parseInt(e, 10) === e
},
se = S(
',key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted'
),
ue = function (e) {
var t = Object.create(null)
return function (n) {
return t[n] || (t[n] = e(n))
}
},
le = /-(\w)/g,
ce = ue(function (e) {
return e.replace(le, function (e, t) {
return t ? t.toUpperCase() : ''
})
}),
he = /\B([A-Z])/g,
de = ue(function (e) {
return e.replace(he, '-$1').toLowerCase()
}),
fe = ue(function (e) {
return e.charAt(0).toUpperCase() + e.slice(1)
}),
pe = ue(function (e) {
return e ? 'on'.concat(fe(e)) : ''
}),
ve = function (e, t) {
return !Object.is(e, t)
},
me = function (e) {
for (var t = arguments.length, n = new Array(t > 1 ? t - 1 : 0), r = 1; r < t; r++)
n[r - 1] = arguments[r]
for (var i = 0; i < e.length; i++) e[i].apply(e, n)
},
ge = function (e, t, n) {
var r = arguments.length > 3 && void 0 !== arguments[3] && arguments[3]
Object.defineProperty(e, t, {
configurable: !0,
enumerable: !1,
writable: r,
value: n,
})
},
ye = function (e) {
var t = parseFloat(e)
return isNaN(t) ? e : t
},
_e = function () {
return (
w ||
(w =
'undefined' != typeof globalThis
? globalThis
: 'undefined' != typeof self
? self
: 'undefined' != typeof window
? window
: 'undefined' != typeof global
? global
: {})
)
}
function be(e) {
if (Y(e)) {
for (var t = {}, n = 0; n < e.length; n++) {
var r = e[n],
i = $(r) ? we(r) : be(r)
if (i) for (var a in i) t[a] = i[a]
}
return t
}
if ($(e) || te(e)) return e
}
var xe = /;(?![^(]*\))/g,
Se = /:([^]+)/,
Ae = /\/\*[^]*?\*\//g
function we(e) {
var t = {}
return (
e
.replace(Ae, '')
.split(xe)
.forEach(function (e) {
if (e) {
var n = e.split(Se)
n.length > 1 && (t[n[0].trim()] = n[1].trim())
}
}),
t
)
}
function Te(e) {
var t = ''
if ($(e)) t = e
else if (Y(e))
for (var n = 0; n < e.length; n++) {
var r = Te(e[n])
r && (t += r + ' ')
}
else if (te(e)) for (var i in e) e[i] && (t += i + ' ')
return t.trim()
}
var Me = S('itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly')
function Ee(e) {
return !!e || '' === e
}
var Ce,
ke,
Re = function (e) {
return !(!e || !0 !== e.__v_isRef)
},
Ie = function (e) {
return $(e)
? e
: null == e
? ''
: Y(e) || (te(e) && (e.toString === re || !J(e.toString)))
? Re(e)
? Ie(e.value)
: JSON.stringify(e, Ne, 2)
: String(e)
},
Ne = function (e, t) {
return Re(t)
? Ne(e, t.value)
: K(t)
? M(
{},
'Map('.concat(t.size, ')'),
I(t.entries()).reduce(function (e, t, n) {
var r = C(t, 2),
i = r[0],
a = r[1]
return ((e[Pe(i, n) + ' =>'] = a), e)
}, {})
)
: Z(t)
? M(
{},
'Set('.concat(t.size, ')'),
I(t.values()).map(function (e) {
return Pe(e)
})
)
: ee(t)
? Pe(t)
: !te(t) || Y(t) || ae(t)
? t
: String(t)
},
Pe = function (e) {
var t,
n = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : ''
return ee(e) ? 'Symbol('.concat(null != (t = e.description) ? t : n, ')') : e
},
Le = (function () {
return T(
function e() {
var t = arguments.length > 0 && void 0 !== arguments[0] && arguments[0]
;(A(this, e),
(this.detached = t),
(this._active = !0),
(this._on = 0),
(this.effects = []),
(this.cleanups = []),
(this._isPaused = !1),
(this.parent = Ce),
!t && Ce && (this.index = (Ce.scopes || (Ce.scopes = [])).push(this) - 1))
},
[
{
key: 'active',
get: function () {
return this._active
},
},
{
key: 'pause',
value: function () {
if (this._active) {
var e, t
if (((this._isPaused = !0), this.scopes))
for (e = 0, t = this.scopes.length; e < t; e++) this.scopes[e].pause()
for (e = 0, t = this.effects.length; e < t; e++) this.effects[e].pause()
}
},
},
{
key: 'resume',
value: function () {
if (this._active && this._isPaused) {
var e, t
if (((this._isPaused = !1), this.scopes))
for (e = 0, t = this.scopes.length; e < t; e++) this.scopes[e].resume()
for (e = 0, t = this.effects.length; e < t; e++) this.effects[e].resume()
}
},
},
{
key: 'run',
value: function (e) {
if (this._active) {
var t = Ce
try {
return ((Ce = this), e())
} finally {
Ce = t
}
}
},
},
{
key: 'on',
value: function () {
1 === ++this._on && ((this.prevScope = Ce), (Ce = this))
},
},
{
key: 'off',
value: function () {
this._on > 0 &&
0 === --this._on &&
((Ce = this.prevScope), (this.prevScope = void 0))
},
},
{
key: 'stop',
value: function (e) {
if (this._active) {
var t, n
for (this._active = !1, t = 0, n = this.effects.length; t < n; t++)
this.effects[t].stop()
for (this.effects.length = 0, t = 0, n = this.cleanups.length; t < n; t++)
this.cleanups[t]()
if (((this.cleanups.length = 0), this.scopes)) {
for (t = 0, n = this.scopes.length; t < n; t++) this.scopes[t].stop(!0)
this.scopes.length = 0
}
if (!this.detached && this.parent && !e) {
var r = this.parent.scopes.pop()
r &&
r !== this &&
((this.parent.scopes[this.index] = r), (r.index = this.index))
}
this.parent = void 0
}
},
},
]
)
})()
function De(e) {
return new Le(e)
}
function Oe() {
return Ce
}
var Fe,
Be,
Ue = new WeakSet(),
ze = (function () {
return T(
function e(t) {
;(A(this, e),
(this.fn = t),
(this.deps = void 0),
(this.depsTail = void 0),
(this.flags = 5),
(this.next = void 0),
(this.cleanup = void 0),
(this.scheduler = void 0),
Ce && Ce.active && Ce.effects.push(this))
},
[
{
key: 'pause',
value: function () {
this.flags |= 64
},
},
{
key: 'resume',
value: function () {
64 & this.flags &&
((this.flags &= -65), Ue.has(this) && (Ue.delete(this), this.trigger()))
},
},
{
key: 'notify',
value: function () {
;(2 & this.flags && !(32 & this.flags)) || 8 & this.flags || He(this)
},
},
{
key: 'run',
value: function () {
if (!(1 & this.flags)) return this.fn()
;((this.flags |= 2), tt(this), je(this))
var e = ke,
t = Ze
;((ke = this), (Ze = !0))
try {
return this.fn()
} finally {
;(Qe(this), (ke = e), (Ze = t), (this.flags &= -3))
}
},
},
{
key: 'stop',
value: function () {
if (1 & this.flags) {
for (var e = this.deps; e; e = e.nextDep) Ye(e)
;((this.deps = this.depsTail = void 0),
tt(this),
this.onStop && this.onStop(),
(this.flags &= -2))
}
},
},
{
key: 'trigger',
value: function () {
64 & this.flags
? Ue.add(this)
: this.scheduler
? this.scheduler()
: this.runIfDirty()
},
},
{
key: 'runIfDirty',
value: function () {
qe(this) && this.run()
},
},
{
key: 'dirty',
get: function () {
return qe(this)
},
},
]
)
})(),
Ve = 0
function He(e) {
var t = arguments.length > 1 && void 0 !== arguments[1] && arguments[1]
if (((e.flags |= 8), t)) return ((e.next = Be), void (Be = e))
;((e.next = Fe), (Fe = e))
}
function We() {
Ve++
}
function Ge() {
if (!(--Ve > 0)) {
if (Be) {
var e = Be
for (Be = void 0; e; ) {
var t = e.next
;((e.next = void 0), (e.flags &= -9), (e = t))
}
}
for (var n; Fe; ) {
var r = Fe
for (Fe = void 0; r; ) {
var i = r.next
if (((r.next = void 0), (r.flags &= -9), 1 & r.flags))
try {
r.trigger()
} catch (a) {
n || (n = a)
}
r = i
}
}
if (n) throw n
}
}
function je(e) {
for (var t = e.deps; t; t = t.nextDep)
((t.version = -1), (t.prevActiveLink = t.dep.activeLink), (t.dep.activeLink = t))
}
function Qe(e) {
for (var t, n = e.depsTail, r = n; r; ) {
var i = r.prevDep
;(-1 === r.version ? (r === n && (n = i), Ye(r), Ke(r)) : (t = r),
(r.dep.activeLink = r.prevActiveLink),
(r.prevActiveLink = void 0),
(r = i))
}
;((e.deps = t), (e.depsTail = n))
}
function qe(e) {
for (var t = e.deps; t; t = t.nextDep)
if (
t.dep.version !== t.version ||
(t.dep.computed && (Xe(t.dep.computed) || t.dep.version !== t.version))
)
return !0
return !!e._dirty
}
function Xe(e) {
if (
(!(4 & e.flags) || 16 & e.flags) &&
((e.flags &= -17),
e.globalVersion !== nt &&
((e.globalVersion = nt),
e.isSSR || !(128 & e.flags) || ((e.deps || e._dirty) && qe(e))))
) {
e.flags |= 2
var t = e.dep,
n = ke,
r = Ze
;((ke = e), (Ze = !0))
try {
je(e)
var i = e.fn(e._value)
;(0 === t.version || ve(i, e._value)) &&
((e.flags |= 128), (e._value = i), t.version++)
} catch (a) {
throw (t.version++, a)
} finally {
;((ke = n), (Ze = r), Qe(e), (e.flags &= -3))
}
}
}
function Ye(e) {
var t = arguments.length > 1 && void 0 !== arguments[1] && arguments[1],
n = e.dep,
r = e.prevSub,
i = e.nextSub
if (
(r && ((r.nextSub = i), (e.prevSub = void 0)),
i && ((i.prevSub = r), (e.nextSub = void 0)),
n.subs === e && ((n.subs = r), !r && n.computed))
) {
n.computed.flags &= -5
for (var a = n.computed.deps; a; a = a.nextDep) Ye(a, !0)
}
t || --n.sc || !n.map || n.map.delete(n.key)
}
function Ke(e) {
var t = e.prevDep,
n = e.nextDep
;(t && ((t.nextDep = n), (e.prevDep = void 0)),
n && ((n.prevDep = t), (e.nextDep = void 0)))
}
var Ze = !0,
Je = []
function $e() {
;(Je.push(Ze), (Ze = !1))
}
function et() {
var e = Je.pop()
Ze = void 0 === e || e
}
function tt(e) {
var t = e.cleanup
if (((e.cleanup = void 0), t)) {
var n = ke
ke = void 0
try {
t()
} finally {
ke = n
}
}
}
var nt = 0,
rt = T(function e(t, n) {
;(A(this, e),
(this.sub = t),
(this.dep = n),
(this.version = n.version),
(this.nextDep =
this.prevDep =
this.nextSub =
this.prevSub =
this.prevActiveLink =
void 0))
}),
it = (function () {
return T(
function e(t) {
;(A(this, e),
(this.computed = t),
(this.version = 0),
(this.activeLink = void 0),
(this.subs = void 0),
(this.map = void 0),
(this.key = void 0),
(this.sc = 0),
(this.__v_skip = !0))
},
[
{
key: 'track',
value: function (e) {
if (ke && Ze && ke !== this.computed) {
var t = this.activeLink
if (void 0 === t || t.sub !== ke)
((t = this.activeLink = new rt(ke, this)),
ke.deps
? ((t.prevDep = ke.depsTail),
(ke.depsTail.nextDep = t),
(ke.depsTail = t))
: (ke.deps = ke.depsTail = t),
at(t))
else if (-1 === t.version && ((t.version = this.version), t.nextDep)) {
var n = t.nextDep
;((n.prevDep = t.prevDep),
t.prevDep && (t.prevDep.nextDep = n),
(t.prevDep = ke.depsTail),
(t.nextDep = void 0),
(ke.depsTail.nextDep = t),
(ke.depsTail = t),
ke.deps === t && (ke.deps = n))
}
return t
}
},
},
{
key: 'trigger',
value: function (e) {
;(this.version++, nt++, this.notify(e))
},
},
{
key: 'notify',
value: function (e) {
We()
try {
0
for (var t = this.subs; t; t = t.prevSub)
t.sub.notify() && t.sub.dep.notify()
} finally {
Ge()
}
},
},
]
)
})()
function at(e) {
if ((e.dep.sc++, 4 & e.sub.flags)) {
var t = e.dep.computed
if (t && !e.dep.subs) {
t.flags |= 20
for (var n = t.deps; n; n = n.nextDep) at(n)
}
var r = e.dep.subs
;(r !== e && ((e.prevSub = r), r && (r.nextSub = e)), (e.dep.subs = e))
}
}
var ot = new WeakMap(),
st = Symbol(''),
ut = Symbol(''),
lt = Symbol('')
function ct(e, t, n) {
if (Ze && ke) {
var r = ot.get(e)
r || ot.set(e, (r = new Map()))
var i = r.get(n)
;(i || (r.set(n, (i = new it())), (i.map = r), (i.key = n)), i.track())
}
}
function ht(e, t, n, r, i, a) {
var o = ot.get(e)
if (o) {
var s = function (e) {
e && e.trigger()
}
if ((We(), 'clear' === t)) o.forEach(s)
else {
var u = Y(e),
l = u && oe(n)
if (u && 'length' === n) {
var c = Number(r)
o.forEach(function (e, t) {
;('length' === t || t === lt || (!ee(t) && t >= c)) && s(e)
})
} else
switch (((void 0 !== n || o.has(void 0)) && s(o.get(n)), l && s(o.get(lt)), t)) {
case 'add':
u ? l && s(o.get('length')) : (s(o.get(st)), K(e) && s(o.get(ut)))
break
case 'delete':
u || (s(o.get(st)), K(e) && s(o.get(ut)))
break
case 'set':
K(e) && s(o.get(st))
}
}
Ge()
} else nt++
}
function dt(e) {
var t = Kt(e)
return t === e ? t : (ct(t, 0, lt), Xt(e) ? t : t.map(Jt))
}
function ft(e) {
return (ct((e = Kt(e)), 0, lt), e)
}
var pt =
(M(
M(
M(
M(
M(
M(
M(
M(
M(
M((r = { __proto__: null }), Symbol.iterator, function () {
return vt(this, Symbol.iterator, Jt)
}),
'concat',
function () {
for (
var e, t = arguments.length, n = new Array(t), r = 0;
r < t;
r++
)
n[r] = arguments[r]
return (e = dt(this)).concat.apply(
e,
I(
n.map(function (e) {
return Y(e) ? dt(e) : e
})
)
)
}
),
'entries',
function () {
return vt(this, 'entries', function (e) {
return ((e[1] = Jt(e[1])), e)
})
}
),
'every',
function (e, t) {
return gt(this, 'every', e, t, void 0, arguments)
}
),
'filter',
function (e, t) {
return gt(
this,
'filter',
e,
t,
function (e) {
return e.map(Jt)
},
arguments
)
}
),
'find',
function (e, t) {
return gt(this, 'find', e, t, Jt, arguments)
}
),
'findIndex',
function (e, t) {
return gt(this, 'findIndex', e, t, void 0, arguments)
}
),
'findLast',
function (e, t) {
return gt(this, 'findLast', e, t, Jt, arguments)
}
),
'findLastIndex',
function (e, t) {
return gt(this, 'findLastIndex', e, t, void 0, arguments)
}
),
'forEach',
function (e, t) {
return gt(this, 'forEach', e, t, void 0, arguments)
}
),
M(
M(
M(
M(
M(
M(
M(
M(
M(
M(r, 'includes', function () {
for (var e = arguments.length, t = new Array(e), n = 0; n < e; n++)
t[n] = arguments[n]
return _t(this, 'includes', t)
}),
'indexOf',
function () {
for (var e = arguments.length, t = new Array(e), n = 0; n < e; n++)
t[n] = arguments[n]
return _t(this, 'indexOf', t)
}
),
'join',
function (e) {
return dt(this).join(e)
}
),
'lastIndexOf',
function () {
for (var e = arguments.length, t = new Array(e), n = 0; n < e; n++)
t[n] = arguments[n]
return _t(this, 'lastIndexOf', t)
}
),
'map',
function (e, t) {
return gt(this, 'map', e, t, void 0, arguments)
}
),
'pop',
function () {
return bt(this, 'pop')
}
),
'push',
function () {
for (var e = arguments.length, t = new Array(e), n = 0; n < e; n++)
t[n] = arguments[n]
return bt(this, 'push', t)
}
),
'reduce',
function (e) {
for (
var t = arguments.length, n = new Array(t > 1 ? t - 1 : 0), r = 1;
r < t;
r++
)
n[r - 1] = arguments[r]
return yt(this, 'reduce', e, n)
}
),
'reduceRight',
function (e) {
for (
var t = arguments.length, n = new Array(t > 1 ? t - 1 : 0), r = 1;
r < t;
r++
)
n[r - 1] = arguments[r]
return yt(this, 'reduceRight', e, n)
}
),
'shift',
function () {
return bt(this, 'shift')
}
),
M(
M(
M(
M(
M(
M(
M(r, 'some', function (e, t) {
return gt(this, 'some', e, t, void 0, arguments)
}),
'splice',
function () {
for (var e = arguments.length, t = new Array(e), n = 0; n < e; n++)
t[n] = arguments[n]
return bt(this, 'splice', t)
}
),
'toReversed',
function () {
return dt(this).toReversed()
}
),
'toSorted',
function (e) {
return dt(this).toSorted(e)
}
),
'toSpliced',
function () {
var e
return (e = dt(this)).toSpliced.apply(e, arguments)
}
),
'unshift',
function () {
for (var e = arguments.length, t = new Array(e), n = 0; n < e; n++)
t[n] = arguments[n]
return bt(this, 'unshift', t)
}
),
'values',
function () {
return vt(this, 'values', Jt)
}
))
function vt(e, t, n) {
var r = ft(e),
i = r[t]()
return (
r === e ||
Xt(e) ||
((i._next = i.next),
(i.next = function () {
var e = i._next()
return (e.value && (e.value = n(e.value)), e)
})),
i
)
}
var mt = Array.prototype
function gt(e, t, n, r, i, a) {
var o = ft(e),
s = o !== e && !Xt(e),
u = o[t]
if (u !== mt[t]) {
var l = u.apply(e, a)
return s ? Jt(l) : l
}
var c = n
o !== e &&
(s
? (c = function (t, r) {
return n.call(this, Jt(t), r, e)
})
: n.length > 2 &&
(c = function (t, r) {
return n.call(this, t, r, e)
}))
var h = u.call(o, c, r)
return s && i ? i(h) : h
}
function yt(e, t, n, r) {
var i = ft(e),
a = n
return (
i !== e &&
(Xt(e)
? n.length > 3 &&
(a = function (t, r, i) {
return n.call(this, t, r, i, e)
})
: (a = function (t, r, i) {
return n.call(this, t, Jt(r), i, e)
})),
i[t].apply(i, [a].concat(I(r)))
)
}
function _t(e, t, n) {
var r = Kt(e)
ct(r, 0, lt)
var i = r[t].apply(r, I(n))
return (-1 !== i && !1 !== i) || !Yt(n[0])
? i
: ((n[0] = Kt(n[0])), r[t].apply(r, I(n)))
}
function bt(e, t) {
var n = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : []
;($e(), We())
var r = Kt(e)[t].apply(e, n)
return (Ge(), et(), r)
}
var xt = S('__proto__,__v_isRef,__isVue'),
St = new Set(
Object.getOwnPropertyNames(Symbol)
.filter(function (e) {
return 'arguments' !== e && 'caller' !== e
})
.map(function (e) {
return Symbol[e]
})
.filter(ee)
)
function At(e) {
ee(e) || (e = String(e))
var t = Kt(this)
return (ct(t, 0, e), t.hasOwnProperty(e))
}
var wt = (function () {
return T(
function e() {
var t = arguments.length > 0 && void 0 !== arguments[0] && arguments[0],
n = arguments.length > 1 && void 0 !== arguments[1] && arguments[1]
;(A(this, e), (this._isReadonly = t), (this._isShallow = n))
},
[
{
key: 'get',
value: function (e, t, n) {
if ('__v_skip' === t) return e.__v_skip
var r = this._isReadonly,
i = this._isShallow
if ('__v_isReactive' === t) return !r
if ('__v_isReadonly' === t) return r
if ('__v_isShallow' === t) return i
if ('__v_raw' === t)
return n === (r ? (i ? Vt : zt) : i ? Ut : Bt).get(e) ||
Object.getPrototypeOf(e) === Object.getPrototypeOf(n)
? e
: void 0
var a = Y(e)
if (!r) {
var o
if (a && (o = pt[t])) return o
if ('hasOwnProperty' === t) return At
}
var s = Reflect.get(e, t, en(e) ? e : n)
return (ee(t) ? St.has(t) : xt(t))
? s
: (r || ct(e, 0, t),
i
? s
: en(s)
? a && oe(t)
? s
: s.value
: te(s)
? r
? Gt(s)
: Wt(s)
: s)
},
},
]
)
})(),
Tt = (function (e) {
function t() {
var e = arguments.length > 0 && void 0 !== arguments[0] && arguments[0]
return (A(this, t), y(this, t, [!1, e]))
}
return (
x(t, e),
T(t, [
{
key: 'set',
value: function (e, t, n, r) {
var i = e[t]
if (!this._isShallow) {
var a = qt(i)
if (
(Xt(n) || qt(n) || ((i = Kt(i)), (n = Kt(n))), !Y(e) && en(i) && !en(n))
)
return !a && ((i.value = n), !0)
}
var o = Y(e) && oe(t) ? Number(t) < e.length : X(e, t),
s = Reflect.set(e, t, n, en(e) ? e : r)
return (
e === Kt(r) && (o ? ve(n, i) && ht(e, 'set', t, n) : ht(e, 'add', t, n)),
s
)
},
},
{
key: 'deleteProperty',
value: function (e, t) {
var n = X(e, t)
e[t]
var r = Reflect.deleteProperty(e, t)
return (r && n && ht(e, 'delete', t, void 0), r)
},
},
{
key: 'has',
value: function (e, t) {
var n = Reflect.has(e, t)
return ((ee(t) && St.has(t)) || ct(e, 0, t), n)
},
},
{
key: 'ownKeys',
value: function (e) {
return (ct(e, 0, Y(e) ? 'length' : st), Reflect.ownKeys(e))
},
},
])
)
})(wt),
Mt = (function (e) {
function t() {
var e = arguments.length > 0 && void 0 !== arguments[0] && arguments[0]
return (A(this, t), y(this, t, [!0, e]))
}
return (
x(t, e),
T(t, [
{
key: 'set',
value: function (e, t) {
return !0
},
},
{
key: 'deleteProperty',
value: function (e, t) {
return !0
},
},
])
)
})(wt),
Et = new Tt(),
Ct = new Mt(),
kt = new Tt(!0),
Rt = function (e) {
return e
},
It = function (e) {
return Reflect.getPrototypeOf(e)
}
function Nt(e) {
return function () {
return 'delete' !== e && ('clear' === e ? void 0 : this)
}
}
function Pt(e, t) {
var n = {
get: function (n) {
var r = this.__v_raw,
i = Kt(r),
a = Kt(n)
e || (ve(n, a) && ct(i, 0, n), ct(i, 0, a))
var o = It(i).has,
s = t ? Rt : e ? $t : Jt
return o.call(i, n)
? s(r.get(n))
: o.call(i, a)
? s(r.get(a))
: void (r !== i && r.get(n))
},
get size() {
var t = this.__v_raw
return (!e && ct(Kt(t), 0, st), Reflect.get(t, 'size', t))
},
has: function (t) {
var n = this.__v_raw,
r = Kt(n),
i = Kt(t)
return (
e || (ve(t, i) && ct(r, 0, t), ct(r, 0, i)),
t === i ? n.has(t) : n.has(t) || n.has(i)
)
},
forEach: function (n, r) {
var i = this,
a = i.__v_raw,
o = Kt(a),
s = t ? Rt : e ? $t : Jt
return (
!e && ct(o, 0, st),
a.forEach(function (e, t) {
return n.call(r, s(e), s(t), i)
})
)
},
}
return (
j(
n,
e
? { add: Nt('add'), set: Nt('set'), delete: Nt('delete'), clear: Nt('clear') }
: {
add: function (e) {
t || Xt(e) || qt(e) || (e = Kt(e))
var n = Kt(this)
return (It(n).has.call(n, e) || (n.add(e), ht(n, 'add', e, e)), this)
},
set: function (e, n) {
t || Xt(n) || qt(n) || (n = Kt(n))
var r = Kt(this),
i = It(r),
a = i.has,
o = i.get,
s = a.call(r, e)
s || ((e = Kt(e)), (s = a.call(r, e)))
var u = o.call(r, e)
return (
r.set(e, n),
s ? ve(n, u) && ht(r, 'set', e, n) : ht(r, 'add', e, n),
this
)
},
delete: function (e) {
var t = Kt(this),
n = It(t),
r = n.has,
i = n.get,
a = r.call(t, e)
;(a || ((e = Kt(e)), (a = r.call(t, e))), i && i.call(t, e))
var o = t.delete(e)
return (a && ht(t, 'delete', e, void 0), o)
},
clear: function () {
var e = Kt(this),
t = 0 !== e.size,
n = e.clear()
return (t && ht(e, 'clear', void 0, void 0), n)
},
}
),
['keys', 'values', 'entries', Symbol.iterator].forEach(function (r) {
n[r] = (function (e, t, n) {
return function () {
var r = this.__v_raw,
i = Kt(r),
a = K(i),
o = 'entries' === e || (e === Symbol.iterator && a),
s = 'keys' === e && a,
u = r[e].apply(r, arguments),
l = n ? Rt : t ? $t : Jt
return (
!t && ct(i, 0, s ? ut : st),
M(
{
next: function () {
var e = u.next(),
t = e.value,
n = e.done
return n
? { value: t, done: n }
: { value: o ? [l(t[0]), l(t[1])] : l(t), done: n }
},
},
Symbol.iterator,
function () {
return this
}
)
)
}
})(r, e, t)
}),
n
)
}
function Lt(e, t) {
var n = Pt(e, t)
return function (t, r, i) {
return '__v_isReactive' === r
? !e
: '__v_isReadonly' === r
? e
: '__v_raw' === r
? t
: Reflect.get(X(n, r) && r in t ? n : t, r, i)
}
}
var Dt = { get: Lt(!1, !1) },
Ot = { get: Lt(!1, !0) },
Ft = { get: Lt(!0, !1) },
Bt = new WeakMap(),
Ut = new WeakMap(),
zt = new WeakMap(),
Vt = new WeakMap()
function Ht(e) {
return e.__v_skip || !Object.isExtensible(e)
? 0
: (function (e) {
switch (e) {
case 'Object':
case 'Array':
return 1
case 'Map':
case 'Set':
case 'WeakMap':
case 'WeakSet':
return 2
default:
return 0
}
})(
(function (e) {
return ie(e).slice(8, -1)
})(e)
)
}
function Wt(e) {
return qt(e) ? e : jt(e, !1, Et, Dt, Bt)
}
function Gt(e) {
return jt(e, !0, Ct, Ft, zt)
}
function jt(e, t, n, r, i) {
if (!te(e)) return e
if (e.__v_raw && (!t || !e.__v_isReactive)) return e
var a = Ht(e)
if (0 === a) return e
var o = i.get(e)
if (o) return o
var s = new Proxy(e, 2 === a ? r : n)
return (i.set(e, s), s)
}
function Qt(e) {
return qt(e) ? Qt(e.__v_raw) : !(!e || !e.__v_isReactive)
}
function qt(e) {
return !(!e || !e.__v_isReadonly)
}
function Xt(e) {
return !(!e || !e.__v_isShallow)
}
function Yt(e) {
return !!e && !!e.__v_raw
}
function Kt(e) {
var t = e && e.__v_raw
return t ? Kt(t) : e
}
function Zt(e) {
return (!X(e, '__v_skip') && Object.isExtensible(e) && ge(e, '__v_skip', !0), e)
}
var Jt = function (e) {
return te(e) ? Wt(e) : e
},
$t = function (e) {
return te(e) ? Gt(e) : e
}
function en(e) {
return !!e && !0 === e.__v_isRef
}
function tn(e) {
return rn(e, !1)
}
function nn(e) {
return rn(e, !0)
}
function rn(e, t) {
return en(e) ? e : new an(e, t)
}
var an = (function () {
return T(
function e(t, n) {
;(A(this, e),
(this.dep = new it()),
(this.__v_isRef = !0),
(this.__v_isShallow = !1),
(this._rawValue = n ? t : Kt(t)),
(this._value = n ? t : Jt(t)),
(this.__v_isShallow = n))
},
[
{
key: 'value',
get: function () {
return (this.dep.track(), this._value)
},
set: function (e) {
var t = this._rawValue,
n = this.__v_isShallow || Xt(e) || qt(e)
;((e = n ? e : Kt(e)),
ve(e, t) &&
((this._rawValue = e), (this._value = n ? e : Jt(e)), this.dep.trigger()))
},
},
]
)
})()
function on(e) {
return en(e) ? e.value : e
}
var sn = {
get: function (e, t, n) {
return '__v_raw' === t ? e : on(Reflect.get(e, t, n))
},
set: function (e, t, n, r) {
var i = e[t]
return en(i) && !en(n) ? ((i.value = n), !0) : Reflect.set(e, t, n, r)
},
}
function un(e) {
return Qt(e) ? e : new Proxy(e, sn)
}
var ln = (function () {
return T(
function e(t, n, r) {
;(A(this, e),
(this._object = t),
(this._key = n),
(this._defaultValue = r),
(this.__v_isRef = !0),
(this._value = void 0))
},
[
{
key: 'value',
get: function () {
var e = this._object[this._key]
return (this._value = void 0 === e ? this._defaultValue : e)
},
set: function (e) {
this._object[this._key] = e
},
},
{
key: 'dep',
get: function () {
return (function (e, t) {
var n = ot.get(e)
return n && n.get(t)
})(Kt(this._object), this._key)
},
},
]
)
})(),
cn = (function () {
return T(
function e(t) {
;(A(this, e),
(this._getter = t),
(this.__v_isRef = !0),
(this.__v_isReadonly = !0),
(this._value = void 0))
},
[
{
key: 'value',
get: function () {
return (this._value = this._getter())
},
},
]
)
})()
function hn(e, t, n) {
var r = e[t]
return en(r) ? r : new ln(e, t, n)
}
var dn = (function () {
return T(
function e(t, n, r) {
;(A(this, e),
(this.fn = t),
(this.setter = n),
(this._value = void 0),
(this.dep = new it(this)),
(this.__v_isRef = !0),
(this.deps = void 0),
(this.depsTail = void 0),
(this.flags = 16),
(this.globalVersion = nt - 1),
(this.next = void 0),
(this.effect = this),
(this.__v_isReadonly = !n),
(this.isSSR = r))
},
[
{
key: 'notify',
value: function () {
if (((this.flags |= 16), !(8 & this.flags) && ke !== this))
return (He(this, !0), !0)
},
},
{
key: 'value',
get: function () {
var e = this.dep.track()
return (Xe(this), e && (e.version = this.dep.version), this._value)
},
set: function (e) {
this.setter && this.setter(e)
},
},
]
)
})()
var fn = {},
pn = new WeakMap(),
vn = void 0
function mn(e, t) {
var n,
r,
i,
a,
o = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : E,
s = o.immediate,
u = o.deep,
l = o.once,
c = o.scheduler,
h = o.augmentJob,
d = o.call,
f = function (e) {
return u ? e : Xt(e) || !1 === u || 0 === u ? gn(e, 1) : gn(e)
},
p = !1,
v = !1
if (
(en(e)
? ((r = function () {
return e.value
}),
(p = Xt(e)))
: Qt(e)
? ((r = function () {
return f(e)
}),
(p = !0))
: Y(e)
? ((v = !0),
(p = e.some(function (e) {
return Qt(e) || Xt(e)
})),
(r = function () {
return e.map(function (e) {
return en(e)
? e.value
: Qt(e)
? f(e)
: J(e)
? d
? d(e, 2)
: e()
: void 0
})
}))
: (r = J(e)
? t
? d
? function () {
return d(e, 2)
}
: e
: function () {
if (i) {
$e()
try {
i()
} finally {
et()
}
}
var t = vn
vn = n
try {
return d ? d(e, 3, [a]) : e(a)
} finally {
vn = t
}
}
: B),
t && u)
) {
var m = r,
g = !0 === u ? 1 / 0 : u
r = function () {
return gn(m(), g)
}
}
var y = Oe(),
_ = function () {
;(n.stop(), y && y.active && Q(y.effects, n))
}
if (l && t) {
var b = t
t = function () {
;(b.apply(void 0, arguments), _())
}
}
var x = v ? new Array(e.length).fill(fn) : fn,
S = function (e) {
if (1 & n.flags && (n.dirty || e))
if (t) {
var r = n.run()
if (
u ||
p ||
(v
? r.some(function (e, t) {
return ve(e, x[t])
})
: ve(r, x))
) {
i && i()
var o = vn
vn = n
try {
var s = [r, x === fn ? void 0 : v && x[0] === fn ? [] : x, a]
;((x = r), d ? d(t, 3, s) : t.apply(void 0, s))
} finally {
vn = o
}
}
} else n.run()
}
return (
h && h(S),
((n = new ze(r)).scheduler = c
? function () {
return c(S, !1)
}
: S),
(a = function (e) {
return (function (e) {
var t = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : vn
if (t) {
var n = pn.get(t)
;(n || pn.set(t, (n = [])), n.push(e))
}
})(e, !1, n)
}),
(i = n.onStop =
function () {
var e = pn.get(n)
if (e) {
if (d) d(e, 4)
else {
var t,
r = L(e)
try {
for (r.s(); !(t = r.n()).done; ) {
;(0, t.value)()
}
} catch (i) {
r.e(i)
} finally {
r.f()
}
}
pn.delete(n)
}
}),
t ? (s ? S(!0) : (x = n.run())) : c ? c(S.bind(null, !0), !0) : n.run(),
(_.pause = n.pause.bind(n)),
(_.resume = n.resume.bind(n)),
(_.stop = _),
_
)
}
function gn(e) {
var t = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : 1 / 0,
n = arguments.length > 2 ? arguments[2] : void 0
if (t <= 0 || !te(e) || e.__v_skip) return e
if ((n = n || new Set()).has(e)) return e
if ((n.add(e), t--, en(e))) gn(e.value, t, n)
else if (Y(e)) for (var r = 0; r < e.length; r++) gn(e[r], t, n)
else if (Z(e) || K(e))
e.forEach(function (e) {
gn(e, t, n)
})
else if (ae(e)) {
for (var i in e) gn(e[i], t, n)
var a,
o = L(Object.getOwnPropertySymbols(e))
try {
for (o.s(); !(a = o.n()).done; ) {
var s = a.value
Object.prototype.propertyIsEnumerable.call(e, s) && gn(e[s], t, n)
}
} catch (u) {
o.e(u)
} finally {
o.f()
}
}
return e
}
/**
* @vue/runtime-core v3.5.17
* (c) 2018-present Yuxi (Evan) You and Vue contributors
* @license MIT
**/ function yn(e, t, n, r) {
try {
return r ? e.apply(void 0, I(r)) : e()
} catch (i) {
bn(i, t, n)
}
}
function _n(e, t, n, r) {
if (J(e)) {
var i = yn(e, t, n, r)
return (
i &&
ne(i) &&
i.catch(function (e) {
bn(e, t, n)
}),
i
)
}
if (Y(e)) {
for (var a = [], o = 0; o < e.length; o++) a.push(_n(e[o], t, n, r))
return a
}
}
function bn(e, t, n) {
var r = !(arguments.length > 3 && void 0 !== arguments[3]) || arguments[3],
i = t ? t.vnode : null,
a = (t && t.appContext.config) || E,
o = a.errorHandler,
s = a.throwUnhandledErrorInProduction
if (t) {
for (
var u = t.parent,
l = t.proxy,
c = 'https://vuejs.org/error-reference/#runtime-'.concat(n);
u;
) {
var h = u.ec
if (h) for (var d = 0; d < h.length; d++) if (!1 === h[d](e, l, c)) return
u = u.parent
}
if (o) return ($e(), yn(o, null, 10, [e, l, c]), void et())
}
!(function (e, t, n) {
var r = arguments.length > 4 && void 0 !== arguments[4] && arguments[4]
if (r) throw e
console.error(e)
})(e, n, i, r, s)
}
var xn = [],
Sn = -1,
An = [],
wn = null,
Tn = 0,
Mn = Promise.resolve(),
En = null
function Cn(e) {
var t = En || Mn
return e ? t.then(this ? e.bind(this) : e) : t
}
function kn(e) {
if (!(1 & e.flags)) {
var t = Pn(e),
n = xn[xn.length - 1]
;(!n || (!(2 & e.flags) && t >= Pn(n))
? xn.push(e)
: xn.splice(
(function (e) {
for (var t = Sn + 1, n = xn.length; t < n; ) {
var r = (t + n) >>> 1,
i = xn[r],
a = Pn(i)
a < e || (a === e && 2 & i.flags) ? (t = r + 1) : (n = r)
}
return t
})(t),
0,
e
),
(e.flags |= 1),
Rn())
}
}
function Rn() {
En || (En = Mn.then(Ln))
}
function In(e, t) {
for (
var n = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : Sn + 1;
n < xn.length;
n++
) {
var r = xn[n]
if (r && 2 & r.flags) {
if (e && r.id !== e.uid) continue
;(xn.splice(n, 1),
n--,
4 & r.flags && (r.flags &= -2),
r(),
4 & r.flags || (r.flags &= -2))
}
}
}
function Nn(e) {
if (An.length) {
var t,
n = I(new Set(An)).sort(function (e, t) {
return Pn(e) - Pn(t)
})
if (((An.length = 0), wn)) return void (t = wn).push.apply(t, I(n))
for (wn = n, Tn = 0; Tn < wn.length; Tn++) {
var r = wn[Tn]
;(4 & r.flags && (r.flags &= -2), 8 & r.flags || r(), (r.flags &= -2))
}
;((wn = null), (Tn = 0))
}
}
var Pn = function (e) {
return null == e.id ? (2 & e.flags ? -1 : 1 / 0) : e.id
}
function Ln(e) {
try {
for (Sn = 0; Sn < xn.length; Sn++) {
var t = xn[Sn]
!t ||
8 & t.flags ||
(4 & t.flags && (t.flags &= -2),
yn(t, t.i, t.i ? 15 : 14),
4 & t.flags || (t.flags &= -2))
}
} finally {
for (; Sn < xn.length; Sn++) {
var n = xn[Sn]
n && (n.flags &= -2)
}
;((Sn = -1), (xn.length = 0), Nn(), (En = null), (xn.length || An.length) && Ln())
}
}
var Dn = null,
On = null
function Fn(e) {
var t = Dn
return ((Dn = e), (On = (e && e.type.__scopeId) || null), t)
}
function Bn(e) {
var t = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : Dn
if (!t) return e
if (e._n) return e
var n = function () {
n._d && Qi(-1)
var r,
i = Fn(t)
try {
r = e.apply(void 0, arguments)
} finally {
;(Fn(i), n._d && Qi(1))
}
return r
}
return ((n._n = !0), (n._c = !0), (n._d = !0), n)
}
function Un(e, t) {
if (null === Dn) return e
for (var n = Ta(Dn), r = e.dirs || (e.dirs = []), i = 0; i < t.length; i++) {
var a = C(t[i], 4),
o = a[0],
s = a[1],
u = a[2],
l = a[3],
c = void 0 === l ? E : l
o &&
(J(o) && (o = { mounted: o, updated: o }),
o.deep && gn(s),
r.push({ dir: o, instance: n, value: s, oldValue: void 0, arg: u, modifiers: c }))
}
return e
}
function zn(e, t, n, r) {
for (var i = e.dirs, a = t && t.dirs, o = 0; o < i.length; o++) {
var s = i[o]
a && (s.oldValue = a[o].value)
var u = s.dir[r]
u && ($e(), _n(u, n, 8, [e.el, s, e, t]), et())
}
}
var Vn = Symbol('_vte'),
Hn = function (e) {
return e && (e.disabled || '' === e.disabled)
},
Wn = function (e) {
return e && (e.defer || '' === e.defer)
},
Gn = function (e) {
return 'undefined' != typeof SVGElement && e instanceof SVGElement
},
jn = function (e) {
return 'function' == typeof MathMLElement && e instanceof MathMLElement
},
Qn = function (e, t) {
var n = e && e.to
return $(n) ? (t ? t(n) : null) : n
},
qn = {
name: 'Teleport',
__isTeleport: !0,
process: function (e, t, n, r, i, a, o, s, u, l) {
var c = l.mc,
h = l.pc,
d = l.pbc,
f = l.o,
p = f.insert,
v = f.querySelector,
m = f.createText,
g = (f.createComment, Hn(t.props)),
y = t.shapeFlag,
_ = t.children,
b = t.dynamicChildren
if (null == e) {
var x = (t.el = m('')),
S = (t.anchor = m(''))
;(p(x, n, r), p(S, n, r))
var A = function (e, t) {
16 & y &&
(i && i.isCE && (i.ce._teleportTarget = e), c(_, e, t, i, a, o, s, u))
},
w = function () {
var e = (t.target = Qn(t.props, v)),
n = Zn(e, t, m, p)
e &&
('svg' !== o && Gn(e)
? (o = 'svg')
: 'mathml' !== o && jn(e) && (o = 'mathml'),
g || (A(e, n), Kn(t, !1)))
}
;(g && (A(n, S), Kn(t, !0)),
Wn(t.props)
? ((t.el.__isMounted = !1),
vi(function () {
;(w(), delete t.el.__isMounted)
}, a))
: w())
} else {
if (Wn(t.props) && !1 === e.el.__isMounted)
return void vi(function () {
qn.process(e, t, n, r, i, a, o, s, u, l)
}, a)
;((t.el = e.el), (t.targetStart = e.targetStart))
var T = (t.anchor = e.anchor),
M = (t.target = e.target),
E = (t.targetAnchor = e.targetAnchor),
C = Hn(e.props),
k = C ? n : M,
R = C ? T : E
if (
('svg' === o || Gn(M)
? (o = 'svg')
: ('mathml' === o || jn(M)) && (o = 'mathml'),
b
? (d(e.dynamicChildren, b, k, i, a, o, s), _i(e, t, !0))
: u || h(e, t, k, R, i, a, o, s, !1),
g)
)
C
? t.props && e.props && t.props.to !== e.props.to && (t.props.to = e.props.to)
: Xn(t, n, T, l, 1)
else if ((t.props && t.props.to) !== (e.props && e.props.to)) {
var I = (t.target = Qn(t.props, v))
I && Xn(t, I, null, l, 0)
} else C && Xn(t, M, E, l, 1)
Kn(t, g)
}
},
remove: function (e, t, n, r, i) {
var a = r.um,
o = r.o.remove,
s = e.shapeFlag,
u = e.children,
l = e.anchor,
c = e.targetStart,
h = e.targetAnchor,
d = e.target,
f = e.props
if ((d && (o(c), o(h)), i && o(l), 16 & s))
for (var p = i || !Hn(f), v = 0; v < u.length; v++) {
var m = u[v]
a(m, t, n, p, !!m.dynamicChildren)
}
},
move: Xn,
hydrate: function (e, t, n, r, i, a, o, s) {
var u = o.o,
l = u.nextSibling,
c = u.parentNode,
h = u.querySelector,
d = u.insert,
f = u.createText,
p = (t.target = Qn(t.props, h))
if (p) {
var v = Hn(t.props),
m = p._lpa || p.firstChild
if (16 & t.shapeFlag)
if (v)
((t.anchor = s(l(e), t, c(e), n, r, i, a)),
(t.targetStart = m),
(t.targetAnchor = m && l(m)))
else {
t.anchor = l(e)
for (var g = m; g; ) {
if (g && 8 === g.nodeType)
if ('teleport start anchor' === g.data) t.targetStart = g
else if ('teleport anchor' === g.data) {
;((t.targetAnchor = g), (p._lpa = t.targetAnchor && l(t.targetAnchor)))
break
}
g = l(g)
}
;(t.targetAnchor || Zn(p, t, f, d), s(m && l(m), t, p, n, r, i, a))
}
Kn(t, v)
}
return t.anchor && l(t.anchor)
},
}
function Xn(e, t, n, r) {
var i = r.o.insert,
a = r.m,
o = arguments.length > 4 && void 0 !== arguments[4] ? arguments[4] : 2
0 === o && i(e.targetAnchor, t, n)
var s = e.el,
u = e.anchor,
l = e.shapeFlag,
c = e.children,
h = e.props,
d = 2 === o
if ((d && i(s, t, n), (!d || Hn(h)) && 16 & l))
for (var f = 0; f < c.length; f++) a(c[f], t, n, 2)
d && i(u, t, n)
}
var Yn = qn
function Kn(e, t) {
var n = e.ctx
if (n && n.ut) {
var r, i
for (
t ? ((r = e.el), (i = e.anchor)) : ((r = e.targetStart), (i = e.targetAnchor));
r && r !== i;
)
(1 === r.nodeType && r.setAttribute('data-v-owner', n.uid), (r = r.nextSibling))
n.ut()
}
}
function Zn(e, t, n, r) {
var i = (t.targetStart = n('')),
a = (t.targetAnchor = n(''))
return ((i[Vn] = a), e && (r(i, e), r(a, e)), a)
}
var Jn = Symbol('_leaveCb'),
$n = Symbol('_enterCb')
var er = [Function, Array],
tr = {
mode: String,
appear: Boolean,
persisted: Boolean,
onBeforeEnter: er,
onEnter: er,
onAfterEnter: er,
onEnterCancelled: er,
onBeforeLeave: er,
onLeave: er,
onAfterLeave: er,
onLeaveCancelled: er,
onBeforeAppear: er,
onAppear: er,
onAfterAppear: er,
onAppearCancelled: er,
}
function nr(e, t, n, r, i) {
var a = t.appear,
o = t.mode,
s = t.persisted,
u = void 0 !== s && s,
l = t.onBeforeEnter,
c = t.onEnter,
h = t.onAfterEnter,
d = t.onEnterCancelled,
f = t.onBeforeLeave,
p = t.onLeave,
v = t.onAfterLeave,
m = t.onLeaveCancelled,
g = t.onBeforeAppear,
y = t.onAppear,
_ = t.onAfterAppear,
b = t.onAppearCancelled,
x = String(e.key),
S = (function (e, t) {
var n = e.leavingVNodes,
r = n.get(t.type)
return (r || ((r = Object.create(null)), n.set(t.type, r)), r)
})(n, e),
A = function (e, t) {
e && _n(e, r, 9, t)
},
w = function (e, t) {
var n = t[1]
;(A(e, t),
Y(e)
? e.every(function (e) {
return e.length <= 1
}) && n()
: e.length <= 1 && n())
},
T = {
mode: o,
persisted: u,
beforeEnter: function (t) {
var r = l
if (!n.isMounted) {
if (!a) return
r = g || l
}
t[Jn] && t[Jn](!0)
var i = S[x]
;(i && Zi(e, i) && i.el[Jn] && i.el[Jn](), A(r, [t]))
},
enter: function (e) {
var t = c,
r = h,
i = d
if (!n.isMounted) {
if (!a) return
;((t = y || c), (r = _ || h), (i = b || d))
}
var o = !1,
s = (e[$n] = function (t) {
o ||
((o = !0),
A(t ? i : r, [e]),
T.delayedLeave && T.delayedLeave(),
(e[$n] = void 0))
})
t ? w(t, [e, s]) : s()
},
leave: function (t, r) {
var i = String(e.key)
if ((t[$n] && t[$n](!0), n.isUnmounting)) return r()
A(f, [t])
var a = !1,
o = (t[Jn] = function (n) {
a ||
((a = !0),
r(),
A(n ? m : v, [t]),
(t[Jn] = void 0),
S[i] === e && delete S[i])
})
;((S[i] = e), p ? w(p, [t, o]) : o())
},
clone: function (e) {
return nr(e, t, n, r)
},
}
return T
}
function rr(e, t) {
6 & e.shapeFlag && e.component
? ((e.transition = t), rr(e.component.subTree, t))
: 128 & e.shapeFlag
? ((e.ssContent.transition = t.clone(e.ssContent)),
(e.ssFallback.transition = t.clone(e.ssFallback)))
: (e.transition = t)
}
function ir(e) {
for (
var t = arguments.length > 1 && void 0 !== arguments[1] && arguments[1],
n = arguments.length > 2 ? arguments[2] : void 0,
r = [],
i = 0,
a = 0;
a < e.length;
a++
) {
var o = e[a],
s = null == n ? o.key : String(n) + String(null != o.key ? o.key : a)
o.type === Bi
? (128 & o.patchFlag && i++, (r = r.concat(ir(o.children, t, s))))
: (t || o.type !== zi) && r.push(null != s ? na(o, { key: s }) : o)
}
if (i > 1) for (var u = 0; u < r.length; u++) r[u].patchFlag = -2
return r
}
/*! #__NO_SIDE_EFFECTS__ */ function ar(e, t) {
return J(e)
? (function () {
return j({ name: e.name }, t, { setup: e })
})()
: e
}
function or(e) {
e.ids = [e.ids[0] + e.ids[2]++ + '-', 0, 0]
}
function sr(e) {
var t = va(),
n = nn(null)
if (t) {
var r = t.refs === E ? (t.refs = {}) : t.refs
Object.defineProperty(r, e, {
enumerable: !0,
get: function () {
return n.value
},
set: function (e) {
return (n.value = e)
},
})
}
return n
}
function ur(e, t, n, r) {
var i = arguments.length > 4 && void 0 !== arguments[4] && arguments[4]
if (Y(e))
e.forEach(function (e, a) {
return ur(e, t && (Y(t) ? t[a] : t), n, r, i)
})
else if (!lr(r) || i) {
var a = 4 & r.shapeFlag ? Ta(r.component) : r.el,
o = i ? null : a,
s = e.i,
u = e.r,
l = t && t.r,
c = s.refs === E ? (s.refs = {}) : s.refs,
h = s.setupState,
d = Kt(h),
f =
h === E
? function () {
return !1
}
: function (e) {
return X(d, e)
}
if (
(null != l &&
l !== u &&
($(l) ? ((c[l] = null), f(l) && (h[l] = null)) : en(l) && (l.value = null)),
J(u))
)
yn(u, s, 12, [o, c])
else {
var p = $(u),
v = en(u)
if (p || v) {
var m = function () {
if (e.f) {
var t = p ? (f(u) ? h[u] : c[u]) : u.value
i
? Y(t) && Q(t, a)
: Y(t)
? t.includes(a) || t.push(a)
: p
? ((c[u] = [a]), f(u) && (h[u] = c[u]))
: ((u.value = [a]), e.k && (c[e.k] = u.value))
} else
p
? ((c[u] = o), f(u) && (h[u] = o))
: v && ((u.value = o), e.k && (c[e.k] = o))
}
o ? ((m.id = -1), vi(m, n)) : m()
}
}
} else
512 & r.shapeFlag &&
r.type.__asyncResolved &&
r.component.subTree.component &&
ur(e, t, n, r.component.subTree)
}
;(_e().requestIdleCallback, _e().cancelIdleCallback)
var lr = function (e) {
return !!e.type.__asyncLoader
},
cr = function (e) {
return e.type.__isKeepAlive
}
function hr(e, t) {
fr(e, 'a', t)
}
function dr(e, t) {
fr(e, 'da', t)
}
function fr(e, t) {
var n = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : pa,
r =
e.__wdc ||
(e.__wdc = function () {
for (var t = n; t; ) {
if (t.isDeactivated) return
t = t.parent
}
return e()
})
if ((vr(t, r, n), n))
for (var i = n.parent; i && i.parent; )
(cr(i.parent.vnode) && pr(r, t, n, i), (i = i.parent))
}
function pr(e, t, n, r) {
var i = vr(t, e, r, !0)
Sr(function () {
Q(r[t], i)
}, n)
}
function vr(e, t) {
var n = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : pa,
r = arguments.length > 3 && void 0 !== arguments[3] && arguments[3]
if (n) {
var i = n[e] || (n[e] = []),
a =
t.__weh ||
(t.__weh = function () {
$e()
for (var r = ya(n), i = arguments.length, a = new Array(i), o = 0; o < i; o++)
a[o] = arguments[o]
var s = _n(t, n, e, a)
return (r(), et(), s)
})
return (r ? i.unshift(a) : i.push(a), a)
}
}
var mr = function (e) {
return function (t) {
;(xa && 'sp' !== e) ||
vr(
e,
function () {
return t.apply(void 0, arguments)
},
arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : pa
)
}
},
gr = mr('bm'),
yr = mr('m'),
_r = mr('bu'),
br = mr('u'),
xr = mr('bum'),
Sr = mr('um'),
Ar = mr('sp'),
wr = mr('rtg'),
Tr = mr('rtc')
function Mr(e) {
vr('ec', e, arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : pa)
}
var Er = 'components',
Cr = Symbol.for('v-ndc')
function kr(e, t) {
var n = arguments.length > 3 && void 0 !== arguments[3] && arguments[3],
r = Dn || pa
if (r) {
var i = r.type
if (e === Er) {
var a = Ma(i, !1)
if (a && (a === t || a === ce(t) || a === fe(ce(t)))) return i
}
var o = Rr(r[e] || i[e], t) || Rr(r.appContext[e], t)
return !o && n ? i : o
}
}
function Rr(e, t) {
return e && (e[t] || e[ce(t)] || e[fe(ce(t))])
}
function Ir(e, t, n, r) {
var i,
a = n,
o = Y(e)
if (o || $(e)) {
var s = !1,
u = !1
;(o && Qt(e) && ((s = !Xt(e)), (u = qt(e)), (e = ft(e))), (i = new Array(e.length)))
for (var l = 0, c = e.length; l < c; l++)
i[l] = t(s ? (u ? $t(Jt(e[l])) : Jt(e[l])) : e[l], l, void 0, a)
} else if ('number' == typeof e) {
i = new Array(e)
for (var h = 0; h < e; h++) i[h] = t(h + 1, h, void 0, a)
} else if (te(e))
if (e[Symbol.iterator])
i = Array.from(e, function (e, n) {
return t(e, n, void 0, a)
})
else {
var d = Object.keys(e)
i = new Array(d.length)
for (var f = 0, p = d.length; f < p; f++) {
var v = d[f]
i[f] = t(e[v], v, f, a)
}
}
else i = []
return i
}
var Nr = function (e) {
return e ? (ba(e) ? Ta(e) : Nr(e.parent)) : null
},
Pr = j(Object.create(null), {
$: function (e) {
return e
},
$el: function (e) {
return e.vnode.el
},
$data: function (e) {
return e.data
},
$props: function (e) {
return e.props
},
$attrs: function (e) {
return e.attrs
},
$slots: function (e) {
return e.slots
},
$refs: function (e) {
return e.refs
},
$parent: function (e) {
return Nr(e.parent)
},
$root: function (e) {
return Nr(e.root)
},
$host: function (e) {
return e.ce
},
$emit: function (e) {
return e.emit
},
$options: function (e) {
return Vr(e)
},
$forceUpdate: function (e) {
return (
e.f ||
(e.f = function () {
kn(e.update)
})
)
},
$nextTick: function (e) {
return e.n || (e.n = Cn.bind(e.proxy))
},
$watch: function (e) {
return Ei.bind(e)
},
}),
Lr = function (e, t) {
return e !== E && !e.__isScriptSetup && X(e, t)
},
Dr = {
get: function (e, t) {
var n = e._
if ('__v_skip' === t) return !0
var r,
i = n.ctx,
a = n.setupState,
o = n.data,
s = n.props,
u = n.accessCache,
l = n.type,
c = n.appContext
if ('$' !== t[0]) {
var h = u[t]
if (void 0 !== h)
switch (h) {
case 1:
return a[t]
case 2:
return o[t]
case 4:
return i[t]
case 3:
return s[t]
}
else {
if (Lr(a, t)) return ((u[t] = 1), a[t])
if (o !== E && X(o, t)) return ((u[t] = 2), o[t])
if ((r = n.propsOptions[0]) && X(r, t)) return ((u[t] = 3), s[t])
if (i !== E && X(i, t)) return ((u[t] = 4), i[t])
Fr && (u[t] = 0)
}
}
var d,
f,
p = Pr[t]
return p
? ('$attrs' === t && ct(n.attrs, 0, ''), p(n))
: (d = l.__cssModules) && (d = d[t])
? d
: i !== E && X(i, t)
? ((u[t] = 4), i[t])
: ((f = c.config.globalProperties), X(f, t) ? f[t] : void 0)
},
set: function (e, t, n) {
var r = e._,
i = r.data,
a = r.setupState,
o = r.ctx
return Lr(a, t)
? ((a[t] = n), !0)
: i !== E && X(i, t)
? ((i[t] = n), !0)
: !X(r.props, t) && ('$' !== t[0] || !(t.slice(1) in r)) && ((o[t] = n), !0)
},
has: function (e, t) {
var n,
r = e._,
i = r.data,
a = r.setupState,
o = r.accessCache,
s = r.ctx,
u = r.appContext,
l = r.propsOptions
return (
!!o[t] ||
(i !== E && X(i, t)) ||
Lr(a, t) ||
((n = l[0]) && X(n, t)) ||
X(s, t) ||
X(Pr, t) ||
X(u.config.globalProperties, t)
)
},
defineProperty: function (e, t, n) {
return (
null != n.get
? (e._.accessCache[t] = 0)
: X(n, 'value') && this.set(e, t, n.value, null),
Reflect.defineProperty(e, t, n)
)
},
}
function Or(e) {
return Y(e)
? e.reduce(function (e, t) {
return ((e[t] = null), e)
}, {})
: e
}
var Fr = !0
function Br(e) {
var t = Vr(e),
n = e.proxy,
r = e.ctx
;((Fr = !1), t.beforeCreate && Ur(t.beforeCreate, e, 'bc'))
var i = t.data,
a = t.computed,
o = t.methods,
s = t.watch,
u = t.provide,
l = t.inject,
c = t.created,
h = t.beforeMount,
d = t.mounted,
f = t.beforeUpdate,
p = t.updated,
v = t.activated,
m = t.deactivated,
g = (t.beforeDestroy, t.beforeUnmount),
y = (t.destroyed, t.unmounted),
_ = t.render,
b = t.renderTracked,
x = t.renderTriggered,
S = t.errorCaptured,
A = t.serverPrefetch,
w = t.expose,
T = t.inheritAttrs,
M = t.components,
E = t.directives
t.filters
if (
(l &&
(function (e, t) {
Y(e) && (e = jr(e))
var n = function () {
var n,
i = e[r]
en(
(n = te(i)
? 'default' in i
? ei(i.from || r, i.default, !0)
: ei(i.from || r)
: ei(i))
)
? Object.defineProperty(t, r, {
enumerable: !0,
configurable: !0,
get: function () {
return n.value
},
set: function (e) {
return (n.value = e)
},
})
: (t[r] = n)
}
for (var r in e) n()
})(l, r, null),
o)
)
for (var C in o) {
var k = o[C]
J(k) && (r[C] = k.bind(n))
}
if (i) {
var R = i.call(n, n)
te(R) && (e.data = Wt(R))
}
if (((Fr = !0), a)) {
var I = function () {
var e = a[N],
t = J(e) ? e.bind(n, n) : J(e.get) ? e.get.bind(n, n) : B,
i = !J(e) && J(e.set) ? e.set.bind(n) : B,
o = Ea({ get: t, set: i })
Object.defineProperty(r, N, {
enumerable: !0,
configurable: !0,
get: function () {
return o.value
},
set: function (e) {
return (o.value = e)
},
})
}
for (var N in a) I()
}
if (s) for (var P in s) zr(s[P], r, n, P)
if (u) {
var L = J(u) ? u.call(n) : u
Reflect.ownKeys(L).forEach(function (e) {
$r(e, L[e])
})
}
function D(e, t) {
Y(t)
? t.forEach(function (t) {
return e(t.bind(n))
})
: t && e(t.bind(n))
}
if (
(c && Ur(c, e, 'c'),
D(gr, h),
D(yr, d),
D(_r, f),
D(br, p),
D(hr, v),
D(dr, m),
D(Mr, S),
D(Tr, b),
D(wr, x),
D(xr, g),
D(Sr, y),
D(Ar, A),
Y(w))
)
if (w.length) {
var O = e.exposed || (e.exposed = {})
w.forEach(function (e) {
Object.defineProperty(O, e, {
get: function () {
return n[e]
},
set: function (t) {
return (n[e] = t)
},
})
})
} else e.exposed || (e.exposed = {})
;(_ && e.render === B && (e.render = _),
null != T && (e.inheritAttrs = T),
M && (e.components = M),
E && (e.directives = E),
A && or(e))
}
function Ur(e, t, n) {
_n(
Y(e)
? e.map(function (e) {
return e.bind(t.proxy)
})
: e.bind(t.proxy),
t,
n
)
}
function zr(e, t, n, r) {
var i = r.includes('.')
? Ci(n, r)
: function () {
return n[r]
}
if ($(e)) {
var a = t[e]
J(a) && Ti(i, a)
} else if (J(e)) Ti(i, e.bind(n))
else if (te(e))
if (Y(e))
e.forEach(function (e) {
return zr(e, t, n, r)
})
else {
var o = J(e.handler) ? e.handler.bind(n) : t[e.handler]
J(o) && Ti(i, o, e)
}
}
function Vr(e) {
var t,
n = e.type,
r = n.mixins,
i = n.extends,
a = e.appContext,
o = a.mixins,
s = a.optionsCache,
u = a.config.optionMergeStrategies,
l = s.get(n)
return (
l
? (t = l)
: o.length || r || i
? ((t = {}),
o.length &&
o.forEach(function (e) {
return Hr(t, e, u, !0)
}),
Hr(t, n, u))
: (t = n),
te(n) && s.set(n, t),
t
)
}
function Hr(e, t, n) {
var r = arguments.length > 3 && void 0 !== arguments[3] && arguments[3],
i = t.mixins,
a = t.extends
for (var o in (a && Hr(e, a, n, !0),
i &&
i.forEach(function (t) {
return Hr(e, t, n, !0)
}),
t))
if (r && 'expose' === o);
else {
var s = Wr[o] || (n && n[o])
e[o] = s ? s(e[o], t[o]) : t[o]
}
return e
}
var Wr = {
data: Gr,
props: Xr,
emits: Xr,
methods: qr,
computed: qr,
beforeCreate: Qr,
created: Qr,
beforeMount: Qr,
mounted: Qr,
beforeUpdate: Qr,
updated: Qr,
beforeDestroy: Qr,
beforeUnmount: Qr,
destroyed: Qr,
unmounted: Qr,
activated: Qr,
deactivated: Qr,
errorCaptured: Qr,
serverPrefetch: Qr,
components: qr,
directives: qr,
watch: function (e, t) {
if (!e) return t
if (!t) return e
var n = j(Object.create(null), e)
for (var r in t) n[r] = Qr(e[r], t[r])
return n
},
provide: Gr,
inject: function (e, t) {
return qr(jr(e), jr(t))
},
}
function Gr(e, t) {
return t
? e
? function () {
return j(J(e) ? e.call(this, this) : e, J(t) ? t.call(this, this) : t)
}
: t
: e
}
function jr(e) {
if (Y(e)) {
for (var t = {}, n = 0; n < e.length; n++) t[e[n]] = e[n]
return t
}
return e
}
function Qr(e, t) {
return e ? I(new Set([].concat(e, t))) : t
}
function qr(e, t) {
return e ? j(Object.create(null), e, t) : t
}
function Xr(e, t) {
return e
? Y(e) && Y(t)
? I(new Set([].concat(I(e), I(t))))
: j(Object.create(null), Or(e), Or(null != t ? t : {}))
: t
}
function Yr() {
return {
app: null,
config: {
isNativeTag: V,
performance: !1,
globalProperties: {},
optionMergeStrategies: {},
errorHandler: void 0,
warnHandler: void 0,
compilerOptions: {},
},
mixins: [],
components: {},
directives: {},
provides: Object.create(null),
optionsCache: new WeakMap(),
propsCache: new WeakMap(),
emitsCache: new WeakMap(),
}
}
var Kr = 0
function Zr(e, t) {
return function (t) {
var n = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : null
;(J(t) || (t = j({}, t)), null == n || te(n) || (n = null))
var r = Yr(),
i = new WeakSet(),
a = [],
o = !1,
s = (r.app = {
_uid: Kr++,
_component: t,
_props: n,
_container: null,
_context: r,
_instance: null,
version: ka,
get config() {
return r.config
},
set config(e) {},
use: function (e) {
for (
var t = arguments.length, n = new Array(t > 1 ? t - 1 : 0), r = 1;
r < t;
r++
)
n[r - 1] = arguments[r]
return (
i.has(e) ||
(e && J(e.install)
? (i.add(e), e.install.apply(e, [s].concat(n)))
: J(e) && (i.add(e), e.apply(void 0, [s].concat(n)))),
s
)
},
mixin: function (e) {
return (r.mixins.includes(e) || r.mixins.push(e), s)
},
component: function (e, t) {
return t ? ((r.components[e] = t), s) : r.components[e]
},
directive: function (e, t) {
return t ? ((r.directives[e] = t), s) : r.directives[e]
},
mount: function (i, a, u) {
if (!o) {
var l = s._ceVNode || ta(t, n)
return (
(l.appContext = r),
!0 === u ? (u = 'svg') : !1 === u && (u = void 0),
e(l, i, u),
(o = !0),
(s._container = i),
(i.__vue_app__ = s),
Ta(l.component)
)
}
},
onUnmount: function (e) {
a.push(e)
},
unmount: function () {
o &&
(_n(a, s._instance, 16),
e(null, s._container),
delete s._container.__vue_app__)
},
provide: function (e, t) {
return ((r.provides[e] = t), s)
},
runWithContext: function (e) {
var t = Jr
Jr = s
try {
return e()
} finally {
Jr = t
}
},
})
return s
}
}
var Jr = null
function $r(e, t) {
if (pa) {
var n = pa.provides,
r = pa.parent && pa.parent.provides
;(r === n && (n = pa.provides = Object.create(r)), (n[e] = t))
} else;
}
function ei(e, t) {
var n = arguments.length > 2 && void 0 !== arguments[2] && arguments[2],
r = pa || Dn
if (r || Jr) {
var i = Jr
? Jr._context.provides
: r
? null == r.parent || r.ce
? r.vnode.appContext && r.vnode.appContext.provides
: r.parent.provides
: void 0
if (i && e in i) return i[e]
if (arguments.length > 1) return n && J(t) ? t.call(r && r.proxy) : t
}
}
var ti = {},
ni = function () {
return Object.create(ti)
},
ri = function (e) {
return Object.getPrototypeOf(e) === ti
}
function ii(e, t, n) {
var r = arguments.length > 3 && void 0 !== arguments[3] && arguments[3],
i = {},
a = ni()
for (var o in ((e.propsDefaults = Object.create(null)),
ai(e, t, i, a),
e.propsOptions[0]))
o in i || (i[o] = void 0)
;(n
? (e.props = r
? i
: (function (e) {
return jt(e, !1, kt, Ot, Ut)
})(i))
: e.type.props
? (e.props = i)
: (e.props = a),
(e.attrs = a))
}
function ai(e, t, n, r) {
var i,
a = C(e.propsOptions, 2),
o = a[0],
s = a[1],
u = !1
if (t)
for (var l in t)
if (!se(l)) {
var c = t[l],
h = void 0
o && X(o, (h = ce(l)))
? s && s.includes(h)
? ((i || (i = {}))[h] = c)
: (n[h] = c)
: Ni(e.emitsOptions, l) || (l in r && c === r[l]) || ((r[l] = c), (u = !0))
}
if (s)
for (var d = Kt(n), f = i || E, p = 0; p < s.length; p++) {
var v = s[p]
n[v] = oi(o, d, v, f[v], e, !X(f, v))
}
return u
}
function oi(e, t, n, r, i, a) {
var o = e[n]
if (null != o) {
var s = X(o, 'default')
if (s && void 0 === r) {
var u = o.default
if (o.type !== Function && !o.skipFactory && J(u)) {
var l = i.propsDefaults
if (n in l) r = l[n]
else {
var c = ya(i)
;((r = l[n] = u.call(null, t)), c())
}
} else r = u
i.ce && i.ce._setProp(n, r)
}
o[0] && (a && !s ? (r = !1) : !o[1] || ('' !== r && r !== de(n)) || (r = !0))
}
return r
}
var si = new WeakMap()
function ui(e, t) {
var n = arguments.length > 2 && void 0 !== arguments[2] && arguments[2],
r = n ? si : t.propsCache,
i = r.get(e)
if (i) return i
var a = e.props,
o = {},
s = [],
u = !1
if (!J(e)) {
var l = function (e) {
u = !0
var n = C(ui(e, t, !0), 2),
r = n[0],
i = n[1]
;(j(o, r), i && s.push.apply(s, I(i)))
}
;(!n && t.mixins.length && t.mixins.forEach(l),
e.extends && l(e.extends),
e.mixins && e.mixins.forEach(l))
}
if (!a && !u) return (te(e) && r.set(e, O), O)
if (Y(a))
for (var c = 0; c < a.length; c++) {
var h = ce(a[c])
li(h) && (o[h] = E)
}
else if (a)
for (var d in a) {
var f = ce(d)
if (li(f)) {
var p = a[d],
v = (o[f] = Y(p) || J(p) ? { type: p } : j({}, p)),
m = v.type,
g = !1,
y = !0
if (Y(m))
for (var _ = 0; _ < m.length; ++_) {
var b = m[_],
x = J(b) && b.name
if ('Boolean' === x) {
g = !0
break
}
'String' === x && (y = !1)
}
else g = J(m) && 'Boolean' === m.name
;((v[0] = g), (v[1] = y), (g || X(v, 'default')) && s.push(f))
}
}
var S = [o, s]
return (te(e) && r.set(e, S), S)
}
function li(e) {
return '$' !== e[0] && !se(e)
}
var ci = function (e) {
return '_' === e[0] || '$stable' === e
},
hi = function (e) {
return Y(e) ? e.map(oa) : [oa(e)]
},
di = function (e, t, n) {
var r = e._ctx,
i = function () {
if (ci(a)) return 1
var n = e[a]
if (J(n))
t[a] = (function (e, t, n) {
if (t._n) return t
var r = Bn(function () {
return hi(t.apply(void 0, arguments))
}, n)
return ((r._c = !1), r)
})(0, n, r)
else if (null != n) {
var i = hi(n)
t[a] = function () {
return i
}
}
}
for (var a in e) i()
},
fi = function (e, t) {
var n = hi(t)
e.slots.default = function () {
return n
}
},
pi = function (e, t, n) {
for (var r in t) (!n && ci(r)) || (e[r] = t[r])
},
vi = function (e, t) {
if (t && t.pendingBranch) {
var n
if (Y(e)) (n = t.effects).push.apply(n, I(e))
else t.effects.push(e)
} else
(Y((r = e))
? An.push.apply(An, I(r))
: wn && -1 === r.id
? wn.splice(Tn + 1, 0, r)
: 1 & r.flags || (An.push(r), (r.flags |= 1)),
Rn())
var r
}
function mi(e) {
return (function (e) {
var t = _e()
t.__VUE__ = !0
var n,
r = e.insert,
i = e.remove,
a = e.patchProp,
o = e.createElement,
s = e.createText,
u = e.createComment,
l = e.setText,
c = e.setElementText,
h = e.parentNode,
d = e.nextSibling,
f = e.setScopeId,
p = void 0 === f ? B : f,
v = e.insertStaticContent,
m = function (e, t, n) {
var r = arguments.length > 3 && void 0 !== arguments[3] ? arguments[3] : null,
i = arguments.length > 4 && void 0 !== arguments[4] ? arguments[4] : null,
a = arguments.length > 5 && void 0 !== arguments[5] ? arguments[5] : null,
o = arguments.length > 6 && void 0 !== arguments[6] ? arguments[6] : void 0,
s = arguments.length > 7 && void 0 !== arguments[7] ? arguments[7] : null,
u =
arguments.length > 8 && void 0 !== arguments[8]
? arguments[8]
: !!t.dynamicChildren
if (e !== t) {
;(e && !Zi(e, t) && ((r = K(e)), W(e, i, a, !0), (e = null)),
-2 === t.patchFlag && ((u = !1), (t.dynamicChildren = null)))
var l = t.type,
c = t.ref,
h = t.shapeFlag
switch (l) {
case Ui:
g(e, t, n, r)
break
case zi:
y(e, t, n, r)
break
case Vi:
null == e && _(t, n, r, o)
break
case Bi:
I(e, t, n, r, i, a, o, s, u)
break
default:
1 & h
? S(e, t, n, r, i, a, o, s, u)
: 6 & h
? N(e, t, n, r, i, a, o, s, u)
: (64 & h || 128 & h) && l.process(e, t, n, r, i, a, o, s, u, $)
}
null != c && i
? ur(c, e && e.ref, a, t || e, !t)
: null == c && e && null != e.ref && ur(e.ref, null, a, e, !0)
}
},
g = function (e, t, n, i) {
if (null == e) r((t.el = s(t.children)), n, i)
else {
var a = (t.el = e.el)
t.children !== e.children && l(a, t.children)
}
},
y = function (e, t, n, i) {
null == e ? r((t.el = u(t.children || '')), n, i) : (t.el = e.el)
},
_ = function (e, t, n, r) {
var i = C(v(e.children, t, n, r, e.el, e.anchor), 2)
;((e.el = i[0]), (e.anchor = i[1]))
},
b = function (e, t, n) {
for (var i, a = e.el, o = e.anchor; a && a !== o; )
((i = d(a)), r(a, t, n), (a = i))
r(o, t, n)
},
x = function (e) {
for (var t, n = e.el, r = e.anchor; n && n !== r; ) ((t = d(n)), i(n), (n = t))
i(r)
},
S = function (e, t, n, r, i, a, o, s, u) {
;('svg' === t.type ? (o = 'svg') : 'math' === t.type && (o = 'mathml'),
null == e ? A(t, n, r, i, a, o, s, u) : M(e, t, i, a, o, s, u))
},
A = function (e, t, n, i, s, u, l, h) {
var d,
f,
p = e.props,
v = e.shapeFlag,
m = e.transition,
g = e.dirs
if (
((d = e.el = o(e.type, u, p && p.is, p)),
8 & v
? c(d, e.children)
: 16 & v && T(e.children, d, null, i, s, gi(e, u), l, h),
g && zn(e, null, i, 'created'),
w(d, e, e.scopeId, l, i),
p)
) {
for (var y in p) 'value' === y || se(y) || a(d, y, null, p[y], u, i)
;('value' in p && a(d, 'value', null, p.value, u),
(f = p.onVnodeBeforeMount) && la(f, i, e))
}
g && zn(e, null, i, 'beforeMount')
var _ = (function (e, t) {
return (!e || (e && !e.pendingBranch)) && t && !t.persisted
})(s, m)
;(_ && m.beforeEnter(d),
r(d, t, n),
((f = p && p.onVnodeMounted) || _ || g) &&
vi(function () {
;(f && la(f, i, e), _ && m.enter(d), g && zn(e, null, i, 'mounted'))
}, s))
},
w = function (e, t, n, r, i) {
if ((n && p(e, n), r)) for (var a = 0; a < r.length; a++) p(e, r[a])
if (i) {
var o = i.subTree
if (t === o || (Fi(o.type) && (o.ssContent === t || o.ssFallback === t))) {
var s = i.vnode
w(e, s, s.scopeId, s.slotScopeIds, i.parent)
}
}
},
T = function (e, t, n, r, i, a, o, s) {
for (
var u = arguments.length > 8 && void 0 !== arguments[8] ? arguments[8] : 0;
u < e.length;
u++
) {
var l = (e[u] = s ? sa(e[u]) : oa(e[u]))
m(null, l, t, n, r, i, a, o, s)
}
},
M = function (e, t, n, r, i, o, s) {
var u = (t.el = e.el),
l = t.patchFlag,
h = t.dynamicChildren,
d = t.dirs
l |= 16 & e.patchFlag
var f,
p = e.props || E,
v = t.props || E
if (
(n && yi(n, !1),
(f = v.onVnodeBeforeUpdate) && la(f, n, t, e),
d && zn(t, e, n, 'beforeUpdate'),
n && yi(n, !0),
((p.innerHTML && null == v.innerHTML) ||
(p.textContent && null == v.textContent)) &&
c(u, ''),
h
? k(e.dynamicChildren, h, u, n, r, gi(t, i), o)
: s || U(e, t, u, null, n, r, gi(t, i), o, !1),
l > 0)
) {
if (16 & l) R(u, p, v, n, i)
else if (
(2 & l && p.class !== v.class && a(u, 'class', null, v.class, i),
4 & l && a(u, 'style', p.style, v.style, i),
8 & l)
)
for (var m = t.dynamicProps, g = 0; g < m.length; g++) {
var y = m[g],
_ = p[y],
b = v[y]
;(b === _ && 'value' !== y) || a(u, y, _, b, i, n)
}
1 & l && e.children !== t.children && c(u, t.children)
} else s || null != h || R(u, p, v, n, i)
;((f = v.onVnodeUpdated) || d) &&
vi(function () {
;(f && la(f, n, t, e), d && zn(t, e, n, 'updated'))
}, r)
},
k = function (e, t, n, r, i, a, o) {
for (var s = 0; s < t.length; s++) {
var u = e[s],
l = t[s],
c = u.el && (u.type === Bi || !Zi(u, l) || 198 & u.shapeFlag) ? h(u.el) : n
m(u, l, c, null, r, i, a, o, !0)
}
},
R = function (e, t, n, r, i) {
if (t !== n) {
if (t !== E) for (var o in t) se(o) || o in n || a(e, o, t[o], null, i, r)
for (var s in n)
if (!se(s)) {
var u = n[s],
l = t[s]
u !== l && 'value' !== s && a(e, s, l, u, i, r)
}
'value' in n && a(e, 'value', t.value, n.value, i)
}
},
I = function (e, t, n, i, a, o, u, l, c) {
var h = (t.el = e ? e.el : s('')),
d = (t.anchor = e ? e.anchor : s('')),
f = t.patchFlag,
p = t.dynamicChildren,
v = t.slotScopeIds
;(v && (l = l ? l.concat(v) : v),
null == e
? (r(h, n, i), r(d, n, i), T(t.children || [], n, d, a, o, u, l, c))
: f > 0 && 64 & f && p && e.dynamicChildren
? (k(e.dynamicChildren, p, n, a, o, u, l),
(null != t.key || (a && t === a.subTree)) && _i(e, t, !0))
: U(e, t, n, d, a, o, u, l, c))
},
N = function (e, t, n, r, i, a, o, s, u) {
;((t.slotScopeIds = s),
null == e
? 512 & t.shapeFlag
? i.ctx.activate(t, n, r, o, u)
: P(t, n, r, i, a, o, u)
: L(e, t, u))
},
P = function (e, t, n, r, i, a, o) {
var s = (e.component = (function (e, t, n) {
var r = e.type,
i = (t ? t.appContext : e.appContext) || ca,
a = {
uid: ha++,
vnode: e,
type: r,
parent: t,
appContext: i,
root: null,
next: null,
subTree: null,
effect: null,
update: null,
job: null,
scope: new Le(!0),
render: null,
proxy: null,
exposed: null,
exposeProxy: null,
withProxy: null,
provides: t ? t.provides : Object.create(i.provides),
ids: t ? t.ids : ['', 0, 0],
accessCache: null,
renderCache: [],
components: null,
directives: null,
propsOptions: ui(r, i),
emitsOptions: Ii(r, i),
emit: null,
emitted: null,
propsDefaults: E,
inheritAttrs: r.inheritAttrs,
ctx: E,
data: E,
props: E,
attrs: E,
slots: E,
refs: E,
setupState: E,
setupContext: null,
suspense: n,
suspenseId: n ? n.pendingId : 0,
asyncDep: null,
asyncResolved: !1,
isMounted: !1,
isUnmounted: !1,
isDeactivated: !1,
bc: null,
c: null,
bm: null,
m: null,
bu: null,
u: null,
um: null,
bum: null,
da: null,
a: null,
rtg: null,
rtc: null,
ec: null,
sp: null,
}
;((a.ctx = { _: a }),
(a.root = t ? t.root : a),
(a.emit = Ri.bind(null, a)),
e.ce && e.ce(a))
return a
})(e, r, i))
if (
(cr(e) && (s.ctx.renderer = $),
(function (e) {
var t = arguments.length > 1 && void 0 !== arguments[1] && arguments[1],
n = arguments.length > 2 && void 0 !== arguments[2] && arguments[2]
t && fa(t)
var r = e.vnode,
i = r.props,
a = r.children,
o = ba(e)
;(ii(e, i, o, t),
(function (e, t, n) {
var r = (e.slots = ni())
if (32 & e.vnode.shapeFlag) {
var i = t.__
i && ge(r, '__', i, !0)
var a = t._
a ? (pi(r, t, n), n && ge(r, '_', a, !0)) : di(t, r)
} else t && fi(e, t)
})(e, a, n || t))
var s = o
? (function (e, t) {
var n = e.type
;((e.accessCache = Object.create(null)),
(e.proxy = new Proxy(e.ctx, Dr)))
var r = n.setup
if (r) {
$e()
var i = (e.setupContext =
r.length > 1
? (function (e) {
var t = function (t) {
e.exposed = t || {}
}
return {
attrs: new Proxy(e.attrs, wa),
slots: e.slots,
emit: e.emit,
expose: t,
}
})(e)
: null),
a = ya(e),
o = yn(r, e, 0, [e.props, i]),
s = ne(o)
if ((et(), a(), (!s && !e.sp) || lr(e) || or(e), s)) {
if ((o.then(_a, _a), t))
return o
.then(function (t) {
Sa(e, t)
})
.catch(function (t) {
bn(t, e, 0)
})
e.asyncDep = o
} else Sa(e, o)
} else Aa(e)
})(e, t)
: void 0
t && fa(!1)
})(s, !1, o),
s.asyncDep)
) {
if ((i && i.registerDep(s, D, o), !e.el)) {
var u = (s.subTree = ta(zi))
y(null, u, t, n)
}
} else D(s, e, t, n, i, a, o)
},
L = function (e, t, n) {
var r = (t.component = e.component)
if (
(function (e, t, n) {
var r = e.props,
i = e.children,
a = e.component,
o = t.props,
s = t.children,
u = t.patchFlag,
l = a.emitsOptions
if (t.dirs || t.transition) return !0
if (!(n && u >= 0))
return (
!((!i && !s) || (s && s.$stable)) ||
(r !== o && (r ? !o || Oi(r, o, l) : !!o))
)
if (1024 & u) return !0
if (16 & u) return r ? Oi(r, o, l) : !!o
if (8 & u)
for (var c = t.dynamicProps, h = 0; h < c.length; h++) {
var d = c[h]
if (o[d] !== r[d] && !Ni(l, d)) return !0
}
return !1
})(e, t, n)
) {
if (r.asyncDep && !r.asyncResolved) return void F(r, t, n)
;((r.next = t), r.update())
} else ((t.el = e.el), (r.vnode = t))
},
D = function (e, t, n, r, i, a, o) {
var s = function () {
if (e.isMounted) {
var u = e.next,
l = e.bu,
c = e.u,
d = e.parent,
f = e.vnode,
p = bi(e)
if (p)
return (
u && ((u.el = f.el), F(e, u, o)),
void p.asyncDep.then(function () {
e.isUnmounted || s()
})
)
var v,
g = u
;(yi(e, !1),
u ? ((u.el = f.el), F(e, u, o)) : (u = f),
l && me(l),
(v = u.props && u.props.onVnodeBeforeUpdate) && la(v, d, u, f),
yi(e, !0))
var y = Pi(e),
_ = e.subTree
;((e.subTree = y),
m(_, y, h(_.el), K(_), e, i, a),
(u.el = y.el),
null === g &&
(function (e, t) {
var n = e.vnode,
r = e.parent
for (; r; ) {
var i = r.subTree
if (
(i.suspense && i.suspense.activeBranch === n && (i.el = n.el),
i !== n)
)
break
;(((n = r.vnode).el = t), (r = r.parent))
}
})(e, y.el),
c && vi(c, i),
(v = u.props && u.props.onVnodeUpdated) &&
vi(function () {
return la(v, d, u, f)
}, i))
} else {
var b,
x = t,
S = (x.el, x.props),
A = e.bm,
w = e.m,
T = e.parent,
M = e.root,
E = e.type,
C = lr(t)
;(yi(e, !1),
A && me(A),
!C && (b = S && S.onVnodeBeforeMount) && la(b, T, t),
yi(e, !0),
M.ce && !1 !== M.ce._def.shadowRoot && M.ce._injectChildStyle(E))
var k = (e.subTree = Pi(e))
if (
(m(null, k, n, r, e, i, a),
(t.el = k.el),
w && vi(w, i),
!C && (b = S && S.onVnodeMounted))
) {
var R = t
vi(function () {
return la(b, T, R)
}, i)
}
;((256 & t.shapeFlag || (T && lr(T.vnode) && 256 & T.vnode.shapeFlag)) &&
e.a &&
vi(e.a, i),
(e.isMounted = !0),
(t = n = r = null))
}
}
e.scope.on()
var u = (e.effect = new ze(s))
e.scope.off()
var l = (e.update = u.run.bind(u)),
c = (e.job = u.runIfDirty.bind(u))
;((c.i = e),
(c.id = e.uid),
(u.scheduler = function () {
return kn(c)
}),
yi(e, !0),
l())
},
F = function (e, t, n) {
t.component = e
var r = e.vnode.props
;((e.vnode = t),
(e.next = null),
(function (e, t, n, r) {
var i = e.props,
a = e.attrs,
o = e.vnode.patchFlag,
s = Kt(i),
u = C(e.propsOptions, 1)[0],
l = !1
if (!(r || o > 0) || 16 & o) {
var c
for (var h in (ai(e, t, i, a) && (l = !0), s))
(t && (X(t, h) || ((c = de(h)) !== h && X(t, c)))) ||
(u
? !n ||
(void 0 === n[h] && void 0 === n[c]) ||
(i[h] = oi(u, s, h, void 0, e, !0))
: delete i[h])
if (a !== s) for (var d in a) (t && X(t, d)) || (delete a[d], (l = !0))
} else if (8 & o)
for (var f = e.vnode.dynamicProps, p = 0; p < f.length; p++) {
var v = f[p]
if (!Ni(e.emitsOptions, v)) {
var m = t[v]
if (u)
if (X(a, v)) m !== a[v] && ((a[v] = m), (l = !0))
else {
var g = ce(v)
i[g] = oi(u, s, g, m, e, !1)
}
else m !== a[v] && ((a[v] = m), (l = !0))
}
}
l && ht(e.attrs, 'set', '')
})(e, t.props, r, n),
(function (e, t, n) {
var r = e.vnode,
i = e.slots,
a = !0,
o = E
if (32 & r.shapeFlag) {
var s = t._
;(s
? n && 1 === s
? (a = !1)
: pi(i, t, n)
: ((a = !t.$stable), di(t, i)),
(o = t))
} else t && (fi(e, t), (o = { default: 1 }))
if (a) for (var u in i) ci(u) || null != o[u] || delete i[u]
})(e, t.children, n),
$e(),
In(e),
et())
},
U = function (e, t, n, r, i, a, o, s) {
var u = arguments.length > 8 && void 0 !== arguments[8] && arguments[8],
l = e && e.children,
h = e ? e.shapeFlag : 0,
d = t.children,
f = t.patchFlag,
p = t.shapeFlag
if (f > 0) {
if (128 & f) return void V(l, d, n, r, i, a, o, s, u)
if (256 & f) return void z(l, d, n, r, i, a, o, s, u)
}
8 & p
? (16 & h && q(l, i, a), d !== l && c(n, d))
: 16 & h
? 16 & p
? V(l, d, n, r, i, a, o, s, u)
: q(l, i, a, !0)
: (8 & h && c(n, ''), 16 & p && T(d, n, r, i, a, o, s, u))
},
z = function (e, t, n, r, i, a, o, s, u) {
t = t || O
var l,
c = (e = e || O).length,
h = t.length,
d = Math.min(c, h)
for (l = 0; l < d; l++) {
var f = (t[l] = u ? sa(t[l]) : oa(t[l]))
m(e[l], f, n, null, i, a, o, s, u)
}
c > h ? q(e, i, a, !0, !1, d) : T(t, n, r, i, a, o, s, u, d)
},
V = function (e, t, n, r, i, a, o, s, u) {
for (var l = 0, c = t.length, h = e.length - 1, d = c - 1; l <= h && l <= d; ) {
var f = e[l],
p = (t[l] = u ? sa(t[l]) : oa(t[l]))
if (!Zi(f, p)) break
;(m(f, p, n, null, i, a, o, s, u), l++)
}
for (; l <= h && l <= d; ) {
var v = e[h],
g = (t[d] = u ? sa(t[d]) : oa(t[d]))
if (!Zi(v, g)) break
;(m(v, g, n, null, i, a, o, s, u), h--, d--)
}
if (l > h) {
if (l <= d)
for (var y = d + 1, _ = y < c ? t[y].el : r; l <= d; )
(m(null, (t[l] = u ? sa(t[l]) : oa(t[l])), n, _, i, a, o, s, u), l++)
} else if (l > d) for (; l <= h; ) (W(e[l], i, a, !0), l++)
else {
var b,
x = l,
S = l,
A = new Map()
for (l = S; l <= d; l++) {
var w = (t[l] = u ? sa(t[l]) : oa(t[l]))
null != w.key && A.set(w.key, l)
}
var T = 0,
M = d - S + 1,
E = !1,
C = 0,
k = new Array(M)
for (l = 0; l < M; l++) k[l] = 0
for (l = x; l <= h; l++) {
var R = e[l]
if (T >= M) W(R, i, a, !0)
else {
var I = void 0
if (null != R.key) I = A.get(R.key)
else
for (b = S; b <= d; b++)
if (0 === k[b - S] && Zi(R, t[b])) {
I = b
break
}
void 0 === I
? W(R, i, a, !0)
: ((k[I - S] = l + 1),
I >= C ? (C = I) : (E = !0),
m(R, t[I], n, null, i, a, o, s, u),
T++)
}
}
var N = E
? (function (e) {
var t,
n,
r,
i,
a,
o = e.slice(),
s = [0],
u = e.length
for (t = 0; t < u; t++) {
var l = e[t]
if (0 !== l) {
if (e[(n = s[s.length - 1])] < l) {
;((o[t] = n), s.push(t))
continue
}
for (r = 0, i = s.length - 1; r < i; )
e[s[(a = (r + i) >> 1)]] < l ? (r = a + 1) : (i = a)
l < e[s[r]] && (r > 0 && (o[t] = s[r - 1]), (s[r] = t))
}
}
;((r = s.length), (i = s[r - 1]))
for (; r-- > 0; ) ((s[r] = i), (i = o[i]))
return s
})(k)
: O
for (b = N.length - 1, l = M - 1; l >= 0; l--) {
var P = S + l,
L = t[P],
D = P + 1 < c ? t[P + 1].el : r
0 === k[l]
? m(null, L, n, D, i, a, o, s, u)
: E && (b < 0 || l !== N[b] ? H(L, n, D, 2) : b--)
}
}
},
H = function (e, t, n, a) {
var o = arguments.length > 4 && void 0 !== arguments[4] ? arguments[4] : null,
s = e.el,
u = e.type,
l = e.transition,
c = e.children,
h = e.shapeFlag
if (6 & h) H(e.component.subTree, t, n, a)
else if (128 & h) e.suspense.move(t, n, a)
else if (64 & h) u.move(e, t, n, $)
else if (u !== Bi) {
if (u !== Vi)
if (2 !== a && 1 & h && l)
if (0 === a)
(l.beforeEnter(s),
r(s, t, n),
vi(function () {
return l.enter(s)
}, o))
else {
var d = l.leave,
f = l.delayLeave,
p = l.afterLeave,
v = function () {
e.ctx.isUnmounted ? i(s) : r(s, t, n)
},
m = function () {
d(s, function () {
;(v(), p && p())
})
}
f ? f(s, v, m) : m()
}
else r(s, t, n)
else b(e, t, n)
} else {
r(s, t, n)
for (var g = 0; g < c.length; g++) H(c[g], t, n, a)
r(e.anchor, t, n)
}
},
W = function (e, t, n) {
var r = arguments.length > 3 && void 0 !== arguments[3] && arguments[3],
i = arguments.length > 4 && void 0 !== arguments[4] && arguments[4],
a = e.type,
o = e.props,
s = e.ref,
u = e.children,
l = e.dynamicChildren,
c = e.shapeFlag,
h = e.patchFlag,
d = e.dirs,
f = e.cacheIndex
if (
(-2 === h && (i = !1),
null != s && ($e(), ur(s, null, n, e, !0), et()),
null != f && (t.renderCache[f] = void 0),
256 & c)
)
t.ctx.deactivate(e)
else {
var p,
v = 1 & c && d,
m = !lr(e)
if ((m && (p = o && o.onVnodeBeforeUnmount) && la(p, t, e), 6 & c))
Q(e.component, n, r)
else {
if (128 & c) return void e.suspense.unmount(n, r)
;(v && zn(e, null, t, 'beforeUnmount'),
64 & c
? e.type.remove(e, t, n, $, r)
: l && !l.hasOnce && (a !== Bi || (h > 0 && 64 & h))
? q(l, t, n, !1, !0)
: ((a === Bi && 384 & h) || (!i && 16 & c)) && q(u, t, n),
r && G(e))
}
;((m && (p = o && o.onVnodeUnmounted)) || v) &&
vi(function () {
;(p && la(p, t, e), v && zn(e, null, t, 'unmounted'))
}, n)
}
},
G = function (e) {
var t = e.type,
n = e.el,
r = e.anchor,
a = e.transition
if (t !== Bi)
if (t !== Vi) {
var o = function () {
;(i(n), a && !a.persisted && a.afterLeave && a.afterLeave())
}
if (1 & e.shapeFlag && a && !a.persisted) {
var s = a.leave,
u = a.delayLeave,
l = function () {
return s(n, o)
}
u ? u(e.el, o, l) : l()
} else o()
} else x(e)
else j(n, r)
},
j = function (e, t) {
for (var n; e !== t; ) ((n = d(e)), i(e), (e = n))
i(t)
},
Q = function (e, t, n) {
var r = e.bum,
i = e.scope,
a = e.job,
o = e.subTree,
s = e.um,
u = e.m,
l = e.a,
c = e.parent,
h = e.slots.__
;(xi(u),
xi(l),
r && me(r),
c &&
Y(h) &&
h.forEach(function (e) {
c.renderCache[e] = void 0
}),
i.stop(),
a && ((a.flags |= 8), W(o, e, t, n)),
s && vi(s, t),
vi(function () {
e.isUnmounted = !0
}, t),
t &&
t.pendingBranch &&
!t.isUnmounted &&
e.asyncDep &&
!e.asyncResolved &&
e.suspenseId === t.pendingId &&
(t.deps--, 0 === t.deps && t.resolve()))
},
q = function (e, t, n) {
for (
var r = arguments.length > 3 && void 0 !== arguments[3] && arguments[3],
i = arguments.length > 4 && void 0 !== arguments[4] && arguments[4],
a = arguments.length > 5 && void 0 !== arguments[5] ? arguments[5] : 0;
a < e.length;
a++
)
W(e[a], t, n, r, i)
},
K = function (e) {
if (6 & e.shapeFlag) return K(e.component.subTree)
if (128 & e.shapeFlag) return e.suspense.next()
var t = d(e.anchor || e.el),
n = t && t[Vn]
return n ? d(n) : t
},
Z = !1,
J = function (e, t, n) {
;(null == e
? t._vnode && W(t._vnode, null, null, !0)
: m(t._vnode || null, e, t, null, null, null, n),
(t._vnode = e),
Z || ((Z = !0), In(), Nn(), (Z = !1)))
},
$ = { p: m, um: W, m: H, r: G, mt: P, mc: T, pc: U, pbc: k, n: K, o: e }
return { render: J, hydrate: n, createApp: Zr(J) }
})(e)
}
function gi(e, t) {
var n = e.type,
r = e.props
return ('svg' === t && 'foreignObject' === n) ||
('mathml' === t &&
'annotation-xml' === n &&
r &&
r.encoding &&
r.encoding.includes('html'))
? void 0
: t
}
function yi(e, t) {
var n = e.effect,
r = e.job
t ? ((n.flags |= 32), (r.flags |= 4)) : ((n.flags &= -33), (r.flags &= -5))
}
function _i(e, t) {
var n = arguments.length > 2 && void 0 !== arguments[2] && arguments[2],
r = e.children,
i = t.children
if (Y(r) && Y(i))
for (var a = 0; a < r.length; a++) {
var o = r[a],
s = i[a]
;(1 & s.shapeFlag &&
!s.dynamicChildren &&
((s.patchFlag <= 0 || 32 === s.patchFlag) && ((s = i[a] = sa(i[a])).el = o.el),
n || -2 === s.patchFlag || _i(o, s)),
s.type === Ui && (s.el = o.el),
s.type !== zi || s.el || (s.el = o.el))
}
}
function bi(e) {
var t = e.subTree.component
if (t) return t.asyncDep && !t.asyncResolved ? t : bi(t)
}
function xi(e) {
if (e) for (var t = 0; t < e.length; t++) e[t].flags |= 8
}
var Si = Symbol.for('v-scx'),
Ai = function () {
return ei(Si)
}
function wi(e, t) {
return Mi(e, null, t)
}
function Ti(e, t, n) {
return Mi(e, t, n)
}
function Mi(e, t) {
var n,
r = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : E,
i = r.immediate,
a = (r.deep, r.flush),
o = (r.once, j({}, r)),
s = (t && i) || (!t && 'post' !== a)
if (xa)
if ('sync' === a) {
var u = Ai()
n = u.__watcherHandles || (u.__watcherHandles = [])
} else if (!s) {
var l = function () {}
return ((l.stop = B), (l.resume = B), (l.pause = B), l)
}
var c = pa
o.call = function (e, t, n) {
return _n(e, c, t, n)
}
var h = !1
;('post' === a
? (o.scheduler = function (e) {
vi(e, c && c.suspense)
})
: 'sync' !== a &&
((h = !0),
(o.scheduler = function (e, t) {
t ? e() : kn(e)
})),
(o.augmentJob = function (e) {
;(t && (e.flags |= 4), h && ((e.flags |= 2), c && ((e.id = c.uid), (e.i = c))))
}))
var d = mn(e, t, o)
return (xa && (n ? n.push(d) : s && d()), d)
}
function Ei(e, t, n) {
var r,
i = this.proxy,
a = $(e)
? e.includes('.')
? Ci(i, e)
: function () {
return i[e]
}
: e.bind(i, i)
J(t) ? (r = t) : ((r = t.handler), (n = t))
var o = ya(this),
s = Mi(a, r.bind(i), n)
return (o(), s)
}
function Ci(e, t) {
var n = t.split('.')
return function () {
for (var t = e, r = 0; r < n.length && t; r++) t = t[n[r]]
return t
}
}
var ki = function (e, t) {
return 'modelValue' === t || 'model-value' === t
? e.modelModifiers
: e[''.concat(t, 'Modifiers')] ||
e[''.concat(ce(t), 'Modifiers')] ||
e[''.concat(de(t), 'Modifiers')]
}
function Ri(e, t) {
if (!e.isUnmounted) {
for (
var n = e.vnode.props || E,
r = arguments.length,
i = new Array(r > 2 ? r - 2 : 0),
a = 2;
a < r;
a++
)
i[a - 2] = arguments[a]
var o,
s = i,
u = t.startsWith('update:'),
l = u && ki(n, t.slice(7))
l &&
(l.trim &&
(s = i.map(function (e) {
return $(e) ? e.trim() : e
})),
l.number && (s = i.map(ye)))
var c = n[(o = pe(t))] || n[(o = pe(ce(t)))]
;(!c && u && (c = n[(o = pe(de(t)))]), c && _n(c, e, 6, s))
var h = n[o + 'Once']
if (h) {
if (e.emitted) {
if (e.emitted[o]) return
} else e.emitted = {}
;((e.emitted[o] = !0), _n(h, e, 6, s))
}
}
}
function Ii(e, t) {
var n = arguments.length > 2 && void 0 !== arguments[2] && arguments[2],
r = t.emitsCache,
i = r.get(e)
if (void 0 !== i) return i
var a = e.emits,
o = {},
s = !1
if (!J(e)) {
var u = function (e) {
var n = Ii(e, t, !0)
n && ((s = !0), j(o, n))
}
;(!n && t.mixins.length && t.mixins.forEach(u),
e.extends && u(e.extends),
e.mixins && e.mixins.forEach(u))
}
return a || s
? (Y(a)
? a.forEach(function (e) {
return (o[e] = null)
})
: j(o, a),
te(e) && r.set(e, o),
o)
: (te(e) && r.set(e, null), null)
}
function Ni(e, t) {
return (
!(!e || !W(t)) &&
((t = t.slice(2).replace(/Once$/, '')),
X(e, t[0].toLowerCase() + t.slice(1)) || X(e, de(t)) || X(e, t))
)
}
function Pi(e) {
var t,
n,
r = e.type,
i = e.vnode,
a = e.proxy,
o = e.withProxy,
s = C(e.propsOptions, 1)[0],
u = e.slots,
l = e.attrs,
c = e.emit,
h = e.render,
d = e.renderCache,
f = e.props,
p = e.data,
v = e.setupState,
m = e.ctx,
g = e.inheritAttrs,
y = Fn(e)
try {
if (4 & i.shapeFlag) {
var _ = o || a,
b = _
;((t = oa(h.call(b, _, d, f, v, p, m))), (n = l))
} else {
var x = r
;(0,
(t = oa(x.length > 1 ? x(f, { attrs: l, slots: u, emit: c }) : x(f, null))),
(n = r.props ? l : Li(l)))
}
} catch (T) {
;((Hi.length = 0), bn(T, e, 1), (t = ta(zi)))
}
var S = t
if (n && !1 !== g) {
var A = Object.keys(n),
w = S.shapeFlag
A.length && 7 & w && (s && A.some(G) && (n = Di(n, s)), (S = na(S, n, !1, !0)))
}
return (
i.dirs && ((S = na(S, null, !1, !0)).dirs = S.dirs ? S.dirs.concat(i.dirs) : i.dirs),
i.transition && rr(S, i.transition),
(t = S),
Fn(y),
t
)
}
var Li = function (e) {
var t
for (var n in e)
('class' === n || 'style' === n || W(n)) && ((t || (t = {}))[n] = e[n])
return t
},
Di = function (e, t) {
var n = {}
for (var r in e) (G(r) && r.slice(9) in t) || (n[r] = e[r])
return n
}
function Oi(e, t, n) {
var r = Object.keys(t)
if (r.length !== Object.keys(e).length) return !0
for (var i = 0; i < r.length; i++) {
var a = r[i]
if (t[a] !== e[a] && !Ni(n, a)) return !0
}
return !1
}
var Fi = function (e) {
return e.__isSuspense
}
var Bi = Symbol.for('v-fgt'),
Ui = Symbol.for('v-txt'),
zi = Symbol.for('v-cmt'),
Vi = Symbol.for('v-stc'),
Hi = [],
Wi = null
function Gi() {
var e = arguments.length > 0 && void 0 !== arguments[0] && arguments[0]
Hi.push((Wi = e ? null : []))
}
var ji = 1
function Qi(e) {
;((ji += e),
e < 0 &&
Wi &&
arguments.length > 1 &&
void 0 !== arguments[1] &&
arguments[1] &&
(Wi.hasOnce = !0))
}
function qi(e) {
return (
(e.dynamicChildren = ji > 0 ? Wi || O : null),
Hi.pop(),
(Wi = Hi[Hi.length - 1] || null),
ji > 0 && Wi && Wi.push(e),
e
)
}
function Xi(e, t, n, r, i, a) {
return qi(ea(e, t, n, r, i, a, !0))
}
function Yi(e, t, n, r, i) {
return qi(ta(e, t, n, r, i, !0))
}
function Ki(e) {
return !!e && !0 === e.__v_isVNode
}
function Zi(e, t) {
return e.type === t.type && e.key === t.key
}
var Ji = function (e) {
var t = e.key
return null != t ? t : null
},
$i = function (e) {
var t = e.ref,
n = e.ref_key,
r = e.ref_for
return (
'number' == typeof t && (t = '' + t),
null != t ? ($(t) || en(t) || J(t) ? { i: Dn, r: t, k: n, f: !!r } : t) : null
)
}
function ea(e) {
var t = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : null,
n = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : null,
r = arguments.length > 3 && void 0 !== arguments[3] ? arguments[3] : 0,
i = arguments.length > 4 && void 0 !== arguments[4] ? arguments[4] : null,
a = arguments.length > 5 && void 0 !== arguments[5] ? arguments[5] : e === Bi ? 0 : 1,
o = arguments.length > 6 && void 0 !== arguments[6] && arguments[6],
s = arguments.length > 7 && void 0 !== arguments[7] && arguments[7],
u = {
__v_isVNode: !0,
__v_skip: !0,
type: e,
props: t,
key: t && Ji(t),
ref: t && $i(t),
scopeId: On,
slotScopeIds: null,
children: n,
component: null,
suspense: null,
ssContent: null,
ssFallback: null,
dirs: null,
transition: null,
el: null,
anchor: null,
target: null,
targetStart: null,
targetAnchor: null,
staticCount: 0,
shapeFlag: a,
patchFlag: r,
dynamicProps: i,
dynamicChildren: null,
appContext: null,
ctx: Dn,
}
return (
s ? (ua(u, n), 128 & a && e.normalize(u)) : n && (u.shapeFlag |= $(n) ? 8 : 16),
ji > 0 && !o && Wi && (u.patchFlag > 0 || 6 & a) && 32 !== u.patchFlag && Wi.push(u),
u
)
}
var ta = function (e) {
var t = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : null,
n = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : null,
r = arguments.length > 3 && void 0 !== arguments[3] ? arguments[3] : 0,
i = arguments.length > 4 && void 0 !== arguments[4] ? arguments[4] : null,
a = arguments.length > 5 && void 0 !== arguments[5] && arguments[5]
;(e && e !== Cr) || (e = zi)
if (Ki(e)) {
var o = na(e, t, !0)
return (
n && ua(o, n),
ji > 0 && !a && Wi && (6 & o.shapeFlag ? (Wi[Wi.indexOf(e)] = o) : Wi.push(o)),
(o.patchFlag = -2),
o
)
}
;((s = e), J(s) && '__vccOpts' in s && (e = e.__vccOpts))
var s
if (t) {
var u = (t = (function (e) {
return e ? (Yt(e) || ri(e) ? j({}, e) : e) : null
})(t)),
l = u.class,
c = u.style
;(l && !$(l) && (t.class = Te(l)),
te(c) && (Yt(c) && !Y(c) && (c = j({}, c)), (t.style = be(c))))
}
var h = $(e)
? 1
: Fi(e)
? 128
: (function (e) {
return e.__isTeleport
})(e)
? 64
: te(e)
? 4
: J(e)
? 2
: 0
return ea(e, t, n, r, i, h, a, !0)
}
function na(e, t) {
var n = arguments.length > 2 && void 0 !== arguments[2] && arguments[2],
r = arguments.length > 3 && void 0 !== arguments[3] && arguments[3],
i = e.props,
a = e.ref,
o = e.patchFlag,
s = e.children,
u = e.transition,
l = t
? (function () {
for (var e = {}, t = 0; t < arguments.length; t++) {
var n = t < 0 || arguments.length <= t ? void 0 : arguments[t]
for (var r in n)
if ('class' === r) e.class !== n.class && (e.class = Te([e.class, n.class]))
else if ('style' === r) e.style = be([e.style, n.style])
else if (W(r)) {
var i = e[r],
a = n[r]
!a ||
i === a ||
(Y(i) && i.includes(a)) ||
(e[r] = i ? [].concat(i, a) : a)
} else '' !== r && (e[r] = n[r])
}
return e
})(i || {}, t)
: i,
c = {
__v_isVNode: !0,
__v_skip: !0,
type: e.type,
props: l,
key: l && Ji(l),
ref: t && t.ref ? (n && a ? (Y(a) ? a.concat($i(t)) : [a, $i(t)]) : $i(t)) : a,
scopeId: e.scopeId,
slotScopeIds: e.slotScopeIds,
children: s,
target: e.target,
targetStart: e.targetStart,
targetAnchor: e.targetAnchor,
staticCount: e.staticCount,
shapeFlag: e.shapeFlag,
patchFlag: t && e.type !== Bi ? (-1 === o ? 16 : 16 | o) : o,
dynamicProps: e.dynamicProps,
dynamicChildren: e.dynamicChildren,
appContext: e.appContext,
dirs: e.dirs,
transition: u,
component: e.component,
suspense: e.suspense,
ssContent: e.ssContent && na(e.ssContent),
ssFallback: e.ssFallback && na(e.ssFallback),
el: e.el,
anchor: e.anchor,
ctx: e.ctx,
ce: e.ce,
}
return (u && r && rr(c, u.clone(c)), c)
}
function ra() {
return ta(
Ui,
null,
arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : ' ',
arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : 0
)
}
function ia(e, t) {
var n = ta(Vi, null, e)
return ((n.staticCount = t), n)
}
function aa() {
var e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : ''
return arguments.length > 1 && void 0 !== arguments[1] && arguments[1]
? (Gi(), Yi(zi, null, e))
: ta(zi, null, e)
}
function oa(e) {
return null == e || 'boolean' == typeof e
? ta(zi)
: Y(e)
? ta(Bi, null, e.slice())
: Ki(e)
? sa(e)
: ta(Ui, null, String(e))
}
function sa(e) {
return (null === e.el && -1 !== e.patchFlag) || e.memo ? e : na(e)
}
function ua(e, t) {
var n = 0,
r = e.shapeFlag
if (null == t) t = null
else if (Y(t)) n = 16
else if ('object' === P(t)) {
if (65 & r) {
var i = t.default
return void (i && (i._c && (i._d = !1), ua(e, i()), i._c && (i._d = !0)))
}
n = 32
var a = t._
a || ri(t)
? 3 === a &&
Dn &&
(1 === Dn.slots._ ? (t._ = 1) : ((t._ = 2), (e.patchFlag |= 1024)))
: (t._ctx = Dn)
} else
J(t)
? ((t = { default: t, _ctx: Dn }), (n = 32))
: ((t = String(t)), 64 & r ? ((n = 16), (t = [ra(t)])) : (n = 8))
;((e.children = t), (e.shapeFlag |= n))
}
function la(e, t, n) {
_n(e, t, 7, [n, arguments.length > 3 && void 0 !== arguments[3] ? arguments[3] : null])
}
var ca = Yr(),
ha = 0
var da,
fa,
pa = null,
va = function () {
return pa || Dn
},
ma = _e(),
ga = function (e, t) {
var n
return (
(n = ma[e]) || (n = ma[e] = []),
n.push(t),
function (e) {
n.length > 1
? n.forEach(function (t) {
return t(e)
})
: n[0](e)
}
)
}
;((da = ga('__VUE_INSTANCE_SETTERS__', function (e) {
return (pa = e)
})),
(fa = ga('__VUE_SSR_SETTERS__', function (e) {
return (xa = e)
})))
var ya = function (e) {
var t = pa
return (
da(e),
e.scope.on(),
function () {
;(e.scope.off(), da(t))
}
)
},
_a = function () {
;(pa && pa.scope.off(), da(null))
}
function ba(e) {
return 4 & e.vnode.shapeFlag
}
var xa = !1
function Sa(e, t, n) {
;(J(t)
? e.type.__ssrInlineRender
? (e.ssrRender = t)
: (e.render = t)
: te(t) && (e.setupState = un(t)),
Aa(e))
}
function Aa(e, t, n) {
var r = e.type
e.render || (e.render = r.render || B)
var i = ya(e)
$e()
try {
Br(e)
} finally {
;(et(), i())
}
}
var wa = {
get: function (e, t) {
return (ct(e, 0, ''), e[t])
},
}
function Ta(e) {
return e.exposed
? e.exposeProxy ||
(e.exposeProxy = new Proxy(un(Zt(e.exposed)), {
get: function (t, n) {
return n in t ? t[n] : n in Pr ? Pr[n](e) : void 0
},
has: function (e, t) {
return t in e || t in Pr
},
}))
: e.proxy
}
function Ma(e) {
var t = !(arguments.length > 1 && void 0 !== arguments[1]) || arguments[1]
return J(e) ? e.displayName || e.name : e.name || (t && e.__name)
}
var Ea = function (e, t) {
var n = (function (e, t) {
var n,
r,
i = arguments.length > 2 && void 0 !== arguments[2] && arguments[2]
return (J(e) ? (n = e) : ((n = e.get), (r = e.set)), new dn(n, r, i))
})(e, t, xa)
return n
}
function Ca(e, t, n) {
var r = arguments.length
return 2 === r
? te(t) && !Y(t)
? Ki(t)
? ta(e, null, [t])
: ta(e, t)
: ta(e, null, t)
: (r > 3
? (n = Array.prototype.slice.call(arguments, 2))
: 3 === r && Ki(n) && (n = [n]),
ta(e, t, n))
}
var ka = '3.5.17',
Ra = void 0,
Ia = 'undefined' != typeof window && window.trustedTypes
/**
* @vue/runtime-dom v3.5.17
* (c) 2018-present Yuxi (Evan) You and Vue contributors
* @license MIT
**/ if (Ia)
try {
Ra = Ia.createPolicy('vue', {
createHTML: function (e) {
return e
},
})
} catch (ZJ) {}
var Na = Ra
? function (e) {
return Ra.createHTML(e)
}
: function (e) {
return e
},
Pa = 'undefined' != typeof document ? document : null,
La = Pa && Pa.createElement('template'),
Da = {
insert: function (e, t, n) {
t.insertBefore(e, n || null)
},
remove: function (e) {
var t = e.parentNode
t && t.removeChild(e)
},
createElement: function (e, t, n, r) {
var i =
'svg' === t
? Pa.createElementNS('http://www.w3.org/2000/svg', e)
: 'mathml' === t
? Pa.createElementNS('http://www.w3.org/1998/Math/MathML', e)
: n
? Pa.createElement(e, { is: n })
: Pa.createElement(e)
return (
'select' === e &&
r &&
null != r.multiple &&
i.setAttribute('multiple', r.multiple),
i
)
},
createText: function (e) {
return Pa.createTextNode(e)
},
createComment: function (e) {
return Pa.createComment(e)
},
setText: function (e, t) {
e.nodeValue = t
},
setElementText: function (e, t) {
e.textContent = t
},
parentNode: function (e) {
return e.parentNode
},
nextSibling: function (e) {
return e.nextSibling
},
querySelector: function (e) {
return Pa.querySelector(e)
},
setScopeId: function (e, t) {
e.setAttribute(t, '')
},
insertStaticContent: function (e, t, n, r, i, a) {
var o = n ? n.previousSibling : t.lastChild
if (i && (i === a || i.nextSibling))
for (; t.insertBefore(i.cloneNode(!0), n), i !== a && (i = i.nextSibling); );
else {
La.innerHTML = Na(
'svg' === r
? '')
: 'mathml' === r
? '')
: e
)
var s = La.content
if ('svg' === r || 'mathml' === r) {
for (var u = s.firstChild; u.firstChild; ) s.appendChild(u.firstChild)
s.removeChild(u)
}
t.insertBefore(s, n)
}
return [o ? o.nextSibling : t.firstChild, n ? n.previousSibling : t.lastChild]
},
},
Oa = 'transition',
Fa = 'animation',
Ba = Symbol('_vtc'),
Ua = {
name: String,
type: String,
css: { type: Boolean, default: !0 },
duration: [String, Number, Object],
enterFromClass: String,
enterActiveClass: String,
enterToClass: String,
appearFromClass: String,
appearActiveClass: String,
appearToClass: String,
leaveFromClass: String,
leaveActiveClass: String,
leaveToClass: String,
},
za = j({}, tr, Ua),
Va = function (e) {
var t = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : []
Y(e)
? e.forEach(function (e) {
return e.apply(void 0, I(t))
})
: e && e.apply(void 0, I(t))
},
Ha = function (e) {
return (
!!e &&
(Y(e)
? e.some(function (e) {
return e.length > 1
})
: e.length > 1)
)
}
function Wa(e) {
var t = {}
for (var n in e) n in Ua || (t[n] = e[n])
if (!1 === e.css) return t
var r = e.name,
i = void 0 === r ? 'v' : r,
a = e.type,
o = e.duration,
s = e.enterFromClass,
u = void 0 === s ? ''.concat(i, '-enter-from') : s,
l = e.enterActiveClass,
c = void 0 === l ? ''.concat(i, '-enter-active') : l,
h = e.enterToClass,
d = void 0 === h ? ''.concat(i, '-enter-to') : h,
f = e.appearFromClass,
p = void 0 === f ? u : f,
v = e.appearActiveClass,
m = void 0 === v ? c : v,
g = e.appearToClass,
y = void 0 === g ? d : g,
_ = e.leaveFromClass,
b = void 0 === _ ? ''.concat(i, '-leave-from') : _,
x = e.leaveActiveClass,
S = void 0 === x ? ''.concat(i, '-leave-active') : x,
A = e.leaveToClass,
w = void 0 === A ? ''.concat(i, '-leave-to') : A,
T = (function (e) {
if (null == e) return null
if (te(e)) return [Ga(e.enter), Ga(e.leave)]
var t = Ga(e)
return [t, t]
})(o),
M = T && T[0],
E = T && T[1],
C = t.onBeforeEnter,
k = t.onEnter,
R = t.onEnterCancelled,
I = t.onLeave,
N = t.onLeaveCancelled,
P = t.onBeforeAppear,
L = void 0 === P ? C : P,
D = t.onAppear,
O = void 0 === D ? k : D,
F = t.onAppearCancelled,
B = void 0 === F ? R : F,
U = function (e, t, n, r) {
;((e._enterCancelled = r), Qa(e, t ? y : d), Qa(e, t ? m : c), n && n())
},
z = function (e, t) {
;((e._isLeaving = !1), Qa(e, b), Qa(e, w), Qa(e, S), t && t())
},
V = function (e) {
return function (t, n) {
var r = e ? O : k,
i = function () {
return U(t, e, n)
}
;(Va(r, [t, i]),
qa(function () {
;(Qa(t, e ? p : u), ja(t, e ? y : d), Ha(r) || Ya(t, a, M, i))
}))
}
}
return j(t, {
onBeforeEnter: function (e) {
;(Va(C, [e]), ja(e, u), ja(e, c))
},
onBeforeAppear: function (e) {
;(Va(L, [e]), ja(e, p), ja(e, m))
},
onEnter: V(!1),
onAppear: V(!0),
onLeave: function (e, t) {
e._isLeaving = !0
var n = function () {
return z(e, t)
}
;(ja(e, b),
e._enterCancelled ? (ja(e, S), $a()) : ($a(), ja(e, S)),
qa(function () {
e._isLeaving && (Qa(e, b), ja(e, w), Ha(I) || Ya(e, a, E, n))
}),
Va(I, [e, n]))
},
onEnterCancelled: function (e) {
;(U(e, !1, void 0, !0), Va(R, [e]))
},
onAppearCancelled: function (e) {
;(U(e, !0, void 0, !0), Va(B, [e]))
},
onLeaveCancelled: function (e) {
;(z(e), Va(N, [e]))
},
})
}
function Ga(e) {
var t = (function (e) {
var t = $(e) ? Number(e) : NaN
return isNaN(t) ? e : t
})(e)
return t
}
function ja(e, t) {
;(t.split(/\s+/).forEach(function (t) {
return t && e.classList.add(t)
}),
(e[Ba] || (e[Ba] = new Set())).add(t))
}
function Qa(e, t) {
t.split(/\s+/).forEach(function (t) {
return t && e.classList.remove(t)
})
var n = e[Ba]
n && (n.delete(t), n.size || (e[Ba] = void 0))
}
function qa(e) {
requestAnimationFrame(function () {
requestAnimationFrame(e)
})
}
var Xa = 0
function Ya(e, t, n, r) {
var i = (e._endId = ++Xa),
a = function () {
i === e._endId && r()
}
if (null != n) return setTimeout(a, n)
var o = Ka(e, t),
s = o.type,
u = o.timeout,
l = o.propCount
if (!s) return r()
var c = s + 'end',
h = 0,
d = function () {
;(e.removeEventListener(c, f), a())
},
f = function (t) {
t.target === e && ++h >= l && d()
}
;(setTimeout(function () {
h < l && d()
}, u + 1),
e.addEventListener(c, f))
}
function Ka(e, t) {
var n = window.getComputedStyle(e),
r = function (e) {
return (n[e] || '').split(', ')
},
i = r(''.concat(Oa, 'Delay')),
a = r(''.concat(Oa, 'Duration')),
o = Za(i, a),
s = r(''.concat(Fa, 'Delay')),
u = r(''.concat(Fa, 'Duration')),
l = Za(s, u),
c = null,
h = 0,
d = 0
return (
t === Oa
? o > 0 && ((c = Oa), (h = o), (d = a.length))
: t === Fa
? l > 0 && ((c = Fa), (h = l), (d = u.length))
: (d = (c = (h = Math.max(o, l)) > 0 ? (o > l ? Oa : Fa) : null)
? c === Oa
? a.length
: u.length
: 0),
{
type: c,
timeout: h,
propCount: d,
hasTransform:
c === Oa &&
/\b(transform|all)(,|$)/.test(r(''.concat(Oa, 'Property')).toString()),
}
)
}
function Za(e, t) {
for (; e.length < t.length; ) e = e.concat(e)
return Math.max.apply(
Math,
I(
t.map(function (t, n) {
return Ja(t) + Ja(e[n])
})
)
)
}
function Ja(e) {
return 'auto' === e ? 0 : 1e3 * Number(e.slice(0, -1).replace(',', '.'))
}
function $a() {
return document.body.offsetHeight
}
var eo = Symbol('_vod'),
to = Symbol('_vsh'),
no = {
beforeMount: function (e, t, n) {
var r = t.value,
i = n.transition
;((e[eo] = 'none' === e.style.display ? '' : e.style.display),
i && r ? i.beforeEnter(e) : ro(e, r))
},
mounted: function (e, t, n) {
var r = t.value,
i = n.transition
i && r && i.enter(e)
},
updated: function (e, t, n) {
var r = t.value,
i = t.oldValue,
a = n.transition
!r != !i &&
(a
? r
? (a.beforeEnter(e), ro(e, !0), a.enter(e))
: a.leave(e, function () {
ro(e, !1)
})
: ro(e, r))
},
beforeUnmount: function (e, t) {
ro(e, t.value)
},
}
function ro(e, t) {
;((e.style.display = t ? e[eo] : 'none'), (e[to] = !t))
}
var io = Symbol(''),
ao = /(^|;)\s*display\s*:/
var oo = /\s*!important$/
function so(e, t, n) {
if (Y(n))
n.forEach(function (n) {
return so(e, t, n)
})
else if ((null == n && (n = ''), t.startsWith('--'))) e.setProperty(t, n)
else {
var r = (function (e, t) {
var n = lo[t]
if (n) return n
var r = ce(t)
if ('filter' !== r && r in e) return (lo[t] = r)
r = fe(r)
for (var i = 0; i < uo.length; i++) {
var a = uo[i] + r
if (a in e) return (lo[t] = a)
}
return t
})(e, t)
oo.test(n) ? e.setProperty(de(r), n.replace(oo, ''), 'important') : (e[r] = n)
}
}
var uo = ['Webkit', 'Moz', 'ms'],
lo = {}
var co = 'http://www.w3.org/1999/xlink'
function ho(e, t, n, r, i) {
var a = arguments.length > 5 && void 0 !== arguments[5] ? arguments[5] : Me(t)
r && t.startsWith('xlink:')
? null == n
? e.removeAttributeNS(co, t.slice(6, t.length))
: e.setAttributeNS(co, t, n)
: null == n || (a && !Ee(n))
? e.removeAttribute(t)
: e.setAttribute(t, a ? '' : ee(n) ? String(n) : n)
}
function fo(e, t, n, r, i) {
if ('innerHTML' !== t && 'textContent' !== t) {
var a = e.tagName
if ('value' === t && 'PROGRESS' !== a && !a.includes('-')) {
var o = 'OPTION' === a ? e.getAttribute('value') || '' : e.value,
s = null == n ? ('checkbox' === e.type ? 'on' : '') : String(n)
return (
(o === s && '_value' in e) || (e.value = s),
null == n && e.removeAttribute(t),
void (e._value = n)
)
}
var u = !1
if ('' === n || null == n) {
var l = P(e[t])
'boolean' === l
? (n = Ee(n))
: null == n && 'string' === l
? ((n = ''), (u = !0))
: 'number' === l && ((n = 0), (u = !0))
}
try {
e[t] = n
} catch (ZJ) {}
u && e.removeAttribute(i || t)
} else null != n && (e[t] = 'innerHTML' === t ? Na(n) : n)
}
var po = Symbol('_vei')
function vo(e, t, n, r) {
var i = arguments.length > 4 && void 0 !== arguments[4] ? arguments[4] : null,
a = e[po] || (e[po] = {}),
o = a[t]
if (r && o) o.value = r
else {
var s = (function (e) {
var t
if (mo.test(e)) {
var n
for (t = {}; (n = e.match(mo)); )
((e = e.slice(0, e.length - n[0].length)), (t[n[0].toLowerCase()] = !0))
}
var r = ':' === e[2] ? e.slice(3) : de(e.slice(2))
return [r, t]
})(t),
u = C(s, 2),
l = u[0],
c = u[1]
if (r) {
var h = (a[t] = (function (e, t) {
var n = function (e) {
if (e._vts) {
if (e._vts <= n.attached) return
} else e._vts = Date.now()
_n(
(function (e, t) {
if (Y(t)) {
var n = e.stopImmediatePropagation
return (
(e.stopImmediatePropagation = function () {
;(n.call(e), (e._stopped = !0))
}),
t.map(function (e) {
return function (t) {
return !t._stopped && e && e(t)
}
})
)
}
return t
})(e, n.value),
t,
5,
[e]
)
}
return ((n.value = e), (n.attached = _o()), n)
})(r, i))
!(function (e, t, n, r) {
e.addEventListener(t, n, r)
})(e, l, h, c)
} else
o &&
(!(function (e, t, n, r) {
e.removeEventListener(t, n, r)
})(e, l, o, c),
(a[t] = void 0))
}
}
var mo = /(?:Once|Passive|Capture)$/
var go = 0,
yo = Promise.resolve(),
_o = function () {
return (
go ||
(yo.then(function () {
return (go = 0)
}),
(go = Date.now()))
)
}
var bo = function (e) {
return (
111 === e.charCodeAt(0) &&
110 === e.charCodeAt(1) &&
e.charCodeAt(2) > 96 &&
e.charCodeAt(2) < 123
)
}
var xo = new WeakMap(),
So = new WeakMap(),
Ao = Symbol('_moveCb'),
wo = Symbol('_enterCb'),
To = function (e) {
return (delete e.props.mode, e)
},
Mo = To({
name: 'TransitionGroup',
props: j({}, za, { tag: String, moveClass: String }),
setup: function (e, t) {
var n,
r,
i = t.slots,
a = va(),
o = (function () {
var e = {
isMounted: !1,
isLeaving: !1,
isUnmounting: !1,
leavingVNodes: new Map(),
}
return (
yr(function () {
e.isMounted = !0
}),
xr(function () {
e.isUnmounting = !0
}),
e
)
})()
return (
br(function () {
if (n.length) {
var t = e.moveClass || ''.concat(e.name || 'v', '-move')
if (
(function (e, t, n) {
var r = e.cloneNode(),
i = e[Ba]
i &&
i.forEach(function (e) {
e.split(/\s+/).forEach(function (e) {
return e && r.classList.remove(e)
})
})
;(n.split(/\s+/).forEach(function (e) {
return e && r.classList.add(e)
}),
(r.style.display = 'none'))
var a = 1 === t.nodeType ? t : t.parentNode
a.appendChild(r)
var o = Ka(r).hasTransform
return (a.removeChild(r), o)
})(n[0].el, a.vnode.el, t)
) {
;(n.forEach(Co), n.forEach(ko))
var r = n.filter(Ro)
;($a(),
r.forEach(function (e) {
var n = e.el,
r = n.style
;(ja(n, t),
(r.transform = r.webkitTransform = r.transitionDuration = ''))
var i = (n[Ao] = function (e) {
;(e && e.target !== n) ||
(e && !/transform$/.test(e.propertyName)) ||
(n.removeEventListener('transitionend', i),
(n[Ao] = null),
Qa(n, t))
})
n.addEventListener('transitionend', i)
}),
(n = []))
} else n = []
}
}),
function () {
var t = Kt(e),
s = Wa(t),
u = t.tag || Bi
if (((n = []), r))
for (var l = 0; l < r.length; l++) {
var c = r[l]
c.el &&
c.el instanceof Element &&
(n.push(c),
rr(c, nr(c, s, o, a)),
xo.set(c, c.el.getBoundingClientRect()))
}
r = i.default ? ir(i.default()) : []
for (var h = 0; h < r.length; h++) {
var d = r[h]
null != d.key && rr(d, nr(d, s, o, a))
}
return ta(u, null, r)
}
)
},
}),
Eo = Mo
function Co(e) {
var t = e.el
;(t[Ao] && t[Ao](), t[wo] && t[wo]())
}
function ko(e) {
So.set(e, e.el.getBoundingClientRect())
}
function Ro(e) {
var t = xo.get(e),
n = So.get(e),
r = t.left - n.left,
i = t.top - n.top
if (r || i) {
var a = e.el.style
return (
(a.transform = a.webkitTransform = 'translate('.concat(r, 'px,').concat(i, 'px)')),
(a.transitionDuration = '0s'),
e
)
}
}
var Io,
No = ['ctrl', 'shift', 'alt', 'meta'],
Po = {
stop: function (e) {
return e.stopPropagation()
},
prevent: function (e) {
return e.preventDefault()
},
self: function (e) {
return e.target !== e.currentTarget
},
ctrl: function (e) {
return !e.ctrlKey
},
shift: function (e) {
return !e.shiftKey
},
alt: function (e) {
return !e.altKey
},
meta: function (e) {
return !e.metaKey
},
left: function (e) {
return 'button' in e && 0 !== e.button
},
middle: function (e) {
return 'button' in e && 1 !== e.button
},
right: function (e) {
return 'button' in e && 2 !== e.button
},
exact: function (e, t) {
return No.some(function (n) {
return e[''.concat(n, 'Key')] && !t.includes(n)
})
},
},
Lo = function (e, t) {
var n = e._withMods || (e._withMods = {}),
r = t.join('.')
return (
n[r] ||
(n[r] = function (n) {
for (var r = 0; r < t.length; r++) {
var i = Po[t[r]]
if (i && i(n, t)) return
}
for (
var a = arguments.length, o = new Array(a > 1 ? a - 1 : 0), s = 1;
s < a;
s++
)
o[s - 1] = arguments[s]
return e.apply(void 0, [n].concat(o))
})
)
},
Do = j(
{
patchProp: function (e, t, n, r, i, a) {
var o = 'svg' === i
'class' === t
? (function (e, t, n) {
var r = e[Ba]
;(r && (t = (t ? [t].concat(I(r)) : I(r)).join(' ')),
null == t
? e.removeAttribute('class')
: n
? e.setAttribute('class', t)
: (e.className = t))
})(e, r, o)
: 'style' === t
? (function (e, t, n) {
var r = e.style,
i = $(n),
a = !1
if (n && !i) {
if (t)
if ($(t)) {
var o,
s = L(t.split(';'))
try {
for (s.s(); !(o = s.n()).done; ) {
var u = o.value,
l = u.slice(0, u.indexOf(':')).trim()
null == n[l] && so(r, l, '')
}
} catch (f) {
s.e(f)
} finally {
s.f()
}
} else for (var c in t) null == n[c] && so(r, c, '')
for (var h in n) ('display' === h && (a = !0), so(r, h, n[h]))
} else if (i) {
if (t !== n) {
var d = r[io]
;(d && (n += ';' + d), (r.cssText = n), (a = ao.test(n)))
}
} else t && e.removeAttribute('style')
eo in e && ((e[eo] = a ? r.display : ''), e[to] && (r.display = 'none'))
})(e, n, r)
: W(t)
? G(t) || vo(e, t, n, r, a)
: (
'.' === t[0]
? ((t = t.slice(1)), 1)
: '^' === t[0]
? ((t = t.slice(1)), 0)
: (function (e, t, n, r) {
if (r)
return (
'innerHTML' === t ||
'textContent' === t ||
!!(t in e && bo(t) && J(n))
)
if (
'spellcheck' === t ||
'draggable' === t ||
'translate' === t ||
'autocorrect' === t
)
return !1
if ('form' === t) return !1
if ('list' === t && 'INPUT' === e.tagName) return !1
if ('type' === t && 'TEXTAREA' === e.tagName) return !1
if ('width' === t || 'height' === t) {
var i = e.tagName
if (
'IMG' === i ||
'VIDEO' === i ||
'CANVAS' === i ||
'SOURCE' === i
)
return !1
}
if (bo(t) && $(n)) return !1
return t in e
})(e, t, r, o)
)
? (fo(e, t, r),
e.tagName.includes('-') ||
('value' !== t && 'checked' !== t && 'selected' !== t) ||
ho(e, t, r, o, a, 'value' !== t))
: !e._isVueCE || (!/[A-Z]/.test(t) && $(r))
? ('true-value' === t
? (e._trueValue = r)
: 'false-value' === t && (e._falseValue = r),
ho(e, t, r, o))
: fo(e, ce(t), r, 0, t)
},
},
Da
)
function Oo() {
return Io || (Io = mi(Do))
}
var Fo,
Bo = function () {
var e
;(e = Oo()).render.apply(e, arguments)
}
var Uo,
zo,
Vo = function (e) {
return (Fo = e)
},
Ho = Symbol()
function Wo(e) {
return (
e &&
'object' === P(e) &&
'[object Object]' === Object.prototype.toString.call(e) &&
'function' != typeof e.toJSON
)
}
;(((zo = Uo || (Uo = {})).direct = 'direct'),
(zo.patchObject = 'patch object'),
(zo.patchFunction = 'patch function'))
var Go = function () {}
function jo(e, t, n) {
var r = arguments.length > 3 && void 0 !== arguments[3] ? arguments[3] : Go
e.push(t)
var i,
a = function () {
var n = e.indexOf(t)
n > -1 && (e.splice(n, 1), r())
}
return (!n && Oe() && ((i = a), Ce && Ce.cleanups.push(i)), a)
}
function Qo(e) {
for (var t = arguments.length, n = new Array(t > 1 ? t - 1 : 0), r = 1; r < t; r++)
n[r - 1] = arguments[r]
e.slice().forEach(function (e) {
e.apply(void 0, n)
})
}
var qo = function (e) {
return e()
},
Xo = Symbol(),
Yo = Symbol()
function Ko(e, t) {
for (var n in (e instanceof Map && t instanceof Map
? t.forEach(function (t, n) {
return e.set(n, t)
})
: e instanceof Set && t instanceof Set && t.forEach(e.add, e),
t))
if (t.hasOwnProperty(n)) {
var r = t[n],
i = e[n]
Wo(i) && Wo(r) && e.hasOwnProperty(n) && !en(r) && !Qt(r)
? (e[n] = Ko(i, r))
: (e[n] = r)
}
return e
}
var Zo = Symbol()
function Jo(e) {
return !Wo(e) || !Object.prototype.hasOwnProperty.call(e, Zo)
}
var $o = Object.assign
function es(e) {
return !(!en(e) || !e.effect)
}
function ts(e, t, n, r) {
var i,
a = t.state,
o = t.actions,
s = t.getters,
u = n.state.value[e]
return (
(i = ns(
e,
function () {
u || (n.state.value[e] = a ? a() : {})
var t = (function (e) {
var t = Y(e) ? new Array(e.length) : {}
for (var n in e) t[n] = hn(e, n)
return t
})(n.state.value[e])
return $o(
t,
o,
Object.keys(s || {}).reduce(function (t, r) {
return (
(t[r] = Zt(
Ea(function () {
Vo(n)
var t = n._s.get(e)
return s[r].call(t, t)
})
)),
t
)
}, {})
)
},
t,
n,
r,
!0
)),
i
)
}
function ns(e, t) {
var n,
r,
i,
a,
o,
s = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {},
u = arguments.length > 3 ? arguments[3] : void 0,
l = arguments.length > 5 ? arguments[5] : void 0,
c = $o({ actions: {} }, s),
h = { deep: !0 },
d = [],
f = [],
p = u.state.value[e]
function v(t) {
var n
;((r = i = !1),
'function' == typeof t
? (t(u.state.value[e]), (n = { type: Uo.patchFunction, storeId: e, events: a }))
: (Ko(u.state.value[e], t),
(n = { type: Uo.patchObject, payload: t, storeId: e, events: a })))
var s = (o = Symbol())
;(Cn().then(function () {
o === s && (r = !0)
}),
(i = !0),
Qo(d, n, u.state.value[e]))
}
;(l || p || (u.state.value[e] = {}), tn({}))
var m = l
? function () {
var e = s.state,
t = e ? e() : {}
this.$patch(function (e) {
$o(e, t)
})
}
: Go
var g = function (t) {
var n = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : ''
if (Xo in t) return ((t[Yo] = n), t)
var r = function () {
Vo(u)
var n,
i = Array.from(arguments),
a = [],
o = []
Qo(f, {
args: i,
name: r[Yo],
store: _,
after: function (e) {
a.push(e)
},
onError: function (e) {
o.push(e)
},
})
try {
n = t.apply(this && this.$id === e ? this : _, i)
} catch (s) {
throw (Qo(o, s), s)
}
return n instanceof Promise
? n
.then(function (e) {
return (Qo(a, e), e)
})
.catch(function (e) {
return (Qo(o, e), Promise.reject(e))
})
: (Qo(a, n), n)
}
return ((r[Xo] = !0), (r[Yo] = n), r)
},
y = {
_p: u,
$id: e,
$onAction: jo.bind(null, f),
$patch: v,
$reset: m,
$subscribe: function (t) {
var o = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {},
s = jo(d, t, o.detached, function () {
return l()
}),
l = n.run(function () {
return Ti(
function () {
return u.state.value[e]
},
function (n) {
;('sync' === o.flush ? i : r) &&
t({ storeId: e, type: Uo.direct, events: a }, n)
},
$o({}, h, o)
)
})
return s
},
$dispose: function () {
;(n.stop(), (d = []), (f = []), u._s.delete(e))
},
},
_ = Wt(y)
u._s.set(e, _)
var b = ((u._a && u._a.runWithContext) || qo)(function () {
return u._e.run(function () {
return (n = De()).run(function () {
return t({ action: g })
})
})
})
for (var x in b) {
var S = b[x]
if ((en(S) && !es(S)) || Qt(S))
l ||
(p && Jo(S) && (en(S) ? (S.value = p[x]) : Ko(S, p[x])),
(u.state.value[e][x] = S))
else if ('function' == typeof S) {
var A = g(S, x)
;((b[x] = A), (c.actions[x] = S))
}
}
return (
$o(_, b),
$o(Kt(_), b),
Object.defineProperty(_, '$state', {
get: function () {
return u.state.value[e]
},
set: function (e) {
v(function (t) {
$o(t, e)
})
},
}),
u._p.forEach(function (e) {
$o(
_,
n.run(function () {
return e({ store: _, app: u._a, pinia: u, options: c })
})
)
}),
p && l && s.hydrate && s.hydrate(_.$state, p),
(r = !0),
(i = !0),
_
)
}
/*! #__NO_SIDE_EFFECTS__ */ function rs(e, t, n) {
var r,
i = 'function' == typeof t
function a(n, a) {
return (
(n = n || (!!(pa || Dn || Jr) ? ei(Ho, null) : null)) && Vo(n),
(n = Fo)._s.has(e) || (i ? ns(e, t, r, n) : ts(e, r, n)),
n._s.get(e)
)
}
return ((r = i ? n : t), (a.$id = e), a)
}
function is(e) {
var t = Kt(e),
n = {},
r = function (r) {
var i = t[r]
i.effect
? (n[r] = Ea({
get: function () {
return e[r]
},
set: function (t) {
e[r] = t
},
}))
: (en(i) || Qt(i)) &&
(n[r] = (function (e, t, n) {
return en(e)
? e
: J(e)
? new cn(e)
: te(e) && arguments.length > 1
? hn(e, t, n)
: tn(e)
})(e, r))
}
for (var i in t) r(i)
return n
}
function as(e) {
return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, 'default')
? e.default
: e
}
var os,
ss = { exports: {} }
var us =
(os ||
((os = 1),
(function (e) {
var t = Object.prototype.hasOwnProperty,
n = '~'
function r() {}
function i(e, t, n) {
;((this.fn = e), (this.context = t), (this.once = n || !1))
}
function a(e, t, r, a, o) {
if ('function' != typeof r)
throw new TypeError('The listener must be a function')
var s = new i(r, a || e, o),
u = n ? n + t : t
return (
e._events[u]
? e._events[u].fn
? (e._events[u] = [e._events[u], s])
: e._events[u].push(s)
: ((e._events[u] = s), e._eventsCount++),
e
)
}
function o(e, t) {
0 === --e._eventsCount ? (e._events = new r()) : delete e._events[t]
}
function s() {
;((this._events = new r()), (this._eventsCount = 0))
}
;(Object.create &&
((r.prototype = Object.create(null)), new r().__proto__ || (n = !1)),
(s.prototype.eventNames = function () {
var e,
r,
i = []
if (0 === this._eventsCount) return i
for (r in (e = this._events)) t.call(e, r) && i.push(n ? r.slice(1) : r)
return Object.getOwnPropertySymbols
? i.concat(Object.getOwnPropertySymbols(e))
: i
}),
(s.prototype.listeners = function (e) {
var t = n ? n + e : e,
r = this._events[t]
if (!r) return []
if (r.fn) return [r.fn]
for (var i = 0, a = r.length, o = new Array(a); i < a; i++) o[i] = r[i].fn
return o
}),
(s.prototype.listenerCount = function (e) {
var t = n ? n + e : e,
r = this._events[t]
return r ? (r.fn ? 1 : r.length) : 0
}),
(s.prototype.emit = function (e, t, r, i, a, o) {
var s = n ? n + e : e
if (!this._events[s]) return !1
var u,
l,
c = this._events[s],
h = arguments.length
if (c.fn) {
switch ((c.once && this.removeListener(e, c.fn, void 0, !0), h)) {
case 1:
return (c.fn.call(c.context), !0)
case 2:
return (c.fn.call(c.context, t), !0)
case 3:
return (c.fn.call(c.context, t, r), !0)
case 4:
return (c.fn.call(c.context, t, r, i), !0)
case 5:
return (c.fn.call(c.context, t, r, i, a), !0)
case 6:
return (c.fn.call(c.context, t, r, i, a, o), !0)
}
for (l = 1, u = new Array(h - 1); l < h; l++) u[l - 1] = arguments[l]
c.fn.apply(c.context, u)
} else {
var d,
f = c.length
for (l = 0; l < f; l++)
switch ((c[l].once && this.removeListener(e, c[l].fn, void 0, !0), h)) {
case 1:
c[l].fn.call(c[l].context)
break
case 2:
c[l].fn.call(c[l].context, t)
break
case 3:
c[l].fn.call(c[l].context, t, r)
break
case 4:
c[l].fn.call(c[l].context, t, r, i)
break
default:
if (!u)
for (d = 1, u = new Array(h - 1); d < h; d++)
u[d - 1] = arguments[d]
c[l].fn.apply(c[l].context, u)
}
}
return !0
}),
(s.prototype.on = function (e, t, n) {
return a(this, e, t, n, !1)
}),
(s.prototype.once = function (e, t, n) {
return a(this, e, t, n, !0)
}),
(s.prototype.removeListener = function (e, t, r, i) {
var a = n ? n + e : e
if (!this._events[a]) return this
if (!t) return (o(this, a), this)
var s = this._events[a]
if (s.fn) s.fn !== t || (i && !s.once) || (r && s.context !== r) || o(this, a)
else {
for (var u = 0, l = [], c = s.length; u < c; u++)
(s[u].fn !== t || (i && !s[u].once) || (r && s[u].context !== r)) &&
l.push(s[u])
l.length ? (this._events[a] = 1 === l.length ? l[0] : l) : o(this, a)
}
return this
}),
(s.prototype.removeAllListeners = function (e) {
var t
return (
e
? ((t = n ? n + e : e), this._events[t] && o(this, t))
: ((this._events = new r()), (this._eventsCount = 0)),
this
)
}),
(s.prototype.off = s.prototype.removeListener),
(s.prototype.addListener = s.prototype.on),
(s.prefixed = n),
(s.EventEmitter = s),
(e.exports = s))
})(ss)),
ss.exports),
ls = as(us),
cs = (function (e) {
return (
(e.ErrorReceived = 'ErrorReceived'),
(e.MessageReceived = 'MessageReceived'),
(e.StartSpeech = 'StartSpeech'),
(e.EndSpeech = 'EndSpeech'),
(e.StateChanged = 'StateChanged'),
e
)
})(cs || {}),
hs = (function (e) {
return (
(e.WS_CLOSE = 'WS_CLOSE'),
(e.WS_ERROR = 'WS_ERROR'),
(e.WS_MESSAGE = 'WS_MESSAGE'),
(e.WS_OPEN = 'WS_OPEN'),
e
)
})(hs || {}),
ds = (function (e) {
return (
(e.Player_EndSpeaking = 'Player_EndSpeaking'),
(e.Player_NoLegacy = 'Player_NoLegacy'),
(e.Player_StartSpeaking = 'Player_StartSpeaking'),
(e.Player_WaitNextAudioClip = 'Player_WaitNextAudioClip'),
e
)
})(ds || {}),
fs = (function (e) {
return (
(e.Change_Status = 'Change_Status'),
(e.Chat_BinsizeError = 'Chat_BinsizeError'),
e
)
})(fs || {}),
ps = (function (e) {
function t(e) {
var n
return (
A(this, t),
M((n = y(this, t)), 'engine', void 0),
M(n, '_inited', !1),
n._init(e),
n
)
}
return (
x(t, e),
T(t, [
{
key: '_init',
value: function (e) {
var t = this
this._inited ||
((this._inited = !0),
(this.engine = new WebSocket(e)),
this.engine.addEventListener('error', function (e) {
t.emit(hs.WS_ERROR, e)
}),
this.engine.addEventListener('open', function () {
t.emit(hs.WS_OPEN)
}),
this.engine.addEventListener('message', function (e) {
t.emit(hs.WS_MESSAGE, e.data)
}),
this.engine.addEventListener('close', function () {
t.emit(hs.WS_CLOSE)
}))
},
},
{
key: 'send',
value: function (e) {
var t
null === (t = this.engine) || void 0 === t || t.send(e)
},
},
{
key: 'stop',
value: function () {
var e
;(this.emit(hs.WS_CLOSE),
(this._inited = !1),
null === (e = this.engine) || void 0 === e || e.close())
},
},
])
)
})(ls),
vs = (function (e) {
return (
(e.Idle = 'Idle'),
(e.Listening = 'Listening'),
(e.Responding = 'Responding'),
(e.Thinking = 'Thinking'),
e
)
})(vs || {}),
ms = (function (e) {
return ((e.closed = 'closed'), (e.open = 'open'), (e.waiting = 'waiting'), e)
})(ms || {}),
gs = (function (e) {
function t(e) {
var n
return (A(this, t), ((n = y(this, t, [e])).name = 'TimeoutError'), n)
}
return (x(t, e), T(t))
})(m(Error)),
ys = (function (e) {
function t(e) {
var n
return (A(this, t), ((n = y(this, t)).name = 'AbortError'), (n.message = e), n)
}
return (x(t, e), T(t))
})(m(Error)),
_s = function (e) {
return void 0 === globalThis.DOMException ? new ys(e) : new DOMException(e)
},
bs = function (e) {
var t = void 0 === e.reason ? _s('This operation was aborted.') : e.reason
return t instanceof Error ? t : _s(t)
}
function xs(e, t) {
var n,
r,
i = t.milliseconds,
a = t.fallback,
o = t.message,
s = t.customTimers,
u = void 0 === s ? { setTimeout: setTimeout, clearTimeout: clearTimeout } : s,
l = new Promise(function (s, l) {
if ('number' != typeof i || 1 !== Math.sign(i))
throw new TypeError(
'Expected `milliseconds` to be a positive number, got `'.concat(i, '`')
)
if (t.signal) {
var c = t.signal
;(c.aborted && l(bs(c)),
(r = function () {
l(bs(c))
}),
c.addEventListener('abort', r, { once: !0 }))
}
if (i !== Number.POSITIVE_INFINITY) {
var h = new gs()
;((n = u.setTimeout.call(
void 0,
function () {
if (a)
try {
s(a())
} catch (t) {
l(t)
}
else
('function' == typeof e.cancel && e.cancel(),
!1 === o
? s()
: o instanceof Error
? l(o)
: ((h.message =
null != o
? o
: 'Promise timed out after '.concat(i, ' milliseconds')),
l(h)))
},
i
)),
v(
d().m(function t() {
var n, r, i
return d().w(
function (t) {
for (;;)
switch (t.n) {
case 0:
return ((t.p = 0), (n = s), (t.n = 1), e)
case 1:
;((r = t.v), n(r), (t.n = 3))
break
case 2:
;((t.p = 2), (i = t.v), l(i))
case 3:
return t.a(2)
}
},
t,
null,
[[0, 2]]
)
})
)())
} else e.then(s, l)
}),
c = l.finally(function () {
;(c.clear(), r && t.signal && t.signal.removeEventListener('abort', r))
})
return (
(c.clear = function () {
;(u.clearTimeout.call(void 0, n), (n = void 0))
}),
c
)
}
var Ss = new WeakMap(),
As = (function () {
return T(
function e() {
;(A(this, e), u(this, Ss, []))
},
[
{
key: 'enqueue',
value: function (e, t) {
var n = { priority: (t = s({ priority: 0 }, t)).priority, id: t.id, run: e }
if (0 === this.size || c(Ss, this)[this.size - 1].priority >= t.priority)
c(Ss, this).push(n)
else {
var r = (function (e, t, n) {
for (var r = 0, i = e.length; i > 0; ) {
var a = Math.trunc(i / 2),
o = r + a
n(e[o], t) <= 0 ? ((r = ++o), (i -= a + 1)) : (i = a)
}
return r
})(c(Ss, this), n, function (e, t) {
return t.priority - e.priority
})
c(Ss, this).splice(r, 0, n)
}
},
},
{
key: 'setPriority',
value: function (e, t) {
var n = c(Ss, this).findIndex(function (t) {
return t.id === e
})
if (-1 === n)
throw new ReferenceError(
'No promise function with the id "'.concat(e, '" exists in the queue.')
)
var r = C(c(Ss, this).splice(n, 1), 1)[0]
this.enqueue(r.run, { priority: t, id: e })
},
},
{
key: 'dequeue',
value: function () {
var e = c(Ss, this).shift()
return null == e ? void 0 : e.run
},
},
{
key: 'filter',
value: function (e) {
return c(Ss, this)
.filter(function (t) {
return t.priority === e.priority
})
.map(function (e) {
return e.run
})
},
},
{
key: 'size',
get: function () {
return c(Ss, this).length
},
},
]
)
})(),
ws = new WeakMap(),
Ts = new WeakMap(),
Ms = new WeakMap(),
Es = new WeakMap(),
Cs = new WeakMap(),
ks = new WeakMap(),
Rs = new WeakMap(),
Is = new WeakMap(),
Ns = new WeakMap(),
Ps = new WeakMap(),
Ls = new WeakMap(),
Ds = new WeakMap(),
Os = new WeakMap(),
Fs = new WeakMap(),
Bs = new WeakMap(),
Us = new WeakSet(),
zs = (function (e) {
function t(e) {
var n, r, i, o, c
if (
(A(this, t),
(function (e, t) {
;(l(e, t), t.add(e))
})((n = y(this, t)), Us),
u(n, ws, void 0),
u(n, Ts, void 0),
u(n, Ms, 0),
u(n, Es, void 0),
u(n, Cs, void 0),
u(n, ks, 0),
u(n, Rs, void 0),
u(n, Is, void 0),
u(n, Ns, void 0),
u(n, Ps, void 0),
u(n, Ls, 0),
u(n, Ds, void 0),
u(n, Os, void 0),
u(n, Fs, void 0),
u(n, Bs, 1n),
M(n, 'timeout', void 0),
!(
'number' ==
typeof (e = s(
{
carryoverConcurrencyCount: !1,
intervalCap: Number.POSITIVE_INFINITY,
interval: 0,
concurrency: Number.POSITIVE_INFINITY,
autoStart: !0,
queueClass: As,
},
e
)).intervalCap && e.intervalCap >= 1
))
)
throw new TypeError(
'Expected `intervalCap` to be a number from 1 and up, got `'
.concat(
null !==
(r =
null === (i = e.intervalCap) || void 0 === i ? void 0 : i.toString()) &&
void 0 !== r
? r
: '',
'` ('
)
.concat(P(e.intervalCap), ')')
)
if (void 0 === e.interval || !(Number.isFinite(e.interval) && e.interval >= 0))
throw new TypeError(
'Expected `interval` to be a finite number >= 0, got `'
.concat(
null !==
(o = null === (c = e.interval) || void 0 === c ? void 0 : c.toString()) &&
void 0 !== o
? o
: '',
'` ('
)
.concat(P(e.interval), ')')
)
return (
a(ws, n, e.carryoverConcurrencyCount),
a(Ts, n, e.intervalCap === Number.POSITIVE_INFINITY || 0 === e.interval),
a(Es, n, e.intervalCap),
a(Cs, n, e.interval),
a(Ns, n, new e.queueClass()),
a(Ps, n, e.queueClass),
(n.concurrency = e.concurrency),
(n.timeout = e.timeout),
a(Fs, n, !0 === e.throwOnTimeout),
a(Os, n, !1 === e.autoStart),
n
)
}
return (
x(t, e),
T(t, [
{
key: 'concurrency',
get: function () {
return c(Ds, this)
},
set: function (e) {
if (!('number' == typeof e && e >= 1))
throw new TypeError(
'Expected `concurrency` to be a number from 1 and up, got `'
.concat(e, '` (')
.concat(P(e), ')')
)
;(a(Ds, this, e), h(Us, this, Ys).call(this))
},
},
{
key: 'setPriority',
value: function (e, t) {
c(Ns, this).setPriority(e, t)
},
},
{
key: 'add',
value:
((f = v(
d().m(function e(t) {
var n,
r,
i,
o,
u,
l = this,
f = arguments
return d().w(
function (e) {
for (;;)
if (0 === e.n)
return (
(null !==
(o = (i = u = f.length > 1 && void 0 !== f[1] ? f[1] : {})
.id) &&
void 0 !== o) ||
(i.id = (a(Bs, this, ((n = c(Bs, this)), (r = n++), n)),
r).toString()),
(u = s(
{ timeout: this.timeout, throwOnTimeout: c(Fs, this) },
u
)),
e.a(
2,
new Promise(function (e, n) {
;(c(Ns, l).enqueue(
v(
d().m(function r() {
var i, o, s, f, p, v
return d().w(
function (r) {
for (;;)
switch (r.n) {
case 0:
return (
a(Ls, l, ((i = c(Ls, l)), ++i)),
a(Ms, l, ((o = c(Ms, l)), ++o)),
(r.p = 1),
null === (s = u.signal) ||
void 0 === s ||
s.throwIfAborted(),
(f = t({ signal: u.signal })),
u.timeout &&
(f = xs(Promise.resolve(f), {
milliseconds: u.timeout,
})),
u.signal &&
(f = Promise.race([
f,
h(Us, l, Ks).call(l, u.signal),
])),
(r.n = 2),
f
)
case 2:
;((p = r.v),
e(p),
l.emit('completed', p),
(r.n = 5))
break
case 3:
if (
((r.p = 3),
!((v = r.v) instanceof gs) ||
u.throwOnTimeout)
) {
r.n = 4
break
}
return (e(), r.a(2))
case 4:
;(n(v), l.emit('error', v))
case 5:
return (
(r.p = 5),
h(Us, l, Ws).call(l),
r.f(5)
)
case 6:
return r.a(2)
}
},
r,
null,
[[1, 3, 5, 6]]
)
})
),
u
),
l.emit('add'),
h(Us, l, Qs).call(l))
})
)
)
},
e,
this
)
})
)),
function (e) {
return f.apply(this, arguments)
}),
},
{
key: 'addAll',
value:
((o = v(
d().m(function e(t, n) {
var r = this
return d().w(function (e) {
for (;;)
if (0 === e.n)
return e.a(
2,
Promise.all(
t.map(
(function () {
var e = v(
d().m(function e(t) {
return d().w(function (e) {
for (;;) if (0 === e.n) return e.a(2, r.add(t, n))
}, e)
})
)
return function (t) {
return e.apply(this, arguments)
}
})()
)
)
)
}, e)
})
)),
function (e, t) {
return o.apply(this, arguments)
}),
},
{
key: 'start',
value: function () {
return c(Os, this)
? (a(Os, this, !1), h(Us, this, Ys).call(this), this)
: this
},
},
{
key: 'pause',
value: function () {
a(Os, this, !0)
},
},
{
key: 'clear',
value: function () {
a(Ns, this, new (c(Ps, this))())
},
},
{
key: 'onEmpty',
value:
((i = v(
d().m(function e() {
return d().w(
function (e) {
for (;;)
switch (e.n) {
case 0:
if (0 !== c(Ns, this).size) {
e.n = 1
break
}
return e.a(2)
case 1:
return ((e.n = 2), h(Us, this, Js).call(this, 'empty'))
case 2:
return e.a(2)
}
},
e,
this
)
})
)),
function () {
return i.apply(this, arguments)
}),
},
{
key: 'onSizeLessThan',
value:
((r = v(
d().m(function e(t) {
var n = this
return d().w(
function (e) {
for (;;)
switch (e.n) {
case 0:
if (!(c(Ns, this).size < t)) {
e.n = 1
break
}
return e.a(2)
case 1:
return (
(e.n = 2),
h(Us, this, Js).call(this, 'next', function () {
return c(Ns, n).size < t
})
)
case 2:
return e.a(2)
}
},
e,
this
)
})
)),
function (e) {
return r.apply(this, arguments)
}),
},
{
key: 'onIdle',
value:
((n = v(
d().m(function e() {
return d().w(
function (e) {
for (;;)
switch (e.n) {
case 0:
if (0 !== c(Ls, this) || 0 !== c(Ns, this).size) {
e.n = 1
break
}
return e.a(2)
case 1:
return ((e.n = 2), h(Us, this, Js).call(this, 'idle'))
case 2:
return e.a(2)
}
},
e,
this
)
})
)),
function () {
return n.apply(this, arguments)
}),
},
{
key: 'size',
get: function () {
return c(Ns, this).size
},
},
{
key: 'sizeBy',
value: function (e) {
return c(Ns, this).filter(e).length
},
},
{
key: 'pending',
get: function () {
return c(Ls, this)
},
},
{
key: 'isPaused',
get: function () {
return c(Os, this)
},
},
])
)
var n, r, i, o, f
})(ls)
function Vs(e) {
return c(Ts, e) || c(Ms, e) < c(Es, e)
}
function Hs(e) {
return c(Ls, e) < c(Ds, e)
}
function Ws() {
var e
;(a(Ls, this, ((e = c(Ls, this)), e--, e)),
h(Us, this, Qs).call(this),
this.emit('next'))
}
function Gs() {
;(h(Us, this, Xs).call(this), h(Us, this, qs).call(this), a(Is, this, void 0))
}
function js(e) {
var t = Date.now()
if (void 0 === c(Rs, e)) {
var n = c(ks, e) - t
if (!(n < 0))
return (
void 0 === c(Is, e) &&
a(
Is,
e,
setTimeout(function () {
h(Us, e, Gs).call(e)
}, n)
),
!0
)
a(Ms, e, c(ws, e) ? c(Ls, e) : 0)
}
return !1
}
function Qs() {
if (0 === c(Ns, this).size)
return (
c(Rs, this) && clearInterval(c(Rs, this)),
a(Rs, this, void 0),
this.emit('empty'),
0 === c(Ls, this) && this.emit('idle'),
!1
)
if (!c(Os, this)) {
var e = !i(Us, this, js)
if (i(Us, this, Vs) && i(Us, this, Hs)) {
var t = c(Ns, this).dequeue()
return !!t && (this.emit('active'), t(), e && h(Us, this, qs).call(this), !0)
}
}
return !1
}
function qs() {
var e = this
c(Ts, this) ||
void 0 !== c(Rs, this) ||
(a(
Rs,
this,
setInterval(
function () {
h(Us, e, Xs).call(e)
},
c(Cs, this)
)
),
a(ks, this, Date.now() + c(Cs, this)))
}
function Xs() {
;(0 === c(Ms, this) &&
0 === c(Ls, this) &&
c(Rs, this) &&
(clearInterval(c(Rs, this)), a(Rs, this, void 0)),
a(Ms, this, c(ws, this) ? c(Ls, this) : 0),
h(Us, this, Ys).call(this))
}
function Ys() {
for (; h(Us, this, Qs).call(this); );
}
function Ks(e) {
return Zs.apply(this, arguments)
}
function Zs() {
return (Zs = v(
d().m(function e(t) {
return d().w(function (e) {
for (;;)
if (0 === e.n)
return e.a(
2,
new Promise(function (e, n) {
t.addEventListener(
'abort',
function () {
n(t.reason)
},
{ once: !0 }
)
})
)
}, e)
})
)).apply(this, arguments)
}
function Js(e, t) {
return $s.apply(this, arguments)
}
function $s() {
return (
($s = v(
d().m(function e(t, n) {
var r = this
return d().w(function (e) {
for (;;)
if (0 === e.n)
return e.a(
2,
new Promise(function (e) {
var i = function () {
;(n && !n()) || (r.off(t, i), e())
}
r.on(t, i)
})
)
}, e)
})
)),
$s.apply(this, arguments)
)
}
var eu,
tu = {}
function nu() {
if (eu) return tu
;((eu = 1),
(tu.byteLength = function (e) {
var t = a(e),
n = t[0],
r = t[1]
return (3 * (n + r)) / 4 - r
}),
(tu.toByteArray = function (e) {
var r,
i,
o = a(e),
s = o[0],
u = o[1],
l = new n(
(function (e, t, n) {
return (3 * (t + n)) / 4 - n
})(0, s, u)
),
c = 0,
h = u > 0 ? s - 4 : s
for (i = 0; i < h; i += 4)
((r =
(t[e.charCodeAt(i)] << 18) |
(t[e.charCodeAt(i + 1)] << 12) |
(t[e.charCodeAt(i + 2)] << 6) |
t[e.charCodeAt(i + 3)]),
(l[c++] = (r >> 16) & 255),
(l[c++] = (r >> 8) & 255),
(l[c++] = 255 & r))
2 === u &&
((r = (t[e.charCodeAt(i)] << 2) | (t[e.charCodeAt(i + 1)] >> 4)),
(l[c++] = 255 & r))
1 === u &&
((r =
(t[e.charCodeAt(i)] << 10) |
(t[e.charCodeAt(i + 1)] << 4) |
(t[e.charCodeAt(i + 2)] >> 2)),
(l[c++] = (r >> 8) & 255),
(l[c++] = 255 & r))
return l
}),
(tu.fromByteArray = function (t) {
for (
var n, r = t.length, i = r % 3, a = [], o = 16383, u = 0, l = r - i;
u < l;
u += o
)
a.push(s(t, u, u + o > l ? l : u + o))
1 === i
? ((n = t[r - 1]), a.push(e[n >> 2] + e[(n << 4) & 63] + '=='))
: 2 === i &&
((n = (t[r - 2] << 8) + t[r - 1]),
a.push(e[n >> 10] + e[(n >> 4) & 63] + e[(n << 2) & 63] + '='))
return a.join('')
}))
for (
var e = [],
t = [],
n = 'undefined' != typeof Uint8Array ? Uint8Array : Array,
r = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/',
i = 0;
i < 64;
++i
)
((e[i] = r[i]), (t[r.charCodeAt(i)] = i))
function a(e) {
var t = e.length
if (t % 4 > 0) throw new Error('Invalid string. Length must be a multiple of 4')
var n = e.indexOf('=')
return (-1 === n && (n = t), [n, n === t ? 0 : 4 - (n % 4)])
}
function o(t) {
return e[(t >> 18) & 63] + e[(t >> 12) & 63] + e[(t >> 6) & 63] + e[63 & t]
}
function s(e, t, n) {
for (var r, i = [], a = t; a < n; a += 3)
((r = ((e[a] << 16) & 16711680) + ((e[a + 1] << 8) & 65280) + (255 & e[a + 2])),
i.push(o(r)))
return i.join('')
}
return ((t['-'.charCodeAt(0)] = 62), (t['_'.charCodeAt(0)] = 63), tu)
}
nu()
var ru,
iu,
au = {},
ou = {}
function su() {
return (
ru ||
((ru = 1),
(ou.read = function (e, t, n, r, i) {
var a,
o,
s = 8 * i - r - 1,
u = (1 << s) - 1,
l = u >> 1,
c = -7,
h = n ? i - 1 : 0,
d = n ? -1 : 1,
f = e[t + h]
for (
h += d, a = f & ((1 << -c) - 1), f >>= -c, c += s;
c > 0;
a = 256 * a + e[t + h], h += d, c -= 8
);
for (
o = a & ((1 << -c) - 1), a >>= -c, c += r;
c > 0;
o = 256 * o + e[t + h], h += d, c -= 8
);
if (0 === a) a = 1 - l
else {
if (a === u) return o ? NaN : (1 / 0) * (f ? -1 : 1)
;((o += Math.pow(2, r)), (a -= l))
}
return (f ? -1 : 1) * o * Math.pow(2, a - r)
}),
(ou.write = function (e, t, n, r, i, a) {
var o,
s,
u,
l = 8 * a - i - 1,
c = (1 << l) - 1,
h = c >> 1,
d = 23 === i ? Math.pow(2, -24) - Math.pow(2, -77) : 0,
f = r ? 0 : a - 1,
p = r ? 1 : -1,
v = t < 0 || (0 === t && 1 / t < 0) ? 1 : 0
for (
t = Math.abs(t),
isNaN(t) || t === 1 / 0
? ((s = isNaN(t) ? 1 : 0), (o = c))
: ((o = Math.floor(Math.log(t) / Math.LN2)),
t * (u = Math.pow(2, -o)) < 1 && (o--, (u *= 2)),
(t += o + h >= 1 ? d / u : d * Math.pow(2, 1 - h)) * u >= 2 &&
(o++, (u /= 2)),
o + h >= c
? ((s = 0), (o = c))
: o + h >= 1
? ((s = (t * u - 1) * Math.pow(2, i)), (o += h))
: ((s = t * Math.pow(2, h - 1) * Math.pow(2, i)), (o = 0)));
i >= 8;
e[n + f] = 255 & s, f += p, s /= 256, i -= 8
);
for (
o = (o << i) | s, l += i;
l > 0;
e[n + f] = 255 & o, f += p, o /= 256, l -= 8
);
e[n + f - p] |= 128 * v
})),
ou
)
}
/*!
* The buffer module from node.js, for the browser.
*
* @author Feross Aboukhadijeh
* @license MIT
*/ function uu() {
return (
iu ||
((iu = 1),
(function (e) {
var t = nu(),
n = su(),
r =
'function' == typeof Symbol && 'function' == typeof Symbol.for
? Symbol.for('nodejs.util.inspect.custom')
: null
;((e.Buffer = o),
(e.SlowBuffer = function (e) {
;+e != e && (e = 0)
return o.alloc(+e)
}),
(e.INSPECT_MAX_BYTES = 50))
var i = 2147483647
function a(e) {
if (e > i)
throw new RangeError('The value "' + e + '" is invalid for option "size"')
var t = new Uint8Array(e)
return (Object.setPrototypeOf(t, o.prototype), t)
}
function o(e, t, n) {
if ('number' == typeof e) {
if ('string' == typeof t)
throw new TypeError(
'The "string" argument must be of type string. Received type number'
)
return l(e)
}
return s(e, t, n)
}
function s(e, t, n) {
if ('string' == typeof e)
return (function (e, t) {
;('string' == typeof t && '' !== t) || (t = 'utf8')
if (!o.isEncoding(t)) throw new TypeError('Unknown encoding: ' + t)
var n = 0 | f(e, t),
r = a(n),
i = r.write(e, t)
i !== n && (r = r.slice(0, i))
return r
})(e, t)
if (ArrayBuffer.isView(e))
return (function (e) {
if (J(e, Uint8Array)) {
var t = new Uint8Array(e)
return h(t.buffer, t.byteOffset, t.byteLength)
}
return c(e)
})(e)
if (null == e)
throw new TypeError(
'The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type ' +
P(e)
)
if (J(e, ArrayBuffer) || (e && J(e.buffer, ArrayBuffer))) return h(e, t, n)
if (
'undefined' != typeof SharedArrayBuffer &&
(J(e, SharedArrayBuffer) || (e && J(e.buffer, SharedArrayBuffer)))
)
return h(e, t, n)
if ('number' == typeof e)
throw new TypeError(
'The "value" argument must not be of type number. Received type number'
)
var r = e.valueOf && e.valueOf()
if (null != r && r !== e) return o.from(r, t, n)
var i = (function (e) {
if (o.isBuffer(e)) {
var t = 0 | d(e.length),
n = a(t)
return (0 === n.length || e.copy(n, 0, 0, t), n)
}
if (void 0 !== e.length)
return 'number' != typeof e.length || $(e.length) ? a(0) : c(e)
if ('Buffer' === e.type && Array.isArray(e.data)) return c(e.data)
})(e)
if (i) return i
if (
'undefined' != typeof Symbol &&
null != Symbol.toPrimitive &&
'function' == typeof e[Symbol.toPrimitive]
)
return o.from(e[Symbol.toPrimitive]('string'), t, n)
throw new TypeError(
'The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type ' +
P(e)
)
}
function u(e) {
if ('number' != typeof e)
throw new TypeError('"size" argument must be of type number')
if (e < 0)
throw new RangeError('The value "' + e + '" is invalid for option "size"')
}
function l(e) {
return (u(e), a(e < 0 ? 0 : 0 | d(e)))
}
function c(e) {
for (var t = e.length < 0 ? 0 : 0 | d(e.length), n = a(t), r = 0; r < t; r += 1)
n[r] = 255 & e[r]
return n
}
function h(e, t, n) {
if (t < 0 || e.byteLength < t)
throw new RangeError('"offset" is outside of buffer bounds')
if (e.byteLength < t + (n || 0))
throw new RangeError('"length" is outside of buffer bounds')
var r
return (
(r =
void 0 === t && void 0 === n
? new Uint8Array(e)
: void 0 === n
? new Uint8Array(e, t)
: new Uint8Array(e, t, n)),
Object.setPrototypeOf(r, o.prototype),
r
)
}
function d(e) {
if (e >= i)
throw new RangeError(
'Attempt to allocate Buffer larger than maximum size: 0x' +
i.toString(16) +
' bytes'
)
return 0 | e
}
function f(e, t) {
if (o.isBuffer(e)) return e.length
if (ArrayBuffer.isView(e) || J(e, ArrayBuffer)) return e.byteLength
if ('string' != typeof e)
throw new TypeError(
'The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type ' +
P(e)
)
var n = e.length,
r = arguments.length > 2 && !0 === arguments[2]
if (!r && 0 === n) return 0
for (var i = !1; ; )
switch (t) {
case 'ascii':
case 'latin1':
case 'binary':
return n
case 'utf8':
case 'utf-8':
return Y(e).length
case 'ucs2':
case 'ucs-2':
case 'utf16le':
case 'utf-16le':
return 2 * n
case 'hex':
return n >>> 1
case 'base64':
return K(e).length
default:
if (i) return r ? -1 : Y(e).length
;((t = ('' + t).toLowerCase()), (i = !0))
}
}
function p(e, t, n) {
var r = !1
if (((void 0 === t || t < 0) && (t = 0), t > this.length)) return ''
if (((void 0 === n || n > this.length) && (n = this.length), n <= 0)) return ''
if ((n >>>= 0) <= (t >>>= 0)) return ''
for (e || (e = 'utf8'); ; )
switch (e) {
case 'hex':
return N(this, t, n)
case 'utf8':
case 'utf-8':
return C(this, t, n)
case 'ascii':
return R(this, t, n)
case 'latin1':
case 'binary':
return I(this, t, n)
case 'base64':
return E(this, t, n)
case 'ucs2':
case 'ucs-2':
case 'utf16le':
case 'utf-16le':
return L(this, t, n)
default:
if (r) throw new TypeError('Unknown encoding: ' + e)
;((e = (e + '').toLowerCase()), (r = !0))
}
}
function v(e, t, n) {
var r = e[t]
;((e[t] = e[n]), (e[n] = r))
}
function m(e, t, n, r, i) {
if (0 === e.length) return -1
if (
('string' == typeof n
? ((r = n), (n = 0))
: n > 2147483647
? (n = 2147483647)
: n < -2147483648 && (n = -2147483648),
$((n = +n)) && (n = i ? 0 : e.length - 1),
n < 0 && (n = e.length + n),
n >= e.length)
) {
if (i) return -1
n = e.length - 1
} else if (n < 0) {
if (!i) return -1
n = 0
}
if (('string' == typeof t && (t = o.from(t, r)), o.isBuffer(t)))
return 0 === t.length ? -1 : g(e, t, n, r, i)
if ('number' == typeof t)
return (
(t &= 255),
'function' == typeof Uint8Array.prototype.indexOf
? i
? Uint8Array.prototype.indexOf.call(e, t, n)
: Uint8Array.prototype.lastIndexOf.call(e, t, n)
: g(e, [t], n, r, i)
)
throw new TypeError('val must be string, number or Buffer')
}
function g(e, t, n, r, i) {
var a,
o = 1,
s = e.length,
u = t.length
if (
void 0 !== r &&
('ucs2' === (r = String(r).toLowerCase()) ||
'ucs-2' === r ||
'utf16le' === r ||
'utf-16le' === r)
) {
if (e.length < 2 || t.length < 2) return -1
;((o = 2), (s /= 2), (u /= 2), (n /= 2))
}
function l(e, t) {
return 1 === o ? e[t] : e.readUInt16BE(t * o)
}
if (i) {
var c = -1
for (a = n; a < s; a++)
if (l(e, a) === l(t, -1 === c ? 0 : a - c)) {
if ((-1 === c && (c = a), a - c + 1 === u)) return c * o
} else (-1 !== c && (a -= a - c), (c = -1))
} else
for (n + u > s && (n = s - u), a = n; a >= 0; a--) {
for (var h = !0, d = 0; d < u; d++)
if (l(e, a + d) !== l(t, d)) {
h = !1
break
}
if (h) return a
}
return -1
}
function _(e, t, n, r) {
n = Number(n) || 0
var i = e.length - n
r ? (r = Number(r)) > i && (r = i) : (r = i)
var a,
o = t.length
for (r > o / 2 && (r = o / 2), a = 0; a < r; ++a) {
var s = parseInt(t.substr(2 * a, 2), 16)
if ($(s)) return a
e[n + a] = s
}
return a
}
function b(e, t, n, r) {
return Z(Y(t, e.length - n), e, n, r)
}
function S(e, t, n, r) {
return Z(
(function (e) {
for (var t = [], n = 0; n < e.length; ++n) t.push(255 & e.charCodeAt(n))
return t
})(t),
e,
n,
r
)
}
function w(e, t, n, r) {
return Z(K(t), e, n, r)
}
function M(e, t, n, r) {
return Z(
(function (e, t) {
for (var n, r, i, a = [], o = 0; o < e.length && !((t -= 2) < 0); ++o)
((r = (n = e.charCodeAt(o)) >> 8), (i = n % 256), a.push(i), a.push(r))
return a
})(t, e.length - n),
e,
n,
r
)
}
function E(e, n, r) {
return 0 === n && r === e.length
? t.fromByteArray(e)
: t.fromByteArray(e.slice(n, r))
}
function C(e, t, n) {
n = Math.min(e.length, n)
for (var r = [], i = t; i < n; ) {
var a = e[i],
o = null,
s = a > 239 ? 4 : a > 223 ? 3 : a > 191 ? 2 : 1
if (i + s <= n) {
var u = void 0,
l = void 0,
c = void 0,
h = void 0
switch (s) {
case 1:
a < 128 && (o = a)
break
case 2:
128 == (192 & (u = e[i + 1])) &&
(h = ((31 & a) << 6) | (63 & u)) > 127 &&
(o = h)
break
case 3:
;((u = e[i + 1]),
(l = e[i + 2]),
128 == (192 & u) &&
128 == (192 & l) &&
(h = ((15 & a) << 12) | ((63 & u) << 6) | (63 & l)) > 2047 &&
(h < 55296 || h > 57343) &&
(o = h))
break
case 4:
;((u = e[i + 1]),
(l = e[i + 2]),
(c = e[i + 3]),
128 == (192 & u) &&
128 == (192 & l) &&
128 == (192 & c) &&
(h =
((15 & a) << 18) |
((63 & u) << 12) |
((63 & l) << 6) |
(63 & c)) > 65535 &&
h < 1114112 &&
(o = h))
}
}
;(null === o
? ((o = 65533), (s = 1))
: o > 65535 &&
((o -= 65536),
r.push(((o >>> 10) & 1023) | 55296),
(o = 56320 | (1023 & o))),
r.push(o),
(i += s))
}
return (function (e) {
var t = e.length
if (t <= k) return String.fromCharCode.apply(String, e)
var n = '',
r = 0
for (; r < t; ) n += String.fromCharCode.apply(String, e.slice(r, (r += k)))
return n
})(r)
}
;((e.kMaxLength = i),
(o.TYPED_ARRAY_SUPPORT = (function () {
try {
var e = new Uint8Array(1),
t = {
foo: function () {
return 42
},
}
return (
Object.setPrototypeOf(t, Uint8Array.prototype),
Object.setPrototypeOf(e, t),
42 === e.foo()
)
} catch (ZJ) {
return !1
}
})()),
o.TYPED_ARRAY_SUPPORT ||
'undefined' == typeof console ||
'function' != typeof console.error ||
console.error(
'This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.'
),
Object.defineProperty(o.prototype, 'parent', {
enumerable: !0,
get: function () {
if (o.isBuffer(this)) return this.buffer
},
}),
Object.defineProperty(o.prototype, 'offset', {
enumerable: !0,
get: function () {
if (o.isBuffer(this)) return this.byteOffset
},
}),
(o.poolSize = 8192),
(o.from = function (e, t, n) {
return s(e, t, n)
}),
Object.setPrototypeOf(o.prototype, Uint8Array.prototype),
Object.setPrototypeOf(o, Uint8Array),
(o.alloc = function (e, t, n) {
return (function (e, t, n) {
return (
u(e),
e <= 0
? a(e)
: void 0 !== t
? 'string' == typeof n
? a(e).fill(t, n)
: a(e).fill(t)
: a(e)
)
})(e, t, n)
}),
(o.allocUnsafe = function (e) {
return l(e)
}),
(o.allocUnsafeSlow = function (e) {
return l(e)
}),
(o.isBuffer = function (e) {
return null != e && !0 === e._isBuffer && e !== o.prototype
}),
(o.compare = function (e, t) {
if (
(J(e, Uint8Array) && (e = o.from(e, e.offset, e.byteLength)),
J(t, Uint8Array) && (t = o.from(t, t.offset, t.byteLength)),
!o.isBuffer(e) || !o.isBuffer(t))
)
throw new TypeError(
'The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array'
)
if (e === t) return 0
for (var n = e.length, r = t.length, i = 0, a = Math.min(n, r); i < a; ++i)
if (e[i] !== t[i]) {
;((n = e[i]), (r = t[i]))
break
}
return n < r ? -1 : r < n ? 1 : 0
}),
(o.isEncoding = function (e) {
switch (String(e).toLowerCase()) {
case 'hex':
case 'utf8':
case 'utf-8':
case 'ascii':
case 'latin1':
case 'binary':
case 'base64':
case 'ucs2':
case 'ucs-2':
case 'utf16le':
case 'utf-16le':
return !0
default:
return !1
}
}),
(o.concat = function (e, t) {
if (!Array.isArray(e))
throw new TypeError('"list" argument must be an Array of Buffers')
if (0 === e.length) return o.alloc(0)
var n
if (void 0 === t) for (t = 0, n = 0; n < e.length; ++n) t += e[n].length
var r = o.allocUnsafe(t),
i = 0
for (n = 0; n < e.length; ++n) {
var a = e[n]
if (J(a, Uint8Array))
i + a.length > r.length
? (o.isBuffer(a) || (a = o.from(a)), a.copy(r, i))
: Uint8Array.prototype.set.call(r, a, i)
else {
if (!o.isBuffer(a))
throw new TypeError('"list" argument must be an Array of Buffers')
a.copy(r, i)
}
i += a.length
}
return r
}),
(o.byteLength = f),
(o.prototype._isBuffer = !0),
(o.prototype.swap16 = function () {
var e = this.length
if (e % 2 != 0)
throw new RangeError('Buffer size must be a multiple of 16-bits')
for (var t = 0; t < e; t += 2) v(this, t, t + 1)
return this
}),
(o.prototype.swap32 = function () {
var e = this.length
if (e % 4 != 0)
throw new RangeError('Buffer size must be a multiple of 32-bits')
for (var t = 0; t < e; t += 4) (v(this, t, t + 3), v(this, t + 1, t + 2))
return this
}),
(o.prototype.swap64 = function () {
var e = this.length
if (e % 8 != 0)
throw new RangeError('Buffer size must be a multiple of 64-bits')
for (var t = 0; t < e; t += 8)
(v(this, t, t + 7),
v(this, t + 1, t + 6),
v(this, t + 2, t + 5),
v(this, t + 3, t + 4))
return this
}),
(o.prototype.toString = function () {
var e = this.length
return 0 === e
? ''
: 0 === arguments.length
? C(this, 0, e)
: p.apply(this, arguments)
}),
(o.prototype.toLocaleString = o.prototype.toString),
(o.prototype.equals = function (e) {
if (!o.isBuffer(e)) throw new TypeError('Argument must be a Buffer')
return this === e || 0 === o.compare(this, e)
}),
(o.prototype.inspect = function () {
var t = '',
n = e.INSPECT_MAX_BYTES
return (
(t = this.toString('hex', 0, n)
.replace(/(.{2})/g, '$1 ')
.trim()),
this.length > n && (t += ' ... '),
''
)
}),
r && (o.prototype[r] = o.prototype.inspect),
(o.prototype.compare = function (e, t, n, r, i) {
if (
(J(e, Uint8Array) && (e = o.from(e, e.offset, e.byteLength)),
!o.isBuffer(e))
)
throw new TypeError(
'The "target" argument must be one of type Buffer or Uint8Array. Received type ' +
P(e)
)
if (
(void 0 === t && (t = 0),
void 0 === n && (n = e ? e.length : 0),
void 0 === r && (r = 0),
void 0 === i && (i = this.length),
t < 0 || n > e.length || r < 0 || i > this.length)
)
throw new RangeError('out of range index')
if (r >= i && t >= n) return 0
if (r >= i) return -1
if (t >= n) return 1
if (this === e) return 0
for (
var a = (i >>>= 0) - (r >>>= 0),
s = (n >>>= 0) - (t >>>= 0),
u = Math.min(a, s),
l = this.slice(r, i),
c = e.slice(t, n),
h = 0;
h < u;
++h
)
if (l[h] !== c[h]) {
;((a = l[h]), (s = c[h]))
break
}
return a < s ? -1 : s < a ? 1 : 0
}),
(o.prototype.includes = function (e, t, n) {
return -1 !== this.indexOf(e, t, n)
}),
(o.prototype.indexOf = function (e, t, n) {
return m(this, e, t, n, !0)
}),
(o.prototype.lastIndexOf = function (e, t, n) {
return m(this, e, t, n, !1)
}),
(o.prototype.write = function (e, t, n, r) {
if (void 0 === t) ((r = 'utf8'), (n = this.length), (t = 0))
else if (void 0 === n && 'string' == typeof t)
((r = t), (n = this.length), (t = 0))
else {
if (!isFinite(t))
throw new Error(
'Buffer.write(string, encoding, offset[, length]) is no longer supported'
)
;((t >>>= 0),
isFinite(n)
? ((n >>>= 0), void 0 === r && (r = 'utf8'))
: ((r = n), (n = void 0)))
}
var i = this.length - t
if (
((void 0 === n || n > i) && (n = i),
(e.length > 0 && (n < 0 || t < 0)) || t > this.length)
)
throw new RangeError('Attempt to write outside buffer bounds')
r || (r = 'utf8')
for (var a = !1; ; )
switch (r) {
case 'hex':
return _(this, e, t, n)
case 'utf8':
case 'utf-8':
return b(this, e, t, n)
case 'ascii':
case 'latin1':
case 'binary':
return S(this, e, t, n)
case 'base64':
return w(this, e, t, n)
case 'ucs2':
case 'ucs-2':
case 'utf16le':
case 'utf-16le':
return M(this, e, t, n)
default:
if (a) throw new TypeError('Unknown encoding: ' + r)
;((r = ('' + r).toLowerCase()), (a = !0))
}
}),
(o.prototype.toJSON = function () {
return {
type: 'Buffer',
data: Array.prototype.slice.call(this._arr || this, 0),
}
}))
var k = 4096
function R(e, t, n) {
var r = ''
n = Math.min(e.length, n)
for (var i = t; i < n; ++i) r += String.fromCharCode(127 & e[i])
return r
}
function I(e, t, n) {
var r = ''
n = Math.min(e.length, n)
for (var i = t; i < n; ++i) r += String.fromCharCode(e[i])
return r
}
function N(e, t, n) {
var r = e.length
;((!t || t < 0) && (t = 0), (!n || n < 0 || n > r) && (n = r))
for (var i = '', a = t; a < n; ++a) i += ee[e[a]]
return i
}
function L(e, t, n) {
for (var r = e.slice(t, n), i = '', a = 0; a < r.length - 1; a += 2)
i += String.fromCharCode(r[a] + 256 * r[a + 1])
return i
}
function D(e, t, n) {
if (e % 1 != 0 || e < 0) throw new RangeError('offset is not uint')
if (e + t > n) throw new RangeError('Trying to access beyond buffer length')
}
function O(e, t, n, r, i, a) {
if (!o.isBuffer(e))
throw new TypeError('"buffer" argument must be a Buffer instance')
if (t > i || t < a) throw new RangeError('"value" argument is out of bounds')
if (n + r > e.length) throw new RangeError('Index out of range')
}
function F(e, t, n, r, i) {
j(t, r, i, e, n, 7)
var a = Number(t & BigInt(4294967295))
;((e[n++] = a),
(a >>= 8),
(e[n++] = a),
(a >>= 8),
(e[n++] = a),
(a >>= 8),
(e[n++] = a))
var o = Number((t >> BigInt(32)) & BigInt(4294967295))
return (
(e[n++] = o),
(o >>= 8),
(e[n++] = o),
(o >>= 8),
(e[n++] = o),
(o >>= 8),
(e[n++] = o),
n
)
}
function B(e, t, n, r, i) {
j(t, r, i, e, n, 7)
var a = Number(t & BigInt(4294967295))
;((e[n + 7] = a),
(a >>= 8),
(e[n + 6] = a),
(a >>= 8),
(e[n + 5] = a),
(a >>= 8),
(e[n + 4] = a))
var o = Number((t >> BigInt(32)) & BigInt(4294967295))
return (
(e[n + 3] = o),
(o >>= 8),
(e[n + 2] = o),
(o >>= 8),
(e[n + 1] = o),
(o >>= 8),
(e[n] = o),
n + 8
)
}
function U(e, t, n, r, i, a) {
if (n + r > e.length) throw new RangeError('Index out of range')
if (n < 0) throw new RangeError('Index out of range')
}
function z(e, t, r, i, a) {
return (
(t = +t),
(r >>>= 0),
a || U(e, 0, r, 4),
n.write(e, t, r, i, 23, 4),
r + 4
)
}
function V(e, t, r, i, a) {
return (
(t = +t),
(r >>>= 0),
a || U(e, 0, r, 8),
n.write(e, t, r, i, 52, 8),
r + 8
)
}
;((o.prototype.slice = function (e, t) {
var n = this.length
;((e = ~~e) < 0 ? (e += n) < 0 && (e = 0) : e > n && (e = n),
(t = void 0 === t ? n : ~~t) < 0 ? (t += n) < 0 && (t = 0) : t > n && (t = n),
t < e && (t = e))
var r = this.subarray(e, t)
return (Object.setPrototypeOf(r, o.prototype), r)
}),
(o.prototype.readUintLE = o.prototype.readUIntLE =
function (e, t, n) {
;((e >>>= 0), (t >>>= 0), n || D(e, t, this.length))
for (var r = this[e], i = 1, a = 0; ++a < t && (i *= 256); )
r += this[e + a] * i
return r
}),
(o.prototype.readUintBE = o.prototype.readUIntBE =
function (e, t, n) {
;((e >>>= 0), (t >>>= 0), n || D(e, t, this.length))
for (var r = this[e + --t], i = 1; t > 0 && (i *= 256); )
r += this[e + --t] * i
return r
}),
(o.prototype.readUint8 = o.prototype.readUInt8 =
function (e, t) {
return ((e >>>= 0), t || D(e, 1, this.length), this[e])
}),
(o.prototype.readUint16LE = o.prototype.readUInt16LE =
function (e, t) {
return ((e >>>= 0), t || D(e, 2, this.length), this[e] | (this[e + 1] << 8))
}),
(o.prototype.readUint16BE = o.prototype.readUInt16BE =
function (e, t) {
return ((e >>>= 0), t || D(e, 2, this.length), (this[e] << 8) | this[e + 1])
}),
(o.prototype.readUint32LE = o.prototype.readUInt32LE =
function (e, t) {
return (
(e >>>= 0),
t || D(e, 4, this.length),
(this[e] | (this[e + 1] << 8) | (this[e + 2] << 16)) +
16777216 * this[e + 3]
)
}),
(o.prototype.readUint32BE = o.prototype.readUInt32BE =
function (e, t) {
return (
(e >>>= 0),
t || D(e, 4, this.length),
16777216 * this[e] +
((this[e + 1] << 16) | (this[e + 2] << 8) | this[e + 3])
)
}),
(o.prototype.readBigUInt64LE = te(function (e) {
Q((e >>>= 0), 'offset')
var t = this[e],
n = this[e + 7]
;(void 0 !== t && void 0 !== n) || q(e, this.length - 8)
var r =
t +
this[++e] * Math.pow(2, 8) +
this[++e] * Math.pow(2, 16) +
this[++e] * Math.pow(2, 24),
i =
this[++e] +
this[++e] * Math.pow(2, 8) +
this[++e] * Math.pow(2, 16) +
n * Math.pow(2, 24)
return BigInt(r) + (BigInt(i) << BigInt(32))
})),
(o.prototype.readBigUInt64BE = te(function (e) {
Q((e >>>= 0), 'offset')
var t = this[e],
n = this[e + 7]
;(void 0 !== t && void 0 !== n) || q(e, this.length - 8)
var r =
t * Math.pow(2, 24) +
this[++e] * Math.pow(2, 16) +
this[++e] * Math.pow(2, 8) +
this[++e],
i =
this[++e] * Math.pow(2, 24) +
this[++e] * Math.pow(2, 16) +
this[++e] * Math.pow(2, 8) +
n
return (BigInt(r) << BigInt(32)) + BigInt(i)
})),
(o.prototype.readIntLE = function (e, t, n) {
;((e >>>= 0), (t >>>= 0), n || D(e, t, this.length))
for (var r = this[e], i = 1, a = 0; ++a < t && (i *= 256); )
r += this[e + a] * i
return (r >= (i *= 128) && (r -= Math.pow(2, 8 * t)), r)
}),
(o.prototype.readIntBE = function (e, t, n) {
;((e >>>= 0), (t >>>= 0), n || D(e, t, this.length))
for (var r = t, i = 1, a = this[e + --r]; r > 0 && (i *= 256); )
a += this[e + --r] * i
return (a >= (i *= 128) && (a -= Math.pow(2, 8 * t)), a)
}),
(o.prototype.readInt8 = function (e, t) {
return (
(e >>>= 0),
t || D(e, 1, this.length),
128 & this[e] ? -1 * (255 - this[e] + 1) : this[e]
)
}),
(o.prototype.readInt16LE = function (e, t) {
;((e >>>= 0), t || D(e, 2, this.length))
var n = this[e] | (this[e + 1] << 8)
return 32768 & n ? 4294901760 | n : n
}),
(o.prototype.readInt16BE = function (e, t) {
;((e >>>= 0), t || D(e, 2, this.length))
var n = this[e + 1] | (this[e] << 8)
return 32768 & n ? 4294901760 | n : n
}),
(o.prototype.readInt32LE = function (e, t) {
return (
(e >>>= 0),
t || D(e, 4, this.length),
this[e] | (this[e + 1] << 8) | (this[e + 2] << 16) | (this[e + 3] << 24)
)
}),
(o.prototype.readInt32BE = function (e, t) {
return (
(e >>>= 0),
t || D(e, 4, this.length),
(this[e] << 24) | (this[e + 1] << 16) | (this[e + 2] << 8) | this[e + 3]
)
}),
(o.prototype.readBigInt64LE = te(function (e) {
Q((e >>>= 0), 'offset')
var t = this[e],
n = this[e + 7]
;(void 0 !== t && void 0 !== n) || q(e, this.length - 8)
var r =
this[e + 4] +
this[e + 5] * Math.pow(2, 8) +
this[e + 6] * Math.pow(2, 16) +
(n << 24)
return (
(BigInt(r) << BigInt(32)) +
BigInt(
t +
this[++e] * Math.pow(2, 8) +
this[++e] * Math.pow(2, 16) +
this[++e] * Math.pow(2, 24)
)
)
})),
(o.prototype.readBigInt64BE = te(function (e) {
Q((e >>>= 0), 'offset')
var t = this[e],
n = this[e + 7]
;(void 0 !== t && void 0 !== n) || q(e, this.length - 8)
var r =
(t << 24) +
this[++e] * Math.pow(2, 16) +
this[++e] * Math.pow(2, 8) +
this[++e]
return (
(BigInt(r) << BigInt(32)) +
BigInt(
this[++e] * Math.pow(2, 24) +
this[++e] * Math.pow(2, 16) +
this[++e] * Math.pow(2, 8) +
n
)
)
})),
(o.prototype.readFloatLE = function (e, t) {
return ((e >>>= 0), t || D(e, 4, this.length), n.read(this, e, !0, 23, 4))
}),
(o.prototype.readFloatBE = function (e, t) {
return ((e >>>= 0), t || D(e, 4, this.length), n.read(this, e, !1, 23, 4))
}),
(o.prototype.readDoubleLE = function (e, t) {
return ((e >>>= 0), t || D(e, 8, this.length), n.read(this, e, !0, 52, 8))
}),
(o.prototype.readDoubleBE = function (e, t) {
return ((e >>>= 0), t || D(e, 8, this.length), n.read(this, e, !1, 52, 8))
}),
(o.prototype.writeUintLE = o.prototype.writeUIntLE =
function (e, t, n, r) {
;((e = +e), (t >>>= 0), (n >>>= 0), r) ||
O(this, e, t, n, Math.pow(2, 8 * n) - 1, 0)
var i = 1,
a = 0
for (this[t] = 255 & e; ++a < n && (i *= 256); ) this[t + a] = (e / i) & 255
return t + n
}),
(o.prototype.writeUintBE = o.prototype.writeUIntBE =
function (e, t, n, r) {
;((e = +e), (t >>>= 0), (n >>>= 0), r) ||
O(this, e, t, n, Math.pow(2, 8 * n) - 1, 0)
var i = n - 1,
a = 1
for (this[t + i] = 255 & e; --i >= 0 && (a *= 256); )
this[t + i] = (e / a) & 255
return t + n
}),
(o.prototype.writeUint8 = o.prototype.writeUInt8 =
function (e, t, n) {
return (
(e = +e),
(t >>>= 0),
n || O(this, e, t, 1, 255, 0),
(this[t] = 255 & e),
t + 1
)
}),
(o.prototype.writeUint16LE = o.prototype.writeUInt16LE =
function (e, t, n) {
return (
(e = +e),
(t >>>= 0),
n || O(this, e, t, 2, 65535, 0),
(this[t] = 255 & e),
(this[t + 1] = e >>> 8),
t + 2
)
}),
(o.prototype.writeUint16BE = o.prototype.writeUInt16BE =
function (e, t, n) {
return (
(e = +e),
(t >>>= 0),
n || O(this, e, t, 2, 65535, 0),
(this[t] = e >>> 8),
(this[t + 1] = 255 & e),
t + 2
)
}),
(o.prototype.writeUint32LE = o.prototype.writeUInt32LE =
function (e, t, n) {
return (
(e = +e),
(t >>>= 0),
n || O(this, e, t, 4, 4294967295, 0),
(this[t + 3] = e >>> 24),
(this[t + 2] = e >>> 16),
(this[t + 1] = e >>> 8),
(this[t] = 255 & e),
t + 4
)
}),
(o.prototype.writeUint32BE = o.prototype.writeUInt32BE =
function (e, t, n) {
return (
(e = +e),
(t >>>= 0),
n || O(this, e, t, 4, 4294967295, 0),
(this[t] = e >>> 24),
(this[t + 1] = e >>> 16),
(this[t + 2] = e >>> 8),
(this[t + 3] = 255 & e),
t + 4
)
}),
(o.prototype.writeBigUInt64LE = te(function (e) {
return F(
this,
e,
arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : 0,
BigInt(0),
BigInt('0xffffffffffffffff')
)
})),
(o.prototype.writeBigUInt64BE = te(function (e) {
return B(
this,
e,
arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : 0,
BigInt(0),
BigInt('0xffffffffffffffff')
)
})),
(o.prototype.writeIntLE = function (e, t, n, r) {
if (((e = +e), (t >>>= 0), !r)) {
var i = Math.pow(2, 8 * n - 1)
O(this, e, t, n, i - 1, -i)
}
var a = 0,
o = 1,
s = 0
for (this[t] = 255 & e; ++a < n && (o *= 256); )
(e < 0 && 0 === s && 0 !== this[t + a - 1] && (s = 1),
(this[t + a] = (((e / o) | 0) - s) & 255))
return t + n
}),
(o.prototype.writeIntBE = function (e, t, n, r) {
if (((e = +e), (t >>>= 0), !r)) {
var i = Math.pow(2, 8 * n - 1)
O(this, e, t, n, i - 1, -i)
}
var a = n - 1,
o = 1,
s = 0
for (this[t + a] = 255 & e; --a >= 0 && (o *= 256); )
(e < 0 && 0 === s && 0 !== this[t + a + 1] && (s = 1),
(this[t + a] = (((e / o) | 0) - s) & 255))
return t + n
}),
(o.prototype.writeInt8 = function (e, t, n) {
return (
(e = +e),
(t >>>= 0),
n || O(this, e, t, 1, 127, -128),
e < 0 && (e = 255 + e + 1),
(this[t] = 255 & e),
t + 1
)
}),
(o.prototype.writeInt16LE = function (e, t, n) {
return (
(e = +e),
(t >>>= 0),
n || O(this, e, t, 2, 32767, -32768),
(this[t] = 255 & e),
(this[t + 1] = e >>> 8),
t + 2
)
}),
(o.prototype.writeInt16BE = function (e, t, n) {
return (
(e = +e),
(t >>>= 0),
n || O(this, e, t, 2, 32767, -32768),
(this[t] = e >>> 8),
(this[t + 1] = 255 & e),
t + 2
)
}),
(o.prototype.writeInt32LE = function (e, t, n) {
return (
(e = +e),
(t >>>= 0),
n || O(this, e, t, 4, 2147483647, -2147483648),
(this[t] = 255 & e),
(this[t + 1] = e >>> 8),
(this[t + 2] = e >>> 16),
(this[t + 3] = e >>> 24),
t + 4
)
}),
(o.prototype.writeInt32BE = function (e, t, n) {
return (
(e = +e),
(t >>>= 0),
n || O(this, e, t, 4, 2147483647, -2147483648),
e < 0 && (e = 4294967295 + e + 1),
(this[t] = e >>> 24),
(this[t + 1] = e >>> 16),
(this[t + 2] = e >>> 8),
(this[t + 3] = 255 & e),
t + 4
)
}),
(o.prototype.writeBigInt64LE = te(function (e) {
return F(
this,
e,
arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : 0,
-BigInt('0x8000000000000000'),
BigInt('0x7fffffffffffffff')
)
})),
(o.prototype.writeBigInt64BE = te(function (e) {
return B(
this,
e,
arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : 0,
-BigInt('0x8000000000000000'),
BigInt('0x7fffffffffffffff')
)
})),
(o.prototype.writeFloatLE = function (e, t, n) {
return z(this, e, t, !0, n)
}),
(o.prototype.writeFloatBE = function (e, t, n) {
return z(this, e, t, !1, n)
}),
(o.prototype.writeDoubleLE = function (e, t, n) {
return V(this, e, t, !0, n)
}),
(o.prototype.writeDoubleBE = function (e, t, n) {
return V(this, e, t, !1, n)
}),
(o.prototype.copy = function (e, t, n, r) {
if (!o.isBuffer(e)) throw new TypeError('argument should be a Buffer')
if (
(n || (n = 0),
r || 0 === r || (r = this.length),
t >= e.length && (t = e.length),
t || (t = 0),
r > 0 && r < n && (r = n),
r === n)
)
return 0
if (0 === e.length || 0 === this.length) return 0
if (t < 0) throw new RangeError('targetStart out of bounds')
if (n < 0 || n >= this.length) throw new RangeError('Index out of range')
if (r < 0) throw new RangeError('sourceEnd out of bounds')
;(r > this.length && (r = this.length),
e.length - t < r - n && (r = e.length - t + n))
var i = r - n
return (
this === e && 'function' == typeof Uint8Array.prototype.copyWithin
? this.copyWithin(t, n, r)
: Uint8Array.prototype.set.call(e, this.subarray(n, r), t),
i
)
}),
(o.prototype.fill = function (e, t, n, r) {
if ('string' == typeof e) {
if (
('string' == typeof t
? ((r = t), (t = 0), (n = this.length))
: 'string' == typeof n && ((r = n), (n = this.length)),
void 0 !== r && 'string' != typeof r)
)
throw new TypeError('encoding must be a string')
if ('string' == typeof r && !o.isEncoding(r))
throw new TypeError('Unknown encoding: ' + r)
if (1 === e.length) {
var i = e.charCodeAt(0)
;(('utf8' === r && i < 128) || 'latin1' === r) && (e = i)
}
} else
'number' == typeof e ? (e &= 255) : 'boolean' == typeof e && (e = Number(e))
if (t < 0 || this.length < t || this.length < n)
throw new RangeError('Out of range index')
if (n <= t) return this
var a
if (
((t >>>= 0),
(n = void 0 === n ? this.length : n >>> 0),
e || (e = 0),
'number' == typeof e)
)
for (a = t; a < n; ++a) this[a] = e
else {
var s = o.isBuffer(e) ? e : o.from(e, r),
u = s.length
if (0 === u)
throw new TypeError(
'The value "' + e + '" is invalid for argument "value"'
)
for (a = 0; a < n - t; ++a) this[a + t] = s[a % u]
}
return this
}))
var H = {}
function W(e, t, n) {
H[e] = (function (n) {
function r() {
var n
return (
A(this, r),
(n = y(this, r)),
Object.defineProperty(n, 'message', {
value: t.apply(n, arguments),
writable: !0,
configurable: !0,
}),
(n.name = ''.concat(n.name, ' [').concat(e, ']')),
n.stack,
delete n.name,
n
)
}
return (
x(r, n),
T(r, [
{
key: 'code',
get: function () {
return e
},
set: function (e) {
Object.defineProperty(this, 'code', {
configurable: !0,
enumerable: !0,
value: e,
writable: !0,
})
},
},
{
key: 'toString',
value: function () {
return ''
.concat(this.name, ' [')
.concat(e, ']: ')
.concat(this.message)
},
},
])
)
})(n)
}
function G(e) {
for (var t = '', n = e.length, r = '-' === e[0] ? 1 : 0; n >= r + 4; n -= 3)
t = '_'.concat(e.slice(n - 3, n)).concat(t)
return ''.concat(e.slice(0, n)).concat(t)
}
function j(e, t, n, r, i, a) {
if (e > n || e < t) {
var o,
s = 'bigint' == typeof t ? 'n' : ''
throw (
(o =
0 === t || t === BigInt(0)
? '>= 0'
.concat(s, ' and < 2')
.concat(s, ' ** ')
.concat(8 * (a + 1))
.concat(s)
: '>= -(2'
.concat(s, ' ** ')
.concat(8 * (a + 1) - 1)
.concat(s, ') and < 2 ** ') + ''.concat(8 * (a + 1) - 1).concat(s)),
new H.ERR_OUT_OF_RANGE('value', o, e)
)
}
!(function (e, t, n) {
;(Q(t, 'offset'),
(void 0 !== e[t] && void 0 !== e[t + n]) || q(t, e.length - (n + 1)))
})(r, i, a)
}
function Q(e, t) {
if ('number' != typeof e) throw new H.ERR_INVALID_ARG_TYPE(t, 'number', e)
}
function q(e, t, n) {
if (Math.floor(e) !== e)
throw (Q(e, n), new H.ERR_OUT_OF_RANGE('offset', 'an integer', e))
if (t < 0) throw new H.ERR_BUFFER_OUT_OF_BOUNDS()
throw new H.ERR_OUT_OF_RANGE('offset', '>= '.concat(0, ' and <= ', t), e)
}
;(W(
'ERR_BUFFER_OUT_OF_BOUNDS',
function (e) {
return e
? ''.concat(e, ' is outside of buffer bounds')
: 'Attempt to access memory outside buffer bounds'
},
RangeError
),
W(
'ERR_INVALID_ARG_TYPE',
function (e, t) {
return 'The "'
.concat(e, '" argument must be of type number. Received type ')
.concat(P(t))
},
TypeError
),
W(
'ERR_OUT_OF_RANGE',
function (e, t, n) {
var r = 'The value of "'.concat(e, '" is out of range.'),
i = n
return (
Number.isInteger(n) && Math.abs(n) > Math.pow(2, 32)
? (i = G(String(n)))
: 'bigint' == typeof n &&
((i = String(n)),
(n > Math.pow(BigInt(2), BigInt(32)) ||
n < -Math.pow(BigInt(2), BigInt(32))) &&
(i = G(i)),
(i += 'n')),
(r += ' It must be '.concat(t, '. Received ').concat(i))
)
},
RangeError
))
var X = /[^+/0-9A-Za-z-_]/g
function Y(e, t) {
var n
t = t || 1 / 0
for (var r = e.length, i = null, a = [], o = 0; o < r; ++o) {
if ((n = e.charCodeAt(o)) > 55295 && n < 57344) {
if (!i) {
if (n > 56319) {
;(t -= 3) > -1 && a.push(239, 191, 189)
continue
}
if (o + 1 === r) {
;(t -= 3) > -1 && a.push(239, 191, 189)
continue
}
i = n
continue
}
if (n < 56320) {
;((t -= 3) > -1 && a.push(239, 191, 189), (i = n))
continue
}
n = 65536 + (((i - 55296) << 10) | (n - 56320))
} else i && (t -= 3) > -1 && a.push(239, 191, 189)
if (((i = null), n < 128)) {
if ((t -= 1) < 0) break
a.push(n)
} else if (n < 2048) {
if ((t -= 2) < 0) break
a.push((n >> 6) | 192, (63 & n) | 128)
} else if (n < 65536) {
if ((t -= 3) < 0) break
a.push((n >> 12) | 224, ((n >> 6) & 63) | 128, (63 & n) | 128)
} else {
if (!(n < 1114112)) throw new Error('Invalid code point')
if ((t -= 4) < 0) break
a.push(
(n >> 18) | 240,
((n >> 12) & 63) | 128,
((n >> 6) & 63) | 128,
(63 & n) | 128
)
}
}
return a
}
function K(e) {
return t.toByteArray(
(function (e) {
if ((e = (e = e.split('=')[0]).trim().replace(X, '')).length < 2) return ''
for (; e.length % 4 != 0; ) e += '='
return e
})(e)
)
}
function Z(e, t, n, r) {
var i
for (i = 0; i < r && !(i + n >= t.length || i >= e.length); ++i) t[i + n] = e[i]
return i
}
function J(e, t) {
return (
e instanceof t ||
(null != e &&
null != e.constructor &&
null != e.constructor.name &&
e.constructor.name === t.name)
)
}
function $(e) {
return e != e
}
var ee = (function () {
for (var e = '0123456789abcdef', t = new Array(256), n = 0; n < 16; ++n)
for (var r = 16 * n, i = 0; i < 16; ++i) t[r + i] = e[n] + e[i]
return t
})()
function te(e) {
return 'undefined' == typeof BigInt ? ne : e
}
function ne() {
throw new Error('BigInt not supported')
}
})(au)),
au
)
}
var lu,
cu,
hu,
du,
fu,
pu,
vu,
mu,
gu = uu()
function yu() {
if (pu) return fu
pu = 1
var e = (function () {
if (du) return hu
;((du = 1), (hu = t))
var e = null
try {
e = new WebAssembly.Instance(
new WebAssembly.Module(
new Uint8Array([
0, 97, 115, 109, 1, 0, 0, 0, 1, 13, 2, 96, 0, 1, 127, 96, 4, 127, 127, 127,
127, 1, 127, 3, 7, 6, 0, 1, 1, 1, 1, 1, 6, 6, 1, 127, 1, 65, 0, 11, 7, 50,
6, 3, 109, 117, 108, 0, 1, 5, 100, 105, 118, 95, 115, 0, 2, 5, 100, 105,
118, 95, 117, 0, 3, 5, 114, 101, 109, 95, 115, 0, 4, 5, 114, 101, 109, 95,
117, 0, 5, 8, 103, 101, 116, 95, 104, 105, 103, 104, 0, 0, 10, 191, 1, 6, 4,
0, 35, 0, 11, 36, 1, 1, 126, 32, 0, 173, 32, 1, 173, 66, 32, 134, 132, 32,
2, 173, 32, 3, 173, 66, 32, 134, 132, 126, 34, 4, 66, 32, 135, 167, 36, 0,
32, 4, 167, 11, 36, 1, 1, 126, 32, 0, 173, 32, 1, 173, 66, 32, 134, 132, 32,
2, 173, 32, 3, 173, 66, 32, 134, 132, 127, 34, 4, 66, 32, 135, 167, 36, 0,
32, 4, 167, 11, 36, 1, 1, 126, 32, 0, 173, 32, 1, 173, 66, 32, 134, 132, 32,
2, 173, 32, 3, 173, 66, 32, 134, 132, 128, 34, 4, 66, 32, 135, 167, 36, 0,
32, 4, 167, 11, 36, 1, 1, 126, 32, 0, 173, 32, 1, 173, 66, 32, 134, 132, 32,
2, 173, 32, 3, 173, 66, 32, 134, 132, 129, 34, 4, 66, 32, 135, 167, 36, 0,
32, 4, 167, 11, 36, 1, 1, 126, 32, 0, 173, 32, 1, 173, 66, 32, 134, 132, 32,
2, 173, 32, 3, 173, 66, 32, 134, 132, 130, 34, 4, 66, 32, 135, 167, 36, 0,
32, 4, 167, 11,
])
),
{}
).exports
} catch (ZJ) {}
function t(e, t, n) {
;((this.low = 0 | e), (this.high = 0 | t), (this.unsigned = !!n))
}
function n(e) {
return !0 === (e && e.__isLong__)
}
;(t.prototype.__isLong__,
Object.defineProperty(t.prototype, '__isLong__', { value: !0 }),
(t.isLong = n))
var r = {},
i = {}
function a(e, t) {
var n, a, o
return t
? (o = 0 <= (e >>>= 0) && e < 256) && (a = i[e])
? a
: ((n = s(e, (0 | e) < 0 ? -1 : 0, !0)), o && (i[e] = n), n)
: (o = -128 <= (e |= 0) && e < 128) && (a = r[e])
? a
: ((n = s(e, e < 0 ? -1 : 0, !1)), o && (r[e] = n), n)
}
function o(e, t) {
if (isNaN(e)) return t ? m : v
if (t) {
if (e < 0) return m
if (e >= d) return x
} else {
if (e <= -f) return S
if (e + 1 >= f) return b
}
return e < 0 ? o(-e, t).neg() : s(e % h | 0, (e / h) | 0, t)
}
function s(e, n, r) {
return new t(e, n, r)
}
;((t.fromInt = a), (t.fromNumber = o), (t.fromBits = s))
var u = Math.pow
function l(e, t, n) {
if (0 === e.length) throw Error('empty string')
if ('NaN' === e || 'Infinity' === e || '+Infinity' === e || '-Infinity' === e)
return v
if (
('number' == typeof t ? ((n = t), (t = !1)) : (t = !!t),
(n = n || 10) < 2 || 36 < n)
)
throw RangeError('radix')
var r
if ((r = e.indexOf('-')) > 0) throw Error('interior hyphen')
if (0 === r) return l(e.substring(1), t, n).neg()
for (var i = o(u(n, 8)), a = v, s = 0; s < e.length; s += 8) {
var c = Math.min(8, e.length - s),
h = parseInt(e.substring(s, s + c), n)
if (c < 8) {
var d = o(u(n, c))
a = a.mul(d).add(o(h))
} else a = (a = a.mul(i)).add(o(h))
}
return ((a.unsigned = t), a)
}
function c(e, t) {
return 'number' == typeof e
? o(e, t)
: 'string' == typeof e
? l(e, t)
: s(e.low, e.high, 'boolean' == typeof t ? t : e.unsigned)
}
;((t.fromString = l), (t.fromValue = c))
var h = 4294967296,
d = h * h,
f = d / 2,
p = a(1 << 24),
v = a(0)
t.ZERO = v
var m = a(0, !0)
t.UZERO = m
var g = a(1)
t.ONE = g
var y = a(1, !0)
t.UONE = y
var _ = a(-1)
t.NEG_ONE = _
var b = s(-1, 2147483647, !1)
t.MAX_VALUE = b
var x = s(-1, -1, !0)
t.MAX_UNSIGNED_VALUE = x
var S = s(0, -2147483648, !1)
t.MIN_VALUE = S
var A = t.prototype
return (
(A.toInt = function () {
return this.unsigned ? this.low >>> 0 : this.low
}),
(A.toNumber = function () {
return this.unsigned
? (this.high >>> 0) * h + (this.low >>> 0)
: this.high * h + (this.low >>> 0)
}),
(A.toString = function (e) {
if ((e = e || 10) < 2 || 36 < e) throw RangeError('radix')
if (this.isZero()) return '0'
if (this.isNegative()) {
if (this.eq(S)) {
var t = o(e),
n = this.div(t),
r = n.mul(t).sub(this)
return n.toString(e) + r.toInt().toString(e)
}
return '-' + this.neg().toString(e)
}
for (var i = o(u(e, 6), this.unsigned), a = this, s = ''; ; ) {
var l = a.div(i),
c = (a.sub(l.mul(i)).toInt() >>> 0).toString(e)
if ((a = l).isZero()) return c + s
for (; c.length < 6; ) c = '0' + c
s = '' + c + s
}
}),
(A.getHighBits = function () {
return this.high
}),
(A.getHighBitsUnsigned = function () {
return this.high >>> 0
}),
(A.getLowBits = function () {
return this.low
}),
(A.getLowBitsUnsigned = function () {
return this.low >>> 0
}),
(A.getNumBitsAbs = function () {
if (this.isNegative()) return this.eq(S) ? 64 : this.neg().getNumBitsAbs()
for (
var e = 0 != this.high ? this.high : this.low, t = 31;
t > 0 && !(e & (1 << t));
t--
);
return 0 != this.high ? t + 33 : t + 1
}),
(A.isZero = function () {
return 0 === this.high && 0 === this.low
}),
(A.eqz = A.isZero),
(A.isNegative = function () {
return !this.unsigned && this.high < 0
}),
(A.isPositive = function () {
return this.unsigned || this.high >= 0
}),
(A.isOdd = function () {
return !(1 & ~this.low)
}),
(A.isEven = function () {
return !(1 & this.low)
}),
(A.equals = function (e) {
return (
n(e) || (e = c(e)),
(this.unsigned === e.unsigned ||
this.high >>> 31 != 1 ||
e.high >>> 31 != 1) &&
this.high === e.high &&
this.low === e.low
)
}),
(A.eq = A.equals),
(A.notEquals = function (e) {
return !this.eq(e)
}),
(A.neq = A.notEquals),
(A.ne = A.notEquals),
(A.lessThan = function (e) {
return this.comp(e) < 0
}),
(A.lt = A.lessThan),
(A.lessThanOrEqual = function (e) {
return this.comp(e) <= 0
}),
(A.lte = A.lessThanOrEqual),
(A.le = A.lessThanOrEqual),
(A.greaterThan = function (e) {
return this.comp(e) > 0
}),
(A.gt = A.greaterThan),
(A.greaterThanOrEqual = function (e) {
return this.comp(e) >= 0
}),
(A.gte = A.greaterThanOrEqual),
(A.ge = A.greaterThanOrEqual),
(A.compare = function (e) {
if ((n(e) || (e = c(e)), this.eq(e))) return 0
var t = this.isNegative(),
r = e.isNegative()
return t && !r
? -1
: !t && r
? 1
: this.unsigned
? e.high >>> 0 > this.high >>> 0 ||
(e.high === this.high && e.low >>> 0 > this.low >>> 0)
? -1
: 1
: this.sub(e).isNegative()
? -1
: 1
}),
(A.comp = A.compare),
(A.negate = function () {
return !this.unsigned && this.eq(S) ? S : this.not().add(g)
}),
(A.neg = A.negate),
(A.add = function (e) {
n(e) || (e = c(e))
var t = this.high >>> 16,
r = 65535 & this.high,
i = this.low >>> 16,
a = 65535 & this.low,
o = e.high >>> 16,
u = 65535 & e.high,
l = e.low >>> 16,
h = 0,
d = 0,
f = 0,
p = 0
return (
(f += (p += a + (65535 & e.low)) >>> 16),
(d += (f += i + l) >>> 16),
(h += (d += r + u) >>> 16),
(h += t + o),
s(
((f &= 65535) << 16) | (p &= 65535),
((h &= 65535) << 16) | (d &= 65535),
this.unsigned
)
)
}),
(A.subtract = function (e) {
return (n(e) || (e = c(e)), this.add(e.neg()))
}),
(A.sub = A.subtract),
(A.multiply = function (t) {
if (this.isZero()) return v
if ((n(t) || (t = c(t)), e))
return s(
e.mul(this.low, this.high, t.low, t.high),
e.get_high(),
this.unsigned
)
if (t.isZero()) return v
if (this.eq(S)) return t.isOdd() ? S : v
if (t.eq(S)) return this.isOdd() ? S : v
if (this.isNegative())
return t.isNegative() ? this.neg().mul(t.neg()) : this.neg().mul(t).neg()
if (t.isNegative()) return this.mul(t.neg()).neg()
if (this.lt(p) && t.lt(p))
return o(this.toNumber() * t.toNumber(), this.unsigned)
var r = this.high >>> 16,
i = 65535 & this.high,
a = this.low >>> 16,
u = 65535 & this.low,
l = t.high >>> 16,
h = 65535 & t.high,
d = t.low >>> 16,
f = 65535 & t.low,
m = 0,
g = 0,
y = 0,
_ = 0
return (
(y += (_ += u * f) >>> 16),
(g += (y += a * f) >>> 16),
(y &= 65535),
(g += (y += u * d) >>> 16),
(m += (g += i * f) >>> 16),
(g &= 65535),
(m += (g += a * d) >>> 16),
(g &= 65535),
(m += (g += u * h) >>> 16),
(m += r * f + i * d + a * h + u * l),
s(
((y &= 65535) << 16) | (_ &= 65535),
((m &= 65535) << 16) | (g &= 65535),
this.unsigned
)
)
}),
(A.mul = A.multiply),
(A.divide = function (t) {
if ((n(t) || (t = c(t)), t.isZero())) throw Error('division by zero')
var r, i, a
if (e)
return this.unsigned ||
-2147483648 !== this.high ||
-1 !== t.low ||
-1 !== t.high
? s(
(this.unsigned ? e.div_u : e.div_s)(this.low, this.high, t.low, t.high),
e.get_high(),
this.unsigned
)
: this
if (this.isZero()) return this.unsigned ? m : v
if (this.unsigned) {
if ((t.unsigned || (t = t.toUnsigned()), t.gt(this))) return m
if (t.gt(this.shru(1))) return y
a = m
} else {
if (this.eq(S))
return t.eq(g) || t.eq(_)
? S
: t.eq(S)
? g
: (r = this.shr(1).div(t).shl(1)).eq(v)
? t.isNegative()
? g
: _
: ((i = this.sub(t.mul(r))), (a = r.add(i.div(t))))
if (t.eq(S)) return this.unsigned ? m : v
if (this.isNegative())
return t.isNegative() ? this.neg().div(t.neg()) : this.neg().div(t).neg()
if (t.isNegative()) return this.div(t.neg()).neg()
a = v
}
for (i = this; i.gte(t); ) {
r = Math.max(1, Math.floor(i.toNumber() / t.toNumber()))
for (
var l = Math.ceil(Math.log(r) / Math.LN2),
h = l <= 48 ? 1 : u(2, l - 48),
d = o(r),
f = d.mul(t);
f.isNegative() || f.gt(i);
)
f = (d = o((r -= h), this.unsigned)).mul(t)
;(d.isZero() && (d = g), (a = a.add(d)), (i = i.sub(f)))
}
return a
}),
(A.div = A.divide),
(A.modulo = function (t) {
return (
n(t) || (t = c(t)),
e
? s(
(this.unsigned ? e.rem_u : e.rem_s)(this.low, this.high, t.low, t.high),
e.get_high(),
this.unsigned
)
: this.sub(this.div(t).mul(t))
)
}),
(A.mod = A.modulo),
(A.rem = A.modulo),
(A.not = function () {
return s(~this.low, ~this.high, this.unsigned)
}),
(A.and = function (e) {
return (
n(e) || (e = c(e)),
s(this.low & e.low, this.high & e.high, this.unsigned)
)
}),
(A.or = function (e) {
return (
n(e) || (e = c(e)),
s(this.low | e.low, this.high | e.high, this.unsigned)
)
}),
(A.xor = function (e) {
return (
n(e) || (e = c(e)),
s(this.low ^ e.low, this.high ^ e.high, this.unsigned)
)
}),
(A.shiftLeft = function (e) {
return (
n(e) && (e = e.toInt()),
0 == (e &= 63)
? this
: e < 32
? s(
this.low << e,
(this.high << e) | (this.low >>> (32 - e)),
this.unsigned
)
: s(0, this.low << (e - 32), this.unsigned)
)
}),
(A.shl = A.shiftLeft),
(A.shiftRight = function (e) {
return (
n(e) && (e = e.toInt()),
0 == (e &= 63)
? this
: e < 32
? s(
(this.low >>> e) | (this.high << (32 - e)),
this.high >> e,
this.unsigned
)
: s(this.high >> (e - 32), this.high >= 0 ? 0 : -1, this.unsigned)
)
}),
(A.shr = A.shiftRight),
(A.shiftRightUnsigned = function (e) {
if ((n(e) && (e = e.toInt()), 0 == (e &= 63))) return this
var t = this.high
return e < 32
? s((this.low >>> e) | (t << (32 - e)), t >>> e, this.unsigned)
: s(32 === e ? t : t >>> (e - 32), 0, this.unsigned)
}),
(A.shru = A.shiftRightUnsigned),
(A.shr_u = A.shiftRightUnsigned),
(A.toSigned = function () {
return this.unsigned ? s(this.low, this.high, !1) : this
}),
(A.toUnsigned = function () {
return this.unsigned ? this : s(this.low, this.high, !0)
}),
(A.toBytes = function (e) {
return e ? this.toBytesLE() : this.toBytesBE()
}),
(A.toBytesLE = function () {
var e = this.high,
t = this.low
return [
255 & t,
(t >>> 8) & 255,
(t >>> 16) & 255,
t >>> 24,
255 & e,
(e >>> 8) & 255,
(e >>> 16) & 255,
e >>> 24,
]
}),
(A.toBytesBE = function () {
var e = this.high,
t = this.low
return [
e >>> 24,
(e >>> 16) & 255,
(e >>> 8) & 255,
255 & e,
t >>> 24,
(t >>> 16) & 255,
(t >>> 8) & 255,
255 & t,
]
}),
(t.fromBytes = function (e, n, r) {
return r ? t.fromBytesLE(e, n) : t.fromBytesBE(e, n)
}),
(t.fromBytesLE = function (e, n) {
return new t(
e[0] | (e[1] << 8) | (e[2] << 16) | (e[3] << 24),
e[4] | (e[5] << 8) | (e[6] << 16) | (e[7] << 24),
n
)
}),
(t.fromBytesBE = function (e, n) {
return new t(
(e[4] << 24) | (e[5] << 16) | (e[6] << 8) | e[7],
(e[0] << 24) | (e[1] << 16) | (e[2] << 8) | e[3],
n
)
}),
hu
)
})(),
t = function (t, n, r) {
;(t instanceof e ||
(t = 'number' == typeof t ? e.fromNumber(t) : e.fromString(t || '')),
n.writeInt32LE(t.getLowBits(), r, !0),
n.writeInt32LE(t.getHighBits(), r + 4, !0))
},
n = function (t, n, r) {
;(t instanceof e ||
(t = 'number' == typeof t ? e.fromNumber(t) : e.fromString(t || '')),
n.writeInt32BE(t.getHighBits(), r, !0),
n.writeInt32BE(t.getLowBits(), r + 4, !0))
}
return (fu = {
unpackUInt64LE: function (t, n) {
return e.fromBits(t.readInt32LE(n), t.readInt32LE(n + 4), !0)
},
unpackUInt64BE: function (t, n) {
return e.fromBits(t.readInt32BE(n + 4), t.readInt32BE(n), !0)
},
unpackInt64LE: function (t, n) {
return e.fromBits(t.readInt32LE(n), t.readInt32LE(n + 4), !1)
},
unpackInt64BE: function (t, n) {
return e.fromBits(t.readInt32BE(n + 4), t.readInt32BE(n), !1)
},
packUInt64LE: t,
packUInt64BE: n,
packInt64LE: t,
packInt64BE: n,
})
}
var _u =
(mu ||
((mu = 1),
(vu = (function () {
if (cu) return lu
cu = 1
var e = function (e, t, n) {
var r = e.indexOf(0, t),
i = Math.min(t + n, -1 === r ? e.length : r)
return e.slice(t, i).toString('utf8')
},
t = function (e, t, n, r) {
var i = t.write(e, n, r, 'utf8')
i < r && t.fill(0, n + i, n + r)
},
n = function (e, t, n) {
var r = e[0]
return (r >= n && (r = n - 1), t++, e.slice(t, t + r).toString('utf8'))
},
r = function (e, t, n, r) {
var i = Buffer.alloc(e, 'utf8'),
a = i.length
;(a >= r && (a = r - 1),
a > 255 && (a = 255),
(i[n] = a),
i.copy(t, n + 1, 0, a),
t.fill(0, n + 1 + a, n + r))
},
i = function (e, t) {
return e.readUInt32LE(t, !0)
},
a = function (e, t) {
return e.readUInt32BE(t, !0)
},
o = function (e, t) {
return e.readInt32LE(t, !0)
},
s = function (e, t) {
return e.readInt32BE(t, !0)
},
u = function (e, t, n) {
t.writeUInt32LE(e, n, !0)
},
l = function (e, t, n) {
t.writeUInt32BE(e, n, !0)
},
c = function (e, t, n) {
t.writeInt32LE(e, n, !0)
},
h = function (e, t, n) {
t.writeInt32BE(e, n, !0)
}
return (
(lu = function (d) {
var f = d.Buffer,
p = void 0 === d.isLittleEndian || !!d.isLittleEndian,
v = void 0 === d.is64bit || !!d.is64bit,
m = d.unpackUInt64LE,
g = d.unpackUInt64BE,
y = d.unpackInt64LE,
_ = d.unpackInt64BE,
b = d.packUInt64LE,
x = d.packUInt64BE,
S = d.packInt64LE,
w = d.packInt64BE,
M = {
x: [1, 1, null, null],
c: [
1,
1,
function (e, t) {
return String.fromCharCode(e[t])
},
function (e, t, n) {
t[n] = e.charCodeAt(0)
},
],
b: [
1,
1,
function (e, t) {
return e.readInt8(t)
},
function (e, t, n) {
t.writeInt8(e, n, !0)
},
],
B: [
1,
1,
function (e, t) {
return e[t]
},
function (e, t, n) {
t[n] = e
},
],
h: [
2,
2,
p
? function (e, t) {
return e.readInt16LE(t)
}
: function (e, t) {
return e.readInt16BE(t)
},
p
? function (e, t, n) {
return t.writeInt16LE(e, n, !0)
}
: function (e, t, n) {
return t.writeInt16BE(e, n, !0)
},
],
H: [
2,
2,
p
? function (e, t) {
return e.readUInt16LE(t)
}
: function (e, t) {
return e.readUInt16BE(t)
},
p
? function (e, t, n) {
return t.writeUInt16LE(e, n, !0)
}
: function (e, t, n) {
return t.writeUInt16BE(e, n, !0)
},
],
i: [4, 4, p ? o : s, p ? c : h],
I: [4, 4, p ? i : a, p ? u : l],
l: [4, 4, p ? o : s, p ? c : h],
L: [4, 4, p ? i : a, p ? u : l],
f: [
4,
4,
p
? function (e, t) {
return e.readFloatLE(t)
}
: function (e, t) {
return e.readFloatBE(t)
},
p
? function (e, t, n) {
return t.writeFloatLE(e, n, !0)
}
: function (e, t, n) {
return t.writeFloatBE(e, n, !0)
},
],
d: [
8,
8,
p
? function (e, t) {
return e.readDoubleLE(t)
}
: function (e, t) {
return e.readDoubleBE(t)
},
p
? function (e, t, n) {
return t.writeDoubleLE(e, n, !0)
}
: function (e, t, n) {
return t.writeDoubleBE(e, n, !0)
},
],
s: [1, 1, e, t],
p: [1, 1, n, r],
P: [
v ? 8 : 4,
v ? 8 : 4,
p ? (v ? m : i) : v ? g : a,
p ? (v ? b : u) : v ? x : l,
],
q: [8, 8, p ? y : _, p ? S : w],
Q: [8, 8, p ? m : g, p ? b : x],
'?': [
1,
1,
function (e, t) {
return 0 !== e[t]
},
function (e, t, n) {
t[n] = e ? 1 : 0
},
],
},
E = {
x: [1, 1, null, null],
c: [
1,
1,
function (e, t) {
return String.fromCharCode(e[t])
},
function (e, t, n) {
t[n] = e.charCodeAt(0)
},
],
b: [
1,
1,
function (e, t) {
return e.readInt8(t)
},
function (e, t, n) {
t.writeInt8(e, n, !0)
},
],
B: [
1,
1,
function (e, t) {
return e[t]
},
function (e, t, n) {
t[n] = e
},
],
h: [
2,
1,
function (e, t) {
return e.readInt16LE(t)
},
function (e, t, n) {
return t.writeInt16LE(e, n, !0)
},
],
H: [
2,
1,
function (e, t) {
return e.readUInt16LE(t)
},
function (e, t, n) {
return t.writeUInt16LE(e, n, !0)
},
],
i: [4, 1, o, c],
I: [4, 1, i, u],
l: [4, 1, o, c],
L: [4, 1, i, u],
f: [
4,
1,
function (e, t) {
return e.readFloatLE(t)
},
function (e, t, n) {
return t.writeFloatLE(e, n, !0)
},
],
d: [
8,
1,
function (e, t) {
return e.readDoubleLE(t)
},
function (e, t, n) {
return t.writeDoubleLE(e, n, !0)
},
],
s: [1, 1, e, t],
p: [1, 1, n, r],
P: [v ? 8 : 4, 1, v ? m : i, v ? b : u],
q: [8, 1, y, S],
Q: [8, 1, m, b],
'?': [
1,
1,
function (e, t) {
return 0 !== e[t]
},
function (e, t, n) {
t[n] = e ? 1 : 0
},
],
},
C = {
x: [1, 1, null, null],
c: [
1,
1,
function (e, t) {
return String.fromCharCode(e[t])
},
function (e, t, n) {
t[n] = e.charCodeAt(0)
},
],
b: [
1,
1,
function (e, t) {
return e.readInt8(t)
},
function (e, t, n) {
t.writeInt8(e, n, !0)
},
],
B: [
1,
1,
function (e, t) {
return e[t]
},
function (e, t, n) {
t[n] = e
},
],
h: [
2,
1,
function (e, t) {
return e.readInt16BE(t)
},
function (e, t, n) {
return t.writeInt16BE(e, n, !0)
},
],
H: [
2,
1,
function (e, t) {
return e.readUInt16BE(t)
},
function (e, t, n) {
return t.writeUInt16BE(e, n, !0)
},
],
i: [4, 1, s, h],
I: [4, 1, a, l],
l: [4, 1, s, h],
L: [4, 1, a, l],
f: [
4,
1,
function (e, t) {
return e.readFloatBE(t)
},
function (e, t, n) {
return t.writeFloatBE(e, n, !0)
},
],
d: [
8,
1,
function (e, t) {
return e.readDoubleBE(t)
},
function (e, t, n) {
return t.writeDoubleBE(e, n, !0)
},
],
s: [1, 1, e, t],
p: [1, 1, n, r],
P: [v ? 8 : 4, 1, v ? g : a, v ? x : l],
q: [8, 1, _, w],
Q: [8, 1, g, x],
'?': [
1,
1,
function (e, t) {
return 0 !== e[t]
},
function (e, t, n) {
t[n] = e ? 1 : 0
},
],
},
k = function (e) {
var t = e[0],
n = !0,
r = M
switch (t) {
case '<':
r = E
break
case '>':
case '!':
r = C
break
case '=':
r = p ? E : C
break
default:
n = !1
case '@':
r = M
}
return { map: r, skipFirst: n }
},
R = (function () {
function e() {
A(this, e)
}
return T(e, null, [
{
key: 'sizeOf',
value: function (e) {
var t,
n,
r,
i,
a = 0,
o = null,
s = 0,
u = k(e),
l = u.map
for (u.skipFirst && s++, n = e.length; s < n; s++)
(t = e[s]) >= '0' && t <= '9'
? (o = null === o ? t : o + t)
: (r = l[t]) &&
((i = r[1]) > 1 && (a = Math.ceil(a / i) * i),
(o = o ? parseInt(o, 10) : 0),
(a +=
's' === t ? o || 0 : 'p' === t ? o || 1 : r[0] * (o || 1)),
(o = null))
return a
},
},
{
key: 'unpack',
value: function (t, n, r) {
return e.unpackFrom(t, n, r, 0)
},
},
{
key: 'unpackFrom',
value: function (e, t, n, r) {
var i = [],
a = null,
o = 0,
s = k(e),
u = s.map
s.skipFirst && o++
for (var l = e.length; o < l; o++) {
var c = e[o]
if (c >= '0' && c <= '9') a = null === a ? c : a + c
else {
var h = u[c]
if (h) {
var d = h[0],
f = h[1]
;(f > 1 && (r = Math.ceil(r / f) * f),
(a = a ? parseInt(a, 10) : 0))
var p = void 0
's' === c
? ((p = 1), (d = a))
: 'p' === c
? ((p = 1), (d = a || 1))
: (p = a || 1)
for (var v = h[2]; p > 0; ) {
if (v) {
if (n && r + d >= t.length)
throw new Error(
"Reached end of buffer, can't unpack anymore data."
)
i.push(v(t, r, a))
}
;((r += d), p--)
}
a = null
}
}
}
return i
},
},
{
key: 'pack',
value: function (t, n, r) {
Array.isArray(n) ||
((n = Array.prototype.slice.call(arguments, 1)), (r = !0))
var i = f.alloc(e.sizeOf(t)),
a = 0,
o = null,
s = 0,
u = 0,
l = k(t),
c = l.map
l.skipFirst && s++
for (var h = t.length; s < h; s++) {
var d = t[s]
if (d >= '0' && d <= '9') o = null === o ? d : o + d
else {
var p = c[d]
if (p) {
var v = p[0],
m = p[1]
;(m > 1 && (a = Math.ceil(a / m) * m),
(o = o ? parseInt(o, 10) : 0))
var g = void 0
's' === d
? ((g = 1), (v = o))
: 'p' === d
? ((g = 1), (v = o || 1))
: (g = o || 1)
for (var y = p[3]; g > 0; ) {
if (y) {
if (r && u >= n.length)
throw new Error(
'Reached end of data, no more elements to pack.'
)
;(y(n[u], i, a, o), u++)
}
;((a += v), g--)
}
o = null
}
}
}
return i
},
},
])
})()
return R
}),
lu
)
})()(
Object.assign(
{
Buffer: uu().Buffer,
isLittleEndian:
void 0 ===
('undefined' == typeof Uint8Array ? 'undefined' : P(Uint8Array)) ||
120 === new Uint8Array(new Uint32Array([305419896]).buffer)[0],
is64bit:
void 0 === ('undefined' == typeof navigator ? 'undefined' : P(navigator)) ||
/WOW64|Win64|arm64|ia64|x64;|Mac OS X/i.test(navigator.userAgent),
},
yu()
)
))),
vu),
bu = as(_u),
xu = (function () {
var e = v(
d().m(function e(t) {
var n,
r,
i,
a,
o,
s,
u,
l,
c = arguments
return d().w(function (e) {
for (;;)
switch (e.n) {
case 0:
return (
(n = c.length > 1 && void 0 !== c[1] ? c[1] : ' 0 && void 0 !== arguments[0] ? arguments[0] : 21,
t = '',
n = crypto.getRandomValues(new Uint8Array((e |= 0)));
e--;
)
t += 'useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict'[
63 & n[e]
]
return t
})()
),
M(this, 'analyserNode', void 0),
M(this, 'audioCtx', void 0),
M(this, 'autoPlay', !0),
M(this, 'bufferSource', void 0),
M(this, 'convertValue', 32768),
M(this, 'ee', void 0),
M(this, 'gainNode', void 0),
M(this, 'option', {
inputCodec: 'Int16',
channels: 1,
sampleRate: 8e3,
fftSize: 2048,
onended: function () {},
isMute: !1,
}),
M(this, 'samplesList', []),
M(this, 'startTime', void 0),
M(this, 'typedArray', void 0),
M(this, '_firstStartRelativeTime', void 0),
M(this, '_firstStartAbsoluteTime', void 0),
(this.ee = n),
this.init(t))
}
return T(
e,
[
{
key: 'continue',
value:
((r = v(
d().m(function e() {
return d().w(
function (e) {
for (;;)
switch (e.n) {
case 0:
return ((e.n = 1), this.audioCtx.resume())
case 1:
return e.a(2)
}
},
e,
this
)
})
)),
function () {
return r.apply(this, arguments)
}),
},
{
key: 'destroy',
value: function () {
var e
;((this.samplesList = []),
null === (e = this.audioCtx) || void 0 === e || e.close(),
(this.audioCtx = void 0))
},
},
{
key: 'feed',
value: function (e) {
var t = e.audio,
n = e.end_of_batch
if (t) {
;(this._isSupported(t), (t = this._getFormattedValue(t)))
var r = new Float32Array(t.length)
r.set(t, 0)
var i = { data: r, end_of_batch: n }
;(this.samplesList.push(i), this.flush(i, this.samplesList.length - 1))
}
},
},
{
key: 'flush',
value: function (e, t) {
var n = this
if (e && this.autoPlay && this.audioCtx) {
var r = e.data,
i = e.end_of_batch
;(this.bufferSource && (this.bufferSource.onended = function () {}),
(this.bufferSource = this.audioCtx.createBufferSource()),
'function' == typeof this.option.onended &&
(this.bufferSource.onended = function () {
;(i ||
t !== n.samplesList.length - 1 ||
n.ee.emit(ds.Player_WaitNextAudioClip),
n.option.onended())
}))
for (
var a = r.length / this.option.channels,
o = this.audioCtx.createBuffer(
this.option.channels,
a,
this.option.sampleRate
),
s = 0;
s < this.option.channels;
s++
)
for (var u = o.getChannelData(s), l = s, c = 50, h = 0; h < a; h++)
((u[h] = r[l]),
h < 50 && (u[h] = (u[h] * h) / 50),
h >= a - 51 && (u[h] = (u[h] * c--) / 50),
(l += this.option.channels))
;(this.startTime < this.audioCtx.currentTime &&
(this.startTime = this.audioCtx.currentTime),
(this.bufferSource.buffer = o),
this.bufferSource.connect(this.gainNode),
this.bufferSource.connect(this.analyserNode),
this.bufferSource.start(this.startTime),
(e.startTime = this.startTime),
void 0 === this._firstStartAbsoluteTime &&
(this._firstStartAbsoluteTime = Date.now()),
void 0 === this._firstStartRelativeTime &&
((this._firstStartRelativeTime = this.startTime),
this.ee.emit(ds.Player_StartSpeaking, this)),
(this.startTime += o.duration))
}
},
},
{
key: 'init',
value: function (e) {
;((this.option = Object.assign(this.option, e)),
(this.convertValue = this._getConvertValue()),
(this.typedArray = this._getTypedArray()),
this.initAudioContext())
},
},
{
key: 'initAudioContext',
value: function () {
;((this.audioCtx = new (window.AudioContext || window.webkitAudioContext)()),
(this.gainNode = this.audioCtx.createGain()),
(this.gainNode.gain.value = this.option.isMute ? 0 : 1),
this.gainNode.connect(this.audioCtx.destination),
(this.startTime = this.audioCtx.currentTime),
(this.analyserNode = this.audioCtx.createAnalyser()),
(this.analyserNode.fftSize = this.option.fftSize))
},
},
{
key: 'setMute',
value: function (e) {
this.gainNode.gain.value = e ? 0 : 1
},
},
{
key: 'pause',
value:
((n = v(
d().m(function e() {
return d().w(
function (e) {
for (;;)
switch (e.n) {
case 0:
return ((e.n = 1), this.audioCtx.suspend())
case 1:
return e.a(2)
}
},
e,
this
)
})
)),
function () {
return n.apply(this, arguments)
}),
},
{
key: 'updateAutoPlay',
value:
((t = v(
d().m(function e(t) {
var n = this
return d().w(
function (e) {
for (;;)
switch (e.n) {
case 0:
this.autoPlay !== t && t
? ((this.autoPlay = t),
this.samplesList.forEach(function (e, t) {
n.flush(e, t)
}))
: (this.autoPlay = t)
case 1:
return e.a(2)
}
},
e,
this
)
})
)),
function (e) {
return t.apply(this, arguments)
}),
},
{
key: 'volume',
value: function (e) {
this.gainNode.gain.value = e
},
},
{
key: '_getFormattedValue',
value: function (e) {
var t = this.typedArray
e = e.constructor === ArrayBuffer ? new t(e) : new t(e.buffer)
for (var n = new Float32Array(e.length), r = 0; r < e.length; r++)
n[r] = e[r] / this.convertValue
return n
},
},
{
key: '_isSupported',
value: function (t) {
if (!e.isTypedArray(t)) throw new Error('请传入ArrayBuffer或者任意TypedArray')
return !0
},
},
{
key: '_getConvertValue',
value: function () {
var e = { Int8: 128, Int16: 32768, Int32: 2147483648, Float32: 1 }
if (!e[this.option.inputCodec])
throw new Error(
'wrong codec.please input one of these codecs:Int8,Int16,Int32,Float32'
)
return e[this.option.inputCodec]
},
},
{
key: '_getTypedArray',
value: function () {
var e = {
Int8: Int8Array,
Int16: Int16Array,
Int32: Int32Array,
Float32: Float32Array,
}
if (!e[this.option.inputCodec])
throw new Error(
'wrong codec.please input one of these codecs:Int8,Int16,Int32,Float32'
)
return e[this.option.inputCodec]
},
},
],
[
{
key: 'isTypedArray',
value: function (e) {
return (
(e.byteLength && e.buffer && e.buffer.constructor === ArrayBuffer) ||
e.constructor === ArrayBuffer
)
},
},
]
)
var t, n, r
})(),
Au = { int16: 'Int16', int32: 'Int32', float32: 'Float32' },
wu = { int16: Int16Array, int32: Int32Array, float32: Float32Array },
Tu = (function () {
return T(
function e(t) {
;(A(this, e),
M(this, 'ee', void 0),
M(this, '_motionDataGroupHandlerQueue', new zs({ concurrency: 1 })),
M(this, '_motionDataGroups', []),
M(this, '_arkit_face_sample_rate', void 0),
M(this, '_arkit_face_channel_names', void 0),
M(this, '_tts2face_sample_rate', void 0),
M(this, '_tts2face_channel_names', void 0),
M(this, '_maxBatchId', void 0),
M(this, '_arkitFaceShape', void 0),
M(this, '_tts2FaceShape', void 0),
(this.ee = t))
},
[
{
key: 'add',
value: function (e) {
var t = this,
n = e.avatar_motion_data
this._motionDataGroupHandlerQueue.add(
v(
d().m(function e() {
return d().w(function (e) {
for (;;)
switch (e.n) {
case 0:
return ((e.n = 1), t._motionDataGroupHandler(n))
case 1:
return e.a(2, e.v)
}
}, e)
})
)
)
},
},
{
key: 'clear',
value: function () {
;(this._motionDataGroups.forEach(function (e) {
var t
null === (t = e.player) || void 0 === t || t.destroy()
}),
(this._motionDataGroups = []))
},
},
{
key: 'setMute',
value: function (e) {
this._motionDataGroups.forEach(function (t) {
var n
null === (n = t.player) || void 0 === n || n.setMute(e)
})
},
},
{
key: 'getArkitFaceFrame',
value: function () {
return { arkitFace: this._getArkitFaceFrame() }
},
},
{
key: 'getLastBatchId',
value: function () {
var e
return (
this._motionDataGroups.forEach(function (t) {
t.batch_id && (e = t.batch_id)
}),
e
)
},
},
{
key: 'getTtt2FaceFrame',
value: function () {
return { tts2Face: this._getTts2FaceFrame() }
},
},
{
key: 'interrupt',
value: function () {
var e = this
;(this._motionDataGroups.forEach(function (t) {
var n
;(t.batch_id && (e._maxBatchId = t.batch_id),
null === (n = t.player) || void 0 === n || n.destroy())
}),
(this._motionDataGroups = []))
},
},
{
key: '_getArkitFaceFrame',
value: function () {
if (!this._motionDataGroups.length) return null
var e = this._motionDataGroups.find(function (e) {
return e.player
})
if (!e) return null
var t = e.arkitFaceArrayBufferArray,
n = e.player
if (
n &&
n._firstStartAbsoluteTime &&
t &&
t.length > 0 &&
this._arkitFaceShape &&
this._arkit_face_sample_rate
) {
var r,
i = Date.now() - n._firstStartAbsoluteTime,
a = 0
n.samplesList.forEach(function (e, t) {
;(void 0 === r && void 0 !== e.startTime && (r = e.startTime),
void 0 !== e.startTime && e.startTime - r <= i / 1e3 && (a = t))
})
var o = n.samplesList[a],
s = i - 1e3 * o.startTime,
u = Math.floor((s / 1e3) * this._arkit_face_sample_rate),
l = new Float32Array(t[a]),
c =
null == l
? void 0
: l.slice(
u * this._arkitFaceShape,
u * this._arkitFaceShape + this._arkitFaceShape
)
if (null != c && c.length) {
var h = {}
return (
(this._arkit_face_channel_names || []).forEach(function (e, t) {
Object.assign(h, M({}, e, c[t]))
}),
h
)
}
return null
}
return null
},
},
{
key: '_getTts2FaceFrame',
value: function () {
if (!this._motionDataGroups.length) return null
var e = this._motionDataGroups.find(function (e) {
return e.player
})
if (!e) return null
var t = e.tts2faceArrayBufferArray,
n = e.player
if (
n &&
n._firstStartAbsoluteTime &&
t &&
t.length > 0 &&
this._tts2FaceShape &&
this._tts2face_sample_rate
) {
var r,
i = Date.now() - n._firstStartAbsoluteTime,
a = 0
n.samplesList.forEach(function (e, t) {
;(void 0 === r && void 0 !== e.startTime && (r = e.startTime),
void 0 !== e.startTime && e.startTime - r <= i / 1e3 && (a = t))
})
var o = n.samplesList[a],
s = i - 1e3 * o.startTime,
u = Math.floor((s / 1e3) * this._tts2face_sample_rate),
l = new Float32Array(t[a]),
c =
null == l
? void 0
: l.slice(
u * this._tts2FaceShape,
u * this._tts2FaceShape + this._tts2FaceShape
)
return null != c && c.length ? c : null
}
return null
},
},
{
key: '_motionDataGroupHandler',
value:
((r = v(
d().m(function e(t) {
var n, r, i, a, o, s, u, l, c, h, f, p, v, m, g, y
return d().w(
function (e) {
for (;;)
switch (e.n) {
case 0:
if (
((e.p = 0),
(n = t.first_package),
(r = t.motion_data_slice),
(i = t.segment_num),
(a = t.binary_size),
(o = t.use_binary_frame),
(s = t.is_audio_mute),
!n)
) {
e.n = 1
break
}
;((u =
this._motionDataGroups[this._motionDataGroups.length - 1]) &&
u.segment_num !== u.motion_data_slices.length &&
this.ee.emit(cs.ErrorReceived, 'lost data packets'),
this._motionDataGroups.push({
first_package: n,
binary_size: a,
segment_num: i,
use_binary_frame: o,
motion_data_slices: [],
merged_motion_data: new Uint8Array(a),
}),
(e.n = 8))
break
case 1:
if (0 !== this._motionDataGroups.length) {
e.n = 2
break
}
return e.a(2)
case 2:
if (r) {
e.n = 3
break
}
return e.a(2)
case 3:
if (
((l =
this._motionDataGroups[this._motionDataGroups.length - 1]),
(c =
this._motionDataGroups[this._motionDataGroups.length - 2]),
l.motion_data_slices.push(r),
l.motion_data_slices.length !== l.segment_num)
) {
e.n = 8
break
}
return ((h = l.motion_data_slices[0]), (e.n = 4), xu(h))
case 4:
if (
((f = e.v),
(p = f.parsedData),
(v = f.jsonSize),
(m = f.binSize),
(l.jsonSize = v),
(l.binSize = m),
(g = h.slice(12 + l.jsonSize)).size !== l.binSize &&
this.ee.emit(fs.Chat_BinsizeError),
this._connectBatch(p, l, c))
) {
e.n = 5
break
}
return e.a(2)
case 5:
return ((e.n = 6), this._handleArkitFaceConfig(p, l, c, g))
case 6:
return ((e.n = 7), this._handleAudioConfig(p, l, c, g, s || !1))
case 7:
this._handleEvents(p)
case 8:
e.n = 10
break
case 9:
;((e.p = 9),
(y = e.v),
console.error('err', y),
this.ee.emit(cs.ErrorReceived, y.message))
case 10:
return e.a(2)
}
},
e,
this,
[[0, 9]]
)
})
)),
function (e) {
return r.apply(this, arguments)
}),
},
{
key: '_handleAudioConfig',
value:
((n = v(
d().m(function e(t, n, r, i, a) {
var o,
s,
u,
l,
c,
h,
f,
p,
v,
m,
g,
y,
_,
b,
x,
S,
A,
w = this
return d().w(
function (e) {
for (;;)
switch (e.n) {
case 0:
if (
((o = t.data_records),
(s = void 0 === o ? {} : o),
(u = t.end_of_batch),
!(l = s.audio))
) {
e.n = 2
break
}
return (
(c = l.sample_rate),
(h = l.shape),
(f = l.data_offset),
(p = l.data_type),
(v = Au[p]),
(m = wu[p]),
void 0 === n.player &&
(r && r.player && r.batch_id === n.batch_id
? (n.player = r.player)
: c &&
(n.player = new Su(
{
inputCodec: v,
channels: 1,
sampleRate: c,
fftSize: 1024,
isMute: a,
onended: function (e) {
if (e) {
var t = e.end_of_batch,
n = e.lastMotionGroup
if (t) {
var r = n.batch_id,
i = n.player
;(w.ee.emit(ds.Player_EndSpeaking, i),
(w._motionDataGroups =
w._motionDataGroups.filter(function (e) {
return e.batch_id > r
})),
w._motionDataGroups.length &&
w._motionDataGroups[0].player
? w._motionDataGroups[0].player.updateAutoPlay(
!0
)
: w.ee.emit(ds.Player_NoLegacy))
}
}
},
},
this.ee
)),
u &&
((g = n.player.option.onended),
(n.player.option.onended = function () {
g({ end_of_batch: u, lastMotionGroup: n })
}))),
(y = h.reduce(
function (e, t) {
return e * t
},
'Int16' === v ? 2 : 4
)),
(_ = f),
(b = f + y),
(x = i.slice(_, b)),
(e.n = 1),
x.arrayBuffer()
)
case 1:
;((S = e.v),
(A = this._motionDataGroups.find(function (e) {
return e.player
})),
this._motionDataGroups.length &&
n.player &&
A &&
A.player !== n.player &&
(n.player.autoPlay = !1),
n.player &&
n.player.feed({ audio: new m(S), end_of_batch: u }),
(e.n = 3))
break
case 2:
r &&
r.player &&
n.batch_id === r.batch_id &&
(n.player = r.player)
case 3:
return e.a(2)
}
},
e,
this
)
})
)),
function (e, t, r, i, a) {
return n.apply(this, arguments)
}),
},
{
key: '_handleArkitFaceConfig',
value:
((t = v(
d().m(function e(t, n, r, i) {
var a, o, s, u, l, c, h, f, p
return d().w(
function (e) {
for (;;)
switch (e.n) {
case 0:
if (
((a = t.data_records),
!(o = (void 0 === a ? {} : a).arkit_face))
) {
e.n = 3
break
}
if (
((s = o.channel_names),
(u = o.shape),
(l = o.data_offset),
(c = o.sample_rate),
s &&
!this._arkit_face_channel_names &&
((this._arkit_face_channel_names = s),
(this._arkit_face_sample_rate = c)),
void 0 !== n.arkitFaceArrayBufferArray)
) {
e.n = 2
break
}
return (
r && r.arkitFaceArrayBufferArray && r.batch_id === n.batch_id
? (n.arkitFaceArrayBufferArray =
r.arkitFaceArrayBufferArray)
: (n.arkitFaceArrayBufferArray = []),
(h = u.reduce(function (e, t) {
return e * t
}, 4)),
(this._arkitFaceShape = u[1]),
(f = i.slice(l, l + h)),
(e.n = 1),
f.arrayBuffer()
)
case 1:
;((p = e.v), n.arkitFaceArrayBufferArray.push(p))
case 2:
e.n = 4
break
case 3:
r &&
r.arkitFaceArrayBufferArray &&
n.batch_id === r.batch_id &&
(n.arkitFaceArrayBufferArray = r.arkitFaceArrayBufferArray)
case 4:
return e.a(2)
}
},
e,
this
)
})
)),
function (e, n, r, i) {
return t.apply(this, arguments)
}),
},
{
key: '_handletts2faceConfig',
value:
((e = v(
d().m(function e(t, n, r, i) {
var a, o, s, u, l, c, h, f, p
return d().w(
function (e) {
for (;;)
switch (e.n) {
case 0:
if (
((a = t.data_records),
!(o = (void 0 === a ? {} : a).tts2face))
) {
e.n = 3
break
}
if (
((s = o.channel_names),
(u = o.shape),
(l = o.data_offset),
(c = o.sample_rate),
s &&
!this._tts2face_channel_names &&
((this._tts2face_channel_names = s),
(this._tts2face_sample_rate = c)),
void 0 !== n.tts2faceArrayBufferArray)
) {
e.n = 2
break
}
return (
r && r.tts2faceArrayBufferArray && r.batch_id === n.batch_id
? (n.tts2faceArrayBufferArray = r.tts2faceArrayBufferArray)
: (n.tts2faceArrayBufferArray = []),
(h = u.reduce(function (e, t) {
return e * t
}, 4)),
(this._tts2FaceShape = u[1]),
(f = i.slice(l, l + h)),
(e.n = 1),
f.arrayBuffer()
)
case 1:
;((p = e.v), n.tts2faceArrayBufferArray.push(p))
case 2:
e.n = 4
break
case 3:
r &&
r.tts2faceArrayBufferArray &&
n.batch_id === r.batch_id &&
(n.tts2faceArrayBufferArray = r.tts2faceArrayBufferArray)
case 4:
return e.a(2)
}
},
e,
this
)
})
)),
function (t, n, r, i) {
return e.apply(this, arguments)
}),
},
{
key: '_handleEvents',
value: function (e) {
var t = this,
n = e.events
n &&
n.length &&
n.forEach(function (e) {
switch (e.event_type) {
case 'interrupt_speech':
break
case 'change_status':
t.ee.emit(fs.Change_Status, e)
}
})
},
},
{
key: '_connectBatch',
value: function (e, t, n) {
var r = !0
return (
e.batch_id && void 0 === t.batch_id && (t.batch_id = e.batch_id),
!t.batch_id && n && n.batch_id && (t.batch_id = n.batch_id),
e.batch_name && void 0 === t.batch_name && (t.batch_name = e.batch_name),
this._maxBatchId &&
t.batch_id &&
t.batch_id <= this._maxBatchId &&
(this.clear(), (r = !1)),
r
)
},
},
]
)
var e, t, n, r
})(),
Mu = (function () {
function e(t, n) {
var r, i
;(A(this, e),
(this.promise = new Promise(function (e, t) {
;((r = e), (i = t))
})))
var a = r.bind(this),
o = i.bind(this)
;(t(
function () {
a.apply(void 0, arguments)
}.bind(this),
function (e) {
o(e)
}.bind(this)
),
(this.abortHandler = n),
(this.id = e.idGen++))
}
return T(e, [
{
key: 'then',
value: function (t) {
var n = this
return new e(function (r, i) {
n.promise = n.promise
.then(function () {
var n = t.apply(void 0, arguments)
n instanceof Promise || n instanceof e
? n.then(function () {
r.apply(void 0, arguments)
})
: r(n)
})
.catch(function (e) {
i(e)
})
}, this.abortHandler)
},
},
{
key: 'catch',
value: function (t) {
var n = this
return new e(function (e) {
n.promise = n.promise
.then(function () {
e.apply(void 0, arguments)
})
.catch(t)
}, this.abortHandler)
},
},
{
key: 'abort',
value: function (e) {
this.abortHandler && this.abortHandler(e)
},
},
])
})()
M(Mu, 'idGen', 0)
var Eu,
Cu = (function (e) {
function t(e) {
return (A(this, t), y(this, t, [e]))
}
return (x(t, e), T(t))
})(m(Error))
;((Eu = new Float32Array(1)), new Int32Array(Eu.buffer))
var ku = (function () {
var e = new Float32Array(1),
t = new Int32Array(e.buffer)
return function (n) {
return ((e[0] = n), t[0])
}
})(),
Ru = function (e, t) {
return e[t] + (e[t + 1] << 8) + (e[t + 2] << 16) + (e[t + 3] << 24)
},
Iu = function (e, t) {
var n = !(arguments.length > 2 && void 0 !== arguments[2]) || arguments[2],
r = arguments.length > 3 ? arguments[3] : void 0,
i = new AbortController(),
a = i.signal,
o = !1
return new Mu(
function (i, s) {
var u = { signal: a }
;(r && (u.headers = r),
fetch(e, u)
.then(
(function () {
var e = v(
d().m(function e(r) {
var a, u, l, c, h, f, p, v, m, g, y, _
return d().w(
function (e) {
for (;;)
switch (e.n) {
case 0:
if (r.ok) {
e.n = 2
break
}
return ((e.n = 1), r.text())
case 1:
return (
(a = e.v),
s(
new Error(
'Fetch failed: '
.concat(r.status, ' ')
.concat(r.statusText, ' ')
.concat(a)
)
),
e.a(2)
)
case 2:
;((u = r.body.getReader()),
(l = 0),
(c = r.headers.get('Content-Length')),
(h = c ? parseInt(c) : void 0),
(f = []))
case 3:
if (o) {
e.n = 9
break
}
return ((e.p = 4), (e.n = 5), u.read())
case 5:
if (((p = e.v), (v = p.value), !p.done)) {
e.n = 6
break
}
return (
t && t(100, '100%', v, h),
n ? ((m = new Blob(f).arrayBuffer()), i(m)) : i(),
e.a(3, 9)
)
case 6:
;((l += v.length),
(g = void 0),
(y = void 0),
void 0 !== h &&
(y = ''.concat((g = (l / h) * 100).toFixed(2), '%')),
n && f.push(v),
t && t(g, y, v, h),
(e.n = 8))
break
case 7:
return ((e.p = 7), (_ = e.v), s(_), e.a(2))
case 8:
e.n = 3
break
case 9:
return e.a(2)
}
},
e,
null,
[[4, 7]]
)
})
)
return function (t) {
return e.apply(this, arguments)
}
})()
)
.catch(function (e) {
s(new Cu(e))
}))
},
function (e) {
;(i.abort(e), (o = !0))
}
)
},
Nu = function (e, t, n) {
return Math.max(Math.min(e, n), t)
},
Pu = function () {
return performance.now() / 1e3
},
Lu = function (e) {
if (
(e.geometry && (e.geometry.dispose(), (e.geometry = null)),
e.material && (e.material.dispose(), (e.material = null)),
e.children)
) {
var t,
n = L(e.children)
try {
for (n.s(); !(t = n.n()).done; ) {
var r = t.value
Lu(r)
}
} catch (i) {
n.e(i)
} finally {
n.f()
}
}
},
Du = function (e, t) {
return new Promise(function (n) {
window.setTimeout(
function () {
n(e())
},
t ? 1 : 50
)
})
},
Ou = function () {
switch (arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : 0) {
case 1:
return 9
case 2:
return 24
}
return 0
},
Fu = function () {
var e,
t,
n = new Promise(function (n, r) {
;((e = n), (t = r))
})
return { promise: n, resolve: e, reject: t }
},
Bu = function (e) {
var t, n
e || (e = function () {})
var r = new Mu(function (e, r) {
;((t = e), (n = r))
}, e)
return { promise: r, resolve: t, reject: n }
},
Uu = (function () {
return T(
function e(t, n, r) {
;(A(this, e), (this.major = t), (this.minor = n), (this.patch = r))
},
[
{
key: 'toString',
value: function () {
return ''.concat(this.major, '_').concat(this.minor, '_').concat(this.patch)
},
},
]
)
})()
function zu() {
var e = navigator.userAgent
return e.indexOf('iPhone') > 0 || e.indexOf('iPad') > 0
}
function Vu() {
if (zu()) {
var e = navigator.userAgent.match(/OS (\d+)_(\d+)_?(\d+)?/)
return new Uu(
parseInt(e[1] || 0, 10),
parseInt(e[2] || 0, 10),
parseInt(e[3] || 0, 10)
)
}
return null
}
var Hu = (function () {
function e() {
var t = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : 0
;(A(this, e),
(this.sphericalHarmonicsDegree = t),
(this.sphericalHarmonicsCount = Ou(this.sphericalHarmonicsDegree)),
(this.componentCount = this.sphericalHarmonicsCount + 14),
(this.defaultSphericalHarmonics = new Array(this.sphericalHarmonicsCount).fill(0)),
(this.splats = []),
(this.splatCount = 0))
}
return T(
e,
[
{
key: 'addSplat',
value: function (e) {
;(this.splats.push(e), this.splatCount++)
},
},
{
key: 'getSplat',
value: function (e) {
return this.splats[e]
},
},
{
key: 'addDefaultSplat',
value: function () {
var t = e.createSplat(this.sphericalHarmonicsDegree)
return (this.addSplat(t), t)
},
},
{
key: 'addSplatFromComonents',
value: function (e, t, n, r, i, a, o, s, u, l, c, h, d, f) {
for (
var p = [e, t, n, r, i, a, o, s, u, l, c, h, d, f].concat(
I(this.defaultSphericalHarmonics)
),
v = 0;
v < (arguments.length <= 14 ? 0 : arguments.length - 14) &&
v < this.sphericalHarmonicsCount;
v++
)
p[v] = v + 14 < 14 || arguments.length <= v + 14 ? void 0 : arguments[v + 14]
return (this.addSplat(p), p)
},
},
{
key: 'addSplatFromArray',
value: function (t, n) {
for (
var r = t.splats[n], i = e.createSplat(this.sphericalHarmonicsDegree), a = 0;
a < this.componentCount && a < r.length;
a++
)
i[a] = r[a]
this.addSplat(i)
},
},
],
[
{
key: 'createSplat',
value: function () {
for (
var e = [0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0],
t = Ou(arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : 0),
n = 0;
n < t;
n++
)
e.push(0)
return e
},
},
]
)
})()
/**
* @license
* Copyright 2010-2025 Three.js Authors
* SPDX-License-Identifier: MIT
*/
M(Hu, 'OFFSET', {
X: 0,
Y: 1,
Z: 2,
SCALE0: 3,
SCALE1: 4,
SCALE2: 5,
ROTATION0: 6,
ROTATION1: 7,
ROTATION2: 8,
ROTATION3: 9,
FDC0: 10,
FDC1: 11,
FDC2: 12,
OPACITY: 13,
FRC0: 14,
FRC1: 15,
FRC2: 16,
FRC3: 17,
FRC4: 18,
FRC5: 19,
FRC6: 20,
FRC7: 21,
FRC8: 22,
FRC9: 23,
FRC10: 24,
FRC11: 25,
FRC12: 26,
FRC13: 27,
FRC14: 28,
FRC15: 29,
FRC16: 30,
FRC17: 31,
FRC18: 32,
FRC19: 33,
FRC20: 34,
FRC21: 35,
FRC22: 36,
FRC23: 37,
})
var Wu = '173',
Gu = 0,
ju = 1,
Qu = 2,
qu = 0,
Xu = 1,
Yu = 2,
Ku = 3,
Zu = 100,
Ju = 204,
$u = 205,
el = 'attached',
tl = 301,
nl = 302,
rl = 306,
il = 1e3,
al = 1001,
ol = 1002,
sl = 1003,
ul = 1005,
ll = 1006,
cl = 1007,
hl = 1008,
dl = 1009,
fl = 1010,
pl = 1011,
vl = 1012,
ml = 1013,
gl = 1014,
yl = 1015,
_l = 1016,
bl = 1017,
xl = 1018,
Sl = 1020,
Al = 35902,
wl = 1023,
Tl = 1026,
Ml = 1027,
El = 1028,
Cl = 1029,
kl = 1030,
Rl = 1031,
Il = 1033,
Nl = 33776,
Pl = 33777,
Ll = 33778,
Dl = 33779,
Ol = 35840,
Fl = 35841,
Bl = 35842,
Ul = 35843,
zl = 36196,
Vl = 37492,
Hl = 37496,
Wl = 37808,
Gl = 37809,
jl = 37810,
Ql = 37811,
ql = 37812,
Xl = 37813,
Yl = 37814,
Kl = 37815,
Zl = 37816,
Jl = 37817,
$l = 37818,
ec = 37819,
tc = 37820,
nc = 37821,
rc = 36492,
ic = 36494,
ac = 36495,
oc = 36284,
sc = 36285,
uc = 36286,
lc = 2200,
cc = 2201,
hc = 2300,
dc = 2301,
fc = 2302,
pc = 2400,
vc = 2401,
mc = 2402,
gc = 2500,
yc = '',
_c = 'srgb',
bc = 'srgb-linear',
xc = 'linear',
Sc = 'srgb',
Ac = 7680,
wc = 35044,
Tc = 35048,
Mc = '300 es',
Ec = 2e3,
Cc = 2001,
kc = (function () {
return T(
function e() {
A(this, e)
},
[
{
key: 'addEventListener',
value: function (e, t) {
void 0 === this._listeners && (this._listeners = {})
var n = this._listeners
;(void 0 === n[e] && (n[e] = []), -1 === n[e].indexOf(t) && n[e].push(t))
},
},
{
key: 'hasEventListener',
value: function (e, t) {
var n = this._listeners
return void 0 !== n && void 0 !== n[e] && -1 !== n[e].indexOf(t)
},
},
{
key: 'removeEventListener',
value: function (e, t) {
var n = this._listeners
if (void 0 !== n) {
var r = n[e]
if (void 0 !== r) {
var i = r.indexOf(t)
;-1 !== i && r.splice(i, 1)
}
}
},
},
{
key: 'dispatchEvent',
value: function (e) {
var t = this._listeners
if (void 0 !== t) {
var n = t[e.type]
if (void 0 !== n) {
e.target = this
for (var r = n.slice(0), i = 0, a = r.length; i < a; i++)
r[i].call(this, e)
e.target = null
}
}
},
},
]
)
})(),
Rc = [
'00',
'01',
'02',
'03',
'04',
'05',
'06',
'07',
'08',
'09',
'0a',
'0b',
'0c',
'0d',
'0e',
'0f',
'10',
'11',
'12',
'13',
'14',
'15',
'16',
'17',
'18',
'19',
'1a',
'1b',
'1c',
'1d',
'1e',
'1f',
'20',
'21',
'22',
'23',
'24',
'25',
'26',
'27',
'28',
'29',
'2a',
'2b',
'2c',
'2d',
'2e',
'2f',
'30',
'31',
'32',
'33',
'34',
'35',
'36',
'37',
'38',
'39',
'3a',
'3b',
'3c',
'3d',
'3e',
'3f',
'40',
'41',
'42',
'43',
'44',
'45',
'46',
'47',
'48',
'49',
'4a',
'4b',
'4c',
'4d',
'4e',
'4f',
'50',
'51',
'52',
'53',
'54',
'55',
'56',
'57',
'58',
'59',
'5a',
'5b',
'5c',
'5d',
'5e',
'5f',
'60',
'61',
'62',
'63',
'64',
'65',
'66',
'67',
'68',
'69',
'6a',
'6b',
'6c',
'6d',
'6e',
'6f',
'70',
'71',
'72',
'73',
'74',
'75',
'76',
'77',
'78',
'79',
'7a',
'7b',
'7c',
'7d',
'7e',
'7f',
'80',
'81',
'82',
'83',
'84',
'85',
'86',
'87',
'88',
'89',
'8a',
'8b',
'8c',
'8d',
'8e',
'8f',
'90',
'91',
'92',
'93',
'94',
'95',
'96',
'97',
'98',
'99',
'9a',
'9b',
'9c',
'9d',
'9e',
'9f',
'a0',
'a1',
'a2',
'a3',
'a4',
'a5',
'a6',
'a7',
'a8',
'a9',
'aa',
'ab',
'ac',
'ad',
'ae',
'af',
'b0',
'b1',
'b2',
'b3',
'b4',
'b5',
'b6',
'b7',
'b8',
'b9',
'ba',
'bb',
'bc',
'bd',
'be',
'bf',
'c0',
'c1',
'c2',
'c3',
'c4',
'c5',
'c6',
'c7',
'c8',
'c9',
'ca',
'cb',
'cc',
'cd',
'ce',
'cf',
'd0',
'd1',
'd2',
'd3',
'd4',
'd5',
'd6',
'd7',
'd8',
'd9',
'da',
'db',
'dc',
'dd',
'de',
'df',
'e0',
'e1',
'e2',
'e3',
'e4',
'e5',
'e6',
'e7',
'e8',
'e9',
'ea',
'eb',
'ec',
'ed',
'ee',
'ef',
'f0',
'f1',
'f2',
'f3',
'f4',
'f5',
'f6',
'f7',
'f8',
'f9',
'fa',
'fb',
'fc',
'fd',
'fe',
'ff',
],
Ic = 1234567,
Nc = Math.PI / 180,
Pc = 180 / Math.PI
function Lc() {
var e = (4294967295 * Math.random()) | 0,
t = (4294967295 * Math.random()) | 0,
n = (4294967295 * Math.random()) | 0,
r = (4294967295 * Math.random()) | 0
return (
Rc[255 & e] +
Rc[(e >> 8) & 255] +
Rc[(e >> 16) & 255] +
Rc[(e >> 24) & 255] +
'-' +
Rc[255 & t] +
Rc[(t >> 8) & 255] +
'-' +
Rc[((t >> 16) & 15) | 64] +
Rc[(t >> 24) & 255] +
'-' +
Rc[(63 & n) | 128] +
Rc[(n >> 8) & 255] +
'-' +
Rc[(n >> 16) & 255] +
Rc[(n >> 24) & 255] +
Rc[255 & r] +
Rc[(r >> 8) & 255] +
Rc[(r >> 16) & 255] +
Rc[(r >> 24) & 255]
).toLowerCase()
}
function Dc(e, t, n) {
return Math.max(t, Math.min(n, e))
}
function Oc(e, t) {
return ((e % t) + t) % t
}
function Fc(e, t, n) {
return (1 - n) * e + n * t
}
function Bc(e, t) {
switch (t.constructor) {
case Float32Array:
return e
case Uint32Array:
return e / 4294967295
case Uint16Array:
return e / 65535
case Uint8Array:
return e / 255
case Int32Array:
return Math.max(e / 2147483647, -1)
case Int16Array:
return Math.max(e / 32767, -1)
case Int8Array:
return Math.max(e / 127, -1)
default:
throw new Error('Invalid component type.')
}
}
function Uc(e, t) {
switch (t.constructor) {
case Float32Array:
return e
case Uint32Array:
return Math.round(4294967295 * e)
case Uint16Array:
return Math.round(65535 * e)
case Uint8Array:
return Math.round(255 * e)
case Int32Array:
return Math.round(2147483647 * e)
case Int16Array:
return Math.round(32767 * e)
case Int8Array:
return Math.round(127 * e)
default:
throw new Error('Invalid component type.')
}
}
var zc = {
DEG2RAD: Nc,
RAD2DEG: Pc,
generateUUID: Lc,
clamp: Dc,
euclideanModulo: Oc,
mapLinear: function (e, t, n, r, i) {
return r + ((e - t) * (i - r)) / (n - t)
},
inverseLerp: function (e, t, n) {
return e !== t ? (n - e) / (t - e) : 0
},
lerp: Fc,
damp: function (e, t, n, r) {
return Fc(e, t, 1 - Math.exp(-n * r))
},
pingpong: function (e) {
var t = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : 1
return t - Math.abs(Oc(e, 2 * t) - t)
},
smoothstep: function (e, t, n) {
return e <= t ? 0 : e >= n ? 1 : (e = (e - t) / (n - t)) * e * (3 - 2 * e)
},
smootherstep: function (e, t, n) {
return e <= t
? 0
: e >= n
? 1
: (e = (e - t) / (n - t)) * e * e * (e * (6 * e - 15) + 10)
},
randInt: function (e, t) {
return e + Math.floor(Math.random() * (t - e + 1))
},
randFloat: function (e, t) {
return e + Math.random() * (t - e)
},
randFloatSpread: function (e) {
return e * (0.5 - Math.random())
},
seededRandom: function (e) {
void 0 !== e && (Ic = e)
var t = (Ic += 1831565813)
return (
(t = Math.imul(t ^ (t >>> 15), 1 | t)),
(((t ^= t + Math.imul(t ^ (t >>> 7), 61 | t)) ^ (t >>> 14)) >>> 0) / 4294967296
)
},
degToRad: function (e) {
return e * Nc
},
radToDeg: function (e) {
return e * Pc
},
isPowerOfTwo: function (e) {
return !(e & (e - 1)) && 0 !== e
},
ceilPowerOfTwo: function (e) {
return Math.pow(2, Math.ceil(Math.log(e) / Math.LN2))
},
floorPowerOfTwo: function (e) {
return Math.pow(2, Math.floor(Math.log(e) / Math.LN2))
},
setQuaternionFromProperEuler: function (e, t, n, r, i) {
var a = Math.cos,
o = Math.sin,
s = a(n / 2),
u = o(n / 2),
l = a((t + r) / 2),
c = o((t + r) / 2),
h = a((t - r) / 2),
d = o((t - r) / 2),
f = a((r - t) / 2),
p = o((r - t) / 2)
switch (i) {
case 'XYX':
e.set(s * c, u * h, u * d, s * l)
break
case 'YZY':
e.set(u * d, s * c, u * h, s * l)
break
case 'ZXZ':
e.set(u * h, u * d, s * c, s * l)
break
case 'XZX':
e.set(s * c, u * p, u * f, s * l)
break
case 'YXY':
e.set(u * f, s * c, u * p, s * l)
break
case 'ZYZ':
e.set(u * p, u * f, s * c, s * l)
break
default:
console.warn(
'THREE.MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: ' +
i
)
}
},
normalize: Uc,
denormalize: Bc,
},
Vc = (function () {
return T(
function e() {
var t = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : 0,
n = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : 0
;(A(this, e), (e.prototype.isVector2 = !0), (this.x = t), (this.y = n))
},
[
{
key: 'width',
get: function () {
return this.x
},
set: function (e) {
this.x = e
},
},
{
key: 'height',
get: function () {
return this.y
},
set: function (e) {
this.y = e
},
},
{
key: 'set',
value: function (e, t) {
return ((this.x = e), (this.y = t), this)
},
},
{
key: 'setScalar',
value: function (e) {
return ((this.x = e), (this.y = e), this)
},
},
{
key: 'setX',
value: function (e) {
return ((this.x = e), this)
},
},
{
key: 'setY',
value: function (e) {
return ((this.y = e), this)
},
},
{
key: 'setComponent',
value: function (e, t) {
switch (e) {
case 0:
this.x = t
break
case 1:
this.y = t
break
default:
throw new Error('index is out of range: ' + e)
}
return this
},
},
{
key: 'getComponent',
value: function (e) {
switch (e) {
case 0:
return this.x
case 1:
return this.y
default:
throw new Error('index is out of range: ' + e)
}
},
},
{
key: 'clone',
value: function () {
return new this.constructor(this.x, this.y)
},
},
{
key: 'copy',
value: function (e) {
return ((this.x = e.x), (this.y = e.y), this)
},
},
{
key: 'add',
value: function (e) {
return ((this.x += e.x), (this.y += e.y), this)
},
},
{
key: 'addScalar',
value: function (e) {
return ((this.x += e), (this.y += e), this)
},
},
{
key: 'addVectors',
value: function (e, t) {
return ((this.x = e.x + t.x), (this.y = e.y + t.y), this)
},
},
{
key: 'addScaledVector',
value: function (e, t) {
return ((this.x += e.x * t), (this.y += e.y * t), this)
},
},
{
key: 'sub',
value: function (e) {
return ((this.x -= e.x), (this.y -= e.y), this)
},
},
{
key: 'subScalar',
value: function (e) {
return ((this.x -= e), (this.y -= e), this)
},
},
{
key: 'subVectors',
value: function (e, t) {
return ((this.x = e.x - t.x), (this.y = e.y - t.y), this)
},
},
{
key: 'multiply',
value: function (e) {
return ((this.x *= e.x), (this.y *= e.y), this)
},
},
{
key: 'multiplyScalar',
value: function (e) {
return ((this.x *= e), (this.y *= e), this)
},
},
{
key: 'divide',
value: function (e) {
return ((this.x /= e.x), (this.y /= e.y), this)
},
},
{
key: 'divideScalar',
value: function (e) {
return this.multiplyScalar(1 / e)
},
},
{
key: 'applyMatrix3',
value: function (e) {
var t = this.x,
n = this.y,
r = e.elements
return (
(this.x = r[0] * t + r[3] * n + r[6]),
(this.y = r[1] * t + r[4] * n + r[7]),
this
)
},
},
{
key: 'min',
value: function (e) {
return (
(this.x = Math.min(this.x, e.x)),
(this.y = Math.min(this.y, e.y)),
this
)
},
},
{
key: 'max',
value: function (e) {
return (
(this.x = Math.max(this.x, e.x)),
(this.y = Math.max(this.y, e.y)),
this
)
},
},
{
key: 'clamp',
value: function (e, t) {
return (
(this.x = Dc(this.x, e.x, t.x)),
(this.y = Dc(this.y, e.y, t.y)),
this
)
},
},
{
key: 'clampScalar',
value: function (e, t) {
return ((this.x = Dc(this.x, e, t)), (this.y = Dc(this.y, e, t)), this)
},
},
{
key: 'clampLength',
value: function (e, t) {
var n = this.length()
return this.divideScalar(n || 1).multiplyScalar(Dc(n, e, t))
},
},
{
key: 'floor',
value: function () {
return ((this.x = Math.floor(this.x)), (this.y = Math.floor(this.y)), this)
},
},
{
key: 'ceil',
value: function () {
return ((this.x = Math.ceil(this.x)), (this.y = Math.ceil(this.y)), this)
},
},
{
key: 'round',
value: function () {
return ((this.x = Math.round(this.x)), (this.y = Math.round(this.y)), this)
},
},
{
key: 'roundToZero',
value: function () {
return ((this.x = Math.trunc(this.x)), (this.y = Math.trunc(this.y)), this)
},
},
{
key: 'negate',
value: function () {
return ((this.x = -this.x), (this.y = -this.y), this)
},
},
{
key: 'dot',
value: function (e) {
return this.x * e.x + this.y * e.y
},
},
{
key: 'cross',
value: function (e) {
return this.x * e.y - this.y * e.x
},
},
{
key: 'lengthSq',
value: function () {
return this.x * this.x + this.y * this.y
},
},
{
key: 'length',
value: function () {
return Math.sqrt(this.x * this.x + this.y * this.y)
},
},
{
key: 'manhattanLength',
value: function () {
return Math.abs(this.x) + Math.abs(this.y)
},
},
{
key: 'normalize',
value: function () {
return this.divideScalar(this.length() || 1)
},
},
{
key: 'angle',
value: function () {
var e = Math.atan2(-this.y, -this.x) + Math.PI
return e
},
},
{
key: 'angleTo',
value: function (e) {
var t = Math.sqrt(this.lengthSq() * e.lengthSq())
if (0 === t) return Math.PI / 2
var n = this.dot(e) / t
return Math.acos(Dc(n, -1, 1))
},
},
{
key: 'distanceTo',
value: function (e) {
return Math.sqrt(this.distanceToSquared(e))
},
},
{
key: 'distanceToSquared',
value: function (e) {
var t = this.x - e.x,
n = this.y - e.y
return t * t + n * n
},
},
{
key: 'manhattanDistanceTo',
value: function (e) {
return Math.abs(this.x - e.x) + Math.abs(this.y - e.y)
},
},
{
key: 'setLength',
value: function (e) {
return this.normalize().multiplyScalar(e)
},
},
{
key: 'lerp',
value: function (e, t) {
return ((this.x += (e.x - this.x) * t), (this.y += (e.y - this.y) * t), this)
},
},
{
key: 'lerpVectors',
value: function (e, t, n) {
return (
(this.x = e.x + (t.x - e.x) * n),
(this.y = e.y + (t.y - e.y) * n),
this
)
},
},
{
key: 'equals',
value: function (e) {
return e.x === this.x && e.y === this.y
},
},
{
key: 'fromArray',
value: function (e) {
var t = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : 0
return ((this.x = e[t]), (this.y = e[t + 1]), this)
},
},
{
key: 'toArray',
value: function () {
var e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : [],
t = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : 0
return ((e[t] = this.x), (e[t + 1] = this.y), e)
},
},
{
key: 'fromBufferAttribute',
value: function (e, t) {
return ((this.x = e.getX(t)), (this.y = e.getY(t)), this)
},
},
{
key: 'rotateAround',
value: function (e, t) {
var n = Math.cos(t),
r = Math.sin(t),
i = this.x - e.x,
a = this.y - e.y
return ((this.x = i * n - a * r + e.x), (this.y = i * r + a * n + e.y), this)
},
},
{
key: 'random',
value: function () {
return ((this.x = Math.random()), (this.y = Math.random()), this)
},
},
{
key: Symbol.iterator,
value: d().m(function e() {
return d().w(
function (e) {
for (;;)
switch (e.n) {
case 0:
return ((e.n = 1), this.x)
case 1:
return ((e.n = 2), this.y)
case 2:
return e.a(2)
}
},
e,
this
)
}),
},
]
)
})(),
Hc = (function () {
return T(
function e(t, n, r, i, a, o, s, u, l) {
;(A(this, e),
(e.prototype.isMatrix3 = !0),
(this.elements = [1, 0, 0, 0, 1, 0, 0, 0, 1]),
void 0 !== t && this.set(t, n, r, i, a, o, s, u, l))
},
[
{
key: 'set',
value: function (e, t, n, r, i, a, o, s, u) {
var l = this.elements
return (
(l[0] = e),
(l[1] = r),
(l[2] = o),
(l[3] = t),
(l[4] = i),
(l[5] = s),
(l[6] = n),
(l[7] = a),
(l[8] = u),
this
)
},
},
{
key: 'identity',
value: function () {
return (this.set(1, 0, 0, 0, 1, 0, 0, 0, 1), this)
},
},
{
key: 'copy',
value: function (e) {
var t = this.elements,
n = e.elements
return (
(t[0] = n[0]),
(t[1] = n[1]),
(t[2] = n[2]),
(t[3] = n[3]),
(t[4] = n[4]),
(t[5] = n[5]),
(t[6] = n[6]),
(t[7] = n[7]),
(t[8] = n[8]),
this
)
},
},
{
key: 'extractBasis',
value: function (e, t, n) {
return (
e.setFromMatrix3Column(this, 0),
t.setFromMatrix3Column(this, 1),
n.setFromMatrix3Column(this, 2),
this
)
},
},
{
key: 'setFromMatrix4',
value: function (e) {
var t = e.elements
return (this.set(t[0], t[4], t[8], t[1], t[5], t[9], t[2], t[6], t[10]), this)
},
},
{
key: 'multiply',
value: function (e) {
return this.multiplyMatrices(this, e)
},
},
{
key: 'premultiply',
value: function (e) {
return this.multiplyMatrices(e, this)
},
},
{
key: 'multiplyMatrices',
value: function (e, t) {
var n = e.elements,
r = t.elements,
i = this.elements,
a = n[0],
o = n[3],
s = n[6],
u = n[1],
l = n[4],
c = n[7],
h = n[2],
d = n[5],
f = n[8],
p = r[0],
v = r[3],
m = r[6],
g = r[1],
y = r[4],
_ = r[7],
b = r[2],
x = r[5],
S = r[8]
return (
(i[0] = a * p + o * g + s * b),
(i[3] = a * v + o * y + s * x),
(i[6] = a * m + o * _ + s * S),
(i[1] = u * p + l * g + c * b),
(i[4] = u * v + l * y + c * x),
(i[7] = u * m + l * _ + c * S),
(i[2] = h * p + d * g + f * b),
(i[5] = h * v + d * y + f * x),
(i[8] = h * m + d * _ + f * S),
this
)
},
},
{
key: 'multiplyScalar',
value: function (e) {
var t = this.elements
return (
(t[0] *= e),
(t[3] *= e),
(t[6] *= e),
(t[1] *= e),
(t[4] *= e),
(t[7] *= e),
(t[2] *= e),
(t[5] *= e),
(t[8] *= e),
this
)
},
},
{
key: 'determinant',
value: function () {
var e = this.elements,
t = e[0],
n = e[1],
r = e[2],
i = e[3],
a = e[4],
o = e[5],
s = e[6],
u = e[7],
l = e[8]
return t * a * l - t * o * u - n * i * l + n * o * s + r * i * u - r * a * s
},
},
{
key: 'invert',
value: function () {
var e = this.elements,
t = e[0],
n = e[1],
r = e[2],
i = e[3],
a = e[4],
o = e[5],
s = e[6],
u = e[7],
l = e[8],
c = l * a - o * u,
h = o * s - l * i,
d = u * i - a * s,
f = t * c + n * h + r * d
if (0 === f) return this.set(0, 0, 0, 0, 0, 0, 0, 0, 0)
var p = 1 / f
return (
(e[0] = c * p),
(e[1] = (r * u - l * n) * p),
(e[2] = (o * n - r * a) * p),
(e[3] = h * p),
(e[4] = (l * t - r * s) * p),
(e[5] = (r * i - o * t) * p),
(e[6] = d * p),
(e[7] = (n * s - u * t) * p),
(e[8] = (a * t - n * i) * p),
this
)
},
},
{
key: 'transpose',
value: function () {
var e,
t = this.elements
return (
(e = t[1]),
(t[1] = t[3]),
(t[3] = e),
(e = t[2]),
(t[2] = t[6]),
(t[6] = e),
(e = t[5]),
(t[5] = t[7]),
(t[7] = e),
this
)
},
},
{
key: 'getNormalMatrix',
value: function (e) {
return this.setFromMatrix4(e).invert().transpose()
},
},
{
key: 'transposeIntoArray',
value: function (e) {
var t = this.elements
return (
(e[0] = t[0]),
(e[1] = t[3]),
(e[2] = t[6]),
(e[3] = t[1]),
(e[4] = t[4]),
(e[5] = t[7]),
(e[6] = t[2]),
(e[7] = t[5]),
(e[8] = t[8]),
this
)
},
},
{
key: 'setUvTransform',
value: function (e, t, n, r, i, a, o) {
var s = Math.cos(i),
u = Math.sin(i)
return (
this.set(
n * s,
n * u,
-n * (s * a + u * o) + a + e,
-r * u,
r * s,
-r * (-u * a + s * o) + o + t,
0,
0,
1
),
this
)
},
},
{
key: 'scale',
value: function (e, t) {
return (this.premultiply(Wc.makeScale(e, t)), this)
},
},
{
key: 'rotate',
value: function (e) {
return (this.premultiply(Wc.makeRotation(-e)), this)
},
},
{
key: 'translate',
value: function (e, t) {
return (this.premultiply(Wc.makeTranslation(e, t)), this)
},
},
{
key: 'makeTranslation',
value: function (e, t) {
return (
e.isVector2
? this.set(1, 0, e.x, 0, 1, e.y, 0, 0, 1)
: this.set(1, 0, e, 0, 1, t, 0, 0, 1),
this
)
},
},
{
key: 'makeRotation',
value: function (e) {
var t = Math.cos(e),
n = Math.sin(e)
return (this.set(t, -n, 0, n, t, 0, 0, 0, 1), this)
},
},
{
key: 'makeScale',
value: function (e, t) {
return (this.set(e, 0, 0, 0, t, 0, 0, 0, 1), this)
},
},
{
key: 'equals',
value: function (e) {
for (var t = this.elements, n = e.elements, r = 0; r < 9; r++)
if (t[r] !== n[r]) return !1
return !0
},
},
{
key: 'fromArray',
value: function (e) {
for (
var t = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : 0,
n = 0;
n < 9;
n++
)
this.elements[n] = e[n + t]
return this
},
},
{
key: 'toArray',
value: function () {
var e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : [],
t = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : 0,
n = this.elements
return (
(e[t] = n[0]),
(e[t + 1] = n[1]),
(e[t + 2] = n[2]),
(e[t + 3] = n[3]),
(e[t + 4] = n[4]),
(e[t + 5] = n[5]),
(e[t + 6] = n[6]),
(e[t + 7] = n[7]),
(e[t + 8] = n[8]),
e
)
},
},
{
key: 'clone',
value: function () {
return new this.constructor().fromArray(this.elements)
},
},
]
)
})(),
Wc = new Hc()
function Gc(e) {
for (var t = e.length - 1; t >= 0; --t) if (e[t] >= 65535) return !0
return !1
}
function jc(e) {
return document.createElementNS('http://www.w3.org/1999/xhtml', e)
}
var Qc = {}
function qc(e) {
e in Qc || ((Qc[e] = !0), console.warn(e))
}
function Xc(e, t, n) {
return new Promise(function (r, i) {
setTimeout(function a() {
switch (e.clientWaitSync(t, e.SYNC_FLUSH_COMMANDS_BIT, 0)) {
case e.WAIT_FAILED:
i()
break
case e.TIMEOUT_EXPIRED:
setTimeout(a, n)
break
default:
r()
}
}, n)
})
}
var Yc = new Hc().set(
0.4123908,
0.3575843,
0.1804808,
0.212639,
0.7151687,
0.0721923,
0.0193308,
0.1191948,
0.9505322
),
Kc = new Hc().set(
3.2409699,
-1.5373832,
-0.4986108,
-0.9692436,
1.8759675,
0.0415551,
0.0556301,
-0.203977,
1.0569715
)
function Zc() {
var e = {
enabled: !0,
workingColorSpace: bc,
spaces: {},
convert: function (e, t, n) {
return !1 !== this.enabled && t !== n && t && n
? (this.spaces[t].transfer === Sc &&
((e.r = eh(e.r)), (e.g = eh(e.g)), (e.b = eh(e.b))),
this.spaces[t].primaries !== this.spaces[n].primaries &&
(e.applyMatrix3(this.spaces[t].toXYZ),
e.applyMatrix3(this.spaces[n].fromXYZ)),
this.spaces[n].transfer === Sc &&
((e.r = th(e.r)), (e.g = th(e.g)), (e.b = th(e.b))),
e)
: e
},
fromWorkingColorSpace: function (e, t) {
return this.convert(e, this.workingColorSpace, t)
},
toWorkingColorSpace: function (e, t) {
return this.convert(e, t, this.workingColorSpace)
},
getPrimaries: function (e) {
return this.spaces[e].primaries
},
getTransfer: function (e) {
return e === yc ? xc : this.spaces[e].transfer
},
getLuminanceCoefficients: function (e) {
var t =
arguments.length > 1 && void 0 !== arguments[1]
? arguments[1]
: this.workingColorSpace
return e.fromArray(this.spaces[t].luminanceCoefficients)
},
define: function (e) {
Object.assign(this.spaces, e)
},
_getMatrix: function (e, t, n) {
return e.copy(this.spaces[t].toXYZ).multiply(this.spaces[n].fromXYZ)
},
_getDrawingBufferColorSpace: function (e) {
return this.spaces[e].outputColorSpaceConfig.drawingBufferColorSpace
},
_getUnpackColorSpace: function () {
var e =
arguments.length > 0 && void 0 !== arguments[0]
? arguments[0]
: this.workingColorSpace
return this.spaces[e].workingColorSpaceConfig.unpackColorSpace
},
},
t = [0.64, 0.33, 0.3, 0.6, 0.15, 0.06],
n = [0.2126, 0.7152, 0.0722],
r = [0.3127, 0.329]
return (
e.define(
M(
M({}, bc, {
primaries: t,
whitePoint: r,
transfer: xc,
toXYZ: Yc,
fromXYZ: Kc,
luminanceCoefficients: n,
workingColorSpaceConfig: { unpackColorSpace: _c },
outputColorSpaceConfig: { drawingBufferColorSpace: _c },
}),
_c,
{
primaries: t,
whitePoint: r,
transfer: Sc,
toXYZ: Yc,
fromXYZ: Kc,
luminanceCoefficients: n,
outputColorSpaceConfig: { drawingBufferColorSpace: _c },
}
)
),
e
)
}
var Jc,
$c = Zc()
function eh(e) {
return e < 0.04045 ? 0.0773993808 * e : Math.pow(0.9478672986 * e + 0.0521327014, 2.4)
}
function th(e) {
return e < 0.0031308 ? 12.92 * e : 1.055 * Math.pow(e, 0.41666) - 0.055
}
var nh = (function () {
return T(
function e() {
A(this, e)
},
null,
[
{
key: 'getDataURL',
value: function (e) {
if (/^data:/i.test(e.src)) return e.src
if ('undefined' == typeof HTMLCanvasElement) return e.src
var t
if (e instanceof HTMLCanvasElement) t = e
else {
;(void 0 === Jc && (Jc = jc('canvas')),
(Jc.width = e.width),
(Jc.height = e.height))
var n = Jc.getContext('2d')
;(e instanceof ImageData
? n.putImageData(e, 0, 0)
: n.drawImage(e, 0, 0, e.width, e.height),
(t = Jc))
}
return t.toDataURL('image/png')
},
},
{
key: 'sRGBToLinear',
value: function (e) {
if (
('undefined' != typeof HTMLImageElement && e instanceof HTMLImageElement) ||
('undefined' != typeof HTMLCanvasElement &&
e instanceof HTMLCanvasElement) ||
('undefined' != typeof ImageBitmap && e instanceof ImageBitmap)
) {
var t = jc('canvas')
;((t.width = e.width), (t.height = e.height))
var n = t.getContext('2d')
n.drawImage(e, 0, 0, e.width, e.height)
for (
var r = n.getImageData(0, 0, e.width, e.height), i = r.data, a = 0;
a < i.length;
a++
)
i[a] = 255 * eh(i[a] / 255)
return (n.putImageData(r, 0, 0), t)
}
if (e.data) {
for (var o = e.data.slice(0), s = 0; s < o.length; s++)
o instanceof Uint8Array || o instanceof Uint8ClampedArray
? (o[s] = Math.floor(255 * eh(o[s] / 255)))
: (o[s] = eh(o[s]))
return { data: o, width: e.width, height: e.height }
}
return (
console.warn(
'THREE.ImageUtils.sRGBToLinear(): Unsupported image type. No color space conversion applied.'
),
e
)
},
},
]
)
})(),
rh = 0,
ih = (function () {
return T(
function e() {
var t = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : null
;(A(this, e),
(this.isSource = !0),
Object.defineProperty(this, 'id', { value: rh++ }),
(this.uuid = Lc()),
(this.data = t),
(this.dataReady = !0),
(this.version = 0))
},
[
{
key: 'needsUpdate',
set: function (e) {
!0 === e && this.version++
},
},
{
key: 'toJSON',
value: function (e) {
var t = void 0 === e || 'string' == typeof e
if (!t && void 0 !== e.images[this.uuid]) return e.images[this.uuid]
var n = { uuid: this.uuid, url: '' },
r = this.data
if (null !== r) {
var i
if (Array.isArray(r)) {
i = []
for (var a = 0, o = r.length; a < o; a++)
r[a].isDataTexture ? i.push(ah(r[a].image)) : i.push(ah(r[a]))
} else i = ah(r)
n.url = i
}
return (t || (e.images[this.uuid] = n), n)
},
},
]
)
})()
function ah(e) {
return ('undefined' != typeof HTMLImageElement && e instanceof HTMLImageElement) ||
('undefined' != typeof HTMLCanvasElement && e instanceof HTMLCanvasElement) ||
('undefined' != typeof ImageBitmap && e instanceof ImageBitmap)
? nh.getDataURL(e)
: e.data
? {
data: Array.from(e.data),
width: e.width,
height: e.height,
type: e.data.constructor.name,
}
: (console.warn('THREE.Texture: Unable to serialize Texture.'), {})
}
var oh = 0,
sh = (function (e) {
function t() {
var e,
n =
arguments.length > 0 && void 0 !== arguments[0]
? arguments[0]
: t.DEFAULT_IMAGE,
r =
arguments.length > 1 && void 0 !== arguments[1]
? arguments[1]
: t.DEFAULT_MAPPING,
i = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : al,
a = arguments.length > 3 && void 0 !== arguments[3] ? arguments[3] : al,
o = arguments.length > 4 && void 0 !== arguments[4] ? arguments[4] : ll,
s = arguments.length > 5 && void 0 !== arguments[5] ? arguments[5] : hl,
u = arguments.length > 6 && void 0 !== arguments[6] ? arguments[6] : wl,
l = arguments.length > 7 && void 0 !== arguments[7] ? arguments[7] : dl,
c =
arguments.length > 8 && void 0 !== arguments[8]
? arguments[8]
: t.DEFAULT_ANISOTROPY,
h = arguments.length > 9 && void 0 !== arguments[9] ? arguments[9] : yc
return (
A(this, t),
((e = y(this, t)).isTexture = !0),
Object.defineProperty(e, 'id', { value: oh++ }),
(e.uuid = Lc()),
(e.name = ''),
(e.source = new ih(n)),
(e.mipmaps = []),
(e.mapping = r),
(e.channel = 0),
(e.wrapS = i),
(e.wrapT = a),
(e.magFilter = o),
(e.minFilter = s),
(e.anisotropy = c),
(e.format = u),
(e.internalFormat = null),
(e.type = l),
(e.offset = new Vc(0, 0)),
(e.repeat = new Vc(1, 1)),
(e.center = new Vc(0, 0)),
(e.rotation = 0),
(e.matrixAutoUpdate = !0),
(e.matrix = new Hc()),
(e.generateMipmaps = !0),
(e.premultiplyAlpha = !1),
(e.flipY = !0),
(e.unpackAlignment = 4),
(e.colorSpace = h),
(e.userData = {}),
(e.version = 0),
(e.onUpdate = null),
(e.renderTarget = null),
(e.isRenderTargetTexture = !1),
(e.pmremVersion = 0),
e
)
}
return (
x(t, e),
T(t, [
{
key: 'image',
get: function () {
return this.source.data
},
set: function () {
var e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : null
this.source.data = e
},
},
{
key: 'updateMatrix',
value: function () {
this.matrix.setUvTransform(
this.offset.x,
this.offset.y,
this.repeat.x,
this.repeat.y,
this.rotation,
this.center.x,
this.center.y
)
},
},
{
key: 'clone',
value: function () {
return new this.constructor().copy(this)
},
},
{
key: 'copy',
value: function (e) {
return (
(this.name = e.name),
(this.source = e.source),
(this.mipmaps = e.mipmaps.slice(0)),
(this.mapping = e.mapping),
(this.channel = e.channel),
(this.wrapS = e.wrapS),
(this.wrapT = e.wrapT),
(this.magFilter = e.magFilter),
(this.minFilter = e.minFilter),
(this.anisotropy = e.anisotropy),
(this.format = e.format),
(this.internalFormat = e.internalFormat),
(this.type = e.type),
this.offset.copy(e.offset),
this.repeat.copy(e.repeat),
this.center.copy(e.center),
(this.rotation = e.rotation),
(this.matrixAutoUpdate = e.matrixAutoUpdate),
this.matrix.copy(e.matrix),
(this.generateMipmaps = e.generateMipmaps),
(this.premultiplyAlpha = e.premultiplyAlpha),
(this.flipY = e.flipY),
(this.unpackAlignment = e.unpackAlignment),
(this.colorSpace = e.colorSpace),
(this.renderTarget = e.renderTarget),
(this.isRenderTargetTexture = e.isRenderTargetTexture),
(this.userData = JSON.parse(JSON.stringify(e.userData))),
(this.needsUpdate = !0),
this
)
},
},
{
key: 'toJSON',
value: function (e) {
var t = void 0 === e || 'string' == typeof e
if (!t && void 0 !== e.textures[this.uuid]) return e.textures[this.uuid]
var n = {
metadata: { version: 4.6, type: 'Texture', generator: 'Texture.toJSON' },
uuid: this.uuid,
name: this.name,
image: this.source.toJSON(e).uuid,
mapping: this.mapping,
channel: this.channel,
repeat: [this.repeat.x, this.repeat.y],
offset: [this.offset.x, this.offset.y],
center: [this.center.x, this.center.y],
rotation: this.rotation,
wrap: [this.wrapS, this.wrapT],
format: this.format,
internalFormat: this.internalFormat,
type: this.type,
colorSpace: this.colorSpace,
minFilter: this.minFilter,
magFilter: this.magFilter,
anisotropy: this.anisotropy,
flipY: this.flipY,
generateMipmaps: this.generateMipmaps,
premultiplyAlpha: this.premultiplyAlpha,
unpackAlignment: this.unpackAlignment,
}
return (
Object.keys(this.userData).length > 0 && (n.userData = this.userData),
t || (e.textures[this.uuid] = n),
n
)
},
},
{
key: 'dispose',
value: function () {
this.dispatchEvent({ type: 'dispose' })
},
},
{
key: 'transformUv',
value: function (e) {
if (300 !== this.mapping) return e
if ((e.applyMatrix3(this.matrix), e.x < 0 || e.x > 1))
switch (this.wrapS) {
case il:
e.x = e.x - Math.floor(e.x)
break
case al:
e.x = e.x < 0 ? 0 : 1
break
case ol:
1 === Math.abs(Math.floor(e.x) % 2)
? (e.x = Math.ceil(e.x) - e.x)
: (e.x = e.x - Math.floor(e.x))
}
if (e.y < 0 || e.y > 1)
switch (this.wrapT) {
case il:
e.y = e.y - Math.floor(e.y)
break
case al:
e.y = e.y < 0 ? 0 : 1
break
case ol:
1 === Math.abs(Math.floor(e.y) % 2)
? (e.y = Math.ceil(e.y) - e.y)
: (e.y = e.y - Math.floor(e.y))
}
return (this.flipY && (e.y = 1 - e.y), e)
},
},
{
key: 'needsUpdate',
set: function (e) {
!0 === e && (this.version++, (this.source.needsUpdate = !0))
},
},
{
key: 'needsPMREMUpdate',
set: function (e) {
!0 === e && this.pmremVersion++
},
},
])
)
})(kc)
;((sh.DEFAULT_IMAGE = null), (sh.DEFAULT_MAPPING = 300), (sh.DEFAULT_ANISOTROPY = 1))
var uh = (function () {
return T(
function e() {
var t = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : 0,
n = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : 0,
r = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : 0,
i = arguments.length > 3 && void 0 !== arguments[3] ? arguments[3] : 1
;(A(this, e),
(e.prototype.isVector4 = !0),
(this.x = t),
(this.y = n),
(this.z = r),
(this.w = i))
},
[
{
key: 'width',
get: function () {
return this.z
},
set: function (e) {
this.z = e
},
},
{
key: 'height',
get: function () {
return this.w
},
set: function (e) {
this.w = e
},
},
{
key: 'set',
value: function (e, t, n, r) {
return ((this.x = e), (this.y = t), (this.z = n), (this.w = r), this)
},
},
{
key: 'setScalar',
value: function (e) {
return ((this.x = e), (this.y = e), (this.z = e), (this.w = e), this)
},
},
{
key: 'setX',
value: function (e) {
return ((this.x = e), this)
},
},
{
key: 'setY',
value: function (e) {
return ((this.y = e), this)
},
},
{
key: 'setZ',
value: function (e) {
return ((this.z = e), this)
},
},
{
key: 'setW',
value: function (e) {
return ((this.w = e), this)
},
},
{
key: 'setComponent',
value: function (e, t) {
switch (e) {
case 0:
this.x = t
break
case 1:
this.y = t
break
case 2:
this.z = t
break
case 3:
this.w = t
break
default:
throw new Error('index is out of range: ' + e)
}
return this
},
},
{
key: 'getComponent',
value: function (e) {
switch (e) {
case 0:
return this.x
case 1:
return this.y
case 2:
return this.z
case 3:
return this.w
default:
throw new Error('index is out of range: ' + e)
}
},
},
{
key: 'clone',
value: function () {
return new this.constructor(this.x, this.y, this.z, this.w)
},
},
{
key: 'copy',
value: function (e) {
return (
(this.x = e.x),
(this.y = e.y),
(this.z = e.z),
(this.w = void 0 !== e.w ? e.w : 1),
this
)
},
},
{
key: 'add',
value: function (e) {
return (
(this.x += e.x),
(this.y += e.y),
(this.z += e.z),
(this.w += e.w),
this
)
},
},
{
key: 'addScalar',
value: function (e) {
return ((this.x += e), (this.y += e), (this.z += e), (this.w += e), this)
},
},
{
key: 'addVectors',
value: function (e, t) {
return (
(this.x = e.x + t.x),
(this.y = e.y + t.y),
(this.z = e.z + t.z),
(this.w = e.w + t.w),
this
)
},
},
{
key: 'addScaledVector',
value: function (e, t) {
return (
(this.x += e.x * t),
(this.y += e.y * t),
(this.z += e.z * t),
(this.w += e.w * t),
this
)
},
},
{
key: 'sub',
value: function (e) {
return (
(this.x -= e.x),
(this.y -= e.y),
(this.z -= e.z),
(this.w -= e.w),
this
)
},
},
{
key: 'subScalar',
value: function (e) {
return ((this.x -= e), (this.y -= e), (this.z -= e), (this.w -= e), this)
},
},
{
key: 'subVectors',
value: function (e, t) {
return (
(this.x = e.x - t.x),
(this.y = e.y - t.y),
(this.z = e.z - t.z),
(this.w = e.w - t.w),
this
)
},
},
{
key: 'multiply',
value: function (e) {
return (
(this.x *= e.x),
(this.y *= e.y),
(this.z *= e.z),
(this.w *= e.w),
this
)
},
},
{
key: 'multiplyScalar',
value: function (e) {
return ((this.x *= e), (this.y *= e), (this.z *= e), (this.w *= e), this)
},
},
{
key: 'applyMatrix4',
value: function (e) {
var t = this.x,
n = this.y,
r = this.z,
i = this.w,
a = e.elements
return (
(this.x = a[0] * t + a[4] * n + a[8] * r + a[12] * i),
(this.y = a[1] * t + a[5] * n + a[9] * r + a[13] * i),
(this.z = a[2] * t + a[6] * n + a[10] * r + a[14] * i),
(this.w = a[3] * t + a[7] * n + a[11] * r + a[15] * i),
this
)
},
},
{
key: 'divide',
value: function (e) {
return (
(this.x /= e.x),
(this.y /= e.y),
(this.z /= e.z),
(this.w /= e.w),
this
)
},
},
{
key: 'divideScalar',
value: function (e) {
return this.multiplyScalar(1 / e)
},
},
{
key: 'setAxisAngleFromQuaternion',
value: function (e) {
this.w = 2 * Math.acos(e.w)
var t = Math.sqrt(1 - e.w * e.w)
return (
t < 1e-4
? ((this.x = 1), (this.y = 0), (this.z = 0))
: ((this.x = e.x / t), (this.y = e.y / t), (this.z = e.z / t)),
this
)
},
},
{
key: 'setAxisAngleFromRotationMatrix',
value: function (e) {
var t,
n,
r,
i,
a = 0.01,
o = 0.1,
s = e.elements,
u = s[0],
l = s[4],
c = s[8],
h = s[1],
d = s[5],
f = s[9],
p = s[2],
v = s[6],
m = s[10]
if (Math.abs(l - h) < a && Math.abs(c - p) < a && Math.abs(f - v) < a) {
if (
Math.abs(l + h) < o &&
Math.abs(c + p) < o &&
Math.abs(f + v) < o &&
Math.abs(u + d + m - 3) < o
)
return (this.set(1, 0, 0, 0), this)
t = Math.PI
var g = (u + 1) / 2,
y = (d + 1) / 2,
_ = (m + 1) / 2,
b = (l + h) / 4,
x = (c + p) / 4,
S = (f + v) / 4
return (
g > y && g > _
? g < a
? ((n = 0), (r = 0.707106781), (i = 0.707106781))
: ((r = b / (n = Math.sqrt(g))), (i = x / n))
: y > _
? y < a
? ((n = 0.707106781), (r = 0), (i = 0.707106781))
: ((n = b / (r = Math.sqrt(y))), (i = S / r))
: _ < a
? ((n = 0.707106781), (r = 0.707106781), (i = 0))
: ((n = x / (i = Math.sqrt(_))), (r = S / i)),
this.set(n, r, i, t),
this
)
}
var A = Math.sqrt((v - f) * (v - f) + (c - p) * (c - p) + (h - l) * (h - l))
return (
Math.abs(A) < 0.001 && (A = 1),
(this.x = (v - f) / A),
(this.y = (c - p) / A),
(this.z = (h - l) / A),
(this.w = Math.acos((u + d + m - 1) / 2)),
this
)
},
},
{
key: 'setFromMatrixPosition',
value: function (e) {
var t = e.elements
return (
(this.x = t[12]),
(this.y = t[13]),
(this.z = t[14]),
(this.w = t[15]),
this
)
},
},
{
key: 'min',
value: function (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
)
},
},
{
key: 'max',
value: function (e) {
return (
(this.x = Math.max(this.x, e.x)),
(this.y = Math.max(this.y, e.y)),
(this.z = Math.max(this.z, e.z)),
(this.w = Math.max(this.w, e.w)),
this
)
},
},
{
key: 'clamp',
value: function (e, t) {
return (
(this.x = Dc(this.x, e.x, t.x)),
(this.y = Dc(this.y, e.y, t.y)),
(this.z = Dc(this.z, e.z, t.z)),
(this.w = Dc(this.w, e.w, t.w)),
this
)
},
},
{
key: 'clampScalar',
value: function (e, t) {
return (
(this.x = Dc(this.x, e, t)),
(this.y = Dc(this.y, e, t)),
(this.z = Dc(this.z, e, t)),
(this.w = Dc(this.w, e, t)),
this
)
},
},
{
key: 'clampLength',
value: function (e, t) {
var n = this.length()
return this.divideScalar(n || 1).multiplyScalar(Dc(n, e, t))
},
},
{
key: 'floor',
value: function () {
return (
(this.x = Math.floor(this.x)),
(this.y = Math.floor(this.y)),
(this.z = Math.floor(this.z)),
(this.w = Math.floor(this.w)),
this
)
},
},
{
key: 'ceil',
value: function () {
return (
(this.x = Math.ceil(this.x)),
(this.y = Math.ceil(this.y)),
(this.z = Math.ceil(this.z)),
(this.w = Math.ceil(this.w)),
this
)
},
},
{
key: 'round',
value: function () {
return (
(this.x = Math.round(this.x)),
(this.y = Math.round(this.y)),
(this.z = Math.round(this.z)),
(this.w = Math.round(this.w)),
this
)
},
},
{
key: 'roundToZero',
value: function () {
return (
(this.x = Math.trunc(this.x)),
(this.y = Math.trunc(this.y)),
(this.z = Math.trunc(this.z)),
(this.w = Math.trunc(this.w)),
this
)
},
},
{
key: 'negate',
value: function () {
return (
(this.x = -this.x),
(this.y = -this.y),
(this.z = -this.z),
(this.w = -this.w),
this
)
},
},
{
key: 'dot',
value: function (e) {
return this.x * e.x + this.y * e.y + this.z * e.z + this.w * e.w
},
},
{
key: 'lengthSq',
value: function () {
return this.x * this.x + this.y * this.y + this.z * this.z + this.w * this.w
},
},
{
key: 'length',
value: function () {
return Math.sqrt(
this.x * this.x + this.y * this.y + this.z * this.z + this.w * this.w
)
},
},
{
key: 'manhattanLength',
value: function () {
return (
Math.abs(this.x) + Math.abs(this.y) + Math.abs(this.z) + Math.abs(this.w)
)
},
},
{
key: 'normalize',
value: function () {
return this.divideScalar(this.length() || 1)
},
},
{
key: 'setLength',
value: function (e) {
return this.normalize().multiplyScalar(e)
},
},
{
key: 'lerp',
value: function (e, t) {
return (
(this.x += (e.x - this.x) * t),
(this.y += (e.y - this.y) * t),
(this.z += (e.z - this.z) * t),
(this.w += (e.w - this.w) * t),
this
)
},
},
{
key: 'lerpVectors',
value: function (e, t, n) {
return (
(this.x = e.x + (t.x - e.x) * n),
(this.y = e.y + (t.y - e.y) * n),
(this.z = e.z + (t.z - e.z) * n),
(this.w = e.w + (t.w - e.w) * n),
this
)
},
},
{
key: 'equals',
value: function (e) {
return e.x === this.x && e.y === this.y && e.z === this.z && e.w === this.w
},
},
{
key: 'fromArray',
value: function (e) {
var t = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : 0
return (
(this.x = e[t]),
(this.y = e[t + 1]),
(this.z = e[t + 2]),
(this.w = e[t + 3]),
this
)
},
},
{
key: 'toArray',
value: function () {
var e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : [],
t = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : 0
return (
(e[t] = this.x),
(e[t + 1] = this.y),
(e[t + 2] = this.z),
(e[t + 3] = this.w),
e
)
},
},
{
key: 'fromBufferAttribute',
value: function (e, t) {
return (
(this.x = e.getX(t)),
(this.y = e.getY(t)),
(this.z = e.getZ(t)),
(this.w = e.getW(t)),
this
)
},
},
{
key: 'random',
value: function () {
return (
(this.x = Math.random()),
(this.y = Math.random()),
(this.z = Math.random()),
(this.w = Math.random()),
this
)
},
},
{
key: Symbol.iterator,
value: d().m(function e() {
return d().w(
function (e) {
for (;;)
switch (e.n) {
case 0:
return ((e.n = 1), this.x)
case 1:
return ((e.n = 2), this.y)
case 2:
return ((e.n = 3), this.z)
case 3:
return ((e.n = 4), this.w)
case 4:
return e.a(2)
}
},
e,
this
)
}),
},
]
)
})(),
lh = (function (e) {
function t() {
var e,
n = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : 1,
r = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : 1,
i = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {}
;(A(this, t),
((e = y(this, t)).isRenderTarget = !0),
(e.width = n),
(e.height = r),
(e.depth = 1),
(e.scissor = new uh(0, 0, n, r)),
(e.scissorTest = !1),
(e.viewport = new uh(0, 0, n, r)))
var a = { width: n, height: r, depth: 1 }
i = Object.assign(
{
generateMipmaps: !1,
internalFormat: null,
minFilter: ll,
depthBuffer: !0,
stencilBuffer: !1,
resolveDepthBuffer: !0,
resolveStencilBuffer: !0,
depthTexture: null,
samples: 0,
count: 1,
},
i
)
var o = new sh(
a,
i.mapping,
i.wrapS,
i.wrapT,
i.magFilter,
i.minFilter,
i.format,
i.type,
i.anisotropy,
i.colorSpace
)
;((o.flipY = !1),
(o.generateMipmaps = i.generateMipmaps),
(o.internalFormat = i.internalFormat),
(e.textures = []))
for (var s = i.count, u = 0; u < s; u++)
((e.textures[u] = o.clone()),
(e.textures[u].isRenderTargetTexture = !0),
(e.textures[u].renderTarget = e))
return (
(e.depthBuffer = i.depthBuffer),
(e.stencilBuffer = i.stencilBuffer),
(e.resolveDepthBuffer = i.resolveDepthBuffer),
(e.resolveStencilBuffer = i.resolveStencilBuffer),
(e._depthTexture = null),
(e.depthTexture = i.depthTexture),
(e.samples = i.samples),
e
)
}
return (
x(t, e),
T(t, [
{
key: 'texture',
get: function () {
return this.textures[0]
},
set: function (e) {
this.textures[0] = e
},
},
{
key: 'depthTexture',
get: function () {
return this._depthTexture
},
set: function (e) {
;(null !== this._depthTexture && (this._depthTexture.renderTarget = null),
null !== e && (e.renderTarget = this),
(this._depthTexture = e))
},
},
{
key: 'setSize',
value: function (e, t) {
var n = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : 1
if (this.width !== e || this.height !== t || this.depth !== n) {
;((this.width = e), (this.height = t), (this.depth = n))
for (var r = 0, i = this.textures.length; r < i; r++)
((this.textures[r].image.width = e),
(this.textures[r].image.height = t),
(this.textures[r].image.depth = n))
this.dispose()
}
;(this.viewport.set(0, 0, e, t), this.scissor.set(0, 0, e, t))
},
},
{
key: 'clone',
value: function () {
return new this.constructor().copy(this)
},
},
{
key: 'copy',
value: function (e) {
;((this.width = e.width),
(this.height = e.height),
(this.depth = e.depth),
this.scissor.copy(e.scissor),
(this.scissorTest = e.scissorTest),
this.viewport.copy(e.viewport),
(this.textures.length = 0))
for (var t = 0, n = e.textures.length; t < n; t++)
((this.textures[t] = e.textures[t].clone()),
(this.textures[t].isRenderTargetTexture = !0),
(this.textures[t].renderTarget = this))
var r = Object.assign({}, e.texture.image)
return (
(this.texture.source = new ih(r)),
(this.depthBuffer = e.depthBuffer),
(this.stencilBuffer = e.stencilBuffer),
(this.resolveDepthBuffer = e.resolveDepthBuffer),
(this.resolveStencilBuffer = e.resolveStencilBuffer),
null !== e.depthTexture && (this.depthTexture = e.depthTexture.clone()),
(this.samples = e.samples),
this
)
},
},
{
key: 'dispose',
value: function () {
this.dispatchEvent({ type: 'dispose' })
},
},
])
)
})(kc),
ch = (function (e) {
function t() {
var e,
n = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : 1,
r = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : 1,
i = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {}
return (A(this, t), ((e = y(this, t, [n, r, i])).isWebGLRenderTarget = !0), e)
}
return (x(t, e), T(t))
})(lh),
hh = (function (e) {
function t() {
var e,
n = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : null,
r = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : 1,
i = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : 1,
a = arguments.length > 3 && void 0 !== arguments[3] ? arguments[3] : 1
return (
A(this, t),
((e = y(this, t, [null])).isDataArrayTexture = !0),
(e.image = { data: n, width: r, height: i, depth: a }),
(e.magFilter = sl),
(e.minFilter = sl),
(e.wrapR = al),
(e.generateMipmaps = !1),
(e.flipY = !1),
(e.unpackAlignment = 1),
(e.layerUpdates = new Set()),
e
)
}
return (
x(t, e),
T(t, [
{
key: 'addLayerUpdate',
value: function (e) {
this.layerUpdates.add(e)
},
},
{
key: 'clearLayerUpdates',
value: function () {
this.layerUpdates.clear()
},
},
])
)
})(sh),
dh = (function (e) {
function t() {
var e,
n = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : null,
r = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : 1,
i = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : 1,
a = arguments.length > 3 && void 0 !== arguments[3] ? arguments[3] : 1
return (
A(this, t),
((e = y(this, t, [null])).isData3DTexture = !0),
(e.image = { data: n, width: r, height: i, depth: a }),
(e.magFilter = sl),
(e.minFilter = sl),
(e.wrapR = al),
(e.generateMipmaps = !1),
(e.flipY = !1),
(e.unpackAlignment = 1),
e
)
}
return (x(t, e), T(t))
})(sh),
fh = (function () {
return T(
function e() {
var t = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : 0,
n = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : 0,
r = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : 0,
i = arguments.length > 3 && void 0 !== arguments[3] ? arguments[3] : 1
;(A(this, e),
(this.isQuaternion = !0),
(this._x = t),
(this._y = n),
(this._z = r),
(this._w = i))
},
[
{
key: 'x',
get: function () {
return this._x
},
set: function (e) {
;((this._x = e), this._onChangeCallback())
},
},
{
key: 'y',
get: function () {
return this._y
},
set: function (e) {
;((this._y = e), this._onChangeCallback())
},
},
{
key: 'z',
get: function () {
return this._z
},
set: function (e) {
;((this._z = e), this._onChangeCallback())
},
},
{
key: 'w',
get: function () {
return this._w
},
set: function (e) {
;((this._w = e), this._onChangeCallback())
},
},
{
key: 'set',
value: function (e, t, n, r) {
return (
(this._x = e),
(this._y = t),
(this._z = n),
(this._w = r),
this._onChangeCallback(),
this
)
},
},
{
key: 'clone',
value: function () {
return new this.constructor(this._x, this._y, this._z, this._w)
},
},
{
key: 'copy',
value: function (e) {
return (
(this._x = e.x),
(this._y = e.y),
(this._z = e.z),
(this._w = e.w),
this._onChangeCallback(),
this
)
},
},
{
key: 'setFromEuler',
value: function (e) {
var t = !(arguments.length > 1 && void 0 !== arguments[1]) || arguments[1],
n = e._x,
r = e._y,
i = e._z,
a = e._order,
o = Math.cos,
s = Math.sin,
u = o(n / 2),
l = o(r / 2),
c = o(i / 2),
h = s(n / 2),
d = s(r / 2),
f = s(i / 2)
switch (a) {
case 'XYZ':
;((this._x = h * l * c + u * d * f),
(this._y = u * d * c - h * l * f),
(this._z = u * l * f + h * d * c),
(this._w = u * l * c - h * d * f))
break
case 'YXZ':
;((this._x = h * l * c + u * d * f),
(this._y = u * d * c - h * l * f),
(this._z = u * l * f - h * d * c),
(this._w = u * l * c + h * d * f))
break
case 'ZXY':
;((this._x = h * l * c - u * d * f),
(this._y = u * d * c + h * l * f),
(this._z = u * l * f + h * d * c),
(this._w = u * l * c - h * d * f))
break
case 'ZYX':
;((this._x = h * l * c - u * d * f),
(this._y = u * d * c + h * l * f),
(this._z = u * l * f - h * d * c),
(this._w = u * l * c + h * d * f))
break
case 'YZX':
;((this._x = h * l * c + u * d * f),
(this._y = u * d * c + h * l * f),
(this._z = u * l * f - h * d * c),
(this._w = u * l * c - h * d * f))
break
case 'XZY':
;((this._x = h * l * c - u * d * f),
(this._y = u * d * c - h * l * f),
(this._z = u * l * f + h * d * c),
(this._w = u * l * c + h * d * f))
break
default:
console.warn(
'THREE.Quaternion: .setFromEuler() encountered an unknown order: ' + a
)
}
return (!0 === t && this._onChangeCallback(), this)
},
},
{
key: 'setFromAxisAngle',
value: function (e, t) {
var n = t / 2,
r = Math.sin(n)
return (
(this._x = e.x * r),
(this._y = e.y * r),
(this._z = e.z * r),
(this._w = Math.cos(n)),
this._onChangeCallback(),
this
)
},
},
{
key: 'setFromRotationMatrix',
value: function (e) {
var t = e.elements,
n = t[0],
r = t[4],
i = t[8],
a = t[1],
o = t[5],
s = t[9],
u = t[2],
l = t[6],
c = t[10],
h = n + o + c
if (h > 0) {
var d = 0.5 / Math.sqrt(h + 1)
;((this._w = 0.25 / d),
(this._x = (l - s) * d),
(this._y = (i - u) * d),
(this._z = (a - r) * d))
} else if (n > o && n > c) {
var f = 2 * Math.sqrt(1 + n - o - c)
;((this._w = (l - s) / f),
(this._x = 0.25 * f),
(this._y = (r + a) / f),
(this._z = (i + u) / f))
} else if (o > c) {
var p = 2 * Math.sqrt(1 + o - n - c)
;((this._w = (i - u) / p),
(this._x = (r + a) / p),
(this._y = 0.25 * p),
(this._z = (s + l) / p))
} else {
var v = 2 * Math.sqrt(1 + c - n - o)
;((this._w = (a - r) / v),
(this._x = (i + u) / v),
(this._y = (s + l) / v),
(this._z = 0.25 * v))
}
return (this._onChangeCallback(), this)
},
},
{
key: 'setFromUnitVectors',
value: function (e, t) {
var n = e.dot(t) + 1
return (
n < Number.EPSILON
? ((n = 0),
Math.abs(e.x) > Math.abs(e.z)
? ((this._x = -e.y), (this._y = e.x), (this._z = 0), (this._w = n))
: ((this._x = 0), (this._y = -e.z), (this._z = e.y), (this._w = n)))
: ((this._x = e.y * t.z - e.z * t.y),
(this._y = e.z * t.x - e.x * t.z),
(this._z = e.x * t.y - e.y * t.x),
(this._w = n)),
this.normalize()
)
},
},
{
key: 'angleTo',
value: function (e) {
return 2 * Math.acos(Math.abs(Dc(this.dot(e), -1, 1)))
},
},
{
key: 'rotateTowards',
value: function (e, t) {
var n = this.angleTo(e)
if (0 === n) return this
var r = Math.min(1, t / n)
return (this.slerp(e, r), this)
},
},
{
key: 'identity',
value: function () {
return this.set(0, 0, 0, 1)
},
},
{
key: 'invert',
value: function () {
return this.conjugate()
},
},
{
key: 'conjugate',
value: function () {
return (
(this._x *= -1),
(this._y *= -1),
(this._z *= -1),
this._onChangeCallback(),
this
)
},
},
{
key: 'dot',
value: function (e) {
return this._x * e._x + this._y * e._y + this._z * e._z + this._w * e._w
},
},
{
key: 'lengthSq',
value: function () {
return (
this._x * this._x +
this._y * this._y +
this._z * this._z +
this._w * this._w
)
},
},
{
key: 'length',
value: function () {
return Math.sqrt(
this._x * this._x +
this._y * this._y +
this._z * this._z +
this._w * this._w
)
},
},
{
key: 'normalize',
value: function () {
var e = this.length()
return (
0 === e
? ((this._x = 0), (this._y = 0), (this._z = 0), (this._w = 1))
: ((e = 1 / e),
(this._x = this._x * e),
(this._y = this._y * e),
(this._z = this._z * e),
(this._w = this._w * e)),
this._onChangeCallback(),
this
)
},
},
{
key: 'multiply',
value: function (e) {
return this.multiplyQuaternions(this, e)
},
},
{
key: 'premultiply',
value: function (e) {
return this.multiplyQuaternions(e, this)
},
},
{
key: 'multiplyQuaternions',
value: function (e, t) {
var n = e._x,
r = e._y,
i = e._z,
a = e._w,
o = t._x,
s = t._y,
u = t._z,
l = t._w
return (
(this._x = n * l + a * o + r * u - i * s),
(this._y = r * l + a * s + i * o - n * u),
(this._z = i * l + a * u + n * s - r * o),
(this._w = a * l - n * o - r * s - i * u),
this._onChangeCallback(),
this
)
},
},
{
key: 'slerp',
value: function (e, t) {
if (0 === t) return this
if (1 === t) return this.copy(e)
var n = this._x,
r = this._y,
i = this._z,
a = this._w,
o = a * e._w + n * e._x + r * e._y + i * e._z
if (
(o < 0
? ((this._w = -e._w),
(this._x = -e._x),
(this._y = -e._y),
(this._z = -e._z),
(o = -o))
: this.copy(e),
o >= 1)
)
return ((this._w = a), (this._x = n), (this._y = r), (this._z = i), this)
var s = 1 - o * o
if (s <= Number.EPSILON) {
var u = 1 - t
return (
(this._w = u * a + t * this._w),
(this._x = u * n + t * this._x),
(this._y = u * r + t * this._y),
(this._z = u * i + t * this._z),
this.normalize(),
this
)
}
var l = Math.sqrt(s),
c = Math.atan2(l, o),
h = Math.sin((1 - t) * c) / l,
d = Math.sin(t * c) / l
return (
(this._w = a * h + this._w * d),
(this._x = n * h + this._x * d),
(this._y = r * h + this._y * d),
(this._z = i * h + this._z * d),
this._onChangeCallback(),
this
)
},
},
{
key: 'slerpQuaternions',
value: function (e, t, n) {
return this.copy(e).slerp(t, n)
},
},
{
key: 'random',
value: function () {
var e = 2 * Math.PI * Math.random(),
t = 2 * Math.PI * Math.random(),
n = Math.random(),
r = Math.sqrt(1 - n),
i = Math.sqrt(n)
return this.set(
r * Math.sin(e),
r * Math.cos(e),
i * Math.sin(t),
i * Math.cos(t)
)
},
},
{
key: 'equals',
value: function (e) {
return (
e._x === this._x && e._y === this._y && e._z === this._z && e._w === this._w
)
},
},
{
key: 'fromArray',
value: function (e) {
var t = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : 0
return (
(this._x = e[t]),
(this._y = e[t + 1]),
(this._z = e[t + 2]),
(this._w = e[t + 3]),
this._onChangeCallback(),
this
)
},
},
{
key: 'toArray',
value: function () {
var e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : [],
t = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : 0
return (
(e[t] = this._x),
(e[t + 1] = this._y),
(e[t + 2] = this._z),
(e[t + 3] = this._w),
e
)
},
},
{
key: 'fromBufferAttribute',
value: function (e, t) {
return (
(this._x = e.getX(t)),
(this._y = e.getY(t)),
(this._z = e.getZ(t)),
(this._w = e.getW(t)),
this._onChangeCallback(),
this
)
},
},
{
key: 'toJSON',
value: function () {
return this.toArray()
},
},
{
key: '_onChange',
value: function (e) {
return ((this._onChangeCallback = e), this)
},
},
{ key: '_onChangeCallback', value: function () {} },
{
key: Symbol.iterator,
value: d().m(function e() {
return d().w(
function (e) {
for (;;)
switch (e.n) {
case 0:
return ((e.n = 1), this._x)
case 1:
return ((e.n = 2), this._y)
case 2:
return ((e.n = 3), this._z)
case 3:
return ((e.n = 4), this._w)
case 4:
return e.a(2)
}
},
e,
this
)
}),
},
],
[
{
key: 'slerpFlat',
value: function (e, t, n, r, i, a, o) {
var s = n[r + 0],
u = n[r + 1],
l = n[r + 2],
c = n[r + 3],
h = i[a + 0],
d = i[a + 1],
f = i[a + 2],
p = i[a + 3]
if (0 === o)
return ((e[t + 0] = s), (e[t + 1] = u), (e[t + 2] = l), void (e[t + 3] = c))
if (1 === o)
return ((e[t + 0] = h), (e[t + 1] = d), (e[t + 2] = f), void (e[t + 3] = p))
if (c !== p || s !== h || u !== d || l !== f) {
var v = 1 - o,
m = s * h + u * d + l * f + c * p,
g = m >= 0 ? 1 : -1,
y = 1 - m * m
if (y > Number.EPSILON) {
var _ = Math.sqrt(y),
b = Math.atan2(_, m * g)
;((v = Math.sin(v * b) / _), (o = Math.sin(o * b) / _))
}
var x = o * g
if (
((s = s * v + h * x),
(u = u * v + d * x),
(l = l * v + f * x),
(c = c * v + p * x),
v === 1 - o)
) {
var S = 1 / Math.sqrt(s * s + u * u + l * l + c * c)
;((s *= S), (u *= S), (l *= S), (c *= S))
}
}
;((e[t] = s), (e[t + 1] = u), (e[t + 2] = l), (e[t + 3] = c))
},
},
{
key: 'multiplyQuaternionsFlat',
value: function (e, t, n, r, i, a) {
var o = n[r],
s = n[r + 1],
u = n[r + 2],
l = n[r + 3],
c = i[a],
h = i[a + 1],
d = i[a + 2],
f = i[a + 3]
return (
(e[t] = o * f + l * c + s * d - u * h),
(e[t + 1] = s * f + l * h + u * c - o * d),
(e[t + 2] = u * f + l * d + o * h - s * c),
(e[t + 3] = l * f - o * c - s * h - u * d),
e
)
},
},
]
)
})(),
ph = (function () {
return T(
function e() {
var t = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : 0,
n = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : 0,
r = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : 0
;(A(this, e),
(e.prototype.isVector3 = !0),
(this.x = t),
(this.y = n),
(this.z = r))
},
[
{
key: 'set',
value: function (e, t, n) {
return (
void 0 === n && (n = this.z),
(this.x = e),
(this.y = t),
(this.z = n),
this
)
},
},
{
key: 'setScalar',
value: function (e) {
return ((this.x = e), (this.y = e), (this.z = e), this)
},
},
{
key: 'setX',
value: function (e) {
return ((this.x = e), this)
},
},
{
key: 'setY',
value: function (e) {
return ((this.y = e), this)
},
},
{
key: 'setZ',
value: function (e) {
return ((this.z = e), this)
},
},
{
key: 'setComponent',
value: function (e, t) {
switch (e) {
case 0:
this.x = t
break
case 1:
this.y = t
break
case 2:
this.z = t
break
default:
throw new Error('index is out of range: ' + e)
}
return this
},
},
{
key: 'getComponent',
value: function (e) {
switch (e) {
case 0:
return this.x
case 1:
return this.y
case 2:
return this.z
default:
throw new Error('index is out of range: ' + e)
}
},
},
{
key: 'clone',
value: function () {
return new this.constructor(this.x, this.y, this.z)
},
},
{
key: 'copy',
value: function (e) {
return ((this.x = e.x), (this.y = e.y), (this.z = e.z), this)
},
},
{
key: 'add',
value: function (e) {
return ((this.x += e.x), (this.y += e.y), (this.z += e.z), this)
},
},
{
key: 'addScalar',
value: function (e) {
return ((this.x += e), (this.y += e), (this.z += e), this)
},
},
{
key: 'addVectors',
value: function (e, t) {
return (
(this.x = e.x + t.x),
(this.y = e.y + t.y),
(this.z = e.z + t.z),
this
)
},
},
{
key: 'addScaledVector',
value: function (e, t) {
return ((this.x += e.x * t), (this.y += e.y * t), (this.z += e.z * t), this)
},
},
{
key: 'sub',
value: function (e) {
return ((this.x -= e.x), (this.y -= e.y), (this.z -= e.z), this)
},
},
{
key: 'subScalar',
value: function (e) {
return ((this.x -= e), (this.y -= e), (this.z -= e), this)
},
},
{
key: 'subVectors',
value: function (e, t) {
return (
(this.x = e.x - t.x),
(this.y = e.y - t.y),
(this.z = e.z - t.z),
this
)
},
},
{
key: 'multiply',
value: function (e) {
return ((this.x *= e.x), (this.y *= e.y), (this.z *= e.z), this)
},
},
{
key: 'multiplyScalar',
value: function (e) {
return ((this.x *= e), (this.y *= e), (this.z *= e), this)
},
},
{
key: 'multiplyVectors',
value: function (e, t) {
return (
(this.x = e.x * t.x),
(this.y = e.y * t.y),
(this.z = e.z * t.z),
this
)
},
},
{
key: 'applyEuler',
value: function (e) {
return this.applyQuaternion(mh.setFromEuler(e))
},
},
{
key: 'applyAxisAngle',
value: function (e, t) {
return this.applyQuaternion(mh.setFromAxisAngle(e, t))
},
},
{
key: 'applyMatrix3',
value: function (e) {
var t = this.x,
n = this.y,
r = this.z,
i = e.elements
return (
(this.x = i[0] * t + i[3] * n + i[6] * r),
(this.y = i[1] * t + i[4] * n + i[7] * r),
(this.z = i[2] * t + i[5] * n + i[8] * r),
this
)
},
},
{
key: 'applyNormalMatrix',
value: function (e) {
return this.applyMatrix3(e).normalize()
},
},
{
key: 'applyMatrix4',
value: function (e) {
var t = this.x,
n = this.y,
r = this.z,
i = e.elements,
a = 1 / (i[3] * t + i[7] * n + i[11] * r + i[15])
return (
(this.x = (i[0] * t + i[4] * n + i[8] * r + i[12]) * a),
(this.y = (i[1] * t + i[5] * n + i[9] * r + i[13]) * a),
(this.z = (i[2] * t + i[6] * n + i[10] * r + i[14]) * a),
this
)
},
},
{
key: 'applyQuaternion',
value: function (e) {
var t = this.x,
n = this.y,
r = this.z,
i = e.x,
a = e.y,
o = e.z,
s = e.w,
u = 2 * (a * r - o * n),
l = 2 * (o * t - i * r),
c = 2 * (i * n - a * t)
return (
(this.x = t + s * u + a * c - o * l),
(this.y = n + s * l + o * u - i * c),
(this.z = r + s * c + i * l - a * u),
this
)
},
},
{
key: 'project',
value: function (e) {
return this.applyMatrix4(e.matrixWorldInverse).applyMatrix4(
e.projectionMatrix
)
},
},
{
key: 'unproject',
value: function (e) {
return this.applyMatrix4(e.projectionMatrixInverse).applyMatrix4(
e.matrixWorld
)
},
},
{
key: 'transformDirection',
value: function (e) {
var t = this.x,
n = this.y,
r = this.z,
i = e.elements
return (
(this.x = i[0] * t + i[4] * n + i[8] * r),
(this.y = i[1] * t + i[5] * n + i[9] * r),
(this.z = i[2] * t + i[6] * n + i[10] * r),
this.normalize()
)
},
},
{
key: 'divide',
value: function (e) {
return ((this.x /= e.x), (this.y /= e.y), (this.z /= e.z), this)
},
},
{
key: 'divideScalar',
value: function (e) {
return this.multiplyScalar(1 / e)
},
},
{
key: 'min',
value: function (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
)
},
},
{
key: 'max',
value: function (e) {
return (
(this.x = Math.max(this.x, e.x)),
(this.y = Math.max(this.y, e.y)),
(this.z = Math.max(this.z, e.z)),
this
)
},
},
{
key: 'clamp',
value: function (e, t) {
return (
(this.x = Dc(this.x, e.x, t.x)),
(this.y = Dc(this.y, e.y, t.y)),
(this.z = Dc(this.z, e.z, t.z)),
this
)
},
},
{
key: 'clampScalar',
value: function (e, t) {
return (
(this.x = Dc(this.x, e, t)),
(this.y = Dc(this.y, e, t)),
(this.z = Dc(this.z, e, t)),
this
)
},
},
{
key: 'clampLength',
value: function (e, t) {
var n = this.length()
return this.divideScalar(n || 1).multiplyScalar(Dc(n, e, t))
},
},
{
key: 'floor',
value: function () {
return (
(this.x = Math.floor(this.x)),
(this.y = Math.floor(this.y)),
(this.z = Math.floor(this.z)),
this
)
},
},
{
key: 'ceil',
value: function () {
return (
(this.x = Math.ceil(this.x)),
(this.y = Math.ceil(this.y)),
(this.z = Math.ceil(this.z)),
this
)
},
},
{
key: 'round',
value: function () {
return (
(this.x = Math.round(this.x)),
(this.y = Math.round(this.y)),
(this.z = Math.round(this.z)),
this
)
},
},
{
key: 'roundToZero',
value: function () {
return (
(this.x = Math.trunc(this.x)),
(this.y = Math.trunc(this.y)),
(this.z = Math.trunc(this.z)),
this
)
},
},
{
key: 'negate',
value: function () {
return ((this.x = -this.x), (this.y = -this.y), (this.z = -this.z), this)
},
},
{
key: 'dot',
value: function (e) {
return this.x * e.x + this.y * e.y + this.z * e.z
},
},
{
key: 'lengthSq',
value: function () {
return this.x * this.x + this.y * this.y + this.z * this.z
},
},
{
key: 'length',
value: function () {
return Math.sqrt(this.x * this.x + this.y * this.y + this.z * this.z)
},
},
{
key: 'manhattanLength',
value: function () {
return Math.abs(this.x) + Math.abs(this.y) + Math.abs(this.z)
},
},
{
key: 'normalize',
value: function () {
return this.divideScalar(this.length() || 1)
},
},
{
key: 'setLength',
value: function (e) {
return this.normalize().multiplyScalar(e)
},
},
{
key: 'lerp',
value: function (e, t) {
return (
(this.x += (e.x - this.x) * t),
(this.y += (e.y - this.y) * t),
(this.z += (e.z - this.z) * t),
this
)
},
},
{
key: 'lerpVectors',
value: function (e, t, n) {
return (
(this.x = e.x + (t.x - e.x) * n),
(this.y = e.y + (t.y - e.y) * n),
(this.z = e.z + (t.z - e.z) * n),
this
)
},
},
{
key: 'cross',
value: function (e) {
return this.crossVectors(this, e)
},
},
{
key: 'crossVectors',
value: function (e, t) {
var n = e.x,
r = e.y,
i = e.z,
a = t.x,
o = t.y,
s = t.z
return (
(this.x = r * s - i * o),
(this.y = i * a - n * s),
(this.z = n * o - r * a),
this
)
},
},
{
key: 'projectOnVector',
value: function (e) {
var t = e.lengthSq()
if (0 === t) return this.set(0, 0, 0)
var n = e.dot(this) / t
return this.copy(e).multiplyScalar(n)
},
},
{
key: 'projectOnPlane',
value: function (e) {
return (vh.copy(this).projectOnVector(e), this.sub(vh))
},
},
{
key: 'reflect',
value: function (e) {
return this.sub(vh.copy(e).multiplyScalar(2 * this.dot(e)))
},
},
{
key: 'angleTo',
value: function (e) {
var t = Math.sqrt(this.lengthSq() * e.lengthSq())
if (0 === t) return Math.PI / 2
var n = this.dot(e) / t
return Math.acos(Dc(n, -1, 1))
},
},
{
key: 'distanceTo',
value: function (e) {
return Math.sqrt(this.distanceToSquared(e))
},
},
{
key: 'distanceToSquared',
value: function (e) {
var t = this.x - e.x,
n = this.y - e.y,
r = this.z - e.z
return t * t + n * n + r * r
},
},
{
key: 'manhattanDistanceTo',
value: function (e) {
return (
Math.abs(this.x - e.x) + Math.abs(this.y - e.y) + Math.abs(this.z - e.z)
)
},
},
{
key: 'setFromSpherical',
value: function (e) {
return this.setFromSphericalCoords(e.radius, e.phi, e.theta)
},
},
{
key: 'setFromSphericalCoords',
value: function (e, t, n) {
var r = Math.sin(t) * e
return (
(this.x = r * Math.sin(n)),
(this.y = Math.cos(t) * e),
(this.z = r * Math.cos(n)),
this
)
},
},
{
key: 'setFromCylindrical',
value: function (e) {
return this.setFromCylindricalCoords(e.radius, e.theta, e.y)
},
},
{
key: 'setFromCylindricalCoords',
value: function (e, t, n) {
return (
(this.x = e * Math.sin(t)),
(this.y = n),
(this.z = e * Math.cos(t)),
this
)
},
},
{
key: 'setFromMatrixPosition',
value: function (e) {
var t = e.elements
return ((this.x = t[12]), (this.y = t[13]), (this.z = t[14]), this)
},
},
{
key: 'setFromMatrixScale',
value: function (e) {
var t = this.setFromMatrixColumn(e, 0).length(),
n = this.setFromMatrixColumn(e, 1).length(),
r = this.setFromMatrixColumn(e, 2).length()
return ((this.x = t), (this.y = n), (this.z = r), this)
},
},
{
key: 'setFromMatrixColumn',
value: function (e, t) {
return this.fromArray(e.elements, 4 * t)
},
},
{
key: 'setFromMatrix3Column',
value: function (e, t) {
return this.fromArray(e.elements, 3 * t)
},
},
{
key: 'setFromEuler',
value: function (e) {
return ((this.x = e._x), (this.y = e._y), (this.z = e._z), this)
},
},
{
key: 'setFromColor',
value: function (e) {
return ((this.x = e.r), (this.y = e.g), (this.z = e.b), this)
},
},
{
key: 'equals',
value: function (e) {
return e.x === this.x && e.y === this.y && e.z === this.z
},
},
{
key: 'fromArray',
value: function (e) {
var t = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : 0
return ((this.x = e[t]), (this.y = e[t + 1]), (this.z = e[t + 2]), this)
},
},
{
key: 'toArray',
value: function () {
var e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : [],
t = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : 0
return ((e[t] = this.x), (e[t + 1] = this.y), (e[t + 2] = this.z), e)
},
},
{
key: 'fromBufferAttribute',
value: function (e, t) {
return (
(this.x = e.getX(t)),
(this.y = e.getY(t)),
(this.z = e.getZ(t)),
this
)
},
},
{
key: 'random',
value: function () {
return (
(this.x = Math.random()),
(this.y = Math.random()),
(this.z = Math.random()),
this
)
},
},
{
key: 'randomDirection',
value: function () {
var e = Math.random() * Math.PI * 2,
t = 2 * Math.random() - 1,
n = Math.sqrt(1 - t * t)
return (
(this.x = n * Math.cos(e)),
(this.y = t),
(this.z = n * Math.sin(e)),
this
)
},
},
{
key: Symbol.iterator,
value: d().m(function e() {
return d().w(
function (e) {
for (;;)
switch (e.n) {
case 0:
return ((e.n = 1), this.x)
case 1:
return ((e.n = 2), this.y)
case 2:
return ((e.n = 3), this.z)
case 3:
return e.a(2)
}
},
e,
this
)
}),
},
]
)
})(),
vh = new ph(),
mh = new fh(),
gh = (function () {
return T(
function e() {
var t =
arguments.length > 0 && void 0 !== arguments[0]
? arguments[0]
: new ph(1 / 0, 1 / 0, 1 / 0),
n =
arguments.length > 1 && void 0 !== arguments[1]
? arguments[1]
: new ph(-1 / 0, -1 / 0, -1 / 0)
;(A(this, e), (this.isBox3 = !0), (this.min = t), (this.max = n))
},
[
{
key: 'set',
value: function (e, t) {
return (this.min.copy(e), this.max.copy(t), this)
},
},
{
key: 'setFromArray',
value: function (e) {
this.makeEmpty()
for (var t = 0, n = e.length; t < n; t += 3)
this.expandByPoint(_h.fromArray(e, t))
return this
},
},
{
key: 'setFromBufferAttribute',
value: function (e) {
this.makeEmpty()
for (var t = 0, n = e.count; t < n; t++)
this.expandByPoint(_h.fromBufferAttribute(e, t))
return this
},
},
{
key: 'setFromPoints',
value: function (e) {
this.makeEmpty()
for (var t = 0, n = e.length; t < n; t++) this.expandByPoint(e[t])
return this
},
},
{
key: 'setFromCenterAndSize',
value: function (e, t) {
var n = _h.copy(t).multiplyScalar(0.5)
return (this.min.copy(e).sub(n), this.max.copy(e).add(n), this)
},
},
{
key: 'setFromObject',
value: function (e) {
var t = arguments.length > 1 && void 0 !== arguments[1] && arguments[1]
return (this.makeEmpty(), this.expandByObject(e, t))
},
},
{
key: 'clone',
value: function () {
return new this.constructor().copy(this)
},
},
{
key: 'copy',
value: function (e) {
return (this.min.copy(e.min), this.max.copy(e.max), this)
},
},
{
key: 'makeEmpty',
value: function () {
return (
(this.min.x = this.min.y = this.min.z = 1 / 0),
(this.max.x = this.max.y = this.max.z = -1 / 0),
this
)
},
},
{
key: 'isEmpty',
value: function () {
return (
this.max.x < this.min.x ||
this.max.y < this.min.y ||
this.max.z < this.min.z
)
},
},
{
key: 'getCenter',
value: function (e) {
return this.isEmpty()
? e.set(0, 0, 0)
: e.addVectors(this.min, this.max).multiplyScalar(0.5)
},
},
{
key: 'getSize',
value: function (e) {
return this.isEmpty() ? e.set(0, 0, 0) : e.subVectors(this.max, this.min)
},
},
{
key: 'expandByPoint',
value: function (e) {
return (this.min.min(e), this.max.max(e), this)
},
},
{
key: 'expandByVector',
value: function (e) {
return (this.min.sub(e), this.max.add(e), this)
},
},
{
key: 'expandByScalar',
value: function (e) {
return (this.min.addScalar(-e), this.max.addScalar(e), this)
},
},
{
key: 'expandByObject',
value: function (e) {
var t = arguments.length > 1 && void 0 !== arguments[1] && arguments[1]
e.updateWorldMatrix(!1, !1)
var n = e.geometry
if (void 0 !== n) {
var r = n.getAttribute('position')
if (!0 === t && void 0 !== r && !0 !== e.isInstancedMesh)
for (var i = 0, a = r.count; i < a; i++)
(!0 === e.isMesh
? e.getVertexPosition(i, _h)
: _h.fromBufferAttribute(r, i),
_h.applyMatrix4(e.matrixWorld),
this.expandByPoint(_h))
else
(void 0 !== e.boundingBox
? (null === e.boundingBox && e.computeBoundingBox(),
bh.copy(e.boundingBox))
: (null === n.boundingBox && n.computeBoundingBox(),
bh.copy(n.boundingBox)),
bh.applyMatrix4(e.matrixWorld),
this.union(bh))
}
for (var o = e.children, s = 0, u = o.length; s < u; s++)
this.expandByObject(o[s], t)
return this
},
},
{
key: 'containsPoint',
value: function (e) {
return (
e.x >= this.min.x &&
e.x <= this.max.x &&
e.y >= this.min.y &&
e.y <= this.max.y &&
e.z >= this.min.z &&
e.z <= this.max.z
)
},
},
{
key: 'containsBox',
value: function (e) {
return (
this.min.x <= e.min.x &&
e.max.x <= this.max.x &&
this.min.y <= e.min.y &&
e.max.y <= this.max.y &&
this.min.z <= e.min.z &&
e.max.z <= this.max.z
)
},
},
{
key: 'getParameter',
value: function (e, t) {
return t.set(
(e.x - this.min.x) / (this.max.x - this.min.x),
(e.y - this.min.y) / (this.max.y - this.min.y),
(e.z - this.min.z) / (this.max.z - this.min.z)
)
},
},
{
key: 'intersectsBox',
value: function (e) {
return (
e.max.x >= this.min.x &&
e.min.x <= this.max.x &&
e.max.y >= this.min.y &&
e.min.y <= this.max.y &&
e.max.z >= this.min.z &&
e.min.z <= this.max.z
)
},
},
{
key: 'intersectsSphere',
value: function (e) {
return (
this.clampPoint(e.center, _h),
_h.distanceToSquared(e.center) <= e.radius * e.radius
)
},
},
{
key: 'intersectsPlane',
value: function (e) {
var t, n
return (
e.normal.x > 0
? ((t = e.normal.x * this.min.x), (n = e.normal.x * this.max.x))
: ((t = e.normal.x * this.max.x), (n = e.normal.x * this.min.x)),
e.normal.y > 0
? ((t += e.normal.y * this.min.y), (n += e.normal.y * this.max.y))
: ((t += e.normal.y * this.max.y), (n += e.normal.y * this.min.y)),
e.normal.z > 0
? ((t += e.normal.z * this.min.z), (n += e.normal.z * this.max.z))
: ((t += e.normal.z * this.max.z), (n += e.normal.z * this.min.z)),
t <= -e.constant && n >= -e.constant
)
},
},
{
key: 'intersectsTriangle',
value: function (e) {
if (this.isEmpty()) return !1
;(this.getCenter(Eh),
Ch.subVectors(this.max, Eh),
xh.subVectors(e.a, Eh),
Sh.subVectors(e.b, Eh),
Ah.subVectors(e.c, Eh),
wh.subVectors(Sh, xh),
Th.subVectors(Ah, Sh),
Mh.subVectors(xh, Ah))
var t = [
0,
-wh.z,
wh.y,
0,
-Th.z,
Th.y,
0,
-Mh.z,
Mh.y,
wh.z,
0,
-wh.x,
Th.z,
0,
-Th.x,
Mh.z,
0,
-Mh.x,
-wh.y,
wh.x,
0,
-Th.y,
Th.x,
0,
-Mh.y,
Mh.x,
0,
]
return (
!!Ih(t, xh, Sh, Ah, Ch) &&
!!Ih((t = [1, 0, 0, 0, 1, 0, 0, 0, 1]), xh, Sh, Ah, Ch) &&
(kh.crossVectors(wh, Th), Ih((t = [kh.x, kh.y, kh.z]), xh, Sh, Ah, Ch))
)
},
},
{
key: 'clampPoint',
value: function (e, t) {
return t.copy(e).clamp(this.min, this.max)
},
},
{
key: 'distanceToPoint',
value: function (e) {
return this.clampPoint(e, _h).distanceTo(e)
},
},
{
key: 'getBoundingSphere',
value: function (e) {
return (
this.isEmpty()
? e.makeEmpty()
: (this.getCenter(e.center),
(e.radius = 0.5 * this.getSize(_h).length())),
e
)
},
},
{
key: 'intersect',
value: function (e) {
return (
this.min.max(e.min),
this.max.min(e.max),
this.isEmpty() && this.makeEmpty(),
this
)
},
},
{
key: 'union',
value: function (e) {
return (this.min.min(e.min), this.max.max(e.max), this)
},
},
{
key: 'applyMatrix4',
value: function (e) {
return (
this.isEmpty() ||
(yh[0].set(this.min.x, this.min.y, this.min.z).applyMatrix4(e),
yh[1].set(this.min.x, this.min.y, this.max.z).applyMatrix4(e),
yh[2].set(this.min.x, this.max.y, this.min.z).applyMatrix4(e),
yh[3].set(this.min.x, this.max.y, this.max.z).applyMatrix4(e),
yh[4].set(this.max.x, this.min.y, this.min.z).applyMatrix4(e),
yh[5].set(this.max.x, this.min.y, this.max.z).applyMatrix4(e),
yh[6].set(this.max.x, this.max.y, this.min.z).applyMatrix4(e),
yh[7].set(this.max.x, this.max.y, this.max.z).applyMatrix4(e),
this.setFromPoints(yh)),
this
)
},
},
{
key: 'translate',
value: function (e) {
return (this.min.add(e), this.max.add(e), this)
},
},
{
key: 'equals',
value: function (e) {
return e.min.equals(this.min) && e.max.equals(this.max)
},
},
]
)
})(),
yh = [new ph(), new ph(), new ph(), new ph(), new ph(), new ph(), new ph(), new ph()],
_h = new ph(),
bh = new gh(),
xh = new ph(),
Sh = new ph(),
Ah = new ph(),
wh = new ph(),
Th = new ph(),
Mh = new ph(),
Eh = new ph(),
Ch = new ph(),
kh = new ph(),
Rh = new ph()
function Ih(e, t, n, r, i) {
for (var a = 0, o = e.length - 3; a <= o; a += 3) {
Rh.fromArray(e, a)
var s = i.x * Math.abs(Rh.x) + i.y * Math.abs(Rh.y) + i.z * Math.abs(Rh.z),
u = t.dot(Rh),
l = n.dot(Rh),
c = r.dot(Rh)
if (Math.max(-Math.max(u, l, c), Math.min(u, l, c)) > s) return !1
}
return !0
}
var Nh = new gh(),
Ph = new ph(),
Lh = new ph(),
Dh = (function () {
return T(
function e() {
var t = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : new ph(),
n = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : -1
;(A(this, e), (this.isSphere = !0), (this.center = t), (this.radius = n))
},
[
{
key: 'set',
value: function (e, t) {
return (this.center.copy(e), (this.radius = t), this)
},
},
{
key: 'setFromPoints',
value: function (e, t) {
var n = this.center
void 0 !== t ? n.copy(t) : Nh.setFromPoints(e).getCenter(n)
for (var r = 0, i = 0, a = e.length; i < a; i++)
r = Math.max(r, n.distanceToSquared(e[i]))
return ((this.radius = Math.sqrt(r)), this)
},
},
{
key: 'copy',
value: function (e) {
return (this.center.copy(e.center), (this.radius = e.radius), this)
},
},
{
key: 'isEmpty',
value: function () {
return this.radius < 0
},
},
{
key: 'makeEmpty',
value: function () {
return (this.center.set(0, 0, 0), (this.radius = -1), this)
},
},
{
key: 'containsPoint',
value: function (e) {
return e.distanceToSquared(this.center) <= this.radius * this.radius
},
},
{
key: 'distanceToPoint',
value: function (e) {
return e.distanceTo(this.center) - this.radius
},
},
{
key: 'intersectsSphere',
value: function (e) {
var t = this.radius + e.radius
return e.center.distanceToSquared(this.center) <= t * t
},
},
{
key: 'intersectsBox',
value: function (e) {
return e.intersectsSphere(this)
},
},
{
key: 'intersectsPlane',
value: function (e) {
return Math.abs(e.distanceToPoint(this.center)) <= this.radius
},
},
{
key: 'clampPoint',
value: function (e, t) {
var n = this.center.distanceToSquared(e)
return (
t.copy(e),
n > this.radius * this.radius &&
(t.sub(this.center).normalize(),
t.multiplyScalar(this.radius).add(this.center)),
t
)
},
},
{
key: 'getBoundingBox',
value: function (e) {
return this.isEmpty()
? (e.makeEmpty(), e)
: (e.set(this.center, this.center), e.expandByScalar(this.radius), e)
},
},
{
key: 'applyMatrix4',
value: function (e) {
return (
this.center.applyMatrix4(e),
(this.radius = this.radius * e.getMaxScaleOnAxis()),
this
)
},
},
{
key: 'translate',
value: function (e) {
return (this.center.add(e), this)
},
},
{
key: 'expandByPoint',
value: function (e) {
if (this.isEmpty()) return (this.center.copy(e), (this.radius = 0), this)
Ph.subVectors(e, this.center)
var t = Ph.lengthSq()
if (t > this.radius * this.radius) {
var n = Math.sqrt(t),
r = 0.5 * (n - this.radius)
;(this.center.addScaledVector(Ph, r / n), (this.radius += r))
}
return this
},
},
{
key: 'union',
value: function (e) {
return e.isEmpty()
? this
: this.isEmpty()
? (this.copy(e), this)
: (!0 === this.center.equals(e.center)
? (this.radius = Math.max(this.radius, e.radius))
: (Lh.subVectors(e.center, this.center).setLength(e.radius),
this.expandByPoint(Ph.copy(e.center).add(Lh)),
this.expandByPoint(Ph.copy(e.center).sub(Lh))),
this)
},
},
{
key: 'equals',
value: function (e) {
return e.center.equals(this.center) && e.radius === this.radius
},
},
{
key: 'clone',
value: function () {
return new this.constructor().copy(this)
},
},
]
)
})(),
Oh = new ph(),
Fh = new ph(),
Bh = new ph(),
Uh = new ph(),
zh = new ph(),
Vh = new ph(),
Hh = new ph(),
Wh = (function () {
return T(
function e() {
var t = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : new ph(),
n =
arguments.length > 1 && void 0 !== arguments[1]
? arguments[1]
: new ph(0, 0, -1)
;(A(this, e), (this.origin = t), (this.direction = n))
},
[
{
key: 'set',
value: function (e, t) {
return (this.origin.copy(e), this.direction.copy(t), this)
},
},
{
key: 'copy',
value: function (e) {
return (this.origin.copy(e.origin), this.direction.copy(e.direction), this)
},
},
{
key: 'at',
value: function (e, t) {
return t.copy(this.origin).addScaledVector(this.direction, e)
},
},
{
key: 'lookAt',
value: function (e) {
return (this.direction.copy(e).sub(this.origin).normalize(), this)
},
},
{
key: 'recast',
value: function (e) {
return (this.origin.copy(this.at(e, Oh)), this)
},
},
{
key: 'closestPointToPoint',
value: function (e, t) {
t.subVectors(e, this.origin)
var n = t.dot(this.direction)
return n < 0
? t.copy(this.origin)
: t.copy(this.origin).addScaledVector(this.direction, n)
},
},
{
key: 'distanceToPoint',
value: function (e) {
return Math.sqrt(this.distanceSqToPoint(e))
},
},
{
key: 'distanceSqToPoint',
value: function (e) {
var t = Oh.subVectors(e, this.origin).dot(this.direction)
return t < 0
? this.origin.distanceToSquared(e)
: (Oh.copy(this.origin).addScaledVector(this.direction, t),
Oh.distanceToSquared(e))
},
},
{
key: 'distanceSqToSegment',
value: function (e, t, n, r) {
;(Fh.copy(e).add(t).multiplyScalar(0.5),
Bh.copy(t).sub(e).normalize(),
Uh.copy(this.origin).sub(Fh))
var i,
a,
o,
s,
u = 0.5 * e.distanceTo(t),
l = -this.direction.dot(Bh),
c = Uh.dot(this.direction),
h = -Uh.dot(Bh),
d = Uh.lengthSq(),
f = Math.abs(1 - l * l)
if (f > 0)
if (((a = l * c - h), (s = u * f), (i = l * h - c) >= 0))
if (a >= -s)
if (a <= s) {
var p = 1 / f
o =
(i *= p) * (i + l * (a *= p) + 2 * c) + a * (l * i + a + 2 * h) + d
} else
((a = u),
(o = -(i = Math.max(0, -(l * a + c))) * i + a * (a + 2 * h) + d))
else
((a = -u),
(o = -(i = Math.max(0, -(l * a + c))) * i + a * (a + 2 * h) + d))
else
a <= -s
? (o =
-(i = Math.max(0, -(-l * u + c))) * i +
(a = i > 0 ? -u : Math.min(Math.max(-u, -h), u)) * (a + 2 * h) +
d)
: a <= s
? ((i = 0),
(o = (a = Math.min(Math.max(-u, -h), u)) * (a + 2 * h) + d))
: (o =
-(i = Math.max(0, -(l * u + c))) * i +
(a = i > 0 ? u : Math.min(Math.max(-u, -h), u)) * (a + 2 * h) +
d)
else
((a = l > 0 ? -u : u),
(o = -(i = Math.max(0, -(l * a + c))) * i + a * (a + 2 * h) + d))
return (
n && n.copy(this.origin).addScaledVector(this.direction, i),
r && r.copy(Fh).addScaledVector(Bh, a),
o
)
},
},
{
key: 'intersectSphere',
value: function (e, t) {
Oh.subVectors(e.center, this.origin)
var n = Oh.dot(this.direction),
r = Oh.dot(Oh) - n * n,
i = e.radius * e.radius
if (r > i) return null
var a = Math.sqrt(i - r),
o = n - a,
s = n + a
return s < 0 ? null : o < 0 ? this.at(s, t) : this.at(o, t)
},
},
{
key: 'intersectsSphere',
value: function (e) {
return this.distanceSqToPoint(e.center) <= e.radius * e.radius
},
},
{
key: 'distanceToPlane',
value: function (e) {
var t = e.normal.dot(this.direction)
if (0 === t) return 0 === e.distanceToPoint(this.origin) ? 0 : null
var n = -(this.origin.dot(e.normal) + e.constant) / t
return n >= 0 ? n : null
},
},
{
key: 'intersectPlane',
value: function (e, t) {
var n = this.distanceToPlane(e)
return null === n ? null : this.at(n, t)
},
},
{
key: 'intersectsPlane',
value: function (e) {
var t = e.distanceToPoint(this.origin)
return 0 === t || e.normal.dot(this.direction) * t < 0
},
},
{
key: 'intersectBox',
value: function (e, t) {
var n,
r,
i,
a,
o,
s,
u = 1 / this.direction.x,
l = 1 / this.direction.y,
c = 1 / this.direction.z,
h = this.origin
return (
u >= 0
? ((n = (e.min.x - h.x) * u), (r = (e.max.x - h.x) * u))
: ((n = (e.max.x - h.x) * u), (r = (e.min.x - h.x) * u)),
l >= 0
? ((i = (e.min.y - h.y) * l), (a = (e.max.y - h.y) * l))
: ((i = (e.max.y - h.y) * l), (a = (e.min.y - h.y) * l)),
n > a || i > r
? null
: ((i > n || isNaN(n)) && (n = i),
(a < r || isNaN(r)) && (r = a),
c >= 0
? ((o = (e.min.z - h.z) * c), (s = (e.max.z - h.z) * c))
: ((o = (e.max.z - h.z) * c), (s = (e.min.z - h.z) * c)),
n > s || o > r
? null
: ((o > n || n != n) && (n = o),
(s < r || r != r) && (r = s),
r < 0 ? null : this.at(n >= 0 ? n : r, t)))
)
},
},
{
key: 'intersectsBox',
value: function (e) {
return null !== this.intersectBox(e, Oh)
},
},
{
key: 'intersectTriangle',
value: function (e, t, n, r, i) {
;(zh.subVectors(t, e), Vh.subVectors(n, e), Hh.crossVectors(zh, Vh))
var a,
o = this.direction.dot(Hh)
if (o > 0) {
if (r) return null
a = 1
} else {
if (!(o < 0)) return null
;((a = -1), (o = -o))
}
Uh.subVectors(this.origin, e)
var s = a * this.direction.dot(Vh.crossVectors(Uh, Vh))
if (s < 0) return null
var u = a * this.direction.dot(zh.cross(Uh))
if (u < 0) return null
if (s + u > o) return null
var l = -a * Uh.dot(Hh)
return l < 0 ? null : this.at(l / o, i)
},
},
{
key: 'applyMatrix4',
value: function (e) {
return (
this.origin.applyMatrix4(e),
this.direction.transformDirection(e),
this
)
},
},
{
key: 'equals',
value: function (e) {
return e.origin.equals(this.origin) && e.direction.equals(this.direction)
},
},
{
key: 'clone',
value: function () {
return new this.constructor().copy(this)
},
},
]
)
})(),
Gh = (function () {
function e(t, n, r, i, a, o, s, u, l, c, h, d, f, p, v, m) {
;(A(this, e),
(e.prototype.isMatrix4 = !0),
(this.elements = [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1]),
void 0 !== t && this.set(t, n, r, i, a, o, s, u, l, c, h, d, f, p, v, m))
}
return T(e, [
{
key: 'set',
value: function (e, t, n, r, i, a, o, s, u, l, c, h, d, f, p, v) {
var m = this.elements
return (
(m[0] = e),
(m[4] = t),
(m[8] = n),
(m[12] = r),
(m[1] = i),
(m[5] = a),
(m[9] = o),
(m[13] = s),
(m[2] = u),
(m[6] = l),
(m[10] = c),
(m[14] = h),
(m[3] = d),
(m[7] = f),
(m[11] = p),
(m[15] = v),
this
)
},
},
{
key: 'identity',
value: function () {
return (this.set(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1), this)
},
},
{
key: 'clone',
value: function () {
return new e().fromArray(this.elements)
},
},
{
key: 'copy',
value: function (e) {
var t = this.elements,
n = e.elements
return (
(t[0] = n[0]),
(t[1] = n[1]),
(t[2] = n[2]),
(t[3] = n[3]),
(t[4] = n[4]),
(t[5] = n[5]),
(t[6] = n[6]),
(t[7] = n[7]),
(t[8] = n[8]),
(t[9] = n[9]),
(t[10] = n[10]),
(t[11] = n[11]),
(t[12] = n[12]),
(t[13] = n[13]),
(t[14] = n[14]),
(t[15] = n[15]),
this
)
},
},
{
key: 'copyPosition',
value: function (e) {
var t = this.elements,
n = e.elements
return ((t[12] = n[12]), (t[13] = n[13]), (t[14] = n[14]), this)
},
},
{
key: 'setFromMatrix3',
value: function (e) {
var t = e.elements
return (
this.set(
t[0],
t[3],
t[6],
0,
t[1],
t[4],
t[7],
0,
t[2],
t[5],
t[8],
0,
0,
0,
0,
1
),
this
)
},
},
{
key: 'extractBasis',
value: function (e, t, n) {
return (
e.setFromMatrixColumn(this, 0),
t.setFromMatrixColumn(this, 1),
n.setFromMatrixColumn(this, 2),
this
)
},
},
{
key: 'makeBasis',
value: function (e, t, n) {
return (
this.set(e.x, t.x, n.x, 0, e.y, t.y, n.y, 0, e.z, t.z, n.z, 0, 0, 0, 0, 1),
this
)
},
},
{
key: 'extractRotation',
value: function (e) {
var t = this.elements,
n = e.elements,
r = 1 / jh.setFromMatrixColumn(e, 0).length(),
i = 1 / jh.setFromMatrixColumn(e, 1).length(),
a = 1 / jh.setFromMatrixColumn(e, 2).length()
return (
(t[0] = n[0] * r),
(t[1] = n[1] * r),
(t[2] = n[2] * r),
(t[3] = 0),
(t[4] = n[4] * i),
(t[5] = n[5] * i),
(t[6] = n[6] * i),
(t[7] = 0),
(t[8] = n[8] * a),
(t[9] = n[9] * a),
(t[10] = n[10] * a),
(t[11] = 0),
(t[12] = 0),
(t[13] = 0),
(t[14] = 0),
(t[15] = 1),
this
)
},
},
{
key: 'makeRotationFromEuler',
value: function (e) {
var t = this.elements,
n = e.x,
r = e.y,
i = e.z,
a = Math.cos(n),
o = Math.sin(n),
s = Math.cos(r),
u = Math.sin(r),
l = Math.cos(i),
c = Math.sin(i)
if ('XYZ' === e.order) {
var h = a * l,
d = a * c,
f = o * l,
p = o * c
;((t[0] = s * l),
(t[4] = -s * c),
(t[8] = u),
(t[1] = d + f * u),
(t[5] = h - p * u),
(t[9] = -o * s),
(t[2] = p - h * u),
(t[6] = f + d * u),
(t[10] = a * s))
} else if ('YXZ' === e.order) {
var v = s * l,
m = s * c,
g = u * l,
y = u * c
;((t[0] = v + y * o),
(t[4] = g * o - m),
(t[8] = a * u),
(t[1] = a * c),
(t[5] = a * l),
(t[9] = -o),
(t[2] = m * o - g),
(t[6] = y + v * o),
(t[10] = a * s))
} else if ('ZXY' === e.order) {
var _ = s * l,
b = s * c,
x = u * l,
S = u * c
;((t[0] = _ - S * o),
(t[4] = -a * c),
(t[8] = x + b * o),
(t[1] = b + x * o),
(t[5] = a * l),
(t[9] = S - _ * o),
(t[2] = -a * u),
(t[6] = o),
(t[10] = a * s))
} else if ('ZYX' === e.order) {
var A = a * l,
w = a * c,
T = o * l,
M = o * c
;((t[0] = s * l),
(t[4] = T * u - w),
(t[8] = A * u + M),
(t[1] = s * c),
(t[5] = M * u + A),
(t[9] = w * u - T),
(t[2] = -u),
(t[6] = o * s),
(t[10] = a * s))
} else if ('YZX' === e.order) {
var E = a * s,
C = a * u,
k = o * s,
R = o * u
;((t[0] = s * l),
(t[4] = R - E * c),
(t[8] = k * c + C),
(t[1] = c),
(t[5] = a * l),
(t[9] = -o * l),
(t[2] = -u * l),
(t[6] = C * c + k),
(t[10] = E - R * c))
} else if ('XZY' === e.order) {
var I = a * s,
N = a * u,
P = o * s,
L = o * u
;((t[0] = s * l),
(t[4] = -c),
(t[8] = u * l),
(t[1] = I * c + L),
(t[5] = a * l),
(t[9] = N * c - P),
(t[2] = P * c - N),
(t[6] = o * l),
(t[10] = L * c + I))
}
return (
(t[3] = 0),
(t[7] = 0),
(t[11] = 0),
(t[12] = 0),
(t[13] = 0),
(t[14] = 0),
(t[15] = 1),
this
)
},
},
{
key: 'makeRotationFromQuaternion',
value: function (e) {
return this.compose(qh, e, Xh)
},
},
{
key: 'lookAt',
value: function (e, t, n) {
var r = this.elements
return (
Zh.subVectors(e, t),
0 === Zh.lengthSq() && (Zh.z = 1),
Zh.normalize(),
Yh.crossVectors(n, Zh),
0 === Yh.lengthSq() &&
(1 === Math.abs(n.z) ? (Zh.x += 1e-4) : (Zh.z += 1e-4),
Zh.normalize(),
Yh.crossVectors(n, Zh)),
Yh.normalize(),
Kh.crossVectors(Zh, Yh),
(r[0] = Yh.x),
(r[4] = Kh.x),
(r[8] = Zh.x),
(r[1] = Yh.y),
(r[5] = Kh.y),
(r[9] = Zh.y),
(r[2] = Yh.z),
(r[6] = Kh.z),
(r[10] = Zh.z),
this
)
},
},
{
key: 'multiply',
value: function (e) {
return this.multiplyMatrices(this, e)
},
},
{
key: 'premultiply',
value: function (e) {
return this.multiplyMatrices(e, this)
},
},
{
key: 'multiplyMatrices',
value: function (e, t) {
var n = e.elements,
r = t.elements,
i = this.elements,
a = n[0],
o = n[4],
s = n[8],
u = n[12],
l = n[1],
c = n[5],
h = n[9],
d = n[13],
f = n[2],
p = n[6],
v = n[10],
m = n[14],
g = n[3],
y = n[7],
_ = n[11],
b = n[15],
x = r[0],
S = r[4],
A = r[8],
w = r[12],
T = r[1],
M = r[5],
E = r[9],
C = r[13],
k = r[2],
R = r[6],
I = r[10],
N = r[14],
P = r[3],
L = r[7],
D = r[11],
O = r[15]
return (
(i[0] = a * x + o * T + s * k + u * P),
(i[4] = a * S + o * M + s * R + u * L),
(i[8] = a * A + o * E + s * I + u * D),
(i[12] = a * w + o * C + s * N + u * O),
(i[1] = l * x + c * T + h * k + d * P),
(i[5] = l * S + c * M + h * R + d * L),
(i[9] = l * A + c * E + h * I + d * D),
(i[13] = l * w + c * C + h * N + d * O),
(i[2] = f * x + p * T + v * k + m * P),
(i[6] = f * S + p * M + v * R + m * L),
(i[10] = f * A + p * E + v * I + m * D),
(i[14] = f * w + p * C + v * N + m * O),
(i[3] = g * x + y * T + _ * k + b * P),
(i[7] = g * S + y * M + _ * R + b * L),
(i[11] = g * A + y * E + _ * I + b * D),
(i[15] = g * w + y * C + _ * N + b * O),
this
)
},
},
{
key: 'multiplyScalar',
value: function (e) {
var 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
)
},
},
{
key: 'determinant',
value: function () {
var e = this.elements,
t = e[0],
n = e[4],
r = e[8],
i = e[12],
a = e[1],
o = e[5],
s = e[9],
u = e[13],
l = e[2],
c = e[6],
h = e[10],
d = e[14]
return (
e[3] *
(+i * s * c - r * u * c - i * o * h + n * u * h + r * o * d - n * s * d) +
e[7] *
(+t * s * d - t * u * h + i * a * h - r * a * d + r * u * l - i * s * l) +
e[11] *
(+t * u * c - t * o * d - i * a * c + n * a * d + i * o * l - n * u * l) +
e[15] *
(-r * o * l - t * s * c + t * o * h + r * a * c - n * a * h + n * s * l)
)
},
},
{
key: 'transpose',
value: function () {
var e,
t = this.elements
return (
(e = t[1]),
(t[1] = t[4]),
(t[4] = e),
(e = t[2]),
(t[2] = t[8]),
(t[8] = e),
(e = t[6]),
(t[6] = t[9]),
(t[9] = e),
(e = t[3]),
(t[3] = t[12]),
(t[12] = e),
(e = t[7]),
(t[7] = t[13]),
(t[13] = e),
(e = t[11]),
(t[11] = t[14]),
(t[14] = e),
this
)
},
},
{
key: 'setPosition',
value: function (e, t, n) {
var r = this.elements
return (
e.isVector3
? ((r[12] = e.x), (r[13] = e.y), (r[14] = e.z))
: ((r[12] = e), (r[13] = t), (r[14] = n)),
this
)
},
},
{
key: 'invert',
value: function () {
var e = this.elements,
t = e[0],
n = e[1],
r = e[2],
i = e[3],
a = e[4],
o = e[5],
s = e[6],
u = e[7],
l = e[8],
c = e[9],
h = e[10],
d = e[11],
f = e[12],
p = e[13],
v = e[14],
m = e[15],
g = c * v * u - p * h * u + p * s * d - o * v * d - c * s * m + o * h * m,
y = f * h * u - l * v * u - f * s * d + a * v * d + l * s * m - a * h * m,
_ = l * p * u - f * c * u + f * o * d - a * p * d - l * o * m + a * c * m,
b = f * c * s - l * p * s - f * o * h + a * p * h + l * o * v - a * c * v,
x = t * g + n * y + r * _ + i * b
if (0 === x) return this.set(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)
var S = 1 / x
return (
(e[0] = g * S),
(e[1] =
(p * h * i - c * v * i - p * r * d + n * v * d + c * r * m - n * h * m) *
S),
(e[2] =
(o * v * i - p * s * i + p * r * u - n * v * u - o * r * m + n * s * m) *
S),
(e[3] =
(c * s * i - o * h * i - c * r * u + n * h * u + o * r * d - n * s * d) *
S),
(e[4] = y * S),
(e[5] =
(l * v * i - f * h * i + f * r * d - t * v * d - l * r * m + t * h * m) *
S),
(e[6] =
(f * s * i - a * v * i - f * r * u + t * v * u + a * r * m - t * s * m) *
S),
(e[7] =
(a * h * i - l * s * i + l * r * u - t * h * u - a * r * d + t * s * d) *
S),
(e[8] = _ * S),
(e[9] =
(f * c * i - l * p * i - f * n * d + t * p * d + l * n * m - t * c * m) *
S),
(e[10] =
(a * p * i - f * o * i + f * n * u - t * p * u - a * n * m + t * o * m) *
S),
(e[11] =
(l * o * i - a * c * i - l * n * u + t * c * u + a * n * d - t * o * d) *
S),
(e[12] = b * S),
(e[13] =
(l * p * r - f * c * r + f * n * h - t * p * h - l * n * v + t * c * v) *
S),
(e[14] =
(f * o * r - a * p * r - f * n * s + t * p * s + a * n * v - t * o * v) *
S),
(e[15] =
(a * c * r - l * o * r + l * n * s - t * c * s - a * n * h + t * o * h) *
S),
this
)
},
},
{
key: 'scale',
value: function (e) {
var t = this.elements,
n = e.x,
r = e.y,
i = e.z
return (
(t[0] *= n),
(t[4] *= r),
(t[8] *= i),
(t[1] *= n),
(t[5] *= r),
(t[9] *= i),
(t[2] *= n),
(t[6] *= r),
(t[10] *= i),
(t[3] *= n),
(t[7] *= r),
(t[11] *= i),
this
)
},
},
{
key: 'getMaxScaleOnAxis',
value: function () {
var e = this.elements,
t = e[0] * e[0] + e[1] * e[1] + e[2] * e[2],
n = e[4] * e[4] + e[5] * e[5] + e[6] * e[6],
r = e[8] * e[8] + e[9] * e[9] + e[10] * e[10]
return Math.sqrt(Math.max(t, n, r))
},
},
{
key: 'makeTranslation',
value: function (e, t, n) {
return (
e.isVector3
? this.set(1, 0, 0, e.x, 0, 1, 0, e.y, 0, 0, 1, e.z, 0, 0, 0, 1)
: this.set(1, 0, 0, e, 0, 1, 0, t, 0, 0, 1, n, 0, 0, 0, 1),
this
)
},
},
{
key: 'makeRotationX',
value: function (e) {
var t = Math.cos(e),
n = Math.sin(e)
return (this.set(1, 0, 0, 0, 0, t, -n, 0, 0, n, t, 0, 0, 0, 0, 1), this)
},
},
{
key: 'makeRotationY',
value: function (e) {
var t = Math.cos(e),
n = Math.sin(e)
return (this.set(t, 0, n, 0, 0, 1, 0, 0, -n, 0, t, 0, 0, 0, 0, 1), this)
},
},
{
key: 'makeRotationZ',
value: function (e) {
var t = Math.cos(e),
n = Math.sin(e)
return (this.set(t, -n, 0, 0, n, t, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1), this)
},
},
{
key: 'makeRotationAxis',
value: function (e, t) {
var n = Math.cos(t),
r = Math.sin(t),
i = 1 - n,
a = e.x,
o = e.y,
s = e.z,
u = i * a,
l = i * o
return (
this.set(
u * a + n,
u * o - r * s,
u * s + r * o,
0,
u * o + r * s,
l * o + n,
l * s - r * a,
0,
u * s - r * o,
l * s + r * a,
i * s * s + n,
0,
0,
0,
0,
1
),
this
)
},
},
{
key: 'makeScale',
value: function (e, t, n) {
return (this.set(e, 0, 0, 0, 0, t, 0, 0, 0, 0, n, 0, 0, 0, 0, 1), this)
},
},
{
key: 'makeShear',
value: function (e, t, n, r, i, a) {
return (this.set(1, n, i, 0, e, 1, a, 0, t, r, 1, 0, 0, 0, 0, 1), this)
},
},
{
key: 'compose',
value: function (e, t, n) {
var r = this.elements,
i = t._x,
a = t._y,
o = t._z,
s = t._w,
u = i + i,
l = a + a,
c = o + o,
h = i * u,
d = i * l,
f = i * c,
p = a * l,
v = a * c,
m = o * c,
g = s * u,
y = s * l,
_ = s * c,
b = n.x,
x = n.y,
S = n.z
return (
(r[0] = (1 - (p + m)) * b),
(r[1] = (d + _) * b),
(r[2] = (f - y) * b),
(r[3] = 0),
(r[4] = (d - _) * x),
(r[5] = (1 - (h + m)) * x),
(r[6] = (v + g) * x),
(r[7] = 0),
(r[8] = (f + y) * S),
(r[9] = (v - g) * S),
(r[10] = (1 - (h + p)) * S),
(r[11] = 0),
(r[12] = e.x),
(r[13] = e.y),
(r[14] = e.z),
(r[15] = 1),
this
)
},
},
{
key: 'decompose',
value: function (e, t, n) {
var r = this.elements,
i = jh.set(r[0], r[1], r[2]).length(),
a = jh.set(r[4], r[5], r[6]).length(),
o = jh.set(r[8], r[9], r[10]).length()
;(this.determinant() < 0 && (i = -i),
(e.x = r[12]),
(e.y = r[13]),
(e.z = r[14]),
Qh.copy(this))
var s = 1 / i,
u = 1 / a,
l = 1 / o
return (
(Qh.elements[0] *= s),
(Qh.elements[1] *= s),
(Qh.elements[2] *= s),
(Qh.elements[4] *= u),
(Qh.elements[5] *= u),
(Qh.elements[6] *= u),
(Qh.elements[8] *= l),
(Qh.elements[9] *= l),
(Qh.elements[10] *= l),
t.setFromRotationMatrix(Qh),
(n.x = i),
(n.y = a),
(n.z = o),
this
)
},
},
{
key: 'makePerspective',
value: function (e, t, n, r, i, a) {
var o,
s,
u = arguments.length > 6 && void 0 !== arguments[6] ? arguments[6] : Ec,
l = this.elements,
c = (2 * i) / (t - e),
h = (2 * i) / (n - r),
d = (t + e) / (t - e),
f = (n + r) / (n - r)
if (u === Ec) ((o = -(a + i) / (a - i)), (s = (-2 * a * i) / (a - i)))
else {
if (u !== Cc)
throw new Error(
'THREE.Matrix4.makePerspective(): Invalid coordinate system: ' + u
)
;((o = -a / (a - i)), (s = (-a * i) / (a - i)))
}
return (
(l[0] = c),
(l[4] = 0),
(l[8] = d),
(l[12] = 0),
(l[1] = 0),
(l[5] = h),
(l[9] = f),
(l[13] = 0),
(l[2] = 0),
(l[6] = 0),
(l[10] = o),
(l[14] = s),
(l[3] = 0),
(l[7] = 0),
(l[11] = -1),
(l[15] = 0),
this
)
},
},
{
key: 'makeOrthographic',
value: function (e, t, n, r, i, a) {
var o,
s,
u = arguments.length > 6 && void 0 !== arguments[6] ? arguments[6] : Ec,
l = this.elements,
c = 1 / (t - e),
h = 1 / (n - r),
d = 1 / (a - i),
f = (t + e) * c,
p = (n + r) * h
if (u === Ec) ((o = (a + i) * d), (s = -2 * d))
else {
if (u !== Cc)
throw new Error(
'THREE.Matrix4.makeOrthographic(): Invalid coordinate system: ' + u
)
;((o = i * d), (s = -1 * d))
}
return (
(l[0] = 2 * c),
(l[4] = 0),
(l[8] = 0),
(l[12] = -f),
(l[1] = 0),
(l[5] = 2 * h),
(l[9] = 0),
(l[13] = -p),
(l[2] = 0),
(l[6] = 0),
(l[10] = s),
(l[14] = -o),
(l[3] = 0),
(l[7] = 0),
(l[11] = 0),
(l[15] = 1),
this
)
},
},
{
key: 'equals',
value: function (e) {
for (var t = this.elements, n = e.elements, r = 0; r < 16; r++)
if (t[r] !== n[r]) return !1
return !0
},
},
{
key: 'fromArray',
value: function (e) {
for (
var t = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : 0,
n = 0;
n < 16;
n++
)
this.elements[n] = e[n + t]
return this
},
},
{
key: 'toArray',
value: function () {
var e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : [],
t = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : 0,
n = this.elements
return (
(e[t] = n[0]),
(e[t + 1] = n[1]),
(e[t + 2] = n[2]),
(e[t + 3] = n[3]),
(e[t + 4] = n[4]),
(e[t + 5] = n[5]),
(e[t + 6] = n[6]),
(e[t + 7] = n[7]),
(e[t + 8] = n[8]),
(e[t + 9] = n[9]),
(e[t + 10] = n[10]),
(e[t + 11] = n[11]),
(e[t + 12] = n[12]),
(e[t + 13] = n[13]),
(e[t + 14] = n[14]),
(e[t + 15] = n[15]),
e
)
},
},
])
})(),
jh = new ph(),
Qh = new Gh(),
qh = new ph(0, 0, 0),
Xh = new ph(1, 1, 1),
Yh = new ph(),
Kh = new ph(),
Zh = new ph(),
Jh = new Gh(),
$h = new fh(),
ed = (function () {
return T(
function e() {
var t = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : 0,
n = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : 0,
r = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : 0,
i =
arguments.length > 3 && void 0 !== arguments[3]
? arguments[3]
: e.DEFAULT_ORDER
;(A(this, e),
(this.isEuler = !0),
(this._x = t),
(this._y = n),
(this._z = r),
(this._order = i))
},
[
{
key: 'x',
get: function () {
return this._x
},
set: function (e) {
;((this._x = e), this._onChangeCallback())
},
},
{
key: 'y',
get: function () {
return this._y
},
set: function (e) {
;((this._y = e), this._onChangeCallback())
},
},
{
key: 'z',
get: function () {
return this._z
},
set: function (e) {
;((this._z = e), this._onChangeCallback())
},
},
{
key: 'order',
get: function () {
return this._order
},
set: function (e) {
;((this._order = e), this._onChangeCallback())
},
},
{
key: 'set',
value: function (e, t, n) {
var r =
arguments.length > 3 && void 0 !== arguments[3] ? arguments[3] : this._order
return (
(this._x = e),
(this._y = t),
(this._z = n),
(this._order = r),
this._onChangeCallback(),
this
)
},
},
{
key: 'clone',
value: function () {
return new this.constructor(this._x, this._y, this._z, this._order)
},
},
{
key: 'copy',
value: function (e) {
return (
(this._x = e._x),
(this._y = e._y),
(this._z = e._z),
(this._order = e._order),
this._onChangeCallback(),
this
)
},
},
{
key: 'setFromRotationMatrix',
value: function (e) {
var t =
arguments.length > 1 && void 0 !== arguments[1]
? arguments[1]
: this._order,
n = !(arguments.length > 2 && void 0 !== arguments[2]) || arguments[2],
r = e.elements,
i = r[0],
a = r[4],
o = r[8],
s = r[1],
u = r[5],
l = r[9],
c = r[2],
h = r[6],
d = r[10]
switch (t) {
case 'XYZ':
;((this._y = Math.asin(Dc(o, -1, 1))),
Math.abs(o) < 0.9999999
? ((this._x = Math.atan2(-l, d)), (this._z = Math.atan2(-a, i)))
: ((this._x = Math.atan2(h, u)), (this._z = 0)))
break
case 'YXZ':
;((this._x = Math.asin(-Dc(l, -1, 1))),
Math.abs(l) < 0.9999999
? ((this._y = Math.atan2(o, d)), (this._z = Math.atan2(s, u)))
: ((this._y = Math.atan2(-c, i)), (this._z = 0)))
break
case 'ZXY':
;((this._x = Math.asin(Dc(h, -1, 1))),
Math.abs(h) < 0.9999999
? ((this._y = Math.atan2(-c, d)), (this._z = Math.atan2(-a, u)))
: ((this._y = 0), (this._z = Math.atan2(s, i))))
break
case 'ZYX':
;((this._y = Math.asin(-Dc(c, -1, 1))),
Math.abs(c) < 0.9999999
? ((this._x = Math.atan2(h, d)), (this._z = Math.atan2(s, i)))
: ((this._x = 0), (this._z = Math.atan2(-a, u))))
break
case 'YZX':
;((this._z = Math.asin(Dc(s, -1, 1))),
Math.abs(s) < 0.9999999
? ((this._x = Math.atan2(-l, u)), (this._y = Math.atan2(-c, i)))
: ((this._x = 0), (this._y = Math.atan2(o, d))))
break
case 'XZY':
;((this._z = Math.asin(-Dc(a, -1, 1))),
Math.abs(a) < 0.9999999
? ((this._x = Math.atan2(h, u)), (this._y = Math.atan2(o, i)))
: ((this._x = Math.atan2(-l, d)), (this._y = 0)))
break
default:
console.warn(
'THREE.Euler: .setFromRotationMatrix() encountered an unknown order: ' +
t
)
}
return ((this._order = t), !0 === n && this._onChangeCallback(), this)
},
},
{
key: 'setFromQuaternion',
value: function (e, t, n) {
return (
Jh.makeRotationFromQuaternion(e),
this.setFromRotationMatrix(Jh, t, n)
)
},
},
{
key: 'setFromVector3',
value: function (e) {
var t =
arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : this._order
return this.set(e.x, e.y, e.z, t)
},
},
{
key: 'reorder',
value: function (e) {
return ($h.setFromEuler(this), this.setFromQuaternion($h, e))
},
},
{
key: 'equals',
value: function (e) {
return (
e._x === this._x &&
e._y === this._y &&
e._z === this._z &&
e._order === this._order
)
},
},
{
key: 'fromArray',
value: function (e) {
return (
(this._x = e[0]),
(this._y = e[1]),
(this._z = e[2]),
void 0 !== e[3] && (this._order = e[3]),
this._onChangeCallback(),
this
)
},
},
{
key: 'toArray',
value: function () {
var e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : [],
t = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : 0
return (
(e[t] = this._x),
(e[t + 1] = this._y),
(e[t + 2] = this._z),
(e[t + 3] = this._order),
e
)
},
},
{
key: '_onChange',
value: function (e) {
return ((this._onChangeCallback = e), this)
},
},
{ key: '_onChangeCallback', value: function () {} },
{
key: Symbol.iterator,
value: d().m(function e() {
return d().w(
function (e) {
for (;;)
switch (e.n) {
case 0:
return ((e.n = 1), this._x)
case 1:
return ((e.n = 2), this._y)
case 2:
return ((e.n = 3), this._z)
case 3:
return ((e.n = 4), this._order)
case 4:
return e.a(2)
}
},
e,
this
)
}),
},
]
)
})()
ed.DEFAULT_ORDER = 'XYZ'
var td = (function () {
return T(
function e() {
;(A(this, e), (this.mask = 1))
},
[
{
key: 'set',
value: function (e) {
this.mask = (1 << e) >>> 0
},
},
{
key: 'enable',
value: function (e) {
this.mask |= 1 << e
},
},
{
key: 'enableAll',
value: function () {
this.mask = -1
},
},
{
key: 'toggle',
value: function (e) {
this.mask ^= 1 << e
},
},
{
key: 'disable',
value: function (e) {
this.mask &= ~(1 << e)
},
},
{
key: 'disableAll',
value: function () {
this.mask = 0
},
},
{
key: 'test',
value: function (e) {
return 0 !== (this.mask & e.mask)
},
},
{
key: 'isEnabled',
value: function (e) {
return !!(this.mask & (1 << e))
},
},
]
)
})(),
nd = 0,
rd = new ph(),
id = new fh(),
ad = new Gh(),
od = new ph(),
sd = new ph(),
ud = new ph(),
ld = new fh(),
cd = new ph(1, 0, 0),
hd = new ph(0, 1, 0),
dd = new ph(0, 0, 1),
fd = { type: 'added' },
pd = { type: 'removed' },
vd = { type: 'childadded', child: null },
md = { type: 'childremoved', child: null },
gd = (function (e) {
function t() {
var e
;(A(this, t),
((e = y(this, t)).isObject3D = !0),
Object.defineProperty(e, 'id', { value: nd++ }),
(e.uuid = Lc()),
(e.name = ''),
(e.type = 'Object3D'),
(e.parent = null),
(e.children = []),
(e.up = t.DEFAULT_UP.clone()))
var n = new ph(),
r = new ed(),
i = new fh(),
a = new ph(1, 1, 1)
return (
r._onChange(function () {
i.setFromEuler(r, !1)
}),
i._onChange(function () {
r.setFromQuaternion(i, void 0, !1)
}),
Object.defineProperties(e, {
position: { configurable: !0, enumerable: !0, value: n },
rotation: { configurable: !0, enumerable: !0, value: r },
quaternion: { configurable: !0, enumerable: !0, value: i },
scale: { configurable: !0, enumerable: !0, value: a },
modelViewMatrix: { value: new Gh() },
normalMatrix: { value: new Hc() },
}),
(e.matrix = new Gh()),
(e.matrixWorld = new Gh()),
(e.matrixAutoUpdate = t.DEFAULT_MATRIX_AUTO_UPDATE),
(e.matrixWorldAutoUpdate = t.DEFAULT_MATRIX_WORLD_AUTO_UPDATE),
(e.matrixWorldNeedsUpdate = !1),
(e.layers = new td()),
(e.visible = !0),
(e.castShadow = !1),
(e.receiveShadow = !1),
(e.frustumCulled = !0),
(e.renderOrder = 0),
(e.animations = []),
(e.userData = {}),
e
)
}
return (
x(t, e),
T(t, [
{ key: 'onBeforeShadow', value: function () {} },
{ key: 'onAfterShadow', value: function () {} },
{ key: 'onBeforeRender', value: function () {} },
{ key: 'onAfterRender', value: function () {} },
{
key: 'applyMatrix4',
value: function (e) {
;(this.matrixAutoUpdate && this.updateMatrix(),
this.matrix.premultiply(e),
this.matrix.decompose(this.position, this.quaternion, this.scale))
},
},
{
key: 'applyQuaternion',
value: function (e) {
return (this.quaternion.premultiply(e), this)
},
},
{
key: 'setRotationFromAxisAngle',
value: function (e, t) {
this.quaternion.setFromAxisAngle(e, t)
},
},
{
key: 'setRotationFromEuler',
value: function (e) {
this.quaternion.setFromEuler(e, !0)
},
},
{
key: 'setRotationFromMatrix',
value: function (e) {
this.quaternion.setFromRotationMatrix(e)
},
},
{
key: 'setRotationFromQuaternion',
value: function (e) {
this.quaternion.copy(e)
},
},
{
key: 'rotateOnAxis',
value: function (e, t) {
return (id.setFromAxisAngle(e, t), this.quaternion.multiply(id), this)
},
},
{
key: 'rotateOnWorldAxis',
value: function (e, t) {
return (id.setFromAxisAngle(e, t), this.quaternion.premultiply(id), this)
},
},
{
key: 'rotateX',
value: function (e) {
return this.rotateOnAxis(cd, e)
},
},
{
key: 'rotateY',
value: function (e) {
return this.rotateOnAxis(hd, e)
},
},
{
key: 'rotateZ',
value: function (e) {
return this.rotateOnAxis(dd, e)
},
},
{
key: 'translateOnAxis',
value: function (e, t) {
return (
rd.copy(e).applyQuaternion(this.quaternion),
this.position.add(rd.multiplyScalar(t)),
this
)
},
},
{
key: 'translateX',
value: function (e) {
return this.translateOnAxis(cd, e)
},
},
{
key: 'translateY',
value: function (e) {
return this.translateOnAxis(hd, e)
},
},
{
key: 'translateZ',
value: function (e) {
return this.translateOnAxis(dd, e)
},
},
{
key: 'localToWorld',
value: function (e) {
return (this.updateWorldMatrix(!0, !1), e.applyMatrix4(this.matrixWorld))
},
},
{
key: 'worldToLocal',
value: function (e) {
return (
this.updateWorldMatrix(!0, !1),
e.applyMatrix4(ad.copy(this.matrixWorld).invert())
)
},
},
{
key: 'lookAt',
value: function (e, t, n) {
e.isVector3 ? od.copy(e) : od.set(e, t, n)
var r = this.parent
;(this.updateWorldMatrix(!0, !1),
sd.setFromMatrixPosition(this.matrixWorld),
this.isCamera || this.isLight
? ad.lookAt(sd, od, this.up)
: ad.lookAt(od, sd, this.up),
this.quaternion.setFromRotationMatrix(ad),
r &&
(ad.extractRotation(r.matrixWorld),
id.setFromRotationMatrix(ad),
this.quaternion.premultiply(id.invert())))
},
},
{
key: 'add',
value: function (e) {
if (arguments.length > 1) {
for (var t = 0; t < arguments.length; t++) this.add(arguments[t])
return this
}
return e === this
? (console.error(
"THREE.Object3D.add: object can't be added as a child of itself.",
e
),
this)
: (e && e.isObject3D
? (e.removeFromParent(),
(e.parent = this),
this.children.push(e),
e.dispatchEvent(fd),
(vd.child = e),
this.dispatchEvent(vd),
(vd.child = null))
: console.error(
'THREE.Object3D.add: object not an instance of THREE.Object3D.',
e
),
this)
},
},
{
key: 'remove',
value: function (e) {
if (arguments.length > 1) {
for (var t = 0; t < arguments.length; t++) this.remove(arguments[t])
return this
}
var n = this.children.indexOf(e)
return (
-1 !== n &&
((e.parent = null),
this.children.splice(n, 1),
e.dispatchEvent(pd),
(md.child = e),
this.dispatchEvent(md),
(md.child = null)),
this
)
},
},
{
key: 'removeFromParent',
value: function () {
var e = this.parent
return (null !== e && e.remove(this), this)
},
},
{
key: 'clear',
value: function () {
return this.remove.apply(this, I(this.children))
},
},
{
key: 'attach',
value: function (e) {
return (
this.updateWorldMatrix(!0, !1),
ad.copy(this.matrixWorld).invert(),
null !== e.parent &&
(e.parent.updateWorldMatrix(!0, !1), ad.multiply(e.parent.matrixWorld)),
e.applyMatrix4(ad),
e.removeFromParent(),
(e.parent = this),
this.children.push(e),
e.updateWorldMatrix(!1, !0),
e.dispatchEvent(fd),
(vd.child = e),
this.dispatchEvent(vd),
(vd.child = null),
this
)
},
},
{
key: 'getObjectById',
value: function (e) {
return this.getObjectByProperty('id', e)
},
},
{
key: 'getObjectByName',
value: function (e) {
return this.getObjectByProperty('name', e)
},
},
{
key: 'getObjectByProperty',
value: function (e, t) {
if (this[e] === t) return this
for (var n = 0, r = this.children.length; n < r; n++) {
var i = this.children[n].getObjectByProperty(e, t)
if (void 0 !== i) return i
}
},
},
{
key: 'getObjectsByProperty',
value: function (e, t) {
var n = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : []
this[e] === t && n.push(this)
for (var r = this.children, i = 0, a = r.length; i < a; i++)
r[i].getObjectsByProperty(e, t, n)
return n
},
},
{
key: 'getWorldPosition',
value: function (e) {
return (
this.updateWorldMatrix(!0, !1),
e.setFromMatrixPosition(this.matrixWorld)
)
},
},
{
key: 'getWorldQuaternion',
value: function (e) {
return (
this.updateWorldMatrix(!0, !1),
this.matrixWorld.decompose(sd, e, ud),
e
)
},
},
{
key: 'getWorldScale',
value: function (e) {
return (
this.updateWorldMatrix(!0, !1),
this.matrixWorld.decompose(sd, ld, e),
e
)
},
},
{
key: 'getWorldDirection',
value: function (e) {
this.updateWorldMatrix(!0, !1)
var t = this.matrixWorld.elements
return e.set(t[8], t[9], t[10]).normalize()
},
},
{ key: 'raycast', value: function () {} },
{
key: 'traverse',
value: function (e) {
e(this)
for (var t = this.children, n = 0, r = t.length; n < r; n++) t[n].traverse(e)
},
},
{
key: 'traverseVisible',
value: function (e) {
if (!1 !== this.visible) {
e(this)
for (var t = this.children, n = 0, r = t.length; n < r; n++)
t[n].traverseVisible(e)
}
},
},
{
key: 'traverseAncestors',
value: function (e) {
var t = this.parent
null !== t && (e(t), t.traverseAncestors(e))
},
},
{
key: 'updateMatrix',
value: function () {
;(this.matrix.compose(this.position, this.quaternion, this.scale),
(this.matrixWorldNeedsUpdate = !0))
},
},
{
key: 'updateMatrixWorld',
value: function (e) {
;(this.matrixAutoUpdate && this.updateMatrix(),
(this.matrixWorldNeedsUpdate || e) &&
(!0 === this.matrixWorldAutoUpdate &&
(null === this.parent
? this.matrixWorld.copy(this.matrix)
: this.matrixWorld.multiplyMatrices(
this.parent.matrixWorld,
this.matrix
)),
(this.matrixWorldNeedsUpdate = !1),
(e = !0)))
for (var t = this.children, n = 0, r = t.length; n < r; n++) {
t[n].updateMatrixWorld(e)
}
},
},
{
key: 'updateWorldMatrix',
value: function (e, t) {
var n = this.parent
if (
(!0 === e && null !== n && n.updateWorldMatrix(!0, !1),
this.matrixAutoUpdate && this.updateMatrix(),
!0 === this.matrixWorldAutoUpdate &&
(null === this.parent
? this.matrixWorld.copy(this.matrix)
: this.matrixWorld.multiplyMatrices(
this.parent.matrixWorld,
this.matrix
)),
!0 === t)
)
for (var r = this.children, i = 0, a = r.length; i < a; i++) {
r[i].updateWorldMatrix(!1, !0)
}
},
},
{
key: 'toJSON',
value: function (e) {
var t = void 0 === e || 'string' == typeof e,
n = {}
t &&
((e = {
geometries: {},
materials: {},
textures: {},
images: {},
shapes: {},
skeletons: {},
animations: {},
nodes: {},
}),
(n.metadata = {
version: 4.6,
type: 'Object',
generator: 'Object3D.toJSON',
}))
var r = {}
function i(t, n) {
return (void 0 === t[n.uuid] && (t[n.uuid] = n.toJSON(e)), n.uuid)
}
if (
((r.uuid = this.uuid),
(r.type = this.type),
'' !== this.name && (r.name = this.name),
!0 === this.castShadow && (r.castShadow = !0),
!0 === this.receiveShadow && (r.receiveShadow = !0),
!1 === this.visible && (r.visible = !1),
!1 === this.frustumCulled && (r.frustumCulled = !1),
0 !== this.renderOrder && (r.renderOrder = this.renderOrder),
Object.keys(this.userData).length > 0 && (r.userData = this.userData),
(r.layers = this.layers.mask),
(r.matrix = this.matrix.toArray()),
(r.up = this.up.toArray()),
!1 === this.matrixAutoUpdate && (r.matrixAutoUpdate = !1),
this.isInstancedMesh &&
((r.type = 'InstancedMesh'),
(r.count = this.count),
(r.instanceMatrix = this.instanceMatrix.toJSON()),
null !== this.instanceColor &&
(r.instanceColor = this.instanceColor.toJSON())),
this.isBatchedMesh &&
((r.type = 'BatchedMesh'),
(r.perObjectFrustumCulled = this.perObjectFrustumCulled),
(r.sortObjects = this.sortObjects),
(r.drawRanges = this._drawRanges),
(r.reservedRanges = this._reservedRanges),
(r.visibility = this._visibility),
(r.active = this._active),
(r.bounds = this._bounds.map(function (e) {
return {
boxInitialized: e.boxInitialized,
boxMin: e.box.min.toArray(),
boxMax: e.box.max.toArray(),
sphereInitialized: e.sphereInitialized,
sphereRadius: e.sphere.radius,
sphereCenter: e.sphere.center.toArray(),
}
})),
(r.maxInstanceCount = this._maxInstanceCount),
(r.maxVertexCount = this._maxVertexCount),
(r.maxIndexCount = this._maxIndexCount),
(r.geometryInitialized = this._geometryInitialized),
(r.geometryCount = this._geometryCount),
(r.matricesTexture = this._matricesTexture.toJSON(e)),
null !== this._colorsTexture &&
(r.colorsTexture = this._colorsTexture.toJSON(e)),
null !== this.boundingSphere &&
(r.boundingSphere = {
center: r.boundingSphere.center.toArray(),
radius: r.boundingSphere.radius,
}),
null !== this.boundingBox &&
(r.boundingBox = {
min: r.boundingBox.min.toArray(),
max: r.boundingBox.max.toArray(),
})),
this.isScene)
)
(this.background &&
(this.background.isColor
? (r.background = this.background.toJSON())
: this.background.isTexture &&
(r.background = this.background.toJSON(e).uuid)),
this.environment &&
this.environment.isTexture &&
!0 !== this.environment.isRenderTargetTexture &&
(r.environment = this.environment.toJSON(e).uuid))
else if (this.isMesh || this.isLine || this.isPoints) {
r.geometry = i(e.geometries, this.geometry)
var a = this.geometry.parameters
if (void 0 !== a && void 0 !== a.shapes) {
var o = a.shapes
if (Array.isArray(o))
for (var s = 0, u = o.length; s < u; s++) {
var l = o[s]
i(e.shapes, l)
}
else i(e.shapes, o)
}
}
if (
(this.isSkinnedMesh &&
((r.bindMode = this.bindMode),
(r.bindMatrix = this.bindMatrix.toArray()),
void 0 !== this.skeleton &&
(i(e.skeletons, this.skeleton), (r.skeleton = this.skeleton.uuid))),
void 0 !== this.material)
)
if (Array.isArray(this.material)) {
for (var c = [], h = 0, d = this.material.length; h < d; h++)
c.push(i(e.materials, this.material[h]))
r.material = c
} else r.material = i(e.materials, this.material)
if (this.children.length > 0) {
r.children = []
for (var f = 0; f < this.children.length; f++)
r.children.push(this.children[f].toJSON(e).object)
}
if (this.animations.length > 0) {
r.animations = []
for (var p = 0; p < this.animations.length; p++) {
var v = this.animations[p]
r.animations.push(i(e.animations, v))
}
}
if (t) {
var m = w(e.geometries),
g = w(e.materials),
y = w(e.textures),
_ = w(e.images),
b = w(e.shapes),
x = w(e.skeletons),
S = w(e.animations),
A = w(e.nodes)
;(m.length > 0 && (n.geometries = m),
g.length > 0 && (n.materials = g),
y.length > 0 && (n.textures = y),
_.length > 0 && (n.images = _),
b.length > 0 && (n.shapes = b),
x.length > 0 && (n.skeletons = x),
S.length > 0 && (n.animations = S),
A.length > 0 && (n.nodes = A))
}
return ((n.object = r), n)
function w(e) {
var t = []
for (var n in e) {
var r = e[n]
;(delete r.metadata, t.push(r))
}
return t
}
},
},
{
key: 'clone',
value: function (e) {
return new this.constructor().copy(this, e)
},
},
{
key: 'copy',
value: function (e) {
var t = !(arguments.length > 1 && void 0 !== arguments[1]) || arguments[1]
if (
((this.name = e.name),
this.up.copy(e.up),
this.position.copy(e.position),
(this.rotation.order = e.rotation.order),
this.quaternion.copy(e.quaternion),
this.scale.copy(e.scale),
this.matrix.copy(e.matrix),
this.matrixWorld.copy(e.matrixWorld),
(this.matrixAutoUpdate = e.matrixAutoUpdate),
(this.matrixWorldAutoUpdate = e.matrixWorldAutoUpdate),
(this.matrixWorldNeedsUpdate = e.matrixWorldNeedsUpdate),
(this.layers.mask = e.layers.mask),
(this.visible = e.visible),
(this.castShadow = e.castShadow),
(this.receiveShadow = e.receiveShadow),
(this.frustumCulled = e.frustumCulled),
(this.renderOrder = e.renderOrder),
(this.animations = e.animations.slice()),
(this.userData = JSON.parse(JSON.stringify(e.userData))),
!0 === t)
)
for (var n = 0; n < e.children.length; n++) {
var r = e.children[n]
this.add(r.clone())
}
return this
},
},
])
)
})(kc)
;((gd.DEFAULT_UP = new ph(0, 1, 0)),
(gd.DEFAULT_MATRIX_AUTO_UPDATE = !0),
(gd.DEFAULT_MATRIX_WORLD_AUTO_UPDATE = !0))
var yd = new ph(),
_d = new ph(),
bd = new ph(),
xd = new ph(),
Sd = new ph(),
Ad = new ph(),
wd = new ph(),
Td = new ph(),
Md = new ph(),
Ed = new ph(),
Cd = new uh(),
kd = new uh(),
Rd = new uh(),
Id = (function () {
function e() {
var t = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : new ph(),
n = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : new ph(),
r = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : new ph()
;(A(this, e), (this.a = t), (this.b = n), (this.c = r))
}
return T(
e,
[
{
key: 'set',
value: function (e, t, n) {
return (this.a.copy(e), this.b.copy(t), this.c.copy(n), this)
},
},
{
key: 'setFromPointsAndIndices',
value: function (e, t, n, r) {
return (this.a.copy(e[t]), this.b.copy(e[n]), this.c.copy(e[r]), this)
},
},
{
key: 'setFromAttributeAndIndices',
value: function (e, t, n, r) {
return (
this.a.fromBufferAttribute(e, t),
this.b.fromBufferAttribute(e, n),
this.c.fromBufferAttribute(e, r),
this
)
},
},
{
key: 'clone',
value: function () {
return new this.constructor().copy(this)
},
},
{
key: 'copy',
value: function (e) {
return (this.a.copy(e.a), this.b.copy(e.b), this.c.copy(e.c), this)
},
},
{
key: 'getArea',
value: function () {
return (
yd.subVectors(this.c, this.b),
_d.subVectors(this.a, this.b),
0.5 * yd.cross(_d).length()
)
},
},
{
key: 'getMidpoint',
value: function (e) {
return e
.addVectors(this.a, this.b)
.add(this.c)
.multiplyScalar(1 / 3)
},
},
{
key: 'getNormal',
value: function (t) {
return e.getNormal(this.a, this.b, this.c, t)
},
},
{
key: 'getPlane',
value: function (e) {
return e.setFromCoplanarPoints(this.a, this.b, this.c)
},
},
{
key: 'getBarycoord',
value: function (t, n) {
return e.getBarycoord(t, this.a, this.b, this.c, n)
},
},
{
key: 'getInterpolation',
value: function (t, n, r, i, a) {
return e.getInterpolation(t, this.a, this.b, this.c, n, r, i, a)
},
},
{
key: 'containsPoint',
value: function (t) {
return e.containsPoint(t, this.a, this.b, this.c)
},
},
{
key: 'isFrontFacing',
value: function (t) {
return e.isFrontFacing(this.a, this.b, this.c, t)
},
},
{
key: 'intersectsBox',
value: function (e) {
return e.intersectsTriangle(this)
},
},
{
key: 'closestPointToPoint',
value: function (e, t) {
var n,
r,
i = this.a,
a = this.b,
o = this.c
;(Sd.subVectors(a, i), Ad.subVectors(o, i), Td.subVectors(e, i))
var s = Sd.dot(Td),
u = Ad.dot(Td)
if (s <= 0 && u <= 0) return t.copy(i)
Md.subVectors(e, a)
var l = Sd.dot(Md),
c = Ad.dot(Md)
if (l >= 0 && c <= l) return t.copy(a)
var h = s * c - l * u
if (h <= 0 && s >= 0 && l <= 0)
return ((n = s / (s - l)), t.copy(i).addScaledVector(Sd, n))
Ed.subVectors(e, o)
var d = Sd.dot(Ed),
f = Ad.dot(Ed)
if (f >= 0 && d <= f) return t.copy(o)
var p = d * u - s * f
if (p <= 0 && u >= 0 && f <= 0)
return ((r = u / (u - f)), t.copy(i).addScaledVector(Ad, r))
var v = l * f - d * c
if (v <= 0 && c - l >= 0 && d - f >= 0)
return (
wd.subVectors(o, a),
(r = (c - l) / (c - l + (d - f))),
t.copy(a).addScaledVector(wd, r)
)
var m = 1 / (v + p + h)
return (
(n = p * m),
(r = h * m),
t.copy(i).addScaledVector(Sd, n).addScaledVector(Ad, r)
)
},
},
{
key: 'equals',
value: function (e) {
return e.a.equals(this.a) && e.b.equals(this.b) && e.c.equals(this.c)
},
},
],
[
{
key: 'getNormal',
value: function (e, t, n, r) {
;(r.subVectors(n, t), yd.subVectors(e, t), r.cross(yd))
var i = r.lengthSq()
return i > 0 ? r.multiplyScalar(1 / Math.sqrt(i)) : r.set(0, 0, 0)
},
},
{
key: 'getBarycoord',
value: function (e, t, n, r, i) {
;(yd.subVectors(r, t), _d.subVectors(n, t), bd.subVectors(e, t))
var a = yd.dot(yd),
o = yd.dot(_d),
s = yd.dot(bd),
u = _d.dot(_d),
l = _d.dot(bd),
c = a * u - o * o
if (0 === c) return (i.set(0, 0, 0), null)
var h = 1 / c,
d = (u * s - o * l) * h,
f = (a * l - o * s) * h
return i.set(1 - d - f, f, d)
},
},
{
key: 'containsPoint',
value: function (e, t, n, r) {
return (
null !== this.getBarycoord(e, t, n, r, xd) &&
xd.x >= 0 &&
xd.y >= 0 &&
xd.x + xd.y <= 1
)
},
},
{
key: 'getInterpolation',
value: function (e, t, n, r, i, a, o, s) {
return null === this.getBarycoord(e, t, n, r, xd)
? ((s.x = 0), (s.y = 0), 'z' in s && (s.z = 0), 'w' in s && (s.w = 0), null)
: (s.setScalar(0),
s.addScaledVector(i, xd.x),
s.addScaledVector(a, xd.y),
s.addScaledVector(o, xd.z),
s)
},
},
{
key: 'getInterpolatedAttribute',
value: function (e, t, n, r, i, a) {
return (
Cd.setScalar(0),
kd.setScalar(0),
Rd.setScalar(0),
Cd.fromBufferAttribute(e, t),
kd.fromBufferAttribute(e, n),
Rd.fromBufferAttribute(e, r),
a.setScalar(0),
a.addScaledVector(Cd, i.x),
a.addScaledVector(kd, i.y),
a.addScaledVector(Rd, i.z),
a
)
},
},
{
key: 'isFrontFacing',
value: function (e, t, n, r) {
return (yd.subVectors(n, t), _d.subVectors(e, t), yd.cross(_d).dot(r) < 0)
},
},
]
)
})(),
Nd = {
aliceblue: 15792383,
antiquewhite: 16444375,
aqua: 65535,
aquamarine: 8388564,
azure: 15794175,
beige: 16119260,
bisque: 16770244,
black: 0,
blanchedalmond: 16772045,
blue: 255,
blueviolet: 9055202,
brown: 10824234,
burlywood: 14596231,
cadetblue: 6266528,
chartreuse: 8388352,
chocolate: 13789470,
coral: 16744272,
cornflowerblue: 6591981,
cornsilk: 16775388,
crimson: 14423100,
cyan: 65535,
darkblue: 139,
darkcyan: 35723,
darkgoldenrod: 12092939,
darkgray: 11119017,
darkgreen: 25600,
darkgrey: 11119017,
darkkhaki: 12433259,
darkmagenta: 9109643,
darkolivegreen: 5597999,
darkorange: 16747520,
darkorchid: 10040012,
darkred: 9109504,
darksalmon: 15308410,
darkseagreen: 9419919,
darkslateblue: 4734347,
darkslategray: 3100495,
darkslategrey: 3100495,
darkturquoise: 52945,
darkviolet: 9699539,
deeppink: 16716947,
deepskyblue: 49151,
dimgray: 6908265,
dimgrey: 6908265,
dodgerblue: 2003199,
firebrick: 11674146,
floralwhite: 16775920,
forestgreen: 2263842,
fuchsia: 16711935,
gainsboro: 14474460,
ghostwhite: 16316671,
gold: 16766720,
goldenrod: 14329120,
gray: 8421504,
green: 32768,
greenyellow: 11403055,
grey: 8421504,
honeydew: 15794160,
hotpink: 16738740,
indianred: 13458524,
indigo: 4915330,
ivory: 16777200,
khaki: 15787660,
lavender: 15132410,
lavenderblush: 16773365,
lawngreen: 8190976,
lemonchiffon: 16775885,
lightblue: 11393254,
lightcoral: 15761536,
lightcyan: 14745599,
lightgoldenrodyellow: 16448210,
lightgray: 13882323,
lightgreen: 9498256,
lightgrey: 13882323,
lightpink: 16758465,
lightsalmon: 16752762,
lightseagreen: 2142890,
lightskyblue: 8900346,
lightslategray: 7833753,
lightslategrey: 7833753,
lightsteelblue: 11584734,
lightyellow: 16777184,
lime: 65280,
limegreen: 3329330,
linen: 16445670,
magenta: 16711935,
maroon: 8388608,
mediumaquamarine: 6737322,
mediumblue: 205,
mediumorchid: 12211667,
mediumpurple: 9662683,
mediumseagreen: 3978097,
mediumslateblue: 8087790,
mediumspringgreen: 64154,
mediumturquoise: 4772300,
mediumvioletred: 13047173,
midnightblue: 1644912,
mintcream: 16121850,
mistyrose: 16770273,
moccasin: 16770229,
navajowhite: 16768685,
navy: 128,
oldlace: 16643558,
olive: 8421376,
olivedrab: 7048739,
orange: 16753920,
orangered: 16729344,
orchid: 14315734,
palegoldenrod: 15657130,
palegreen: 10025880,
paleturquoise: 11529966,
palevioletred: 14381203,
papayawhip: 16773077,
peachpuff: 16767673,
peru: 13468991,
pink: 16761035,
plum: 14524637,
powderblue: 11591910,
purple: 8388736,
rebeccapurple: 6697881,
red: 16711680,
rosybrown: 12357519,
royalblue: 4286945,
saddlebrown: 9127187,
salmon: 16416882,
sandybrown: 16032864,
seagreen: 3050327,
seashell: 16774638,
sienna: 10506797,
silver: 12632256,
skyblue: 8900331,
slateblue: 6970061,
slategray: 7372944,
slategrey: 7372944,
snow: 16775930,
springgreen: 65407,
steelblue: 4620980,
tan: 13808780,
teal: 32896,
thistle: 14204888,
tomato: 16737095,
turquoise: 4251856,
violet: 15631086,
wheat: 16113331,
white: 16777215,
whitesmoke: 16119285,
yellow: 16776960,
yellowgreen: 10145074,
},
Pd = { h: 0, s: 0, l: 0 },
Ld = { h: 0, s: 0, l: 0 }
function Dd(e, t, n) {
return (
n < 0 && (n += 1),
n > 1 && (n -= 1),
n < 1 / 6
? e + 6 * (t - e) * n
: n < 0.5
? t
: n < 2 / 3
? e + 6 * (t - e) * (2 / 3 - n)
: e
)
}
var Od = (function () {
return T(
function e(t, n, r) {
return (
A(this, e),
(this.isColor = !0),
(this.r = 1),
(this.g = 1),
(this.b = 1),
this.set(t, n, r)
)
},
[
{
key: 'set',
value: function (e, t, n) {
if (void 0 === t && void 0 === n) {
var r = e
r && r.isColor
? this.copy(r)
: 'number' == typeof r
? this.setHex(r)
: 'string' == typeof r && this.setStyle(r)
} else this.setRGB(e, t, n)
return this
},
},
{
key: 'setScalar',
value: function (e) {
return ((this.r = e), (this.g = e), (this.b = e), this)
},
},
{
key: 'setHex',
value: function (e) {
var t = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : _c
return (
(e = Math.floor(e)),
(this.r = ((e >> 16) & 255) / 255),
(this.g = ((e >> 8) & 255) / 255),
(this.b = (255 & e) / 255),
$c.toWorkingColorSpace(this, t),
this
)
},
},
{
key: 'setRGB',
value: function (e, t, n) {
var r =
arguments.length > 3 && void 0 !== arguments[3]
? arguments[3]
: $c.workingColorSpace
return (
(this.r = e),
(this.g = t),
(this.b = n),
$c.toWorkingColorSpace(this, r),
this
)
},
},
{
key: 'setHSL',
value: function (e, t, n) {
var r =
arguments.length > 3 && void 0 !== arguments[3]
? arguments[3]
: $c.workingColorSpace
if (((e = Oc(e, 1)), (t = Dc(t, 0, 1)), (n = Dc(n, 0, 1)), 0 === t))
this.r = this.g = this.b = n
else {
var i = n <= 0.5 ? n * (1 + t) : n + t - n * t,
a = 2 * n - i
;((this.r = Dd(a, i, e + 1 / 3)),
(this.g = Dd(a, i, e)),
(this.b = Dd(a, i, e - 1 / 3)))
}
return ($c.toWorkingColorSpace(this, r), this)
},
},
{
key: 'setStyle',
value: function (e) {
var t,
n = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : _c
function r(t) {
void 0 !== t &&
parseFloat(t) < 1 &&
console.warn('THREE.Color: Alpha component of ' + e + ' will be ignored.')
}
if ((t = /^(\w+)\(([^\)]*)\)/.exec(e))) {
var i,
a = t[1],
o = t[2]
switch (a) {
case 'rgb':
case 'rgba':
if (
(i =
/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(
o
))
)
return (
r(i[4]),
this.setRGB(
Math.min(255, parseInt(i[1], 10)) / 255,
Math.min(255, parseInt(i[2], 10)) / 255,
Math.min(255, parseInt(i[3], 10)) / 255,
n
)
)
if (
(i =
/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(
o
))
)
return (
r(i[4]),
this.setRGB(
Math.min(100, parseInt(i[1], 10)) / 100,
Math.min(100, parseInt(i[2], 10)) / 100,
Math.min(100, parseInt(i[3], 10)) / 100,
n
)
)
break
case 'hsl':
case 'hsla':
if (
(i =
/^\s*(\d*\.?\d+)\s*,\s*(\d*\.?\d+)\%\s*,\s*(\d*\.?\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(
o
))
)
return (
r(i[4]),
this.setHSL(
parseFloat(i[1]) / 360,
parseFloat(i[2]) / 100,
parseFloat(i[3]) / 100,
n
)
)
break
default:
console.warn('THREE.Color: Unknown color model ' + e)
}
} else if ((t = /^\#([A-Fa-f\d]+)$/.exec(e))) {
var s = t[1],
u = s.length
if (3 === u)
return this.setRGB(
parseInt(s.charAt(0), 16) / 15,
parseInt(s.charAt(1), 16) / 15,
parseInt(s.charAt(2), 16) / 15,
n
)
if (6 === u) return this.setHex(parseInt(s, 16), n)
console.warn('THREE.Color: Invalid hex color ' + e)
} else if (e && e.length > 0) return this.setColorName(e, n)
return this
},
},
{
key: 'setColorName',
value: function (e) {
var t = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : _c,
n = Nd[e.toLowerCase()]
return (
void 0 !== n
? this.setHex(n, t)
: console.warn('THREE.Color: Unknown color ' + e),
this
)
},
},
{
key: 'clone',
value: function () {
return new this.constructor(this.r, this.g, this.b)
},
},
{
key: 'copy',
value: function (e) {
return ((this.r = e.r), (this.g = e.g), (this.b = e.b), this)
},
},
{
key: 'copySRGBToLinear',
value: function (e) {
return ((this.r = eh(e.r)), (this.g = eh(e.g)), (this.b = eh(e.b)), this)
},
},
{
key: 'copyLinearToSRGB',
value: function (e) {
return ((this.r = th(e.r)), (this.g = th(e.g)), (this.b = th(e.b)), this)
},
},
{
key: 'convertSRGBToLinear',
value: function () {
return (this.copySRGBToLinear(this), this)
},
},
{
key: 'convertLinearToSRGB',
value: function () {
return (this.copyLinearToSRGB(this), this)
},
},
{
key: 'getHex',
value: function () {
var e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : _c
return (
$c.fromWorkingColorSpace(Fd.copy(this), e),
65536 * Math.round(Dc(255 * Fd.r, 0, 255)) +
256 * Math.round(Dc(255 * Fd.g, 0, 255)) +
Math.round(Dc(255 * Fd.b, 0, 255))
)
},
},
{
key: 'getHexString',
value: function () {
var e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : _c
return ('000000' + this.getHex(e).toString(16)).slice(-6)
},
},
{
key: 'getHSL',
value: function (e) {
var t =
arguments.length > 1 && void 0 !== arguments[1]
? arguments[1]
: $c.workingColorSpace
$c.fromWorkingColorSpace(Fd.copy(this), t)
var n,
r,
i = Fd.r,
a = Fd.g,
o = Fd.b,
s = Math.max(i, a, o),
u = Math.min(i, a, o),
l = (u + s) / 2
if (u === s) ((n = 0), (r = 0))
else {
var c = s - u
switch (((r = l <= 0.5 ? c / (s + u) : c / (2 - s - u)), s)) {
case i:
n = (a - o) / c + (a < o ? 6 : 0)
break
case a:
n = (o - i) / c + 2
break
case o:
n = (i - a) / c + 4
}
n /= 6
}
return ((e.h = n), (e.s = r), (e.l = l), e)
},
},
{
key: 'getRGB',
value: function (e) {
var t =
arguments.length > 1 && void 0 !== arguments[1]
? arguments[1]
: $c.workingColorSpace
return (
$c.fromWorkingColorSpace(Fd.copy(this), t),
(e.r = Fd.r),
(e.g = Fd.g),
(e.b = Fd.b),
e
)
},
},
{
key: 'getStyle',
value: function () {
var e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : _c
$c.fromWorkingColorSpace(Fd.copy(this), e)
var t = Fd.r,
n = Fd.g,
r = Fd.b
return e !== _c
? 'color('
.concat(e, ' ')
.concat(t.toFixed(3), ' ')
.concat(n.toFixed(3), ' ')
.concat(r.toFixed(3), ')')
: 'rgb('
.concat(Math.round(255 * t), ',')
.concat(Math.round(255 * n), ',')
.concat(Math.round(255 * r), ')')
},
},
{
key: 'offsetHSL',
value: function (e, t, n) {
return (this.getHSL(Pd), this.setHSL(Pd.h + e, Pd.s + t, Pd.l + n))
},
},
{
key: 'add',
value: function (e) {
return ((this.r += e.r), (this.g += e.g), (this.b += e.b), this)
},
},
{
key: 'addColors',
value: function (e, t) {
return (
(this.r = e.r + t.r),
(this.g = e.g + t.g),
(this.b = e.b + t.b),
this
)
},
},
{
key: 'addScalar',
value: function (e) {
return ((this.r += e), (this.g += e), (this.b += e), this)
},
},
{
key: 'sub',
value: function (e) {
return (
(this.r = Math.max(0, this.r - e.r)),
(this.g = Math.max(0, this.g - e.g)),
(this.b = Math.max(0, this.b - e.b)),
this
)
},
},
{
key: 'multiply',
value: function (e) {
return ((this.r *= e.r), (this.g *= e.g), (this.b *= e.b), this)
},
},
{
key: 'multiplyScalar',
value: function (e) {
return ((this.r *= e), (this.g *= e), (this.b *= e), this)
},
},
{
key: 'lerp',
value: function (e, t) {
return (
(this.r += (e.r - this.r) * t),
(this.g += (e.g - this.g) * t),
(this.b += (e.b - this.b) * t),
this
)
},
},
{
key: 'lerpColors',
value: function (e, t, n) {
return (
(this.r = e.r + (t.r - e.r) * n),
(this.g = e.g + (t.g - e.g) * n),
(this.b = e.b + (t.b - e.b) * n),
this
)
},
},
{
key: 'lerpHSL',
value: function (e, t) {
;(this.getHSL(Pd), e.getHSL(Ld))
var n = Fc(Pd.h, Ld.h, t),
r = Fc(Pd.s, Ld.s, t),
i = Fc(Pd.l, Ld.l, t)
return (this.setHSL(n, r, i), this)
},
},
{
key: 'setFromVector3',
value: function (e) {
return ((this.r = e.x), (this.g = e.y), (this.b = e.z), this)
},
},
{
key: 'applyMatrix3',
value: function (e) {
var t = this.r,
n = this.g,
r = this.b,
i = e.elements
return (
(this.r = i[0] * t + i[3] * n + i[6] * r),
(this.g = i[1] * t + i[4] * n + i[7] * r),
(this.b = i[2] * t + i[5] * n + i[8] * r),
this
)
},
},
{
key: 'equals',
value: function (e) {
return e.r === this.r && e.g === this.g && e.b === this.b
},
},
{
key: 'fromArray',
value: function (e) {
var t = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : 0
return ((this.r = e[t]), (this.g = e[t + 1]), (this.b = e[t + 2]), this)
},
},
{
key: 'toArray',
value: function () {
var e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : [],
t = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : 0
return ((e[t] = this.r), (e[t + 1] = this.g), (e[t + 2] = this.b), e)
},
},
{
key: 'fromBufferAttribute',
value: function (e, t) {
return (
(this.r = e.getX(t)),
(this.g = e.getY(t)),
(this.b = e.getZ(t)),
this
)
},
},
{
key: 'toJSON',
value: function () {
return this.getHex()
},
},
{
key: Symbol.iterator,
value: d().m(function e() {
return d().w(
function (e) {
for (;;)
switch (e.n) {
case 0:
return ((e.n = 1), this.r)
case 1:
return ((e.n = 2), this.g)
case 2:
return ((e.n = 3), this.b)
case 3:
return e.a(2)
}
},
e,
this
)
}),
},
]
)
})(),
Fd = new Od()
Od.NAMES = Nd
var Bd = 0,
Ud = (function (e) {
function t() {
var e
return (
A(this, t),
((e = y(this, t)).isMaterial = !0),
Object.defineProperty(e, 'id', { value: Bd++ }),
(e.uuid = Lc()),
(e.name = ''),
(e.type = 'Material'),
(e.blending = 1),
(e.side = 0),
(e.vertexColors = !1),
(e.opacity = 1),
(e.transparent = !1),
(e.alphaHash = !1),
(e.blendSrc = Ju),
(e.blendDst = $u),
(e.blendEquation = Zu),
(e.blendSrcAlpha = null),
(e.blendDstAlpha = null),
(e.blendEquationAlpha = null),
(e.blendColor = new Od(0, 0, 0)),
(e.blendAlpha = 0),
(e.depthFunc = 3),
(e.depthTest = !0),
(e.depthWrite = !0),
(e.stencilWriteMask = 255),
(e.stencilFunc = 519),
(e.stencilRef = 0),
(e.stencilFuncMask = 255),
(e.stencilFail = Ac),
(e.stencilZFail = Ac),
(e.stencilZPass = Ac),
(e.stencilWrite = !1),
(e.clippingPlanes = null),
(e.clipIntersection = !1),
(e.clipShadows = !1),
(e.shadowSide = null),
(e.colorWrite = !0),
(e.precision = null),
(e.polygonOffset = !1),
(e.polygonOffsetFactor = 0),
(e.polygonOffsetUnits = 0),
(e.dithering = !1),
(e.alphaToCoverage = !1),
(e.premultipliedAlpha = !1),
(e.forceSinglePass = !1),
(e.visible = !0),
(e.toneMapped = !0),
(e.userData = {}),
(e.version = 0),
(e._alphaTest = 0),
e
)
}
return (
x(t, e),
T(t, [
{
key: 'alphaTest',
get: function () {
return this._alphaTest
},
set: function (e) {
;(this._alphaTest > 0 != e > 0 && this.version++, (this._alphaTest = e))
},
},
{ key: 'onBeforeRender', value: function () {} },
{ key: 'onBeforeCompile', value: function () {} },
{
key: 'customProgramCacheKey',
value: function () {
return this.onBeforeCompile.toString()
},
},
{
key: 'setValues',
value: function (e) {
if (void 0 !== e)
for (var t in e) {
var n = e[t]
if (void 0 !== n) {
var r = this[t]
void 0 !== r
? r && r.isColor
? r.set(n)
: r && r.isVector3 && n && n.isVector3
? r.copy(n)
: (this[t] = n)
: console.warn(
"THREE.Material: '"
.concat(t, "' is not a property of THREE.")
.concat(this.type, '.')
)
} else
console.warn(
"THREE.Material: parameter '".concat(t, "' has value of undefined.")
)
}
},
},
{
key: 'toJSON',
value: function (e) {
var t = void 0 === e || 'string' == typeof e
t && (e = { textures: {}, images: {} })
var n = {
metadata: { version: 4.6, type: 'Material', generator: 'Material.toJSON' },
}
function r(e) {
var t = []
for (var n in e) {
var r = e[n]
;(delete r.metadata, t.push(r))
}
return t
}
if (
((n.uuid = this.uuid),
(n.type = this.type),
'' !== this.name && (n.name = this.name),
this.color && this.color.isColor && (n.color = this.color.getHex()),
void 0 !== this.roughness && (n.roughness = this.roughness),
void 0 !== this.metalness && (n.metalness = this.metalness),
void 0 !== this.sheen && (n.sheen = this.sheen),
this.sheenColor &&
this.sheenColor.isColor &&
(n.sheenColor = this.sheenColor.getHex()),
void 0 !== this.sheenRoughness && (n.sheenRoughness = this.sheenRoughness),
this.emissive &&
this.emissive.isColor &&
(n.emissive = this.emissive.getHex()),
void 0 !== this.emissiveIntensity &&
1 !== this.emissiveIntensity &&
(n.emissiveIntensity = this.emissiveIntensity),
this.specular &&
this.specular.isColor &&
(n.specular = this.specular.getHex()),
void 0 !== this.specularIntensity &&
(n.specularIntensity = this.specularIntensity),
this.specularColor &&
this.specularColor.isColor &&
(n.specularColor = this.specularColor.getHex()),
void 0 !== this.shininess && (n.shininess = this.shininess),
void 0 !== this.clearcoat && (n.clearcoat = this.clearcoat),
void 0 !== this.clearcoatRoughness &&
(n.clearcoatRoughness = this.clearcoatRoughness),
this.clearcoatMap &&
this.clearcoatMap.isTexture &&
(n.clearcoatMap = this.clearcoatMap.toJSON(e).uuid),
this.clearcoatRoughnessMap &&
this.clearcoatRoughnessMap.isTexture &&
(n.clearcoatRoughnessMap = this.clearcoatRoughnessMap.toJSON(e).uuid),
this.clearcoatNormalMap &&
this.clearcoatNormalMap.isTexture &&
((n.clearcoatNormalMap = this.clearcoatNormalMap.toJSON(e).uuid),
(n.clearcoatNormalScale = this.clearcoatNormalScale.toArray())),
void 0 !== this.dispersion && (n.dispersion = this.dispersion),
void 0 !== this.iridescence && (n.iridescence = this.iridescence),
void 0 !== this.iridescenceIOR && (n.iridescenceIOR = this.iridescenceIOR),
void 0 !== this.iridescenceThicknessRange &&
(n.iridescenceThicknessRange = this.iridescenceThicknessRange),
this.iridescenceMap &&
this.iridescenceMap.isTexture &&
(n.iridescenceMap = this.iridescenceMap.toJSON(e).uuid),
this.iridescenceThicknessMap &&
this.iridescenceThicknessMap.isTexture &&
(n.iridescenceThicknessMap = this.iridescenceThicknessMap.toJSON(e).uuid),
void 0 !== this.anisotropy && (n.anisotropy = this.anisotropy),
void 0 !== this.anisotropyRotation &&
(n.anisotropyRotation = this.anisotropyRotation),
this.anisotropyMap &&
this.anisotropyMap.isTexture &&
(n.anisotropyMap = this.anisotropyMap.toJSON(e).uuid),
this.map && this.map.isTexture && (n.map = this.map.toJSON(e).uuid),
this.matcap &&
this.matcap.isTexture &&
(n.matcap = this.matcap.toJSON(e).uuid),
this.alphaMap &&
this.alphaMap.isTexture &&
(n.alphaMap = this.alphaMap.toJSON(e).uuid),
this.lightMap &&
this.lightMap.isTexture &&
((n.lightMap = this.lightMap.toJSON(e).uuid),
(n.lightMapIntensity = this.lightMapIntensity)),
this.aoMap &&
this.aoMap.isTexture &&
((n.aoMap = this.aoMap.toJSON(e).uuid),
(n.aoMapIntensity = this.aoMapIntensity)),
this.bumpMap &&
this.bumpMap.isTexture &&
((n.bumpMap = this.bumpMap.toJSON(e).uuid),
(n.bumpScale = this.bumpScale)),
this.normalMap &&
this.normalMap.isTexture &&
((n.normalMap = this.normalMap.toJSON(e).uuid),
(n.normalMapType = this.normalMapType),
(n.normalScale = this.normalScale.toArray())),
this.displacementMap &&
this.displacementMap.isTexture &&
((n.displacementMap = this.displacementMap.toJSON(e).uuid),
(n.displacementScale = this.displacementScale),
(n.displacementBias = this.displacementBias)),
this.roughnessMap &&
this.roughnessMap.isTexture &&
(n.roughnessMap = this.roughnessMap.toJSON(e).uuid),
this.metalnessMap &&
this.metalnessMap.isTexture &&
(n.metalnessMap = this.metalnessMap.toJSON(e).uuid),
this.emissiveMap &&
this.emissiveMap.isTexture &&
(n.emissiveMap = this.emissiveMap.toJSON(e).uuid),
this.specularMap &&
this.specularMap.isTexture &&
(n.specularMap = this.specularMap.toJSON(e).uuid),
this.specularIntensityMap &&
this.specularIntensityMap.isTexture &&
(n.specularIntensityMap = this.specularIntensityMap.toJSON(e).uuid),
this.specularColorMap &&
this.specularColorMap.isTexture &&
(n.specularColorMap = this.specularColorMap.toJSON(e).uuid),
this.envMap &&
this.envMap.isTexture &&
((n.envMap = this.envMap.toJSON(e).uuid),
void 0 !== this.combine && (n.combine = this.combine)),
void 0 !== this.envMapRotation &&
(n.envMapRotation = this.envMapRotation.toArray()),
void 0 !== this.envMapIntensity &&
(n.envMapIntensity = this.envMapIntensity),
void 0 !== this.reflectivity && (n.reflectivity = this.reflectivity),
void 0 !== this.refractionRatio &&
(n.refractionRatio = this.refractionRatio),
this.gradientMap &&
this.gradientMap.isTexture &&
(n.gradientMap = this.gradientMap.toJSON(e).uuid),
void 0 !== this.transmission && (n.transmission = this.transmission),
this.transmissionMap &&
this.transmissionMap.isTexture &&
(n.transmissionMap = this.transmissionMap.toJSON(e).uuid),
void 0 !== this.thickness && (n.thickness = this.thickness),
this.thicknessMap &&
this.thicknessMap.isTexture &&
(n.thicknessMap = this.thicknessMap.toJSON(e).uuid),
void 0 !== this.attenuationDistance &&
this.attenuationDistance !== 1 / 0 &&
(n.attenuationDistance = this.attenuationDistance),
void 0 !== this.attenuationColor &&
(n.attenuationColor = this.attenuationColor.getHex()),
void 0 !== this.size && (n.size = this.size),
null !== this.shadowSide && (n.shadowSide = this.shadowSide),
void 0 !== this.sizeAttenuation &&
(n.sizeAttenuation = this.sizeAttenuation),
1 !== this.blending && (n.blending = this.blending),
0 !== this.side && (n.side = this.side),
!0 === this.vertexColors && (n.vertexColors = !0),
this.opacity < 1 && (n.opacity = this.opacity),
!0 === this.transparent && (n.transparent = !0),
this.blendSrc !== Ju && (n.blendSrc = this.blendSrc),
this.blendDst !== $u && (n.blendDst = this.blendDst),
this.blendEquation !== Zu && (n.blendEquation = this.blendEquation),
null !== this.blendSrcAlpha && (n.blendSrcAlpha = this.blendSrcAlpha),
null !== this.blendDstAlpha && (n.blendDstAlpha = this.blendDstAlpha),
null !== this.blendEquationAlpha &&
(n.blendEquationAlpha = this.blendEquationAlpha),
this.blendColor &&
this.blendColor.isColor &&
(n.blendColor = this.blendColor.getHex()),
0 !== this.blendAlpha && (n.blendAlpha = this.blendAlpha),
3 !== this.depthFunc && (n.depthFunc = this.depthFunc),
!1 === this.depthTest && (n.depthTest = this.depthTest),
!1 === this.depthWrite && (n.depthWrite = this.depthWrite),
!1 === this.colorWrite && (n.colorWrite = this.colorWrite),
255 !== this.stencilWriteMask &&
(n.stencilWriteMask = this.stencilWriteMask),
519 !== this.stencilFunc && (n.stencilFunc = this.stencilFunc),
0 !== this.stencilRef && (n.stencilRef = this.stencilRef),
255 !== this.stencilFuncMask && (n.stencilFuncMask = this.stencilFuncMask),
this.stencilFail !== Ac && (n.stencilFail = this.stencilFail),
this.stencilZFail !== Ac && (n.stencilZFail = this.stencilZFail),
this.stencilZPass !== Ac && (n.stencilZPass = this.stencilZPass),
!0 === this.stencilWrite && (n.stencilWrite = this.stencilWrite),
void 0 !== this.rotation &&
0 !== this.rotation &&
(n.rotation = this.rotation),
!0 === this.polygonOffset && (n.polygonOffset = !0),
0 !== this.polygonOffsetFactor &&
(n.polygonOffsetFactor = this.polygonOffsetFactor),
0 !== this.polygonOffsetUnits &&
(n.polygonOffsetUnits = this.polygonOffsetUnits),
void 0 !== this.linewidth &&
1 !== this.linewidth &&
(n.linewidth = this.linewidth),
void 0 !== this.dashSize && (n.dashSize = this.dashSize),
void 0 !== this.gapSize && (n.gapSize = this.gapSize),
void 0 !== this.scale && (n.scale = this.scale),
!0 === this.dithering && (n.dithering = !0),
this.alphaTest > 0 && (n.alphaTest = this.alphaTest),
!0 === this.alphaHash && (n.alphaHash = !0),
!0 === this.alphaToCoverage && (n.alphaToCoverage = !0),
!0 === this.premultipliedAlpha && (n.premultipliedAlpha = !0),
!0 === this.forceSinglePass && (n.forceSinglePass = !0),
!0 === this.wireframe && (n.wireframe = !0),
this.wireframeLinewidth > 1 &&
(n.wireframeLinewidth = this.wireframeLinewidth),
'round' !== this.wireframeLinecap &&
(n.wireframeLinecap = this.wireframeLinecap),
'round' !== this.wireframeLinejoin &&
(n.wireframeLinejoin = this.wireframeLinejoin),
!0 === this.flatShading && (n.flatShading = !0),
!1 === this.visible && (n.visible = !1),
!1 === this.toneMapped && (n.toneMapped = !1),
!1 === this.fog && (n.fog = !1),
Object.keys(this.userData).length > 0 && (n.userData = this.userData),
t)
) {
var i = r(e.textures),
a = r(e.images)
;(i.length > 0 && (n.textures = i), a.length > 0 && (n.images = a))
}
return n
},
},
{
key: 'clone',
value: function () {
return new this.constructor().copy(this)
},
},
{
key: 'copy',
value: function (e) {
;((this.name = e.name),
(this.blending = e.blending),
(this.side = e.side),
(this.vertexColors = e.vertexColors),
(this.opacity = e.opacity),
(this.transparent = e.transparent),
(this.blendSrc = e.blendSrc),
(this.blendDst = e.blendDst),
(this.blendEquation = e.blendEquation),
(this.blendSrcAlpha = e.blendSrcAlpha),
(this.blendDstAlpha = e.blendDstAlpha),
(this.blendEquationAlpha = e.blendEquationAlpha),
this.blendColor.copy(e.blendColor),
(this.blendAlpha = e.blendAlpha),
(this.depthFunc = e.depthFunc),
(this.depthTest = e.depthTest),
(this.depthWrite = e.depthWrite),
(this.stencilWriteMask = e.stencilWriteMask),
(this.stencilFunc = e.stencilFunc),
(this.stencilRef = e.stencilRef),
(this.stencilFuncMask = e.stencilFuncMask),
(this.stencilFail = e.stencilFail),
(this.stencilZFail = e.stencilZFail),
(this.stencilZPass = e.stencilZPass),
(this.stencilWrite = e.stencilWrite))
var t = e.clippingPlanes,
n = null
if (null !== t) {
var r = t.length
n = new Array(r)
for (var i = 0; i !== r; ++i) n[i] = t[i].clone()
}
return (
(this.clippingPlanes = n),
(this.clipIntersection = e.clipIntersection),
(this.clipShadows = e.clipShadows),
(this.shadowSide = e.shadowSide),
(this.colorWrite = e.colorWrite),
(this.precision = e.precision),
(this.polygonOffset = e.polygonOffset),
(this.polygonOffsetFactor = e.polygonOffsetFactor),
(this.polygonOffsetUnits = e.polygonOffsetUnits),
(this.dithering = e.dithering),
(this.alphaTest = e.alphaTest),
(this.alphaHash = e.alphaHash),
(this.alphaToCoverage = e.alphaToCoverage),
(this.premultipliedAlpha = e.premultipliedAlpha),
(this.forceSinglePass = e.forceSinglePass),
(this.visible = e.visible),
(this.toneMapped = e.toneMapped),
(this.userData = JSON.parse(JSON.stringify(e.userData))),
this
)
},
},
{
key: 'dispose',
value: function () {
this.dispatchEvent({ type: 'dispose' })
},
},
{
key: 'needsUpdate',
set: function (e) {
!0 === e && this.version++
},
},
{
key: 'onBuild',
value: function () {
console.warn('Material: onBuild() has been removed.')
},
},
])
)
})(kc),
zd = (function (e) {
function t(e) {
var n
return (
A(this, t),
((n = y(this, t)).isMeshBasicMaterial = !0),
(n.type = 'MeshBasicMaterial'),
(n.color = new Od(16777215)),
(n.map = null),
(n.lightMap = null),
(n.lightMapIntensity = 1),
(n.aoMap = null),
(n.aoMapIntensity = 1),
(n.specularMap = null),
(n.alphaMap = null),
(n.envMap = null),
(n.envMapRotation = new ed()),
(n.combine = 0),
(n.reflectivity = 1),
(n.refractionRatio = 0.98),
(n.wireframe = !1),
(n.wireframeLinewidth = 1),
(n.wireframeLinecap = 'round'),
(n.wireframeLinejoin = 'round'),
(n.fog = !0),
n.setValues(e),
n
)
}
return (
x(t, e),
T(t, [
{
key: 'copy',
value: function (e) {
return (
n(t, 'copy', this, 3)([e]),
this.color.copy(e.color),
(this.map = e.map),
(this.lightMap = e.lightMap),
(this.lightMapIntensity = e.lightMapIntensity),
(this.aoMap = e.aoMap),
(this.aoMapIntensity = e.aoMapIntensity),
(this.specularMap = e.specularMap),
(this.alphaMap = e.alphaMap),
(this.envMap = e.envMap),
this.envMapRotation.copy(e.envMapRotation),
(this.combine = e.combine),
(this.reflectivity = e.reflectivity),
(this.refractionRatio = e.refractionRatio),
(this.wireframe = e.wireframe),
(this.wireframeLinewidth = e.wireframeLinewidth),
(this.wireframeLinecap = e.wireframeLinecap),
(this.wireframeLinejoin = e.wireframeLinejoin),
(this.fog = e.fog),
this
)
},
},
])
)
})(Ud),
Vd = Hd()
function Hd() {
for (
var e = new ArrayBuffer(4),
t = new Float32Array(e),
n = new Uint32Array(e),
r = new Uint32Array(512),
i = new Uint32Array(512),
a = 0;
a < 256;
++a
) {
var o = a - 127
o < -27
? ((r[a] = 0), (r[256 | a] = 32768), (i[a] = 24), (i[256 | a] = 24))
: o < -14
? ((r[a] = 1024 >> (-o - 14)),
(r[256 | a] = (1024 >> (-o - 14)) | 32768),
(i[a] = -o - 1),
(i[256 | a] = -o - 1))
: o <= 15
? ((r[a] = (o + 15) << 10),
(r[256 | a] = ((o + 15) << 10) | 32768),
(i[a] = 13),
(i[256 | a] = 13))
: o < 128
? ((r[a] = 31744), (r[256 | a] = 64512), (i[a] = 24), (i[256 | a] = 24))
: ((r[a] = 31744), (r[256 | a] = 64512), (i[a] = 13), (i[256 | a] = 13))
}
for (
var s = new Uint32Array(2048),
u = new Uint32Array(64),
l = new Uint32Array(64),
c = 1;
c < 1024;
++c
) {
for (var h = c << 13, d = 0; !(8388608 & h); ) ((h <<= 1), (d -= 8388608))
;((h &= -8388609), (d += 947912704), (s[c] = h | d))
}
for (var f = 1024; f < 2048; ++f) s[f] = 939524096 + ((f - 1024) << 13)
for (var p = 1; p < 31; ++p) u[p] = p << 23
;((u[31] = 1199570944), (u[32] = 2147483648))
for (var v = 33; v < 63; ++v) u[v] = 2147483648 + ((v - 32) << 23)
u[63] = 3347054592
for (var m = 1; m < 64; ++m) 32 !== m && (l[m] = 1024)
return {
floatView: t,
uint32View: n,
baseTable: r,
shiftTable: i,
mantissaTable: s,
exponentTable: u,
offsetTable: l,
}
}
var Wd = {
toHalfFloat: function (e) {
;(Math.abs(e) > 65504 &&
console.warn('THREE.DataUtils.toHalfFloat(): Value out of range.'),
(e = Dc(e, -65504, 65504)),
(Vd.floatView[0] = e))
var t = Vd.uint32View[0],
n = (t >> 23) & 511
return Vd.baseTable[n] + ((8388607 & t) >> Vd.shiftTable[n])
},
fromHalfFloat: function (e) {
var t = e >> 10
return (
(Vd.uint32View[0] =
Vd.mantissaTable[Vd.offsetTable[t] + (1023 & e)] + Vd.exponentTable[t]),
Vd.floatView[0]
)
},
},
Gd = new ph(),
jd = new Vc(),
Qd = 0,
qd = (function () {
return T(
function e(t, n) {
var r = arguments.length > 2 && void 0 !== arguments[2] && arguments[2]
if ((A(this, e), Array.isArray(t)))
throw new TypeError('THREE.BufferAttribute: array should be a Typed Array.')
;((this.isBufferAttribute = !0),
Object.defineProperty(this, 'id', { value: Qd++ }),
(this.name = ''),
(this.array = t),
(this.itemSize = n),
(this.count = void 0 !== t ? t.length / n : 0),
(this.normalized = r),
(this.usage = wc),
(this.updateRanges = []),
(this.gpuType = yl),
(this.version = 0))
},
[
{ key: 'onUploadCallback', value: function () {} },
{
key: 'needsUpdate',
set: function (e) {
!0 === e && this.version++
},
},
{
key: 'setUsage',
value: function (e) {
return ((this.usage = e), this)
},
},
{
key: 'addUpdateRange',
value: function (e, t) {
this.updateRanges.push({ start: e, count: t })
},
},
{
key: 'clearUpdateRanges',
value: function () {
this.updateRanges.length = 0
},
},
{
key: 'copy',
value: function (e) {
return (
(this.name = e.name),
(this.array = new e.array.constructor(e.array)),
(this.itemSize = e.itemSize),
(this.count = e.count),
(this.normalized = e.normalized),
(this.usage = e.usage),
(this.gpuType = e.gpuType),
this
)
},
},
{
key: 'copyAt',
value: function (e, t, n) {
;((e *= this.itemSize), (n *= t.itemSize))
for (var r = 0, i = this.itemSize; r < i; r++)
this.array[e + r] = t.array[n + r]
return this
},
},
{
key: 'copyArray',
value: function (e) {
return (this.array.set(e), this)
},
},
{
key: 'applyMatrix3',
value: function (e) {
if (2 === this.itemSize)
for (var t = 0, n = this.count; t < n; t++)
(jd.fromBufferAttribute(this, t),
jd.applyMatrix3(e),
this.setXY(t, jd.x, jd.y))
else if (3 === this.itemSize)
for (var r = 0, i = this.count; r < i; r++)
(Gd.fromBufferAttribute(this, r),
Gd.applyMatrix3(e),
this.setXYZ(r, Gd.x, Gd.y, Gd.z))
return this
},
},
{
key: 'applyMatrix4',
value: function (e) {
for (var t = 0, n = this.count; t < n; t++)
(Gd.fromBufferAttribute(this, t),
Gd.applyMatrix4(e),
this.setXYZ(t, Gd.x, Gd.y, Gd.z))
return this
},
},
{
key: 'applyNormalMatrix',
value: function (e) {
for (var t = 0, n = this.count; t < n; t++)
(Gd.fromBufferAttribute(this, t),
Gd.applyNormalMatrix(e),
this.setXYZ(t, Gd.x, Gd.y, Gd.z))
return this
},
},
{
key: 'transformDirection',
value: function (e) {
for (var t = 0, n = this.count; t < n; t++)
(Gd.fromBufferAttribute(this, t),
Gd.transformDirection(e),
this.setXYZ(t, Gd.x, Gd.y, Gd.z))
return this
},
},
{
key: 'set',
value: function (e) {
var t = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : 0
return (this.array.set(e, t), this)
},
},
{
key: 'getComponent',
value: function (e, t) {
var n = this.array[e * this.itemSize + t]
return (this.normalized && (n = Bc(n, this.array)), n)
},
},
{
key: 'setComponent',
value: function (e, t, n) {
return (
this.normalized && (n = Uc(n, this.array)),
(this.array[e * this.itemSize + t] = n),
this
)
},
},
{
key: 'getX',
value: function (e) {
var t = this.array[e * this.itemSize]
return (this.normalized && (t = Bc(t, this.array)), t)
},
},
{
key: 'setX',
value: function (e, t) {
return (
this.normalized && (t = Uc(t, this.array)),
(this.array[e * this.itemSize] = t),
this
)
},
},
{
key: 'getY',
value: function (e) {
var t = this.array[e * this.itemSize + 1]
return (this.normalized && (t = Bc(t, this.array)), t)
},
},
{
key: 'setY',
value: function (e, t) {
return (
this.normalized && (t = Uc(t, this.array)),
(this.array[e * this.itemSize + 1] = t),
this
)
},
},
{
key: 'getZ',
value: function (e) {
var t = this.array[e * this.itemSize + 2]
return (this.normalized && (t = Bc(t, this.array)), t)
},
},
{
key: 'setZ',
value: function (e, t) {
return (
this.normalized && (t = Uc(t, this.array)),
(this.array[e * this.itemSize + 2] = t),
this
)
},
},
{
key: 'getW',
value: function (e) {
var t = this.array[e * this.itemSize + 3]
return (this.normalized && (t = Bc(t, this.array)), t)
},
},
{
key: 'setW',
value: function (e, t) {
return (
this.normalized && (t = Uc(t, this.array)),
(this.array[e * this.itemSize + 3] = t),
this
)
},
},
{
key: 'setXY',
value: function (e, t, n) {
return (
(e *= this.itemSize),
this.normalized && ((t = Uc(t, this.array)), (n = Uc(n, this.array))),
(this.array[e + 0] = t),
(this.array[e + 1] = n),
this
)
},
},
{
key: 'setXYZ',
value: function (e, t, n, r) {
return (
(e *= this.itemSize),
this.normalized &&
((t = Uc(t, this.array)),
(n = Uc(n, this.array)),
(r = Uc(r, this.array))),
(this.array[e + 0] = t),
(this.array[e + 1] = n),
(this.array[e + 2] = r),
this
)
},
},
{
key: 'setXYZW',
value: function (e, t, n, r, i) {
return (
(e *= this.itemSize),
this.normalized &&
((t = Uc(t, this.array)),
(n = Uc(n, this.array)),
(r = Uc(r, this.array)),
(i = Uc(i, this.array))),
(this.array[e + 0] = t),
(this.array[e + 1] = n),
(this.array[e + 2] = r),
(this.array[e + 3] = i),
this
)
},
},
{
key: 'onUpload',
value: function (e) {
return ((this.onUploadCallback = e), this)
},
},
{
key: 'clone',
value: function () {
return new this.constructor(this.array, this.itemSize).copy(this)
},
},
{
key: 'toJSON',
value: function () {
var e = {
itemSize: this.itemSize,
type: this.array.constructor.name,
array: Array.from(this.array),
normalized: this.normalized,
}
return (
'' !== this.name && (e.name = this.name),
this.usage !== wc && (e.usage = this.usage),
e
)
},
},
]
)
})(),
Xd = (function (e) {
function t(e, n, r) {
return (A(this, t), y(this, t, [new Uint16Array(e), n, r]))
}
return (x(t, e), T(t))
})(qd),
Yd = (function (e) {
function t(e, n, r) {
return (A(this, t), y(this, t, [new Uint32Array(e), n, r]))
}
return (x(t, e), T(t))
})(qd),
Kd = (function (e) {
function t(e, n, r) {
return (A(this, t), y(this, t, [new Float32Array(e), n, r]))
}
return (x(t, e), T(t))
})(qd),
Zd = 0,
Jd = new Gh(),
$d = new gd(),
ef = new ph(),
tf = new gh(),
nf = new gh(),
rf = new ph(),
af = (function (e) {
function t() {
var e
return (
A(this, t),
((e = y(this, t)).isBufferGeometry = !0),
Object.defineProperty(e, 'id', { value: Zd++ }),
(e.uuid = Lc()),
(e.name = ''),
(e.type = 'BufferGeometry'),
(e.index = null),
(e.indirect = null),
(e.attributes = {}),
(e.morphAttributes = {}),
(e.morphTargetsRelative = !1),
(e.groups = []),
(e.boundingBox = null),
(e.boundingSphere = null),
(e.drawRange = { start: 0, count: 1 / 0 }),
(e.userData = {}),
e
)
}
return (
x(t, e),
T(t, [
{
key: 'getIndex',
value: function () {
return this.index
},
},
{
key: 'setIndex',
value: function (e) {
return (
Array.isArray(e)
? (this.index = new (Gc(e) ? Yd : Xd)(e, 1))
: (this.index = e),
this
)
},
},
{
key: 'setIndirect',
value: function (e) {
return ((this.indirect = e), this)
},
},
{
key: 'getIndirect',
value: function () {
return this.indirect
},
},
{
key: 'getAttribute',
value: function (e) {
return this.attributes[e]
},
},
{
key: 'setAttribute',
value: function (e, t) {
return ((this.attributes[e] = t), this)
},
},
{
key: 'deleteAttribute',
value: function (e) {
return (delete this.attributes[e], this)
},
},
{
key: 'hasAttribute',
value: function (e) {
return void 0 !== this.attributes[e]
},
},
{
key: 'addGroup',
value: function (e, t) {
var n = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : 0
this.groups.push({ start: e, count: t, materialIndex: n })
},
},
{
key: 'clearGroups',
value: function () {
this.groups = []
},
},
{
key: 'setDrawRange',
value: function (e, t) {
;((this.drawRange.start = e), (this.drawRange.count = t))
},
},
{
key: 'applyMatrix4',
value: function (e) {
var t = this.attributes.position
void 0 !== t && (t.applyMatrix4(e), (t.needsUpdate = !0))
var n = this.attributes.normal
if (void 0 !== n) {
var r = new Hc().getNormalMatrix(e)
;(n.applyNormalMatrix(r), (n.needsUpdate = !0))
}
var i = this.attributes.tangent
return (
void 0 !== i && (i.transformDirection(e), (i.needsUpdate = !0)),
null !== this.boundingBox && this.computeBoundingBox(),
null !== this.boundingSphere && this.computeBoundingSphere(),
this
)
},
},
{
key: 'applyQuaternion',
value: function (e) {
return (Jd.makeRotationFromQuaternion(e), this.applyMatrix4(Jd), this)
},
},
{
key: 'rotateX',
value: function (e) {
return (Jd.makeRotationX(e), this.applyMatrix4(Jd), this)
},
},
{
key: 'rotateY',
value: function (e) {
return (Jd.makeRotationY(e), this.applyMatrix4(Jd), this)
},
},
{
key: 'rotateZ',
value: function (e) {
return (Jd.makeRotationZ(e), this.applyMatrix4(Jd), this)
},
},
{
key: 'translate',
value: function (e, t, n) {
return (Jd.makeTranslation(e, t, n), this.applyMatrix4(Jd), this)
},
},
{
key: 'scale',
value: function (e, t, n) {
return (Jd.makeScale(e, t, n), this.applyMatrix4(Jd), this)
},
},
{
key: 'lookAt',
value: function (e) {
return ($d.lookAt(e), $d.updateMatrix(), this.applyMatrix4($d.matrix), this)
},
},
{
key: 'center',
value: function () {
return (
this.computeBoundingBox(),
this.boundingBox.getCenter(ef).negate(),
this.translate(ef.x, ef.y, ef.z),
this
)
},
},
{
key: 'setFromPoints',
value: function (e) {
var t = this.getAttribute('position')
if (void 0 === t) {
for (var n = [], r = 0, i = e.length; r < i; r++) {
var a = e[r]
n.push(a.x, a.y, a.z || 0)
}
this.setAttribute('position', new Kd(n, 3))
} else {
for (var o = Math.min(e.length, t.count), s = 0; s < o; s++) {
var u = e[s]
t.setXYZ(s, u.x, u.y, u.z || 0)
}
;(e.length > t.count &&
console.warn(
'THREE.BufferGeometry: Buffer size too small for points data. Use .dispose() and create a new geometry.'
),
(t.needsUpdate = !0))
}
return this
},
},
{
key: 'computeBoundingBox',
value: function () {
null === this.boundingBox && (this.boundingBox = new gh())
var e = this.attributes.position,
t = this.morphAttributes.position
if (e && e.isGLBufferAttribute)
return (
console.error(
'THREE.BufferGeometry.computeBoundingBox(): GLBufferAttribute requires a manual bounding box.',
this
),
void this.boundingBox.set(
new ph(-1 / 0, -1 / 0, -1 / 0),
new ph(1 / 0, 1 / 0, 1 / 0)
)
)
if (void 0 !== e) {
if ((this.boundingBox.setFromBufferAttribute(e), t))
for (var n = 0, r = t.length; n < r; n++) {
var i = t[n]
;(tf.setFromBufferAttribute(i),
this.morphTargetsRelative
? (rf.addVectors(this.boundingBox.min, tf.min),
this.boundingBox.expandByPoint(rf),
rf.addVectors(this.boundingBox.max, tf.max),
this.boundingBox.expandByPoint(rf))
: (this.boundingBox.expandByPoint(tf.min),
this.boundingBox.expandByPoint(tf.max)))
}
} else this.boundingBox.makeEmpty()
;(isNaN(this.boundingBox.min.x) ||
isNaN(this.boundingBox.min.y) ||
isNaN(this.boundingBox.min.z)) &&
console.error(
'THREE.BufferGeometry.computeBoundingBox(): Computed min/max have NaN values. The "position" attribute is likely to have NaN values.',
this
)
},
},
{
key: 'computeBoundingSphere',
value: function () {
null === this.boundingSphere && (this.boundingSphere = new Dh())
var e = this.attributes.position,
t = this.morphAttributes.position
if (e && e.isGLBufferAttribute)
return (
console.error(
'THREE.BufferGeometry.computeBoundingSphere(): GLBufferAttribute requires a manual bounding sphere.',
this
),
void this.boundingSphere.set(new ph(), 1 / 0)
)
if (e) {
var n = this.boundingSphere.center
if ((tf.setFromBufferAttribute(e), t))
for (var r = 0, i = t.length; r < i; r++) {
var a = t[r]
;(nf.setFromBufferAttribute(a),
this.morphTargetsRelative
? (rf.addVectors(tf.min, nf.min),
tf.expandByPoint(rf),
rf.addVectors(tf.max, nf.max),
tf.expandByPoint(rf))
: (tf.expandByPoint(nf.min), tf.expandByPoint(nf.max)))
}
tf.getCenter(n)
for (var o = 0, s = 0, u = e.count; s < u; s++)
(rf.fromBufferAttribute(e, s), (o = Math.max(o, n.distanceToSquared(rf))))
if (t)
for (var l = 0, c = t.length; l < c; l++)
for (
var h = t[l], d = this.morphTargetsRelative, f = 0, p = h.count;
f < p;
f++
)
(rf.fromBufferAttribute(h, f),
d && (ef.fromBufferAttribute(e, f), rf.add(ef)),
(o = Math.max(o, n.distanceToSquared(rf))))
;((this.boundingSphere.radius = Math.sqrt(o)),
isNaN(this.boundingSphere.radius) &&
console.error(
'THREE.BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The "position" attribute is likely to have NaN values.',
this
))
}
},
},
{
key: 'computeTangents',
value: function () {
var e = this.index,
t = this.attributes
if (
null !== e &&
void 0 !== t.position &&
void 0 !== t.normal &&
void 0 !== t.uv
) {
var n = t.position,
r = t.normal,
i = t.uv
!1 === this.hasAttribute('tangent') &&
this.setAttribute('tangent', new qd(new Float32Array(4 * n.count), 4))
for (
var a = this.getAttribute('tangent'), o = [], s = [], u = 0;
u < n.count;
u++
)
((o[u] = new ph()), (s[u] = new ph()))
var l = new ph(),
c = new ph(),
h = new ph(),
d = new Vc(),
f = new Vc(),
p = new Vc(),
v = new ph(),
m = new ph(),
g = this.groups
0 === g.length && (g = [{ start: 0, count: e.count }])
for (var y = 0, _ = g.length; y < _; ++y)
for (var b = g[y], x = b.start, S = x, A = x + b.count; S < A; S += 3)
L(e.getX(S + 0), e.getX(S + 1), e.getX(S + 2))
for (
var w = new ph(),
T = new ph(),
M = new ph(),
E = new ph(),
C = 0,
k = g.length;
C < k;
++C
)
for (var R = g[C], I = R.start, N = I, P = I + R.count; N < P; N += 3)
(D(e.getX(N + 0)), D(e.getX(N + 1)), D(e.getX(N + 2)))
} else
console.error(
'THREE.BufferGeometry: .computeTangents() failed. Missing required attributes (index, position, normal or uv)'
)
function L(e, t, r) {
;(l.fromBufferAttribute(n, e),
c.fromBufferAttribute(n, t),
h.fromBufferAttribute(n, r),
d.fromBufferAttribute(i, e),
f.fromBufferAttribute(i, t),
p.fromBufferAttribute(i, r),
c.sub(l),
h.sub(l),
f.sub(d),
p.sub(d))
var a = 1 / (f.x * p.y - p.x * f.y)
isFinite(a) &&
(v.copy(c).multiplyScalar(p.y).addScaledVector(h, -f.y).multiplyScalar(a),
m.copy(h).multiplyScalar(f.x).addScaledVector(c, -p.x).multiplyScalar(a),
o[e].add(v),
o[t].add(v),
o[r].add(v),
s[e].add(m),
s[t].add(m),
s[r].add(m))
}
function D(e) {
;(M.fromBufferAttribute(r, e), E.copy(M))
var t = o[e]
;(w.copy(t),
w.sub(M.multiplyScalar(M.dot(t))).normalize(),
T.crossVectors(E, t))
var n = T.dot(s[e]) < 0 ? -1 : 1
a.setXYZW(e, w.x, w.y, w.z, n)
}
},
},
{
key: 'computeVertexNormals',
value: function () {
var e = this.index,
t = this.getAttribute('position')
if (void 0 !== t) {
var n = this.getAttribute('normal')
if (void 0 === n)
((n = new qd(new Float32Array(3 * t.count), 3)),
this.setAttribute('normal', n))
else for (var r = 0, i = n.count; r < i; r++) n.setXYZ(r, 0, 0, 0)
var a = new ph(),
o = new ph(),
s = new ph(),
u = new ph(),
l = new ph(),
c = new ph(),
h = new ph(),
d = new ph()
if (e)
for (var f = 0, p = e.count; f < p; f += 3) {
var v = e.getX(f + 0),
m = e.getX(f + 1),
g = e.getX(f + 2)
;(a.fromBufferAttribute(t, v),
o.fromBufferAttribute(t, m),
s.fromBufferAttribute(t, g),
h.subVectors(s, o),
d.subVectors(a, o),
h.cross(d),
u.fromBufferAttribute(n, v),
l.fromBufferAttribute(n, m),
c.fromBufferAttribute(n, g),
u.add(h),
l.add(h),
c.add(h),
n.setXYZ(v, u.x, u.y, u.z),
n.setXYZ(m, l.x, l.y, l.z),
n.setXYZ(g, c.x, c.y, c.z))
}
else
for (var y = 0, _ = t.count; y < _; y += 3)
(a.fromBufferAttribute(t, y + 0),
o.fromBufferAttribute(t, y + 1),
s.fromBufferAttribute(t, y + 2),
h.subVectors(s, o),
d.subVectors(a, o),
h.cross(d),
n.setXYZ(y + 0, h.x, h.y, h.z),
n.setXYZ(y + 1, h.x, h.y, h.z),
n.setXYZ(y + 2, h.x, h.y, h.z))
;(this.normalizeNormals(), (n.needsUpdate = !0))
}
},
},
{
key: 'normalizeNormals',
value: function () {
for (var e = this.attributes.normal, t = 0, n = e.count; t < n; t++)
(rf.fromBufferAttribute(e, t),
rf.normalize(),
e.setXYZ(t, rf.x, rf.y, rf.z))
},
},
{
key: 'toNonIndexed',
value: function () {
function e(e, t) {
for (
var n = e.array,
r = e.itemSize,
i = e.normalized,
a = new n.constructor(t.length * r),
o = 0,
s = 0,
u = 0,
l = t.length;
u < l;
u++
) {
o = e.isInterleavedBufferAttribute
? t[u] * e.data.stride + e.offset
: t[u] * r
for (var c = 0; c < r; c++) a[s++] = n[o++]
}
return new qd(a, r, i)
}
if (null === this.index)
return (
console.warn(
'THREE.BufferGeometry.toNonIndexed(): BufferGeometry is already non-indexed.'
),
this
)
var n = new t(),
r = this.index.array,
i = this.attributes
for (var a in i) {
var o = e(i[a], r)
n.setAttribute(a, o)
}
var s = this.morphAttributes
for (var u in s) {
for (var l = [], c = s[u], h = 0, d = c.length; h < d; h++) {
var f = e(c[h], r)
l.push(f)
}
n.morphAttributes[u] = l
}
n.morphTargetsRelative = this.morphTargetsRelative
for (var p = this.groups, v = 0, m = p.length; v < m; v++) {
var g = p[v]
n.addGroup(g.start, g.count, g.materialIndex)
}
return n
},
},
{
key: 'toJSON',
value: function () {
var e = {
metadata: {
version: 4.6,
type: 'BufferGeometry',
generator: 'BufferGeometry.toJSON',
},
}
if (
((e.uuid = this.uuid),
(e.type = this.type),
'' !== this.name && (e.name = this.name),
Object.keys(this.userData).length > 0 && (e.userData = this.userData),
void 0 !== this.parameters)
) {
var t = this.parameters
for (var n in t) void 0 !== t[n] && (e[n] = t[n])
return e
}
e.data = { attributes: {} }
var r = this.index
null !== r &&
(e.data.index = {
type: r.array.constructor.name,
array: Array.prototype.slice.call(r.array),
})
var i = this.attributes
for (var a in i) {
var o = i[a]
e.data.attributes[a] = o.toJSON(e.data)
}
var s = {},
u = !1
for (var l in this.morphAttributes) {
for (
var c = this.morphAttributes[l], h = [], d = 0, f = c.length;
d < f;
d++
) {
var p = c[d]
h.push(p.toJSON(e.data))
}
h.length > 0 && ((s[l] = h), (u = !0))
}
u &&
((e.data.morphAttributes = s),
(e.data.morphTargetsRelative = this.morphTargetsRelative))
var v = this.groups
v.length > 0 && (e.data.groups = JSON.parse(JSON.stringify(v)))
var m = this.boundingSphere
return (
null !== m &&
(e.data.boundingSphere = {
center: m.center.toArray(),
radius: m.radius,
}),
e
)
},
},
{
key: 'clone',
value: function () {
return new this.constructor().copy(this)
},
},
{
key: 'copy',
value: function (e) {
;((this.index = null),
(this.attributes = {}),
(this.morphAttributes = {}),
(this.groups = []),
(this.boundingBox = null),
(this.boundingSphere = null))
var t = {}
this.name = e.name
var n = e.index
null !== n && this.setIndex(n.clone(t))
var r = e.attributes
for (var i in r) {
var a = r[i]
this.setAttribute(i, a.clone(t))
}
var o = e.morphAttributes
for (var s in o) {
for (var u = [], l = o[s], c = 0, h = l.length; c < h; c++)
u.push(l[c].clone(t))
this.morphAttributes[s] = u
}
this.morphTargetsRelative = e.morphTargetsRelative
for (var d = e.groups, f = 0, p = d.length; f < p; f++) {
var v = d[f]
this.addGroup(v.start, v.count, v.materialIndex)
}
var m = e.boundingBox
null !== m && (this.boundingBox = m.clone())
var g = e.boundingSphere
return (
null !== g && (this.boundingSphere = g.clone()),
(this.drawRange.start = e.drawRange.start),
(this.drawRange.count = e.drawRange.count),
(this.userData = e.userData),
this
)
},
},
{
key: 'dispose',
value: function () {
this.dispatchEvent({ type: 'dispose' })
},
},
])
)
})(kc),
of = new Gh(),
sf = new Wh(),
uf = new Dh(),
lf = new ph(),
cf = new ph(),
hf = new ph(),
df = new ph(),
ff = new ph(),
pf = new ph(),
vf = new ph(),
mf = new ph(),
gf = (function (e) {
function t() {
var e,
n = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : new af(),
r = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : new zd()
return (
A(this, t),
((e = y(this, t)).isMesh = !0),
(e.type = 'Mesh'),
(e.geometry = n),
(e.material = r),
e.updateMorphTargets(),
e
)
}
return (
x(t, e),
T(t, [
{
key: 'copy',
value: function (e, r) {
return (
n(t, 'copy', this, 3)([e, r]),
void 0 !== e.morphTargetInfluences &&
(this.morphTargetInfluences = e.morphTargetInfluences.slice()),
void 0 !== e.morphTargetDictionary &&
(this.morphTargetDictionary = Object.assign({}, e.morphTargetDictionary)),
(this.material = Array.isArray(e.material)
? e.material.slice()
: e.material),
(this.geometry = e.geometry),
this
)
},
},
{
key: 'updateMorphTargets',
value: function () {
var e = this.geometry.morphAttributes,
t = Object.keys(e)
if (t.length > 0) {
var n = e[t[0]]
if (void 0 !== n) {
;((this.morphTargetInfluences = []), (this.morphTargetDictionary = {}))
for (var r = 0, i = n.length; r < i; r++) {
var a = n[r].name || String(r)
;(this.morphTargetInfluences.push(0),
(this.morphTargetDictionary[a] = r))
}
}
}
},
},
{
key: 'getVertexPosition',
value: function (e, t) {
var n = this.geometry,
r = n.attributes.position,
i = n.morphAttributes.position,
a = n.morphTargetsRelative
t.fromBufferAttribute(r, e)
var o = this.morphTargetInfluences
if (i && o) {
pf.set(0, 0, 0)
for (var s = 0, u = i.length; s < u; s++) {
var l = o[s],
c = i[s]
0 !== l &&
(ff.fromBufferAttribute(c, e),
a ? pf.addScaledVector(ff, l) : pf.addScaledVector(ff.sub(t), l))
}
t.add(pf)
}
return t
},
},
{
key: 'raycast',
value: function (e, t) {
var n = this.geometry,
r = this.material,
i = this.matrixWorld
if (void 0 !== r) {
if (
(null === n.boundingSphere && n.computeBoundingSphere(),
uf.copy(n.boundingSphere),
uf.applyMatrix4(i),
sf.copy(e.ray).recast(e.near),
!1 === uf.containsPoint(sf.origin))
) {
if (null === sf.intersectSphere(uf, lf)) return
if (sf.origin.distanceToSquared(lf) > Math.pow(e.far - e.near, 2)) return
}
;(of.copy(i).invert(),
sf.copy(e.ray).applyMatrix4(of),
(null !== n.boundingBox && !1 === sf.intersectsBox(n.boundingBox)) ||
this._computeIntersections(e, t, sf))
}
},
},
{
key: '_computeIntersections',
value: function (e, t, n) {
var r,
i = this.geometry,
a = this.material,
o = i.index,
s = i.attributes.position,
u = i.attributes.uv,
l = i.attributes.uv1,
c = i.attributes.normal,
h = i.groups,
d = i.drawRange
if (null !== o)
if (Array.isArray(a))
for (var f = 0, p = h.length; f < p; f++)
for (
var v = h[f],
m = a[v.materialIndex],
g = Math.max(v.start, d.start),
y = Math.min(
o.count,
Math.min(v.start + v.count, d.start + d.count)
);
g < y;
g += 3
) {
;(r = yf(
this,
m,
e,
n,
u,
l,
c,
o.getX(g),
o.getX(g + 1),
o.getX(g + 2)
)) &&
((r.faceIndex = Math.floor(g / 3)),
(r.face.materialIndex = v.materialIndex),
t.push(r))
}
else
for (
var _ = Math.max(0, d.start), b = Math.min(o.count, d.start + d.count);
_ < b;
_ += 3
) {
;(r = yf(
this,
a,
e,
n,
u,
l,
c,
o.getX(_),
o.getX(_ + 1),
o.getX(_ + 2)
)) && ((r.faceIndex = Math.floor(_ / 3)), t.push(r))
}
else if (void 0 !== s)
if (Array.isArray(a))
for (var x = 0, S = h.length; x < S; x++)
for (
var A = h[x],
w = a[A.materialIndex],
T = Math.max(A.start, d.start),
M = Math.min(
s.count,
Math.min(A.start + A.count, d.start + d.count)
);
T < M;
T += 3
) {
;(r = yf(this, w, e, n, u, l, c, T, T + 1, T + 2)) &&
((r.faceIndex = Math.floor(T / 3)),
(r.face.materialIndex = A.materialIndex),
t.push(r))
}
else
for (
var E = Math.max(0, d.start), C = Math.min(s.count, d.start + d.count);
E < C;
E += 3
) {
;(r = yf(this, a, e, n, u, l, c, E, E + 1, E + 2)) &&
((r.faceIndex = Math.floor(E / 3)), t.push(r))
}
},
},
])
)
})(gd)
function yf(e, t, n, r, i, a, o, s, u, l) {
;(e.getVertexPosition(s, cf), e.getVertexPosition(u, hf), e.getVertexPosition(l, df))
var c = (function (e, t, n, r, i, a, o, s) {
if (
null ===
(1 === t.side
? r.intersectTriangle(o, a, i, !0, s)
: r.intersectTriangle(i, a, o, 0 === t.side, s))
)
return null
;(mf.copy(s), mf.applyMatrix4(e.matrixWorld))
var u = n.ray.origin.distanceTo(mf)
return u < n.near || u > n.far ? null : { distance: u, point: mf.clone(), object: e }
})(e, t, n, r, cf, hf, df, vf)
if (c) {
var h = new ph()
;(Id.getBarycoord(vf, cf, hf, df, h),
i && (c.uv = Id.getInterpolatedAttribute(i, s, u, l, h, new Vc())),
a && (c.uv1 = Id.getInterpolatedAttribute(a, s, u, l, h, new Vc())),
o &&
((c.normal = Id.getInterpolatedAttribute(o, s, u, l, h, new ph())),
c.normal.dot(r.direction) > 0 && c.normal.multiplyScalar(-1)))
var d = { a: s, b: u, c: l, normal: new ph(), materialIndex: 0 }
;(Id.getNormal(cf, hf, df, d.normal), (c.face = d), (c.barycoord = h))
}
return c
}
var _f = (function (e) {
function t() {
var e,
n = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : 1,
r = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : 1,
i = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : 1,
a = arguments.length > 3 && void 0 !== arguments[3] ? arguments[3] : 1,
o = arguments.length > 4 && void 0 !== arguments[4] ? arguments[4] : 1,
s = arguments.length > 5 && void 0 !== arguments[5] ? arguments[5] : 1
;(A(this, t),
((e = y(this, t)).type = 'BoxGeometry'),
(e.parameters = {
width: n,
height: r,
depth: i,
widthSegments: a,
heightSegments: o,
depthSegments: s,
}))
var u = e
;((a = Math.floor(a)), (o = Math.floor(o)), (s = Math.floor(s)))
var l = [],
c = [],
h = [],
d = [],
f = 0,
p = 0
function v(e, t, n, r, i, a, o, s, v, m, g) {
for (
var y = a / v,
_ = o / m,
b = a / 2,
x = o / 2,
S = s / 2,
A = v + 1,
w = m + 1,
T = 0,
M = 0,
E = new ph(),
C = 0;
C < w;
C++
)
for (var k = C * _ - x, R = 0; R < A; R++) {
var I = R * y - b
;((E[e] = I * r),
(E[t] = k * i),
(E[n] = S),
c.push(E.x, E.y, E.z),
(E[e] = 0),
(E[t] = 0),
(E[n] = s > 0 ? 1 : -1),
h.push(E.x, E.y, E.z),
d.push(R / v),
d.push(1 - C / m),
(T += 1))
}
for (var N = 0; N < m; N++)
for (var P = 0; P < v; P++) {
var L = f + P + A * N,
D = f + P + A * (N + 1),
O = f + (P + 1) + A * (N + 1),
F = f + (P + 1) + A * N
;(l.push(L, D, F), l.push(D, O, F), (M += 6))
}
;(u.addGroup(p, M, g), (p += M), (f += T))
}
return (
v('z', 'y', 'x', -1, -1, i, r, n, s, o, 0),
v('z', 'y', 'x', 1, -1, i, r, -n, s, o, 1),
v('x', 'z', 'y', 1, 1, n, i, r, a, s, 2),
v('x', 'z', 'y', 1, -1, n, i, -r, a, s, 3),
v('x', 'y', 'z', 1, -1, n, r, i, a, o, 4),
v('x', 'y', 'z', -1, -1, n, r, -i, a, o, 5),
e.setIndex(l),
e.setAttribute('position', new Kd(c, 3)),
e.setAttribute('normal', new Kd(h, 3)),
e.setAttribute('uv', new Kd(d, 2)),
e
)
}
return (
x(t, e),
T(
t,
[
{
key: 'copy',
value: function (e) {
return (
n(t, 'copy', this, 3)([e]),
(this.parameters = Object.assign({}, e.parameters)),
this
)
},
},
],
[
{
key: 'fromJSON',
value: function (e) {
return new t(
e.width,
e.height,
e.depth,
e.widthSegments,
e.heightSegments,
e.depthSegments
)
},
},
]
)
)
})(af)
function bf(e) {
var t = {}
for (var n in e)
for (var r in ((t[n] = {}), e[n])) {
var i = e[n][r]
i &&
(i.isColor ||
i.isMatrix3 ||
i.isMatrix4 ||
i.isVector2 ||
i.isVector3 ||
i.isVector4 ||
i.isTexture ||
i.isQuaternion)
? i.isRenderTargetTexture
? (console.warn(
'UniformsUtils: Textures of render targets cannot be cloned via cloneUniforms() or mergeUniforms().'
),
(t[n][r] = null))
: (t[n][r] = i.clone())
: Array.isArray(i)
? (t[n][r] = i.slice())
: (t[n][r] = i)
}
return t
}
function xf(e) {
for (var t = {}, n = 0; n < e.length; n++) {
var r = bf(e[n])
for (var i in r) t[i] = r[i]
}
return t
}
function Sf(e) {
var t = e.getRenderTarget()
return null === t
? e.outputColorSpace
: !0 === t.isXRRenderTarget
? t.texture.colorSpace
: $c.workingColorSpace
}
var Af = { clone: bf, merge: xf },
wf = (function (e) {
function t(e) {
var n
return (
A(this, t),
((n = y(this, t)).isShaderMaterial = !0),
(n.type = 'ShaderMaterial'),
(n.defines = {}),
(n.uniforms = {}),
(n.uniformsGroups = []),
(n.vertexShader =
'void main() {\n\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}'),
(n.fragmentShader =
'void main() {\n\tgl_FragColor = vec4( 1.0, 0.0, 0.0, 1.0 );\n}'),
(n.linewidth = 1),
(n.wireframe = !1),
(n.wireframeLinewidth = 1),
(n.fog = !1),
(n.lights = !1),
(n.clipping = !1),
(n.forceSinglePass = !0),
(n.extensions = { clipCullDistance: !1, multiDraw: !1 }),
(n.defaultAttributeValues = { color: [1, 1, 1], uv: [0, 0], uv1: [0, 0] }),
(n.index0AttributeName = void 0),
(n.uniformsNeedUpdate = !1),
(n.glslVersion = null),
void 0 !== e && n.setValues(e),
n
)
}
return (
x(t, e),
T(t, [
{
key: 'copy',
value: function (e) {
return (
n(t, 'copy', this, 3)([e]),
(this.fragmentShader = e.fragmentShader),
(this.vertexShader = e.vertexShader),
(this.uniforms = bf(e.uniforms)),
(this.uniformsGroups = (function (e) {
for (var t = [], n = 0; n < e.length; n++) t.push(e[n].clone())
return t
})(e.uniformsGroups)),
(this.defines = Object.assign({}, e.defines)),
(this.wireframe = e.wireframe),
(this.wireframeLinewidth = e.wireframeLinewidth),
(this.fog = e.fog),
(this.lights = e.lights),
(this.clipping = e.clipping),
(this.extensions = Object.assign({}, e.extensions)),
(this.glslVersion = e.glslVersion),
this
)
},
},
{
key: 'toJSON',
value: function (e) {
var r = n(t, 'toJSON', this, 3)([e])
for (var i in ((r.glslVersion = this.glslVersion),
(r.uniforms = {}),
this.uniforms)) {
var a = this.uniforms[i].value
a && a.isTexture
? (r.uniforms[i] = { type: 't', value: a.toJSON(e).uuid })
: a && a.isColor
? (r.uniforms[i] = { type: 'c', value: a.getHex() })
: a && a.isVector2
? (r.uniforms[i] = { type: 'v2', value: a.toArray() })
: a && a.isVector3
? (r.uniforms[i] = { type: 'v3', value: a.toArray() })
: a && a.isVector4
? (r.uniforms[i] = { type: 'v4', value: a.toArray() })
: a && a.isMatrix3
? (r.uniforms[i] = { type: 'm3', value: a.toArray() })
: a && a.isMatrix4
? (r.uniforms[i] = { type: 'm4', value: a.toArray() })
: (r.uniforms[i] = { value: a })
}
;(Object.keys(this.defines).length > 0 && (r.defines = this.defines),
(r.vertexShader = this.vertexShader),
(r.fragmentShader = this.fragmentShader),
(r.lights = this.lights),
(r.clipping = this.clipping))
var o = {}
for (var s in this.extensions) !0 === this.extensions[s] && (o[s] = !0)
return (Object.keys(o).length > 0 && (r.extensions = o), r)
},
},
])
)
})(Ud),
Tf = (function (e) {
function t() {
var e
return (
A(this, t),
((e = y(this, t)).isCamera = !0),
(e.type = 'Camera'),
(e.matrixWorldInverse = new Gh()),
(e.projectionMatrix = new Gh()),
(e.projectionMatrixInverse = new Gh()),
(e.coordinateSystem = Ec),
e
)
}
return (
x(t, e),
T(t, [
{
key: 'copy',
value: function (e, r) {
return (
n(t, 'copy', this, 3)([e, r]),
this.matrixWorldInverse.copy(e.matrixWorldInverse),
this.projectionMatrix.copy(e.projectionMatrix),
this.projectionMatrixInverse.copy(e.projectionMatrixInverse),
(this.coordinateSystem = e.coordinateSystem),
this
)
},
},
{
key: 'getWorldDirection',
value: function (e) {
return n(t, 'getWorldDirection', this, 3)([e]).negate()
},
},
{
key: 'updateMatrixWorld',
value: function (e) {
;(n(t, 'updateMatrixWorld', this, 3)([e]),
this.matrixWorldInverse.copy(this.matrixWorld).invert())
},
},
{
key: 'updateWorldMatrix',
value: function (e, r) {
;(n(t, 'updateWorldMatrix', this, 3)([e, r]),
this.matrixWorldInverse.copy(this.matrixWorld).invert())
},
},
{
key: 'clone',
value: function () {
return new this.constructor().copy(this)
},
},
])
)
})(gd),
Mf = new ph(),
Ef = new Vc(),
Cf = new Vc(),
kf = (function (e) {
function t() {
var e,
n = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : 50,
r = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : 1,
i = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : 0.1,
a = arguments.length > 3 && void 0 !== arguments[3] ? arguments[3] : 2e3
return (
A(this, t),
((e = y(this, t)).isPerspectiveCamera = !0),
(e.type = 'PerspectiveCamera'),
(e.fov = n),
(e.zoom = 1),
(e.near = i),
(e.far = a),
(e.focus = 10),
(e.aspect = r),
(e.view = null),
(e.filmGauge = 35),
(e.filmOffset = 0),
e.updateProjectionMatrix(),
e
)
}
return (
x(t, e),
T(t, [
{
key: 'copy',
value: function (e, r) {
return (
n(t, 'copy', this, 3)([e, r]),
(this.fov = e.fov),
(this.zoom = e.zoom),
(this.near = e.near),
(this.far = e.far),
(this.focus = e.focus),
(this.aspect = e.aspect),
(this.view = null === e.view ? null : Object.assign({}, e.view)),
(this.filmGauge = e.filmGauge),
(this.filmOffset = e.filmOffset),
this
)
},
},
{
key: 'setFocalLength',
value: function (e) {
var t = (0.5 * this.getFilmHeight()) / e
;((this.fov = 2 * Pc * Math.atan(t)), this.updateProjectionMatrix())
},
},
{
key: 'getFocalLength',
value: function () {
var e = Math.tan(0.5 * Nc * this.fov)
return (0.5 * this.getFilmHeight()) / e
},
},
{
key: 'getEffectiveFOV',
value: function () {
return 2 * Pc * Math.atan(Math.tan(0.5 * Nc * this.fov) / this.zoom)
},
},
{
key: 'getFilmWidth',
value: function () {
return this.filmGauge * Math.min(this.aspect, 1)
},
},
{
key: 'getFilmHeight',
value: function () {
return this.filmGauge / Math.max(this.aspect, 1)
},
},
{
key: 'getViewBounds',
value: function (e, t, n) {
;(Mf.set(-1, -1, 0.5).applyMatrix4(this.projectionMatrixInverse),
t.set(Mf.x, Mf.y).multiplyScalar(-e / Mf.z),
Mf.set(1, 1, 0.5).applyMatrix4(this.projectionMatrixInverse),
n.set(Mf.x, Mf.y).multiplyScalar(-e / Mf.z))
},
},
{
key: 'getViewSize',
value: function (e, t) {
return (this.getViewBounds(e, Ef, Cf), t.subVectors(Cf, Ef))
},
},
{
key: 'setViewOffset',
value: function (e, t, n, r, i, a) {
;((this.aspect = e / t),
null === this.view &&
(this.view = {
enabled: !0,
fullWidth: 1,
fullHeight: 1,
offsetX: 0,
offsetY: 0,
width: 1,
height: 1,
}),
(this.view.enabled = !0),
(this.view.fullWidth = e),
(this.view.fullHeight = t),
(this.view.offsetX = n),
(this.view.offsetY = r),
(this.view.width = i),
(this.view.height = a),
this.updateProjectionMatrix())
},
},
{
key: 'clearViewOffset',
value: function () {
;(null !== this.view && (this.view.enabled = !1),
this.updateProjectionMatrix())
},
},
{
key: 'updateProjectionMatrix',
value: function () {
var e = this.near,
t = (e * Math.tan(0.5 * Nc * this.fov)) / this.zoom,
n = 2 * t,
r = this.aspect * n,
i = -0.5 * r,
a = this.view
if (null !== this.view && this.view.enabled) {
var o = a.fullWidth,
s = a.fullHeight
;((i += (a.offsetX * r) / o),
(t -= (a.offsetY * n) / s),
(r *= a.width / o),
(n *= a.height / s))
}
var u = this.filmOffset
;(0 !== u && (i += (e * u) / this.getFilmWidth()),
this.projectionMatrix.makePerspective(
i,
i + r,
t,
t - n,
e,
this.far,
this.coordinateSystem
),
this.projectionMatrixInverse.copy(this.projectionMatrix).invert())
},
},
{
key: 'toJSON',
value: function (e) {
var r = n(t, 'toJSON', this, 3)([e])
return (
(r.object.fov = this.fov),
(r.object.zoom = this.zoom),
(r.object.near = this.near),
(r.object.far = this.far),
(r.object.focus = this.focus),
(r.object.aspect = this.aspect),
null !== this.view && (r.object.view = Object.assign({}, this.view)),
(r.object.filmGauge = this.filmGauge),
(r.object.filmOffset = this.filmOffset),
r
)
},
},
])
)
})(Tf),
Rf = -90,
If = (function (e) {
function t(e, n, r) {
var i
;(A(this, t),
((i = y(this, t)).type = 'CubeCamera'),
(i.renderTarget = r),
(i.coordinateSystem = null),
(i.activeMipmapLevel = 0))
var a = new kf(Rf, 1, e, n)
;((a.layers = i.layers), i.add(a))
var o = new kf(Rf, 1, e, n)
;((o.layers = i.layers), i.add(o))
var s = new kf(Rf, 1, e, n)
;((s.layers = i.layers), i.add(s))
var u = new kf(Rf, 1, e, n)
;((u.layers = i.layers), i.add(u))
var l = new kf(Rf, 1, e, n)
;((l.layers = i.layers), i.add(l))
var c = new kf(Rf, 1, e, n)
return ((c.layers = i.layers), i.add(c), i)
}
return (
x(t, e),
T(t, [
{
key: 'updateCoordinateSystem',
value: function () {
var e,
t = this.coordinateSystem,
n = this.children.concat(),
r = C(n, 6),
i = r[0],
a = r[1],
o = r[2],
s = r[3],
u = r[4],
l = r[5],
c = L(n)
try {
for (c.s(); !(e = c.n()).done; ) {
var h = e.value
this.remove(h)
}
} catch (v) {
c.e(v)
} finally {
c.f()
}
if (t === Ec)
(i.up.set(0, 1, 0),
i.lookAt(1, 0, 0),
a.up.set(0, 1, 0),
a.lookAt(-1, 0, 0),
o.up.set(0, 0, -1),
o.lookAt(0, 1, 0),
s.up.set(0, 0, 1),
s.lookAt(0, -1, 0),
u.up.set(0, 1, 0),
u.lookAt(0, 0, 1),
l.up.set(0, 1, 0),
l.lookAt(0, 0, -1))
else {
if (t !== Cc)
throw new Error(
'THREE.CubeCamera.updateCoordinateSystem(): Invalid coordinate system: ' +
t
)
;(i.up.set(0, -1, 0),
i.lookAt(-1, 0, 0),
a.up.set(0, -1, 0),
a.lookAt(1, 0, 0),
o.up.set(0, 0, 1),
o.lookAt(0, 1, 0),
s.up.set(0, 0, -1),
s.lookAt(0, -1, 0),
u.up.set(0, -1, 0),
u.lookAt(0, 0, 1),
l.up.set(0, -1, 0),
l.lookAt(0, 0, -1))
}
var d,
f = L(n)
try {
for (f.s(); !(d = f.n()).done; ) {
var p = d.value
;(this.add(p), p.updateMatrixWorld())
}
} catch (v) {
f.e(v)
} finally {
f.f()
}
},
},
{
key: 'update',
value: function (e, t) {
null === this.parent && this.updateMatrixWorld()
var n = this.renderTarget,
r = this.activeMipmapLevel
this.coordinateSystem !== e.coordinateSystem &&
((this.coordinateSystem = e.coordinateSystem),
this.updateCoordinateSystem())
var i = C(this.children, 6),
a = i[0],
o = i[1],
s = i[2],
u = i[3],
l = i[4],
c = i[5],
h = e.getRenderTarget(),
d = e.getActiveCubeFace(),
f = e.getActiveMipmapLevel(),
p = e.xr.enabled
e.xr.enabled = !1
var v = n.texture.generateMipmaps
;((n.texture.generateMipmaps = !1),
e.setRenderTarget(n, 0, r),
e.render(t, a),
e.setRenderTarget(n, 1, r),
e.render(t, o),
e.setRenderTarget(n, 2, r),
e.render(t, s),
e.setRenderTarget(n, 3, r),
e.render(t, u),
e.setRenderTarget(n, 4, r),
e.render(t, l),
(n.texture.generateMipmaps = v),
e.setRenderTarget(n, 5, r),
e.render(t, c),
e.setRenderTarget(h, d, f),
(e.xr.enabled = p),
(n.texture.needsPMREMUpdate = !0))
},
},
])
)
})(gd),
Nf = (function (e) {
function t(e, n, r, i, a, o, s, u, l, c) {
var h
return (
A(this, t),
((h = y(this, t, [
(e = void 0 !== e ? e : []),
(n = void 0 !== n ? n : tl),
r,
i,
a,
o,
s,
u,
l,
c,
])).isCubeTexture = !0),
(h.flipY = !1),
h
)
}
return (
x(t, e),
T(t, [
{
key: 'images',
get: function () {
return this.image
},
set: function (e) {
this.image = e
},
},
])
)
})(sh),
Pf = (function (e) {
function t() {
var e,
n = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : 1,
r = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {}
;(A(this, t), ((e = y(this, t, [n, n, r])).isWebGLCubeRenderTarget = !0))
var i = { width: n, height: n, depth: 1 },
a = [i, i, i, i, i, i]
return (
(e.texture = new Nf(
a,
r.mapping,
r.wrapS,
r.wrapT,
r.magFilter,
r.minFilter,
r.format,
r.type,
r.anisotropy,
r.colorSpace
)),
(e.texture.isRenderTargetTexture = !0),
(e.texture.generateMipmaps = void 0 !== r.generateMipmaps && r.generateMipmaps),
(e.texture.minFilter = void 0 !== r.minFilter ? r.minFilter : ll),
e
)
}
return (
x(t, e),
T(t, [
{
key: 'fromEquirectangularTexture',
value: function (e, t) {
;((this.texture.type = t.type),
(this.texture.colorSpace = t.colorSpace),
(this.texture.generateMipmaps = t.generateMipmaps),
(this.texture.minFilter = t.minFilter),
(this.texture.magFilter = t.magFilter))
var n = { tEquirect: { value: null } },
r =
'\n\n\t\t\t\tvarying vec3 vWorldDirection;\n\n\t\t\t\tvec3 transformDirection( in vec3 dir, in mat4 matrix ) {\n\n\t\t\t\t\treturn normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );\n\n\t\t\t\t}\n\n\t\t\t\tvoid main() {\n\n\t\t\t\t\tvWorldDirection = transformDirection( position, modelMatrix );\n\n\t\t\t\t\t#include \n\t\t\t\t\t#include \n\n\t\t\t\t}\n\t\t\t',
i =
'\n\n\t\t\t\tuniform sampler2D tEquirect;\n\n\t\t\t\tvarying vec3 vWorldDirection;\n\n\t\t\t\t#include \n\n\t\t\t\tvoid main() {\n\n\t\t\t\t\tvec3 direction = normalize( vWorldDirection );\n\n\t\t\t\t\tvec2 sampleUV = equirectUv( direction );\n\n\t\t\t\t\tgl_FragColor = texture2D( tEquirect, sampleUV );\n\n\t\t\t\t}\n\t\t\t',
a = new _f(5, 5, 5),
o = new wf({
name: 'CubemapFromEquirect',
uniforms: bf(n),
vertexShader: r,
fragmentShader: i,
side: 1,
blending: 0,
})
o.uniforms.tEquirect.value = t
var s = new gf(a, o),
u = t.minFilter
return (
t.minFilter === hl && (t.minFilter = ll),
new If(1, 10, this).update(e, s),
(t.minFilter = u),
s.geometry.dispose(),
s.material.dispose(),
this
)
},
},
{
key: 'clear',
value: function (e, t, n, r) {
for (var i = e.getRenderTarget(), a = 0; a < 6; a++)
(e.setRenderTarget(this, a), e.clear(t, n, r))
e.setRenderTarget(i)
},
},
])
)
})(ch),
Lf = (function (e) {
function t() {
var e
return (A(this, t), ((e = y(this, t)).isGroup = !0), (e.type = 'Group'), e)
}
return (x(t, e), T(t))
})(gd),
Df = { type: 'move' },
Of = (function () {
return T(
function e() {
;(A(this, e), (this._targetRay = null), (this._grip = null), (this._hand = null))
},
[
{
key: 'getHandSpace',
value: function () {
return (
null === this._hand &&
((this._hand = new Lf()),
(this._hand.matrixAutoUpdate = !1),
(this._hand.visible = !1),
(this._hand.joints = {}),
(this._hand.inputState = { pinching: !1 })),
this._hand
)
},
},
{
key: 'getTargetRaySpace',
value: function () {
return (
null === this._targetRay &&
((this._targetRay = new Lf()),
(this._targetRay.matrixAutoUpdate = !1),
(this._targetRay.visible = !1),
(this._targetRay.hasLinearVelocity = !1),
(this._targetRay.linearVelocity = new ph()),
(this._targetRay.hasAngularVelocity = !1),
(this._targetRay.angularVelocity = new ph())),
this._targetRay
)
},
},
{
key: 'getGripSpace',
value: function () {
return (
null === this._grip &&
((this._grip = new Lf()),
(this._grip.matrixAutoUpdate = !1),
(this._grip.visible = !1),
(this._grip.hasLinearVelocity = !1),
(this._grip.linearVelocity = new ph()),
(this._grip.hasAngularVelocity = !1),
(this._grip.angularVelocity = new ph())),
this._grip
)
},
},
{
key: 'dispatchEvent',
value: function (e) {
return (
null !== this._targetRay && this._targetRay.dispatchEvent(e),
null !== this._grip && this._grip.dispatchEvent(e),
null !== this._hand && this._hand.dispatchEvent(e),
this
)
},
},
{
key: 'connect',
value: function (e) {
if (e && e.hand) {
var t = this._hand
if (t) {
var n,
r = L(e.hand.values())
try {
for (r.s(); !(n = r.n()).done; ) {
var i = n.value
this._getHandJoint(t, i)
}
} catch (a) {
r.e(a)
} finally {
r.f()
}
}
}
return (this.dispatchEvent({ type: 'connected', data: e }), this)
},
},
{
key: 'disconnect',
value: function (e) {
return (
this.dispatchEvent({ type: 'disconnected', data: e }),
null !== this._targetRay && (this._targetRay.visible = !1),
null !== this._grip && (this._grip.visible = !1),
null !== this._hand && (this._hand.visible = !1),
this
)
},
},
{
key: 'update',
value: function (e, t, n) {
var r = null,
i = null,
a = null,
o = this._targetRay,
s = this._grip,
u = this._hand
if (e && 'visible-blurred' !== t.session.visibilityState) {
if (u && e.hand) {
a = !0
var l,
c = L(e.hand.values())
try {
for (c.s(); !(l = c.n()).done; ) {
var h = l.value,
d = t.getJointPose(h, n),
f = this._getHandJoint(u, h)
;(null !== d &&
(f.matrix.fromArray(d.transform.matrix),
f.matrix.decompose(f.position, f.rotation, f.scale),
(f.matrixWorldNeedsUpdate = !0),
(f.jointRadius = d.radius)),
(f.visible = null !== d))
}
} catch (g) {
c.e(g)
} finally {
c.f()
}
var p = u.joints['index-finger-tip'],
v = u.joints['thumb-tip'],
m = p.position.distanceTo(v.position)
u.inputState.pinching && m > 0.025
? ((u.inputState.pinching = !1),
this.dispatchEvent({
type: 'pinchend',
handedness: e.handedness,
target: this,
}))
: !u.inputState.pinching &&
m <= 0.015 &&
((u.inputState.pinching = !0),
this.dispatchEvent({
type: 'pinchstart',
handedness: e.handedness,
target: this,
}))
} else
null !== s &&
e.gripSpace &&
null !== (i = t.getPose(e.gripSpace, n)) &&
(s.matrix.fromArray(i.transform.matrix),
s.matrix.decompose(s.position, s.rotation, s.scale),
(s.matrixWorldNeedsUpdate = !0),
i.linearVelocity
? ((s.hasLinearVelocity = !0),
s.linearVelocity.copy(i.linearVelocity))
: (s.hasLinearVelocity = !1),
i.angularVelocity
? ((s.hasAngularVelocity = !0),
s.angularVelocity.copy(i.angularVelocity))
: (s.hasAngularVelocity = !1))
null !== o &&
(null === (r = t.getPose(e.targetRaySpace, n)) && null !== i && (r = i),
null !== r &&
(o.matrix.fromArray(r.transform.matrix),
o.matrix.decompose(o.position, o.rotation, o.scale),
(o.matrixWorldNeedsUpdate = !0),
r.linearVelocity
? ((o.hasLinearVelocity = !0),
o.linearVelocity.copy(r.linearVelocity))
: (o.hasLinearVelocity = !1),
r.angularVelocity
? ((o.hasAngularVelocity = !0),
o.angularVelocity.copy(r.angularVelocity))
: (o.hasAngularVelocity = !1),
this.dispatchEvent(Df)))
}
return (
null !== o && (o.visible = null !== r),
null !== s && (s.visible = null !== i),
null !== u && (u.visible = null !== a),
this
)
},
},
{
key: '_getHandJoint',
value: function (e, t) {
if (void 0 === e.joints[t.jointName]) {
var n = new Lf()
;((n.matrixAutoUpdate = !1),
(n.visible = !1),
(e.joints[t.jointName] = n),
e.add(n))
}
return e.joints[t.jointName]
},
},
]
)
})(),
Ff = (function (e) {
function t() {
var e
return (
A(this, t),
((e = y(this, t)).isScene = !0),
(e.type = 'Scene'),
(e.background = null),
(e.environment = null),
(e.fog = null),
(e.backgroundBlurriness = 0),
(e.backgroundIntensity = 1),
(e.backgroundRotation = new ed()),
(e.environmentIntensity = 1),
(e.environmentRotation = new ed()),
(e.overrideMaterial = null),
'undefined' != typeof __THREE_DEVTOOLS__ &&
__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent('observe', { detail: e })),
e
)
}
return (
x(t, e),
T(t, [
{
key: 'copy',
value: function (e, r) {
return (
n(t, 'copy', this, 3)([e, r]),
null !== e.background && (this.background = e.background.clone()),
null !== e.environment && (this.environment = e.environment.clone()),
null !== e.fog && (this.fog = e.fog.clone()),
(this.backgroundBlurriness = e.backgroundBlurriness),
(this.backgroundIntensity = e.backgroundIntensity),
this.backgroundRotation.copy(e.backgroundRotation),
(this.environmentIntensity = e.environmentIntensity),
this.environmentRotation.copy(e.environmentRotation),
null !== e.overrideMaterial &&
(this.overrideMaterial = e.overrideMaterial.clone()),
(this.matrixAutoUpdate = e.matrixAutoUpdate),
this
)
},
},
{
key: 'toJSON',
value: function (e) {
var r = n(t, 'toJSON', this, 3)([e])
return (
null !== this.fog && (r.object.fog = this.fog.toJSON()),
this.backgroundBlurriness > 0 &&
(r.object.backgroundBlurriness = this.backgroundBlurriness),
1 !== this.backgroundIntensity &&
(r.object.backgroundIntensity = this.backgroundIntensity),
(r.object.backgroundRotation = this.backgroundRotation.toArray()),
1 !== this.environmentIntensity &&
(r.object.environmentIntensity = this.environmentIntensity),
(r.object.environmentRotation = this.environmentRotation.toArray()),
r
)
},
},
])
)
})(gd),
Bf = (function () {
return T(
function e(t, n) {
;(A(this, e),
(this.isInterleavedBuffer = !0),
(this.array = t),
(this.stride = n),
(this.count = void 0 !== t ? t.length / n : 0),
(this.usage = wc),
(this.updateRanges = []),
(this.version = 0),
(this.uuid = Lc()))
},
[
{ key: 'onUploadCallback', value: function () {} },
{
key: 'needsUpdate',
set: function (e) {
!0 === e && this.version++
},
},
{
key: 'setUsage',
value: function (e) {
return ((this.usage = e), this)
},
},
{
key: 'addUpdateRange',
value: function (e, t) {
this.updateRanges.push({ start: e, count: t })
},
},
{
key: 'clearUpdateRanges',
value: function () {
this.updateRanges.length = 0
},
},
{
key: 'copy',
value: function (e) {
return (
(this.array = new e.array.constructor(e.array)),
(this.count = e.count),
(this.stride = e.stride),
(this.usage = e.usage),
this
)
},
},
{
key: 'copyAt',
value: function (e, t, n) {
;((e *= this.stride), (n *= t.stride))
for (var r = 0, i = this.stride; r < i; r++)
this.array[e + r] = t.array[n + r]
return this
},
},
{
key: 'set',
value: function (e) {
var t = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : 0
return (this.array.set(e, t), this)
},
},
{
key: 'clone',
value: function (e) {
;(void 0 === e.arrayBuffers && (e.arrayBuffers = {}),
void 0 === this.array.buffer._uuid && (this.array.buffer._uuid = Lc()),
void 0 === e.arrayBuffers[this.array.buffer._uuid] &&
(e.arrayBuffers[this.array.buffer._uuid] = this.array.slice(0).buffer))
var t = new this.array.constructor(e.arrayBuffers[this.array.buffer._uuid]),
n = new this.constructor(t, this.stride)
return (n.setUsage(this.usage), n)
},
},
{
key: 'onUpload',
value: function (e) {
return ((this.onUploadCallback = e), this)
},
},
{
key: 'toJSON',
value: function (e) {
return (
void 0 === e.arrayBuffers && (e.arrayBuffers = {}),
void 0 === this.array.buffer._uuid && (this.array.buffer._uuid = Lc()),
void 0 === e.arrayBuffers[this.array.buffer._uuid] &&
(e.arrayBuffers[this.array.buffer._uuid] = Array.from(
new Uint32Array(this.array.buffer)
)),
{
uuid: this.uuid,
buffer: this.array.buffer._uuid,
type: this.array.constructor.name,
stride: this.stride,
}
)
},
},
]
)
})(),
Uf = new ph(),
zf = (function () {
function e(t, n, r) {
var i = arguments.length > 3 && void 0 !== arguments[3] && arguments[3]
;(A(this, e),
(this.isInterleavedBufferAttribute = !0),
(this.name = ''),
(this.data = t),
(this.itemSize = n),
(this.offset = r),
(this.normalized = i))
}
return T(e, [
{
key: 'count',
get: function () {
return this.data.count
},
},
{
key: 'array',
get: function () {
return this.data.array
},
},
{
key: 'needsUpdate',
set: function (e) {
this.data.needsUpdate = e
},
},
{
key: 'applyMatrix4',
value: function (e) {
for (var t = 0, n = this.data.count; t < n; t++)
(Uf.fromBufferAttribute(this, t),
Uf.applyMatrix4(e),
this.setXYZ(t, Uf.x, Uf.y, Uf.z))
return this
},
},
{
key: 'applyNormalMatrix',
value: function (e) {
for (var t = 0, n = this.count; t < n; t++)
(Uf.fromBufferAttribute(this, t),
Uf.applyNormalMatrix(e),
this.setXYZ(t, Uf.x, Uf.y, Uf.z))
return this
},
},
{
key: 'transformDirection',
value: function (e) {
for (var t = 0, n = this.count; t < n; t++)
(Uf.fromBufferAttribute(this, t),
Uf.transformDirection(e),
this.setXYZ(t, Uf.x, Uf.y, Uf.z))
return this
},
},
{
key: 'getComponent',
value: function (e, t) {
var n = this.array[e * this.data.stride + this.offset + t]
return (this.normalized && (n = Bc(n, this.array)), n)
},
},
{
key: 'setComponent',
value: function (e, t, n) {
return (
this.normalized && (n = Uc(n, this.array)),
(this.data.array[e * this.data.stride + this.offset + t] = n),
this
)
},
},
{
key: 'setX',
value: function (e, t) {
return (
this.normalized && (t = Uc(t, this.array)),
(this.data.array[e * this.data.stride + this.offset] = t),
this
)
},
},
{
key: 'setY',
value: function (e, t) {
return (
this.normalized && (t = Uc(t, this.array)),
(this.data.array[e * this.data.stride + this.offset + 1] = t),
this
)
},
},
{
key: 'setZ',
value: function (e, t) {
return (
this.normalized && (t = Uc(t, this.array)),
(this.data.array[e * this.data.stride + this.offset + 2] = t),
this
)
},
},
{
key: 'setW',
value: function (e, t) {
return (
this.normalized && (t = Uc(t, this.array)),
(this.data.array[e * this.data.stride + this.offset + 3] = t),
this
)
},
},
{
key: 'getX',
value: function (e) {
var t = this.data.array[e * this.data.stride + this.offset]
return (this.normalized && (t = Bc(t, this.array)), t)
},
},
{
key: 'getY',
value: function (e) {
var t = this.data.array[e * this.data.stride + this.offset + 1]
return (this.normalized && (t = Bc(t, this.array)), t)
},
},
{
key: 'getZ',
value: function (e) {
var t = this.data.array[e * this.data.stride + this.offset + 2]
return (this.normalized && (t = Bc(t, this.array)), t)
},
},
{
key: 'getW',
value: function (e) {
var t = this.data.array[e * this.data.stride + this.offset + 3]
return (this.normalized && (t = Bc(t, this.array)), t)
},
},
{
key: 'setXY',
value: function (e, t, n) {
return (
(e = e * this.data.stride + this.offset),
this.normalized && ((t = Uc(t, this.array)), (n = Uc(n, this.array))),
(this.data.array[e + 0] = t),
(this.data.array[e + 1] = n),
this
)
},
},
{
key: 'setXYZ',
value: function (e, t, n, r) {
return (
(e = e * this.data.stride + this.offset),
this.normalized &&
((t = Uc(t, this.array)), (n = Uc(n, this.array)), (r = Uc(r, this.array))),
(this.data.array[e + 0] = t),
(this.data.array[e + 1] = n),
(this.data.array[e + 2] = r),
this
)
},
},
{
key: 'setXYZW',
value: function (e, t, n, r, i) {
return (
(e = e * this.data.stride + this.offset),
this.normalized &&
((t = Uc(t, this.array)),
(n = Uc(n, this.array)),
(r = Uc(r, this.array)),
(i = Uc(i, this.array))),
(this.data.array[e + 0] = t),
(this.data.array[e + 1] = n),
(this.data.array[e + 2] = r),
(this.data.array[e + 3] = i),
this
)
},
},
{
key: 'clone',
value: function (t) {
if (void 0 === t) {
console.log(
'THREE.InterleavedBufferAttribute.clone(): Cloning an interleaved buffer attribute will de-interleave buffer data.'
)
for (var n = [], r = 0; r < this.count; r++)
for (
var i = r * this.data.stride + this.offset, a = 0;
a < this.itemSize;
a++
)
n.push(this.data.array[i + a])
return new qd(new this.array.constructor(n), this.itemSize, this.normalized)
}
return (
void 0 === t.interleavedBuffers && (t.interleavedBuffers = {}),
void 0 === t.interleavedBuffers[this.data.uuid] &&
(t.interleavedBuffers[this.data.uuid] = this.data.clone(t)),
new e(
t.interleavedBuffers[this.data.uuid],
this.itemSize,
this.offset,
this.normalized
)
)
},
},
{
key: 'toJSON',
value: function (e) {
if (void 0 === e) {
console.log(
'THREE.InterleavedBufferAttribute.toJSON(): Serializing an interleaved buffer attribute will de-interleave buffer data.'
)
for (var t = [], n = 0; n < this.count; n++)
for (
var r = n * this.data.stride + this.offset, i = 0;
i < this.itemSize;
i++
)
t.push(this.data.array[r + i])
return {
itemSize: this.itemSize,
type: this.array.constructor.name,
array: t,
normalized: this.normalized,
}
}
return (
void 0 === e.interleavedBuffers && (e.interleavedBuffers = {}),
void 0 === e.interleavedBuffers[this.data.uuid] &&
(e.interleavedBuffers[this.data.uuid] = this.data.toJSON(e)),
{
isInterleavedBufferAttribute: !0,
itemSize: this.itemSize,
data: this.data.uuid,
offset: this.offset,
normalized: this.normalized,
}
)
},
},
])
})(),
Vf = new ph(),
Hf = new uh(),
Wf = new uh(),
Gf = new ph(),
jf = new Gh(),
Qf = new ph(),
qf = new Dh(),
Xf = new Gh(),
Yf = new Wh(),
Kf = (function (e) {
function t(e, n) {
var r
return (
A(this, t),
((r = y(this, t, [e, n])).isSkinnedMesh = !0),
(r.type = 'SkinnedMesh'),
(r.bindMode = el),
(r.bindMatrix = new Gh()),
(r.bindMatrixInverse = new Gh()),
(r.boundingBox = null),
(r.boundingSphere = null),
r
)
}
return (
x(t, e),
T(t, [
{
key: 'computeBoundingBox',
value: function () {
var e = this.geometry
;(null === this.boundingBox && (this.boundingBox = new gh()),
this.boundingBox.makeEmpty())
for (var t = e.getAttribute('position'), n = 0; n < t.count; n++)
(this.getVertexPosition(n, Qf), this.boundingBox.expandByPoint(Qf))
},
},
{
key: 'computeBoundingSphere',
value: function () {
var e = this.geometry
;(null === this.boundingSphere && (this.boundingSphere = new Dh()),
this.boundingSphere.makeEmpty())
for (var t = e.getAttribute('position'), n = 0; n < t.count; n++)
(this.getVertexPosition(n, Qf), this.boundingSphere.expandByPoint(Qf))
},
},
{
key: 'copy',
value: function (e, r) {
return (
n(t, 'copy', this, 3)([e, r]),
(this.bindMode = e.bindMode),
this.bindMatrix.copy(e.bindMatrix),
this.bindMatrixInverse.copy(e.bindMatrixInverse),
(this.skeleton = e.skeleton),
null !== e.boundingBox && (this.boundingBox = e.boundingBox.clone()),
null !== e.boundingSphere &&
(this.boundingSphere = e.boundingSphere.clone()),
this
)
},
},
{
key: 'raycast',
value: function (e, t) {
var n = this.material,
r = this.matrixWorld
void 0 !== n &&
(null === this.boundingSphere && this.computeBoundingSphere(),
qf.copy(this.boundingSphere),
qf.applyMatrix4(r),
!1 !== e.ray.intersectsSphere(qf) &&
(Xf.copy(r).invert(),
Yf.copy(e.ray).applyMatrix4(Xf),
(null !== this.boundingBox &&
!1 === Yf.intersectsBox(this.boundingBox)) ||
this._computeIntersections(e, t, Yf)))
},
},
{
key: 'getVertexPosition',
value: function (e, r) {
return (
n(t, 'getVertexPosition', this, 3)([e, r]),
this.applyBoneTransform(e, r),
r
)
},
},
{
key: 'bind',
value: function (e, t) {
;((this.skeleton = e),
void 0 === t &&
(this.updateMatrixWorld(!0),
this.skeleton.calculateInverses(),
(t = this.matrixWorld)),
this.bindMatrix.copy(t),
this.bindMatrixInverse.copy(t).invert())
},
},
{
key: 'pose',
value: function () {
this.skeleton.pose()
},
},
{
key: 'normalizeSkinWeights',
value: function () {
for (
var e = new uh(),
t = this.geometry.attributes.skinWeight,
n = 0,
r = t.count;
n < r;
n++
) {
e.fromBufferAttribute(t, n)
var i = 1 / e.manhattanLength()
;(i !== 1 / 0 ? e.multiplyScalar(i) : e.set(1, 0, 0, 0),
t.setXYZW(n, e.x, e.y, e.z, e.w))
}
},
},
{
key: 'updateMatrixWorld',
value: function (e) {
;(n(t, 'updateMatrixWorld', this, 3)([e]),
this.bindMode === el
? this.bindMatrixInverse.copy(this.matrixWorld).invert()
: 'detached' === this.bindMode
? this.bindMatrixInverse.copy(this.bindMatrix).invert()
: console.warn(
'THREE.SkinnedMesh: Unrecognized bindMode: ' + this.bindMode
))
},
},
{
key: 'applyBoneTransform',
value: function (e, t) {
var n = this.skeleton,
r = this.geometry
;(Hf.fromBufferAttribute(r.attributes.skinIndex, e),
Wf.fromBufferAttribute(r.attributes.skinWeight, e),
Vf.copy(t).applyMatrix4(this.bindMatrix),
t.set(0, 0, 0))
for (var i = 0; i < 4; i++) {
var a = Wf.getComponent(i)
if (0 !== a) {
var o = Hf.getComponent(i)
;(jf.multiplyMatrices(n.bones[o].matrixWorld, n.boneInverses[o]),
t.addScaledVector(Gf.copy(Vf).applyMatrix4(jf), a))
}
}
return t.applyMatrix4(this.bindMatrixInverse)
},
},
])
)
})(gf),
Zf = (function (e) {
function t() {
var e
return (A(this, t), ((e = y(this, t)).isBone = !0), (e.type = 'Bone'), e)
}
return (x(t, e), T(t))
})(gd),
Jf = (function (e) {
function t() {
var e,
n = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : null,
r = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : 1,
i = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : 1,
a = arguments.length > 3 ? arguments[3] : void 0,
o = arguments.length > 4 ? arguments[4] : void 0,
s = arguments.length > 5 ? arguments[5] : void 0,
u = arguments.length > 6 ? arguments[6] : void 0,
l = arguments.length > 7 ? arguments[7] : void 0,
c = arguments.length > 8 && void 0 !== arguments[8] ? arguments[8] : sl,
h = arguments.length > 9 && void 0 !== arguments[9] ? arguments[9] : sl,
d = arguments.length > 10 ? arguments[10] : void 0,
f = arguments.length > 11 ? arguments[11] : void 0
return (
A(this, t),
((e = y(this, t, [null, s, u, l, c, h, a, o, d, f])).isDataTexture = !0),
(e.image = { data: n, width: r, height: i }),
(e.generateMipmaps = !1),
(e.flipY = !1),
(e.unpackAlignment = 1),
e
)
}
return (x(t, e), T(t))
})(sh),
$f = new Gh(),
ep = new Gh(),
tp = (function () {
function e() {
var t = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : [],
n = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : []
;(A(this, e),
(this.uuid = Lc()),
(this.bones = t.slice(0)),
(this.boneInverses = n),
(this.boneMatrices = null),
(this.boneTexture = null),
this.init())
}
return T(e, [
{
key: 'init',
value: function () {
var e = this.bones,
t = this.boneInverses
if (((this.boneMatrices = new Float32Array(16 * e.length)), 0 === t.length))
this.calculateInverses()
else if (e.length !== t.length) {
;(console.warn(
'THREE.Skeleton: Number of inverse bone matrices does not match amount of bones.'
),
(this.boneInverses = []))
for (var n = 0, r = this.bones.length; n < r; n++)
this.boneInverses.push(new Gh())
}
},
},
{
key: 'calculateInverses',
value: function () {
this.boneInverses.length = 0
for (var e = 0, t = this.bones.length; e < t; e++) {
var n = new Gh()
;(this.bones[e] && n.copy(this.bones[e].matrixWorld).invert(),
this.boneInverses.push(n))
}
},
},
{
key: 'pose',
value: function () {
for (var e = 0, t = this.bones.length; e < t; e++) {
var n = this.bones[e]
n && n.matrixWorld.copy(this.boneInverses[e]).invert()
}
for (var r = 0, i = this.bones.length; r < i; r++) {
var a = this.bones[r]
a &&
(a.parent && a.parent.isBone
? (a.matrix.copy(a.parent.matrixWorld).invert(),
a.matrix.multiply(a.matrixWorld))
: a.matrix.copy(a.matrixWorld),
a.matrix.decompose(a.position, a.quaternion, a.scale))
}
},
},
{
key: 'update',
value: function () {
for (
var e = this.bones,
t = this.boneInverses,
n = this.boneMatrices,
r = this.boneTexture,
i = 0,
a = e.length;
i < a;
i++
) {
var o = e[i] ? e[i].matrixWorld : ep
;($f.multiplyMatrices(o, t[i]), $f.toArray(n, 16 * i))
}
null !== r && (r.needsUpdate = !0)
},
},
{
key: 'clone',
value: function () {
return new e(this.bones, this.boneInverses)
},
},
{
key: 'computeBoneTexture',
value: function () {
var e = Math.sqrt(4 * this.bones.length)
;((e = 4 * Math.ceil(e / 4)), (e = Math.max(e, 4)))
var t = new Float32Array(e * e * 4)
t.set(this.boneMatrices)
var n = new Jf(t, e, e, wl, yl)
return (
(n.needsUpdate = !0),
(this.boneMatrices = t),
(this.boneTexture = n),
this
)
},
},
{
key: 'getBoneByName',
value: function (e) {
for (var t = 0, n = this.bones.length; t < n; t++) {
var r = this.bones[t]
if (r.name === e) return r
}
},
},
{
key: 'dispose',
value: function () {
null !== this.boneTexture &&
(this.boneTexture.dispose(), (this.boneTexture = null))
},
},
{
key: 'fromJSON',
value: function (e, t) {
this.uuid = e.uuid
for (var n = 0, r = e.bones.length; n < r; n++) {
var i = e.bones[n],
a = t[i]
;(void 0 === a &&
(console.warn('THREE.Skeleton: No bone found with UUID:', i),
(a = new Zf())),
this.bones.push(a),
this.boneInverses.push(new Gh().fromArray(e.boneInverses[n])))
}
return (this.init(), this)
},
},
{
key: 'toJSON',
value: function () {
var e = {
metadata: { version: 4.6, type: 'Skeleton', generator: 'Skeleton.toJSON' },
bones: [],
boneInverses: [],
}
e.uuid = this.uuid
for (
var t = this.bones, n = this.boneInverses, r = 0, i = t.length;
r < i;
r++
) {
var a = t[r]
e.bones.push(a.uuid)
var o = n[r]
e.boneInverses.push(o.toArray())
}
return e
},
},
])
})(),
np = (function (e) {
function t(e, n, r) {
var i,
a = arguments.length > 3 && void 0 !== arguments[3] ? arguments[3] : 1
return (
A(this, t),
((i = y(this, t, [e, n, r])).isInstancedBufferAttribute = !0),
(i.meshPerAttribute = a),
i
)
}
return (
x(t, e),
T(t, [
{
key: 'copy',
value: function (e) {
return (
n(t, 'copy', this, 3)([e]),
(this.meshPerAttribute = e.meshPerAttribute),
this
)
},
},
{
key: 'toJSON',
value: function () {
var e = n(t, 'toJSON', this, 3)([])
return (
(e.meshPerAttribute = this.meshPerAttribute),
(e.isInstancedBufferAttribute = !0),
e
)
},
},
])
)
})(qd),
rp = new Gh(),
ip = new Gh(),
ap = [],
op = new gh(),
sp = new Gh(),
up = new gf(),
lp = new Dh(),
cp = (function (e) {
function t(e, n, r) {
var i
;(A(this, t),
((i = y(this, t, [e, n])).isInstancedMesh = !0),
(i.instanceMatrix = new np(new Float32Array(16 * r), 16)),
(i.instanceColor = null),
(i.morphTexture = null),
(i.count = r),
(i.boundingBox = null),
(i.boundingSphere = null))
for (var a = 0; a < r; a++) i.setMatrixAt(a, sp)
return i
}
return (
x(t, e),
T(t, [
{
key: 'computeBoundingBox',
value: function () {
var e = this.geometry,
t = this.count
;(null === this.boundingBox && (this.boundingBox = new gh()),
null === e.boundingBox && e.computeBoundingBox(),
this.boundingBox.makeEmpty())
for (var n = 0; n < t; n++)
(this.getMatrixAt(n, rp),
op.copy(e.boundingBox).applyMatrix4(rp),
this.boundingBox.union(op))
},
},
{
key: 'computeBoundingSphere',
value: function () {
var e = this.geometry,
t = this.count
;(null === this.boundingSphere && (this.boundingSphere = new Dh()),
null === e.boundingSphere && e.computeBoundingSphere(),
this.boundingSphere.makeEmpty())
for (var n = 0; n < t; n++)
(this.getMatrixAt(n, rp),
lp.copy(e.boundingSphere).applyMatrix4(rp),
this.boundingSphere.union(lp))
},
},
{
key: 'copy',
value: function (e, r) {
return (
n(t, 'copy', this, 3)([e, r]),
this.instanceMatrix.copy(e.instanceMatrix),
null !== e.morphTexture && (this.morphTexture = e.morphTexture.clone()),
null !== e.instanceColor && (this.instanceColor = e.instanceColor.clone()),
(this.count = e.count),
null !== e.boundingBox && (this.boundingBox = e.boundingBox.clone()),
null !== e.boundingSphere &&
(this.boundingSphere = e.boundingSphere.clone()),
this
)
},
},
{
key: 'getColorAt',
value: function (e, t) {
t.fromArray(this.instanceColor.array, 3 * e)
},
},
{
key: 'getMatrixAt',
value: function (e, t) {
t.fromArray(this.instanceMatrix.array, 16 * e)
},
},
{
key: 'getMorphAt',
value: function (e, t) {
for (
var n = t.morphTargetInfluences,
r = this.morphTexture.source.data.data,
i = e * (n.length + 1) + 1,
a = 0;
a < n.length;
a++
)
n[a] = r[i + a]
},
},
{
key: 'raycast',
value: function (e, t) {
var n = this.matrixWorld,
r = this.count
if (
((up.geometry = this.geometry),
(up.material = this.material),
void 0 !== up.material &&
(null === this.boundingSphere && this.computeBoundingSphere(),
lp.copy(this.boundingSphere),
lp.applyMatrix4(n),
!1 !== e.ray.intersectsSphere(lp)))
)
for (var i = 0; i < r; i++) {
;(this.getMatrixAt(i, rp),
ip.multiplyMatrices(n, rp),
(up.matrixWorld = ip),
up.raycast(e, ap))
for (var a = 0, o = ap.length; a < o; a++) {
var s = ap[a]
;((s.instanceId = i), (s.object = this), t.push(s))
}
ap.length = 0
}
},
},
{
key: 'setColorAt',
value: function (e, t) {
;(null === this.instanceColor &&
(this.instanceColor = new np(
new Float32Array(3 * this.instanceMatrix.count).fill(1),
3
)),
t.toArray(this.instanceColor.array, 3 * e))
},
},
{
key: 'setMatrixAt',
value: function (e, t) {
t.toArray(this.instanceMatrix.array, 16 * e)
},
},
{
key: 'setMorphAt',
value: function (e, t) {
var n = t.morphTargetInfluences,
r = n.length + 1
null === this.morphTexture &&
(this.morphTexture = new Jf(
new Float32Array(r * this.count),
r,
this.count,
El,
yl
))
for (
var i = this.morphTexture.source.data.data, a = 0, o = 0;
o < n.length;
o++
)
a += n[o]
var s = this.geometry.morphTargetsRelative ? 1 : 1 - a,
u = r * e
;((i[u] = s), i.set(n, u + 1))
},
},
{ key: 'updateMorphTargets', value: function () {} },
{
key: 'dispose',
value: function () {
return (
this.dispatchEvent({ type: 'dispose' }),
null !== this.morphTexture &&
(this.morphTexture.dispose(), (this.morphTexture = null)),
this
)
},
},
])
)
})(gf),
hp = new ph(),
dp = new ph(),
fp = new Hc(),
pp = (function () {
return T(
function e() {
var t =
arguments.length > 0 && void 0 !== arguments[0]
? arguments[0]
: new ph(1, 0, 0),
n = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : 0
;(A(this, e), (this.isPlane = !0), (this.normal = t), (this.constant = n))
},
[
{
key: 'set',
value: function (e, t) {
return (this.normal.copy(e), (this.constant = t), this)
},
},
{
key: 'setComponents',
value: function (e, t, n, r) {
return (this.normal.set(e, t, n), (this.constant = r), this)
},
},
{
key: 'setFromNormalAndCoplanarPoint',
value: function (e, t) {
return (this.normal.copy(e), (this.constant = -t.dot(this.normal)), this)
},
},
{
key: 'setFromCoplanarPoints',
value: function (e, t, n) {
var r = hp.subVectors(n, t).cross(dp.subVectors(e, t)).normalize()
return (this.setFromNormalAndCoplanarPoint(r, e), this)
},
},
{
key: 'copy',
value: function (e) {
return (this.normal.copy(e.normal), (this.constant = e.constant), this)
},
},
{
key: 'normalize',
value: function () {
var e = 1 / this.normal.length()
return (this.normal.multiplyScalar(e), (this.constant *= e), this)
},
},
{
key: 'negate',
value: function () {
return ((this.constant *= -1), this.normal.negate(), this)
},
},
{
key: 'distanceToPoint',
value: function (e) {
return this.normal.dot(e) + this.constant
},
},
{
key: 'distanceToSphere',
value: function (e) {
return this.distanceToPoint(e.center) - e.radius
},
},
{
key: 'projectPoint',
value: function (e, t) {
return t.copy(e).addScaledVector(this.normal, -this.distanceToPoint(e))
},
},
{
key: 'intersectLine',
value: function (e, t) {
var n = e.delta(hp),
r = this.normal.dot(n)
if (0 === r)
return 0 === this.distanceToPoint(e.start) ? t.copy(e.start) : null
var i = -(e.start.dot(this.normal) + this.constant) / r
return i < 0 || i > 1 ? null : t.copy(e.start).addScaledVector(n, i)
},
},
{
key: 'intersectsLine',
value: function (e) {
var t = this.distanceToPoint(e.start),
n = this.distanceToPoint(e.end)
return (t < 0 && n > 0) || (n < 0 && t > 0)
},
},
{
key: 'intersectsBox',
value: function (e) {
return e.intersectsPlane(this)
},
},
{
key: 'intersectsSphere',
value: function (e) {
return e.intersectsPlane(this)
},
},
{
key: 'coplanarPoint',
value: function (e) {
return e.copy(this.normal).multiplyScalar(-this.constant)
},
},
{
key: 'applyMatrix4',
value: function (e, t) {
var n = t || fp.getNormalMatrix(e),
r = this.coplanarPoint(hp).applyMatrix4(e),
i = this.normal.applyMatrix3(n).normalize()
return ((this.constant = -r.dot(i)), this)
},
},
{
key: 'translate',
value: function (e) {
return ((this.constant -= e.dot(this.normal)), this)
},
},
{
key: 'equals',
value: function (e) {
return e.normal.equals(this.normal) && e.constant === this.constant
},
},
{
key: 'clone',
value: function () {
return new this.constructor().copy(this)
},
},
]
)
})(),
vp = new Dh(),
mp = new ph(),
gp = (function () {
return T(
function e() {
var t = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : new pp(),
n = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : new pp(),
r = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : new pp(),
i = arguments.length > 3 && void 0 !== arguments[3] ? arguments[3] : new pp(),
a = arguments.length > 4 && void 0 !== arguments[4] ? arguments[4] : new pp(),
o = arguments.length > 5 && void 0 !== arguments[5] ? arguments[5] : new pp()
;(A(this, e), (this.planes = [t, n, r, i, a, o]))
},
[
{
key: 'set',
value: function (e, t, n, r, i, a) {
var o = this.planes
return (
o[0].copy(e),
o[1].copy(t),
o[2].copy(n),
o[3].copy(r),
o[4].copy(i),
o[5].copy(a),
this
)
},
},
{
key: 'copy',
value: function (e) {
for (var t = this.planes, n = 0; n < 6; n++) t[n].copy(e.planes[n])
return this
},
},
{
key: 'setFromProjectionMatrix',
value: function (e) {
var t = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : Ec,
n = this.planes,
r = e.elements,
i = r[0],
a = r[1],
o = r[2],
s = r[3],
u = r[4],
l = r[5],
c = r[6],
h = r[7],
d = r[8],
f = r[9],
p = r[10],
v = r[11],
m = r[12],
g = r[13],
y = r[14],
_ = r[15]
if (
(n[0].setComponents(s - i, h - u, v - d, _ - m).normalize(),
n[1].setComponents(s + i, h + u, v + d, _ + m).normalize(),
n[2].setComponents(s + a, h + l, v + f, _ + g).normalize(),
n[3].setComponents(s - a, h - l, v - f, _ - g).normalize(),
n[4].setComponents(s - o, h - c, v - p, _ - y).normalize(),
t === Ec)
)
n[5].setComponents(s + o, h + c, v + p, _ + y).normalize()
else {
if (t !== Cc)
throw new Error(
'THREE.Frustum.setFromProjectionMatrix(): Invalid coordinate system: ' +
t
)
n[5].setComponents(o, c, p, y).normalize()
}
return this
},
},
{
key: 'intersectsObject',
value: function (e) {
if (void 0 !== e.boundingSphere)
(null === e.boundingSphere && e.computeBoundingSphere(),
vp.copy(e.boundingSphere).applyMatrix4(e.matrixWorld))
else {
var t = e.geometry
;(null === t.boundingSphere && t.computeBoundingSphere(),
vp.copy(t.boundingSphere).applyMatrix4(e.matrixWorld))
}
return this.intersectsSphere(vp)
},
},
{
key: 'intersectsSprite',
value: function (e) {
return (
vp.center.set(0, 0, 0),
(vp.radius = 0.7071067811865476),
vp.applyMatrix4(e.matrixWorld),
this.intersectsSphere(vp)
)
},
},
{
key: 'intersectsSphere',
value: function (e) {
for (var t = this.planes, n = e.center, r = -e.radius, i = 0; i < 6; i++) {
if (t[i].distanceToPoint(n) < r) return !1
}
return !0
},
},
{
key: 'intersectsBox',
value: function (e) {
for (var t = this.planes, n = 0; n < 6; n++) {
var r = t[n]
if (
((mp.x = r.normal.x > 0 ? e.max.x : e.min.x),
(mp.y = r.normal.y > 0 ? e.max.y : e.min.y),
(mp.z = r.normal.z > 0 ? e.max.z : e.min.z),
r.distanceToPoint(mp) < 0)
)
return !1
}
return !0
},
},
{
key: 'containsPoint',
value: function (e) {
for (var t = this.planes, n = 0; n < 6; n++)
if (t[n].distanceToPoint(e) < 0) return !1
return !0
},
},
{
key: 'clone',
value: function () {
return new this.constructor().copy(this)
},
},
]
)
})(),
yp = (function (e) {
function t(e) {
var n
return (
A(this, t),
((n = y(this, t)).isLineBasicMaterial = !0),
(n.type = 'LineBasicMaterial'),
(n.color = new Od(16777215)),
(n.map = null),
(n.linewidth = 1),
(n.linecap = 'round'),
(n.linejoin = 'round'),
(n.fog = !0),
n.setValues(e),
n
)
}
return (
x(t, e),
T(t, [
{
key: 'copy',
value: function (e) {
return (
n(t, 'copy', this, 3)([e]),
this.color.copy(e.color),
(this.map = e.map),
(this.linewidth = e.linewidth),
(this.linecap = e.linecap),
(this.linejoin = e.linejoin),
(this.fog = e.fog),
this
)
},
},
])
)
})(Ud),
_p = new ph(),
bp = new ph(),
xp = new Gh(),
Sp = new Wh(),
Ap = new Dh(),
wp = new ph(),
Tp = new ph(),
Mp = (function (e) {
function t() {
var e,
n = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : new af(),
r = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : new yp()
return (
A(this, t),
((e = y(this, t)).isLine = !0),
(e.type = 'Line'),
(e.geometry = n),
(e.material = r),
e.updateMorphTargets(),
e
)
}
return (
x(t, e),
T(t, [
{
key: 'copy',
value: function (e, r) {
return (
n(t, 'copy', this, 3)([e, r]),
(this.material = Array.isArray(e.material)
? e.material.slice()
: e.material),
(this.geometry = e.geometry),
this
)
},
},
{
key: 'computeLineDistances',
value: function () {
var e = this.geometry
if (null === e.index) {
for (var t = e.attributes.position, n = [0], r = 1, i = t.count; r < i; r++)
(_p.fromBufferAttribute(t, r - 1),
bp.fromBufferAttribute(t, r),
(n[r] = n[r - 1]),
(n[r] += _p.distanceTo(bp)))
e.setAttribute('lineDistance', new Kd(n, 1))
} else
console.warn(
'THREE.Line.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.'
)
return this
},
},
{
key: 'raycast',
value: function (e, t) {
var n = this.geometry,
r = this.matrixWorld,
i = e.params.Line.threshold,
a = n.drawRange
if (
(null === n.boundingSphere && n.computeBoundingSphere(),
Ap.copy(n.boundingSphere),
Ap.applyMatrix4(r),
(Ap.radius += i),
!1 !== e.ray.intersectsSphere(Ap))
) {
;(xp.copy(r).invert(), Sp.copy(e.ray).applyMatrix4(xp))
var o = i / ((this.scale.x + this.scale.y + this.scale.z) / 3),
s = o * o,
u = this.isLineSegments ? 2 : 1,
l = n.index,
c = n.attributes.position
if (null !== l) {
for (
var h = Math.max(0, a.start),
d = Math.min(l.count, a.start + a.count),
f = h,
p = d - 1;
f < p;
f += u
) {
var v = l.getX(f),
m = l.getX(f + 1),
g = Ep(this, e, Sp, s, v, m, f)
g && t.push(g)
}
if (this.isLineLoop) {
var y = l.getX(d - 1),
_ = l.getX(h),
b = Ep(this, e, Sp, s, y, _, d - 1)
b && t.push(b)
}
} else {
for (
var x = Math.max(0, a.start),
S = Math.min(c.count, a.start + a.count),
A = x,
w = S - 1;
A < w;
A += u
) {
var T = Ep(this, e, Sp, s, A, A + 1, A)
T && t.push(T)
}
if (this.isLineLoop) {
var M = Ep(this, e, Sp, s, S - 1, x, S - 1)
M && t.push(M)
}
}
}
},
},
{
key: 'updateMorphTargets',
value: function () {
var e = this.geometry.morphAttributes,
t = Object.keys(e)
if (t.length > 0) {
var n = e[t[0]]
if (void 0 !== n) {
;((this.morphTargetInfluences = []), (this.morphTargetDictionary = {}))
for (var r = 0, i = n.length; r < i; r++) {
var a = n[r].name || String(r)
;(this.morphTargetInfluences.push(0),
(this.morphTargetDictionary[a] = r))
}
}
}
},
},
])
)
})(gd)
function Ep(e, t, n, r, i, a, o) {
var s = e.geometry.attributes.position
if (
(_p.fromBufferAttribute(s, i),
bp.fromBufferAttribute(s, a),
!(n.distanceSqToSegment(_p, bp, wp, Tp) > r))
) {
wp.applyMatrix4(e.matrixWorld)
var u = t.ray.origin.distanceTo(wp)
if (!(u < t.near || u > t.far))
return {
distance: u,
point: Tp.clone().applyMatrix4(e.matrixWorld),
index: o,
face: null,
faceIndex: null,
barycoord: null,
object: e,
}
}
}
var Cp = new ph(),
kp = new ph(),
Rp = (function (e) {
function t(e, n) {
var r
return (
A(this, t),
((r = y(this, t, [e, n])).isLineSegments = !0),
(r.type = 'LineSegments'),
r
)
}
return (
x(t, e),
T(t, [
{
key: 'computeLineDistances',
value: function () {
var e = this.geometry
if (null === e.index) {
for (
var t = e.attributes.position, n = [], r = 0, i = t.count;
r < i;
r += 2
)
(Cp.fromBufferAttribute(t, r),
kp.fromBufferAttribute(t, r + 1),
(n[r] = 0 === r ? 0 : n[r - 1]),
(n[r + 1] = n[r] + Cp.distanceTo(kp)))
e.setAttribute('lineDistance', new Kd(n, 1))
} else
console.warn(
'THREE.LineSegments.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.'
)
return this
},
},
])
)
})(Mp),
Ip = (function (e) {
function t(e, n) {
var r
return (
A(this, t),
((r = y(this, t, [e, n])).isLineLoop = !0),
(r.type = 'LineLoop'),
r
)
}
return (x(t, e), T(t))
})(Mp),
Np = (function (e) {
function t(e) {
var n
return (
A(this, t),
((n = y(this, t)).isPointsMaterial = !0),
(n.type = 'PointsMaterial'),
(n.color = new Od(16777215)),
(n.map = null),
(n.alphaMap = null),
(n.size = 1),
(n.sizeAttenuation = !0),
(n.fog = !0),
n.setValues(e),
n
)
}
return (
x(t, e),
T(t, [
{
key: 'copy',
value: function (e) {
return (
n(t, 'copy', this, 3)([e]),
this.color.copy(e.color),
(this.map = e.map),
(this.alphaMap = e.alphaMap),
(this.size = e.size),
(this.sizeAttenuation = e.sizeAttenuation),
(this.fog = e.fog),
this
)
},
},
])
)
})(Ud),
Pp = new Gh(),
Lp = new Wh(),
Dp = new Dh(),
Op = new ph(),
Fp = (function (e) {
function t() {
var e,
n = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : new af(),
r = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : new Np()
return (
A(this, t),
((e = y(this, t)).isPoints = !0),
(e.type = 'Points'),
(e.geometry = n),
(e.material = r),
e.updateMorphTargets(),
e
)
}
return (
x(t, e),
T(t, [
{
key: 'copy',
value: function (e, r) {
return (
n(t, 'copy', this, 3)([e, r]),
(this.material = Array.isArray(e.material)
? e.material.slice()
: e.material),
(this.geometry = e.geometry),
this
)
},
},
{
key: 'raycast',
value: function (e, t) {
var n = this.geometry,
r = this.matrixWorld,
i = e.params.Points.threshold,
a = n.drawRange
if (
(null === n.boundingSphere && n.computeBoundingSphere(),
Dp.copy(n.boundingSphere),
Dp.applyMatrix4(r),
(Dp.radius += i),
!1 !== e.ray.intersectsSphere(Dp))
) {
;(Pp.copy(r).invert(), Lp.copy(e.ray).applyMatrix4(Pp))
var o = i / ((this.scale.x + this.scale.y + this.scale.z) / 3),
s = o * o,
u = n.index,
l = n.attributes.position
if (null !== u)
for (
var c = Math.max(0, a.start), h = Math.min(u.count, a.start + a.count);
c < h;
c++
) {
var d = u.getX(c)
;(Op.fromBufferAttribute(l, d), Bp(Op, d, s, r, e, t, this))
}
else
for (
var f = Math.max(0, a.start), p = Math.min(l.count, a.start + a.count);
f < p;
f++
)
(Op.fromBufferAttribute(l, f), Bp(Op, f, s, r, e, t, this))
}
},
},
{
key: 'updateMorphTargets',
value: function () {
var e = this.geometry.morphAttributes,
t = Object.keys(e)
if (t.length > 0) {
var n = e[t[0]]
if (void 0 !== n) {
;((this.morphTargetInfluences = []), (this.morphTargetDictionary = {}))
for (var r = 0, i = n.length; r < i; r++) {
var a = n[r].name || String(r)
;(this.morphTargetInfluences.push(0),
(this.morphTargetDictionary[a] = r))
}
}
}
},
},
])
)
})(gd)
function Bp(e, t, n, r, i, a, o) {
var s = Lp.distanceSqToPoint(e)
if (s < n) {
var u = new ph()
;(Lp.closestPointToPoint(e, u), u.applyMatrix4(r))
var l = i.ray.origin.distanceTo(u)
if (l < i.near || l > i.far) return
a.push({
distance: l,
distanceToRay: Math.sqrt(s),
point: u,
index: t,
face: null,
faceIndex: null,
barycoord: null,
object: o,
})
}
}
var Up = (function (e) {
function t(e, n) {
var r
return (
A(this, t),
((r = y(this, t, [{ width: e, height: n }])).isFramebufferTexture = !0),
(r.magFilter = sl),
(r.minFilter = sl),
(r.generateMipmaps = !1),
(r.needsUpdate = !0),
r
)
}
return (x(t, e), T(t))
})(sh),
zp = (function (e) {
function t(e, n, r, i, a, o, s, u, l) {
var c,
h = arguments.length > 9 && void 0 !== arguments[9] ? arguments[9] : Tl
if ((A(this, t), h !== Tl && h !== Ml))
throw new Error(
'DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat'
)
return (
void 0 === r && h === Tl && (r = gl),
void 0 === r && h === Ml && (r = Sl),
((c = y(this, t, [null, i, a, o, s, u, h, r, l])).isDepthTexture = !0),
(c.image = { width: e, height: n }),
(c.magFilter = void 0 !== s ? s : sl),
(c.minFilter = void 0 !== u ? u : sl),
(c.flipY = !1),
(c.generateMipmaps = !1),
(c.compareFunction = null),
c
)
}
return (
x(t, e),
T(t, [
{
key: 'copy',
value: function (e) {
return (
n(t, 'copy', this, 3)([e]),
(this.compareFunction = e.compareFunction),
this
)
},
},
{
key: 'toJSON',
value: function (e) {
var r = n(t, 'toJSON', this, 3)([e])
return (
null !== this.compareFunction && (r.compareFunction = this.compareFunction),
r
)
},
},
])
)
})(sh),
Vp = (function (e) {
function t() {
var e,
n = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : 1,
r = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : 1,
i = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : 1,
a = arguments.length > 3 && void 0 !== arguments[3] ? arguments[3] : 32,
o = arguments.length > 4 && void 0 !== arguments[4] ? arguments[4] : 1,
s = arguments.length > 5 && void 0 !== arguments[5] && arguments[5],
u = arguments.length > 6 && void 0 !== arguments[6] ? arguments[6] : 0,
l = arguments.length > 7 && void 0 !== arguments[7] ? arguments[7] : 2 * Math.PI
;(A(this, t),
((e = y(this, t)).type = 'CylinderGeometry'),
(e.parameters = {
radiusTop: n,
radiusBottom: r,
height: i,
radialSegments: a,
heightSegments: o,
openEnded: s,
thetaStart: u,
thetaLength: l,
}))
var c = e
;((a = Math.floor(a)), (o = Math.floor(o)))
var h = [],
d = [],
f = [],
p = [],
v = 0,
m = [],
g = i / 2,
_ = 0
function b(e) {
for (
var t = v,
i = new Vc(),
o = new ph(),
s = 0,
m = !0 === e ? n : r,
y = !0 === e ? 1 : -1,
b = 1;
b <= a;
b++
)
(d.push(0, g * y, 0), f.push(0, y, 0), p.push(0.5, 0.5), v++)
for (var x = v, S = 0; S <= a; S++) {
var A = (S / a) * l + u,
w = Math.cos(A),
T = Math.sin(A)
;((o.x = m * T),
(o.y = g * y),
(o.z = m * w),
d.push(o.x, o.y, o.z),
f.push(0, y, 0),
(i.x = 0.5 * w + 0.5),
(i.y = 0.5 * T * y + 0.5),
p.push(i.x, i.y),
v++)
}
for (var M = 0; M < a; M++) {
var E = t + M,
C = x + M
;(!0 === e ? h.push(C, C + 1, E) : h.push(C + 1, C, E), (s += 3))
}
;(c.addGroup(_, s, !0 === e ? 1 : 2), (_ += s))
}
return (
(function () {
for (
var e = new ph(), t = new ph(), s = 0, y = (r - n) / i, b = 0;
b <= o;
b++
) {
for (var x = [], S = b / o, A = S * (r - n) + n, w = 0; w <= a; w++) {
var T = w / a,
M = T * l + u,
E = Math.sin(M),
C = Math.cos(M)
;((t.x = A * E),
(t.y = -S * i + g),
(t.z = A * C),
d.push(t.x, t.y, t.z),
e.set(E, y, C).normalize(),
f.push(e.x, e.y, e.z),
p.push(T, 1 - S),
x.push(v++))
}
m.push(x)
}
for (var k = 0; k < a; k++)
for (var R = 0; R < o; R++) {
var I = m[R][k],
N = m[R + 1][k],
P = m[R + 1][k + 1],
L = m[R][k + 1]
;((n > 0 || 0 !== R) && (h.push(I, N, L), (s += 3)),
(r > 0 || R !== o - 1) && (h.push(N, P, L), (s += 3)))
}
;(c.addGroup(_, s, 0), (_ += s))
})(),
!1 === s && (n > 0 && b(!0), r > 0 && b(!1)),
e.setIndex(h),
e.setAttribute('position', new Kd(d, 3)),
e.setAttribute('normal', new Kd(f, 3)),
e.setAttribute('uv', new Kd(p, 2)),
e
)
}
return (
x(t, e),
T(
t,
[
{
key: 'copy',
value: function (e) {
return (
n(t, 'copy', this, 3)([e]),
(this.parameters = Object.assign({}, e.parameters)),
this
)
},
},
],
[
{
key: 'fromJSON',
value: function (e) {
return new t(
e.radiusTop,
e.radiusBottom,
e.height,
e.radialSegments,
e.heightSegments,
e.openEnded,
e.thetaStart,
e.thetaLength
)
},
},
]
)
)
})(af),
Hp = (function (e) {
function t() {
var e,
n = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : 1,
r = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : 1,
i = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : 32,
a = arguments.length > 3 && void 0 !== arguments[3] ? arguments[3] : 1,
o = arguments.length > 4 && void 0 !== arguments[4] && arguments[4],
s = arguments.length > 5 && void 0 !== arguments[5] ? arguments[5] : 0,
u = arguments.length > 6 && void 0 !== arguments[6] ? arguments[6] : 2 * Math.PI
return (
A(this, t),
((e = y(this, t, [0, n, r, i, a, o, s, u])).type = 'ConeGeometry'),
(e.parameters = {
radius: n,
height: r,
radialSegments: i,
heightSegments: a,
openEnded: o,
thetaStart: s,
thetaLength: u,
}),
e
)
}
return (
x(t, e),
T(t, null, [
{
key: 'fromJSON',
value: function (e) {
return new t(
e.radius,
e.height,
e.radialSegments,
e.heightSegments,
e.openEnded,
e.thetaStart,
e.thetaLength
)
},
},
])
)
})(Vp),
Wp = (function (e) {
function t() {
var e,
n = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : 1,
r = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : 1,
i = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : 1,
a = arguments.length > 3 && void 0 !== arguments[3] ? arguments[3] : 1
;(A(this, t),
((e = y(this, t)).type = 'PlaneGeometry'),
(e.parameters = { width: n, height: r, widthSegments: i, heightSegments: a }))
for (
var o = n / 2,
s = r / 2,
u = Math.floor(i),
l = Math.floor(a),
c = u + 1,
h = l + 1,
d = n / u,
f = r / l,
p = [],
v = [],
m = [],
g = [],
_ = 0;
_ < h;
_++
)
for (var b = _ * f - s, x = 0; x < c; x++) {
var S = x * d - o
;(v.push(S, -b, 0), m.push(0, 0, 1), g.push(x / u), g.push(1 - _ / l))
}
for (var w = 0; w < l; w++)
for (var T = 0; T < u; T++) {
var M = T + c * w,
E = T + c * (w + 1),
C = T + 1 + c * (w + 1),
k = T + 1 + c * w
;(p.push(M, E, k), p.push(E, C, k))
}
return (
e.setIndex(p),
e.setAttribute('position', new Kd(v, 3)),
e.setAttribute('normal', new Kd(m, 3)),
e.setAttribute('uv', new Kd(g, 2)),
e
)
}
return (
x(t, e),
T(
t,
[
{
key: 'copy',
value: function (e) {
return (
n(t, 'copy', this, 3)([e]),
(this.parameters = Object.assign({}, e.parameters)),
this
)
},
},
],
[
{
key: 'fromJSON',
value: function (e) {
return new t(e.width, e.height, e.widthSegments, e.heightSegments)
},
},
]
)
)
})(af),
Gp = (function (e) {
function t() {
var e,
n = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : 1,
r = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : 32,
i = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : 16,
a = arguments.length > 3 && void 0 !== arguments[3] ? arguments[3] : 0,
o = arguments.length > 4 && void 0 !== arguments[4] ? arguments[4] : 2 * Math.PI,
s = arguments.length > 5 && void 0 !== arguments[5] ? arguments[5] : 0,
u = arguments.length > 6 && void 0 !== arguments[6] ? arguments[6] : Math.PI
;(A(this, t),
((e = y(this, t)).type = 'SphereGeometry'),
(e.parameters = {
radius: n,
widthSegments: r,
heightSegments: i,
phiStart: a,
phiLength: o,
thetaStart: s,
thetaLength: u,
}),
(r = Math.max(3, Math.floor(r))),
(i = Math.max(2, Math.floor(i))))
for (
var l = Math.min(s + u, Math.PI),
c = 0,
h = [],
d = new ph(),
f = new ph(),
p = [],
v = [],
m = [],
g = [],
_ = 0;
_ <= i;
_++
) {
var b = [],
x = _ / i,
S = 0
0 === _ && 0 === s ? (S = 0.5 / r) : _ === i && l === Math.PI && (S = -0.5 / r)
for (var w = 0; w <= r; w++) {
var T = w / r
;((d.x = -n * Math.cos(a + T * o) * Math.sin(s + x * u)),
(d.y = n * Math.cos(s + x * u)),
(d.z = n * Math.sin(a + T * o) * Math.sin(s + x * u)),
v.push(d.x, d.y, d.z),
f.copy(d).normalize(),
m.push(f.x, f.y, f.z),
g.push(T + S, 1 - x),
b.push(c++))
}
h.push(b)
}
for (var M = 0; M < i; M++)
for (var E = 0; E < r; E++) {
var C = h[M][E + 1],
k = h[M][E],
R = h[M + 1][E],
I = h[M + 1][E + 1]
;((0 !== M || s > 0) && p.push(C, k, I),
(M !== i - 1 || l < Math.PI) && p.push(k, R, I))
}
return (
e.setIndex(p),
e.setAttribute('position', new Kd(v, 3)),
e.setAttribute('normal', new Kd(m, 3)),
e.setAttribute('uv', new Kd(g, 2)),
e
)
}
return (
x(t, e),
T(
t,
[
{
key: 'copy',
value: function (e) {
return (
n(t, 'copy', this, 3)([e]),
(this.parameters = Object.assign({}, e.parameters)),
this
)
},
},
],
[
{
key: 'fromJSON',
value: function (e) {
return new t(
e.radius,
e.widthSegments,
e.heightSegments,
e.phiStart,
e.phiLength,
e.thetaStart,
e.thetaLength
)
},
},
]
)
)
})(af),
jp = (function (e) {
function t(e) {
var n
return (
A(this, t),
((n = y(this, t)).isMeshStandardMaterial = !0),
(n.type = 'MeshStandardMaterial'),
(n.defines = { STANDARD: '' }),
(n.color = new Od(16777215)),
(n.roughness = 1),
(n.metalness = 0),
(n.map = null),
(n.lightMap = null),
(n.lightMapIntensity = 1),
(n.aoMap = null),
(n.aoMapIntensity = 1),
(n.emissive = new Od(0)),
(n.emissiveIntensity = 1),
(n.emissiveMap = null),
(n.bumpMap = null),
(n.bumpScale = 1),
(n.normalMap = null),
(n.normalMapType = 0),
(n.normalScale = new Vc(1, 1)),
(n.displacementMap = null),
(n.displacementScale = 1),
(n.displacementBias = 0),
(n.roughnessMap = null),
(n.metalnessMap = null),
(n.alphaMap = null),
(n.envMap = null),
(n.envMapRotation = new ed()),
(n.envMapIntensity = 1),
(n.wireframe = !1),
(n.wireframeLinewidth = 1),
(n.wireframeLinecap = 'round'),
(n.wireframeLinejoin = 'round'),
(n.flatShading = !1),
(n.fog = !0),
n.setValues(e),
n
)
}
return (
x(t, e),
T(t, [
{
key: 'copy',
value: function (e) {
return (
n(t, 'copy', this, 3)([e]),
(this.defines = { STANDARD: '' }),
this.color.copy(e.color),
(this.roughness = e.roughness),
(this.metalness = e.metalness),
(this.map = e.map),
(this.lightMap = e.lightMap),
(this.lightMapIntensity = e.lightMapIntensity),
(this.aoMap = e.aoMap),
(this.aoMapIntensity = e.aoMapIntensity),
this.emissive.copy(e.emissive),
(this.emissiveMap = e.emissiveMap),
(this.emissiveIntensity = e.emissiveIntensity),
(this.bumpMap = e.bumpMap),
(this.bumpScale = e.bumpScale),
(this.normalMap = e.normalMap),
(this.normalMapType = e.normalMapType),
this.normalScale.copy(e.normalScale),
(this.displacementMap = e.displacementMap),
(this.displacementScale = e.displacementScale),
(this.displacementBias = e.displacementBias),
(this.roughnessMap = e.roughnessMap),
(this.metalnessMap = e.metalnessMap),
(this.alphaMap = e.alphaMap),
(this.envMap = e.envMap),
this.envMapRotation.copy(e.envMapRotation),
(this.envMapIntensity = e.envMapIntensity),
(this.wireframe = e.wireframe),
(this.wireframeLinewidth = e.wireframeLinewidth),
(this.wireframeLinecap = e.wireframeLinecap),
(this.wireframeLinejoin = e.wireframeLinejoin),
(this.flatShading = e.flatShading),
(this.fog = e.fog),
this
)
},
},
])
)
})(Ud),
Qp = (function (e) {
function t(e) {
var n
return (
A(this, t),
((n = y(this, t)).isMeshPhysicalMaterial = !0),
(n.defines = { STANDARD: '', PHYSICAL: '' }),
(n.type = 'MeshPhysicalMaterial'),
(n.anisotropyRotation = 0),
(n.anisotropyMap = null),
(n.clearcoatMap = null),
(n.clearcoatRoughness = 0),
(n.clearcoatRoughnessMap = null),
(n.clearcoatNormalScale = new Vc(1, 1)),
(n.clearcoatNormalMap = null),
(n.ior = 1.5),
Object.defineProperty(n, 'reflectivity', {
get: function () {
return Dc((2.5 * (this.ior - 1)) / (this.ior + 1), 0, 1)
},
set: function (e) {
this.ior = (1 + 0.4 * e) / (1 - 0.4 * e)
},
}),
(n.iridescenceMap = null),
(n.iridescenceIOR = 1.3),
(n.iridescenceThicknessRange = [100, 400]),
(n.iridescenceThicknessMap = null),
(n.sheenColor = new Od(0)),
(n.sheenColorMap = null),
(n.sheenRoughness = 1),
(n.sheenRoughnessMap = null),
(n.transmissionMap = null),
(n.thickness = 0),
(n.thicknessMap = null),
(n.attenuationDistance = 1 / 0),
(n.attenuationColor = new Od(1, 1, 1)),
(n.specularIntensity = 1),
(n.specularIntensityMap = null),
(n.specularColor = new Od(1, 1, 1)),
(n.specularColorMap = null),
(n._anisotropy = 0),
(n._clearcoat = 0),
(n._dispersion = 0),
(n._iridescence = 0),
(n._sheen = 0),
(n._transmission = 0),
n.setValues(e),
n
)
}
return (
x(t, e),
T(t, [
{
key: 'anisotropy',
get: function () {
return this._anisotropy
},
set: function (e) {
;(this._anisotropy > 0 != e > 0 && this.version++, (this._anisotropy = e))
},
},
{
key: 'clearcoat',
get: function () {
return this._clearcoat
},
set: function (e) {
;(this._clearcoat > 0 != e > 0 && this.version++, (this._clearcoat = e))
},
},
{
key: 'iridescence',
get: function () {
return this._iridescence
},
set: function (e) {
;(this._iridescence > 0 != e > 0 && this.version++, (this._iridescence = e))
},
},
{
key: 'dispersion',
get: function () {
return this._dispersion
},
set: function (e) {
;(this._dispersion > 0 != e > 0 && this.version++, (this._dispersion = e))
},
},
{
key: 'sheen',
get: function () {
return this._sheen
},
set: function (e) {
;(this._sheen > 0 != e > 0 && this.version++, (this._sheen = e))
},
},
{
key: 'transmission',
get: function () {
return this._transmission
},
set: function (e) {
;(this._transmission > 0 != e > 0 && this.version++, (this._transmission = e))
},
},
{
key: 'copy',
value: function (e) {
return (
n(t, 'copy', this, 3)([e]),
(this.defines = { STANDARD: '', PHYSICAL: '' }),
(this.anisotropy = e.anisotropy),
(this.anisotropyRotation = e.anisotropyRotation),
(this.anisotropyMap = e.anisotropyMap),
(this.clearcoat = e.clearcoat),
(this.clearcoatMap = e.clearcoatMap),
(this.clearcoatRoughness = e.clearcoatRoughness),
(this.clearcoatRoughnessMap = e.clearcoatRoughnessMap),
(this.clearcoatNormalMap = e.clearcoatNormalMap),
this.clearcoatNormalScale.copy(e.clearcoatNormalScale),
(this.dispersion = e.dispersion),
(this.ior = e.ior),
(this.iridescence = e.iridescence),
(this.iridescenceMap = e.iridescenceMap),
(this.iridescenceIOR = e.iridescenceIOR),
(this.iridescenceThicknessRange = I(e.iridescenceThicknessRange)),
(this.iridescenceThicknessMap = e.iridescenceThicknessMap),
(this.sheen = e.sheen),
this.sheenColor.copy(e.sheenColor),
(this.sheenColorMap = e.sheenColorMap),
(this.sheenRoughness = e.sheenRoughness),
(this.sheenRoughnessMap = e.sheenRoughnessMap),
(this.transmission = e.transmission),
(this.transmissionMap = e.transmissionMap),
(this.thickness = e.thickness),
(this.thicknessMap = e.thicknessMap),
(this.attenuationDistance = e.attenuationDistance),
this.attenuationColor.copy(e.attenuationColor),
(this.specularIntensity = e.specularIntensity),
(this.specularIntensityMap = e.specularIntensityMap),
this.specularColor.copy(e.specularColor),
(this.specularColorMap = e.specularColorMap),
this
)
},
},
])
)
})(jp),
qp = (function (e) {
function t(e) {
var n
return (
A(this, t),
((n = y(this, t)).isMeshDepthMaterial = !0),
(n.type = 'MeshDepthMaterial'),
(n.depthPacking = 3200),
(n.map = null),
(n.alphaMap = null),
(n.displacementMap = null),
(n.displacementScale = 1),
(n.displacementBias = 0),
(n.wireframe = !1),
(n.wireframeLinewidth = 1),
n.setValues(e),
n
)
}
return (
x(t, e),
T(t, [
{
key: 'copy',
value: function (e) {
return (
n(t, 'copy', this, 3)([e]),
(this.depthPacking = e.depthPacking),
(this.map = e.map),
(this.alphaMap = e.alphaMap),
(this.displacementMap = e.displacementMap),
(this.displacementScale = e.displacementScale),
(this.displacementBias = e.displacementBias),
(this.wireframe = e.wireframe),
(this.wireframeLinewidth = e.wireframeLinewidth),
this
)
},
},
])
)
})(Ud),
Xp = (function (e) {
function t(e) {
var n
return (
A(this, t),
((n = y(this, t)).isMeshDistanceMaterial = !0),
(n.type = 'MeshDistanceMaterial'),
(n.map = null),
(n.alphaMap = null),
(n.displacementMap = null),
(n.displacementScale = 1),
(n.displacementBias = 0),
n.setValues(e),
n
)
}
return (
x(t, e),
T(t, [
{
key: 'copy',
value: function (e) {
return (
n(t, 'copy', this, 3)([e]),
(this.map = e.map),
(this.alphaMap = e.alphaMap),
(this.displacementMap = e.displacementMap),
(this.displacementScale = e.displacementScale),
(this.displacementBias = e.displacementBias),
this
)
},
},
])
)
})(Ud)
function Yp(e, t, n) {
return !e || (!n && e.constructor === t)
? e
: 'number' == typeof t.BYTES_PER_ELEMENT
? new t(e)
: Array.prototype.slice.call(e)
}
function Kp(e) {
for (var t = e.length, n = new Array(t), r = 0; r !== t; ++r) n[r] = r
return (
n.sort(function (t, n) {
return e[t] - e[n]
}),
n
)
}
function Zp(e, t, n) {
for (var r = e.length, i = new e.constructor(r), a = 0, o = 0; o !== r; ++a)
for (var s = n[a] * t, u = 0; u !== t; ++u) i[o++] = e[s + u]
return i
}
function Jp(e, t, n, r) {
for (var i = 1, a = e[0]; void 0 !== a && void 0 === a[r]; ) a = e[i++]
if (void 0 !== a) {
var o = a[r]
if (void 0 !== o)
if (Array.isArray(o))
do {
;(void 0 !== (o = a[r]) && (t.push(a.time), n.push.apply(n, o)), (a = e[i++]))
} while (void 0 !== a)
else if (void 0 !== o.toArray)
do {
;(void 0 !== (o = a[r]) && (t.push(a.time), o.toArray(n, n.length)),
(a = e[i++]))
} while (void 0 !== a)
else
do {
;(void 0 !== (o = a[r]) && (t.push(a.time), n.push(o)), (a = e[i++]))
} while (void 0 !== a)
}
}
var $p = (function () {
return T(
function e(t, n, r, i) {
;(A(this, e),
(this.parameterPositions = t),
(this._cachedIndex = 0),
(this.resultBuffer = void 0 !== i ? i : new n.constructor(r)),
(this.sampleValues = n),
(this.valueSize = r),
(this.settings = null),
(this.DefaultSettings_ = {}))
},
[
{
key: 'evaluate',
value: function (e) {
var t = this.parameterPositions,
n = this._cachedIndex,
r = t[n],
i = t[n - 1]
e: {
t: {
var a
n: {
r: if (!(e < r)) {
for (var o = n + 2; ; ) {
if (void 0 === r) {
if (e < i) break r
return (
(n = t.length),
(this._cachedIndex = n),
this.copySampleValue_(n - 1)
)
}
if (n === o) break
if (((i = r), e < (r = t[++n]))) break t
}
a = t.length
break n
}
if (e >= i) break e
var s = t[1]
e < s && ((n = 2), (i = s))
for (var u = n - 2; ; ) {
if (void 0 === i)
return ((this._cachedIndex = 0), this.copySampleValue_(0))
if (n === u) break
if (((r = i), e >= (i = t[--n - 1]))) break t
}
;((a = n), (n = 0))
}
for (; n < a; ) {
var l = (n + a) >>> 1
e < t[l] ? (a = l) : (n = l + 1)
}
if (((r = t[n]), void 0 === (i = t[n - 1])))
return ((this._cachedIndex = 0), this.copySampleValue_(0))
if (void 0 === r)
return (
(n = t.length),
(this._cachedIndex = n),
this.copySampleValue_(n - 1)
)
}
;((this._cachedIndex = n), this.intervalChanged_(n, i, r))
}
return this.interpolate_(n, i, e, r)
},
},
{
key: 'getSettings_',
value: function () {
return this.settings || this.DefaultSettings_
},
},
{
key: 'copySampleValue_',
value: function (e) {
for (
var t = this.resultBuffer,
n = this.sampleValues,
r = this.valueSize,
i = e * r,
a = 0;
a !== r;
++a
)
t[a] = n[i + a]
return t
},
},
{
key: 'interpolate_',
value: function () {
throw new Error('call to abstract method')
},
},
{ key: 'intervalChanged_', value: function () {} },
]
)
})(),
ev = (function (e) {
function t(e, n, r, i) {
var a
return (
A(this, t),
((a = y(this, t, [e, n, r, i]))._weightPrev = -0),
(a._offsetPrev = -0),
(a._weightNext = -0),
(a._offsetNext = -0),
(a.DefaultSettings_ = { endingStart: pc, endingEnd: pc }),
a
)
}
return (
x(t, e),
T(t, [
{
key: 'intervalChanged_',
value: function (e, t, n) {
var r = this.parameterPositions,
i = e - 2,
a = e + 1,
o = r[i],
s = r[a]
if (void 0 === o)
switch (this.getSettings_().endingStart) {
case vc:
;((i = e), (o = 2 * t - n))
break
case mc:
o = t + r[(i = r.length - 2)] - r[i + 1]
break
default:
;((i = e), (o = n))
}
if (void 0 === s)
switch (this.getSettings_().endingEnd) {
case vc:
;((a = e), (s = 2 * n - t))
break
case mc:
;((a = 1), (s = n + r[1] - r[0]))
break
default:
;((a = e - 1), (s = t))
}
var u = 0.5 * (n - t),
l = this.valueSize
;((this._weightPrev = u / (t - o)),
(this._weightNext = u / (s - n)),
(this._offsetPrev = i * l),
(this._offsetNext = a * l))
},
},
{
key: 'interpolate_',
value: function (e, t, n, r) {
for (
var i = this.resultBuffer,
a = this.sampleValues,
o = this.valueSize,
s = e * o,
u = s - o,
l = this._offsetPrev,
c = this._offsetNext,
h = this._weightPrev,
d = this._weightNext,
f = (n - t) / (r - t),
p = f * f,
v = p * f,
m = -h * v + 2 * h * p - h * f,
g = (1 + h) * v + (-1.5 - 2 * h) * p + (-0.5 + h) * f + 1,
y = (-1 - d) * v + (1.5 + d) * p + 0.5 * f,
_ = d * v - d * p,
b = 0;
b !== o;
++b
)
i[b] = m * a[l + b] + g * a[u + b] + y * a[s + b] + _ * a[c + b]
return i
},
},
])
)
})($p),
tv = (function (e) {
function t(e, n, r, i) {
return (A(this, t), y(this, t, [e, n, r, i]))
}
return (
x(t, e),
T(t, [
{
key: 'interpolate_',
value: function (e, t, n, r) {
for (
var i = this.resultBuffer,
a = this.sampleValues,
o = this.valueSize,
s = e * o,
u = s - o,
l = (n - t) / (r - t),
c = 1 - l,
h = 0;
h !== o;
++h
)
i[h] = a[u + h] * c + a[s + h] * l
return i
},
},
])
)
})($p),
nv = (function (e) {
function t(e, n, r, i) {
return (A(this, t), y(this, t, [e, n, r, i]))
}
return (
x(t, e),
T(t, [
{
key: 'interpolate_',
value: function (e) {
return this.copySampleValue_(e - 1)
},
},
])
)
})($p),
rv = (function () {
return T(
function e(t, n, r, i) {
if ((A(this, e), void 0 === t))
throw new Error('THREE.KeyframeTrack: track name is undefined')
if (void 0 === n || 0 === n.length)
throw new Error('THREE.KeyframeTrack: no keyframes in track named ' + t)
;((this.name = t),
(this.times = Yp(n, this.TimeBufferType)),
(this.values = Yp(r, this.ValueBufferType)),
this.setInterpolation(i || this.DefaultInterpolation))
},
[
{
key: 'InterpolantFactoryMethodDiscrete',
value: function (e) {
return new nv(this.times, this.values, this.getValueSize(), e)
},
},
{
key: 'InterpolantFactoryMethodLinear',
value: function (e) {
return new tv(this.times, this.values, this.getValueSize(), e)
},
},
{
key: 'InterpolantFactoryMethodSmooth',
value: function (e) {
return new ev(this.times, this.values, this.getValueSize(), e)
},
},
{
key: 'setInterpolation',
value: function (e) {
var t
switch (e) {
case hc:
t = this.InterpolantFactoryMethodDiscrete
break
case dc:
t = this.InterpolantFactoryMethodLinear
break
case fc:
t = this.InterpolantFactoryMethodSmooth
}
if (void 0 === t) {
var n =
'unsupported interpolation for ' +
this.ValueTypeName +
' keyframe track named ' +
this.name
if (void 0 === this.createInterpolant) {
if (e === this.DefaultInterpolation) throw new Error(n)
this.setInterpolation(this.DefaultInterpolation)
}
return (console.warn('THREE.KeyframeTrack:', n), this)
}
return ((this.createInterpolant = t), this)
},
},
{
key: 'getInterpolation',
value: function () {
switch (this.createInterpolant) {
case this.InterpolantFactoryMethodDiscrete:
return hc
case this.InterpolantFactoryMethodLinear:
return dc
case this.InterpolantFactoryMethodSmooth:
return fc
}
},
},
{
key: 'getValueSize',
value: function () {
return this.values.length / this.times.length
},
},
{
key: 'shift',
value: function (e) {
if (0 !== e)
for (var t = this.times, n = 0, r = t.length; n !== r; ++n) t[n] += e
return this
},
},
{
key: 'scale',
value: function (e) {
if (1 !== e)
for (var t = this.times, n = 0, r = t.length; n !== r; ++n) t[n] *= e
return this
},
},
{
key: 'trim',
value: function (e, t) {
for (
var n = this.times, r = n.length, i = 0, a = r - 1;
i !== r && n[i] < e;
)
++i
for (; -1 !== a && n[a] > t; ) --a
if ((++a, 0 !== i || a !== r)) {
i >= a && (i = (a = Math.max(a, 1)) - 1)
var o = this.getValueSize()
;((this.times = n.slice(i, a)),
(this.values = this.values.slice(i * o, a * o)))
}
return this
},
},
{
key: 'validate',
value: function () {
var e = !0,
t = this.getValueSize()
t - Math.floor(t) !== 0 &&
(console.error('THREE.KeyframeTrack: Invalid value size in track.', this),
(e = !1))
var n = this.times,
r = this.values,
i = n.length
0 === i &&
(console.error('THREE.KeyframeTrack: Track is empty.', this), (e = !1))
for (var a, o = null, s = 0; s !== i; s++) {
var u = n[s]
if ('number' == typeof u && isNaN(u)) {
;(console.error(
'THREE.KeyframeTrack: Time is not a valid number.',
this,
s,
u
),
(e = !1))
break
}
if (null !== o && o > u) {
;(console.error('THREE.KeyframeTrack: Out of order keys.', this, s, u, o),
(e = !1))
break
}
o = u
}
if (
void 0 !== r &&
((a = r), ArrayBuffer.isView(a) && !(a instanceof DataView))
)
for (var l = 0, c = r.length; l !== c; ++l) {
var h = r[l]
if (isNaN(h)) {
;(console.error(
'THREE.KeyframeTrack: Value is not a valid number.',
this,
l,
h
),
(e = !1))
break
}
}
return e
},
},
{
key: 'optimize',
value: function () {
for (
var e = this.times.slice(),
t = this.values.slice(),
n = this.getValueSize(),
r = this.getInterpolation() === fc,
i = e.length - 1,
a = 1,
o = 1;
o < i;
++o
) {
var s = !1,
u = e[o]
if (u !== e[o + 1] && (1 !== o || u !== e[0]))
if (r) s = !0
else
for (var l = o * n, c = l - n, h = l + n, d = 0; d !== n; ++d) {
var f = t[l + d]
if (f !== t[c + d] || f !== t[h + d]) {
s = !0
break
}
}
if (s) {
if (o !== a) {
e[a] = e[o]
for (var p = o * n, v = a * n, m = 0; m !== n; ++m) t[v + m] = t[p + m]
}
++a
}
}
if (i > 0) {
e[a] = e[i]
for (var g = i * n, y = a * n, _ = 0; _ !== n; ++_) t[y + _] = t[g + _]
++a
}
return (
a !== e.length
? ((this.times = e.slice(0, a)), (this.values = t.slice(0, a * n)))
: ((this.times = e), (this.values = t)),
this
)
},
},
{
key: 'clone',
value: function () {
var e = this.times.slice(),
t = this.values.slice(),
n = new (0, this.constructor)(this.name, e, t)
return ((n.createInterpolant = this.createInterpolant), n)
},
},
],
[
{
key: 'toJSON',
value: function (e) {
var t,
n = e.constructor
if (n.toJSON !== this.toJSON) t = n.toJSON(e)
else {
t = { name: e.name, times: Yp(e.times, Array), values: Yp(e.values, Array) }
var r = e.getInterpolation()
r !== e.DefaultInterpolation && (t.interpolation = r)
}
return ((t.type = e.ValueTypeName), t)
},
},
]
)
})()
;((rv.prototype.TimeBufferType = Float32Array),
(rv.prototype.ValueBufferType = Float32Array),
(rv.prototype.DefaultInterpolation = dc))
var iv = (function (e) {
function t(e, n, r) {
return (A(this, t), y(this, t, [e, n, r]))
}
return (x(t, e), T(t))
})(rv)
;((iv.prototype.ValueTypeName = 'bool'),
(iv.prototype.ValueBufferType = Array),
(iv.prototype.DefaultInterpolation = hc),
(iv.prototype.InterpolantFactoryMethodLinear = void 0),
(iv.prototype.InterpolantFactoryMethodSmooth = void 0))
var av = (function (e) {
function t() {
return (A(this, t), y(this, t, arguments))
}
return (x(t, e), T(t))
})(rv)
av.prototype.ValueTypeName = 'color'
var ov = (function (e) {
function t() {
return (A(this, t), y(this, t, arguments))
}
return (x(t, e), T(t))
})(rv)
ov.prototype.ValueTypeName = 'number'
var sv = (function (e) {
function t(e, n, r, i) {
return (A(this, t), y(this, t, [e, n, r, i]))
}
return (
x(t, e),
T(t, [
{
key: 'interpolate_',
value: function (e, t, n, r) {
for (
var i = this.resultBuffer,
a = this.sampleValues,
o = this.valueSize,
s = (n - t) / (r - t),
u = e * o,
l = u + o;
u !== l;
u += 4
)
fh.slerpFlat(i, 0, a, u - o, a, u, s)
return i
},
},
])
)
})($p),
uv = (function (e) {
function t() {
return (A(this, t), y(this, t, arguments))
}
return (
x(t, e),
T(t, [
{
key: 'InterpolantFactoryMethodLinear',
value: function (e) {
return new sv(this.times, this.values, this.getValueSize(), e)
},
},
])
)
})(rv)
;((uv.prototype.ValueTypeName = 'quaternion'),
(uv.prototype.InterpolantFactoryMethodSmooth = void 0))
var lv = (function (e) {
function t(e, n, r) {
return (A(this, t), y(this, t, [e, n, r]))
}
return (x(t, e), T(t))
})(rv)
;((lv.prototype.ValueTypeName = 'string'),
(lv.prototype.ValueBufferType = Array),
(lv.prototype.DefaultInterpolation = hc),
(lv.prototype.InterpolantFactoryMethodLinear = void 0),
(lv.prototype.InterpolantFactoryMethodSmooth = void 0))
var cv = (function (e) {
function t() {
return (A(this, t), y(this, t, arguments))
}
return (x(t, e), T(t))
})(rv)
cv.prototype.ValueTypeName = 'vector'
var hv = (function () {
return T(
function e() {
var t = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : '',
n = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : -1,
r = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : [],
i = arguments.length > 3 && void 0 !== arguments[3] ? arguments[3] : gc
;(A(this, e),
(this.name = t),
(this.tracks = r),
(this.duration = n),
(this.blendMode = i),
(this.uuid = Lc()),
this.duration < 0 && this.resetDuration())
},
[
{
key: 'resetDuration',
value: function () {
for (var e = 0, t = 0, n = this.tracks.length; t !== n; ++t) {
var r = this.tracks[t]
e = Math.max(e, r.times[r.times.length - 1])
}
return ((this.duration = e), this)
},
},
{
key: 'trim',
value: function () {
for (var e = 0; e < this.tracks.length; e++)
this.tracks[e].trim(0, this.duration)
return this
},
},
{
key: 'validate',
value: function () {
for (var e = !0, t = 0; t < this.tracks.length; t++)
e = e && this.tracks[t].validate()
return e
},
},
{
key: 'optimize',
value: function () {
for (var e = 0; e < this.tracks.length; e++) this.tracks[e].optimize()
return this
},
},
{
key: 'clone',
value: function () {
for (var e = [], t = 0; t < this.tracks.length; t++)
e.push(this.tracks[t].clone())
return new this.constructor(this.name, this.duration, e, this.blendMode)
},
},
{
key: 'toJSON',
value: function () {
return this.constructor.toJSON(this)
},
},
],
[
{
key: 'parse',
value: function (e) {
for (
var t = [], n = e.tracks, r = 1 / (e.fps || 1), i = 0, a = n.length;
i !== a;
++i
)
t.push(dv(n[i]).scale(r))
var o = new this(e.name, e.duration, t, e.blendMode)
return ((o.uuid = e.uuid), o)
},
},
{
key: 'toJSON',
value: function (e) {
for (
var t = [],
n = e.tracks,
r = {
name: e.name,
duration: e.duration,
tracks: t,
uuid: e.uuid,
blendMode: e.blendMode,
},
i = 0,
a = n.length;
i !== a;
++i
)
t.push(rv.toJSON(n[i]))
return r
},
},
{
key: 'CreateFromMorphTargetSequence',
value: function (e, t, n, r) {
for (var i = t.length, a = [], o = 0; o < i; o++) {
var s = [],
u = []
;(s.push((o + i - 1) % i, o, (o + 1) % i), u.push(0, 1, 0))
var l = Kp(s)
;((s = Zp(s, 1, l)),
(u = Zp(u, 1, l)),
r || 0 !== s[0] || (s.push(i), u.push(u[0])),
a.push(
new ov('.morphTargetInfluences[' + t[o].name + ']', s, u).scale(1 / n)
))
}
return new this(e, -1, a)
},
},
{
key: 'findByName',
value: function (e, t) {
var n = e
if (!Array.isArray(e)) {
var r = e
n = (r.geometry && r.geometry.animations) || r.animations
}
for (var i = 0; i < n.length; i++) if (n[i].name === t) return n[i]
return null
},
},
{
key: 'CreateClipsFromMorphTargetSequences',
value: function (e, t, n) {
for (var r = {}, i = /^([\w-]*?)([\d]+)$/, a = 0, o = e.length; a < o; a++) {
var s = e[a],
u = s.name.match(i)
if (u && u.length > 1) {
var l = u[1],
c = r[l]
;(c || (r[l] = c = []), c.push(s))
}
}
var h = []
for (var d in r) h.push(this.CreateFromMorphTargetSequence(d, r[d], t, n))
return h
},
},
{
key: 'parseAnimation',
value: function (e, t) {
if (!e)
return (
console.error('THREE.AnimationClip: No animation in JSONLoader data.'),
null
)
for (
var n = function (e, t, n, r, i) {
if (0 !== n.length) {
var a = [],
o = []
;(Jp(n, a, o, r), 0 !== a.length && i.push(new e(t, a, o)))
}
},
r = [],
i = e.name || 'default',
a = e.fps || 30,
o = e.blendMode,
s = e.length || -1,
u = e.hierarchy || [],
l = 0;
l < u.length;
l++
) {
var c = u[l].keys
if (c && 0 !== c.length)
if (c[0].morphTargets) {
var h = {},
d = void 0
for (d = 0; d < c.length; d++)
if (c[d].morphTargets)
for (var f = 0; f < c[d].morphTargets.length; f++)
h[c[d].morphTargets[f]] = -1
for (var p in h) {
for (var v = [], m = [], g = 0; g !== c[d].morphTargets.length; ++g) {
var y = c[d]
;(v.push(y.time), m.push(y.morphTarget === p ? 1 : 0))
}
r.push(new ov('.morphTargetInfluence[' + p + ']', v, m))
}
s = h.length * a
} else {
var _ = '.bones[' + t[l].name + ']'
;(n(cv, _ + '.position', c, 'pos', r),
n(uv, _ + '.quaternion', c, 'rot', r),
n(cv, _ + '.scale', c, 'scl', r))
}
}
return 0 === r.length ? null : new this(i, s, r, o)
},
},
]
)
})()
function dv(e) {
if (void 0 === e.type)
throw new Error('THREE.KeyframeTrack: track type undefined, can not parse')
var t = (function (e) {
switch (e.toLowerCase()) {
case 'scalar':
case 'double':
case 'float':
case 'number':
case 'integer':
return ov
case 'vector':
case 'vector2':
case 'vector3':
case 'vector4':
return cv
case 'color':
return av
case 'quaternion':
return uv
case 'bool':
case 'boolean':
return iv
case 'string':
return lv
}
throw new Error('THREE.KeyframeTrack: Unsupported typeName: ' + e)
})(e.type)
if (void 0 === e.times) {
var n = [],
r = []
;(Jp(e.keys, n, r, 'value'), (e.times = n), (e.values = r))
}
return void 0 !== t.parse
? t.parse(e)
: new t(e.name, e.times, e.values, e.interpolation)
}
var fv = {
enabled: !1,
files: {},
add: function (e, t) {
!1 !== this.enabled && (this.files[e] = t)
},
get: function (e) {
if (!1 !== this.enabled) return this.files[e]
},
remove: function (e) {
delete this.files[e]
},
clear: function () {
this.files = {}
},
},
pv = T(function e(t, n, r) {
A(this, e)
var i = this,
a = !1,
o = 0,
s = 0,
u = void 0,
l = []
;((this.onStart = void 0),
(this.onLoad = t),
(this.onProgress = n),
(this.onError = r),
(this.itemStart = function (e) {
;(s++, !1 === a && void 0 !== i.onStart && i.onStart(e, o, s), (a = !0))
}),
(this.itemEnd = function (e) {
;(o++,
void 0 !== i.onProgress && i.onProgress(e, o, s),
o === s && ((a = !1), void 0 !== i.onLoad && i.onLoad()))
}),
(this.itemError = function (e) {
void 0 !== i.onError && i.onError(e)
}),
(this.resolveURL = function (e) {
return u ? u(e) : e
}),
(this.setURLModifier = function (e) {
return ((u = e), this)
}),
(this.addHandler = function (e, t) {
return (l.push(e, t), this)
}),
(this.removeHandler = function (e) {
var t = l.indexOf(e)
return (-1 !== t && l.splice(t, 2), this)
}),
(this.getHandler = function (e) {
for (var t = 0, n = l.length; t < n; t += 2) {
var r = l[t],
i = l[t + 1]
if ((r.global && (r.lastIndex = 0), r.test(e))) return i
}
return null
}))
}),
vv = new pv(),
mv = (function () {
return T(
function e(t) {
;(A(this, e),
(this.manager = void 0 !== t ? t : vv),
(this.crossOrigin = 'anonymous'),
(this.withCredentials = !1),
(this.path = ''),
(this.resourcePath = ''),
(this.requestHeader = {}))
},
[
{ key: 'load', value: function () {} },
{
key: 'loadAsync',
value: function (e, t) {
var n = this
return new Promise(function (r, i) {
n.load(e, r, t, i)
})
},
},
{ key: 'parse', value: function () {} },
{
key: 'setCrossOrigin',
value: function (e) {
return ((this.crossOrigin = e), this)
},
},
{
key: 'setWithCredentials',
value: function (e) {
return ((this.withCredentials = e), this)
},
},
{
key: 'setPath',
value: function (e) {
return ((this.path = e), this)
},
},
{
key: 'setResourcePath',
value: function (e) {
return ((this.resourcePath = e), this)
},
},
{
key: 'setRequestHeader',
value: function (e) {
return ((this.requestHeader = e), this)
},
},
]
)
})()
mv.DEFAULT_MATERIAL_NAME = '__DEFAULT'
var gv = {},
yv = (function (e) {
function t(e, n) {
var r
return (A(this, t), ((r = y(this, t, [e])).response = n), r)
}
return (x(t, e), T(t))
})(m(Error)),
_v = (function (e) {
function t(e) {
return (A(this, t), y(this, t, [e]))
}
return (
x(t, e),
T(t, [
{
key: 'load',
value: function (e, t, n, r) {
var i = this
;(void 0 === e && (e = ''),
void 0 !== this.path && (e = this.path + e),
(e = this.manager.resolveURL(e)))
var a = fv.get(e)
if (void 0 !== a)
return (
this.manager.itemStart(e),
setTimeout(function () {
;(t && t(a), i.manager.itemEnd(e))
}, 0),
a
)
if (void 0 === gv[e]) {
;((gv[e] = []), gv[e].push({ onLoad: t, onProgress: n, onError: r }))
var o = new Request(e, {
headers: new Headers(this.requestHeader),
credentials: this.withCredentials ? 'include' : 'same-origin',
}),
s = this.mimeType,
u = this.responseType
;(fetch(o)
.then(function (t) {
if (200 === t.status || 0 === t.status) {
if (
(0 === t.status &&
console.warn('THREE.FileLoader: HTTP Status 0 received.'),
'undefined' == typeof ReadableStream ||
void 0 === t.body ||
void 0 === t.body.getReader)
)
return t
var n = gv[e],
r = t.body.getReader(),
i = t.headers.get('X-File-Size') || t.headers.get('Content-Length'),
a = i ? parseInt(i) : 0,
o = 0 !== a,
s = 0,
u = new ReadableStream({
start: function (e) {
!(function t() {
r.read().then(
function (r) {
var i = r.done,
u = r.value
if (i) e.close()
else {
s += u.byteLength
for (
var l = new ProgressEvent('progress', {
lengthComputable: o,
loaded: s,
total: a,
}),
c = 0,
h = n.length;
c < h;
c++
) {
var d = n[c]
d.onProgress && d.onProgress(l)
}
;(e.enqueue(u), t())
}
},
function (t) {
e.error(t)
}
)
})()
},
})
return new Response(u)
}
throw new yv(
'fetch for "'
.concat(t.url, '" responded with ')
.concat(t.status, ': ')
.concat(t.statusText),
t
)
})
.then(function (e) {
switch (u) {
case 'arraybuffer':
return e.arrayBuffer()
case 'blob':
return e.blob()
case 'document':
return e.text().then(function (e) {
return new DOMParser().parseFromString(e, s)
})
case 'json':
return e.json()
default:
if (void 0 === s) return e.text()
var t = /charset="?([^;"\s]*)"?/i.exec(s),
n = t && t[1] ? t[1].toLowerCase() : void 0,
r = new TextDecoder(n)
return e.arrayBuffer().then(function (e) {
return r.decode(e)
})
}
})
.then(function (t) {
fv.add(e, t)
var n = gv[e]
delete gv[e]
for (var r = 0, i = n.length; r < i; r++) {
var a = n[r]
a.onLoad && a.onLoad(t)
}
})
.catch(function (t) {
var n = gv[e]
if (void 0 === n) throw (i.manager.itemError(e), t)
delete gv[e]
for (var r = 0, a = n.length; r < a; r++) {
var o = n[r]
o.onError && o.onError(t)
}
i.manager.itemError(e)
})
.finally(function () {
i.manager.itemEnd(e)
}),
this.manager.itemStart(e))
} else gv[e].push({ onLoad: t, onProgress: n, onError: r })
},
},
{
key: 'setResponseType',
value: function (e) {
return ((this.responseType = e), this)
},
},
{
key: 'setMimeType',
value: function (e) {
return ((this.mimeType = e), this)
},
},
])
)
})(mv),
bv = (function (e) {
function t(e) {
return (A(this, t), y(this, t, [e]))
}
return (
x(t, e),
T(t, [
{
key: 'load',
value: function (e, t, n, r) {
;(void 0 !== this.path && (e = this.path + e),
(e = this.manager.resolveURL(e)))
var i = this,
a = fv.get(e)
if (void 0 !== a)
return (
i.manager.itemStart(e),
setTimeout(function () {
;(t && t(a), i.manager.itemEnd(e))
}, 0),
a
)
var o = jc('img')
function s() {
;(l(), fv.add(e, this), t && t(this), i.manager.itemEnd(e))
}
function u(t) {
;(l(), r && r(t), i.manager.itemError(e), i.manager.itemEnd(e))
}
function l() {
;(o.removeEventListener('load', s, !1),
o.removeEventListener('error', u, !1))
}
return (
o.addEventListener('load', s, !1),
o.addEventListener('error', u, !1),
'data:' !== e.slice(0, 5) &&
void 0 !== this.crossOrigin &&
(o.crossOrigin = this.crossOrigin),
i.manager.itemStart(e),
(o.src = e),
o
)
},
},
])
)
})(mv),
xv = (function (e) {
function t(e) {
return (A(this, t), y(this, t, [e]))
}
return (
x(t, e),
T(t, [
{
key: 'load',
value: function (e, t, n, r) {
var i = new sh(),
a = new bv(this.manager)
return (
a.setCrossOrigin(this.crossOrigin),
a.setPath(this.path),
a.load(
e,
function (e) {
;((i.image = e), (i.needsUpdate = !0), void 0 !== t && t(i))
},
n,
r
),
i
)
},
},
])
)
})(mv),
Sv = (function (e) {
function t(e) {
var n,
r = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : 1
return (
A(this, t),
((n = y(this, t)).isLight = !0),
(n.type = 'Light'),
(n.color = new Od(e)),
(n.intensity = r),
n
)
}
return (
x(t, e),
T(t, [
{ key: 'dispose', value: function () {} },
{
key: 'copy',
value: function (e, r) {
return (
n(t, 'copy', this, 3)([e, r]),
this.color.copy(e.color),
(this.intensity = e.intensity),
this
)
},
},
{
key: 'toJSON',
value: function (e) {
var r = n(t, 'toJSON', this, 3)([e])
return (
(r.object.color = this.color.getHex()),
(r.object.intensity = this.intensity),
void 0 !== this.groundColor &&
(r.object.groundColor = this.groundColor.getHex()),
void 0 !== this.distance && (r.object.distance = this.distance),
void 0 !== this.angle && (r.object.angle = this.angle),
void 0 !== this.decay && (r.object.decay = this.decay),
void 0 !== this.penumbra && (r.object.penumbra = this.penumbra),
void 0 !== this.shadow && (r.object.shadow = this.shadow.toJSON()),
void 0 !== this.target && (r.object.target = this.target.uuid),
r
)
},
},
])
)
})(gd),
Av = new Gh(),
wv = new ph(),
Tv = new ph(),
Mv = (function () {
return T(
function e(t) {
;(A(this, e),
(this.camera = t),
(this.intensity = 1),
(this.bias = 0),
(this.normalBias = 0),
(this.radius = 1),
(this.blurSamples = 8),
(this.mapSize = new Vc(512, 512)),
(this.map = null),
(this.mapPass = null),
(this.matrix = new Gh()),
(this.autoUpdate = !0),
(this.needsUpdate = !1),
(this._frustum = new gp()),
(this._frameExtents = new Vc(1, 1)),
(this._viewportCount = 1),
(this._viewports = [new uh(0, 0, 1, 1)]))
},
[
{
key: 'getViewportCount',
value: function () {
return this._viewportCount
},
},
{
key: 'getFrustum',
value: function () {
return this._frustum
},
},
{
key: 'updateMatrices',
value: function (e) {
var t = this.camera,
n = this.matrix
;(wv.setFromMatrixPosition(e.matrixWorld),
t.position.copy(wv),
Tv.setFromMatrixPosition(e.target.matrixWorld),
t.lookAt(Tv),
t.updateMatrixWorld(),
Av.multiplyMatrices(t.projectionMatrix, t.matrixWorldInverse),
this._frustum.setFromProjectionMatrix(Av),
n.set(0.5, 0, 0, 0.5, 0, 0.5, 0, 0.5, 0, 0, 0.5, 0.5, 0, 0, 0, 1),
n.multiply(Av))
},
},
{
key: 'getViewport',
value: function (e) {
return this._viewports[e]
},
},
{
key: 'getFrameExtents',
value: function () {
return this._frameExtents
},
},
{
key: 'dispose',
value: function () {
;(this.map && this.map.dispose(), this.mapPass && this.mapPass.dispose())
},
},
{
key: 'copy',
value: function (e) {
return (
(this.camera = e.camera.clone()),
(this.intensity = e.intensity),
(this.bias = e.bias),
(this.radius = e.radius),
this.mapSize.copy(e.mapSize),
this
)
},
},
{
key: 'clone',
value: function () {
return new this.constructor().copy(this)
},
},
{
key: 'toJSON',
value: function () {
var e = {}
return (
1 !== this.intensity && (e.intensity = this.intensity),
0 !== this.bias && (e.bias = this.bias),
0 !== this.normalBias && (e.normalBias = this.normalBias),
1 !== this.radius && (e.radius = this.radius),
(512 === this.mapSize.x && 512 === this.mapSize.y) ||
(e.mapSize = this.mapSize.toArray()),
(e.camera = this.camera.toJSON(!1).object),
delete e.camera.matrix,
e
)
},
},
]
)
})(),
Ev = (function (e) {
function t() {
var e
return (
A(this, t),
((e = y(this, t, [new kf(50, 1, 0.5, 500)])).isSpotLightShadow = !0),
(e.focus = 1),
e
)
}
return (
x(t, e),
T(t, [
{
key: 'updateMatrices',
value: function (e) {
var r = this.camera,
i = 2 * Pc * e.angle * this.focus,
a = this.mapSize.width / this.mapSize.height,
o = e.distance || r.far
;((i === r.fov && a === r.aspect && o === r.far) ||
((r.fov = i), (r.aspect = a), (r.far = o), r.updateProjectionMatrix()),
n(t, 'updateMatrices', this, 3)([e]))
},
},
{
key: 'copy',
value: function (e) {
return (n(t, 'copy', this, 3)([e]), (this.focus = e.focus), this)
},
},
])
)
})(Mv),
Cv = (function (e) {
function t(e, n) {
var r,
i = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : 0,
a = arguments.length > 3 && void 0 !== arguments[3] ? arguments[3] : Math.PI / 3,
o = arguments.length > 4 && void 0 !== arguments[4] ? arguments[4] : 0,
s = arguments.length > 5 && void 0 !== arguments[5] ? arguments[5] : 2
return (
A(this, t),
((r = y(this, t, [e, n])).isSpotLight = !0),
(r.type = 'SpotLight'),
r.position.copy(gd.DEFAULT_UP),
r.updateMatrix(),
(r.target = new gd()),
(r.distance = i),
(r.angle = a),
(r.penumbra = o),
(r.decay = s),
(r.map = null),
(r.shadow = new Ev()),
r
)
}
return (
x(t, e),
T(t, [
{
key: 'power',
get: function () {
return this.intensity * Math.PI
},
set: function (e) {
this.intensity = e / Math.PI
},
},
{
key: 'dispose',
value: function () {
this.shadow.dispose()
},
},
{
key: 'copy',
value: function (e, r) {
return (
n(t, 'copy', this, 3)([e, r]),
(this.distance = e.distance),
(this.angle = e.angle),
(this.penumbra = e.penumbra),
(this.decay = e.decay),
(this.target = e.target.clone()),
(this.shadow = e.shadow.clone()),
this
)
},
},
])
)
})(Sv),
kv = new Gh(),
Rv = new ph(),
Iv = new ph(),
Nv = (function (e) {
function t() {
var e
return (
A(this, t),
((e = y(this, t, [new kf(90, 1, 0.5, 500)])).isPointLightShadow = !0),
(e._frameExtents = new Vc(4, 2)),
(e._viewportCount = 6),
(e._viewports = [
new uh(2, 1, 1, 1),
new uh(0, 1, 1, 1),
new uh(3, 1, 1, 1),
new uh(1, 1, 1, 1),
new uh(3, 0, 1, 1),
new uh(1, 0, 1, 1),
]),
(e._cubeDirections = [
new ph(1, 0, 0),
new ph(-1, 0, 0),
new ph(0, 0, 1),
new ph(0, 0, -1),
new ph(0, 1, 0),
new ph(0, -1, 0),
]),
(e._cubeUps = [
new ph(0, 1, 0),
new ph(0, 1, 0),
new ph(0, 1, 0),
new ph(0, 1, 0),
new ph(0, 0, 1),
new ph(0, 0, -1),
]),
e
)
}
return (
x(t, e),
T(t, [
{
key: 'updateMatrices',
value: function (e) {
var t = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : 0,
n = this.camera,
r = this.matrix,
i = e.distance || n.far
;(i !== n.far && ((n.far = i), n.updateProjectionMatrix()),
Rv.setFromMatrixPosition(e.matrixWorld),
n.position.copy(Rv),
Iv.copy(n.position),
Iv.add(this._cubeDirections[t]),
n.up.copy(this._cubeUps[t]),
n.lookAt(Iv),
n.updateMatrixWorld(),
r.makeTranslation(-Rv.x, -Rv.y, -Rv.z),
kv.multiplyMatrices(n.projectionMatrix, n.matrixWorldInverse),
this._frustum.setFromProjectionMatrix(kv))
},
},
])
)
})(Mv),
Pv = (function (e) {
function t(e, n) {
var r,
i = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : 0,
a = arguments.length > 3 && void 0 !== arguments[3] ? arguments[3] : 2
return (
A(this, t),
((r = y(this, t, [e, n])).isPointLight = !0),
(r.type = 'PointLight'),
(r.distance = i),
(r.decay = a),
(r.shadow = new Nv()),
r
)
}
return (
x(t, e),
T(t, [
{
key: 'power',
get: function () {
return 4 * this.intensity * Math.PI
},
set: function (e) {
this.intensity = e / (4 * Math.PI)
},
},
{
key: 'dispose',
value: function () {
this.shadow.dispose()
},
},
{
key: 'copy',
value: function (e, r) {
return (
n(t, 'copy', this, 3)([e, r]),
(this.distance = e.distance),
(this.decay = e.decay),
(this.shadow = e.shadow.clone()),
this
)
},
},
])
)
})(Sv),
Lv = (function (e) {
function t() {
var e,
n = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : -1,
r = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : 1,
i = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : 1,
a = arguments.length > 3 && void 0 !== arguments[3] ? arguments[3] : -1,
o = arguments.length > 4 && void 0 !== arguments[4] ? arguments[4] : 0.1,
s = arguments.length > 5 && void 0 !== arguments[5] ? arguments[5] : 2e3
return (
A(this, t),
((e = y(this, t)).isOrthographicCamera = !0),
(e.type = 'OrthographicCamera'),
(e.zoom = 1),
(e.view = null),
(e.left = n),
(e.right = r),
(e.top = i),
(e.bottom = a),
(e.near = o),
(e.far = s),
e.updateProjectionMatrix(),
e
)
}
return (
x(t, e),
T(t, [
{
key: 'copy',
value: function (e, r) {
return (
n(t, 'copy', this, 3)([e, r]),
(this.left = e.left),
(this.right = e.right),
(this.top = e.top),
(this.bottom = e.bottom),
(this.near = e.near),
(this.far = e.far),
(this.zoom = e.zoom),
(this.view = null === e.view ? null : Object.assign({}, e.view)),
this
)
},
},
{
key: 'setViewOffset',
value: function (e, t, n, r, i, a) {
;(null === this.view &&
(this.view = {
enabled: !0,
fullWidth: 1,
fullHeight: 1,
offsetX: 0,
offsetY: 0,
width: 1,
height: 1,
}),
(this.view.enabled = !0),
(this.view.fullWidth = e),
(this.view.fullHeight = t),
(this.view.offsetX = n),
(this.view.offsetY = r),
(this.view.width = i),
(this.view.height = a),
this.updateProjectionMatrix())
},
},
{
key: 'clearViewOffset',
value: function () {
;(null !== this.view && (this.view.enabled = !1),
this.updateProjectionMatrix())
},
},
{
key: 'updateProjectionMatrix',
value: function () {
var e = (this.right - this.left) / (2 * this.zoom),
t = (this.top - this.bottom) / (2 * this.zoom),
n = (this.right + this.left) / 2,
r = (this.top + this.bottom) / 2,
i = n - e,
a = n + e,
o = r + t,
s = r - t
if (null !== this.view && this.view.enabled) {
var u = (this.right - this.left) / this.view.fullWidth / this.zoom,
l = (this.top - this.bottom) / this.view.fullHeight / this.zoom
;((a = (i += u * this.view.offsetX) + u * this.view.width),
(s = (o -= l * this.view.offsetY) - l * this.view.height))
}
;(this.projectionMatrix.makeOrthographic(
i,
a,
o,
s,
this.near,
this.far,
this.coordinateSystem
),
this.projectionMatrixInverse.copy(this.projectionMatrix).invert())
},
},
{
key: 'toJSON',
value: function (e) {
var r = n(t, 'toJSON', this, 3)([e])
return (
(r.object.zoom = this.zoom),
(r.object.left = this.left),
(r.object.right = this.right),
(r.object.top = this.top),
(r.object.bottom = this.bottom),
(r.object.near = this.near),
(r.object.far = this.far),
null !== this.view && (r.object.view = Object.assign({}, this.view)),
r
)
},
},
])
)
})(Tf),
Dv = (function (e) {
function t() {
var e
return (
A(this, t),
((e = y(this, t, [new Lv(-5, 5, 5, -5, 0.5, 500)])).isDirectionalLightShadow =
!0),
e
)
}
return (x(t, e), T(t))
})(Mv),
Ov = (function (e) {
function t(e, n) {
var r
return (
A(this, t),
((r = y(this, t, [e, n])).isDirectionalLight = !0),
(r.type = 'DirectionalLight'),
r.position.copy(gd.DEFAULT_UP),
r.updateMatrix(),
(r.target = new gd()),
(r.shadow = new Dv()),
r
)
}
return (
x(t, e),
T(t, [
{
key: 'dispose',
value: function () {
this.shadow.dispose()
},
},
{
key: 'copy',
value: function (e) {
return (
n(t, 'copy', this, 3)([e]),
(this.target = e.target.clone()),
(this.shadow = e.shadow.clone()),
this
)
},
},
])
)
})(Sv),
Fv = (function () {
return T(
function e() {
A(this, e)
},
null,
[
{
key: 'decodeText',
value: function (e) {
if (
(console.warn(
'THREE.LoaderUtils: decodeText() has been deprecated with r165 and will be removed with r175. Use TextDecoder instead.'
),
'undefined' != typeof TextDecoder)
)
return new TextDecoder().decode(e)
for (var t = '', n = 0, r = e.length; n < r; n++)
t += String.fromCharCode(e[n])
try {
return decodeURIComponent(escape(t))
} catch (ZJ) {
return t
}
},
},
{
key: 'extractUrlBase',
value: function (e) {
var t = e.lastIndexOf('/')
return -1 === t ? './' : e.slice(0, t + 1)
},
},
{
key: 'resolveURL',
value: function (e, t) {
return 'string' != typeof e || '' === e
? ''
: (/^https?:\/\//i.test(t) &&
/^\//.test(e) &&
(t = t.replace(/(^https?:\/\/[^\/]+).*/i, '$1')),
/^(https?:)?\/\//i.test(e) ||
/^data:.*,.*$/i.test(e) ||
/^blob:.*$/i.test(e)
? e
: t + e)
},
},
]
)
})(),
Bv = (function (e) {
function t() {
var e
return (
A(this, t),
((e = y(this, t)).isInstancedBufferGeometry = !0),
(e.type = 'InstancedBufferGeometry'),
(e.instanceCount = 1 / 0),
e
)
}
return (
x(t, e),
T(t, [
{
key: 'copy',
value: function (e) {
return (
n(t, 'copy', this, 3)([e]),
(this.instanceCount = e.instanceCount),
this
)
},
},
{
key: 'toJSON',
value: function () {
var e = n(t, 'toJSON', this, 3)([])
return (
(e.instanceCount = this.instanceCount),
(e.isInstancedBufferGeometry = !0),
e
)
},
},
])
)
})(af),
Uv = (function (e) {
function t(e) {
var n
return (
A(this, t),
((n = y(this, t, [e])).isImageBitmapLoader = !0),
'undefined' == typeof createImageBitmap &&
console.warn('THREE.ImageBitmapLoader: createImageBitmap() not supported.'),
'undefined' == typeof fetch &&
console.warn('THREE.ImageBitmapLoader: fetch() not supported.'),
(n.options = { premultiplyAlpha: 'none' }),
n
)
}
return (
x(t, e),
T(t, [
{
key: 'setOptions',
value: function (e) {
return ((this.options = e), this)
},
},
{
key: 'load',
value: function (e, t, n, r) {
;(void 0 === e && (e = ''),
void 0 !== this.path && (e = this.path + e),
(e = this.manager.resolveURL(e)))
var i = this,
a = fv.get(e)
if (void 0 !== a)
return (
i.manager.itemStart(e),
a.then
? void a
.then(function (n) {
;(t && t(n), i.manager.itemEnd(e))
})
.catch(function (e) {
r && r(e)
})
: (setTimeout(function () {
;(t && t(a), i.manager.itemEnd(e))
}, 0),
a)
)
var o = {}
;((o.credentials =
'anonymous' === this.crossOrigin ? 'same-origin' : 'include'),
(o.headers = this.requestHeader))
var s = fetch(e, o)
.then(function (e) {
return e.blob()
})
.then(function (e) {
return createImageBitmap(
e,
Object.assign(i.options, { colorSpaceConversion: 'none' })
)
})
.then(function (n) {
return (fv.add(e, n), t && t(n), i.manager.itemEnd(e), n)
})
.catch(function (t) {
;(r && r(t), fv.remove(e), i.manager.itemError(e), i.manager.itemEnd(e))
})
;(fv.add(e, s), i.manager.itemStart(e))
},
},
])
)
})(mv),
zv = (function (e) {
function t() {
var e,
n = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : []
return (
A(this, t),
((e = y(this, t)).isArrayCamera = !0),
(e.cameras = n),
(e.index = 0),
e
)
}
return (x(t, e), T(t))
})(kf),
Vv = (function () {
return T(
function e() {
var t = !(arguments.length > 0 && void 0 !== arguments[0]) || arguments[0]
;(A(this, e),
(this.autoStart = t),
(this.startTime = 0),
(this.oldTime = 0),
(this.elapsedTime = 0),
(this.running = !1))
},
[
{
key: 'start',
value: function () {
;((this.startTime = Hv()),
(this.oldTime = this.startTime),
(this.elapsedTime = 0),
(this.running = !0))
},
},
{
key: 'stop',
value: function () {
;(this.getElapsedTime(), (this.running = !1), (this.autoStart = !1))
},
},
{
key: 'getElapsedTime',
value: function () {
return (this.getDelta(), this.elapsedTime)
},
},
{
key: 'getDelta',
value: function () {
var e = 0
if (this.autoStart && !this.running) return (this.start(), 0)
if (this.running) {
var t = Hv()
;((e = (t - this.oldTime) / 1e3),
(this.oldTime = t),
(this.elapsedTime += e))
}
return e
},
},
]
)
})()
function Hv() {
return performance.now()
}
var Wv = (function () {
return T(
function e(t, n, r) {
var i, a, o
switch ((A(this, e), (this.binding = t), (this.valueSize = r), n)) {
case 'quaternion':
;((i = this._slerp),
(a = this._slerpAdditive),
(o = this._setAdditiveIdentityQuaternion),
(this.buffer = new Float64Array(6 * r)),
(this._workIndex = 5))
break
case 'string':
case 'bool':
;((i = this._select),
(a = this._select),
(o = this._setAdditiveIdentityOther),
(this.buffer = new Array(5 * r)))
break
default:
;((i = this._lerp),
(a = this._lerpAdditive),
(o = this._setAdditiveIdentityNumeric),
(this.buffer = new Float64Array(5 * r)))
}
;((this._mixBufferRegion = i),
(this._mixBufferRegionAdditive = a),
(this._setIdentity = o),
(this._origIndex = 3),
(this._addIndex = 4),
(this.cumulativeWeight = 0),
(this.cumulativeWeightAdditive = 0),
(this.useCount = 0),
(this.referenceCount = 0))
},
[
{
key: 'accumulate',
value: function (e, t) {
var n = this.buffer,
r = this.valueSize,
i = e * r + r,
a = this.cumulativeWeight
if (0 === a) {
for (var o = 0; o !== r; ++o) n[i + o] = n[o]
a = t
} else {
var s = t / (a += t)
this._mixBufferRegion(n, i, 0, s, r)
}
this.cumulativeWeight = a
},
},
{
key: 'accumulateAdditive',
value: function (e) {
var t = this.buffer,
n = this.valueSize,
r = n * this._addIndex
;(0 === this.cumulativeWeightAdditive && this._setIdentity(),
this._mixBufferRegionAdditive(t, r, 0, e, n),
(this.cumulativeWeightAdditive += e))
},
},
{
key: 'apply',
value: function (e) {
var t = this.valueSize,
n = this.buffer,
r = e * t + t,
i = this.cumulativeWeight,
a = this.cumulativeWeightAdditive,
o = this.binding
if (
((this.cumulativeWeight = 0), (this.cumulativeWeightAdditive = 0), i < 1)
) {
var s = t * this._origIndex
this._mixBufferRegion(n, r, s, 1 - i, t)
}
a > 0 && this._mixBufferRegionAdditive(n, r, this._addIndex * t, 1, t)
for (var u = t, l = t + t; u !== l; ++u)
if (n[u] !== n[u + t]) {
o.setValue(n, r)
break
}
},
},
{
key: 'saveOriginalState',
value: function () {
var e = this.binding,
t = this.buffer,
n = this.valueSize,
r = n * this._origIndex
e.getValue(t, r)
for (var i = n, a = r; i !== a; ++i) t[i] = t[r + (i % n)]
;(this._setIdentity(),
(this.cumulativeWeight = 0),
(this.cumulativeWeightAdditive = 0))
},
},
{
key: 'restoreOriginalState',
value: function () {
var e = 3 * this.valueSize
this.binding.setValue(this.buffer, e)
},
},
{
key: '_setAdditiveIdentityNumeric',
value: function () {
for (
var e = this._addIndex * this.valueSize, t = e + this.valueSize, n = e;
n < t;
n++
)
this.buffer[n] = 0
},
},
{
key: '_setAdditiveIdentityQuaternion',
value: function () {
;(this._setAdditiveIdentityNumeric(),
(this.buffer[this._addIndex * this.valueSize + 3] = 1))
},
},
{
key: '_setAdditiveIdentityOther',
value: function () {
for (
var e = this._origIndex * this.valueSize,
t = this._addIndex * this.valueSize,
n = 0;
n < this.valueSize;
n++
)
this.buffer[t + n] = this.buffer[e + n]
},
},
{
key: '_select',
value: function (e, t, n, r, i) {
if (r >= 0.5) for (var a = 0; a !== i; ++a) e[t + a] = e[n + a]
},
},
{
key: '_slerp',
value: function (e, t, n, r) {
fh.slerpFlat(e, t, e, t, e, n, r)
},
},
{
key: '_slerpAdditive',
value: function (e, t, n, r, i) {
var a = this._workIndex * i
;(fh.multiplyQuaternionsFlat(e, a, e, t, e, n),
fh.slerpFlat(e, t, e, t, e, a, r))
},
},
{
key: '_lerp',
value: function (e, t, n, r, i) {
for (var a = 1 - r, o = 0; o !== i; ++o) {
var s = t + o
e[s] = e[s] * a + e[n + o] * r
}
},
},
{
key: '_lerpAdditive',
value: function (e, t, n, r, i) {
for (var a = 0; a !== i; ++a) {
var o = t + a
e[o] = e[o] + e[n + a] * r
}
},
},
]
)
})(),
Gv = '\\[\\]\\.:\\/',
jv = new RegExp('[' + Gv + ']', 'g'),
Qv = '[^' + Gv + ']',
qv = '[^' + Gv.replace('\\.', '') + ']',
Xv = new RegExp(
'^' +
/((?:WC+[\/:])*)/.source.replace('WC', Qv) +
/(WCOD+)?/.source.replace('WCOD', qv) +
/(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace('WC', Qv) +
/\.(WC+)(?:\[(.+)\])?/.source.replace('WC', Qv) +
'$'
),
Yv = ['material', 'materials', 'bones', 'map'],
Kv = (function () {
return T(
function e(t, n, r) {
A(this, e)
var i = r || Zv.parseTrackName(n)
;((this._targetGroup = t), (this._bindings = t.subscribe_(n, i)))
},
[
{
key: 'getValue',
value: function (e, t) {
this.bind()
var n = this._targetGroup.nCachedObjects_,
r = this._bindings[n]
void 0 !== r && r.getValue(e, t)
},
},
{
key: 'setValue',
value: function (e, t) {
for (
var n = this._bindings, r = this._targetGroup.nCachedObjects_, i = n.length;
r !== i;
++r
)
n[r].setValue(e, t)
},
},
{
key: 'bind',
value: function () {
for (
var e = this._bindings, t = this._targetGroup.nCachedObjects_, n = e.length;
t !== n;
++t
)
e[t].bind()
},
},
{
key: 'unbind',
value: function () {
for (
var e = this._bindings, t = this._targetGroup.nCachedObjects_, n = e.length;
t !== n;
++t
)
e[t].unbind()
},
},
]
)
})(),
Zv = (function () {
function e(t, n, r) {
;(A(this, e),
(this.path = n),
(this.parsedPath = r || e.parseTrackName(n)),
(this.node = e.findNode(t, this.parsedPath.nodeName)),
(this.rootNode = t),
(this.getValue = this._getValue_unbound),
(this.setValue = this._setValue_unbound))
}
return T(
e,
[
{ key: '_getValue_unavailable', value: function () {} },
{ key: '_setValue_unavailable', value: function () {} },
{
key: '_getValue_direct',
value: function (e, t) {
e[t] = this.targetObject[this.propertyName]
},
},
{
key: '_getValue_array',
value: function (e, t) {
for (var n = this.resolvedProperty, r = 0, i = n.length; r !== i; ++r)
e[t++] = n[r]
},
},
{
key: '_getValue_arrayElement',
value: function (e, t) {
e[t] = this.resolvedProperty[this.propertyIndex]
},
},
{
key: '_getValue_toArray',
value: function (e, t) {
this.resolvedProperty.toArray(e, t)
},
},
{
key: '_setValue_direct',
value: function (e, t) {
this.targetObject[this.propertyName] = e[t]
},
},
{
key: '_setValue_direct_setNeedsUpdate',
value: function (e, t) {
;((this.targetObject[this.propertyName] = e[t]),
(this.targetObject.needsUpdate = !0))
},
},
{
key: '_setValue_direct_setMatrixWorldNeedsUpdate',
value: function (e, t) {
;((this.targetObject[this.propertyName] = e[t]),
(this.targetObject.matrixWorldNeedsUpdate = !0))
},
},
{
key: '_setValue_array',
value: function (e, t) {
for (var n = this.resolvedProperty, r = 0, i = n.length; r !== i; ++r)
n[r] = e[t++]
},
},
{
key: '_setValue_array_setNeedsUpdate',
value: function (e, t) {
for (var n = this.resolvedProperty, r = 0, i = n.length; r !== i; ++r)
n[r] = e[t++]
this.targetObject.needsUpdate = !0
},
},
{
key: '_setValue_array_setMatrixWorldNeedsUpdate',
value: function (e, t) {
for (var n = this.resolvedProperty, r = 0, i = n.length; r !== i; ++r)
n[r] = e[t++]
this.targetObject.matrixWorldNeedsUpdate = !0
},
},
{
key: '_setValue_arrayElement',
value: function (e, t) {
this.resolvedProperty[this.propertyIndex] = e[t]
},
},
{
key: '_setValue_arrayElement_setNeedsUpdate',
value: function (e, t) {
;((this.resolvedProperty[this.propertyIndex] = e[t]),
(this.targetObject.needsUpdate = !0))
},
},
{
key: '_setValue_arrayElement_setMatrixWorldNeedsUpdate',
value: function (e, t) {
;((this.resolvedProperty[this.propertyIndex] = e[t]),
(this.targetObject.matrixWorldNeedsUpdate = !0))
},
},
{
key: '_setValue_fromArray',
value: function (e, t) {
this.resolvedProperty.fromArray(e, t)
},
},
{
key: '_setValue_fromArray_setNeedsUpdate',
value: function (e, t) {
;(this.resolvedProperty.fromArray(e, t), (this.targetObject.needsUpdate = !0))
},
},
{
key: '_setValue_fromArray_setMatrixWorldNeedsUpdate',
value: function (e, t) {
;(this.resolvedProperty.fromArray(e, t),
(this.targetObject.matrixWorldNeedsUpdate = !0))
},
},
{
key: '_getValue_unbound',
value: function (e, t) {
;(this.bind(), this.getValue(e, t))
},
},
{
key: '_setValue_unbound',
value: function (e, t) {
;(this.bind(), this.setValue(e, t))
},
},
{
key: 'bind',
value: function () {
var t = this.node,
n = this.parsedPath,
r = n.objectName,
i = n.propertyName,
a = n.propertyIndex
if (
(t || ((t = e.findNode(this.rootNode, n.nodeName)), (this.node = t)),
(this.getValue = this._getValue_unavailable),
(this.setValue = this._setValue_unavailable),
t)
) {
if (r) {
var o = n.objectIndex
switch (r) {
case 'materials':
if (!t.material)
return void console.error(
'THREE.PropertyBinding: Can not bind to material as node does not have a material.',
this
)
if (!t.material.materials)
return void console.error(
'THREE.PropertyBinding: Can not bind to material.materials as node.material does not have a materials array.',
this
)
t = t.material.materials
break
case 'bones':
if (!t.skeleton)
return void console.error(
'THREE.PropertyBinding: Can not bind to bones as node does not have a skeleton.',
this
)
t = t.skeleton.bones
for (var s = 0; s < t.length; s++)
if (t[s].name === o) {
o = s
break
}
break
case 'map':
if ('map' in t) {
t = t.map
break
}
if (!t.material)
return void console.error(
'THREE.PropertyBinding: Can not bind to material as node does not have a material.',
this
)
if (!t.material.map)
return void console.error(
'THREE.PropertyBinding: Can not bind to material.map as node.material does not have a map.',
this
)
t = t.material.map
break
default:
if (void 0 === t[r])
return void console.error(
'THREE.PropertyBinding: Can not bind to objectName of node undefined.',
this
)
t = t[r]
}
if (void 0 !== o) {
if (void 0 === t[o])
return void console.error(
'THREE.PropertyBinding: Trying to bind to objectIndex of objectName, but is undefined.',
this,
t
)
t = t[o]
}
}
var u = t[i]
if (void 0 !== u) {
var l = this.Versioning.None
;((this.targetObject = t),
!0 === t.isMaterial
? (l = this.Versioning.NeedsUpdate)
: !0 === t.isObject3D && (l = this.Versioning.MatrixWorldNeedsUpdate))
var c = this.BindingType.Direct
if (void 0 !== a) {
if ('morphTargetInfluences' === i) {
if (!t.geometry)
return void console.error(
'THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.',
this
)
if (!t.geometry.morphAttributes)
return void console.error(
'THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.morphAttributes.',
this
)
void 0 !== t.morphTargetDictionary[a] &&
(a = t.morphTargetDictionary[a])
}
;((c = this.BindingType.ArrayElement),
(this.resolvedProperty = u),
(this.propertyIndex = a))
} else
void 0 !== u.fromArray && void 0 !== u.toArray
? ((c = this.BindingType.HasFromToArray), (this.resolvedProperty = u))
: Array.isArray(u)
? ((c = this.BindingType.EntireArray), (this.resolvedProperty = u))
: (this.propertyName = i)
;((this.getValue = this.GetterByBindingType[c]),
(this.setValue = this.SetterByBindingTypeAndVersioning[c][l]))
} else {
var h = n.nodeName
console.error(
'THREE.PropertyBinding: Trying to update property for track: ' +
h +
'.' +
i +
" but it wasn't found.",
t
)
}
} else
console.warn(
'THREE.PropertyBinding: No target node found for track: ' +
this.path +
'.'
)
},
},
{
key: 'unbind',
value: function () {
;((this.node = null),
(this.getValue = this._getValue_unbound),
(this.setValue = this._setValue_unbound))
},
},
],
[
{
key: 'create',
value: function (t, n, r) {
return t && t.isAnimationObjectGroup
? new e.Composite(t, n, r)
: new e(t, n, r)
},
},
{
key: 'sanitizeNodeName',
value: function (e) {
return e.replace(/\s/g, '_').replace(jv, '')
},
},
{
key: 'parseTrackName',
value: function (e) {
var t = Xv.exec(e)
if (null === t)
throw new Error('PropertyBinding: Cannot parse trackName: ' + e)
var n = {
nodeName: t[2],
objectName: t[3],
objectIndex: t[4],
propertyName: t[5],
propertyIndex: t[6],
},
r = n.nodeName && n.nodeName.lastIndexOf('.')
if (void 0 !== r && -1 !== r) {
var i = n.nodeName.substring(r + 1)
;-1 !== Yv.indexOf(i) &&
((n.nodeName = n.nodeName.substring(0, r)), (n.objectName = i))
}
if (null === n.propertyName || 0 === n.propertyName.length)
throw new Error(
'PropertyBinding: can not parse propertyName from trackName: ' + e
)
return n
},
},
{
key: 'findNode',
value: function (e, t) {
if (
void 0 === t ||
'' === t ||
'.' === t ||
-1 === t ||
t === e.name ||
t === e.uuid
)
return e
if (e.skeleton) {
var n = e.skeleton.getBoneByName(t)
if (void 0 !== n) return n
}
if (e.children) {
var r = function (e) {
for (var n = 0; n < e.length; n++) {
var i = e[n]
if (i.name === t || i.uuid === t) return i
var a = r(i.children)
if (a) return a
}
return null
},
i = r(e.children)
if (i) return i
}
return null
},
},
]
)
})()
;((Zv.Composite = Kv),
(Zv.prototype.BindingType = {
Direct: 0,
EntireArray: 1,
ArrayElement: 2,
HasFromToArray: 3,
}),
(Zv.prototype.Versioning = { None: 0, NeedsUpdate: 1, MatrixWorldNeedsUpdate: 2 }),
(Zv.prototype.GetterByBindingType = [
Zv.prototype._getValue_direct,
Zv.prototype._getValue_array,
Zv.prototype._getValue_arrayElement,
Zv.prototype._getValue_toArray,
]),
(Zv.prototype.SetterByBindingTypeAndVersioning = [
[
Zv.prototype._setValue_direct,
Zv.prototype._setValue_direct_setNeedsUpdate,
Zv.prototype._setValue_direct_setMatrixWorldNeedsUpdate,
],
[
Zv.prototype._setValue_array,
Zv.prototype._setValue_array_setNeedsUpdate,
Zv.prototype._setValue_array_setMatrixWorldNeedsUpdate,
],
[
Zv.prototype._setValue_arrayElement,
Zv.prototype._setValue_arrayElement_setNeedsUpdate,
Zv.prototype._setValue_arrayElement_setMatrixWorldNeedsUpdate,
],
[
Zv.prototype._setValue_fromArray,
Zv.prototype._setValue_fromArray_setNeedsUpdate,
Zv.prototype._setValue_fromArray_setMatrixWorldNeedsUpdate,
],
]))
var Jv = (function () {
return T(
function e(t, n) {
var r = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : null,
i = arguments.length > 3 && void 0 !== arguments[3] ? arguments[3] : n.blendMode
;(A(this, e),
(this._mixer = t),
(this._clip = n),
(this._localRoot = r),
(this.blendMode = i))
for (
var a = n.tracks,
o = a.length,
s = new Array(o),
u = { endingStart: pc, endingEnd: pc },
l = 0;
l !== o;
++l
) {
var c = a[l].createInterpolant(null)
;((s[l] = c), (c.settings = u))
}
;((this._interpolantSettings = u),
(this._interpolants = s),
(this._propertyBindings = new Array(o)),
(this._cacheIndex = null),
(this._byClipCacheIndex = null),
(this._timeScaleInterpolant = null),
(this._weightInterpolant = null),
(this.loop = cc),
(this._loopCount = -1),
(this._startTime = null),
(this.time = 0),
(this.timeScale = 1),
(this._effectiveTimeScale = 1),
(this.weight = 1),
(this._effectiveWeight = 1),
(this.repetitions = 1 / 0),
(this.paused = !1),
(this.enabled = !0),
(this.clampWhenFinished = !1),
(this.zeroSlopeAtStart = !0),
(this.zeroSlopeAtEnd = !0))
},
[
{
key: 'play',
value: function () {
return (this._mixer._activateAction(this), this)
},
},
{
key: 'stop',
value: function () {
return (this._mixer._deactivateAction(this), this.reset())
},
},
{
key: 'reset',
value: function () {
return (
(this.paused = !1),
(this.enabled = !0),
(this.time = 0),
(this._loopCount = -1),
(this._startTime = null),
this.stopFading().stopWarping()
)
},
},
{
key: 'isRunning',
value: function () {
return (
this.enabled &&
!this.paused &&
0 !== this.timeScale &&
null === this._startTime &&
this._mixer._isActiveAction(this)
)
},
},
{
key: 'isScheduled',
value: function () {
return this._mixer._isActiveAction(this)
},
},
{
key: 'startAt',
value: function (e) {
return ((this._startTime = e), this)
},
},
{
key: 'setLoop',
value: function (e, t) {
return ((this.loop = e), (this.repetitions = t), this)
},
},
{
key: 'setEffectiveWeight',
value: function (e) {
return (
(this.weight = e),
(this._effectiveWeight = this.enabled ? e : 0),
this.stopFading()
)
},
},
{
key: 'getEffectiveWeight',
value: function () {
return this._effectiveWeight
},
},
{
key: 'fadeIn',
value: function (e) {
return this._scheduleFading(e, 0, 1)
},
},
{
key: 'fadeOut',
value: function (e) {
return this._scheduleFading(e, 1, 0)
},
},
{
key: 'crossFadeFrom',
value: function (e, t, n) {
if ((e.fadeOut(t), this.fadeIn(t), n)) {
var r = this._clip.duration,
i = e._clip.duration,
a = i / r,
o = r / i
;(e.warp(1, a, t), this.warp(o, 1, t))
}
return this
},
},
{
key: 'crossFadeTo',
value: function (e, t, n) {
return e.crossFadeFrom(this, t, n)
},
},
{
key: 'stopFading',
value: function () {
var e = this._weightInterpolant
return (
null !== e &&
((this._weightInterpolant = null),
this._mixer._takeBackControlInterpolant(e)),
this
)
},
},
{
key: 'setEffectiveTimeScale',
value: function (e) {
return (
(this.timeScale = e),
(this._effectiveTimeScale = this.paused ? 0 : e),
this.stopWarping()
)
},
},
{
key: 'getEffectiveTimeScale',
value: function () {
return this._effectiveTimeScale
},
},
{
key: 'setDuration',
value: function (e) {
return ((this.timeScale = this._clip.duration / e), this.stopWarping())
},
},
{
key: 'syncWith',
value: function (e) {
return (
(this.time = e.time),
(this.timeScale = e.timeScale),
this.stopWarping()
)
},
},
{
key: 'halt',
value: function (e) {
return this.warp(this._effectiveTimeScale, 0, e)
},
},
{
key: 'warp',
value: function (e, t, n) {
var r = this._mixer,
i = r.time,
a = this.timeScale,
o = this._timeScaleInterpolant
null === o &&
((o = r._lendControlInterpolant()), (this._timeScaleInterpolant = o))
var s = o.parameterPositions,
u = o.sampleValues
return ((s[0] = i), (s[1] = i + n), (u[0] = e / a), (u[1] = t / a), this)
},
},
{
key: 'stopWarping',
value: function () {
var e = this._timeScaleInterpolant
return (
null !== e &&
((this._timeScaleInterpolant = null),
this._mixer._takeBackControlInterpolant(e)),
this
)
},
},
{
key: 'getMixer',
value: function () {
return this._mixer
},
},
{
key: 'getClip',
value: function () {
return this._clip
},
},
{
key: 'getRoot',
value: function () {
return this._localRoot || this._mixer._root
},
},
{
key: '_update',
value: function (e, t, n, r) {
if (this.enabled) {
var i = this._startTime
if (null !== i) {
var a = (e - i) * n
a < 0 || 0 === n ? (t = 0) : ((this._startTime = null), (t = n * a))
}
t *= this._updateTimeScale(e)
var o = this._updateTime(t),
s = this._updateWeight(e)
if (s > 0) {
var u = this._interpolants,
l = this._propertyBindings
if (2501 === this.blendMode)
for (var c = 0, h = u.length; c !== h; ++c)
(u[c].evaluate(o), l[c].accumulateAdditive(s))
else
for (var d = 0, f = u.length; d !== f; ++d)
(u[d].evaluate(o), l[d].accumulate(r, s))
}
} else this._updateWeight(e)
},
},
{
key: '_updateWeight',
value: function (e) {
var t = 0
if (this.enabled) {
t = this.weight
var n = this._weightInterpolant
if (null !== n) {
var r = n.evaluate(e)[0]
;((t *= r),
e > n.parameterPositions[1] &&
(this.stopFading(), 0 === r && (this.enabled = !1)))
}
}
return ((this._effectiveWeight = t), t)
},
},
{
key: '_updateTimeScale',
value: function (e) {
var t = 0
if (!this.paused) {
t = this.timeScale
var n = this._timeScaleInterpolant
if (null !== n)
((t *= n.evaluate(e)[0]),
e > n.parameterPositions[1] &&
(this.stopWarping(),
0 === t ? (this.paused = !0) : (this.timeScale = t)))
}
return ((this._effectiveTimeScale = t), t)
},
},
{
key: '_updateTime',
value: function (e) {
var t = this._clip.duration,
n = this.loop,
r = this.time + e,
i = this._loopCount,
a = 2202 === n
if (0 === e) return -1 === i || !a || 1 & ~i ? r : t - r
if (n === lc) {
;-1 === i && ((this._loopCount = 0), this._setEndings(!0, !0, !1))
e: {
if (r >= t) r = t
else {
if (!(r < 0)) {
this.time = r
break e
}
r = 0
}
;(this.clampWhenFinished ? (this.paused = !0) : (this.enabled = !1),
(this.time = r),
this._mixer.dispatchEvent({
type: 'finished',
action: this,
direction: e < 0 ? -1 : 1,
}))
}
} else {
if (
(-1 === i &&
(e >= 0
? ((i = 0), this._setEndings(!0, 0 === this.repetitions, a))
: this._setEndings(0 === this.repetitions, !0, a)),
r >= t || r < 0)
) {
var o = Math.floor(r / t)
;((r -= t * o), (i += Math.abs(o)))
var s = this.repetitions - i
if (s <= 0)
(this.clampWhenFinished ? (this.paused = !0) : (this.enabled = !1),
(r = e > 0 ? t : 0),
(this.time = r),
this._mixer.dispatchEvent({
type: 'finished',
action: this,
direction: e > 0 ? 1 : -1,
}))
else {
if (1 === s) {
var u = e < 0
this._setEndings(u, !u, a)
} else this._setEndings(!1, !1, a)
;((this._loopCount = i),
(this.time = r),
this._mixer.dispatchEvent({
type: 'loop',
action: this,
loopDelta: o,
}))
}
} else this.time = r
if (a && !(1 & ~i)) return t - r
}
return r
},
},
{
key: '_setEndings',
value: function (e, t, n) {
var r = this._interpolantSettings
n
? ((r.endingStart = vc), (r.endingEnd = vc))
: ((r.endingStart = e ? (this.zeroSlopeAtStart ? vc : pc) : mc),
(r.endingEnd = t ? (this.zeroSlopeAtEnd ? vc : pc) : mc))
},
},
{
key: '_scheduleFading',
value: function (e, t, n) {
var r = this._mixer,
i = r.time,
a = this._weightInterpolant
null === a &&
((a = r._lendControlInterpolant()), (this._weightInterpolant = a))
var o = a.parameterPositions,
s = a.sampleValues
return ((o[0] = i), (s[0] = t), (o[1] = i + e), (s[1] = n), this)
},
},
]
)
})(),
$v = new Float32Array(1),
em = (function (e) {
function t(e) {
var n
return (
A(this, t),
((n = y(this, t))._root = e),
n._initMemoryManager(),
(n._accuIndex = 0),
(n.time = 0),
(n.timeScale = 1),
n
)
}
return (
x(t, e),
T(t, [
{
key: '_bindAction',
value: function (e, t) {
var n = e._localRoot || this._root,
r = e._clip.tracks,
i = r.length,
a = e._propertyBindings,
o = e._interpolants,
s = n.uuid,
u = this._bindingsByRootAndName,
l = u[s]
void 0 === l && ((l = {}), (u[s] = l))
for (var c = 0; c !== i; ++c) {
var h = r[c],
d = h.name,
f = l[d]
if (void 0 !== f) (++f.referenceCount, (a[c] = f))
else {
if (void 0 !== (f = a[c])) {
null === f._cacheIndex &&
(++f.referenceCount, this._addInactiveBinding(f, s, d))
continue
}
var p = t && t._propertyBindings[c].binding.parsedPath
;(++(f = new Wv(Zv.create(n, d, p), h.ValueTypeName, h.getValueSize()))
.referenceCount,
this._addInactiveBinding(f, s, d),
(a[c] = f))
}
o[c].resultBuffer = f.buffer
}
},
},
{
key: '_activateAction',
value: function (e) {
if (!this._isActiveAction(e)) {
if (null === e._cacheIndex) {
var t = (e._localRoot || this._root).uuid,
n = e._clip.uuid,
r = this._actionsByClip[n]
;(this._bindAction(e, r && r.knownActions[0]),
this._addInactiveAction(e, n, t))
}
for (var i = e._propertyBindings, a = 0, o = i.length; a !== o; ++a) {
var s = i[a]
0 === s.useCount++ && (this._lendBinding(s), s.saveOriginalState())
}
this._lendAction(e)
}
},
},
{
key: '_deactivateAction',
value: function (e) {
if (this._isActiveAction(e)) {
for (var t = e._propertyBindings, n = 0, r = t.length; n !== r; ++n) {
var i = t[n]
0 === --i.useCount && (i.restoreOriginalState(), this._takeBackBinding(i))
}
this._takeBackAction(e)
}
},
},
{
key: '_initMemoryManager',
value: function () {
;((this._actions = []),
(this._nActiveActions = 0),
(this._actionsByClip = {}),
(this._bindings = []),
(this._nActiveBindings = 0),
(this._bindingsByRootAndName = {}),
(this._controlInterpolants = []),
(this._nActiveControlInterpolants = 0))
var e = this
this.stats = {
actions: {
get total() {
return e._actions.length
},
get inUse() {
return e._nActiveActions
},
},
bindings: {
get total() {
return e._bindings.length
},
get inUse() {
return e._nActiveBindings
},
},
controlInterpolants: {
get total() {
return e._controlInterpolants.length
},
get inUse() {
return e._nActiveControlInterpolants
},
},
}
},
},
{
key: '_isActiveAction',
value: function (e) {
var t = e._cacheIndex
return null !== t && t < this._nActiveActions
},
},
{
key: '_addInactiveAction',
value: function (e, t, n) {
var r = this._actions,
i = this._actionsByClip,
a = i[t]
if (void 0 === a)
((a = { knownActions: [e], actionByRoot: {} }),
(e._byClipCacheIndex = 0),
(i[t] = a))
else {
var o = a.knownActions
;((e._byClipCacheIndex = o.length), o.push(e))
}
;((e._cacheIndex = r.length), r.push(e), (a.actionByRoot[n] = e))
},
},
{
key: '_removeInactiveAction',
value: function (e) {
var t = this._actions,
n = t[t.length - 1],
r = e._cacheIndex
;((n._cacheIndex = r), (t[r] = n), t.pop(), (e._cacheIndex = null))
var i = e._clip.uuid,
a = this._actionsByClip,
o = a[i],
s = o.knownActions,
u = s[s.length - 1],
l = e._byClipCacheIndex
;((u._byClipCacheIndex = l),
(s[l] = u),
s.pop(),
(e._byClipCacheIndex = null),
delete o.actionByRoot[(e._localRoot || this._root).uuid],
0 === s.length && delete a[i],
this._removeInactiveBindingsForAction(e))
},
},
{
key: '_removeInactiveBindingsForAction',
value: function (e) {
for (var t = e._propertyBindings, n = 0, r = t.length; n !== r; ++n) {
var i = t[n]
0 === --i.referenceCount && this._removeInactiveBinding(i)
}
},
},
{
key: '_lendAction',
value: function (e) {
var t = this._actions,
n = e._cacheIndex,
r = this._nActiveActions++,
i = t[r]
;((e._cacheIndex = r), (t[r] = e), (i._cacheIndex = n), (t[n] = i))
},
},
{
key: '_takeBackAction',
value: function (e) {
var t = this._actions,
n = e._cacheIndex,
r = --this._nActiveActions,
i = t[r]
;((e._cacheIndex = r), (t[r] = e), (i._cacheIndex = n), (t[n] = i))
},
},
{
key: '_addInactiveBinding',
value: function (e, t, n) {
var r = this._bindingsByRootAndName,
i = this._bindings,
a = r[t]
;(void 0 === a && ((a = {}), (r[t] = a)),
(a[n] = e),
(e._cacheIndex = i.length),
i.push(e))
},
},
{
key: '_removeInactiveBinding',
value: function (e) {
var t = this._bindings,
n = e.binding,
r = n.rootNode.uuid,
i = n.path,
a = this._bindingsByRootAndName,
o = a[r],
s = t[t.length - 1],
u = e._cacheIndex
;((s._cacheIndex = u),
(t[u] = s),
t.pop(),
delete o[i],
0 === Object.keys(o).length && delete a[r])
},
},
{
key: '_lendBinding',
value: function (e) {
var t = this._bindings,
n = e._cacheIndex,
r = this._nActiveBindings++,
i = t[r]
;((e._cacheIndex = r), (t[r] = e), (i._cacheIndex = n), (t[n] = i))
},
},
{
key: '_takeBackBinding',
value: function (e) {
var t = this._bindings,
n = e._cacheIndex,
r = --this._nActiveBindings,
i = t[r]
;((e._cacheIndex = r), (t[r] = e), (i._cacheIndex = n), (t[n] = i))
},
},
{
key: '_lendControlInterpolant',
value: function () {
var e = this._controlInterpolants,
t = this._nActiveControlInterpolants++,
n = e[t]
return (
void 0 === n &&
(((n = new tv(
new Float32Array(2),
new Float32Array(2),
1,
$v
)).__cacheIndex = t),
(e[t] = n)),
n
)
},
},
{
key: '_takeBackControlInterpolant',
value: function (e) {
var t = this._controlInterpolants,
n = e.__cacheIndex,
r = --this._nActiveControlInterpolants,
i = t[r]
;((e.__cacheIndex = r), (t[r] = e), (i.__cacheIndex = n), (t[n] = i))
},
},
{
key: 'clipAction',
value: function (e, t, n) {
var r = t || this._root,
i = r.uuid,
a = 'string' == typeof e ? hv.findByName(r, e) : e,
o = null !== a ? a.uuid : e,
s = this._actionsByClip[o],
u = null
if ((void 0 === n && (n = null !== a ? a.blendMode : gc), void 0 !== s)) {
var l = s.actionByRoot[i]
if (void 0 !== l && l.blendMode === n) return l
;((u = s.knownActions[0]), null === a && (a = u._clip))
}
if (null === a) return null
var c = new Jv(this, a, t, n)
return (this._bindAction(c, u), this._addInactiveAction(c, o, i), c)
},
},
{
key: 'existingAction',
value: function (e, t) {
var n = t || this._root,
r = n.uuid,
i = 'string' == typeof e ? hv.findByName(n, e) : e,
a = i ? i.uuid : e,
o = this._actionsByClip[a]
return (void 0 !== o && o.actionByRoot[r]) || null
},
},
{
key: 'stopAllAction',
value: function () {
for (var e = this._actions, t = this._nActiveActions - 1; t >= 0; --t)
e[t].stop()
return this
},
},
{
key: 'update',
value: function (e) {
e *= this.timeScale
for (
var t = this._actions,
n = this._nActiveActions,
r = (this.time += e),
i = Math.sign(e),
a = (this._accuIndex ^= 1),
o = 0;
o !== n;
++o
) {
t[o]._update(r, e, i, a)
}
for (var s = this._bindings, u = this._nActiveBindings, l = 0; l !== u; ++l)
s[l].apply(a)
return this
},
},
{
key: 'setTime',
value: function (e) {
this.time = 0
for (var t = 0; t < this._actions.length; t++) this._actions[t].time = 0
return this.update(e)
},
},
{
key: 'getRoot',
value: function () {
return this._root
},
},
{
key: 'uncacheClip',
value: function (e) {
var t = this._actions,
n = e.uuid,
r = this._actionsByClip,
i = r[n]
if (void 0 !== i) {
for (var a = i.knownActions, o = 0, s = a.length; o !== s; ++o) {
var u = a[o]
this._deactivateAction(u)
var l = u._cacheIndex,
c = t[t.length - 1]
;((u._cacheIndex = null),
(u._byClipCacheIndex = null),
(c._cacheIndex = l),
(t[l] = c),
t.pop(),
this._removeInactiveBindingsForAction(u))
}
delete r[n]
}
},
},
{
key: 'uncacheRoot',
value: function (e) {
var t = e.uuid,
n = this._actionsByClip
for (var r in n) {
var i = n[r].actionByRoot[t]
void 0 !== i && (this._deactivateAction(i), this._removeInactiveAction(i))
}
var a = this._bindingsByRootAndName[t]
if (void 0 !== a)
for (var o in a) {
var s = a[o]
;(s.restoreOriginalState(), this._removeInactiveBinding(s))
}
},
},
{
key: 'uncacheAction',
value: function (e, t) {
var n = this.existingAction(e, t)
null !== n && (this._deactivateAction(n), this._removeInactiveAction(n))
},
},
])
)
})(kc),
tm = (function (e) {
function t(e, n) {
var r,
i = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : 1
return (
A(this, t),
((r = y(this, t, [e, n])).isInstancedInterleavedBuffer = !0),
(r.meshPerAttribute = i),
r
)
}
return (
x(t, e),
T(t, [
{
key: 'copy',
value: function (e) {
return (
n(t, 'copy', this, 3)([e]),
(this.meshPerAttribute = e.meshPerAttribute),
this
)
},
},
{
key: 'clone',
value: function (e) {
var r = n(t, 'clone', this, 3)([e])
return ((r.meshPerAttribute = this.meshPerAttribute), r)
},
},
{
key: 'toJSON',
value: function (e) {
var r = n(t, 'toJSON', this, 3)([e])
return (
(r.isInstancedInterleavedBuffer = !0),
(r.meshPerAttribute = this.meshPerAttribute),
r
)
},
},
])
)
})(Bf),
nm = (function () {
return T(
function e() {
var t = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : 1,
n = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : 0,
r = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : 0
return (A(this, e), (this.radius = t), (this.phi = n), (this.theta = r), this)
},
[
{
key: 'set',
value: function (e, t, n) {
return ((this.radius = e), (this.phi = t), (this.theta = n), this)
},
},
{
key: 'copy',
value: function (e) {
return (
(this.radius = e.radius),
(this.phi = e.phi),
(this.theta = e.theta),
this
)
},
},
{
key: 'makeSafe',
value: function () {
var e = 1e-6
return ((this.phi = Dc(this.phi, e, Math.PI - e)), this)
},
},
{
key: 'setFromVector3',
value: function (e) {
return this.setFromCartesianCoords(e.x, e.y, e.z)
},
},
{
key: 'setFromCartesianCoords',
value: function (e, t, n) {
return (
(this.radius = Math.sqrt(e * e + t * t + n * n)),
0 === this.radius
? ((this.theta = 0), (this.phi = 0))
: ((this.theta = Math.atan2(e, n)),
(this.phi = Math.acos(Dc(t / this.radius, -1, 1)))),
this
)
},
},
{
key: 'clone',
value: function () {
return new this.constructor().copy(this)
},
},
]
)
})(),
rm = (function () {
return T(
function e(t, n, r, i) {
;(A(this, e),
(e.prototype.isMatrix2 = !0),
(this.elements = [1, 0, 0, 1]),
void 0 !== t && this.set(t, n, r, i))
},
[
{
key: 'identity',
value: function () {
return (this.set(1, 0, 0, 1), this)
},
},
{
key: 'fromArray',
value: function (e) {
for (
var t = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : 0,
n = 0;
n < 4;
n++
)
this.elements[n] = e[n + t]
return this
},
},
{
key: 'set',
value: function (e, t, n, r) {
var i = this.elements
return ((i[0] = e), (i[2] = t), (i[1] = n), (i[3] = r), this)
},
},
]
)
})()
function im(e, t, n, r) {
var i = (function (e) {
switch (e) {
case dl:
case fl:
return { byteLength: 1, components: 1 }
case vl:
case pl:
case _l:
return { byteLength: 2, components: 1 }
case bl:
case xl:
return { byteLength: 2, components: 4 }
case gl:
case ml:
case yl:
return { byteLength: 4, components: 1 }
case Al:
return { byteLength: 4, components: 3 }
}
throw new Error('Unknown texture type '.concat(e, '.'))
})(r)
switch (n) {
case 1021:
case 1024:
return e * t
case 1025:
return e * t * 2
case El:
case Cl:
return ((e * t) / i.components) * i.byteLength
case kl:
case Rl:
return ((e * t * 2) / i.components) * i.byteLength
case 1022:
return ((e * t * 3) / i.components) * i.byteLength
case wl:
case Il:
return ((e * t * 4) / i.components) * i.byteLength
case Nl:
case Pl:
return Math.floor((e + 3) / 4) * Math.floor((t + 3) / 4) * 8
case Ll:
case Dl:
return Math.floor((e + 3) / 4) * Math.floor((t + 3) / 4) * 16
case Fl:
case Ul:
return (Math.max(e, 16) * Math.max(t, 8)) / 4
case Ol:
case Bl:
return (Math.max(e, 8) * Math.max(t, 8)) / 2
case zl:
case Vl:
return Math.floor((e + 3) / 4) * Math.floor((t + 3) / 4) * 8
case Hl:
case Wl:
return Math.floor((e + 3) / 4) * Math.floor((t + 3) / 4) * 16
case Gl:
return Math.floor((e + 4) / 5) * Math.floor((t + 3) / 4) * 16
case jl:
return Math.floor((e + 4) / 5) * Math.floor((t + 4) / 5) * 16
case Ql:
return Math.floor((e + 5) / 6) * Math.floor((t + 4) / 5) * 16
case ql:
return Math.floor((e + 5) / 6) * Math.floor((t + 5) / 6) * 16
case Xl:
return Math.floor((e + 7) / 8) * Math.floor((t + 4) / 5) * 16
case Yl:
return Math.floor((e + 7) / 8) * Math.floor((t + 5) / 6) * 16
case Kl:
return Math.floor((e + 7) / 8) * Math.floor((t + 7) / 8) * 16
case Zl:
return Math.floor((e + 9) / 10) * Math.floor((t + 4) / 5) * 16
case Jl:
return Math.floor((e + 9) / 10) * Math.floor((t + 5) / 6) * 16
case $l:
return Math.floor((e + 9) / 10) * Math.floor((t + 7) / 8) * 16
case ec:
return Math.floor((e + 9) / 10) * Math.floor((t + 9) / 10) * 16
case tc:
return Math.floor((e + 11) / 12) * Math.floor((t + 9) / 10) * 16
case nc:
return Math.floor((e + 11) / 12) * Math.floor((t + 11) / 12) * 16
case rc:
case ic:
case ac:
return Math.ceil(e / 4) * Math.ceil(t / 4) * 16
case 36283:
case oc:
return Math.ceil(e / 4) * Math.ceil(t / 4) * 8
case sc:
case uc:
return Math.ceil(e / 4) * Math.ceil(t / 4) * 16
}
throw new Error('Unable to determine texture byte length for '.concat(n, ' format.'))
}
/**
* @license
* Copyright 2010-2025 Three.js Authors
* SPDX-License-Identifier: MIT
*/
function am() {
var e = null,
t = !1,
n = null,
r = null
function i(t, a) {
;(n(t, a), (r = e.requestAnimationFrame(i)))
}
return {
start: function () {
!0 !== t && null !== n && ((r = e.requestAnimationFrame(i)), (t = !0))
},
stop: function () {
;(e.cancelAnimationFrame(r), (t = !1))
},
setAnimationLoop: function (e) {
n = e
},
setContext: function (t) {
e = t
},
}
}
function om(e) {
var t = new WeakMap()
return {
get: function (e) {
return (e.isInterleavedBufferAttribute && (e = e.data), t.get(e))
},
remove: function (n) {
n.isInterleavedBufferAttribute && (n = n.data)
var r = t.get(n)
r && (e.deleteBuffer(r.buffer), t.delete(n))
},
update: function (n, r) {
if ((n.isInterleavedBufferAttribute && (n = n.data), n.isGLBufferAttribute)) {
var i = t.get(n)
;(!i || i.version < n.version) &&
t.set(n, {
buffer: n.buffer,
type: n.type,
bytesPerElement: n.elementSize,
version: n.version,
})
} else {
var a = t.get(n)
if (void 0 === a)
t.set(
n,
(function (t, n) {
var r,
i = t.array,
a = t.usage,
o = i.byteLength,
s = e.createBuffer()
if (
(e.bindBuffer(n, s),
e.bufferData(n, i, a),
t.onUploadCallback(),
i instanceof Float32Array)
)
r = e.FLOAT
else if (i instanceof Uint16Array)
r = t.isFloat16BufferAttribute ? e.HALF_FLOAT : e.UNSIGNED_SHORT
else if (i instanceof Int16Array) r = e.SHORT
else if (i instanceof Uint32Array) r = e.UNSIGNED_INT
else if (i instanceof Int32Array) r = e.INT
else if (i instanceof Int8Array) r = e.BYTE
else if (i instanceof Uint8Array) r = e.UNSIGNED_BYTE
else {
if (!(i instanceof Uint8ClampedArray))
throw new Error(
'THREE.WebGLAttributes: Unsupported buffer data format: ' + i
)
r = e.UNSIGNED_BYTE
}
return {
buffer: s,
type: r,
bytesPerElement: i.BYTES_PER_ELEMENT,
version: t.version,
size: o,
}
})(n, r)
)
else if (a.version < n.version) {
if (a.size !== n.array.byteLength)
throw new Error(
"THREE.WebGLAttributes: The size of the buffer attribute's array buffer does not match the original size. Resizing buffer attributes is not supported."
)
;(!(function (t, n, r) {
var i = n.array,
a = n.updateRanges
if ((e.bindBuffer(r, t), 0 === a.length)) e.bufferSubData(r, 0, i)
else {
a.sort(function (e, t) {
return e.start - t.start
})
for (var o = 0, s = 1; s < a.length; s++) {
var u = a[o],
l = a[s]
l.start <= u.start + u.count + 1
? (u.count = Math.max(u.count, l.start + l.count - u.start))
: (a[++o] = l)
}
a.length = o + 1
for (var c = 0, h = a.length; c < h; c++) {
var d = a[c]
e.bufferSubData(r, d.start * i.BYTES_PER_ELEMENT, i, d.start, d.count)
}
n.clearUpdateRanges()
}
n.onUploadCallback()
})(a.buffer, n, r),
(a.version = n.version))
}
}
},
}
}
;('undefined' != typeof __THREE_DEVTOOLS__ &&
__THREE_DEVTOOLS__.dispatchEvent(
new CustomEvent('register', { detail: { revision: Wu } })
),
'undefined' != typeof window &&
(window.__THREE__
? console.warn('WARNING: Multiple instances of Three.js being imported.')
: (window.__THREE__ = Wu)))
var sm = {
alphahash_fragment:
'#ifdef USE_ALPHAHASH\n\tif ( diffuseColor.a < getAlphaHashThreshold( vPosition ) ) discard;\n#endif',
alphahash_pars_fragment:
'#ifdef USE_ALPHAHASH\n\tconst float ALPHA_HASH_SCALE = 0.05;\n\tfloat hash2D( vec2 value ) {\n\t\treturn fract( 1.0e4 * sin( 17.0 * value.x + 0.1 * value.y ) * ( 0.1 + abs( sin( 13.0 * value.y + value.x ) ) ) );\n\t}\n\tfloat hash3D( vec3 value ) {\n\t\treturn hash2D( vec2( hash2D( value.xy ), value.z ) );\n\t}\n\tfloat getAlphaHashThreshold( vec3 position ) {\n\t\tfloat maxDeriv = max(\n\t\t\tlength( dFdx( position.xyz ) ),\n\t\t\tlength( dFdy( position.xyz ) )\n\t\t);\n\t\tfloat pixScale = 1.0 / ( ALPHA_HASH_SCALE * maxDeriv );\n\t\tvec2 pixScales = vec2(\n\t\t\texp2( floor( log2( pixScale ) ) ),\n\t\t\texp2( ceil( log2( pixScale ) ) )\n\t\t);\n\t\tvec2 alpha = vec2(\n\t\t\thash3D( floor( pixScales.x * position.xyz ) ),\n\t\t\thash3D( floor( pixScales.y * position.xyz ) )\n\t\t);\n\t\tfloat lerpFactor = fract( log2( pixScale ) );\n\t\tfloat x = ( 1.0 - lerpFactor ) * alpha.x + lerpFactor * alpha.y;\n\t\tfloat a = min( lerpFactor, 1.0 - lerpFactor );\n\t\tvec3 cases = vec3(\n\t\t\tx * x / ( 2.0 * a * ( 1.0 - a ) ),\n\t\t\t( x - 0.5 * a ) / ( 1.0 - a ),\n\t\t\t1.0 - ( ( 1.0 - x ) * ( 1.0 - x ) / ( 2.0 * a * ( 1.0 - a ) ) )\n\t\t);\n\t\tfloat threshold = ( x < ( 1.0 - a ) )\n\t\t\t? ( ( x < a ) ? cases.x : cases.y )\n\t\t\t: cases.z;\n\t\treturn clamp( threshold , 1.0e-6, 1.0 );\n\t}\n#endif',
alphamap_fragment:
'#ifdef USE_ALPHAMAP\n\tdiffuseColor.a *= texture2D( alphaMap, vAlphaMapUv ).g;\n#endif',
alphamap_pars_fragment: '#ifdef USE_ALPHAMAP\n\tuniform sampler2D alphaMap;\n#endif',
alphatest_fragment:
'#ifdef USE_ALPHATEST\n\t#ifdef ALPHA_TO_COVERAGE\n\tdiffuseColor.a = smoothstep( alphaTest, alphaTest + fwidth( diffuseColor.a ), diffuseColor.a );\n\tif ( diffuseColor.a == 0.0 ) discard;\n\t#else\n\tif ( diffuseColor.a < alphaTest ) discard;\n\t#endif\n#endif',
alphatest_pars_fragment: '#ifdef USE_ALPHATEST\n\tuniform float alphaTest;\n#endif',
aomap_fragment:
'#ifdef USE_AOMAP\n\tfloat ambientOcclusion = ( texture2D( aoMap, vAoMapUv ).r - 1.0 ) * aoMapIntensity + 1.0;\n\treflectedLight.indirectDiffuse *= ambientOcclusion;\n\t#if defined( USE_CLEARCOAT ) \n\t\tclearcoatSpecularIndirect *= ambientOcclusion;\n\t#endif\n\t#if defined( USE_SHEEN ) \n\t\tsheenSpecularIndirect *= ambientOcclusion;\n\t#endif\n\t#if defined( USE_ENVMAP ) && defined( STANDARD )\n\t\tfloat dotNV = saturate( dot( geometryNormal, geometryViewDir ) );\n\t\treflectedLight.indirectSpecular *= computeSpecularOcclusion( dotNV, ambientOcclusion, material.roughness );\n\t#endif\n#endif',
aomap_pars_fragment:
'#ifdef USE_AOMAP\n\tuniform sampler2D aoMap;\n\tuniform float aoMapIntensity;\n#endif',
batching_pars_vertex:
'#ifdef USE_BATCHING\n\t#if ! defined( GL_ANGLE_multi_draw )\n\t#define gl_DrawID _gl_DrawID\n\tuniform int _gl_DrawID;\n\t#endif\n\tuniform highp sampler2D batchingTexture;\n\tuniform highp usampler2D batchingIdTexture;\n\tmat4 getBatchingMatrix( const in float i ) {\n\t\tint size = textureSize( batchingTexture, 0 ).x;\n\t\tint j = int( i ) * 4;\n\t\tint x = j % size;\n\t\tint y = j / size;\n\t\tvec4 v1 = texelFetch( batchingTexture, ivec2( x, y ), 0 );\n\t\tvec4 v2 = texelFetch( batchingTexture, ivec2( x + 1, y ), 0 );\n\t\tvec4 v3 = texelFetch( batchingTexture, ivec2( x + 2, y ), 0 );\n\t\tvec4 v4 = texelFetch( batchingTexture, ivec2( x + 3, y ), 0 );\n\t\treturn mat4( v1, v2, v3, v4 );\n\t}\n\tfloat getIndirectIndex( const in int i ) {\n\t\tint size = textureSize( batchingIdTexture, 0 ).x;\n\t\tint x = i % size;\n\t\tint y = i / size;\n\t\treturn float( texelFetch( batchingIdTexture, ivec2( x, y ), 0 ).r );\n\t}\n#endif\n#ifdef USE_BATCHING_COLOR\n\tuniform sampler2D batchingColorTexture;\n\tvec3 getBatchingColor( const in float i ) {\n\t\tint size = textureSize( batchingColorTexture, 0 ).x;\n\t\tint j = int( i );\n\t\tint x = j % size;\n\t\tint y = j / size;\n\t\treturn texelFetch( batchingColorTexture, ivec2( x, y ), 0 ).rgb;\n\t}\n#endif',
batching_vertex:
'#ifdef USE_BATCHING\n\tmat4 batchingMatrix = getBatchingMatrix( getIndirectIndex( gl_DrawID ) );\n#endif',
begin_vertex:
'vec3 transformed = vec3( position );\n#ifdef USE_ALPHAHASH\n\tvPosition = vec3( position );\n#endif',
beginnormal_vertex:
'vec3 objectNormal = vec3( normal );\n#ifdef USE_TANGENT\n\tvec3 objectTangent = vec3( tangent.xyz );\n#endif',
bsdfs:
'float G_BlinnPhong_Implicit( ) {\n\treturn 0.25;\n}\nfloat D_BlinnPhong( const in float shininess, const in float dotNH ) {\n\treturn RECIPROCAL_PI * ( shininess * 0.5 + 1.0 ) * pow( dotNH, shininess );\n}\nvec3 BRDF_BlinnPhong( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in vec3 specularColor, const in float shininess ) {\n\tvec3 halfDir = normalize( lightDir + viewDir );\n\tfloat dotNH = saturate( dot( normal, halfDir ) );\n\tfloat dotVH = saturate( dot( viewDir, halfDir ) );\n\tvec3 F = F_Schlick( specularColor, 1.0, dotVH );\n\tfloat G = G_BlinnPhong_Implicit( );\n\tfloat D = D_BlinnPhong( shininess, dotNH );\n\treturn F * ( G * D );\n} // validated',
iridescence_fragment:
'#ifdef USE_IRIDESCENCE\n\tconst mat3 XYZ_TO_REC709 = mat3(\n\t\t 3.2404542, -0.9692660, 0.0556434,\n\t\t-1.5371385, 1.8760108, -0.2040259,\n\t\t-0.4985314, 0.0415560, 1.0572252\n\t);\n\tvec3 Fresnel0ToIor( vec3 fresnel0 ) {\n\t\tvec3 sqrtF0 = sqrt( fresnel0 );\n\t\treturn ( vec3( 1.0 ) + sqrtF0 ) / ( vec3( 1.0 ) - sqrtF0 );\n\t}\n\tvec3 IorToFresnel0( vec3 transmittedIor, float incidentIor ) {\n\t\treturn pow2( ( transmittedIor - vec3( incidentIor ) ) / ( transmittedIor + vec3( incidentIor ) ) );\n\t}\n\tfloat IorToFresnel0( float transmittedIor, float incidentIor ) {\n\t\treturn pow2( ( transmittedIor - incidentIor ) / ( transmittedIor + incidentIor ));\n\t}\n\tvec3 evalSensitivity( float OPD, vec3 shift ) {\n\t\tfloat phase = 2.0 * PI * OPD * 1.0e-9;\n\t\tvec3 val = vec3( 5.4856e-13, 4.4201e-13, 5.2481e-13 );\n\t\tvec3 pos = vec3( 1.6810e+06, 1.7953e+06, 2.2084e+06 );\n\t\tvec3 var = vec3( 4.3278e+09, 9.3046e+09, 6.6121e+09 );\n\t\tvec3 xyz = val * sqrt( 2.0 * PI * var ) * cos( pos * phase + shift ) * exp( - pow2( phase ) * var );\n\t\txyz.x += 9.7470e-14 * sqrt( 2.0 * PI * 4.5282e+09 ) * cos( 2.2399e+06 * phase + shift[ 0 ] ) * exp( - 4.5282e+09 * pow2( phase ) );\n\t\txyz /= 1.0685e-7;\n\t\tvec3 rgb = XYZ_TO_REC709 * xyz;\n\t\treturn rgb;\n\t}\n\tvec3 evalIridescence( float outsideIOR, float eta2, float cosTheta1, float thinFilmThickness, vec3 baseF0 ) {\n\t\tvec3 I;\n\t\tfloat iridescenceIOR = mix( outsideIOR, eta2, smoothstep( 0.0, 0.03, thinFilmThickness ) );\n\t\tfloat sinTheta2Sq = pow2( outsideIOR / iridescenceIOR ) * ( 1.0 - pow2( cosTheta1 ) );\n\t\tfloat cosTheta2Sq = 1.0 - sinTheta2Sq;\n\t\tif ( cosTheta2Sq < 0.0 ) {\n\t\t\treturn vec3( 1.0 );\n\t\t}\n\t\tfloat cosTheta2 = sqrt( cosTheta2Sq );\n\t\tfloat R0 = IorToFresnel0( iridescenceIOR, outsideIOR );\n\t\tfloat R12 = F_Schlick( R0, 1.0, cosTheta1 );\n\t\tfloat T121 = 1.0 - R12;\n\t\tfloat phi12 = 0.0;\n\t\tif ( iridescenceIOR < outsideIOR ) phi12 = PI;\n\t\tfloat phi21 = PI - phi12;\n\t\tvec3 baseIOR = Fresnel0ToIor( clamp( baseF0, 0.0, 0.9999 ) );\t\tvec3 R1 = IorToFresnel0( baseIOR, iridescenceIOR );\n\t\tvec3 R23 = F_Schlick( R1, 1.0, cosTheta2 );\n\t\tvec3 phi23 = vec3( 0.0 );\n\t\tif ( baseIOR[ 0 ] < iridescenceIOR ) phi23[ 0 ] = PI;\n\t\tif ( baseIOR[ 1 ] < iridescenceIOR ) phi23[ 1 ] = PI;\n\t\tif ( baseIOR[ 2 ] < iridescenceIOR ) phi23[ 2 ] = PI;\n\t\tfloat OPD = 2.0 * iridescenceIOR * thinFilmThickness * cosTheta2;\n\t\tvec3 phi = vec3( phi21 ) + phi23;\n\t\tvec3 R123 = clamp( R12 * R23, 1e-5, 0.9999 );\n\t\tvec3 r123 = sqrt( R123 );\n\t\tvec3 Rs = pow2( T121 ) * R23 / ( vec3( 1.0 ) - R123 );\n\t\tvec3 C0 = R12 + Rs;\n\t\tI = C0;\n\t\tvec3 Cm = Rs - T121;\n\t\tfor ( int m = 1; m <= 2; ++ m ) {\n\t\t\tCm *= r123;\n\t\t\tvec3 Sm = 2.0 * evalSensitivity( float( m ) * OPD, float( m ) * phi );\n\t\t\tI += Cm * Sm;\n\t\t}\n\t\treturn max( I, vec3( 0.0 ) );\n\t}\n#endif',
bumpmap_pars_fragment:
'#ifdef USE_BUMPMAP\n\tuniform sampler2D bumpMap;\n\tuniform float bumpScale;\n\tvec2 dHdxy_fwd() {\n\t\tvec2 dSTdx = dFdx( vBumpMapUv );\n\t\tvec2 dSTdy = dFdy( vBumpMapUv );\n\t\tfloat Hll = bumpScale * texture2D( bumpMap, vBumpMapUv ).x;\n\t\tfloat dBx = bumpScale * texture2D( bumpMap, vBumpMapUv + dSTdx ).x - Hll;\n\t\tfloat dBy = bumpScale * texture2D( bumpMap, vBumpMapUv + dSTdy ).x - Hll;\n\t\treturn vec2( dBx, dBy );\n\t}\n\tvec3 perturbNormalArb( vec3 surf_pos, vec3 surf_norm, vec2 dHdxy, float faceDirection ) {\n\t\tvec3 vSigmaX = normalize( dFdx( surf_pos.xyz ) );\n\t\tvec3 vSigmaY = normalize( dFdy( surf_pos.xyz ) );\n\t\tvec3 vN = surf_norm;\n\t\tvec3 R1 = cross( vSigmaY, vN );\n\t\tvec3 R2 = cross( vN, vSigmaX );\n\t\tfloat fDet = dot( vSigmaX, R1 ) * faceDirection;\n\t\tvec3 vGrad = sign( fDet ) * ( dHdxy.x * R1 + dHdxy.y * R2 );\n\t\treturn normalize( abs( fDet ) * surf_norm - vGrad );\n\t}\n#endif',
clipping_planes_fragment:
'#if NUM_CLIPPING_PLANES > 0\n\tvec4 plane;\n\t#ifdef ALPHA_TO_COVERAGE\n\t\tfloat distanceToPlane, distanceGradient;\n\t\tfloat clipOpacity = 1.0;\n\t\t#pragma unroll_loop_start\n\t\tfor ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) {\n\t\t\tplane = clippingPlanes[ i ];\n\t\t\tdistanceToPlane = - dot( vClipPosition, plane.xyz ) + plane.w;\n\t\t\tdistanceGradient = fwidth( distanceToPlane ) / 2.0;\n\t\t\tclipOpacity *= smoothstep( - distanceGradient, distanceGradient, distanceToPlane );\n\t\t\tif ( clipOpacity == 0.0 ) discard;\n\t\t}\n\t\t#pragma unroll_loop_end\n\t\t#if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES\n\t\t\tfloat unionClipOpacity = 1.0;\n\t\t\t#pragma unroll_loop_start\n\t\t\tfor ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) {\n\t\t\t\tplane = clippingPlanes[ i ];\n\t\t\t\tdistanceToPlane = - dot( vClipPosition, plane.xyz ) + plane.w;\n\t\t\t\tdistanceGradient = fwidth( distanceToPlane ) / 2.0;\n\t\t\t\tunionClipOpacity *= 1.0 - smoothstep( - distanceGradient, distanceGradient, distanceToPlane );\n\t\t\t}\n\t\t\t#pragma unroll_loop_end\n\t\t\tclipOpacity *= 1.0 - unionClipOpacity;\n\t\t#endif\n\t\tdiffuseColor.a *= clipOpacity;\n\t\tif ( diffuseColor.a == 0.0 ) discard;\n\t#else\n\t\t#pragma unroll_loop_start\n\t\tfor ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) {\n\t\t\tplane = clippingPlanes[ i ];\n\t\t\tif ( dot( vClipPosition, plane.xyz ) > plane.w ) discard;\n\t\t}\n\t\t#pragma unroll_loop_end\n\t\t#if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES\n\t\t\tbool clipped = true;\n\t\t\t#pragma unroll_loop_start\n\t\t\tfor ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) {\n\t\t\t\tplane = clippingPlanes[ i ];\n\t\t\t\tclipped = ( dot( vClipPosition, plane.xyz ) > plane.w ) && clipped;\n\t\t\t}\n\t\t\t#pragma unroll_loop_end\n\t\t\tif ( clipped ) discard;\n\t\t#endif\n\t#endif\n#endif',
clipping_planes_pars_fragment:
'#if NUM_CLIPPING_PLANES > 0\n\tvarying vec3 vClipPosition;\n\tuniform vec4 clippingPlanes[ NUM_CLIPPING_PLANES ];\n#endif',
clipping_planes_pars_vertex:
'#if NUM_CLIPPING_PLANES > 0\n\tvarying vec3 vClipPosition;\n#endif',
clipping_planes_vertex:
'#if NUM_CLIPPING_PLANES > 0\n\tvClipPosition = - mvPosition.xyz;\n#endif',
color_fragment:
'#if defined( USE_COLOR_ALPHA )\n\tdiffuseColor *= vColor;\n#elif defined( USE_COLOR )\n\tdiffuseColor.rgb *= vColor;\n#endif',
color_pars_fragment:
'#if defined( USE_COLOR_ALPHA )\n\tvarying vec4 vColor;\n#elif defined( USE_COLOR )\n\tvarying vec3 vColor;\n#endif',
color_pars_vertex:
'#if defined( USE_COLOR_ALPHA )\n\tvarying vec4 vColor;\n#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR ) || defined( USE_BATCHING_COLOR )\n\tvarying vec3 vColor;\n#endif',
color_vertex:
'#if defined( USE_COLOR_ALPHA )\n\tvColor = vec4( 1.0 );\n#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR ) || defined( USE_BATCHING_COLOR )\n\tvColor = vec3( 1.0 );\n#endif\n#ifdef USE_COLOR\n\tvColor *= color;\n#endif\n#ifdef USE_INSTANCING_COLOR\n\tvColor.xyz *= instanceColor.xyz;\n#endif\n#ifdef USE_BATCHING_COLOR\n\tvec3 batchingColor = getBatchingColor( getIndirectIndex( gl_DrawID ) );\n\tvColor.xyz *= batchingColor.xyz;\n#endif',
common:
'#define PI 3.141592653589793\n#define PI2 6.283185307179586\n#define PI_HALF 1.5707963267948966\n#define RECIPROCAL_PI 0.3183098861837907\n#define RECIPROCAL_PI2 0.15915494309189535\n#define EPSILON 1e-6\n#ifndef saturate\n#define saturate( a ) clamp( a, 0.0, 1.0 )\n#endif\n#define whiteComplement( a ) ( 1.0 - saturate( a ) )\nfloat pow2( const in float x ) { return x*x; }\nvec3 pow2( const in vec3 x ) { return x*x; }\nfloat pow3( const in float x ) { return x*x*x; }\nfloat pow4( const in float x ) { float x2 = x*x; return x2*x2; }\nfloat max3( const in vec3 v ) { return max( max( v.x, v.y ), v.z ); }\nfloat average( const in vec3 v ) { return dot( v, vec3( 0.3333333 ) ); }\nhighp float rand( const in vec2 uv ) {\n\tconst highp float a = 12.9898, b = 78.233, c = 43758.5453;\n\thighp float dt = dot( uv.xy, vec2( a,b ) ), sn = mod( dt, PI );\n\treturn fract( sin( sn ) * c );\n}\n#ifdef HIGH_PRECISION\n\tfloat precisionSafeLength( vec3 v ) { return length( v ); }\n#else\n\tfloat precisionSafeLength( vec3 v ) {\n\t\tfloat maxComponent = max3( abs( v ) );\n\t\treturn length( v / maxComponent ) * maxComponent;\n\t}\n#endif\nstruct IncidentLight {\n\tvec3 color;\n\tvec3 direction;\n\tbool visible;\n};\nstruct ReflectedLight {\n\tvec3 directDiffuse;\n\tvec3 directSpecular;\n\tvec3 indirectDiffuse;\n\tvec3 indirectSpecular;\n};\n#ifdef USE_ALPHAHASH\n\tvarying vec3 vPosition;\n#endif\nvec3 transformDirection( in vec3 dir, in mat4 matrix ) {\n\treturn normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );\n}\nvec3 inverseTransformDirection( in vec3 dir, in mat4 matrix ) {\n\treturn normalize( ( vec4( dir, 0.0 ) * matrix ).xyz );\n}\nmat3 transposeMat3( const in mat3 m ) {\n\tmat3 tmp;\n\ttmp[ 0 ] = vec3( m[ 0 ].x, m[ 1 ].x, m[ 2 ].x );\n\ttmp[ 1 ] = vec3( m[ 0 ].y, m[ 1 ].y, m[ 2 ].y );\n\ttmp[ 2 ] = vec3( m[ 0 ].z, m[ 1 ].z, m[ 2 ].z );\n\treturn tmp;\n}\nbool isPerspectiveMatrix( mat4 m ) {\n\treturn m[ 2 ][ 3 ] == - 1.0;\n}\nvec2 equirectUv( in vec3 dir ) {\n\tfloat u = atan( dir.z, dir.x ) * RECIPROCAL_PI2 + 0.5;\n\tfloat v = asin( clamp( dir.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5;\n\treturn vec2( u, v );\n}\nvec3 BRDF_Lambert( const in vec3 diffuseColor ) {\n\treturn RECIPROCAL_PI * diffuseColor;\n}\nvec3 F_Schlick( const in vec3 f0, const in float f90, const in float dotVH ) {\n\tfloat fresnel = exp2( ( - 5.55473 * dotVH - 6.98316 ) * dotVH );\n\treturn f0 * ( 1.0 - fresnel ) + ( f90 * fresnel );\n}\nfloat F_Schlick( const in float f0, const in float f90, const in float dotVH ) {\n\tfloat fresnel = exp2( ( - 5.55473 * dotVH - 6.98316 ) * dotVH );\n\treturn f0 * ( 1.0 - fresnel ) + ( f90 * fresnel );\n} // validated',
cube_uv_reflection_fragment:
'#ifdef ENVMAP_TYPE_CUBE_UV\n\t#define cubeUV_minMipLevel 4.0\n\t#define cubeUV_minTileSize 16.0\n\tfloat getFace( vec3 direction ) {\n\t\tvec3 absDirection = abs( direction );\n\t\tfloat face = - 1.0;\n\t\tif ( absDirection.x > absDirection.z ) {\n\t\t\tif ( absDirection.x > absDirection.y )\n\t\t\t\tface = direction.x > 0.0 ? 0.0 : 3.0;\n\t\t\telse\n\t\t\t\tface = direction.y > 0.0 ? 1.0 : 4.0;\n\t\t} else {\n\t\t\tif ( absDirection.z > absDirection.y )\n\t\t\t\tface = direction.z > 0.0 ? 2.0 : 5.0;\n\t\t\telse\n\t\t\t\tface = direction.y > 0.0 ? 1.0 : 4.0;\n\t\t}\n\t\treturn face;\n\t}\n\tvec2 getUV( vec3 direction, float face ) {\n\t\tvec2 uv;\n\t\tif ( face == 0.0 ) {\n\t\t\tuv = vec2( direction.z, direction.y ) / abs( direction.x );\n\t\t} else if ( face == 1.0 ) {\n\t\t\tuv = vec2( - direction.x, - direction.z ) / abs( direction.y );\n\t\t} else if ( face == 2.0 ) {\n\t\t\tuv = vec2( - direction.x, direction.y ) / abs( direction.z );\n\t\t} else if ( face == 3.0 ) {\n\t\t\tuv = vec2( - direction.z, direction.y ) / abs( direction.x );\n\t\t} else if ( face == 4.0 ) {\n\t\t\tuv = vec2( - direction.x, direction.z ) / abs( direction.y );\n\t\t} else {\n\t\t\tuv = vec2( direction.x, direction.y ) / abs( direction.z );\n\t\t}\n\t\treturn 0.5 * ( uv + 1.0 );\n\t}\n\tvec3 bilinearCubeUV( sampler2D envMap, vec3 direction, float mipInt ) {\n\t\tfloat face = getFace( direction );\n\t\tfloat filterInt = max( cubeUV_minMipLevel - mipInt, 0.0 );\n\t\tmipInt = max( mipInt, cubeUV_minMipLevel );\n\t\tfloat faceSize = exp2( mipInt );\n\t\thighp vec2 uv = getUV( direction, face ) * ( faceSize - 2.0 ) + 1.0;\n\t\tif ( face > 2.0 ) {\n\t\t\tuv.y += faceSize;\n\t\t\tface -= 3.0;\n\t\t}\n\t\tuv.x += face * faceSize;\n\t\tuv.x += filterInt * 3.0 * cubeUV_minTileSize;\n\t\tuv.y += 4.0 * ( exp2( CUBEUV_MAX_MIP ) - faceSize );\n\t\tuv.x *= CUBEUV_TEXEL_WIDTH;\n\t\tuv.y *= CUBEUV_TEXEL_HEIGHT;\n\t\t#ifdef texture2DGradEXT\n\t\t\treturn texture2DGradEXT( envMap, uv, vec2( 0.0 ), vec2( 0.0 ) ).rgb;\n\t\t#else\n\t\t\treturn texture2D( envMap, uv ).rgb;\n\t\t#endif\n\t}\n\t#define cubeUV_r0 1.0\n\t#define cubeUV_m0 - 2.0\n\t#define cubeUV_r1 0.8\n\t#define cubeUV_m1 - 1.0\n\t#define cubeUV_r4 0.4\n\t#define cubeUV_m4 2.0\n\t#define cubeUV_r5 0.305\n\t#define cubeUV_m5 3.0\n\t#define cubeUV_r6 0.21\n\t#define cubeUV_m6 4.0\n\tfloat roughnessToMip( float roughness ) {\n\t\tfloat mip = 0.0;\n\t\tif ( roughness >= cubeUV_r1 ) {\n\t\t\tmip = ( cubeUV_r0 - roughness ) * ( cubeUV_m1 - cubeUV_m0 ) / ( cubeUV_r0 - cubeUV_r1 ) + cubeUV_m0;\n\t\t} else if ( roughness >= cubeUV_r4 ) {\n\t\t\tmip = ( cubeUV_r1 - roughness ) * ( cubeUV_m4 - cubeUV_m1 ) / ( cubeUV_r1 - cubeUV_r4 ) + cubeUV_m1;\n\t\t} else if ( roughness >= cubeUV_r5 ) {\n\t\t\tmip = ( cubeUV_r4 - roughness ) * ( cubeUV_m5 - cubeUV_m4 ) / ( cubeUV_r4 - cubeUV_r5 ) + cubeUV_m4;\n\t\t} else if ( roughness >= cubeUV_r6 ) {\n\t\t\tmip = ( cubeUV_r5 - roughness ) * ( cubeUV_m6 - cubeUV_m5 ) / ( cubeUV_r5 - cubeUV_r6 ) + cubeUV_m5;\n\t\t} else {\n\t\t\tmip = - 2.0 * log2( 1.16 * roughness );\t\t}\n\t\treturn mip;\n\t}\n\tvec4 textureCubeUV( sampler2D envMap, vec3 sampleDir, float roughness ) {\n\t\tfloat mip = clamp( roughnessToMip( roughness ), cubeUV_m0, CUBEUV_MAX_MIP );\n\t\tfloat mipF = fract( mip );\n\t\tfloat mipInt = floor( mip );\n\t\tvec3 color0 = bilinearCubeUV( envMap, sampleDir, mipInt );\n\t\tif ( mipF == 0.0 ) {\n\t\t\treturn vec4( color0, 1.0 );\n\t\t} else {\n\t\t\tvec3 color1 = bilinearCubeUV( envMap, sampleDir, mipInt + 1.0 );\n\t\t\treturn vec4( mix( color0, color1, mipF ), 1.0 );\n\t\t}\n\t}\n#endif',
defaultnormal_vertex:
'vec3 transformedNormal = objectNormal;\n#ifdef USE_TANGENT\n\tvec3 transformedTangent = objectTangent;\n#endif\n#ifdef USE_BATCHING\n\tmat3 bm = mat3( batchingMatrix );\n\ttransformedNormal /= vec3( dot( bm[ 0 ], bm[ 0 ] ), dot( bm[ 1 ], bm[ 1 ] ), dot( bm[ 2 ], bm[ 2 ] ) );\n\ttransformedNormal = bm * transformedNormal;\n\t#ifdef USE_TANGENT\n\t\ttransformedTangent = bm * transformedTangent;\n\t#endif\n#endif\n#ifdef USE_INSTANCING\n\tmat3 im = mat3( instanceMatrix );\n\ttransformedNormal /= vec3( dot( im[ 0 ], im[ 0 ] ), dot( im[ 1 ], im[ 1 ] ), dot( im[ 2 ], im[ 2 ] ) );\n\ttransformedNormal = im * transformedNormal;\n\t#ifdef USE_TANGENT\n\t\ttransformedTangent = im * transformedTangent;\n\t#endif\n#endif\ntransformedNormal = normalMatrix * transformedNormal;\n#ifdef FLIP_SIDED\n\ttransformedNormal = - transformedNormal;\n#endif\n#ifdef USE_TANGENT\n\ttransformedTangent = ( modelViewMatrix * vec4( transformedTangent, 0.0 ) ).xyz;\n\t#ifdef FLIP_SIDED\n\t\ttransformedTangent = - transformedTangent;\n\t#endif\n#endif',
displacementmap_pars_vertex:
'#ifdef USE_DISPLACEMENTMAP\n\tuniform sampler2D displacementMap;\n\tuniform float displacementScale;\n\tuniform float displacementBias;\n#endif',
displacementmap_vertex:
'#ifdef USE_DISPLACEMENTMAP\n\ttransformed += normalize( objectNormal ) * ( texture2D( displacementMap, vDisplacementMapUv ).x * displacementScale + displacementBias );\n#endif',
emissivemap_fragment:
'#ifdef USE_EMISSIVEMAP\n\tvec4 emissiveColor = texture2D( emissiveMap, vEmissiveMapUv );\n\t#ifdef DECODE_VIDEO_TEXTURE_EMISSIVE\n\t\temissiveColor = sRGBTransferEOTF( emissiveColor );\n\t#endif\n\ttotalEmissiveRadiance *= emissiveColor.rgb;\n#endif',
emissivemap_pars_fragment:
'#ifdef USE_EMISSIVEMAP\n\tuniform sampler2D emissiveMap;\n#endif',
colorspace_fragment: 'gl_FragColor = linearToOutputTexel( gl_FragColor );',
colorspace_pars_fragment:
'vec4 LinearTransferOETF( in vec4 value ) {\n\treturn value;\n}\nvec4 sRGBTransferEOTF( in vec4 value ) {\n\treturn vec4( mix( pow( value.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), value.rgb * 0.0773993808, vec3( lessThanEqual( value.rgb, vec3( 0.04045 ) ) ) ), value.a );\n}\nvec4 sRGBTransferOETF( in vec4 value ) {\n\treturn vec4( mix( pow( value.rgb, vec3( 0.41666 ) ) * 1.055 - vec3( 0.055 ), value.rgb * 12.92, vec3( lessThanEqual( value.rgb, vec3( 0.0031308 ) ) ) ), value.a );\n}',
envmap_fragment:
'#ifdef USE_ENVMAP\n\t#ifdef ENV_WORLDPOS\n\t\tvec3 cameraToFrag;\n\t\tif ( isOrthographic ) {\n\t\t\tcameraToFrag = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) );\n\t\t} else {\n\t\t\tcameraToFrag = normalize( vWorldPosition - cameraPosition );\n\t\t}\n\t\tvec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t\tvec3 reflectVec = reflect( cameraToFrag, worldNormal );\n\t\t#else\n\t\t\tvec3 reflectVec = refract( cameraToFrag, worldNormal, refractionRatio );\n\t\t#endif\n\t#else\n\t\tvec3 reflectVec = vReflect;\n\t#endif\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tvec4 envColor = textureCube( envMap, envMapRotation * vec3( flipEnvMap * reflectVec.x, reflectVec.yz ) );\n\t#else\n\t\tvec4 envColor = vec4( 0.0 );\n\t#endif\n\t#ifdef ENVMAP_BLENDING_MULTIPLY\n\t\toutgoingLight = mix( outgoingLight, outgoingLight * envColor.xyz, specularStrength * reflectivity );\n\t#elif defined( ENVMAP_BLENDING_MIX )\n\t\toutgoingLight = mix( outgoingLight, envColor.xyz, specularStrength * reflectivity );\n\t#elif defined( ENVMAP_BLENDING_ADD )\n\t\toutgoingLight += envColor.xyz * specularStrength * reflectivity;\n\t#endif\n#endif',
envmap_common_pars_fragment:
'#ifdef USE_ENVMAP\n\tuniform float envMapIntensity;\n\tuniform float flipEnvMap;\n\tuniform mat3 envMapRotation;\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tuniform samplerCube envMap;\n\t#else\n\t\tuniform sampler2D envMap;\n\t#endif\n\t\n#endif',
envmap_pars_fragment:
'#ifdef USE_ENVMAP\n\tuniform float reflectivity;\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( LAMBERT )\n\t\t#define ENV_WORLDPOS\n\t#endif\n\t#ifdef ENV_WORLDPOS\n\t\tvarying vec3 vWorldPosition;\n\t\tuniform float refractionRatio;\n\t#else\n\t\tvarying vec3 vReflect;\n\t#endif\n#endif',
envmap_pars_vertex:
'#ifdef USE_ENVMAP\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( LAMBERT )\n\t\t#define ENV_WORLDPOS\n\t#endif\n\t#ifdef ENV_WORLDPOS\n\t\t\n\t\tvarying vec3 vWorldPosition;\n\t#else\n\t\tvarying vec3 vReflect;\n\t\tuniform float refractionRatio;\n\t#endif\n#endif',
envmap_physical_pars_fragment:
'#ifdef USE_ENVMAP\n\tvec3 getIBLIrradiance( const in vec3 normal ) {\n\t\t#ifdef ENVMAP_TYPE_CUBE_UV\n\t\t\tvec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\n\t\t\tvec4 envMapColor = textureCubeUV( envMap, envMapRotation * worldNormal, 1.0 );\n\t\t\treturn PI * envMapColor.rgb * envMapIntensity;\n\t\t#else\n\t\t\treturn vec3( 0.0 );\n\t\t#endif\n\t}\n\tvec3 getIBLRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness ) {\n\t\t#ifdef ENVMAP_TYPE_CUBE_UV\n\t\t\tvec3 reflectVec = reflect( - viewDir, normal );\n\t\t\treflectVec = normalize( mix( reflectVec, normal, roughness * roughness) );\n\t\t\treflectVec = inverseTransformDirection( reflectVec, viewMatrix );\n\t\t\tvec4 envMapColor = textureCubeUV( envMap, envMapRotation * reflectVec, roughness );\n\t\t\treturn envMapColor.rgb * envMapIntensity;\n\t\t#else\n\t\t\treturn vec3( 0.0 );\n\t\t#endif\n\t}\n\t#ifdef USE_ANISOTROPY\n\t\tvec3 getIBLAnisotropyRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness, const in vec3 bitangent, const in float anisotropy ) {\n\t\t\t#ifdef ENVMAP_TYPE_CUBE_UV\n\t\t\t\tvec3 bentNormal = cross( bitangent, viewDir );\n\t\t\t\tbentNormal = normalize( cross( bentNormal, bitangent ) );\n\t\t\t\tbentNormal = normalize( mix( bentNormal, normal, pow2( pow2( 1.0 - anisotropy * ( 1.0 - roughness ) ) ) ) );\n\t\t\t\treturn getIBLRadiance( viewDir, bentNormal, roughness );\n\t\t\t#else\n\t\t\t\treturn vec3( 0.0 );\n\t\t\t#endif\n\t\t}\n\t#endif\n#endif',
envmap_vertex:
'#ifdef USE_ENVMAP\n\t#ifdef ENV_WORLDPOS\n\t\tvWorldPosition = worldPosition.xyz;\n\t#else\n\t\tvec3 cameraToVertex;\n\t\tif ( isOrthographic ) {\n\t\t\tcameraToVertex = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) );\n\t\t} else {\n\t\t\tcameraToVertex = normalize( worldPosition.xyz - cameraPosition );\n\t\t}\n\t\tvec3 worldNormal = inverseTransformDirection( transformedNormal, viewMatrix );\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t\tvReflect = reflect( cameraToVertex, worldNormal );\n\t\t#else\n\t\t\tvReflect = refract( cameraToVertex, worldNormal, refractionRatio );\n\t\t#endif\n\t#endif\n#endif',
fog_vertex: '#ifdef USE_FOG\n\tvFogDepth = - mvPosition.z;\n#endif',
fog_pars_vertex: '#ifdef USE_FOG\n\tvarying float vFogDepth;\n#endif',
fog_fragment:
'#ifdef USE_FOG\n\t#ifdef FOG_EXP2\n\t\tfloat fogFactor = 1.0 - exp( - fogDensity * fogDensity * vFogDepth * vFogDepth );\n\t#else\n\t\tfloat fogFactor = smoothstep( fogNear, fogFar, vFogDepth );\n\t#endif\n\tgl_FragColor.rgb = mix( gl_FragColor.rgb, fogColor, fogFactor );\n#endif',
fog_pars_fragment:
'#ifdef USE_FOG\n\tuniform vec3 fogColor;\n\tvarying float vFogDepth;\n\t#ifdef FOG_EXP2\n\t\tuniform float fogDensity;\n\t#else\n\t\tuniform float fogNear;\n\t\tuniform float fogFar;\n\t#endif\n#endif',
gradientmap_pars_fragment:
'#ifdef USE_GRADIENTMAP\n\tuniform sampler2D gradientMap;\n#endif\nvec3 getGradientIrradiance( vec3 normal, vec3 lightDirection ) {\n\tfloat dotNL = dot( normal, lightDirection );\n\tvec2 coord = vec2( dotNL * 0.5 + 0.5, 0.0 );\n\t#ifdef USE_GRADIENTMAP\n\t\treturn vec3( texture2D( gradientMap, coord ).r );\n\t#else\n\t\tvec2 fw = fwidth( coord ) * 0.5;\n\t\treturn mix( vec3( 0.7 ), vec3( 1.0 ), smoothstep( 0.7 - fw.x, 0.7 + fw.x, coord.x ) );\n\t#endif\n}',
lightmap_pars_fragment:
'#ifdef USE_LIGHTMAP\n\tuniform sampler2D lightMap;\n\tuniform float lightMapIntensity;\n#endif',
lights_lambert_fragment:
'LambertMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;\nmaterial.specularStrength = specularStrength;',
lights_lambert_pars_fragment:
'varying vec3 vViewPosition;\nstruct LambertMaterial {\n\tvec3 diffuseColor;\n\tfloat specularStrength;\n};\nvoid RE_Direct_Lambert( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in LambertMaterial material, inout ReflectedLight reflectedLight ) {\n\tfloat dotNL = saturate( dot( geometryNormal, directLight.direction ) );\n\tvec3 irradiance = dotNL * directLight.color;\n\treflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectDiffuse_Lambert( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in LambertMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\n#define RE_Direct\t\t\t\tRE_Direct_Lambert\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_Lambert',
lights_pars_begin:
'uniform bool receiveShadow;\nuniform vec3 ambientLightColor;\n#if defined( USE_LIGHT_PROBES )\n\tuniform vec3 lightProbe[ 9 ];\n#endif\nvec3 shGetIrradianceAt( in vec3 normal, in vec3 shCoefficients[ 9 ] ) {\n\tfloat x = normal.x, y = normal.y, z = normal.z;\n\tvec3 result = shCoefficients[ 0 ] * 0.886227;\n\tresult += shCoefficients[ 1 ] * 2.0 * 0.511664 * y;\n\tresult += shCoefficients[ 2 ] * 2.0 * 0.511664 * z;\n\tresult += shCoefficients[ 3 ] * 2.0 * 0.511664 * x;\n\tresult += shCoefficients[ 4 ] * 2.0 * 0.429043 * x * y;\n\tresult += shCoefficients[ 5 ] * 2.0 * 0.429043 * y * z;\n\tresult += shCoefficients[ 6 ] * ( 0.743125 * z * z - 0.247708 );\n\tresult += shCoefficients[ 7 ] * 2.0 * 0.429043 * x * z;\n\tresult += shCoefficients[ 8 ] * 0.429043 * ( x * x - y * y );\n\treturn result;\n}\nvec3 getLightProbeIrradiance( const in vec3 lightProbe[ 9 ], const in vec3 normal ) {\n\tvec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\n\tvec3 irradiance = shGetIrradianceAt( worldNormal, lightProbe );\n\treturn irradiance;\n}\nvec3 getAmbientLightIrradiance( const in vec3 ambientLightColor ) {\n\tvec3 irradiance = ambientLightColor;\n\treturn irradiance;\n}\nfloat getDistanceAttenuation( const in float lightDistance, const in float cutoffDistance, const in float decayExponent ) {\n\tfloat distanceFalloff = 1.0 / max( pow( lightDistance, decayExponent ), 0.01 );\n\tif ( cutoffDistance > 0.0 ) {\n\t\tdistanceFalloff *= pow2( saturate( 1.0 - pow4( lightDistance / cutoffDistance ) ) );\n\t}\n\treturn distanceFalloff;\n}\nfloat getSpotAttenuation( const in float coneCosine, const in float penumbraCosine, const in float angleCosine ) {\n\treturn smoothstep( coneCosine, penumbraCosine, angleCosine );\n}\n#if NUM_DIR_LIGHTS > 0\n\tstruct DirectionalLight {\n\t\tvec3 direction;\n\t\tvec3 color;\n\t};\n\tuniform DirectionalLight directionalLights[ NUM_DIR_LIGHTS ];\n\tvoid getDirectionalLightInfo( const in DirectionalLight directionalLight, out IncidentLight light ) {\n\t\tlight.color = directionalLight.color;\n\t\tlight.direction = directionalLight.direction;\n\t\tlight.visible = true;\n\t}\n#endif\n#if NUM_POINT_LIGHTS > 0\n\tstruct PointLight {\n\t\tvec3 position;\n\t\tvec3 color;\n\t\tfloat distance;\n\t\tfloat decay;\n\t};\n\tuniform PointLight pointLights[ NUM_POINT_LIGHTS ];\n\tvoid getPointLightInfo( const in PointLight pointLight, const in vec3 geometryPosition, out IncidentLight light ) {\n\t\tvec3 lVector = pointLight.position - geometryPosition;\n\t\tlight.direction = normalize( lVector );\n\t\tfloat lightDistance = length( lVector );\n\t\tlight.color = pointLight.color;\n\t\tlight.color *= getDistanceAttenuation( lightDistance, pointLight.distance, pointLight.decay );\n\t\tlight.visible = ( light.color != vec3( 0.0 ) );\n\t}\n#endif\n#if NUM_SPOT_LIGHTS > 0\n\tstruct SpotLight {\n\t\tvec3 position;\n\t\tvec3 direction;\n\t\tvec3 color;\n\t\tfloat distance;\n\t\tfloat decay;\n\t\tfloat coneCos;\n\t\tfloat penumbraCos;\n\t};\n\tuniform SpotLight spotLights[ NUM_SPOT_LIGHTS ];\n\tvoid getSpotLightInfo( const in SpotLight spotLight, const in vec3 geometryPosition, out IncidentLight light ) {\n\t\tvec3 lVector = spotLight.position - geometryPosition;\n\t\tlight.direction = normalize( lVector );\n\t\tfloat angleCos = dot( light.direction, spotLight.direction );\n\t\tfloat spotAttenuation = getSpotAttenuation( spotLight.coneCos, spotLight.penumbraCos, angleCos );\n\t\tif ( spotAttenuation > 0.0 ) {\n\t\t\tfloat lightDistance = length( lVector );\n\t\t\tlight.color = spotLight.color * spotAttenuation;\n\t\t\tlight.color *= getDistanceAttenuation( lightDistance, spotLight.distance, spotLight.decay );\n\t\t\tlight.visible = ( light.color != vec3( 0.0 ) );\n\t\t} else {\n\t\t\tlight.color = vec3( 0.0 );\n\t\t\tlight.visible = false;\n\t\t}\n\t}\n#endif\n#if NUM_RECT_AREA_LIGHTS > 0\n\tstruct RectAreaLight {\n\t\tvec3 color;\n\t\tvec3 position;\n\t\tvec3 halfWidth;\n\t\tvec3 halfHeight;\n\t};\n\tuniform sampler2D ltc_1;\tuniform sampler2D ltc_2;\n\tuniform RectAreaLight rectAreaLights[ NUM_RECT_AREA_LIGHTS ];\n#endif\n#if NUM_HEMI_LIGHTS > 0\n\tstruct HemisphereLight {\n\t\tvec3 direction;\n\t\tvec3 skyColor;\n\t\tvec3 groundColor;\n\t};\n\tuniform HemisphereLight hemisphereLights[ NUM_HEMI_LIGHTS ];\n\tvec3 getHemisphereLightIrradiance( const in HemisphereLight hemiLight, const in vec3 normal ) {\n\t\tfloat dotNL = dot( normal, hemiLight.direction );\n\t\tfloat hemiDiffuseWeight = 0.5 * dotNL + 0.5;\n\t\tvec3 irradiance = mix( hemiLight.groundColor, hemiLight.skyColor, hemiDiffuseWeight );\n\t\treturn irradiance;\n\t}\n#endif',
lights_toon_fragment:
'ToonMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;',
lights_toon_pars_fragment:
'varying vec3 vViewPosition;\nstruct ToonMaterial {\n\tvec3 diffuseColor;\n};\nvoid RE_Direct_Toon( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in ToonMaterial material, inout ReflectedLight reflectedLight ) {\n\tvec3 irradiance = getGradientIrradiance( geometryNormal, directLight.direction ) * directLight.color;\n\treflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectDiffuse_Toon( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in ToonMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\n#define RE_Direct\t\t\t\tRE_Direct_Toon\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_Toon',
lights_phong_fragment:
'BlinnPhongMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;\nmaterial.specularColor = specular;\nmaterial.specularShininess = shininess;\nmaterial.specularStrength = specularStrength;',
lights_phong_pars_fragment:
'varying vec3 vViewPosition;\nstruct BlinnPhongMaterial {\n\tvec3 diffuseColor;\n\tvec3 specularColor;\n\tfloat specularShininess;\n\tfloat specularStrength;\n};\nvoid RE_Direct_BlinnPhong( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\n\tfloat dotNL = saturate( dot( geometryNormal, directLight.direction ) );\n\tvec3 irradiance = dotNL * directLight.color;\n\treflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n\treflectedLight.directSpecular += irradiance * BRDF_BlinnPhong( directLight.direction, geometryViewDir, geometryNormal, material.specularColor, material.specularShininess ) * material.specularStrength;\n}\nvoid RE_IndirectDiffuse_BlinnPhong( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\n#define RE_Direct\t\t\t\tRE_Direct_BlinnPhong\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_BlinnPhong',
lights_physical_fragment:
'PhysicalMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb * ( 1.0 - metalnessFactor );\nvec3 dxy = max( abs( dFdx( nonPerturbedNormal ) ), abs( dFdy( nonPerturbedNormal ) ) );\nfloat geometryRoughness = max( max( dxy.x, dxy.y ), dxy.z );\nmaterial.roughness = max( roughnessFactor, 0.0525 );material.roughness += geometryRoughness;\nmaterial.roughness = min( material.roughness, 1.0 );\n#ifdef IOR\n\tmaterial.ior = ior;\n\t#ifdef USE_SPECULAR\n\t\tfloat specularIntensityFactor = specularIntensity;\n\t\tvec3 specularColorFactor = specularColor;\n\t\t#ifdef USE_SPECULAR_COLORMAP\n\t\t\tspecularColorFactor *= texture2D( specularColorMap, vSpecularColorMapUv ).rgb;\n\t\t#endif\n\t\t#ifdef USE_SPECULAR_INTENSITYMAP\n\t\t\tspecularIntensityFactor *= texture2D( specularIntensityMap, vSpecularIntensityMapUv ).a;\n\t\t#endif\n\t\tmaterial.specularF90 = mix( specularIntensityFactor, 1.0, metalnessFactor );\n\t#else\n\t\tfloat specularIntensityFactor = 1.0;\n\t\tvec3 specularColorFactor = vec3( 1.0 );\n\t\tmaterial.specularF90 = 1.0;\n\t#endif\n\tmaterial.specularColor = mix( min( pow2( ( material.ior - 1.0 ) / ( material.ior + 1.0 ) ) * specularColorFactor, vec3( 1.0 ) ) * specularIntensityFactor, diffuseColor.rgb, metalnessFactor );\n#else\n\tmaterial.specularColor = mix( vec3( 0.04 ), diffuseColor.rgb, metalnessFactor );\n\tmaterial.specularF90 = 1.0;\n#endif\n#ifdef USE_CLEARCOAT\n\tmaterial.clearcoat = clearcoat;\n\tmaterial.clearcoatRoughness = clearcoatRoughness;\n\tmaterial.clearcoatF0 = vec3( 0.04 );\n\tmaterial.clearcoatF90 = 1.0;\n\t#ifdef USE_CLEARCOATMAP\n\t\tmaterial.clearcoat *= texture2D( clearcoatMap, vClearcoatMapUv ).x;\n\t#endif\n\t#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\t\tmaterial.clearcoatRoughness *= texture2D( clearcoatRoughnessMap, vClearcoatRoughnessMapUv ).y;\n\t#endif\n\tmaterial.clearcoat = saturate( material.clearcoat );\tmaterial.clearcoatRoughness = max( material.clearcoatRoughness, 0.0525 );\n\tmaterial.clearcoatRoughness += geometryRoughness;\n\tmaterial.clearcoatRoughness = min( material.clearcoatRoughness, 1.0 );\n#endif\n#ifdef USE_DISPERSION\n\tmaterial.dispersion = dispersion;\n#endif\n#ifdef USE_IRIDESCENCE\n\tmaterial.iridescence = iridescence;\n\tmaterial.iridescenceIOR = iridescenceIOR;\n\t#ifdef USE_IRIDESCENCEMAP\n\t\tmaterial.iridescence *= texture2D( iridescenceMap, vIridescenceMapUv ).r;\n\t#endif\n\t#ifdef USE_IRIDESCENCE_THICKNESSMAP\n\t\tmaterial.iridescenceThickness = (iridescenceThicknessMaximum - iridescenceThicknessMinimum) * texture2D( iridescenceThicknessMap, vIridescenceThicknessMapUv ).g + iridescenceThicknessMinimum;\n\t#else\n\t\tmaterial.iridescenceThickness = iridescenceThicknessMaximum;\n\t#endif\n#endif\n#ifdef USE_SHEEN\n\tmaterial.sheenColor = sheenColor;\n\t#ifdef USE_SHEEN_COLORMAP\n\t\tmaterial.sheenColor *= texture2D( sheenColorMap, vSheenColorMapUv ).rgb;\n\t#endif\n\tmaterial.sheenRoughness = clamp( sheenRoughness, 0.07, 1.0 );\n\t#ifdef USE_SHEEN_ROUGHNESSMAP\n\t\tmaterial.sheenRoughness *= texture2D( sheenRoughnessMap, vSheenRoughnessMapUv ).a;\n\t#endif\n#endif\n#ifdef USE_ANISOTROPY\n\t#ifdef USE_ANISOTROPYMAP\n\t\tmat2 anisotropyMat = mat2( anisotropyVector.x, anisotropyVector.y, - anisotropyVector.y, anisotropyVector.x );\n\t\tvec3 anisotropyPolar = texture2D( anisotropyMap, vAnisotropyMapUv ).rgb;\n\t\tvec2 anisotropyV = anisotropyMat * normalize( 2.0 * anisotropyPolar.rg - vec2( 1.0 ) ) * anisotropyPolar.b;\n\t#else\n\t\tvec2 anisotropyV = anisotropyVector;\n\t#endif\n\tmaterial.anisotropy = length( anisotropyV );\n\tif( material.anisotropy == 0.0 ) {\n\t\tanisotropyV = vec2( 1.0, 0.0 );\n\t} else {\n\t\tanisotropyV /= material.anisotropy;\n\t\tmaterial.anisotropy = saturate( material.anisotropy );\n\t}\n\tmaterial.alphaT = mix( pow2( material.roughness ), 1.0, pow2( material.anisotropy ) );\n\tmaterial.anisotropyT = tbn[ 0 ] * anisotropyV.x + tbn[ 1 ] * anisotropyV.y;\n\tmaterial.anisotropyB = tbn[ 1 ] * anisotropyV.x - tbn[ 0 ] * anisotropyV.y;\n#endif',
lights_physical_pars_fragment:
'struct PhysicalMaterial {\n\tvec3 diffuseColor;\n\tfloat roughness;\n\tvec3 specularColor;\n\tfloat specularF90;\n\tfloat dispersion;\n\t#ifdef USE_CLEARCOAT\n\t\tfloat clearcoat;\n\t\tfloat clearcoatRoughness;\n\t\tvec3 clearcoatF0;\n\t\tfloat clearcoatF90;\n\t#endif\n\t#ifdef USE_IRIDESCENCE\n\t\tfloat iridescence;\n\t\tfloat iridescenceIOR;\n\t\tfloat iridescenceThickness;\n\t\tvec3 iridescenceFresnel;\n\t\tvec3 iridescenceF0;\n\t#endif\n\t#ifdef USE_SHEEN\n\t\tvec3 sheenColor;\n\t\tfloat sheenRoughness;\n\t#endif\n\t#ifdef IOR\n\t\tfloat ior;\n\t#endif\n\t#ifdef USE_TRANSMISSION\n\t\tfloat transmission;\n\t\tfloat transmissionAlpha;\n\t\tfloat thickness;\n\t\tfloat attenuationDistance;\n\t\tvec3 attenuationColor;\n\t#endif\n\t#ifdef USE_ANISOTROPY\n\t\tfloat anisotropy;\n\t\tfloat alphaT;\n\t\tvec3 anisotropyT;\n\t\tvec3 anisotropyB;\n\t#endif\n};\nvec3 clearcoatSpecularDirect = vec3( 0.0 );\nvec3 clearcoatSpecularIndirect = vec3( 0.0 );\nvec3 sheenSpecularDirect = vec3( 0.0 );\nvec3 sheenSpecularIndirect = vec3(0.0 );\nvec3 Schlick_to_F0( const in vec3 f, const in float f90, const in float dotVH ) {\n float x = clamp( 1.0 - dotVH, 0.0, 1.0 );\n float x2 = x * x;\n float x5 = clamp( x * x2 * x2, 0.0, 0.9999 );\n return ( f - vec3( f90 ) * x5 ) / ( 1.0 - x5 );\n}\nfloat V_GGX_SmithCorrelated( const in float alpha, const in float dotNL, const in float dotNV ) {\n\tfloat a2 = pow2( alpha );\n\tfloat gv = dotNL * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) );\n\tfloat gl = dotNV * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) );\n\treturn 0.5 / max( gv + gl, EPSILON );\n}\nfloat D_GGX( const in float alpha, const in float dotNH ) {\n\tfloat a2 = pow2( alpha );\n\tfloat denom = pow2( dotNH ) * ( a2 - 1.0 ) + 1.0;\n\treturn RECIPROCAL_PI * a2 / pow2( denom );\n}\n#ifdef USE_ANISOTROPY\n\tfloat V_GGX_SmithCorrelated_Anisotropic( const in float alphaT, const in float alphaB, const in float dotTV, const in float dotBV, const in float dotTL, const in float dotBL, const in float dotNV, const in float dotNL ) {\n\t\tfloat gv = dotNL * length( vec3( alphaT * dotTV, alphaB * dotBV, dotNV ) );\n\t\tfloat gl = dotNV * length( vec3( alphaT * dotTL, alphaB * dotBL, dotNL ) );\n\t\tfloat v = 0.5 / ( gv + gl );\n\t\treturn saturate(v);\n\t}\n\tfloat D_GGX_Anisotropic( const in float alphaT, const in float alphaB, const in float dotNH, const in float dotTH, const in float dotBH ) {\n\t\tfloat a2 = alphaT * alphaB;\n\t\thighp vec3 v = vec3( alphaB * dotTH, alphaT * dotBH, a2 * dotNH );\n\t\thighp float v2 = dot( v, v );\n\t\tfloat w2 = a2 / v2;\n\t\treturn RECIPROCAL_PI * a2 * pow2 ( w2 );\n\t}\n#endif\n#ifdef USE_CLEARCOAT\n\tvec3 BRDF_GGX_Clearcoat( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in PhysicalMaterial material) {\n\t\tvec3 f0 = material.clearcoatF0;\n\t\tfloat f90 = material.clearcoatF90;\n\t\tfloat roughness = material.clearcoatRoughness;\n\t\tfloat alpha = pow2( roughness );\n\t\tvec3 halfDir = normalize( lightDir + viewDir );\n\t\tfloat dotNL = saturate( dot( normal, lightDir ) );\n\t\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\t\tfloat dotNH = saturate( dot( normal, halfDir ) );\n\t\tfloat dotVH = saturate( dot( viewDir, halfDir ) );\n\t\tvec3 F = F_Schlick( f0, f90, dotVH );\n\t\tfloat V = V_GGX_SmithCorrelated( alpha, dotNL, dotNV );\n\t\tfloat D = D_GGX( alpha, dotNH );\n\t\treturn F * ( V * D );\n\t}\n#endif\nvec3 BRDF_GGX( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in PhysicalMaterial material ) {\n\tvec3 f0 = material.specularColor;\n\tfloat f90 = material.specularF90;\n\tfloat roughness = material.roughness;\n\tfloat alpha = pow2( roughness );\n\tvec3 halfDir = normalize( lightDir + viewDir );\n\tfloat dotNL = saturate( dot( normal, lightDir ) );\n\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\tfloat dotNH = saturate( dot( normal, halfDir ) );\n\tfloat dotVH = saturate( dot( viewDir, halfDir ) );\n\tvec3 F = F_Schlick( f0, f90, dotVH );\n\t#ifdef USE_IRIDESCENCE\n\t\tF = mix( F, material.iridescenceFresnel, material.iridescence );\n\t#endif\n\t#ifdef USE_ANISOTROPY\n\t\tfloat dotTL = dot( material.anisotropyT, lightDir );\n\t\tfloat dotTV = dot( material.anisotropyT, viewDir );\n\t\tfloat dotTH = dot( material.anisotropyT, halfDir );\n\t\tfloat dotBL = dot( material.anisotropyB, lightDir );\n\t\tfloat dotBV = dot( material.anisotropyB, viewDir );\n\t\tfloat dotBH = dot( material.anisotropyB, halfDir );\n\t\tfloat V = V_GGX_SmithCorrelated_Anisotropic( material.alphaT, alpha, dotTV, dotBV, dotTL, dotBL, dotNV, dotNL );\n\t\tfloat D = D_GGX_Anisotropic( material.alphaT, alpha, dotNH, dotTH, dotBH );\n\t#else\n\t\tfloat V = V_GGX_SmithCorrelated( alpha, dotNL, dotNV );\n\t\tfloat D = D_GGX( alpha, dotNH );\n\t#endif\n\treturn F * ( V * D );\n}\nvec2 LTC_Uv( const in vec3 N, const in vec3 V, const in float roughness ) {\n\tconst float LUT_SIZE = 64.0;\n\tconst float LUT_SCALE = ( LUT_SIZE - 1.0 ) / LUT_SIZE;\n\tconst float LUT_BIAS = 0.5 / LUT_SIZE;\n\tfloat dotNV = saturate( dot( N, V ) );\n\tvec2 uv = vec2( roughness, sqrt( 1.0 - dotNV ) );\n\tuv = uv * LUT_SCALE + LUT_BIAS;\n\treturn uv;\n}\nfloat LTC_ClippedSphereFormFactor( const in vec3 f ) {\n\tfloat l = length( f );\n\treturn max( ( l * l + f.z ) / ( l + 1.0 ), 0.0 );\n}\nvec3 LTC_EdgeVectorFormFactor( const in vec3 v1, const in vec3 v2 ) {\n\tfloat x = dot( v1, v2 );\n\tfloat y = abs( x );\n\tfloat a = 0.8543985 + ( 0.4965155 + 0.0145206 * y ) * y;\n\tfloat b = 3.4175940 + ( 4.1616724 + y ) * y;\n\tfloat v = a / b;\n\tfloat theta_sintheta = ( x > 0.0 ) ? v : 0.5 * inversesqrt( max( 1.0 - x * x, 1e-7 ) ) - v;\n\treturn cross( v1, v2 ) * theta_sintheta;\n}\nvec3 LTC_Evaluate( const in vec3 N, const in vec3 V, const in vec3 P, const in mat3 mInv, const in vec3 rectCoords[ 4 ] ) {\n\tvec3 v1 = rectCoords[ 1 ] - rectCoords[ 0 ];\n\tvec3 v2 = rectCoords[ 3 ] - rectCoords[ 0 ];\n\tvec3 lightNormal = cross( v1, v2 );\n\tif( dot( lightNormal, P - rectCoords[ 0 ] ) < 0.0 ) return vec3( 0.0 );\n\tvec3 T1, T2;\n\tT1 = normalize( V - N * dot( V, N ) );\n\tT2 = - cross( N, T1 );\n\tmat3 mat = mInv * transposeMat3( mat3( T1, T2, N ) );\n\tvec3 coords[ 4 ];\n\tcoords[ 0 ] = mat * ( rectCoords[ 0 ] - P );\n\tcoords[ 1 ] = mat * ( rectCoords[ 1 ] - P );\n\tcoords[ 2 ] = mat * ( rectCoords[ 2 ] - P );\n\tcoords[ 3 ] = mat * ( rectCoords[ 3 ] - P );\n\tcoords[ 0 ] = normalize( coords[ 0 ] );\n\tcoords[ 1 ] = normalize( coords[ 1 ] );\n\tcoords[ 2 ] = normalize( coords[ 2 ] );\n\tcoords[ 3 ] = normalize( coords[ 3 ] );\n\tvec3 vectorFormFactor = vec3( 0.0 );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 0 ], coords[ 1 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 1 ], coords[ 2 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 2 ], coords[ 3 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 3 ], coords[ 0 ] );\n\tfloat result = LTC_ClippedSphereFormFactor( vectorFormFactor );\n\treturn vec3( result );\n}\n#if defined( USE_SHEEN )\nfloat D_Charlie( float roughness, float dotNH ) {\n\tfloat alpha = pow2( roughness );\n\tfloat invAlpha = 1.0 / alpha;\n\tfloat cos2h = dotNH * dotNH;\n\tfloat sin2h = max( 1.0 - cos2h, 0.0078125 );\n\treturn ( 2.0 + invAlpha ) * pow( sin2h, invAlpha * 0.5 ) / ( 2.0 * PI );\n}\nfloat V_Neubelt( float dotNV, float dotNL ) {\n\treturn saturate( 1.0 / ( 4.0 * ( dotNL + dotNV - dotNL * dotNV ) ) );\n}\nvec3 BRDF_Sheen( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, vec3 sheenColor, const in float sheenRoughness ) {\n\tvec3 halfDir = normalize( lightDir + viewDir );\n\tfloat dotNL = saturate( dot( normal, lightDir ) );\n\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\tfloat dotNH = saturate( dot( normal, halfDir ) );\n\tfloat D = D_Charlie( sheenRoughness, dotNH );\n\tfloat V = V_Neubelt( dotNV, dotNL );\n\treturn sheenColor * ( D * V );\n}\n#endif\nfloat IBLSheenBRDF( const in vec3 normal, const in vec3 viewDir, const in float roughness ) {\n\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\tfloat r2 = roughness * roughness;\n\tfloat a = roughness < 0.25 ? -339.2 * r2 + 161.4 * roughness - 25.9 : -8.48 * r2 + 14.3 * roughness - 9.95;\n\tfloat b = roughness < 0.25 ? 44.0 * r2 - 23.7 * roughness + 3.26 : 1.97 * r2 - 3.27 * roughness + 0.72;\n\tfloat DG = exp( a * dotNV + b ) + ( roughness < 0.25 ? 0.0 : 0.1 * ( roughness - 0.25 ) );\n\treturn saturate( DG * RECIPROCAL_PI );\n}\nvec2 DFGApprox( const in vec3 normal, const in vec3 viewDir, const in float roughness ) {\n\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\tconst vec4 c0 = vec4( - 1, - 0.0275, - 0.572, 0.022 );\n\tconst vec4 c1 = vec4( 1, 0.0425, 1.04, - 0.04 );\n\tvec4 r = roughness * c0 + c1;\n\tfloat a004 = min( r.x * r.x, exp2( - 9.28 * dotNV ) ) * r.x + r.y;\n\tvec2 fab = vec2( - 1.04, 1.04 ) * a004 + r.zw;\n\treturn fab;\n}\nvec3 EnvironmentBRDF( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float roughness ) {\n\tvec2 fab = DFGApprox( normal, viewDir, roughness );\n\treturn specularColor * fab.x + specularF90 * fab.y;\n}\n#ifdef USE_IRIDESCENCE\nvoid computeMultiscatteringIridescence( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float iridescence, const in vec3 iridescenceF0, const in float roughness, inout vec3 singleScatter, inout vec3 multiScatter ) {\n#else\nvoid computeMultiscattering( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float roughness, inout vec3 singleScatter, inout vec3 multiScatter ) {\n#endif\n\tvec2 fab = DFGApprox( normal, viewDir, roughness );\n\t#ifdef USE_IRIDESCENCE\n\t\tvec3 Fr = mix( specularColor, iridescenceF0, iridescence );\n\t#else\n\t\tvec3 Fr = specularColor;\n\t#endif\n\tvec3 FssEss = Fr * fab.x + specularF90 * fab.y;\n\tfloat Ess = fab.x + fab.y;\n\tfloat Ems = 1.0 - Ess;\n\tvec3 Favg = Fr + ( 1.0 - Fr ) * 0.047619;\tvec3 Fms = FssEss * Favg / ( 1.0 - Ems * Favg );\n\tsingleScatter += FssEss;\n\tmultiScatter += Fms * Ems;\n}\n#if NUM_RECT_AREA_LIGHTS > 0\n\tvoid RE_Direct_RectArea_Physical( const in RectAreaLight rectAreaLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\t\tvec3 normal = geometryNormal;\n\t\tvec3 viewDir = geometryViewDir;\n\t\tvec3 position = geometryPosition;\n\t\tvec3 lightPos = rectAreaLight.position;\n\t\tvec3 halfWidth = rectAreaLight.halfWidth;\n\t\tvec3 halfHeight = rectAreaLight.halfHeight;\n\t\tvec3 lightColor = rectAreaLight.color;\n\t\tfloat roughness = material.roughness;\n\t\tvec3 rectCoords[ 4 ];\n\t\trectCoords[ 0 ] = lightPos + halfWidth - halfHeight;\t\trectCoords[ 1 ] = lightPos - halfWidth - halfHeight;\n\t\trectCoords[ 2 ] = lightPos - halfWidth + halfHeight;\n\t\trectCoords[ 3 ] = lightPos + halfWidth + halfHeight;\n\t\tvec2 uv = LTC_Uv( normal, viewDir, roughness );\n\t\tvec4 t1 = texture2D( ltc_1, uv );\n\t\tvec4 t2 = texture2D( ltc_2, uv );\n\t\tmat3 mInv = mat3(\n\t\t\tvec3( t1.x, 0, t1.y ),\n\t\t\tvec3( 0, 1, 0 ),\n\t\t\tvec3( t1.z, 0, t1.w )\n\t\t);\n\t\tvec3 fresnel = ( material.specularColor * t2.x + ( vec3( 1.0 ) - material.specularColor ) * t2.y );\n\t\treflectedLight.directSpecular += lightColor * fresnel * LTC_Evaluate( normal, viewDir, position, mInv, rectCoords );\n\t\treflectedLight.directDiffuse += lightColor * material.diffuseColor * LTC_Evaluate( normal, viewDir, position, mat3( 1.0 ), rectCoords );\n\t}\n#endif\nvoid RE_Direct_Physical( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\tfloat dotNL = saturate( dot( geometryNormal, directLight.direction ) );\n\tvec3 irradiance = dotNL * directLight.color;\n\t#ifdef USE_CLEARCOAT\n\t\tfloat dotNLcc = saturate( dot( geometryClearcoatNormal, directLight.direction ) );\n\t\tvec3 ccIrradiance = dotNLcc * directLight.color;\n\t\tclearcoatSpecularDirect += ccIrradiance * BRDF_GGX_Clearcoat( directLight.direction, geometryViewDir, geometryClearcoatNormal, material );\n\t#endif\n\t#ifdef USE_SHEEN\n\t\tsheenSpecularDirect += irradiance * BRDF_Sheen( directLight.direction, geometryViewDir, geometryNormal, material.sheenColor, material.sheenRoughness );\n\t#endif\n\treflectedLight.directSpecular += irradiance * BRDF_GGX( directLight.direction, geometryViewDir, geometryNormal, material );\n\treflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectDiffuse_Physical( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectSpecular_Physical( const in vec3 radiance, const in vec3 irradiance, const in vec3 clearcoatRadiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight) {\n\t#ifdef USE_CLEARCOAT\n\t\tclearcoatSpecularIndirect += clearcoatRadiance * EnvironmentBRDF( geometryClearcoatNormal, geometryViewDir, material.clearcoatF0, material.clearcoatF90, material.clearcoatRoughness );\n\t#endif\n\t#ifdef USE_SHEEN\n\t\tsheenSpecularIndirect += irradiance * material.sheenColor * IBLSheenBRDF( geometryNormal, geometryViewDir, material.sheenRoughness );\n\t#endif\n\tvec3 singleScattering = vec3( 0.0 );\n\tvec3 multiScattering = vec3( 0.0 );\n\tvec3 cosineWeightedIrradiance = irradiance * RECIPROCAL_PI;\n\t#ifdef USE_IRIDESCENCE\n\t\tcomputeMultiscatteringIridescence( geometryNormal, geometryViewDir, material.specularColor, material.specularF90, material.iridescence, material.iridescenceFresnel, material.roughness, singleScattering, multiScattering );\n\t#else\n\t\tcomputeMultiscattering( geometryNormal, geometryViewDir, material.specularColor, material.specularF90, material.roughness, singleScattering, multiScattering );\n\t#endif\n\tvec3 totalScattering = singleScattering + multiScattering;\n\tvec3 diffuse = material.diffuseColor * ( 1.0 - max( max( totalScattering.r, totalScattering.g ), totalScattering.b ) );\n\treflectedLight.indirectSpecular += radiance * singleScattering;\n\treflectedLight.indirectSpecular += multiScattering * cosineWeightedIrradiance;\n\treflectedLight.indirectDiffuse += diffuse * cosineWeightedIrradiance;\n}\n#define RE_Direct\t\t\t\tRE_Direct_Physical\n#define RE_Direct_RectArea\t\tRE_Direct_RectArea_Physical\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_Physical\n#define RE_IndirectSpecular\t\tRE_IndirectSpecular_Physical\nfloat computeSpecularOcclusion( const in float dotNV, const in float ambientOcclusion, const in float roughness ) {\n\treturn saturate( pow( dotNV + ambientOcclusion, exp2( - 16.0 * roughness - 1.0 ) ) - 1.0 + ambientOcclusion );\n}',
lights_fragment_begin:
'\nvec3 geometryPosition = - vViewPosition;\nvec3 geometryNormal = normal;\nvec3 geometryViewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( vViewPosition );\nvec3 geometryClearcoatNormal = vec3( 0.0 );\n#ifdef USE_CLEARCOAT\n\tgeometryClearcoatNormal = clearcoatNormal;\n#endif\n#ifdef USE_IRIDESCENCE\n\tfloat dotNVi = saturate( dot( normal, geometryViewDir ) );\n\tif ( material.iridescenceThickness == 0.0 ) {\n\t\tmaterial.iridescence = 0.0;\n\t} else {\n\t\tmaterial.iridescence = saturate( material.iridescence );\n\t}\n\tif ( material.iridescence > 0.0 ) {\n\t\tmaterial.iridescenceFresnel = evalIridescence( 1.0, material.iridescenceIOR, dotNVi, material.iridescenceThickness, material.specularColor );\n\t\tmaterial.iridescenceF0 = Schlick_to_F0( material.iridescenceFresnel, 1.0, dotNVi );\n\t}\n#endif\nIncidentLight directLight;\n#if ( NUM_POINT_LIGHTS > 0 ) && defined( RE_Direct )\n\tPointLight pointLight;\n\t#if defined( USE_SHADOWMAP ) && NUM_POINT_LIGHT_SHADOWS > 0\n\tPointLightShadow pointLightShadow;\n\t#endif\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n\t\tpointLight = pointLights[ i ];\n\t\tgetPointLightInfo( pointLight, geometryPosition, directLight );\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_POINT_LIGHT_SHADOWS )\n\t\tpointLightShadow = pointLightShadows[ i ];\n\t\tdirectLight.color *= ( directLight.visible && receiveShadow ) ? getPointShadow( pointShadowMap[ i ], pointLightShadow.shadowMapSize, pointLightShadow.shadowIntensity, pointLightShadow.shadowBias, pointLightShadow.shadowRadius, vPointShadowCoord[ i ], pointLightShadow.shadowCameraNear, pointLightShadow.shadowCameraFar ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if ( NUM_SPOT_LIGHTS > 0 ) && defined( RE_Direct )\n\tSpotLight spotLight;\n\tvec4 spotColor;\n\tvec3 spotLightCoord;\n\tbool inSpotLightMap;\n\t#if defined( USE_SHADOWMAP ) && NUM_SPOT_LIGHT_SHADOWS > 0\n\tSpotLightShadow spotLightShadow;\n\t#endif\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n\t\tspotLight = spotLights[ i ];\n\t\tgetSpotLightInfo( spotLight, geometryPosition, directLight );\n\t\t#if ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS )\n\t\t#define SPOT_LIGHT_MAP_INDEX UNROLLED_LOOP_INDEX\n\t\t#elif ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )\n\t\t#define SPOT_LIGHT_MAP_INDEX NUM_SPOT_LIGHT_MAPS\n\t\t#else\n\t\t#define SPOT_LIGHT_MAP_INDEX ( UNROLLED_LOOP_INDEX - NUM_SPOT_LIGHT_SHADOWS + NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS )\n\t\t#endif\n\t\t#if ( SPOT_LIGHT_MAP_INDEX < NUM_SPOT_LIGHT_MAPS )\n\t\t\tspotLightCoord = vSpotLightCoord[ i ].xyz / vSpotLightCoord[ i ].w;\n\t\t\tinSpotLightMap = all( lessThan( abs( spotLightCoord * 2. - 1. ), vec3( 1.0 ) ) );\n\t\t\tspotColor = texture2D( spotLightMap[ SPOT_LIGHT_MAP_INDEX ], spotLightCoord.xy );\n\t\t\tdirectLight.color = inSpotLightMap ? directLight.color * spotColor.rgb : directLight.color;\n\t\t#endif\n\t\t#undef SPOT_LIGHT_MAP_INDEX\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )\n\t\tspotLightShadow = spotLightShadows[ i ];\n\t\tdirectLight.color *= ( directLight.visible && receiveShadow ) ? getShadow( spotShadowMap[ i ], spotLightShadow.shadowMapSize, spotLightShadow.shadowIntensity, spotLightShadow.shadowBias, spotLightShadow.shadowRadius, vSpotLightCoord[ i ] ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if ( NUM_DIR_LIGHTS > 0 ) && defined( RE_Direct )\n\tDirectionalLight directionalLight;\n\t#if defined( USE_SHADOWMAP ) && NUM_DIR_LIGHT_SHADOWS > 0\n\tDirectionalLightShadow directionalLightShadow;\n\t#endif\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n\t\tdirectionalLight = directionalLights[ i ];\n\t\tgetDirectionalLightInfo( directionalLight, directLight );\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_DIR_LIGHT_SHADOWS )\n\t\tdirectionalLightShadow = directionalLightShadows[ i ];\n\t\tdirectLight.color *= ( directLight.visible && receiveShadow ) ? getShadow( directionalShadowMap[ i ], directionalLightShadow.shadowMapSize, directionalLightShadow.shadowIntensity, directionalLightShadow.shadowBias, directionalLightShadow.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if ( NUM_RECT_AREA_LIGHTS > 0 ) && defined( RE_Direct_RectArea )\n\tRectAreaLight rectAreaLight;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_RECT_AREA_LIGHTS; i ++ ) {\n\t\trectAreaLight = rectAreaLights[ i ];\n\t\tRE_Direct_RectArea( rectAreaLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if defined( RE_IndirectDiffuse )\n\tvec3 iblIrradiance = vec3( 0.0 );\n\tvec3 irradiance = getAmbientLightIrradiance( ambientLightColor );\n\t#if defined( USE_LIGHT_PROBES )\n\t\tirradiance += getLightProbeIrradiance( lightProbe, geometryNormal );\n\t#endif\n\t#if ( NUM_HEMI_LIGHTS > 0 )\n\t\t#pragma unroll_loop_start\n\t\tfor ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {\n\t\t\tirradiance += getHemisphereLightIrradiance( hemisphereLights[ i ], geometryNormal );\n\t\t}\n\t\t#pragma unroll_loop_end\n\t#endif\n#endif\n#if defined( RE_IndirectSpecular )\n\tvec3 radiance = vec3( 0.0 );\n\tvec3 clearcoatRadiance = vec3( 0.0 );\n#endif',
lights_fragment_maps:
'#if defined( RE_IndirectDiffuse )\n\t#ifdef USE_LIGHTMAP\n\t\tvec4 lightMapTexel = texture2D( lightMap, vLightMapUv );\n\t\tvec3 lightMapIrradiance = lightMapTexel.rgb * lightMapIntensity;\n\t\tirradiance += lightMapIrradiance;\n\t#endif\n\t#if defined( USE_ENVMAP ) && defined( STANDARD ) && defined( ENVMAP_TYPE_CUBE_UV )\n\t\tiblIrradiance += getIBLIrradiance( geometryNormal );\n\t#endif\n#endif\n#if defined( USE_ENVMAP ) && defined( RE_IndirectSpecular )\n\t#ifdef USE_ANISOTROPY\n\t\tradiance += getIBLAnisotropyRadiance( geometryViewDir, geometryNormal, material.roughness, material.anisotropyB, material.anisotropy );\n\t#else\n\t\tradiance += getIBLRadiance( geometryViewDir, geometryNormal, material.roughness );\n\t#endif\n\t#ifdef USE_CLEARCOAT\n\t\tclearcoatRadiance += getIBLRadiance( geometryViewDir, geometryClearcoatNormal, material.clearcoatRoughness );\n\t#endif\n#endif',
lights_fragment_end:
'#if defined( RE_IndirectDiffuse )\n\tRE_IndirectDiffuse( irradiance, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );\n#endif\n#if defined( RE_IndirectSpecular )\n\tRE_IndirectSpecular( radiance, iblIrradiance, clearcoatRadiance, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );\n#endif',
logdepthbuf_fragment:
'#if defined( USE_LOGDEPTHBUF )\n\tgl_FragDepth = vIsPerspective == 0.0 ? gl_FragCoord.z : log2( vFragDepth ) * logDepthBufFC * 0.5;\n#endif',
logdepthbuf_pars_fragment:
'#if defined( USE_LOGDEPTHBUF )\n\tuniform float logDepthBufFC;\n\tvarying float vFragDepth;\n\tvarying float vIsPerspective;\n#endif',
logdepthbuf_pars_vertex:
'#ifdef USE_LOGDEPTHBUF\n\tvarying float vFragDepth;\n\tvarying float vIsPerspective;\n#endif',
logdepthbuf_vertex:
'#ifdef USE_LOGDEPTHBUF\n\tvFragDepth = 1.0 + gl_Position.w;\n\tvIsPerspective = float( isPerspectiveMatrix( projectionMatrix ) );\n#endif',
map_fragment:
'#ifdef USE_MAP\n\tvec4 sampledDiffuseColor = texture2D( map, vMapUv );\n\t#ifdef DECODE_VIDEO_TEXTURE\n\t\tsampledDiffuseColor = sRGBTransferEOTF( sampledDiffuseColor );\n\t#endif\n\tdiffuseColor *= sampledDiffuseColor;\n#endif',
map_pars_fragment: '#ifdef USE_MAP\n\tuniform sampler2D map;\n#endif',
map_particle_fragment:
'#if defined( USE_MAP ) || defined( USE_ALPHAMAP )\n\t#if defined( USE_POINTS_UV )\n\t\tvec2 uv = vUv;\n\t#else\n\t\tvec2 uv = ( uvTransform * vec3( gl_PointCoord.x, 1.0 - gl_PointCoord.y, 1 ) ).xy;\n\t#endif\n#endif\n#ifdef USE_MAP\n\tdiffuseColor *= texture2D( map, uv );\n#endif\n#ifdef USE_ALPHAMAP\n\tdiffuseColor.a *= texture2D( alphaMap, uv ).g;\n#endif',
map_particle_pars_fragment:
'#if defined( USE_POINTS_UV )\n\tvarying vec2 vUv;\n#else\n\t#if defined( USE_MAP ) || defined( USE_ALPHAMAP )\n\t\tuniform mat3 uvTransform;\n\t#endif\n#endif\n#ifdef USE_MAP\n\tuniform sampler2D map;\n#endif\n#ifdef USE_ALPHAMAP\n\tuniform sampler2D alphaMap;\n#endif',
metalnessmap_fragment:
'float metalnessFactor = metalness;\n#ifdef USE_METALNESSMAP\n\tvec4 texelMetalness = texture2D( metalnessMap, vMetalnessMapUv );\n\tmetalnessFactor *= texelMetalness.b;\n#endif',
metalnessmap_pars_fragment:
'#ifdef USE_METALNESSMAP\n\tuniform sampler2D metalnessMap;\n#endif',
morphinstance_vertex:
'#ifdef USE_INSTANCING_MORPH\n\tfloat morphTargetInfluences[ MORPHTARGETS_COUNT ];\n\tfloat morphTargetBaseInfluence = texelFetch( morphTexture, ivec2( 0, gl_InstanceID ), 0 ).r;\n\tfor ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {\n\t\tmorphTargetInfluences[i] = texelFetch( morphTexture, ivec2( i + 1, gl_InstanceID ), 0 ).r;\n\t}\n#endif',
morphcolor_vertex:
'#if defined( USE_MORPHCOLORS )\n\tvColor *= morphTargetBaseInfluence;\n\tfor ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {\n\t\t#if defined( USE_COLOR_ALPHA )\n\t\t\tif ( morphTargetInfluences[ i ] != 0.0 ) vColor += getMorph( gl_VertexID, i, 2 ) * morphTargetInfluences[ i ];\n\t\t#elif defined( USE_COLOR )\n\t\t\tif ( morphTargetInfluences[ i ] != 0.0 ) vColor += getMorph( gl_VertexID, i, 2 ).rgb * morphTargetInfluences[ i ];\n\t\t#endif\n\t}\n#endif',
morphnormal_vertex:
'#ifdef USE_MORPHNORMALS\n\tobjectNormal *= morphTargetBaseInfluence;\n\tfor ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {\n\t\tif ( morphTargetInfluences[ i ] != 0.0 ) objectNormal += getMorph( gl_VertexID, i, 1 ).xyz * morphTargetInfluences[ i ];\n\t}\n#endif',
morphtarget_pars_vertex:
'#ifdef USE_MORPHTARGETS\n\t#ifndef USE_INSTANCING_MORPH\n\t\tuniform float morphTargetBaseInfluence;\n\t\tuniform float morphTargetInfluences[ MORPHTARGETS_COUNT ];\n\t#endif\n\tuniform sampler2DArray morphTargetsTexture;\n\tuniform ivec2 morphTargetsTextureSize;\n\tvec4 getMorph( const in int vertexIndex, const in int morphTargetIndex, const in int offset ) {\n\t\tint texelIndex = vertexIndex * MORPHTARGETS_TEXTURE_STRIDE + offset;\n\t\tint y = texelIndex / morphTargetsTextureSize.x;\n\t\tint x = texelIndex - y * morphTargetsTextureSize.x;\n\t\tivec3 morphUV = ivec3( x, y, morphTargetIndex );\n\t\treturn texelFetch( morphTargetsTexture, morphUV, 0 );\n\t}\n#endif',
morphtarget_vertex:
'#ifdef USE_MORPHTARGETS\n\ttransformed *= morphTargetBaseInfluence;\n\tfor ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {\n\t\tif ( morphTargetInfluences[ i ] != 0.0 ) transformed += getMorph( gl_VertexID, i, 0 ).xyz * morphTargetInfluences[ i ];\n\t}\n#endif',
normal_fragment_begin:
'float faceDirection = gl_FrontFacing ? 1.0 : - 1.0;\n#ifdef FLAT_SHADED\n\tvec3 fdx = dFdx( vViewPosition );\n\tvec3 fdy = dFdy( vViewPosition );\n\tvec3 normal = normalize( cross( fdx, fdy ) );\n#else\n\tvec3 normal = normalize( vNormal );\n\t#ifdef DOUBLE_SIDED\n\t\tnormal *= faceDirection;\n\t#endif\n#endif\n#if defined( USE_NORMALMAP_TANGENTSPACE ) || defined( USE_CLEARCOAT_NORMALMAP ) || defined( USE_ANISOTROPY )\n\t#ifdef USE_TANGENT\n\t\tmat3 tbn = mat3( normalize( vTangent ), normalize( vBitangent ), normal );\n\t#else\n\t\tmat3 tbn = getTangentFrame( - vViewPosition, normal,\n\t\t#if defined( USE_NORMALMAP )\n\t\t\tvNormalMapUv\n\t\t#elif defined( USE_CLEARCOAT_NORMALMAP )\n\t\t\tvClearcoatNormalMapUv\n\t\t#else\n\t\t\tvUv\n\t\t#endif\n\t\t);\n\t#endif\n\t#if defined( DOUBLE_SIDED ) && ! defined( FLAT_SHADED )\n\t\ttbn[0] *= faceDirection;\n\t\ttbn[1] *= faceDirection;\n\t#endif\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n\t#ifdef USE_TANGENT\n\t\tmat3 tbn2 = mat3( normalize( vTangent ), normalize( vBitangent ), normal );\n\t#else\n\t\tmat3 tbn2 = getTangentFrame( - vViewPosition, normal, vClearcoatNormalMapUv );\n\t#endif\n\t#if defined( DOUBLE_SIDED ) && ! defined( FLAT_SHADED )\n\t\ttbn2[0] *= faceDirection;\n\t\ttbn2[1] *= faceDirection;\n\t#endif\n#endif\nvec3 nonPerturbedNormal = normal;',
normal_fragment_maps:
'#ifdef USE_NORMALMAP_OBJECTSPACE\n\tnormal = texture2D( normalMap, vNormalMapUv ).xyz * 2.0 - 1.0;\n\t#ifdef FLIP_SIDED\n\t\tnormal = - normal;\n\t#endif\n\t#ifdef DOUBLE_SIDED\n\t\tnormal = normal * faceDirection;\n\t#endif\n\tnormal = normalize( normalMatrix * normal );\n#elif defined( USE_NORMALMAP_TANGENTSPACE )\n\tvec3 mapN = texture2D( normalMap, vNormalMapUv ).xyz * 2.0 - 1.0;\n\tmapN.xy *= normalScale;\n\tnormal = normalize( tbn * mapN );\n#elif defined( USE_BUMPMAP )\n\tnormal = perturbNormalArb( - vViewPosition, normal, dHdxy_fwd(), faceDirection );\n#endif',
normal_pars_fragment:
'#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n\t#ifdef USE_TANGENT\n\t\tvarying vec3 vTangent;\n\t\tvarying vec3 vBitangent;\n\t#endif\n#endif',
normal_pars_vertex:
'#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n\t#ifdef USE_TANGENT\n\t\tvarying vec3 vTangent;\n\t\tvarying vec3 vBitangent;\n\t#endif\n#endif',
normal_vertex:
'#ifndef FLAT_SHADED\n\tvNormal = normalize( transformedNormal );\n\t#ifdef USE_TANGENT\n\t\tvTangent = normalize( transformedTangent );\n\t\tvBitangent = normalize( cross( vNormal, vTangent ) * tangent.w );\n\t#endif\n#endif',
normalmap_pars_fragment:
'#ifdef USE_NORMALMAP\n\tuniform sampler2D normalMap;\n\tuniform vec2 normalScale;\n#endif\n#ifdef USE_NORMALMAP_OBJECTSPACE\n\tuniform mat3 normalMatrix;\n#endif\n#if ! defined ( USE_TANGENT ) && ( defined ( USE_NORMALMAP_TANGENTSPACE ) || defined ( USE_CLEARCOAT_NORMALMAP ) || defined( USE_ANISOTROPY ) )\n\tmat3 getTangentFrame( vec3 eye_pos, vec3 surf_norm, vec2 uv ) {\n\t\tvec3 q0 = dFdx( eye_pos.xyz );\n\t\tvec3 q1 = dFdy( eye_pos.xyz );\n\t\tvec2 st0 = dFdx( uv.st );\n\t\tvec2 st1 = dFdy( uv.st );\n\t\tvec3 N = surf_norm;\n\t\tvec3 q1perp = cross( q1, N );\n\t\tvec3 q0perp = cross( N, q0 );\n\t\tvec3 T = q1perp * st0.x + q0perp * st1.x;\n\t\tvec3 B = q1perp * st0.y + q0perp * st1.y;\n\t\tfloat det = max( dot( T, T ), dot( B, B ) );\n\t\tfloat scale = ( det == 0.0 ) ? 0.0 : inversesqrt( det );\n\t\treturn mat3( T * scale, B * scale, N );\n\t}\n#endif',
clearcoat_normal_fragment_begin:
'#ifdef USE_CLEARCOAT\n\tvec3 clearcoatNormal = nonPerturbedNormal;\n#endif',
clearcoat_normal_fragment_maps:
'#ifdef USE_CLEARCOAT_NORMALMAP\n\tvec3 clearcoatMapN = texture2D( clearcoatNormalMap, vClearcoatNormalMapUv ).xyz * 2.0 - 1.0;\n\tclearcoatMapN.xy *= clearcoatNormalScale;\n\tclearcoatNormal = normalize( tbn2 * clearcoatMapN );\n#endif',
clearcoat_pars_fragment:
'#ifdef USE_CLEARCOATMAP\n\tuniform sampler2D clearcoatMap;\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n\tuniform sampler2D clearcoatNormalMap;\n\tuniform vec2 clearcoatNormalScale;\n#endif\n#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\tuniform sampler2D clearcoatRoughnessMap;\n#endif',
iridescence_pars_fragment:
'#ifdef USE_IRIDESCENCEMAP\n\tuniform sampler2D iridescenceMap;\n#endif\n#ifdef USE_IRIDESCENCE_THICKNESSMAP\n\tuniform sampler2D iridescenceThicknessMap;\n#endif',
opaque_fragment:
'#ifdef OPAQUE\ndiffuseColor.a = 1.0;\n#endif\n#ifdef USE_TRANSMISSION\ndiffuseColor.a *= material.transmissionAlpha;\n#endif\ngl_FragColor = vec4( outgoingLight, diffuseColor.a );',
packing:
'vec3 packNormalToRGB( const in vec3 normal ) {\n\treturn normalize( normal ) * 0.5 + 0.5;\n}\nvec3 unpackRGBToNormal( const in vec3 rgb ) {\n\treturn 2.0 * rgb.xyz - 1.0;\n}\nconst float PackUpscale = 256. / 255.;const float UnpackDownscale = 255. / 256.;const float ShiftRight8 = 1. / 256.;\nconst float Inv255 = 1. / 255.;\nconst vec4 PackFactors = vec4( 1.0, 256.0, 256.0 * 256.0, 256.0 * 256.0 * 256.0 );\nconst vec2 UnpackFactors2 = vec2( UnpackDownscale, 1.0 / PackFactors.g );\nconst vec3 UnpackFactors3 = vec3( UnpackDownscale / PackFactors.rg, 1.0 / PackFactors.b );\nconst vec4 UnpackFactors4 = vec4( UnpackDownscale / PackFactors.rgb, 1.0 / PackFactors.a );\nvec4 packDepthToRGBA( const in float v ) {\n\tif( v <= 0.0 )\n\t\treturn vec4( 0., 0., 0., 0. );\n\tif( v >= 1.0 )\n\t\treturn vec4( 1., 1., 1., 1. );\n\tfloat vuf;\n\tfloat af = modf( v * PackFactors.a, vuf );\n\tfloat bf = modf( vuf * ShiftRight8, vuf );\n\tfloat gf = modf( vuf * ShiftRight8, vuf );\n\treturn vec4( vuf * Inv255, gf * PackUpscale, bf * PackUpscale, af );\n}\nvec3 packDepthToRGB( const in float v ) {\n\tif( v <= 0.0 )\n\t\treturn vec3( 0., 0., 0. );\n\tif( v >= 1.0 )\n\t\treturn vec3( 1., 1., 1. );\n\tfloat vuf;\n\tfloat bf = modf( v * PackFactors.b, vuf );\n\tfloat gf = modf( vuf * ShiftRight8, vuf );\n\treturn vec3( vuf * Inv255, gf * PackUpscale, bf );\n}\nvec2 packDepthToRG( const in float v ) {\n\tif( v <= 0.0 )\n\t\treturn vec2( 0., 0. );\n\tif( v >= 1.0 )\n\t\treturn vec2( 1., 1. );\n\tfloat vuf;\n\tfloat gf = modf( v * 256., vuf );\n\treturn vec2( vuf * Inv255, gf );\n}\nfloat unpackRGBAToDepth( const in vec4 v ) {\n\treturn dot( v, UnpackFactors4 );\n}\nfloat unpackRGBToDepth( const in vec3 v ) {\n\treturn dot( v, UnpackFactors3 );\n}\nfloat unpackRGToDepth( const in vec2 v ) {\n\treturn v.r * UnpackFactors2.r + v.g * UnpackFactors2.g;\n}\nvec4 pack2HalfToRGBA( const in vec2 v ) {\n\tvec4 r = vec4( v.x, fract( v.x * 255.0 ), v.y, fract( v.y * 255.0 ) );\n\treturn vec4( r.x - r.y / 255.0, r.y, r.z - r.w / 255.0, r.w );\n}\nvec2 unpackRGBATo2Half( const in vec4 v ) {\n\treturn vec2( v.x + ( v.y / 255.0 ), v.z + ( v.w / 255.0 ) );\n}\nfloat viewZToOrthographicDepth( const in float viewZ, const in float near, const in float far ) {\n\treturn ( viewZ + near ) / ( near - far );\n}\nfloat orthographicDepthToViewZ( const in float depth, const in float near, const in float far ) {\n\treturn depth * ( near - far ) - near;\n}\nfloat viewZToPerspectiveDepth( const in float viewZ, const in float near, const in float far ) {\n\treturn ( ( near + viewZ ) * far ) / ( ( far - near ) * viewZ );\n}\nfloat perspectiveDepthToViewZ( const in float depth, const in float near, const in float far ) {\n\treturn ( near * far ) / ( ( far - near ) * depth - far );\n}',
premultiplied_alpha_fragment:
'#ifdef PREMULTIPLIED_ALPHA\n\tgl_FragColor.rgb *= gl_FragColor.a;\n#endif',
project_vertex:
'vec4 mvPosition = vec4( transformed, 1.0 );\n#ifdef USE_BATCHING\n\tmvPosition = batchingMatrix * mvPosition;\n#endif\n#ifdef USE_INSTANCING\n\tmvPosition = instanceMatrix * mvPosition;\n#endif\nmvPosition = modelViewMatrix * mvPosition;\ngl_Position = projectionMatrix * mvPosition;',
dithering_fragment:
'#ifdef DITHERING\n\tgl_FragColor.rgb = dithering( gl_FragColor.rgb );\n#endif',
dithering_pars_fragment:
'#ifdef DITHERING\n\tvec3 dithering( vec3 color ) {\n\t\tfloat grid_position = rand( gl_FragCoord.xy );\n\t\tvec3 dither_shift_RGB = vec3( 0.25 / 255.0, -0.25 / 255.0, 0.25 / 255.0 );\n\t\tdither_shift_RGB = mix( 2.0 * dither_shift_RGB, -2.0 * dither_shift_RGB, grid_position );\n\t\treturn color + dither_shift_RGB;\n\t}\n#endif',
roughnessmap_fragment:
'float roughnessFactor = roughness;\n#ifdef USE_ROUGHNESSMAP\n\tvec4 texelRoughness = texture2D( roughnessMap, vRoughnessMapUv );\n\troughnessFactor *= texelRoughness.g;\n#endif',
roughnessmap_pars_fragment:
'#ifdef USE_ROUGHNESSMAP\n\tuniform sampler2D roughnessMap;\n#endif',
shadowmap_pars_fragment:
'#if NUM_SPOT_LIGHT_COORDS > 0\n\tvarying vec4 vSpotLightCoord[ NUM_SPOT_LIGHT_COORDS ];\n#endif\n#if NUM_SPOT_LIGHT_MAPS > 0\n\tuniform sampler2D spotLightMap[ NUM_SPOT_LIGHT_MAPS ];\n#endif\n#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\t\tuniform sampler2D directionalShadowMap[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tvarying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tstruct DirectionalLightShadow {\n\t\t\tfloat shadowIntensity;\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\t\tuniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\t\tuniform sampler2D spotShadowMap[ NUM_SPOT_LIGHT_SHADOWS ];\n\t\tstruct SpotLightShadow {\n\t\t\tfloat shadowIntensity;\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\t\tuniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\t\tuniform sampler2D pointShadowMap[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tvarying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tstruct PointLightShadow {\n\t\t\tfloat shadowIntensity;\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t\tfloat shadowCameraNear;\n\t\t\tfloat shadowCameraFar;\n\t\t};\n\t\tuniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ];\n\t#endif\n\tfloat texture2DCompare( sampler2D depths, vec2 uv, float compare ) {\n\t\treturn step( compare, unpackRGBAToDepth( texture2D( depths, uv ) ) );\n\t}\n\tvec2 texture2DDistribution( sampler2D shadow, vec2 uv ) {\n\t\treturn unpackRGBATo2Half( texture2D( shadow, uv ) );\n\t}\n\tfloat VSMShadow (sampler2D shadow, vec2 uv, float compare ){\n\t\tfloat occlusion = 1.0;\n\t\tvec2 distribution = texture2DDistribution( shadow, uv );\n\t\tfloat hard_shadow = step( compare , distribution.x );\n\t\tif (hard_shadow != 1.0 ) {\n\t\t\tfloat distance = compare - distribution.x ;\n\t\t\tfloat variance = max( 0.00000, distribution.y * distribution.y );\n\t\t\tfloat softness_probability = variance / (variance + distance * distance );\t\t\tsoftness_probability = clamp( ( softness_probability - 0.3 ) / ( 0.95 - 0.3 ), 0.0, 1.0 );\t\t\tocclusion = clamp( max( hard_shadow, softness_probability ), 0.0, 1.0 );\n\t\t}\n\t\treturn occlusion;\n\t}\n\tfloat getShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowIntensity, float shadowBias, float shadowRadius, vec4 shadowCoord ) {\n\t\tfloat shadow = 1.0;\n\t\tshadowCoord.xyz /= shadowCoord.w;\n\t\tshadowCoord.z += shadowBias;\n\t\tbool inFrustum = shadowCoord.x >= 0.0 && shadowCoord.x <= 1.0 && shadowCoord.y >= 0.0 && shadowCoord.y <= 1.0;\n\t\tbool frustumTest = inFrustum && shadowCoord.z <= 1.0;\n\t\tif ( frustumTest ) {\n\t\t#if defined( SHADOWMAP_TYPE_PCF )\n\t\t\tvec2 texelSize = vec2( 1.0 ) / shadowMapSize;\n\t\t\tfloat dx0 = - texelSize.x * shadowRadius;\n\t\t\tfloat dy0 = - texelSize.y * shadowRadius;\n\t\t\tfloat dx1 = + texelSize.x * shadowRadius;\n\t\t\tfloat dy1 = + texelSize.y * shadowRadius;\n\t\t\tfloat dx2 = dx0 / 2.0;\n\t\t\tfloat dy2 = dy0 / 2.0;\n\t\t\tfloat dx3 = dx1 / 2.0;\n\t\t\tfloat dy3 = dy1 / 2.0;\n\t\t\tshadow = (\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy2 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy2 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy2 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy3 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy3 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy3 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy1 ), shadowCoord.z )\n\t\t\t) * ( 1.0 / 17.0 );\n\t\t#elif defined( SHADOWMAP_TYPE_PCF_SOFT )\n\t\t\tvec2 texelSize = vec2( 1.0 ) / shadowMapSize;\n\t\t\tfloat dx = texelSize.x;\n\t\t\tfloat dy = texelSize.y;\n\t\t\tvec2 uv = shadowCoord.xy;\n\t\t\tvec2 f = fract( uv * shadowMapSize + 0.5 );\n\t\t\tuv -= f * texelSize;\n\t\t\tshadow = (\n\t\t\t\ttexture2DCompare( shadowMap, uv, shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, uv + vec2( dx, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, uv + vec2( 0.0, dy ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, uv + texelSize, shadowCoord.z ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( -dx, 0.0 ), shadowCoord.z ),\n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 0.0 ), shadowCoord.z ),\n\t\t\t\t\t f.x ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( -dx, dy ), shadowCoord.z ),\n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, dy ), shadowCoord.z ),\n\t\t\t\t\t f.x ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( 0.0, -dy ), shadowCoord.z ),\n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 0.0, 2.0 * dy ), shadowCoord.z ),\n\t\t\t\t\t f.y ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( dx, -dy ), shadowCoord.z ),\n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( dx, 2.0 * dy ), shadowCoord.z ),\n\t\t\t\t\t f.y ) +\n\t\t\t\tmix( mix( texture2DCompare( shadowMap, uv + vec2( -dx, -dy ), shadowCoord.z ),\n\t\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, -dy ), shadowCoord.z ),\n\t\t\t\t\t\t f.x ),\n\t\t\t\t\t mix( texture2DCompare( shadowMap, uv + vec2( -dx, 2.0 * dy ), shadowCoord.z ),\n\t\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 2.0 * dy ), shadowCoord.z ),\n\t\t\t\t\t\t f.x ),\n\t\t\t\t\t f.y )\n\t\t\t) * ( 1.0 / 9.0 );\n\t\t#elif defined( SHADOWMAP_TYPE_VSM )\n\t\t\tshadow = VSMShadow( shadowMap, shadowCoord.xy, shadowCoord.z );\n\t\t#else\n\t\t\tshadow = texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z );\n\t\t#endif\n\t\t}\n\t\treturn mix( 1.0, shadow, shadowIntensity );\n\t}\n\tvec2 cubeToUV( vec3 v, float texelSizeY ) {\n\t\tvec3 absV = abs( v );\n\t\tfloat scaleToCube = 1.0 / max( absV.x, max( absV.y, absV.z ) );\n\t\tabsV *= scaleToCube;\n\t\tv *= scaleToCube * ( 1.0 - 2.0 * texelSizeY );\n\t\tvec2 planar = v.xy;\n\t\tfloat almostATexel = 1.5 * texelSizeY;\n\t\tfloat almostOne = 1.0 - almostATexel;\n\t\tif ( absV.z >= almostOne ) {\n\t\t\tif ( v.z > 0.0 )\n\t\t\t\tplanar.x = 4.0 - v.x;\n\t\t} else if ( absV.x >= almostOne ) {\n\t\t\tfloat signX = sign( v.x );\n\t\t\tplanar.x = v.z * signX + 2.0 * signX;\n\t\t} else if ( absV.y >= almostOne ) {\n\t\t\tfloat signY = sign( v.y );\n\t\t\tplanar.x = v.x + 2.0 * signY + 2.0;\n\t\t\tplanar.y = v.z * signY - 2.0;\n\t\t}\n\t\treturn vec2( 0.125, 0.25 ) * planar + vec2( 0.375, 0.75 );\n\t}\n\tfloat getPointShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowIntensity, float shadowBias, float shadowRadius, vec4 shadowCoord, float shadowCameraNear, float shadowCameraFar ) {\n\t\tfloat shadow = 1.0;\n\t\tvec3 lightToPosition = shadowCoord.xyz;\n\t\t\n\t\tfloat lightToPositionLength = length( lightToPosition );\n\t\tif ( lightToPositionLength - shadowCameraFar <= 0.0 && lightToPositionLength - shadowCameraNear >= 0.0 ) {\n\t\t\tfloat dp = ( lightToPositionLength - shadowCameraNear ) / ( shadowCameraFar - shadowCameraNear );\t\t\tdp += shadowBias;\n\t\t\tvec3 bd3D = normalize( lightToPosition );\n\t\t\tvec2 texelSize = vec2( 1.0 ) / ( shadowMapSize * vec2( 4.0, 2.0 ) );\n\t\t\t#if defined( SHADOWMAP_TYPE_PCF ) || defined( SHADOWMAP_TYPE_PCF_SOFT ) || defined( SHADOWMAP_TYPE_VSM )\n\t\t\t\tvec2 offset = vec2( - 1, 1 ) * shadowRadius * texelSize.y;\n\t\t\t\tshadow = (\n\t\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyy, texelSize.y ), dp ) +\n\t\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyy, texelSize.y ), dp ) +\n\t\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyx, texelSize.y ), dp ) +\n\t\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyx, texelSize.y ), dp ) +\n\t\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp ) +\n\t\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxy, texelSize.y ), dp ) +\n\t\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxy, texelSize.y ), dp ) +\n\t\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxx, texelSize.y ), dp ) +\n\t\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxx, texelSize.y ), dp )\n\t\t\t\t) * ( 1.0 / 9.0 );\n\t\t\t#else\n\t\t\t\tshadow = texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp );\n\t\t\t#endif\n\t\t}\n\t\treturn mix( 1.0, shadow, shadowIntensity );\n\t}\n#endif',
shadowmap_pars_vertex:
'#if NUM_SPOT_LIGHT_COORDS > 0\n\tuniform mat4 spotLightMatrix[ NUM_SPOT_LIGHT_COORDS ];\n\tvarying vec4 vSpotLightCoord[ NUM_SPOT_LIGHT_COORDS ];\n#endif\n#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\t\tuniform mat4 directionalShadowMatrix[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tvarying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tstruct DirectionalLightShadow {\n\t\t\tfloat shadowIntensity;\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\t\tuniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\t\tstruct SpotLightShadow {\n\t\t\tfloat shadowIntensity;\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\t\tuniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\t\tuniform mat4 pointShadowMatrix[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tvarying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tstruct PointLightShadow {\n\t\t\tfloat shadowIntensity;\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t\tfloat shadowCameraNear;\n\t\t\tfloat shadowCameraFar;\n\t\t};\n\t\tuniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ];\n\t#endif\n#endif',
shadowmap_vertex:
'#if ( defined( USE_SHADOWMAP ) && ( NUM_DIR_LIGHT_SHADOWS > 0 || NUM_POINT_LIGHT_SHADOWS > 0 ) ) || ( NUM_SPOT_LIGHT_COORDS > 0 )\n\tvec3 shadowWorldNormal = inverseTransformDirection( transformedNormal, viewMatrix );\n\tvec4 shadowWorldPosition;\n#endif\n#if defined( USE_SHADOWMAP )\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\t\t#pragma unroll_loop_start\n\t\tfor ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) {\n\t\t\tshadowWorldPosition = worldPosition + vec4( shadowWorldNormal * directionalLightShadows[ i ].shadowNormalBias, 0 );\n\t\t\tvDirectionalShadowCoord[ i ] = directionalShadowMatrix[ i ] * shadowWorldPosition;\n\t\t}\n\t\t#pragma unroll_loop_end\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\t\t#pragma unroll_loop_start\n\t\tfor ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) {\n\t\t\tshadowWorldPosition = worldPosition + vec4( shadowWorldNormal * pointLightShadows[ i ].shadowNormalBias, 0 );\n\t\t\tvPointShadowCoord[ i ] = pointShadowMatrix[ i ] * shadowWorldPosition;\n\t\t}\n\t\t#pragma unroll_loop_end\n\t#endif\n#endif\n#if NUM_SPOT_LIGHT_COORDS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_SPOT_LIGHT_COORDS; i ++ ) {\n\t\tshadowWorldPosition = worldPosition;\n\t\t#if ( defined( USE_SHADOWMAP ) && UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )\n\t\t\tshadowWorldPosition.xyz += shadowWorldNormal * spotLightShadows[ i ].shadowNormalBias;\n\t\t#endif\n\t\tvSpotLightCoord[ i ] = spotLightMatrix[ i ] * shadowWorldPosition;\n\t}\n\t#pragma unroll_loop_end\n#endif',
shadowmask_pars_fragment:
'float getShadowMask() {\n\tfloat shadow = 1.0;\n\t#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\tDirectionalLightShadow directionalLight;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) {\n\t\tdirectionalLight = directionalLightShadows[ i ];\n\t\tshadow *= receiveShadow ? getShadow( directionalShadowMap[ i ], directionalLight.shadowMapSize, directionalLight.shadowIntensity, directionalLight.shadowBias, directionalLight.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\tSpotLightShadow spotLight;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_SPOT_LIGHT_SHADOWS; i ++ ) {\n\t\tspotLight = spotLightShadows[ i ];\n\t\tshadow *= receiveShadow ? getShadow( spotShadowMap[ i ], spotLight.shadowMapSize, spotLight.shadowIntensity, spotLight.shadowBias, spotLight.shadowRadius, vSpotLightCoord[ i ] ) : 1.0;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\tPointLightShadow pointLight;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) {\n\t\tpointLight = pointLightShadows[ i ];\n\t\tshadow *= receiveShadow ? getPointShadow( pointShadowMap[ i ], pointLight.shadowMapSize, pointLight.shadowIntensity, pointLight.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ], pointLight.shadowCameraNear, pointLight.shadowCameraFar ) : 1.0;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#endif\n\treturn shadow;\n}',
skinbase_vertex:
'#ifdef USE_SKINNING\n\tmat4 boneMatX = getBoneMatrix( skinIndex.x );\n\tmat4 boneMatY = getBoneMatrix( skinIndex.y );\n\tmat4 boneMatZ = getBoneMatrix( skinIndex.z );\n\tmat4 boneMatW = getBoneMatrix( skinIndex.w );\n#endif',
skinning_pars_vertex:
'#ifdef USE_SKINNING\n\tuniform mat4 bindMatrix;\n\tuniform mat4 bindMatrixInverse;\n\tuniform highp sampler2D boneTexture;\n\tmat4 getBoneMatrix( const in float i ) {\n\t\tint size = textureSize( boneTexture, 0 ).x;\n\t\tint j = int( i ) * 4;\n\t\tint x = j % size;\n\t\tint y = j / size;\n\t\tvec4 v1 = texelFetch( boneTexture, ivec2( x, y ), 0 );\n\t\tvec4 v2 = texelFetch( boneTexture, ivec2( x + 1, y ), 0 );\n\t\tvec4 v3 = texelFetch( boneTexture, ivec2( x + 2, y ), 0 );\n\t\tvec4 v4 = texelFetch( boneTexture, ivec2( x + 3, y ), 0 );\n\t\treturn mat4( v1, v2, v3, v4 );\n\t}\n#endif',
skinning_vertex:
'#ifdef USE_SKINNING\n\tvec4 skinVertex = bindMatrix * vec4( transformed, 1.0 );\n\tvec4 skinned = vec4( 0.0 );\n\tskinned += boneMatX * skinVertex * skinWeight.x;\n\tskinned += boneMatY * skinVertex * skinWeight.y;\n\tskinned += boneMatZ * skinVertex * skinWeight.z;\n\tskinned += boneMatW * skinVertex * skinWeight.w;\n\ttransformed = ( bindMatrixInverse * skinned ).xyz;\n#endif',
skinnormal_vertex:
'#ifdef USE_SKINNING\n\tmat4 skinMatrix = mat4( 0.0 );\n\tskinMatrix += skinWeight.x * boneMatX;\n\tskinMatrix += skinWeight.y * boneMatY;\n\tskinMatrix += skinWeight.z * boneMatZ;\n\tskinMatrix += skinWeight.w * boneMatW;\n\tskinMatrix = bindMatrixInverse * skinMatrix * bindMatrix;\n\tobjectNormal = vec4( skinMatrix * vec4( objectNormal, 0.0 ) ).xyz;\n\t#ifdef USE_TANGENT\n\t\tobjectTangent = vec4( skinMatrix * vec4( objectTangent, 0.0 ) ).xyz;\n\t#endif\n#endif',
specularmap_fragment:
'float specularStrength;\n#ifdef USE_SPECULARMAP\n\tvec4 texelSpecular = texture2D( specularMap, vSpecularMapUv );\n\tspecularStrength = texelSpecular.r;\n#else\n\tspecularStrength = 1.0;\n#endif',
specularmap_pars_fragment:
'#ifdef USE_SPECULARMAP\n\tuniform sampler2D specularMap;\n#endif',
tonemapping_fragment:
'#if defined( TONE_MAPPING )\n\tgl_FragColor.rgb = toneMapping( gl_FragColor.rgb );\n#endif',
tonemapping_pars_fragment:
'#ifndef saturate\n#define saturate( a ) clamp( a, 0.0, 1.0 )\n#endif\nuniform float toneMappingExposure;\nvec3 LinearToneMapping( vec3 color ) {\n\treturn saturate( toneMappingExposure * color );\n}\nvec3 ReinhardToneMapping( vec3 color ) {\n\tcolor *= toneMappingExposure;\n\treturn saturate( color / ( vec3( 1.0 ) + color ) );\n}\nvec3 CineonToneMapping( vec3 color ) {\n\tcolor *= toneMappingExposure;\n\tcolor = max( vec3( 0.0 ), color - 0.004 );\n\treturn pow( ( color * ( 6.2 * color + 0.5 ) ) / ( color * ( 6.2 * color + 1.7 ) + 0.06 ), vec3( 2.2 ) );\n}\nvec3 RRTAndODTFit( vec3 v ) {\n\tvec3 a = v * ( v + 0.0245786 ) - 0.000090537;\n\tvec3 b = v * ( 0.983729 * v + 0.4329510 ) + 0.238081;\n\treturn a / b;\n}\nvec3 ACESFilmicToneMapping( vec3 color ) {\n\tconst mat3 ACESInputMat = mat3(\n\t\tvec3( 0.59719, 0.07600, 0.02840 ),\t\tvec3( 0.35458, 0.90834, 0.13383 ),\n\t\tvec3( 0.04823, 0.01566, 0.83777 )\n\t);\n\tconst mat3 ACESOutputMat = mat3(\n\t\tvec3( 1.60475, -0.10208, -0.00327 ),\t\tvec3( -0.53108, 1.10813, -0.07276 ),\n\t\tvec3( -0.07367, -0.00605, 1.07602 )\n\t);\n\tcolor *= toneMappingExposure / 0.6;\n\tcolor = ACESInputMat * color;\n\tcolor = RRTAndODTFit( color );\n\tcolor = ACESOutputMat * color;\n\treturn saturate( color );\n}\nconst mat3 LINEAR_REC2020_TO_LINEAR_SRGB = mat3(\n\tvec3( 1.6605, - 0.1246, - 0.0182 ),\n\tvec3( - 0.5876, 1.1329, - 0.1006 ),\n\tvec3( - 0.0728, - 0.0083, 1.1187 )\n);\nconst mat3 LINEAR_SRGB_TO_LINEAR_REC2020 = mat3(\n\tvec3( 0.6274, 0.0691, 0.0164 ),\n\tvec3( 0.3293, 0.9195, 0.0880 ),\n\tvec3( 0.0433, 0.0113, 0.8956 )\n);\nvec3 agxDefaultContrastApprox( vec3 x ) {\n\tvec3 x2 = x * x;\n\tvec3 x4 = x2 * x2;\n\treturn + 15.5 * x4 * x2\n\t\t- 40.14 * x4 * x\n\t\t+ 31.96 * x4\n\t\t- 6.868 * x2 * x\n\t\t+ 0.4298 * x2\n\t\t+ 0.1191 * x\n\t\t- 0.00232;\n}\nvec3 AgXToneMapping( vec3 color ) {\n\tconst mat3 AgXInsetMatrix = mat3(\n\t\tvec3( 0.856627153315983, 0.137318972929847, 0.11189821299995 ),\n\t\tvec3( 0.0951212405381588, 0.761241990602591, 0.0767994186031903 ),\n\t\tvec3( 0.0482516061458583, 0.101439036467562, 0.811302368396859 )\n\t);\n\tconst mat3 AgXOutsetMatrix = mat3(\n\t\tvec3( 1.1271005818144368, - 0.1413297634984383, - 0.14132976349843826 ),\n\t\tvec3( - 0.11060664309660323, 1.157823702216272, - 0.11060664309660294 ),\n\t\tvec3( - 0.016493938717834573, - 0.016493938717834257, 1.2519364065950405 )\n\t);\n\tconst float AgxMinEv = - 12.47393;\tconst float AgxMaxEv = 4.026069;\n\tcolor *= toneMappingExposure;\n\tcolor = LINEAR_SRGB_TO_LINEAR_REC2020 * color;\n\tcolor = AgXInsetMatrix * color;\n\tcolor = max( color, 1e-10 );\tcolor = log2( color );\n\tcolor = ( color - AgxMinEv ) / ( AgxMaxEv - AgxMinEv );\n\tcolor = clamp( color, 0.0, 1.0 );\n\tcolor = agxDefaultContrastApprox( color );\n\tcolor = AgXOutsetMatrix * color;\n\tcolor = pow( max( vec3( 0.0 ), color ), vec3( 2.2 ) );\n\tcolor = LINEAR_REC2020_TO_LINEAR_SRGB * color;\n\tcolor = clamp( color, 0.0, 1.0 );\n\treturn color;\n}\nvec3 NeutralToneMapping( vec3 color ) {\n\tconst float StartCompression = 0.8 - 0.04;\n\tconst float Desaturation = 0.15;\n\tcolor *= toneMappingExposure;\n\tfloat x = min( color.r, min( color.g, color.b ) );\n\tfloat offset = x < 0.08 ? x - 6.25 * x * x : 0.04;\n\tcolor -= offset;\n\tfloat peak = max( color.r, max( color.g, color.b ) );\n\tif ( peak < StartCompression ) return color;\n\tfloat d = 1. - StartCompression;\n\tfloat newPeak = 1. - d * d / ( peak + d - StartCompression );\n\tcolor *= newPeak / peak;\n\tfloat g = 1. - 1. / ( Desaturation * ( peak - newPeak ) + 1. );\n\treturn mix( color, vec3( newPeak ), g );\n}\nvec3 CustomToneMapping( vec3 color ) { return color; }',
transmission_fragment:
'#ifdef USE_TRANSMISSION\n\tmaterial.transmission = transmission;\n\tmaterial.transmissionAlpha = 1.0;\n\tmaterial.thickness = thickness;\n\tmaterial.attenuationDistance = attenuationDistance;\n\tmaterial.attenuationColor = attenuationColor;\n\t#ifdef USE_TRANSMISSIONMAP\n\t\tmaterial.transmission *= texture2D( transmissionMap, vTransmissionMapUv ).r;\n\t#endif\n\t#ifdef USE_THICKNESSMAP\n\t\tmaterial.thickness *= texture2D( thicknessMap, vThicknessMapUv ).g;\n\t#endif\n\tvec3 pos = vWorldPosition;\n\tvec3 v = normalize( cameraPosition - pos );\n\tvec3 n = inverseTransformDirection( normal, viewMatrix );\n\tvec4 transmitted = getIBLVolumeRefraction(\n\t\tn, v, material.roughness, material.diffuseColor, material.specularColor, material.specularF90,\n\t\tpos, modelMatrix, viewMatrix, projectionMatrix, material.dispersion, material.ior, material.thickness,\n\t\tmaterial.attenuationColor, material.attenuationDistance );\n\tmaterial.transmissionAlpha = mix( material.transmissionAlpha, transmitted.a, material.transmission );\n\ttotalDiffuse = mix( totalDiffuse, transmitted.rgb, material.transmission );\n#endif',
transmission_pars_fragment:
'#ifdef USE_TRANSMISSION\n\tuniform float transmission;\n\tuniform float thickness;\n\tuniform float attenuationDistance;\n\tuniform vec3 attenuationColor;\n\t#ifdef USE_TRANSMISSIONMAP\n\t\tuniform sampler2D transmissionMap;\n\t#endif\n\t#ifdef USE_THICKNESSMAP\n\t\tuniform sampler2D thicknessMap;\n\t#endif\n\tuniform vec2 transmissionSamplerSize;\n\tuniform sampler2D transmissionSamplerMap;\n\tuniform mat4 modelMatrix;\n\tuniform mat4 projectionMatrix;\n\tvarying vec3 vWorldPosition;\n\tfloat w0( float a ) {\n\t\treturn ( 1.0 / 6.0 ) * ( a * ( a * ( - a + 3.0 ) - 3.0 ) + 1.0 );\n\t}\n\tfloat w1( float a ) {\n\t\treturn ( 1.0 / 6.0 ) * ( a * a * ( 3.0 * a - 6.0 ) + 4.0 );\n\t}\n\tfloat w2( float a ){\n\t\treturn ( 1.0 / 6.0 ) * ( a * ( a * ( - 3.0 * a + 3.0 ) + 3.0 ) + 1.0 );\n\t}\n\tfloat w3( float a ) {\n\t\treturn ( 1.0 / 6.0 ) * ( a * a * a );\n\t}\n\tfloat g0( float a ) {\n\t\treturn w0( a ) + w1( a );\n\t}\n\tfloat g1( float a ) {\n\t\treturn w2( a ) + w3( a );\n\t}\n\tfloat h0( float a ) {\n\t\treturn - 1.0 + w1( a ) / ( w0( a ) + w1( a ) );\n\t}\n\tfloat h1( float a ) {\n\t\treturn 1.0 + w3( a ) / ( w2( a ) + w3( a ) );\n\t}\n\tvec4 bicubic( sampler2D tex, vec2 uv, vec4 texelSize, float lod ) {\n\t\tuv = uv * texelSize.zw + 0.5;\n\t\tvec2 iuv = floor( uv );\n\t\tvec2 fuv = fract( uv );\n\t\tfloat g0x = g0( fuv.x );\n\t\tfloat g1x = g1( fuv.x );\n\t\tfloat h0x = h0( fuv.x );\n\t\tfloat h1x = h1( fuv.x );\n\t\tfloat h0y = h0( fuv.y );\n\t\tfloat h1y = h1( fuv.y );\n\t\tvec2 p0 = ( vec2( iuv.x + h0x, iuv.y + h0y ) - 0.5 ) * texelSize.xy;\n\t\tvec2 p1 = ( vec2( iuv.x + h1x, iuv.y + h0y ) - 0.5 ) * texelSize.xy;\n\t\tvec2 p2 = ( vec2( iuv.x + h0x, iuv.y + h1y ) - 0.5 ) * texelSize.xy;\n\t\tvec2 p3 = ( vec2( iuv.x + h1x, iuv.y + h1y ) - 0.5 ) * texelSize.xy;\n\t\treturn g0( fuv.y ) * ( g0x * textureLod( tex, p0, lod ) + g1x * textureLod( tex, p1, lod ) ) +\n\t\t\tg1( fuv.y ) * ( g0x * textureLod( tex, p2, lod ) + g1x * textureLod( tex, p3, lod ) );\n\t}\n\tvec4 textureBicubic( sampler2D sampler, vec2 uv, float lod ) {\n\t\tvec2 fLodSize = vec2( textureSize( sampler, int( lod ) ) );\n\t\tvec2 cLodSize = vec2( textureSize( sampler, int( lod + 1.0 ) ) );\n\t\tvec2 fLodSizeInv = 1.0 / fLodSize;\n\t\tvec2 cLodSizeInv = 1.0 / cLodSize;\n\t\tvec4 fSample = bicubic( sampler, uv, vec4( fLodSizeInv, fLodSize ), floor( lod ) );\n\t\tvec4 cSample = bicubic( sampler, uv, vec4( cLodSizeInv, cLodSize ), ceil( lod ) );\n\t\treturn mix( fSample, cSample, fract( lod ) );\n\t}\n\tvec3 getVolumeTransmissionRay( const in vec3 n, const in vec3 v, const in float thickness, const in float ior, const in mat4 modelMatrix ) {\n\t\tvec3 refractionVector = refract( - v, normalize( n ), 1.0 / ior );\n\t\tvec3 modelScale;\n\t\tmodelScale.x = length( vec3( modelMatrix[ 0 ].xyz ) );\n\t\tmodelScale.y = length( vec3( modelMatrix[ 1 ].xyz ) );\n\t\tmodelScale.z = length( vec3( modelMatrix[ 2 ].xyz ) );\n\t\treturn normalize( refractionVector ) * thickness * modelScale;\n\t}\n\tfloat applyIorToRoughness( const in float roughness, const in float ior ) {\n\t\treturn roughness * clamp( ior * 2.0 - 2.0, 0.0, 1.0 );\n\t}\n\tvec4 getTransmissionSample( const in vec2 fragCoord, const in float roughness, const in float ior ) {\n\t\tfloat lod = log2( transmissionSamplerSize.x ) * applyIorToRoughness( roughness, ior );\n\t\treturn textureBicubic( transmissionSamplerMap, fragCoord.xy, lod );\n\t}\n\tvec3 volumeAttenuation( const in float transmissionDistance, const in vec3 attenuationColor, const in float attenuationDistance ) {\n\t\tif ( isinf( attenuationDistance ) ) {\n\t\t\treturn vec3( 1.0 );\n\t\t} else {\n\t\t\tvec3 attenuationCoefficient = -log( attenuationColor ) / attenuationDistance;\n\t\t\tvec3 transmittance = exp( - attenuationCoefficient * transmissionDistance );\t\t\treturn transmittance;\n\t\t}\n\t}\n\tvec4 getIBLVolumeRefraction( const in vec3 n, const in vec3 v, const in float roughness, const in vec3 diffuseColor,\n\t\tconst in vec3 specularColor, const in float specularF90, const in vec3 position, const in mat4 modelMatrix,\n\t\tconst in mat4 viewMatrix, const in mat4 projMatrix, const in float dispersion, const in float ior, const in float thickness,\n\t\tconst in vec3 attenuationColor, const in float attenuationDistance ) {\n\t\tvec4 transmittedLight;\n\t\tvec3 transmittance;\n\t\t#ifdef USE_DISPERSION\n\t\t\tfloat halfSpread = ( ior - 1.0 ) * 0.025 * dispersion;\n\t\t\tvec3 iors = vec3( ior - halfSpread, ior, ior + halfSpread );\n\t\t\tfor ( int i = 0; i < 3; i ++ ) {\n\t\t\t\tvec3 transmissionRay = getVolumeTransmissionRay( n, v, thickness, iors[ i ], modelMatrix );\n\t\t\t\tvec3 refractedRayExit = position + transmissionRay;\n\t\t\t\tvec4 ndcPos = projMatrix * viewMatrix * vec4( refractedRayExit, 1.0 );\n\t\t\t\tvec2 refractionCoords = ndcPos.xy / ndcPos.w;\n\t\t\t\trefractionCoords += 1.0;\n\t\t\t\trefractionCoords /= 2.0;\n\t\t\t\tvec4 transmissionSample = getTransmissionSample( refractionCoords, roughness, iors[ i ] );\n\t\t\t\ttransmittedLight[ i ] = transmissionSample[ i ];\n\t\t\t\ttransmittedLight.a += transmissionSample.a;\n\t\t\t\ttransmittance[ i ] = diffuseColor[ i ] * volumeAttenuation( length( transmissionRay ), attenuationColor, attenuationDistance )[ i ];\n\t\t\t}\n\t\t\ttransmittedLight.a /= 3.0;\n\t\t#else\n\t\t\tvec3 transmissionRay = getVolumeTransmissionRay( n, v, thickness, ior, modelMatrix );\n\t\t\tvec3 refractedRayExit = position + transmissionRay;\n\t\t\tvec4 ndcPos = projMatrix * viewMatrix * vec4( refractedRayExit, 1.0 );\n\t\t\tvec2 refractionCoords = ndcPos.xy / ndcPos.w;\n\t\t\trefractionCoords += 1.0;\n\t\t\trefractionCoords /= 2.0;\n\t\t\ttransmittedLight = getTransmissionSample( refractionCoords, roughness, ior );\n\t\t\ttransmittance = diffuseColor * volumeAttenuation( length( transmissionRay ), attenuationColor, attenuationDistance );\n\t\t#endif\n\t\tvec3 attenuatedColor = transmittance * transmittedLight.rgb;\n\t\tvec3 F = EnvironmentBRDF( n, v, specularColor, specularF90, roughness );\n\t\tfloat transmittanceFactor = ( transmittance.r + transmittance.g + transmittance.b ) / 3.0;\n\t\treturn vec4( ( 1.0 - F ) * attenuatedColor, 1.0 - ( 1.0 - transmittedLight.a ) * transmittanceFactor );\n\t}\n#endif',
uv_pars_fragment:
'#if defined( USE_UV ) || defined( USE_ANISOTROPY )\n\tvarying vec2 vUv;\n#endif\n#ifdef USE_MAP\n\tvarying vec2 vMapUv;\n#endif\n#ifdef USE_ALPHAMAP\n\tvarying vec2 vAlphaMapUv;\n#endif\n#ifdef USE_LIGHTMAP\n\tvarying vec2 vLightMapUv;\n#endif\n#ifdef USE_AOMAP\n\tvarying vec2 vAoMapUv;\n#endif\n#ifdef USE_BUMPMAP\n\tvarying vec2 vBumpMapUv;\n#endif\n#ifdef USE_NORMALMAP\n\tvarying vec2 vNormalMapUv;\n#endif\n#ifdef USE_EMISSIVEMAP\n\tvarying vec2 vEmissiveMapUv;\n#endif\n#ifdef USE_METALNESSMAP\n\tvarying vec2 vMetalnessMapUv;\n#endif\n#ifdef USE_ROUGHNESSMAP\n\tvarying vec2 vRoughnessMapUv;\n#endif\n#ifdef USE_ANISOTROPYMAP\n\tvarying vec2 vAnisotropyMapUv;\n#endif\n#ifdef USE_CLEARCOATMAP\n\tvarying vec2 vClearcoatMapUv;\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n\tvarying vec2 vClearcoatNormalMapUv;\n#endif\n#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\tvarying vec2 vClearcoatRoughnessMapUv;\n#endif\n#ifdef USE_IRIDESCENCEMAP\n\tvarying vec2 vIridescenceMapUv;\n#endif\n#ifdef USE_IRIDESCENCE_THICKNESSMAP\n\tvarying vec2 vIridescenceThicknessMapUv;\n#endif\n#ifdef USE_SHEEN_COLORMAP\n\tvarying vec2 vSheenColorMapUv;\n#endif\n#ifdef USE_SHEEN_ROUGHNESSMAP\n\tvarying vec2 vSheenRoughnessMapUv;\n#endif\n#ifdef USE_SPECULARMAP\n\tvarying vec2 vSpecularMapUv;\n#endif\n#ifdef USE_SPECULAR_COLORMAP\n\tvarying vec2 vSpecularColorMapUv;\n#endif\n#ifdef USE_SPECULAR_INTENSITYMAP\n\tvarying vec2 vSpecularIntensityMapUv;\n#endif\n#ifdef USE_TRANSMISSIONMAP\n\tuniform mat3 transmissionMapTransform;\n\tvarying vec2 vTransmissionMapUv;\n#endif\n#ifdef USE_THICKNESSMAP\n\tuniform mat3 thicknessMapTransform;\n\tvarying vec2 vThicknessMapUv;\n#endif',
uv_pars_vertex:
'#if defined( USE_UV ) || defined( USE_ANISOTROPY )\n\tvarying vec2 vUv;\n#endif\n#ifdef USE_MAP\n\tuniform mat3 mapTransform;\n\tvarying vec2 vMapUv;\n#endif\n#ifdef USE_ALPHAMAP\n\tuniform mat3 alphaMapTransform;\n\tvarying vec2 vAlphaMapUv;\n#endif\n#ifdef USE_LIGHTMAP\n\tuniform mat3 lightMapTransform;\n\tvarying vec2 vLightMapUv;\n#endif\n#ifdef USE_AOMAP\n\tuniform mat3 aoMapTransform;\n\tvarying vec2 vAoMapUv;\n#endif\n#ifdef USE_BUMPMAP\n\tuniform mat3 bumpMapTransform;\n\tvarying vec2 vBumpMapUv;\n#endif\n#ifdef USE_NORMALMAP\n\tuniform mat3 normalMapTransform;\n\tvarying vec2 vNormalMapUv;\n#endif\n#ifdef USE_DISPLACEMENTMAP\n\tuniform mat3 displacementMapTransform;\n\tvarying vec2 vDisplacementMapUv;\n#endif\n#ifdef USE_EMISSIVEMAP\n\tuniform mat3 emissiveMapTransform;\n\tvarying vec2 vEmissiveMapUv;\n#endif\n#ifdef USE_METALNESSMAP\n\tuniform mat3 metalnessMapTransform;\n\tvarying vec2 vMetalnessMapUv;\n#endif\n#ifdef USE_ROUGHNESSMAP\n\tuniform mat3 roughnessMapTransform;\n\tvarying vec2 vRoughnessMapUv;\n#endif\n#ifdef USE_ANISOTROPYMAP\n\tuniform mat3 anisotropyMapTransform;\n\tvarying vec2 vAnisotropyMapUv;\n#endif\n#ifdef USE_CLEARCOATMAP\n\tuniform mat3 clearcoatMapTransform;\n\tvarying vec2 vClearcoatMapUv;\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n\tuniform mat3 clearcoatNormalMapTransform;\n\tvarying vec2 vClearcoatNormalMapUv;\n#endif\n#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\tuniform mat3 clearcoatRoughnessMapTransform;\n\tvarying vec2 vClearcoatRoughnessMapUv;\n#endif\n#ifdef USE_SHEEN_COLORMAP\n\tuniform mat3 sheenColorMapTransform;\n\tvarying vec2 vSheenColorMapUv;\n#endif\n#ifdef USE_SHEEN_ROUGHNESSMAP\n\tuniform mat3 sheenRoughnessMapTransform;\n\tvarying vec2 vSheenRoughnessMapUv;\n#endif\n#ifdef USE_IRIDESCENCEMAP\n\tuniform mat3 iridescenceMapTransform;\n\tvarying vec2 vIridescenceMapUv;\n#endif\n#ifdef USE_IRIDESCENCE_THICKNESSMAP\n\tuniform mat3 iridescenceThicknessMapTransform;\n\tvarying vec2 vIridescenceThicknessMapUv;\n#endif\n#ifdef USE_SPECULARMAP\n\tuniform mat3 specularMapTransform;\n\tvarying vec2 vSpecularMapUv;\n#endif\n#ifdef USE_SPECULAR_COLORMAP\n\tuniform mat3 specularColorMapTransform;\n\tvarying vec2 vSpecularColorMapUv;\n#endif\n#ifdef USE_SPECULAR_INTENSITYMAP\n\tuniform mat3 specularIntensityMapTransform;\n\tvarying vec2 vSpecularIntensityMapUv;\n#endif\n#ifdef USE_TRANSMISSIONMAP\n\tuniform mat3 transmissionMapTransform;\n\tvarying vec2 vTransmissionMapUv;\n#endif\n#ifdef USE_THICKNESSMAP\n\tuniform mat3 thicknessMapTransform;\n\tvarying vec2 vThicknessMapUv;\n#endif',
uv_vertex:
'#if defined( USE_UV ) || defined( USE_ANISOTROPY )\n\tvUv = vec3( uv, 1 ).xy;\n#endif\n#ifdef USE_MAP\n\tvMapUv = ( mapTransform * vec3( MAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_ALPHAMAP\n\tvAlphaMapUv = ( alphaMapTransform * vec3( ALPHAMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_LIGHTMAP\n\tvLightMapUv = ( lightMapTransform * vec3( LIGHTMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_AOMAP\n\tvAoMapUv = ( aoMapTransform * vec3( AOMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_BUMPMAP\n\tvBumpMapUv = ( bumpMapTransform * vec3( BUMPMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_NORMALMAP\n\tvNormalMapUv = ( normalMapTransform * vec3( NORMALMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_DISPLACEMENTMAP\n\tvDisplacementMapUv = ( displacementMapTransform * vec3( DISPLACEMENTMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_EMISSIVEMAP\n\tvEmissiveMapUv = ( emissiveMapTransform * vec3( EMISSIVEMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_METALNESSMAP\n\tvMetalnessMapUv = ( metalnessMapTransform * vec3( METALNESSMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_ROUGHNESSMAP\n\tvRoughnessMapUv = ( roughnessMapTransform * vec3( ROUGHNESSMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_ANISOTROPYMAP\n\tvAnisotropyMapUv = ( anisotropyMapTransform * vec3( ANISOTROPYMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_CLEARCOATMAP\n\tvClearcoatMapUv = ( clearcoatMapTransform * vec3( CLEARCOATMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n\tvClearcoatNormalMapUv = ( clearcoatNormalMapTransform * vec3( CLEARCOAT_NORMALMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\tvClearcoatRoughnessMapUv = ( clearcoatRoughnessMapTransform * vec3( CLEARCOAT_ROUGHNESSMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_IRIDESCENCEMAP\n\tvIridescenceMapUv = ( iridescenceMapTransform * vec3( IRIDESCENCEMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_IRIDESCENCE_THICKNESSMAP\n\tvIridescenceThicknessMapUv = ( iridescenceThicknessMapTransform * vec3( IRIDESCENCE_THICKNESSMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_SHEEN_COLORMAP\n\tvSheenColorMapUv = ( sheenColorMapTransform * vec3( SHEEN_COLORMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_SHEEN_ROUGHNESSMAP\n\tvSheenRoughnessMapUv = ( sheenRoughnessMapTransform * vec3( SHEEN_ROUGHNESSMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_SPECULARMAP\n\tvSpecularMapUv = ( specularMapTransform * vec3( SPECULARMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_SPECULAR_COLORMAP\n\tvSpecularColorMapUv = ( specularColorMapTransform * vec3( SPECULAR_COLORMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_SPECULAR_INTENSITYMAP\n\tvSpecularIntensityMapUv = ( specularIntensityMapTransform * vec3( SPECULAR_INTENSITYMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_TRANSMISSIONMAP\n\tvTransmissionMapUv = ( transmissionMapTransform * vec3( TRANSMISSIONMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_THICKNESSMAP\n\tvThicknessMapUv = ( thicknessMapTransform * vec3( THICKNESSMAP_UV, 1 ) ).xy;\n#endif',
worldpos_vertex:
'#if defined( USE_ENVMAP ) || defined( DISTANCE ) || defined ( USE_SHADOWMAP ) || defined ( USE_TRANSMISSION ) || NUM_SPOT_LIGHT_COORDS > 0\n\tvec4 worldPosition = vec4( transformed, 1.0 );\n\t#ifdef USE_BATCHING\n\t\tworldPosition = batchingMatrix * worldPosition;\n\t#endif\n\t#ifdef USE_INSTANCING\n\t\tworldPosition = instanceMatrix * worldPosition;\n\t#endif\n\tworldPosition = modelMatrix * worldPosition;\n#endif',
background_vert:
'varying vec2 vUv;\nuniform mat3 uvTransform;\nvoid main() {\n\tvUv = ( uvTransform * vec3( uv, 1 ) ).xy;\n\tgl_Position = vec4( position.xy, 1.0, 1.0 );\n}',
background_frag:
'uniform sampler2D t2D;\nuniform float backgroundIntensity;\nvarying vec2 vUv;\nvoid main() {\n\tvec4 texColor = texture2D( t2D, vUv );\n\t#ifdef DECODE_VIDEO_TEXTURE\n\t\ttexColor = vec4( mix( pow( texColor.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), texColor.rgb * 0.0773993808, vec3( lessThanEqual( texColor.rgb, vec3( 0.04045 ) ) ) ), texColor.w );\n\t#endif\n\ttexColor.rgb *= backgroundIntensity;\n\tgl_FragColor = texColor;\n\t#include \n\t#include \n}',
backgroundCube_vert:
'varying vec3 vWorldDirection;\n#include \nvoid main() {\n\tvWorldDirection = transformDirection( position, modelMatrix );\n\t#include \n\t#include \n\tgl_Position.z = gl_Position.w;\n}',
backgroundCube_frag:
'#ifdef ENVMAP_TYPE_CUBE\n\tuniform samplerCube envMap;\n#elif defined( ENVMAP_TYPE_CUBE_UV )\n\tuniform sampler2D envMap;\n#endif\nuniform float flipEnvMap;\nuniform float backgroundBlurriness;\nuniform float backgroundIntensity;\nuniform mat3 backgroundRotation;\nvarying vec3 vWorldDirection;\n#include \nvoid main() {\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tvec4 texColor = textureCube( envMap, backgroundRotation * vec3( flipEnvMap * vWorldDirection.x, vWorldDirection.yz ) );\n\t#elif defined( ENVMAP_TYPE_CUBE_UV )\n\t\tvec4 texColor = textureCubeUV( envMap, backgroundRotation * vWorldDirection, backgroundBlurriness );\n\t#else\n\t\tvec4 texColor = vec4( 0.0, 0.0, 0.0, 1.0 );\n\t#endif\n\ttexColor.rgb *= backgroundIntensity;\n\tgl_FragColor = texColor;\n\t#include \n\t#include \n}',
cube_vert:
'varying vec3 vWorldDirection;\n#include \nvoid main() {\n\tvWorldDirection = transformDirection( position, modelMatrix );\n\t#include \n\t#include \n\tgl_Position.z = gl_Position.w;\n}',
cube_frag:
'uniform samplerCube tCube;\nuniform float tFlip;\nuniform float opacity;\nvarying vec3 vWorldDirection;\nvoid main() {\n\tvec4 texColor = textureCube( tCube, vec3( tFlip * vWorldDirection.x, vWorldDirection.yz ) );\n\tgl_FragColor = texColor;\n\tgl_FragColor.a *= opacity;\n\t#include \n\t#include \n}',
depth_vert:
'#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvarying vec2 vHighPrecisionZW;\nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#ifdef USE_DISPLACEMENTMAP\n\t\t#include \n\t\t#include \n\t\t#include \n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvHighPrecisionZW = gl_Position.zw;\n}',
depth_frag:
'#if DEPTH_PACKING == 3200\n\tuniform float opacity;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvarying vec2 vHighPrecisionZW;\nvoid main() {\n\tvec4 diffuseColor = vec4( 1.0 );\n\t#include \n\t#if DEPTH_PACKING == 3200\n\t\tdiffuseColor.a = opacity;\n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tfloat fragCoordZ = 0.5 * vHighPrecisionZW[0] / vHighPrecisionZW[1] + 0.5;\n\t#if DEPTH_PACKING == 3200\n\t\tgl_FragColor = vec4( vec3( 1.0 - fragCoordZ ), opacity );\n\t#elif DEPTH_PACKING == 3201\n\t\tgl_FragColor = packDepthToRGBA( fragCoordZ );\n\t#elif DEPTH_PACKING == 3202\n\t\tgl_FragColor = vec4( packDepthToRGB( fragCoordZ ), 1.0 );\n\t#elif DEPTH_PACKING == 3203\n\t\tgl_FragColor = vec4( packDepthToRG( fragCoordZ ), 0.0, 1.0 );\n\t#endif\n}',
distanceRGBA_vert:
'#define DISTANCE\nvarying vec3 vWorldPosition;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#ifdef USE_DISPLACEMENTMAP\n\t\t#include \n\t\t#include \n\t\t#include \n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvWorldPosition = worldPosition.xyz;\n}',
distanceRGBA_frag:
'#define DISTANCE\nuniform vec3 referencePosition;\nuniform float nearDistance;\nuniform float farDistance;\nvarying vec3 vWorldPosition;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main () {\n\tvec4 diffuseColor = vec4( 1.0 );\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tfloat dist = length( vWorldPosition - referencePosition );\n\tdist = ( dist - nearDistance ) / ( farDistance - nearDistance );\n\tdist = saturate( dist );\n\tgl_FragColor = packDepthToRGBA( dist );\n}',
equirect_vert:
'varying vec3 vWorldDirection;\n#include \nvoid main() {\n\tvWorldDirection = transformDirection( position, modelMatrix );\n\t#include \n\t#include \n}',
equirect_frag:
'uniform sampler2D tEquirect;\nvarying vec3 vWorldDirection;\n#include \nvoid main() {\n\tvec3 direction = normalize( vWorldDirection );\n\tvec2 sampleUV = equirectUv( direction );\n\tgl_FragColor = texture2D( tEquirect, sampleUV );\n\t#include \n\t#include \n}',
linedashed_vert:
'uniform float scale;\nattribute float lineDistance;\nvarying float vLineDistance;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\tvLineDistance = scale * lineDistance;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}',
linedashed_frag:
'uniform vec3 diffuse;\nuniform float opacity;\nuniform float dashSize;\nuniform float totalSize;\nvarying float vLineDistance;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include \n\tif ( mod( vLineDistance, totalSize ) > dashSize ) {\n\t\tdiscard;\n\t}\n\tvec3 outgoingLight = vec3( 0.0 );\n\t#include \n\t#include \n\t#include \n\toutgoingLight = diffuseColor.rgb;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}',
meshbasic_vert:
'#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#if defined ( USE_ENVMAP ) || defined ( USE_SKINNING )\n\t\t#include \n\t\t#include \n\t\t#include \n\t\t#include \n\t\t#include \n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}',
meshbasic_frag:
'uniform vec3 diffuse;\nuniform float opacity;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\t#ifdef USE_LIGHTMAP\n\t\tvec4 lightMapTexel = texture2D( lightMap, vLightMapUv );\n\t\treflectedLight.indirectDiffuse += lightMapTexel.rgb * lightMapIntensity * RECIPROCAL_PI;\n\t#else\n\t\treflectedLight.indirectDiffuse += vec3( 1.0 );\n\t#endif\n\t#include \n\treflectedLight.indirectDiffuse *= diffuseColor.rgb;\n\tvec3 outgoingLight = reflectedLight.indirectDiffuse;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}',
meshlambert_vert:
'#define LAMBERT\nvarying vec3 vViewPosition;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvViewPosition = - mvPosition.xyz;\n\t#include \n\t#include \n\t#include \n\t#include \n}',
meshlambert_frag:
'#define LAMBERT\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include \n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include \n\t#include \n\t#include \n\t#include