var pI = Object.defineProperty
var A2 = (n) => {
throw TypeError(n)
}
var mI = (n, e, t) =>
e in n ? pI(n, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : (n[e] = t)
var xe = (n, e, t) => mI(n, typeof e != 'symbol' ? e + '' : e, t),
G0 = (n, e, t) => e.has(n) || A2('Cannot ' + t)
var dt = (n, e, t) => (G0(n, e, 'read from private field'), t ? t.call(n) : e.get(n)),
oi = (n, e, t) =>
e.has(n)
? A2('Cannot add the same private member more than once')
: e instanceof WeakSet
? e.add(n)
: e.set(n, t),
En = (n, e, t, i) => (G0(n, e, 'write to private field'), i ? i.call(n, t) : e.set(n, t), t),
fi = (n, e, t) => (G0(n, e, 'access private method'), t)
var Yu = (n, e, t, i) => ({
set _(r) {
En(n, e, r, t)
},
get _() {
return dt(n, e, i)
},
})
function hre() {
;(import.meta.url, import('_').catch(() => 1), (async function* () {})().next())
}
;(function () {
const e = document.createElement('link').relList
if (e && e.supports && e.supports('modulepreload')) return
for (const r of document.querySelectorAll('link[rel="modulepreload"]')) i(r)
new MutationObserver((r) => {
for (const s of r)
if (s.type === 'childList')
for (const o of s.addedNodes) o.tagName === 'LINK' && o.rel === 'modulepreload' && i(o)
}).observe(document, { childList: !0, subtree: !0 })
function t(r) {
const s = {}
return (
r.integrity && (s.integrity = r.integrity),
r.referrerPolicy && (s.referrerPolicy = r.referrerPolicy),
r.crossOrigin === 'use-credentials'
? (s.credentials = 'include')
: r.crossOrigin === 'anonymous'
? (s.credentials = 'omit')
: (s.credentials = 'same-origin'),
s
)
}
function i(r) {
if (r.ep) return
r.ep = !0
const s = t(r)
fetch(r.href, s)
}
})()
/**
* @vue/shared v3.5.17
* (c) 2018-present Yuxi (Evan) You and Vue contributors
* @license MIT
**/ /*! #__NO_SIDE_EFFECTS__ */ function $v(n) {
const e = Object.create(null)
for (const t of n.split(',')) e[t] = 1
return (t) => t in e
}
const un = {},
Vc = [],
Qs = () => {},
gI = () => !1,
Gm = (n) =>
n.charCodeAt(0) === 111 &&
n.charCodeAt(1) === 110 &&
(n.charCodeAt(2) > 122 || n.charCodeAt(2) < 97),
Gv = (n) => n.startsWith('onUpdate:'),
ti = Object.assign,
Wv = (n, e) => {
const t = n.indexOf(e)
t > -1 && n.splice(t, 1)
},
yI = Object.prototype.hasOwnProperty,
en = (n, e) => yI.call(n, e),
yt = Array.isArray,
Hc = (n) => Wm(n) === '[object Map]',
FT = (n) => Wm(n) === '[object Set]',
Ct = (n) => typeof n == 'function',
wn = (n) => typeof n == 'string',
za = (n) => typeof n == 'symbol',
gn = (n) => n !== null && typeof n == 'object',
OT = (n) => (gn(n) || Ct(n)) && Ct(n.then) && Ct(n.catch),
BT = Object.prototype.toString,
Wm = (n) => BT.call(n),
vI = (n) => Wm(n).slice(8, -1),
UT = (n) => Wm(n) === '[object Object]',
Qv = (n) => wn(n) && n !== 'NaN' && n[0] !== '-' && '' + parseInt(n, 10) === n,
Md = $v(
',key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted'
),
Qm = (n) => {
const e = Object.create(null)
return (t) => e[t] || (e[t] = n(t))
},
_I = /-(\w)/g,
ns = Qm((n) => n.replace(_I, (e, t) => (t ? t.toUpperCase() : ''))),
xI = /\B([A-Z])/g,
Wl = Qm((n) => n.replace(xI, '-$1').toLowerCase()),
jm = Qm((n) => n.charAt(0).toUpperCase() + n.slice(1)),
W0 = Qm((n) => (n ? 'on'.concat(jm(n)) : '')),
Pa = (n, e) => !Object.is(n, e),
Q0 = (n, ...e) => {
for (let t = 0; t < n.length; t++) n[t](...e)
},
U1 = (n, e, t, i = !1) => {
Object.defineProperty(n, e, { configurable: !0, enumerable: !1, writable: i, value: t })
},
SI = (n) => {
const e = parseFloat(n)
return isNaN(e) ? n : e
},
AI = (n) => {
const e = wn(n) ? Number(n) : NaN
return isNaN(e) ? n : e
}
let b2
const qm = () =>
b2 ||
(b2 =
typeof globalThis < 'u'
? globalThis
: typeof self < 'u'
? self
: typeof window < 'u'
? window
: typeof global < 'u'
? global
: {})
function js(n) {
if (yt(n)) {
const e = {}
for (let t = 0; t < n.length; t++) {
const i = n[t],
r = wn(i) ? CI(i) : js(i)
if (r) for (const s in r) e[s] = r[s]
}
return e
} else if (wn(n) || gn(n)) return n
}
const bI = /;(?![^(]*\))/g,
TI = /:([^]+)/,
wI = /\/\*[^]*?\*\//g
function CI(n) {
const e = {}
return (
n
.replace(wI, '')
.split(bI)
.forEach((t) => {
if (t) {
const i = t.split(TI)
i.length > 1 && (e[i[0].trim()] = i[1].trim())
}
}),
e
)
}
function Ys(n) {
let e = ''
if (wn(n)) e = n
else if (yt(n))
for (let t = 0; t < n.length; t++) {
const i = Ys(n[t])
i && (e += i + ' ')
}
else if (gn(n)) for (const t in n) n[t] && (e += t + ' ')
return e.trim()
}
const EI = 'itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly',
MI = $v(EI)
function kT(n) {
return !!n || n === ''
}
const zT = (n) => !!(n && n.__v_isRef === !0),
su = (n) =>
wn(n)
? n
: n == null
? ''
: yt(n) || (gn(n) && (n.toString === BT || !Ct(n.toString)))
? zT(n)
? su(n.value)
: JSON.stringify(n, VT, 2)
: String(n),
VT = (n, e) =>
zT(e)
? VT(n, e.value)
: Hc(e)
? {
['Map('.concat(e.size, ')')]: [...e.entries()].reduce(
(t, [i, r], s) => ((t[j0(i, s) + ' =>'] = r), t),
{}
),
}
: FT(e)
? { ['Set('.concat(e.size, ')')]: [...e.values()].map((t) => j0(t)) }
: za(e)
? j0(e)
: gn(e) && !yt(e) && !UT(e)
? String(e)
: e,
j0 = (n, e = '') => {
var t
return za(n) ? 'Symbol('.concat((t = n.description) != null ? t : e, ')') : n
}
/**
* @vue/reactivity v3.5.17
* (c) 2018-present Yuxi (Evan) You and Vue contributors
* @license MIT
**/ let Ri
class HT {
constructor(e = !1) {
;((this.detached = e),
(this._active = !0),
(this._on = 0),
(this.effects = []),
(this.cleanups = []),
(this._isPaused = !1),
(this.parent = Ri),
!e && Ri && (this.index = (Ri.scopes || (Ri.scopes = [])).push(this) - 1))
}
get active() {
return this._active
}
pause() {
if (this._active) {
this._isPaused = !0
let e, t
if (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()
}
}
resume() {
if (this._active && this._isPaused) {
this._isPaused = !1
let e, t
if (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()
}
}
run(e) {
if (this._active) {
const t = Ri
try {
return ((Ri = this), e())
} finally {
Ri = t
}
}
}
on() {
++this._on === 1 && ((this.prevScope = Ri), (Ri = this))
}
off() {
this._on > 0 && --this._on === 0 && ((Ri = this.prevScope), (this.prevScope = void 0))
}
stop(e) {
if (this._active) {
this._active = !1
let t, i
for (t = 0, i = this.effects.length; t < i; t++) this.effects[t].stop()
for (this.effects.length = 0, t = 0, i = this.cleanups.length; t < i; t++) this.cleanups[t]()
if (((this.cleanups.length = 0), this.scopes)) {
for (t = 0, i = this.scopes.length; t < i; t++) this.scopes[t].stop(!0)
this.scopes.length = 0
}
if (!this.detached && this.parent && !e) {
const r = this.parent.scopes.pop()
r && r !== this && ((this.parent.scopes[this.index] = r), (r.index = this.index))
}
this.parent = void 0
}
}
}
function jv(n) {
return new HT(n)
}
function $T() {
return Ri
}
function RI(n, e = !1) {
Ri && Ri.cleanups.push(n)
}
let fn
const q0 = new WeakSet()
class GT {
constructor(e) {
;((this.fn = e),
(this.deps = void 0),
(this.depsTail = void 0),
(this.flags = 5),
(this.next = void 0),
(this.cleanup = void 0),
(this.scheduler = void 0),
Ri && Ri.active && Ri.effects.push(this))
}
pause() {
this.flags |= 64
}
resume() {
this.flags & 64 && ((this.flags &= -65), q0.has(this) && (q0.delete(this), this.trigger()))
}
notify() {
;(this.flags & 2 && !(this.flags & 32)) || this.flags & 8 || QT(this)
}
run() {
if (!(this.flags & 1)) return this.fn()
;((this.flags |= 2), T2(this), jT(this))
const e = fn,
t = vs
;((fn = this), (vs = !0))
try {
return this.fn()
} finally {
;(qT(this), (fn = e), (vs = t), (this.flags &= -3))
}
}
stop() {
if (this.flags & 1) {
for (let e = this.deps; e; e = e.nextDep) Kv(e)
;((this.deps = this.depsTail = void 0),
T2(this),
this.onStop && this.onStop(),
(this.flags &= -2))
}
}
trigger() {
this.flags & 64 ? q0.add(this) : this.scheduler ? this.scheduler() : this.runIfDirty()
}
runIfDirty() {
k1(this) && this.run()
}
get dirty() {
return k1(this)
}
}
let WT = 0,
Rd,
Id
function QT(n, e = !1) {
if (((n.flags |= 8), e)) {
;((n.next = Id), (Id = n))
return
}
;((n.next = Rd), (Rd = n))
}
function qv() {
WT++
}
function Xv() {
if (--WT > 0) return
if (Id) {
let e = Id
for (Id = void 0; e; ) {
const t = e.next
;((e.next = void 0), (e.flags &= -9), (e = t))
}
}
let n
for (; Rd; ) {
let e = Rd
for (Rd = void 0; e; ) {
const t = e.next
if (((e.next = void 0), (e.flags &= -9), e.flags & 1))
try {
e.trigger()
} catch (i) {
n || (n = i)
}
e = t
}
}
if (n) throw n
}
function jT(n) {
for (let e = n.deps; e; e = e.nextDep)
((e.version = -1), (e.prevActiveLink = e.dep.activeLink), (e.dep.activeLink = e))
}
function qT(n) {
let e,
t = n.depsTail,
i = t
for (; i; ) {
const r = i.prevDep
;(i.version === -1 ? (i === t && (t = r), Kv(i), II(i)) : (e = i),
(i.dep.activeLink = i.prevActiveLink),
(i.prevActiveLink = void 0),
(i = r))
}
;((n.deps = e), (n.depsTail = t))
}
function k1(n) {
for (let e = n.deps; e; e = e.nextDep)
if (
e.dep.version !== e.version ||
(e.dep.computed && (XT(e.dep.computed) || e.dep.version !== e.version))
)
return !0
return !!n._dirty
}
function XT(n) {
if (
(n.flags & 4 && !(n.flags & 16)) ||
((n.flags &= -17), n.globalVersion === Yd) ||
((n.globalVersion = Yd), !n.isSSR && n.flags & 128 && ((!n.deps && !n._dirty) || !k1(n)))
)
return
n.flags |= 2
const e = n.dep,
t = fn,
i = vs
;((fn = n), (vs = !0))
try {
jT(n)
const r = n.fn(n._value)
;(e.version === 0 || Pa(r, n._value)) && ((n.flags |= 128), (n._value = r), e.version++)
} catch (r) {
throw (e.version++, r)
} finally {
;((fn = t), (vs = i), qT(n), (n.flags &= -3))
}
}
function Kv(n, e = !1) {
const { dep: t, prevSub: i, nextSub: r } = n
if (
(i && ((i.nextSub = r), (n.prevSub = void 0)),
r && ((r.prevSub = i), (n.nextSub = void 0)),
t.subs === n && ((t.subs = i), !i && t.computed))
) {
t.computed.flags &= -5
for (let s = t.computed.deps; s; s = s.nextDep) Kv(s, !0)
}
!e && !--t.sc && t.map && t.map.delete(t.key)
}
function II(n) {
const { prevDep: e, nextDep: t } = n
;(e && ((e.nextDep = t), (n.prevDep = void 0)), t && ((t.prevDep = e), (n.nextDep = void 0)))
}
let vs = !0
const KT = []
function Go() {
;(KT.push(vs), (vs = !1))
}
function Wo() {
const n = KT.pop()
vs = n === void 0 ? !0 : n
}
function T2(n) {
const { cleanup: e } = n
if (((n.cleanup = void 0), e)) {
const t = fn
fn = void 0
try {
e()
} finally {
fn = t
}
}
}
let Yd = 0
class NI {
constructor(e, t) {
;((this.sub = e),
(this.dep = t),
(this.version = t.version),
(this.nextDep = this.prevDep = this.nextSub = this.prevSub = this.prevActiveLink = void 0))
}
}
class Yv {
constructor(e) {
;((this.computed = e),
(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))
}
track(e) {
if (!fn || !vs || fn === this.computed) return
let t = this.activeLink
if (t === void 0 || t.sub !== fn)
((t = this.activeLink = new NI(fn, this)),
fn.deps
? ((t.prevDep = fn.depsTail), (fn.depsTail.nextDep = t), (fn.depsTail = t))
: (fn.deps = fn.depsTail = t),
YT(t))
else if (t.version === -1 && ((t.version = this.version), t.nextDep)) {
const i = t.nextDep
;((i.prevDep = t.prevDep),
t.prevDep && (t.prevDep.nextDep = i),
(t.prevDep = fn.depsTail),
(t.nextDep = void 0),
(fn.depsTail.nextDep = t),
(fn.depsTail = t),
fn.deps === t && (fn.deps = i))
}
return t
}
trigger(e) {
;(this.version++, Yd++, this.notify(e))
}
notify(e) {
qv()
try {
for (let t = this.subs; t; t = t.prevSub) t.sub.notify() && t.sub.dep.notify()
} finally {
Xv()
}
}
}
function YT(n) {
if ((n.dep.sc++, n.sub.flags & 4)) {
const e = n.dep.computed
if (e && !n.dep.subs) {
e.flags |= 20
for (let i = e.deps; i; i = i.nextDep) YT(i)
}
const t = n.dep.subs
;(t !== n && ((n.prevSub = t), t && (t.nextSub = n)), (n.dep.subs = n))
}
}
const Yp = new WeakMap(),
Ml = Symbol(''),
z1 = Symbol(''),
Zd = Symbol('')
function Pi(n, e, t) {
if (vs && fn) {
let i = Yp.get(n)
i || Yp.set(n, (i = new Map()))
let r = i.get(t)
;(r || (i.set(t, (r = new Yv())), (r.map = i), (r.key = t)), r.track())
}
}
function Po(n, e, t, i, r, s) {
const o = Yp.get(n)
if (!o) {
Yd++
return
}
const a = (l) => {
l && l.trigger()
}
if ((qv(), e === 'clear')) o.forEach(a)
else {
const l = yt(n),
c = l && Qv(t)
if (l && t === 'length') {
const u = Number(i)
o.forEach((d, h) => {
;(h === 'length' || h === Zd || (!za(h) && h >= u)) && a(d)
})
} else
switch (((t !== void 0 || o.has(void 0)) && a(o.get(t)), c && a(o.get(Zd)), e)) {
case 'add':
l ? c && a(o.get('length')) : (a(o.get(Ml)), Hc(n) && a(o.get(z1)))
break
case 'delete':
l || (a(o.get(Ml)), Hc(n) && a(o.get(z1)))
break
case 'set':
Hc(n) && a(o.get(Ml))
break
}
}
Xv()
}
function PI(n, e) {
const t = Yp.get(n)
return t && t.get(e)
}
function Yl(n) {
const e = Ot(n)
return e === n ? e : (Pi(e, 'iterate', Zd), Zr(n) ? e : e.map(gi))
}
function Xm(n) {
return (Pi((n = Ot(n)), 'iterate', Zd), n)
}
const LI = {
__proto__: null,
[Symbol.iterator]() {
return X0(this, Symbol.iterator, gi)
},
concat(...n) {
return Yl(this).concat(...n.map((e) => (yt(e) ? Yl(e) : e)))
},
entries() {
return X0(this, 'entries', (n) => ((n[1] = gi(n[1])), n))
},
every(n, e) {
return fo(this, 'every', n, e, void 0, arguments)
},
filter(n, e) {
return fo(this, 'filter', n, e, (t) => t.map(gi), arguments)
},
find(n, e) {
return fo(this, 'find', n, e, gi, arguments)
},
findIndex(n, e) {
return fo(this, 'findIndex', n, e, void 0, arguments)
},
findLast(n, e) {
return fo(this, 'findLast', n, e, gi, arguments)
},
findLastIndex(n, e) {
return fo(this, 'findLastIndex', n, e, void 0, arguments)
},
forEach(n, e) {
return fo(this, 'forEach', n, e, void 0, arguments)
},
includes(...n) {
return K0(this, 'includes', n)
},
indexOf(...n) {
return K0(this, 'indexOf', n)
},
join(n) {
return Yl(this).join(n)
},
lastIndexOf(...n) {
return K0(this, 'lastIndexOf', n)
},
map(n, e) {
return fo(this, 'map', n, e, void 0, arguments)
},
pop() {
return Zu(this, 'pop')
},
push(...n) {
return Zu(this, 'push', n)
},
reduce(n, ...e) {
return w2(this, 'reduce', n, e)
},
reduceRight(n, ...e) {
return w2(this, 'reduceRight', n, e)
},
shift() {
return Zu(this, 'shift')
},
some(n, e) {
return fo(this, 'some', n, e, void 0, arguments)
},
splice(...n) {
return Zu(this, 'splice', n)
},
toReversed() {
return Yl(this).toReversed()
},
toSorted(n) {
return Yl(this).toSorted(n)
},
toSpliced(...n) {
return Yl(this).toSpliced(...n)
},
unshift(...n) {
return Zu(this, 'unshift', n)
},
values() {
return X0(this, 'values', gi)
},
}
function X0(n, e, t) {
const i = Xm(n),
r = i[e]()
return (
i !== n &&
!Zr(n) &&
((r._next = r.next),
(r.next = () => {
const s = r._next()
return (s.value && (s.value = t(s.value)), s)
})),
r
)
}
const DI = Array.prototype
function fo(n, e, t, i, r, s) {
const o = Xm(n),
a = o !== n && !Zr(n),
l = o[e]
if (l !== DI[e]) {
const d = l.apply(n, s)
return a ? gi(d) : d
}
let c = t
o !== n &&
(a
? (c = function (d, h) {
return t.call(this, gi(d), h, n)
})
: t.length > 2 &&
(c = function (d, h) {
return t.call(this, d, h, n)
}))
const u = l.call(o, c, i)
return a && r ? r(u) : u
}
function w2(n, e, t, i) {
const r = Xm(n)
let s = t
return (
r !== n &&
(Zr(n)
? t.length > 3 &&
(s = function (o, a, l) {
return t.call(this, o, a, l, n)
})
: (s = function (o, a, l) {
return t.call(this, o, gi(a), l, n)
})),
r[e](s, ...i)
)
}
function K0(n, e, t) {
const i = Ot(n)
Pi(i, 'iterate', Zd)
const r = i[e](...t)
return (r === -1 || r === !1) && e_(t[0]) ? ((t[0] = Ot(t[0])), i[e](...t)) : r
}
function Zu(n, e, t = []) {
;(Go(), qv())
const i = Ot(n)[e].apply(n, t)
return (Xv(), Wo(), i)
}
const FI = $v('__proto__,__v_isRef,__isVue'),
ZT = new Set(
Object.getOwnPropertyNames(Symbol)
.filter((n) => n !== 'arguments' && n !== 'caller')
.map((n) => Symbol[n])
.filter(za)
)
function OI(n) {
za(n) || (n = String(n))
const e = Ot(this)
return (Pi(e, 'has', n), e.hasOwnProperty(n))
}
class JT {
constructor(e = !1, t = !1) {
;((this._isReadonly = e), (this._isShallow = t))
}
get(e, t, i) {
if (t === '__v_skip') return e.__v_skip
const r = this._isReadonly,
s = this._isShallow
if (t === '__v_isReactive') return !r
if (t === '__v_isReadonly') return r
if (t === '__v_isShallow') return s
if (t === '__v_raw')
return i === (r ? (s ? QI : iw) : s ? nw : tw).get(e) ||
Object.getPrototypeOf(e) === Object.getPrototypeOf(i)
? e
: void 0
const o = yt(e)
if (!r) {
let l
if (o && (l = LI[t])) return l
if (t === 'hasOwnProperty') return OI
}
const a = Reflect.get(e, t, bn(e) ? e : i)
return (za(t) ? ZT.has(t) : FI(t)) || (r || Pi(e, 'get', t), s)
? a
: bn(a)
? o && Qv(t)
? a
: a.value
: gn(a)
? r
? rw(a)
: Zs(a)
: a
}
}
class ew extends JT {
constructor(e = !1) {
super(!1, e)
}
set(e, t, i, r) {
let s = e[t]
if (!this._isShallow) {
const l = Oa(s)
if ((!Zr(i) && !Oa(i) && ((s = Ot(s)), (i = Ot(i))), !yt(e) && bn(s) && !bn(i)))
return l ? !1 : ((s.value = i), !0)
}
const o = yt(e) && Qv(t) ? Number(t) < e.length : en(e, t),
a = Reflect.set(e, t, i, bn(e) ? e : r)
return (e === Ot(r) && (o ? Pa(i, s) && Po(e, 'set', t, i) : Po(e, 'add', t, i)), a)
}
deleteProperty(e, t) {
const i = en(e, t)
e[t]
const r = Reflect.deleteProperty(e, t)
return (r && i && Po(e, 'delete', t, void 0), r)
}
has(e, t) {
const i = Reflect.has(e, t)
return ((!za(t) || !ZT.has(t)) && Pi(e, 'has', t), i)
}
ownKeys(e) {
return (Pi(e, 'iterate', yt(e) ? 'length' : Ml), Reflect.ownKeys(e))
}
}
class BI extends JT {
constructor(e = !1) {
super(!0, e)
}
set(e, t) {
return !0
}
deleteProperty(e, t) {
return !0
}
}
const UI = new ew(),
kI = new BI(),
zI = new ew(!0)
const V1 = (n) => n,
ff = (n) => Reflect.getPrototypeOf(n)
function VI(n, e, t) {
return function (...i) {
const r = this.__v_raw,
s = Ot(r),
o = Hc(s),
a = n === 'entries' || (n === Symbol.iterator && o),
l = n === 'keys' && o,
c = r[n](...i),
u = t ? V1 : e ? Zp : gi
return (
!e && Pi(s, 'iterate', l ? z1 : Ml),
{
next() {
const { value: d, done: h } = c.next()
return h ? { value: d, done: h } : { value: a ? [u(d[0]), u(d[1])] : u(d), done: h }
},
[Symbol.iterator]() {
return this
},
}
)
}
}
function pf(n) {
return function (...e) {
return n === 'delete' ? !1 : n === 'clear' ? void 0 : this
}
}
function HI(n, e) {
const t = {
get(r) {
const s = this.__v_raw,
o = Ot(s),
a = Ot(r)
n || (Pa(r, a) && Pi(o, 'get', r), Pi(o, 'get', a))
const { has: l } = ff(o),
c = e ? V1 : n ? Zp : gi
if (l.call(o, r)) return c(s.get(r))
if (l.call(o, a)) return c(s.get(a))
s !== o && s.get(r)
},
get size() {
const r = this.__v_raw
return (!n && Pi(Ot(r), 'iterate', Ml), Reflect.get(r, 'size', r))
},
has(r) {
const s = this.__v_raw,
o = Ot(s),
a = Ot(r)
return (
n || (Pa(r, a) && Pi(o, 'has', r), Pi(o, 'has', a)),
r === a ? s.has(r) : s.has(r) || s.has(a)
)
},
forEach(r, s) {
const o = this,
a = o.__v_raw,
l = Ot(a),
c = e ? V1 : n ? Zp : gi
return (!n && Pi(l, 'iterate', Ml), a.forEach((u, d) => r.call(s, c(u), c(d), o)))
},
}
return (
ti(
t,
n
? { add: pf('add'), set: pf('set'), delete: pf('delete'), clear: pf('clear') }
: {
add(r) {
!e && !Zr(r) && !Oa(r) && (r = Ot(r))
const s = Ot(this)
return (ff(s).has.call(s, r) || (s.add(r), Po(s, 'add', r, r)), this)
},
set(r, s) {
!e && !Zr(s) && !Oa(s) && (s = Ot(s))
const o = Ot(this),
{ has: a, get: l } = ff(o)
let c = a.call(o, r)
c || ((r = Ot(r)), (c = a.call(o, r)))
const u = l.call(o, r)
return (o.set(r, s), c ? Pa(s, u) && Po(o, 'set', r, s) : Po(o, 'add', r, s), this)
},
delete(r) {
const s = Ot(this),
{ has: o, get: a } = ff(s)
let l = o.call(s, r)
;(l || ((r = Ot(r)), (l = o.call(s, r))), a && a.call(s, r))
const c = s.delete(r)
return (l && Po(s, 'delete', r, void 0), c)
},
clear() {
const r = Ot(this),
s = r.size !== 0,
o = r.clear()
return (s && Po(r, 'clear', void 0, void 0), o)
},
}
),
['keys', 'values', 'entries', Symbol.iterator].forEach((r) => {
t[r] = VI(r, n, e)
}),
t
)
}
function Zv(n, e) {
const t = HI(n, e)
return (i, r, s) =>
r === '__v_isReactive'
? !n
: r === '__v_isReadonly'
? n
: r === '__v_raw'
? i
: Reflect.get(en(t, r) && r in i ? t : i, r, s)
}
const $I = { get: Zv(!1, !1) },
GI = { get: Zv(!1, !0) },
WI = { get: Zv(!0, !1) }
const tw = new WeakMap(),
nw = new WeakMap(),
iw = new WeakMap(),
QI = new WeakMap()
function jI(n) {
switch (n) {
case 'Object':
case 'Array':
return 1
case 'Map':
case 'Set':
case 'WeakMap':
case 'WeakSet':
return 2
default:
return 0
}
}
function qI(n) {
return n.__v_skip || !Object.isExtensible(n) ? 0 : jI(vI(n))
}
function Zs(n) {
return Oa(n) ? n : Jv(n, !1, UI, $I, tw)
}
function XI(n) {
return Jv(n, !1, zI, GI, nw)
}
function rw(n) {
return Jv(n, !0, kI, WI, iw)
}
function Jv(n, e, t, i, r) {
if (!gn(n) || (n.__v_raw && !(e && n.__v_isReactive))) return n
const s = qI(n)
if (s === 0) return n
const o = r.get(n)
if (o) return o
const a = new Proxy(n, s === 2 ? i : t)
return (r.set(n, a), a)
}
function ko(n) {
return Oa(n) ? ko(n.__v_raw) : !!(n && n.__v_isReactive)
}
function Oa(n) {
return !!(n && n.__v_isReadonly)
}
function Zr(n) {
return !!(n && n.__v_isShallow)
}
function e_(n) {
return n ? !!n.__v_raw : !1
}
function Ot(n) {
const e = n && n.__v_raw
return e ? Ot(e) : n
}
function t_(n) {
return (!en(n, '__v_skip') && Object.isExtensible(n) && U1(n, '__v_skip', !0), n)
}
const gi = (n) => (gn(n) ? Zs(n) : n),
Zp = (n) => (gn(n) ? rw(n) : n)
function bn(n) {
return n ? n.__v_isRef === !0 : !1
}
function Dn(n) {
return sw(n, !1)
}
function lr(n) {
return sw(n, !0)
}
function sw(n, e) {
return bn(n) ? n : new KI(n, e)
}
class KI {
constructor(e, t) {
;((this.dep = new Yv()),
(this.__v_isRef = !0),
(this.__v_isShallow = !1),
(this._rawValue = t ? e : Ot(e)),
(this._value = t ? e : gi(e)),
(this.__v_isShallow = t))
}
get value() {
return (this.dep.track(), this._value)
}
set value(e) {
const t = this._rawValue,
i = this.__v_isShallow || Zr(e) || Oa(e)
;((e = i ? e : Ot(e)),
Pa(e, t) && ((this._rawValue = e), (this._value = i ? e : gi(e)), this.dep.trigger()))
}
}
function YI(n) {
n.dep && n.dep.trigger()
}
function Ge(n) {
return bn(n) ? n.value : n
}
const ZI = {
get: (n, e, t) => (e === '__v_raw' ? n : Ge(Reflect.get(n, e, t))),
set: (n, e, t, i) => {
const r = n[e]
return bn(r) && !bn(t) ? ((r.value = t), !0) : Reflect.set(n, e, t, i)
},
}
function ow(n) {
return ko(n) ? n : new Proxy(n, ZI)
}
function JI(n) {
const e = yt(n) ? new Array(n.length) : {}
for (const t in n) e[t] = aw(n, t)
return e
}
class e8 {
constructor(e, t, i) {
;((this._object = e),
(this._key = t),
(this._defaultValue = i),
(this.__v_isRef = !0),
(this._value = void 0))
}
get value() {
const e = this._object[this._key]
return (this._value = e === void 0 ? this._defaultValue : e)
}
set value(e) {
this._object[this._key] = e
}
get dep() {
return PI(Ot(this._object), this._key)
}
}
class t8 {
constructor(e) {
;((this._getter = e), (this.__v_isRef = !0), (this.__v_isReadonly = !0), (this._value = void 0))
}
get value() {
return (this._value = this._getter())
}
}
function n8(n, e, t) {
return bn(n) ? n : Ct(n) ? new t8(n) : gn(n) && arguments.length > 1 ? aw(n, e, t) : Dn(n)
}
function aw(n, e, t) {
const i = n[e]
return bn(i) ? i : new e8(n, e, t)
}
class i8 {
constructor(e, t, i) {
;((this.fn = e),
(this.setter = t),
(this._value = void 0),
(this.dep = new Yv(this)),
(this.__v_isRef = !0),
(this.deps = void 0),
(this.depsTail = void 0),
(this.flags = 16),
(this.globalVersion = Yd - 1),
(this.next = void 0),
(this.effect = this),
(this.__v_isReadonly = !t),
(this.isSSR = i))
}
notify() {
if (((this.flags |= 16), !(this.flags & 8) && fn !== this)) return (QT(this, !0), !0)
}
get value() {
const e = this.dep.track()
return (XT(this), e && (e.version = this.dep.version), this._value)
}
set value(e) {
this.setter && this.setter(e)
}
}
function r8(n, e, t = !1) {
let i, r
return (Ct(n) ? (i = n) : ((i = n.get), (r = n.set)), new i8(i, r, t))
}
const mf = {},
Jp = new WeakMap()
let fl
function s8(n, e = !1, t = fl) {
if (t) {
let i = Jp.get(t)
;(i || Jp.set(t, (i = [])), i.push(n))
}
}
function o8(n, e, t = un) {
const { immediate: i, deep: r, once: s, scheduler: o, augmentJob: a, call: l } = t,
c = (_) => (r ? _ : Zr(_) || r === !1 || r === 0 ? Lo(_, 1) : Lo(_))
let u,
d,
h,
f,
p = !1,
g = !1
if (
(bn(n)
? ((d = () => n.value), (p = Zr(n)))
: ko(n)
? ((d = () => c(n)), (p = !0))
: yt(n)
? ((g = !0),
(p = n.some((_) => ko(_) || Zr(_))),
(d = () =>
n.map((_) => {
if (bn(_)) return _.value
if (ko(_)) return c(_)
if (Ct(_)) return l ? l(_, 2) : _()
})))
: Ct(n)
? e
? (d = l ? () => l(n, 2) : n)
: (d = () => {
if (h) {
Go()
try {
h()
} finally {
Wo()
}
}
const _ = fl
fl = u
try {
return l ? l(n, 3, [f]) : n(f)
} finally {
fl = _
}
})
: (d = Qs),
e && r)
) {
const _ = d,
S = r === !0 ? 1 / 0 : r
d = () => Lo(_(), S)
}
const y = $T(),
m = () => {
;(u.stop(), y && y.active && Wv(y.effects, u))
}
if (s && e) {
const _ = e
e = (...S) => {
;(_(...S), m())
}
}
let v = g ? new Array(n.length).fill(mf) : mf
const x = (_) => {
if (!(!(u.flags & 1) || (!u.dirty && !_)))
if (e) {
const S = u.run()
if (r || p || (g ? S.some((C, A) => Pa(C, v[A])) : Pa(S, v))) {
h && h()
const C = fl
fl = u
try {
const A = [S, v === mf ? void 0 : g && v[0] === mf ? [] : v, f]
;((v = S), l ? l(e, 3, A) : e(...A))
} finally {
fl = C
}
}
} else u.run()
}
return (
a && a(x),
(u = new GT(d)),
(u.scheduler = o ? () => o(x, !1) : x),
(f = (_) => s8(_, !1, u)),
(h = u.onStop =
() => {
const _ = Jp.get(u)
if (_) {
if (l) l(_, 4)
else for (const S of _) S()
Jp.delete(u)
}
}),
e ? (i ? x(!0) : (v = u.run())) : o ? o(x.bind(null, !0), !0) : u.run(),
(m.pause = u.pause.bind(u)),
(m.resume = u.resume.bind(u)),
(m.stop = m),
m
)
}
function Lo(n, e = 1 / 0, t) {
if (e <= 0 || !gn(n) || n.__v_skip || ((t = t || new Set()), t.has(n))) return n
if ((t.add(n), e--, bn(n))) Lo(n.value, e, t)
else if (yt(n)) for (let i = 0; i < n.length; i++) Lo(n[i], e, t)
else if (FT(n) || Hc(n))
n.forEach((i) => {
Lo(i, e, t)
})
else if (UT(n)) {
for (const i in n) Lo(n[i], e, t)
for (const i of Object.getOwnPropertySymbols(n))
Object.prototype.propertyIsEnumerable.call(n, i) && Lo(n[i], e, t)
}
return n
}
/**
* @vue/runtime-core v3.5.17
* (c) 2018-present Yuxi (Evan) You and Vue contributors
* @license MIT
**/ function Lh(n, e, t, i) {
try {
return i ? n(...i) : n()
} catch (r) {
Km(r, e, t)
}
}
function As(n, e, t, i) {
if (Ct(n)) {
const r = Lh(n, e, t, i)
return (
r &&
OT(r) &&
r.catch((s) => {
Km(s, e, t)
}),
r
)
}
if (yt(n)) {
const r = []
for (let s = 0; s < n.length; s++) r.push(As(n[s], e, t, i))
return r
}
}
function Km(n, e, t, i = !0) {
const r = e ? e.vnode : null,
{ errorHandler: s, throwUnhandledErrorInProduction: o } = (e && e.appContext.config) || un
if (e) {
let a = e.parent
const l = e.proxy,
c = 'https://vuejs.org/error-reference/#runtime-'.concat(t)
for (; a; ) {
const u = a.ec
if (u) {
for (let d = 0; d < u.length; d++) if (u[d](n, l, c) === !1) return
}
a = a.parent
}
if (s) {
;(Go(), Lh(s, null, 10, [n, l, c]), Wo())
return
}
}
a8(n, t, r, i, o)
}
function a8(n, e, t, i = !0, r = !1) {
if (r) throw n
console.error(n)
}
const Xi = []
let Fs = -1
const $c = []
let va = null,
Tc = 0
const lw = Promise.resolve()
let em = null
function Dh(n) {
const e = em || lw
return n ? e.then(this ? n.bind(this) : n) : e
}
function l8(n) {
let e = Fs + 1,
t = Xi.length
for (; e < t; ) {
const i = (e + t) >>> 1,
r = Xi[i],
s = Jd(r)
s < n || (s === n && r.flags & 2) ? (e = i + 1) : (t = i)
}
return e
}
function n_(n) {
if (!(n.flags & 1)) {
const e = Jd(n),
t = Xi[Xi.length - 1]
;(!t || (!(n.flags & 2) && e >= Jd(t)) ? Xi.push(n) : Xi.splice(l8(e), 0, n),
(n.flags |= 1),
cw())
}
}
function cw() {
em || (em = lw.then(dw))
}
function c8(n) {
;(yt(n)
? $c.push(...n)
: va && n.id === -1
? va.splice(Tc + 1, 0, n)
: n.flags & 1 || ($c.push(n), (n.flags |= 1)),
cw())
}
function C2(n, e, t = Fs + 1) {
for (; t < Xi.length; t++) {
const i = Xi[t]
if (i && i.flags & 2) {
if (n && i.id !== n.uid) continue
;(Xi.splice(t, 1), t--, i.flags & 4 && (i.flags &= -2), i(), i.flags & 4 || (i.flags &= -2))
}
}
}
function uw(n) {
if ($c.length) {
const e = [...new Set($c)].sort((t, i) => Jd(t) - Jd(i))
if ((($c.length = 0), va)) {
va.push(...e)
return
}
for (va = e, Tc = 0; Tc < va.length; Tc++) {
const t = va[Tc]
;(t.flags & 4 && (t.flags &= -2), t.flags & 8 || t(), (t.flags &= -2))
}
;((va = null), (Tc = 0))
}
}
const Jd = (n) => (n.id == null ? (n.flags & 2 ? -1 : 1 / 0) : n.id)
function dw(n) {
try {
for (Fs = 0; Fs < Xi.length; Fs++) {
const e = Xi[Fs]
e &&
!(e.flags & 8) &&
(e.flags & 4 && (e.flags &= -2), Lh(e, e.i, e.i ? 15 : 14), e.flags & 4 || (e.flags &= -2))
}
} finally {
for (; Fs < Xi.length; Fs++) {
const e = Xi[Fs]
e && (e.flags &= -2)
}
;((Fs = -1), (Xi.length = 0), uw(), (em = null), (Xi.length || $c.length) && dw())
}
}
let Zi = null,
hw = null
function tm(n) {
const e = Zi
return ((Zi = n), (hw = (n && n.type.__scopeId) || null), e)
}
function fw(n, e = Zi, t) {
if (!e || n._n) return n
const i = (...r) => {
i._d && k2(-1)
const s = tm(e)
let o
try {
o = n(...r)
} finally {
;(tm(s), i._d && k2(1))
}
return o
}
return ((i._n = !0), (i._c = !0), (i._d = !0), i)
}
function Pc(n, e) {
if (Zi === null) return n
const t = t0(Zi),
i = n.dirs || (n.dirs = [])
for (let r = 0; r < e.length; r++) {
let [s, o, a, l = un] = e[r]
s &&
(Ct(s) && (s = { mounted: s, updated: s }),
s.deep && Lo(o),
i.push({ dir: s, instance: t, value: o, oldValue: void 0, arg: a, modifiers: l }))
}
return n
}
function Ya(n, e, t, i) {
const r = n.dirs,
s = e && e.dirs
for (let o = 0; o < r.length; o++) {
const a = r[o]
s && (a.oldValue = s[o].value)
let l = a.dir[i]
l && (Go(), As(l, t, 8, [n.el, a, n, e]), Wo())
}
}
const pw = Symbol('_vte'),
u8 = (n) => n.__isTeleport,
Nd = (n) => n && (n.disabled || n.disabled === ''),
E2 = (n) => n && (n.defer || n.defer === ''),
M2 = (n) => typeof SVGElement < 'u' && n instanceof SVGElement,
R2 = (n) => typeof MathMLElement == 'function' && n instanceof MathMLElement,
H1 = (n, e) => {
const t = n && n.to
return wn(t) ? (e ? e(t) : null) : t
},
mw = {
name: 'Teleport',
__isTeleport: !0,
process(n, e, t, i, r, s, o, a, l, c) {
const {
mc: u,
pc: d,
pbc: h,
o: { insert: f, querySelector: p, createText: g, createComment: y },
} = c,
m = Nd(e.props)
let { shapeFlag: v, children: x, dynamicChildren: _ } = e
if (n == null) {
const S = (e.el = g('')),
C = (e.anchor = g(''))
;(f(S, t, i), f(C, t, i))
const A = (w, M) => {
v & 16 && (r && r.isCE && (r.ce._teleportTarget = w), u(x, w, M, r, s, o, a, l))
},
R = () => {
const w = (e.target = H1(e.props, p)),
M = yw(w, e, g, f)
w &&
(o !== 'svg' && M2(w) ? (o = 'svg') : o !== 'mathml' && R2(w) && (o = 'mathml'),
m || (A(w, M), _p(e, !1)))
}
;(m && (A(t, C), _p(e, !0)),
E2(e.props)
? ((e.el.__isMounted = !1),
ji(() => {
;(R(), delete e.el.__isMounted)
}, s))
: R())
} else {
if (E2(e.props) && n.el.__isMounted === !1) {
ji(() => {
mw.process(n, e, t, i, r, s, o, a, l, c)
}, s)
return
}
;((e.el = n.el), (e.targetStart = n.targetStart))
const S = (e.anchor = n.anchor),
C = (e.target = n.target),
A = (e.targetAnchor = n.targetAnchor),
R = Nd(n.props),
w = R ? t : C,
M = R ? S : A
if (
(o === 'svg' || M2(C) ? (o = 'svg') : (o === 'mathml' || R2(C)) && (o = 'mathml'),
_
? (h(n.dynamicChildren, _, w, r, s, o, a), o_(n, e, !0))
: l || d(n, e, w, M, r, s, o, a, !1),
m)
)
R
? e.props && n.props && e.props.to !== n.props.to && (e.props.to = n.props.to)
: gf(e, t, S, c, 1)
else if ((e.props && e.props.to) !== (n.props && n.props.to)) {
const I = (e.target = H1(e.props, p))
I && gf(e, I, null, c, 0)
} else R && gf(e, C, A, c, 1)
_p(e, m)
}
},
remove(n, e, t, { um: i, o: { remove: r } }, s) {
const {
shapeFlag: o,
children: a,
anchor: l,
targetStart: c,
targetAnchor: u,
target: d,
props: h,
} = n
if ((d && (r(c), r(u)), s && r(l), o & 16)) {
const f = s || !Nd(h)
for (let p = 0; p < a.length; p++) {
const g = a[p]
i(g, e, t, f, !!g.dynamicChildren)
}
}
},
move: gf,
hydrate: d8,
}
function gf(n, e, t, { o: { insert: i }, m: r }, s = 2) {
s === 0 && i(n.targetAnchor, e, t)
const { el: o, anchor: a, shapeFlag: l, children: c, props: u } = n,
d = s === 2
if ((d && i(o, e, t), (!d || Nd(u)) && l & 16))
for (let h = 0; h < c.length; h++) r(c[h], e, t, 2)
d && i(a, e, t)
}
function d8(
n,
e,
t,
i,
r,
s,
{ o: { nextSibling: o, parentNode: a, querySelector: l, insert: c, createText: u } },
d
) {
const h = (e.target = H1(e.props, l))
if (h) {
const f = Nd(e.props),
p = h._lpa || h.firstChild
if (e.shapeFlag & 16)
if (f)
((e.anchor = d(o(n), e, a(n), t, i, r, s)),
(e.targetStart = p),
(e.targetAnchor = p && o(p)))
else {
e.anchor = o(n)
let g = p
for (; g; ) {
if (g && g.nodeType === 8) {
if (g.data === 'teleport start anchor') e.targetStart = g
else if (g.data === 'teleport anchor') {
;((e.targetAnchor = g), (h._lpa = e.targetAnchor && o(e.targetAnchor)))
break
}
}
g = o(g)
}
;(e.targetAnchor || yw(h, e, u, c), d(p && o(p), e, h, t, i, r, s))
}
_p(e, f)
}
return e.anchor && o(e.anchor)
}
const gw = mw
function _p(n, e) {
const t = n.ctx
if (t && t.ut) {
let i, r
for (
e ? ((i = n.el), (r = n.anchor)) : ((i = n.targetStart), (r = n.targetAnchor));
i && i !== r;
)
(i.nodeType === 1 && i.setAttribute('data-v-owner', t.uid), (i = i.nextSibling))
t.ut()
}
}
function yw(n, e, t, i) {
const r = (e.targetStart = t('')),
s = (e.targetAnchor = t(''))
return ((r[pw] = s), n && (i(r, n), i(s, n)), s)
}
const Zl = Symbol('_leaveCb'),
yf = Symbol('_enterCb')
function h8() {
const n = { isMounted: !1, isLeaving: !1, isUnmounting: !1, leavingVNodes: new Map() }
return (
Va(() => {
n.isMounted = !0
}),
Zm(() => {
n.isUnmounting = !0
}),
n
)
}
const Vr = [Function, Array],
f8 = {
mode: String,
appear: Boolean,
persisted: Boolean,
onBeforeEnter: Vr,
onEnter: Vr,
onAfterEnter: Vr,
onEnterCancelled: Vr,
onBeforeLeave: Vr,
onLeave: Vr,
onAfterLeave: Vr,
onLeaveCancelled: Vr,
onBeforeAppear: Vr,
onAppear: Vr,
onAfterAppear: Vr,
onAppearCancelled: Vr,
}
function p8(n, e) {
const { leavingVNodes: t } = n
let i = t.get(e.type)
return (i || ((i = Object.create(null)), t.set(e.type, i)), i)
}
function $1(n, e, t, i, r) {
const {
appear: s,
mode: o,
persisted: a = !1,
onBeforeEnter: l,
onEnter: c,
onAfterEnter: u,
onEnterCancelled: d,
onBeforeLeave: h,
onLeave: f,
onAfterLeave: p,
onLeaveCancelled: g,
onBeforeAppear: y,
onAppear: m,
onAfterAppear: v,
onAppearCancelled: x,
} = e,
_ = String(n.key),
S = p8(t, n),
C = (w, M) => {
w && As(w, i, 9, M)
},
A = (w, M) => {
const I = M[1]
;(C(w, M), yt(w) ? w.every((L) => L.length <= 1) && I() : w.length <= 1 && I())
},
R = {
mode: o,
persisted: a,
beforeEnter(w) {
let M = l
if (!t.isMounted)
if (s) M = y || l
else return
w[Zl] && w[Zl](!0)
const I = S[_]
;(I && wc(n, I) && I.el[Zl] && I.el[Zl](), C(M, [w]))
},
enter(w) {
let M = c,
I = u,
L = d
if (!t.isMounted)
if (s) ((M = m || c), (I = v || u), (L = x || d))
else return
let U = !1
const T = (w[yf] = (F) => {
U ||
((U = !0),
F ? C(L, [w]) : C(I, [w]),
R.delayedLeave && R.delayedLeave(),
(w[yf] = void 0))
})
M ? A(M, [w, T]) : T()
},
leave(w, M) {
const I = String(n.key)
if ((w[yf] && w[yf](!0), t.isUnmounting)) return M()
C(h, [w])
let L = !1
const U = (w[Zl] = (T) => {
L ||
((L = !0), M(), T ? C(g, [w]) : C(p, [w]), (w[Zl] = void 0), S[I] === n && delete S[I])
})
;((S[I] = n), f ? A(f, [w, U]) : U())
},
clone(w) {
return $1(w, e, t, i)
},
}
return R
}
function eh(n, e) {
n.shapeFlag & 6 && n.component
? ((n.transition = e), eh(n.component.subTree, e))
: n.shapeFlag & 128
? ((n.ssContent.transition = e.clone(n.ssContent)),
(n.ssFallback.transition = e.clone(n.ssFallback)))
: (n.transition = e)
}
function vw(n, e = !1, t) {
let i = [],
r = 0
for (let s = 0; s < n.length; s++) {
let o = n[s]
const a = t == null ? o.key : String(t) + String(o.key != null ? o.key : s)
o.type === Hn
? (o.patchFlag & 128 && r++, (i = i.concat(vw(o.children, e, a))))
: (e || o.type !== Js) && i.push(a != null ? Qo(o, { key: a }) : o)
}
if (r > 1) for (let s = 0; s < i.length; s++) i[s].patchFlag = -2
return i
}
/*! #__NO_SIDE_EFFECTS__ */ function qt(n, e) {
return Ct(n) ? ti({ name: n.name }, e, { setup: n }) : n
}
function _w(n) {
n.ids = [n.ids[0] + n.ids[2]++ + '-', 0, 0]
}
function nm(n) {
const e = jo(),
t = lr(null)
if (e) {
const r = e.refs === un ? (e.refs = {}) : e.refs
Object.defineProperty(r, n, { enumerable: !0, get: () => t.value, set: (s) => (t.value = s) })
}
return t
}
function Pd(n, e, t, i, r = !1) {
if (yt(n)) {
n.forEach((p, g) => Pd(p, e && (yt(e) ? e[g] : e), t, i, r))
return
}
if (Ld(i) && !r) {
i.shapeFlag & 512 &&
i.type.__asyncResolved &&
i.component.subTree.component &&
Pd(n, e, t, i.component.subTree)
return
}
const s = i.shapeFlag & 4 ? t0(i.component) : i.el,
o = r ? null : s,
{ i: a, r: l } = n,
c = e && e.r,
u = a.refs === un ? (a.refs = {}) : a.refs,
d = a.setupState,
h = Ot(d),
f = d === un ? () => !1 : (p) => en(h, p)
if (
(c != null &&
c !== l &&
(wn(c) ? ((u[c] = null), f(c) && (d[c] = null)) : bn(c) && (c.value = null)),
Ct(l))
)
Lh(l, a, 12, [o, u])
else {
const p = wn(l),
g = bn(l)
if (p || g) {
const y = () => {
if (n.f) {
const m = p ? (f(l) ? d[l] : u[l]) : l.value
r
? yt(m) && Wv(m, s)
: yt(m)
? m.includes(s) || m.push(s)
: p
? ((u[l] = [s]), f(l) && (d[l] = u[l]))
: ((l.value = [s]), n.k && (u[n.k] = l.value))
} else p ? ((u[l] = o), f(l) && (d[l] = o)) : g && ((l.value = o), n.k && (u[n.k] = o))
}
o ? ((y.id = -1), ji(y, t)) : y()
}
}
}
qm().requestIdleCallback
qm().cancelIdleCallback
const Ld = (n) => !!n.type.__asyncLoader,
xw = (n) => n.type.__isKeepAlive
function m8(n, e) {
Sw(n, 'a', e)
}
function g8(n, e) {
Sw(n, 'da', e)
}
function Sw(n, e, t = ui) {
const i =
n.__wdc ||
(n.__wdc = () => {
let r = t
for (; r; ) {
if (r.isDeactivated) return
r = r.parent
}
return n()
})
if ((Ym(e, i, t), t)) {
let r = t.parent
for (; r && r.parent; ) (xw(r.parent.vnode) && y8(i, e, t, r), (r = r.parent))
}
}
function y8(n, e, t, i) {
const r = Ym(e, n, i, !0)
Fh(() => {
Wv(i[e], r)
}, t)
}
function Ym(n, e, t = ui, i = !1) {
if (t) {
const r = t[n] || (t[n] = []),
s =
e.__weh ||
(e.__weh = (...o) => {
Go()
const a = Oh(t),
l = As(e, t, n, o)
return (a(), Wo(), l)
})
return (i ? r.unshift(s) : r.push(s), s)
}
}
const na =
(n) =>
(e, t = ui) => {
;(!ih || n === 'sp') && Ym(n, (...i) => e(...i), t)
},
Aw = na('bm'),
Va = na('m'),
v8 = na('bu'),
i_ = na('u'),
Zm = na('bum'),
Fh = na('um'),
_8 = na('sp'),
x8 = na('rtg'),
S8 = na('rtc')
function A8(n, e = ui) {
Ym('ec', n, e)
}
const bw = 'components',
b8 = 'directives',
Tw = Symbol.for('v-ndc')
function T8(n) {
return wn(n) ? ww(bw, n, !1) || n : n || Tw
}
function w8(n) {
return ww(b8, n)
}
function ww(n, e, t = !0, i = !1) {
const r = Zi || ui
if (r) {
const s = r.type
if (n === bw) {
const a = h9(s, !1)
if (a && (a === e || a === ns(e) || a === jm(ns(e)))) return s
}
const o = I2(r[n] || s[n], e) || I2(r.appContext[n], e)
return !o && i ? s : o
}
}
function I2(n, e) {
return n && (n[e] || n[ns(e)] || n[jm(ns(e))])
}
function th(n, e, t, i) {
let r
const s = t,
o = yt(n)
if (o || wn(n)) {
const a = o && ko(n)
let l = !1,
c = !1
;(a && ((l = !Zr(n)), (c = Oa(n)), (n = Xm(n))), (r = new Array(n.length)))
for (let u = 0, d = n.length; u < d; u++)
r[u] = e(l ? (c ? Zp(gi(n[u])) : gi(n[u])) : n[u], u, void 0, s)
} else if (typeof n == 'number') {
r = new Array(n)
for (let a = 0; a < n; a++) r[a] = e(a + 1, a, void 0, s)
} else if (gn(n))
if (n[Symbol.iterator]) r = Array.from(n, (a, l) => e(a, l, void 0, s))
else {
const a = Object.keys(n)
r = new Array(a.length)
for (let l = 0, c = a.length; l < c; l++) {
const u = a[l]
r[l] = e(n[u], u, l, s)
}
}
else r = []
return r
}
const G1 = (n) => (n ? ($w(n) ? t0(n) : G1(n.parent)) : null),
Dd = ti(Object.create(null), {
$: (n) => n,
$el: (n) => n.vnode.el,
$data: (n) => n.data,
$props: (n) => n.props,
$attrs: (n) => n.attrs,
$slots: (n) => n.slots,
$refs: (n) => n.refs,
$parent: (n) => G1(n.parent),
$root: (n) => G1(n.root),
$host: (n) => n.ce,
$emit: (n) => n.emit,
$options: (n) => Ew(n),
$forceUpdate: (n) =>
n.f ||
(n.f = () => {
n_(n.update)
}),
$nextTick: (n) => n.n || (n.n = Dh.bind(n.proxy)),
$watch: (n) => j8.bind(n),
}),
Y0 = (n, e) => n !== un && !n.__isScriptSetup && en(n, e),
C8 = {
get({ _: n }, e) {
if (e === '__v_skip') return !0
const { ctx: t, setupState: i, data: r, props: s, accessCache: o, type: a, appContext: l } = n
let c
if (e[0] !== '$') {
const f = o[e]
if (f !== void 0)
switch (f) {
case 1:
return i[e]
case 2:
return r[e]
case 4:
return t[e]
case 3:
return s[e]
}
else {
if (Y0(i, e)) return ((o[e] = 1), i[e])
if (r !== un && en(r, e)) return ((o[e] = 2), r[e])
if ((c = n.propsOptions[0]) && en(c, e)) return ((o[e] = 3), s[e])
if (t !== un && en(t, e)) return ((o[e] = 4), t[e])
W1 && (o[e] = 0)
}
}
const u = Dd[e]
let d, h
if (u) return (e === '$attrs' && Pi(n.attrs, 'get', ''), u(n))
if ((d = a.__cssModules) && (d = d[e])) return d
if (t !== un && en(t, e)) return ((o[e] = 4), t[e])
if (((h = l.config.globalProperties), en(h, e))) return h[e]
},
set({ _: n }, e, t) {
const { data: i, setupState: r, ctx: s } = n
return Y0(r, e)
? ((r[e] = t), !0)
: i !== un && en(i, e)
? ((i[e] = t), !0)
: en(n.props, e) || (e[0] === '$' && e.slice(1) in n)
? !1
: ((s[e] = t), !0)
},
has(
{ _: { data: n, setupState: e, accessCache: t, ctx: i, appContext: r, propsOptions: s } },
o
) {
let a
return (
!!t[o] ||
(n !== un && en(n, o)) ||
Y0(e, o) ||
((a = s[0]) && en(a, o)) ||
en(i, o) ||
en(Dd, o) ||
en(r.config.globalProperties, o)
)
},
defineProperty(n, e, t) {
return (
t.get != null ? (n._.accessCache[e] = 0) : en(t, 'value') && this.set(n, e, t.value, null),
Reflect.defineProperty(n, e, t)
)
},
}
function N2(n) {
return yt(n) ? n.reduce((e, t) => ((e[t] = null), e), {}) : n
}
let W1 = !0
function E8(n) {
const e = Ew(n),
t = n.proxy,
i = n.ctx
;((W1 = !1), e.beforeCreate && P2(e.beforeCreate, n, 'bc'))
const {
data: r,
computed: s,
methods: o,
watch: a,
provide: l,
inject: c,
created: u,
beforeMount: d,
mounted: h,
beforeUpdate: f,
updated: p,
activated: g,
deactivated: y,
beforeDestroy: m,
beforeUnmount: v,
destroyed: x,
unmounted: _,
render: S,
renderTracked: C,
renderTriggered: A,
errorCaptured: R,
serverPrefetch: w,
expose: M,
inheritAttrs: I,
components: L,
directives: U,
filters: T,
} = e
if ((c && M8(c, i, null), o))
for (const Q in o) {
const ee = o[Q]
Ct(ee) && (i[Q] = ee.bind(t))
}
if (r) {
const Q = r.call(t, t)
gn(Q) && (n.data = Zs(Q))
}
if (((W1 = !0), s))
for (const Q in s) {
const ee = s[Q],
se = Ct(ee) ? ee.bind(t, t) : Ct(ee.get) ? ee.get.bind(t, t) : Qs,
he = !Ct(ee) && Ct(ee.set) ? ee.set.bind(t) : Qs,
ie = We({ get: se, set: he })
Object.defineProperty(i, Q, {
enumerable: !0,
configurable: !0,
get: () => ie.value,
set: (re) => (ie.value = re),
})
}
if (a) for (const Q in a) Cw(a[Q], i, t, Q)
if (l) {
const Q = Ct(l) ? l.call(t) : l
Reflect.ownKeys(Q).forEach((ee) => {
ia(ee, Q[ee])
})
}
u && P2(u, n, 'c')
function V(Q, ee) {
yt(ee) ? ee.forEach((se) => Q(se.bind(t))) : ee && Q(ee.bind(t))
}
if (
(V(Aw, d),
V(Va, h),
V(v8, f),
V(i_, p),
V(m8, g),
V(g8, y),
V(A8, R),
V(S8, C),
V(x8, A),
V(Zm, v),
V(Fh, _),
V(_8, w),
yt(M))
)
if (M.length) {
const Q = n.exposed || (n.exposed = {})
M.forEach((ee) => {
Object.defineProperty(Q, ee, { get: () => t[ee], set: (se) => (t[ee] = se) })
})
} else n.exposed || (n.exposed = {})
;(S && n.render === Qs && (n.render = S),
I != null && (n.inheritAttrs = I),
L && (n.components = L),
U && (n.directives = U),
w && _w(n))
}
function M8(n, e, t = Qs) {
yt(n) && (n = Q1(n))
for (const i in n) {
const r = n[i]
let s
;(gn(r)
? 'default' in r
? (s = Ji(r.from || i, r.default, !0))
: (s = Ji(r.from || i))
: (s = Ji(r)),
bn(s)
? Object.defineProperty(e, i, {
enumerable: !0,
configurable: !0,
get: () => s.value,
set: (o) => (s.value = o),
})
: (e[i] = s))
}
}
function P2(n, e, t) {
As(yt(n) ? n.map((i) => i.bind(e.proxy)) : n.bind(e.proxy), e, t)
}
function Cw(n, e, t, i) {
let r = i.includes('.') ? Uw(t, i) : () => t[i]
if (wn(n)) {
const s = e[n]
Ct(s) && Jn(r, s)
} else if (Ct(n)) Jn(r, n.bind(t))
else if (gn(n))
if (yt(n)) n.forEach((s) => Cw(s, e, t, i))
else {
const s = Ct(n.handler) ? n.handler.bind(t) : e[n.handler]
Ct(s) && Jn(r, s, n)
}
}
function Ew(n) {
const e = n.type,
{ mixins: t, extends: i } = e,
{
mixins: r,
optionsCache: s,
config: { optionMergeStrategies: o },
} = n.appContext,
a = s.get(e)
let l
return (
a
? (l = a)
: !r.length && !t && !i
? (l = e)
: ((l = {}), r.length && r.forEach((c) => im(l, c, o, !0)), im(l, e, o)),
gn(e) && s.set(e, l),
l
)
}
function im(n, e, t, i = !1) {
const { mixins: r, extends: s } = e
;(s && im(n, s, t, !0), r && r.forEach((o) => im(n, o, t, !0)))
for (const o in e)
if (!(i && o === 'expose')) {
const a = R8[o] || (t && t[o])
n[o] = a ? a(n[o], e[o]) : e[o]
}
return n
}
const R8 = {
data: L2,
props: D2,
emits: D2,
methods: bd,
computed: bd,
beforeCreate: $i,
created: $i,
beforeMount: $i,
mounted: $i,
beforeUpdate: $i,
updated: $i,
beforeDestroy: $i,
beforeUnmount: $i,
destroyed: $i,
unmounted: $i,
activated: $i,
deactivated: $i,
errorCaptured: $i,
serverPrefetch: $i,
components: bd,
directives: bd,
watch: N8,
provide: L2,
inject: I8,
}
function L2(n, e) {
return e
? n
? function () {
return ti(Ct(n) ? n.call(this, this) : n, Ct(e) ? e.call(this, this) : e)
}
: e
: n
}
function I8(n, e) {
return bd(Q1(n), Q1(e))
}
function Q1(n) {
if (yt(n)) {
const e = {}
for (let t = 0; t < n.length; t++) e[n[t]] = n[t]
return e
}
return n
}
function $i(n, e) {
return n ? [...new Set([].concat(n, e))] : e
}
function bd(n, e) {
return n ? ti(Object.create(null), n, e) : e
}
function D2(n, e) {
return n
? yt(n) && yt(e)
? [...new Set([...n, ...e])]
: ti(Object.create(null), N2(n), N2(e != null ? e : {}))
: e
}
function N8(n, e) {
if (!n) return e
if (!e) return n
const t = ti(Object.create(null), n)
for (const i in e) t[i] = $i(n[i], e[i])
return t
}
function Mw() {
return {
app: null,
config: {
isNativeTag: gI,
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(),
}
}
let P8 = 0
function L8(n, e) {
return function (i, r = null) {
;(Ct(i) || (i = ti({}, i)), r != null && !gn(r) && (r = null))
const s = Mw(),
o = new WeakSet(),
a = []
let l = !1
const c = (s.app = {
_uid: P8++,
_component: i,
_props: r,
_container: null,
_context: s,
_instance: null,
version: p9,
get config() {
return s.config
},
set config(u) {},
use(u, ...d) {
return (
o.has(u) ||
(u && Ct(u.install) ? (o.add(u), u.install(c, ...d)) : Ct(u) && (o.add(u), u(c, ...d))),
c
)
},
mixin(u) {
return (s.mixins.includes(u) || s.mixins.push(u), c)
},
component(u, d) {
return d ? ((s.components[u] = d), c) : s.components[u]
},
directive(u, d) {
return d ? ((s.directives[u] = d), c) : s.directives[u]
},
mount(u, d, h) {
if (!l) {
const f = c._ceVNode || Ae(i, r)
return (
(f.appContext = s),
h === !0 ? (h = 'svg') : h === !1 && (h = void 0),
n(f, u, h),
(l = !0),
(c._container = u),
(u.__vue_app__ = c),
t0(f.component)
)
}
},
onUnmount(u) {
a.push(u)
},
unmount() {
l && (As(a, c._instance, 16), n(null, c._container), delete c._container.__vue_app__)
},
provide(u, d) {
return ((s.provides[u] = d), c)
},
runWithContext(u) {
const d = Rl
Rl = c
try {
return u()
} finally {
Rl = d
}
},
})
return c
}
}
let Rl = null
function ia(n, e) {
if (ui) {
let t = ui.provides
const i = ui.parent && ui.parent.provides
;(i === t && (t = ui.provides = Object.create(i)), (t[n] = e))
}
}
function Ji(n, e, t = !1) {
const i = ui || Zi
if (i || Rl) {
let r = Rl
? Rl._context.provides
: i
? i.parent == null || i.ce
? i.vnode.appContext && i.vnode.appContext.provides
: i.parent.provides
: void 0
if (r && n in r) return r[n]
if (arguments.length > 1) return t && Ct(e) ? e.call(i && i.proxy) : e
}
}
function D8() {
return !!(ui || Zi || Rl)
}
const Rw = {},
Iw = () => Object.create(Rw),
Nw = (n) => Object.getPrototypeOf(n) === Rw
function F8(n, e, t, i = !1) {
const r = {},
s = Iw()
;((n.propsDefaults = Object.create(null)), Pw(n, e, r, s))
for (const o in n.propsOptions[0]) o in r || (r[o] = void 0)
;(t ? (n.props = i ? r : XI(r)) : n.type.props ? (n.props = r) : (n.props = s), (n.attrs = s))
}
function O8(n, e, t, i) {
const {
props: r,
attrs: s,
vnode: { patchFlag: o },
} = n,
a = Ot(r),
[l] = n.propsOptions
let c = !1
if ((i || o > 0) && !(o & 16)) {
if (o & 8) {
const u = n.vnode.dynamicProps
for (let d = 0; d < u.length; d++) {
let h = u[d]
if (e0(n.emitsOptions, h)) continue
const f = e[h]
if (l)
if (en(s, h)) f !== s[h] && ((s[h] = f), (c = !0))
else {
const p = ns(h)
r[p] = j1(l, a, p, f, n, !1)
}
else f !== s[h] && ((s[h] = f), (c = !0))
}
}
} else {
Pw(n, e, r, s) && (c = !0)
let u
for (const d in a)
(!e || (!en(e, d) && ((u = Wl(d)) === d || !en(e, u)))) &&
(l
? t && (t[d] !== void 0 || t[u] !== void 0) && (r[d] = j1(l, a, d, void 0, n, !0))
: delete r[d])
if (s !== a) for (const d in s) (!e || !en(e, d)) && (delete s[d], (c = !0))
}
c && Po(n.attrs, 'set', '')
}
function Pw(n, e, t, i) {
const [r, s] = n.propsOptions
let o = !1,
a
if (e)
for (let l in e) {
if (Md(l)) continue
const c = e[l]
let u
r && en(r, (u = ns(l)))
? !s || !s.includes(u)
? (t[u] = c)
: ((a || (a = {}))[u] = c)
: e0(n.emitsOptions, l) || ((!(l in i) || c !== i[l]) && ((i[l] = c), (o = !0)))
}
if (s) {
const l = Ot(t),
c = a || un
for (let u = 0; u < s.length; u++) {
const d = s[u]
t[d] = j1(r, l, d, c[d], n, !en(c, d))
}
}
return o
}
function j1(n, e, t, i, r, s) {
const o = n[t]
if (o != null) {
const a = en(o, 'default')
if (a && i === void 0) {
const l = o.default
if (o.type !== Function && !o.skipFactory && Ct(l)) {
const { propsDefaults: c } = r
if (t in c) i = c[t]
else {
const u = Oh(r)
;((i = c[t] = l.call(null, e)), u())
}
} else i = l
r.ce && r.ce._setProp(t, i)
}
o[0] && (s && !a ? (i = !1) : o[1] && (i === '' || i === Wl(t)) && (i = !0))
}
return i
}
const B8 = new WeakMap()
function Lw(n, e, t = !1) {
const i = t ? B8 : e.propsCache,
r = i.get(n)
if (r) return r
const s = n.props,
o = {},
a = []
let l = !1
if (!Ct(n)) {
const u = (d) => {
l = !0
const [h, f] = Lw(d, e, !0)
;(ti(o, h), f && a.push(...f))
}
;(!t && e.mixins.length && e.mixins.forEach(u),
n.extends && u(n.extends),
n.mixins && n.mixins.forEach(u))
}
if (!s && !l) return (gn(n) && i.set(n, Vc), Vc)
if (yt(s))
for (let u = 0; u < s.length; u++) {
const d = ns(s[u])
F2(d) && (o[d] = un)
}
else if (s)
for (const u in s) {
const d = ns(u)
if (F2(d)) {
const h = s[u],
f = (o[d] = yt(h) || Ct(h) ? { type: h } : ti({}, h)),
p = f.type
let g = !1,
y = !0
if (yt(p))
for (let m = 0; m < p.length; ++m) {
const v = p[m],
x = Ct(v) && v.name
if (x === 'Boolean') {
g = !0
break
} else x === 'String' && (y = !1)
}
else g = Ct(p) && p.name === 'Boolean'
;((f[0] = g), (f[1] = y), (g || en(f, 'default')) && a.push(d))
}
}
const c = [o, a]
return (gn(n) && i.set(n, c), c)
}
function F2(n) {
return n[0] !== '$' && !Md(n)
}
const r_ = (n) => n[0] === '_' || n === '$stable',
s_ = (n) => (yt(n) ? n.map(Us) : [Us(n)]),
U8 = (n, e, t) => {
if (e._n) return e
const i = fw((...r) => s_(e(...r)), t)
return ((i._c = !1), i)
},
Dw = (n, e, t) => {
const i = n._ctx
for (const r in n) {
if (r_(r)) continue
const s = n[r]
if (Ct(s)) e[r] = U8(r, s, i)
else if (s != null) {
const o = s_(s)
e[r] = () => o
}
}
},
Fw = (n, e) => {
const t = s_(e)
n.slots.default = () => t
},
Ow = (n, e, t) => {
for (const i in e) (t || !r_(i)) && (n[i] = e[i])
},
k8 = (n, e, t) => {
const i = (n.slots = Iw())
if (n.vnode.shapeFlag & 32) {
const r = e.__
r && U1(i, '__', r, !0)
const s = e._
s ? (Ow(i, e, t), t && U1(i, '_', s, !0)) : Dw(e, i)
} else e && Fw(n, e)
},
z8 = (n, e, t) => {
const { vnode: i, slots: r } = n
let s = !0,
o = un
if (i.shapeFlag & 32) {
const a = e._
;(a ? (t && a === 1 ? (s = !1) : Ow(r, e, t)) : ((s = !e.$stable), Dw(e, r)), (o = e))
} else e && (Fw(n, e), (o = { default: 1 }))
if (s) for (const a in r) !r_(a) && o[a] == null && delete r[a]
},
ji = e9
function V8(n) {
return H8(n)
}
function H8(n, e) {
const t = qm()
t.__VUE__ = !0
const {
insert: i,
remove: r,
patchProp: s,
createElement: o,
createText: a,
createComment: l,
setText: c,
setElementText: u,
parentNode: d,
nextSibling: h,
setScopeId: f = Qs,
insertStaticContent: p,
} = n,
g = (
te,
ne,
b,
oe = null,
J = null,
H = null,
P = void 0,
k = null,
j = !!ne.dynamicChildren
) => {
if (te === ne) return
;(te && !wc(te, ne) && ((oe = Ee(te)), re(te, J, H, !0), (te = null)),
ne.patchFlag === -2 && ((j = !1), (ne.dynamicChildren = null)))
const { type: B, ref: D, shapeFlag: W } = ne
switch (B) {
case Nu:
y(te, ne, b, oe)
break
case Js:
m(te, ne, b, oe)
break
case xp:
te == null && v(ne, b, oe, P)
break
case Hn:
L(te, ne, b, oe, J, H, P, k, j)
break
default:
W & 1
? S(te, ne, b, oe, J, H, P, k, j)
: W & 6
? U(te, ne, b, oe, J, H, P, k, j)
: (W & 64 || W & 128) && B.process(te, ne, b, oe, J, H, P, k, j, Be)
}
D != null && J
? Pd(D, te && te.ref, H, ne || te, !ne)
: D == null && te && te.ref != null && Pd(te.ref, null, H, te, !0)
},
y = (te, ne, b, oe) => {
if (te == null) i((ne.el = a(ne.children)), b, oe)
else {
const J = (ne.el = te.el)
ne.children !== te.children && c(J, ne.children)
}
},
m = (te, ne, b, oe) => {
te == null ? i((ne.el = l(ne.children || '')), b, oe) : (ne.el = te.el)
},
v = (te, ne, b, oe) => {
;[te.el, te.anchor] = p(te.children, ne, b, oe, te.el, te.anchor)
},
x = ({ el: te, anchor: ne }, b, oe) => {
let J
for (; te && te !== ne; ) ((J = h(te)), i(te, b, oe), (te = J))
i(ne, b, oe)
},
_ = ({ el: te, anchor: ne }) => {
let b
for (; te && te !== ne; ) ((b = h(te)), r(te), (te = b))
r(ne)
},
S = (te, ne, b, oe, J, H, P, k, j) => {
;(ne.type === 'svg' ? (P = 'svg') : ne.type === 'math' && (P = 'mathml'),
te == null ? C(ne, b, oe, J, H, P, k, j) : w(te, ne, J, H, P, k, j))
},
C = (te, ne, b, oe, J, H, P, k) => {
let j, B
const { props: D, shapeFlag: W, transition: G, dirs: X } = te
if (
((j = te.el = o(te.type, H, D && D.is, D)),
W & 8 ? u(j, te.children) : W & 16 && R(te.children, j, null, oe, J, Z0(te, H), P, k),
X && Ya(te, null, oe, 'created'),
A(j, te, te.scopeId, P, oe),
D)
) {
for (const z in D) z !== 'value' && !Md(z) && s(j, z, null, D[z], H, oe)
;('value' in D && s(j, 'value', null, D.value, H),
(B = D.onVnodeBeforeMount) && Ms(B, oe, te))
}
X && Ya(te, null, oe, 'beforeMount')
const ue = $8(J, G)
;(ue && G.beforeEnter(j),
i(j, ne, b),
((B = D && D.onVnodeMounted) || ue || X) &&
ji(() => {
;(B && Ms(B, oe, te), ue && G.enter(j), X && Ya(te, null, oe, 'mounted'))
}, J))
},
A = (te, ne, b, oe, J) => {
if ((b && f(te, b), oe)) for (let H = 0; H < oe.length; H++) f(te, oe[H])
if (J) {
let H = J.subTree
if (ne === H || (zw(H.type) && (H.ssContent === ne || H.ssFallback === ne))) {
const P = J.vnode
A(te, P, P.scopeId, P.slotScopeIds, J.parent)
}
}
},
R = (te, ne, b, oe, J, H, P, k, j = 0) => {
for (let B = j; B < te.length; B++) {
const D = (te[B] = k ? _a(te[B]) : Us(te[B]))
g(null, D, ne, b, oe, J, H, P, k)
}
},
w = (te, ne, b, oe, J, H, P) => {
const k = (ne.el = te.el)
let { patchFlag: j, dynamicChildren: B, dirs: D } = ne
j |= te.patchFlag & 16
const W = te.props || un,
G = ne.props || un
let X
if (
(b && Za(b, !1),
(X = G.onVnodeBeforeUpdate) && Ms(X, b, ne, te),
D && Ya(ne, te, b, 'beforeUpdate'),
b && Za(b, !0),
((W.innerHTML && G.innerHTML == null) || (W.textContent && G.textContent == null)) &&
u(k, ''),
B
? M(te.dynamicChildren, B, k, b, oe, Z0(ne, J), H)
: P || ee(te, ne, k, null, b, oe, Z0(ne, J), H, !1),
j > 0)
) {
if (j & 16) I(k, W, G, b, J)
else if (
(j & 2 && W.class !== G.class && s(k, 'class', null, G.class, J),
j & 4 && s(k, 'style', W.style, G.style, J),
j & 8)
) {
const ue = ne.dynamicProps
for (let z = 0; z < ue.length; z++) {
const E = ue[z],
N = W[E],
q = G[E]
;(q !== N || E === 'value') && s(k, E, N, q, J, b)
}
}
j & 1 && te.children !== ne.children && u(k, ne.children)
} else !P && B == null && I(k, W, G, b, J)
;((X = G.onVnodeUpdated) || D) &&
ji(() => {
;(X && Ms(X, b, ne, te), D && Ya(ne, te, b, 'updated'))
}, oe)
},
M = (te, ne, b, oe, J, H, P) => {
for (let k = 0; k < ne.length; k++) {
const j = te[k],
B = ne[k],
D = j.el && (j.type === Hn || !wc(j, B) || j.shapeFlag & 198) ? d(j.el) : b
g(j, B, D, null, oe, J, H, P, !0)
}
},
I = (te, ne, b, oe, J) => {
if (ne !== b) {
if (ne !== un) for (const H in ne) !Md(H) && !(H in b) && s(te, H, ne[H], null, J, oe)
for (const H in b) {
if (Md(H)) continue
const P = b[H],
k = ne[H]
P !== k && H !== 'value' && s(te, H, k, P, J, oe)
}
'value' in b && s(te, 'value', ne.value, b.value, J)
}
},
L = (te, ne, b, oe, J, H, P, k, j) => {
const B = (ne.el = te ? te.el : a('')),
D = (ne.anchor = te ? te.anchor : a(''))
let { patchFlag: W, dynamicChildren: G, slotScopeIds: X } = ne
;(X && (k = k ? k.concat(X) : X),
te == null
? (i(B, b, oe), i(D, b, oe), R(ne.children || [], b, D, J, H, P, k, j))
: W > 0 && W & 64 && G && te.dynamicChildren
? (M(te.dynamicChildren, G, b, J, H, P, k),
(ne.key != null || (J && ne === J.subTree)) && o_(te, ne, !0))
: ee(te, ne, b, D, J, H, P, k, j))
},
U = (te, ne, b, oe, J, H, P, k, j) => {
;((ne.slotScopeIds = k),
te == null
? ne.shapeFlag & 512
? J.ctx.activate(ne, b, oe, P, j)
: T(ne, b, oe, J, H, P, j)
: F(te, ne, j))
},
T = (te, ne, b, oe, J, H, P) => {
const k = (te.component = a9(te, oe, J))
if ((xw(te) && (k.ctx.renderer = Be), l9(k, !1, P), k.asyncDep)) {
if ((J && J.registerDep(k, V, P), !te.el)) {
const j = (k.subTree = Ae(Js))
m(null, j, ne, b)
}
} else V(k, te, ne, b, J, H, P)
},
F = (te, ne, b) => {
const oe = (ne.component = te.component)
if (Z8(te, ne, b))
if (oe.asyncDep && !oe.asyncResolved) {
Q(oe, ne, b)
return
} else ((oe.next = ne), oe.update())
else ((ne.el = te.el), (oe.vnode = ne))
},
V = (te, ne, b, oe, J, H, P) => {
const k = () => {
if (te.isMounted) {
let { next: W, bu: G, u: X, parent: ue, vnode: z } = te
{
const $ = Bw(te)
if ($) {
;(W && ((W.el = z.el), Q(te, W, P)),
$.asyncDep.then(() => {
te.isUnmounted || k()
}))
return
}
}
let E = W,
N
;(Za(te, !1),
W ? ((W.el = z.el), Q(te, W, P)) : (W = z),
G && Q0(G),
(N = W.props && W.props.onVnodeBeforeUpdate) && Ms(N, ue, W, z),
Za(te, !0))
const q = B2(te),
Z = te.subTree
;((te.subTree = q),
g(Z, q, d(Z.el), Ee(Z), te, J, H),
(W.el = q.el),
E === null && J8(te, q.el),
X && ji(X, J),
(N = W.props && W.props.onVnodeUpdated) && ji(() => Ms(N, ue, W, z), J))
} else {
let W
const { el: G, props: X } = ne,
{ bm: ue, m: z, parent: E, root: N, type: q } = te,
Z = Ld(ne)
;(Za(te, !1),
ue && Q0(ue),
!Z && (W = X && X.onVnodeBeforeMount) && Ms(W, E, ne),
Za(te, !0))
{
N.ce && N.ce._def.shadowRoot !== !1 && N.ce._injectChildStyle(q)
const $ = (te.subTree = B2(te))
;(g(null, $, b, oe, te, J, H), (ne.el = $.el))
}
if ((z && ji(z, J), !Z && (W = X && X.onVnodeMounted))) {
const $ = ne
ji(() => Ms(W, E, $), J)
}
;((ne.shapeFlag & 256 || (E && Ld(E.vnode) && E.vnode.shapeFlag & 256)) &&
te.a &&
ji(te.a, J),
(te.isMounted = !0),
(ne = b = oe = null))
}
}
te.scope.on()
const j = (te.effect = new GT(k))
te.scope.off()
const B = (te.update = j.run.bind(j)),
D = (te.job = j.runIfDirty.bind(j))
;((D.i = te), (D.id = te.uid), (j.scheduler = () => n_(D)), Za(te, !0), B())
},
Q = (te, ne, b) => {
ne.component = te
const oe = te.vnode.props
;((te.vnode = ne),
(te.next = null),
O8(te, ne.props, oe, b),
z8(te, ne.children, b),
Go(),
C2(te),
Wo())
},
ee = (te, ne, b, oe, J, H, P, k, j = !1) => {
const B = te && te.children,
D = te ? te.shapeFlag : 0,
W = ne.children,
{ patchFlag: G, shapeFlag: X } = ne
if (G > 0) {
if (G & 128) {
he(B, W, b, oe, J, H, P, k, j)
return
} else if (G & 256) {
se(B, W, b, oe, J, H, P, k, j)
return
}
}
X & 8
? (D & 16 && we(B, J, H), W !== B && u(b, W))
: D & 16
? X & 16
? he(B, W, b, oe, J, H, P, k, j)
: we(B, J, H, !0)
: (D & 8 && u(b, ''), X & 16 && R(W, b, oe, J, H, P, k, j))
},
se = (te, ne, b, oe, J, H, P, k, j) => {
;((te = te || Vc), (ne = ne || Vc))
const B = te.length,
D = ne.length,
W = Math.min(B, D)
let G
for (G = 0; G < W; G++) {
const X = (ne[G] = j ? _a(ne[G]) : Us(ne[G]))
g(te[G], X, b, null, J, H, P, k, j)
}
B > D ? we(te, J, H, !0, !1, W) : R(ne, b, oe, J, H, P, k, j, W)
},
he = (te, ne, b, oe, J, H, P, k, j) => {
let B = 0
const D = ne.length
let W = te.length - 1,
G = D - 1
for (; B <= W && B <= G; ) {
const X = te[B],
ue = (ne[B] = j ? _a(ne[B]) : Us(ne[B]))
if (wc(X, ue)) g(X, ue, b, null, J, H, P, k, j)
else break
B++
}
for (; B <= W && B <= G; ) {
const X = te[W],
ue = (ne[G] = j ? _a(ne[G]) : Us(ne[G]))
if (wc(X, ue)) g(X, ue, b, null, J, H, P, k, j)
else break
;(W--, G--)
}
if (B > W) {
if (B <= G) {
const X = G + 1,
ue = X < D ? ne[X].el : oe
for (; B <= G; ) (g(null, (ne[B] = j ? _a(ne[B]) : Us(ne[B])), b, ue, J, H, P, k, j), B++)
}
} else if (B > G) for (; B <= W; ) (re(te[B], J, H, !0), B++)
else {
const X = B,
ue = B,
z = new Map()
for (B = ue; B <= G; B++) {
const Le = (ne[B] = j ? _a(ne[B]) : Us(ne[B]))
Le.key != null && z.set(Le.key, B)
}
let E,
N = 0
const q = G - ue + 1
let Z = !1,
$ = 0
const ae = new Array(q)
for (B = 0; B < q; B++) ae[B] = 0
for (B = X; B <= W; B++) {
const Le = te[B]
if (N >= q) {
re(Le, J, H, !0)
continue
}
let Ve
if (Le.key != null) Ve = z.get(Le.key)
else
for (E = ue; E <= G; E++)
if (ae[E - ue] === 0 && wc(Le, ne[E])) {
Ve = E
break
}
Ve === void 0
? re(Le, J, H, !0)
: ((ae[Ve - ue] = B + 1),
Ve >= $ ? ($ = Ve) : (Z = !0),
g(Le, ne[Ve], b, null, J, H, P, k, j),
N++)
}
const Ue = Z ? G8(ae) : Vc
for (E = Ue.length - 1, B = q - 1; B >= 0; B--) {
const Le = ue + B,
Ve = ne[Le],
Je = Le + 1 < D ? ne[Le + 1].el : oe
ae[B] === 0
? g(null, Ve, b, Je, J, H, P, k, j)
: Z && (E < 0 || B !== Ue[E] ? ie(Ve, b, Je, 2) : E--)
}
}
},
ie = (te, ne, b, oe, J = null) => {
const { el: H, type: P, transition: k, children: j, shapeFlag: B } = te
if (B & 6) {
ie(te.component.subTree, ne, b, oe)
return
}
if (B & 128) {
te.suspense.move(ne, b, oe)
return
}
if (B & 64) {
P.move(te, ne, b, Be)
return
}
if (P === Hn) {
i(H, ne, b)
for (let W = 0; W < j.length; W++) ie(j[W], ne, b, oe)
i(te.anchor, ne, b)
return
}
if (P === xp) {
x(te, ne, b)
return
}
if (oe !== 2 && B & 1 && k)
if (oe === 0) (k.beforeEnter(H), i(H, ne, b), ji(() => k.enter(H), J))
else {
const { leave: W, delayLeave: G, afterLeave: X } = k,
ue = () => {
te.ctx.isUnmounted ? r(H) : i(H, ne, b)
},
z = () => {
W(H, () => {
;(ue(), X && X())
})
}
G ? G(H, ue, z) : z()
}
else i(H, ne, b)
},
re = (te, ne, b, oe = !1, J = !1) => {
const {
type: H,
props: P,
ref: k,
children: j,
dynamicChildren: B,
shapeFlag: D,
patchFlag: W,
dirs: G,
cacheIndex: X,
} = te
if (
(W === -2 && (J = !1),
k != null && (Go(), Pd(k, null, b, te, !0), Wo()),
X != null && (ne.renderCache[X] = void 0),
D & 256)
) {
ne.ctx.deactivate(te)
return
}
const ue = D & 1 && G,
z = !Ld(te)
let E
if ((z && (E = P && P.onVnodeBeforeUnmount) && Ms(E, ne, te), D & 6)) fe(te.component, b, oe)
else {
if (D & 128) {
te.suspense.unmount(b, oe)
return
}
;(ue && Ya(te, null, ne, 'beforeUnmount'),
D & 64
? te.type.remove(te, ne, b, Be, oe)
: B && !B.hasOnce && (H !== Hn || (W > 0 && W & 64))
? we(B, ne, b, !1, !0)
: ((H === Hn && W & 384) || (!J && D & 16)) && we(j, ne, b),
oe && Te(te))
}
;((z && (E = P && P.onVnodeUnmounted)) || ue) &&
ji(() => {
;(E && Ms(E, ne, te), ue && Ya(te, null, ne, 'unmounted'))
}, b)
},
Te = (te) => {
const { type: ne, el: b, anchor: oe, transition: J } = te
if (ne === Hn) {
le(b, oe)
return
}
if (ne === xp) {
_(te)
return
}
const H = () => {
;(r(b), J && !J.persisted && J.afterLeave && J.afterLeave())
}
if (te.shapeFlag & 1 && J && !J.persisted) {
const { leave: P, delayLeave: k } = J,
j = () => P(b, H)
k ? k(te.el, H, j) : j()
} else H()
},
le = (te, ne) => {
let b
for (; te !== ne; ) ((b = h(te)), r(te), (te = b))
r(ne)
},
fe = (te, ne, b) => {
const {
bum: oe,
scope: J,
job: H,
subTree: P,
um: k,
m: j,
a: B,
parent: D,
slots: { __: W },
} = te
;(O2(j),
O2(B),
oe && Q0(oe),
D &&
yt(W) &&
W.forEach((G) => {
D.renderCache[G] = void 0
}),
J.stop(),
H && ((H.flags |= 8), re(P, te, ne, b)),
k && ji(k, ne),
ji(() => {
te.isUnmounted = !0
}, ne),
ne &&
ne.pendingBranch &&
!ne.isUnmounted &&
te.asyncDep &&
!te.asyncResolved &&
te.suspenseId === ne.pendingId &&
(ne.deps--, ne.deps === 0 && ne.resolve()))
},
we = (te, ne, b, oe = !1, J = !1, H = 0) => {
for (let P = H; P < te.length; P++) re(te[P], ne, b, oe, J)
},
Ee = (te) => {
if (te.shapeFlag & 6) return Ee(te.component.subTree)
if (te.shapeFlag & 128) return te.suspense.next()
const ne = h(te.anchor || te.el),
b = ne && ne[pw]
return b ? h(b) : ne
}
let Ie = !1
const ze = (te, ne, b) => {
;(te == null
? ne._vnode && re(ne._vnode, null, null, !0)
: g(ne._vnode || null, te, ne, null, null, null, b),
(ne._vnode = te),
Ie || ((Ie = !0), C2(), uw(), (Ie = !1)))
},
Be = { p: g, um: re, m: ie, r: Te, mt: T, mc: R, pc: ee, pbc: M, n: Ee, o: n }
return { render: ze, hydrate: void 0, createApp: L8(ze) }
}
function Z0({ type: n, props: e }, t) {
return (t === 'svg' && n === 'foreignObject') ||
(t === 'mathml' && n === 'annotation-xml' && e && e.encoding && e.encoding.includes('html'))
? void 0
: t
}
function Za({ effect: n, job: e }, t) {
t ? ((n.flags |= 32), (e.flags |= 4)) : ((n.flags &= -33), (e.flags &= -5))
}
function $8(n, e) {
return (!n || (n && !n.pendingBranch)) && e && !e.persisted
}
function o_(n, e, t = !1) {
const i = n.children,
r = e.children
if (yt(i) && yt(r))
for (let s = 0; s < i.length; s++) {
const o = i[s]
let a = r[s]
;(a.shapeFlag & 1 &&
!a.dynamicChildren &&
((a.patchFlag <= 0 || a.patchFlag === 32) && ((a = r[s] = _a(r[s])), (a.el = o.el)),
!t && a.patchFlag !== -2 && o_(o, a)),
a.type === Nu && (a.el = o.el),
a.type === Js && !a.el && (a.el = o.el))
}
}
function G8(n) {
const e = n.slice(),
t = [0]
let i, r, s, o, a
const l = n.length
for (i = 0; i < l; i++) {
const c = n[i]
if (c !== 0) {
if (((r = t[t.length - 1]), n[r] < c)) {
;((e[i] = r), t.push(i))
continue
}
for (s = 0, o = t.length - 1; s < o; )
((a = (s + o) >> 1), n[t[a]] < c ? (s = a + 1) : (o = a))
c < n[t[s]] && (s > 0 && (e[i] = t[s - 1]), (t[s] = i))
}
}
for (s = t.length, o = t[s - 1]; s-- > 0; ) ((t[s] = o), (o = e[o]))
return t
}
function Bw(n) {
const e = n.subTree.component
if (e) return e.asyncDep && !e.asyncResolved ? e : Bw(e)
}
function O2(n) {
if (n) for (let e = 0; e < n.length; e++) n[e].flags |= 8
}
const W8 = Symbol.for('v-scx'),
Q8 = () => Ji(W8)
function Jm(n, e) {
return a_(n, null, e)
}
function Jn(n, e, t) {
return a_(n, e, t)
}
function a_(n, e, t = un) {
const { immediate: i, deep: r, flush: s, once: o } = t,
a = ti({}, t),
l = (e && i) || (!e && s !== 'post')
let c
if (ih) {
if (s === 'sync') {
const f = Q8()
c = f.__watcherHandles || (f.__watcherHandles = [])
} else if (!l) {
const f = () => {}
return ((f.stop = Qs), (f.resume = Qs), (f.pause = Qs), f)
}
}
const u = ui
a.call = (f, p, g) => As(f, u, p, g)
let d = !1
;(s === 'post'
? (a.scheduler = (f) => {
ji(f, u && u.suspense)
})
: s !== 'sync' &&
((d = !0),
(a.scheduler = (f, p) => {
p ? f() : n_(f)
})),
(a.augmentJob = (f) => {
;(e && (f.flags |= 4), d && ((f.flags |= 2), u && ((f.id = u.uid), (f.i = u))))
}))
const h = o8(n, e, a)
return (ih && (c ? c.push(h) : l && h()), h)
}
function j8(n, e, t) {
const i = this.proxy,
r = wn(n) ? (n.includes('.') ? Uw(i, n) : () => i[n]) : n.bind(i, i)
let s
Ct(e) ? (s = e) : ((s = e.handler), (t = e))
const o = Oh(this),
a = a_(r, s.bind(i), t)
return (o(), a)
}
function Uw(n, e) {
const t = e.split('.')
return () => {
let i = n
for (let r = 0; r < t.length && i; r++) i = i[t[r]]
return i
}
}
const q8 = (n, e) =>
e === 'modelValue' || e === 'model-value'
? n.modelModifiers
: n[''.concat(e, 'Modifiers')] ||
n[''.concat(ns(e), 'Modifiers')] ||
n[''.concat(Wl(e), 'Modifiers')]
function X8(n, e, ...t) {
if (n.isUnmounted) return
const i = n.vnode.props || un
let r = t
const s = e.startsWith('update:'),
o = s && q8(i, e.slice(7))
o && (o.trim && (r = t.map((u) => (wn(u) ? u.trim() : u))), o.number && (r = t.map(SI)))
let a,
l = i[(a = W0(e))] || i[(a = W0(ns(e)))]
;(!l && s && (l = i[(a = W0(Wl(e)))]), l && As(l, n, 6, r))
const c = i[a + 'Once']
if (c) {
if (!n.emitted) n.emitted = {}
else if (n.emitted[a]) return
;((n.emitted[a] = !0), As(c, n, 6, r))
}
}
function kw(n, e, t = !1) {
const i = e.emitsCache,
r = i.get(n)
if (r !== void 0) return r
const s = n.emits
let o = {},
a = !1
if (!Ct(n)) {
const l = (c) => {
const u = kw(c, e, !0)
u && ((a = !0), ti(o, u))
}
;(!t && e.mixins.length && e.mixins.forEach(l),
n.extends && l(n.extends),
n.mixins && n.mixins.forEach(l))
}
return !s && !a
? (gn(n) && i.set(n, null), null)
: (yt(s) ? s.forEach((l) => (o[l] = null)) : ti(o, s), gn(n) && i.set(n, o), o)
}
function e0(n, e) {
return !n || !Gm(e)
? !1
: ((e = e.slice(2).replace(/Once$/, '')),
en(n, e[0].toLowerCase() + e.slice(1)) || en(n, Wl(e)) || en(n, e))
}
function B2(n) {
const {
type: e,
vnode: t,
proxy: i,
withProxy: r,
propsOptions: [s],
slots: o,
attrs: a,
emit: l,
render: c,
renderCache: u,
props: d,
data: h,
setupState: f,
ctx: p,
inheritAttrs: g,
} = n,
y = tm(n)
let m, v
try {
if (t.shapeFlag & 4) {
const _ = r || i,
S = _
;((m = Us(c.call(S, _, u, d, f, h, p))), (v = a))
} else {
const _ = e
;((m = Us(_.length > 1 ? _(d, { attrs: a, slots: o, emit: l }) : _(d, null))),
(v = e.props ? a : K8(a)))
}
} catch (_) {
;((Fd.length = 0), Km(_, n, 1), (m = Ae(Js)))
}
let x = m
if (v && g !== !1) {
const _ = Object.keys(v),
{ shapeFlag: S } = x
_.length && S & 7 && (s && _.some(Gv) && (v = Y8(v, s)), (x = Qo(x, v, !1, !0)))
}
return (
t.dirs && ((x = Qo(x, null, !1, !0)), (x.dirs = x.dirs ? x.dirs.concat(t.dirs) : t.dirs)),
t.transition && eh(x, t.transition),
(m = x),
tm(y),
m
)
}
const K8 = (n) => {
let e
for (const t in n) (t === 'class' || t === 'style' || Gm(t)) && ((e || (e = {}))[t] = n[t])
return e
},
Y8 = (n, e) => {
const t = {}
for (const i in n) (!Gv(i) || !(i.slice(9) in e)) && (t[i] = n[i])
return t
}
function Z8(n, e, t) {
const { props: i, children: r, component: s } = n,
{ props: o, children: a, patchFlag: l } = e,
c = s.emitsOptions
if (e.dirs || e.transition) return !0
if (t && l >= 0) {
if (l & 1024) return !0
if (l & 16) return i ? U2(i, o, c) : !!o
if (l & 8) {
const u = e.dynamicProps
for (let d = 0; d < u.length; d++) {
const h = u[d]
if (o[h] !== i[h] && !e0(c, h)) return !0
}
}
} else
return (r || a) && (!a || !a.$stable) ? !0 : i === o ? !1 : i ? (o ? U2(i, o, c) : !0) : !!o
return !1
}
function U2(n, e, t) {
const i = Object.keys(e)
if (i.length !== Object.keys(n).length) return !0
for (let r = 0; r < i.length; r++) {
const s = i[r]
if (e[s] !== n[s] && !e0(t, s)) return !0
}
return !1
}
function J8({ vnode: n, parent: e }, t) {
for (; e; ) {
const i = e.subTree
if ((i.suspense && i.suspense.activeBranch === n && (i.el = n.el), i === n))
(((n = e.vnode).el = t), (e = e.parent))
else break
}
}
const zw = (n) => n.__isSuspense
function e9(n, e) {
e && e.pendingBranch ? (yt(n) ? e.effects.push(...n) : e.effects.push(n)) : c8(n)
}
const Hn = Symbol.for('v-fgt'),
Nu = Symbol.for('v-txt'),
Js = Symbol.for('v-cmt'),
xp = Symbol.for('v-stc'),
Fd = []
let Rr = null
function ft(n = !1) {
Fd.push((Rr = n ? null : []))
}
function t9() {
;(Fd.pop(), (Rr = Fd[Fd.length - 1] || null))
}
let nh = 1
function k2(n, e = !1) {
;((nh += n), n < 0 && Rr && e && (Rr.hasOnce = !0))
}
function Vw(n) {
return ((n.dynamicChildren = nh > 0 ? Rr || Vc : null), t9(), nh > 0 && Rr && Rr.push(n), n)
}
function xt(n, e, t, i, r, s) {
return Vw(zt(n, e, t, i, r, s, !0))
}
function ou(n, e, t, i, r) {
return Vw(Ae(n, e, t, i, r, !0))
}
function au(n) {
return n ? n.__v_isVNode === !0 : !1
}
function wc(n, e) {
return n.type === e.type && n.key === e.key
}
const Hw = ({ key: n }) => (n != null ? n : null),
Sp = ({ ref: n, ref_key: e, ref_for: t }) => (
typeof n == 'number' && (n = '' + n),
n != null ? (wn(n) || bn(n) || Ct(n) ? { i: Zi, r: n, k: e, f: !!t } : n) : null
)
function zt(n, e = null, t = null, i = 0, r = null, s = n === Hn ? 0 : 1, o = !1, a = !1) {
const l = {
__v_isVNode: !0,
__v_skip: !0,
type: n,
props: e,
key: e && Hw(e),
ref: e && Sp(e),
scopeId: hw,
slotScopeIds: null,
children: t,
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: s,
patchFlag: i,
dynamicProps: r,
dynamicChildren: null,
appContext: null,
ctx: Zi,
}
return (
a ? (l_(l, t), s & 128 && n.normalize(l)) : t && (l.shapeFlag |= wn(t) ? 8 : 16),
nh > 0 && !o && Rr && (l.patchFlag > 0 || s & 6) && l.patchFlag !== 32 && Rr.push(l),
l
)
}
const Ae = n9
function n9(n, e = null, t = null, i = 0, r = null, s = !1) {
if (((!n || n === Tw) && (n = Js), au(n))) {
const a = Qo(n, e, !0)
return (
t && l_(a, t),
nh > 0 && !s && Rr && (a.shapeFlag & 6 ? (Rr[Rr.indexOf(n)] = a) : Rr.push(a)),
(a.patchFlag = -2),
a
)
}
if ((f9(n) && (n = n.__vccOpts), e)) {
e = i9(e)
let { class: a, style: l } = e
;(a && !wn(a) && (e.class = Ys(a)),
gn(l) && (e_(l) && !yt(l) && (l = ti({}, l)), (e.style = js(l))))
}
const o = wn(n) ? 1 : zw(n) ? 128 : u8(n) ? 64 : gn(n) ? 4 : Ct(n) ? 2 : 0
return zt(n, e, t, i, r, o, s, !0)
}
function i9(n) {
return n ? (e_(n) || Nw(n) ? ti({}, n) : n) : null
}
function Qo(n, e, t = !1, i = !1) {
const { props: r, ref: s, patchFlag: o, children: a, transition: l } = n,
c = e ? r9(r || {}, e) : r,
u = {
__v_isVNode: !0,
__v_skip: !0,
type: n.type,
props: c,
key: c && Hw(c),
ref: e && e.ref ? (t && s ? (yt(s) ? s.concat(Sp(e)) : [s, Sp(e)]) : Sp(e)) : s,
scopeId: n.scopeId,
slotScopeIds: n.slotScopeIds,
children: a,
target: n.target,
targetStart: n.targetStart,
targetAnchor: n.targetAnchor,
staticCount: n.staticCount,
shapeFlag: n.shapeFlag,
patchFlag: e && n.type !== Hn ? (o === -1 ? 16 : o | 16) : o,
dynamicProps: n.dynamicProps,
dynamicChildren: n.dynamicChildren,
appContext: n.appContext,
dirs: n.dirs,
transition: l,
component: n.component,
suspense: n.suspense,
ssContent: n.ssContent && Qo(n.ssContent),
ssFallback: n.ssFallback && Qo(n.ssFallback),
el: n.el,
anchor: n.anchor,
ctx: n.ctx,
ce: n.ce,
}
return (l && i && eh(u, l.clone(u)), u)
}
function rm(n = ' ', e = 0) {
return Ae(Nu, null, n, e)
}
function Pu(n, e) {
const t = Ae(xp, null, n)
return ((t.staticCount = e), t)
}
function Tr(n = '', e = !1) {
return e ? (ft(), ou(Js, null, n)) : Ae(Js, null, n)
}
function Us(n) {
return n == null || typeof n == 'boolean'
? Ae(Js)
: yt(n)
? Ae(Hn, null, n.slice())
: au(n)
? _a(n)
: Ae(Nu, null, String(n))
}
function _a(n) {
return (n.el === null && n.patchFlag !== -1) || n.memo ? n : Qo(n)
}
function l_(n, e) {
let t = 0
const { shapeFlag: i } = n
if (e == null) e = null
else if (yt(e)) t = 16
else if (typeof e == 'object')
if (i & 65) {
const r = e.default
r && (r._c && (r._d = !1), l_(n, r()), r._c && (r._d = !0))
return
} else {
t = 32
const r = e._
!r && !Nw(e)
? (e._ctx = Zi)
: r === 3 && Zi && (Zi.slots._ === 1 ? (e._ = 1) : ((e._ = 2), (n.patchFlag |= 1024)))
}
else
Ct(e)
? ((e = { default: e, _ctx: Zi }), (t = 32))
: ((e = String(e)), i & 64 ? ((t = 16), (e = [rm(e)])) : (t = 8))
;((n.children = e), (n.shapeFlag |= t))
}
function r9(...n) {
const e = {}
for (let t = 0; t < n.length; t++) {
const i = n[t]
for (const r in i)
if (r === 'class') e.class !== i.class && (e.class = Ys([e.class, i.class]))
else if (r === 'style') e.style = js([e.style, i.style])
else if (Gm(r)) {
const s = e[r],
o = i[r]
o && s !== o && !(yt(s) && s.includes(o)) && (e[r] = s ? [].concat(s, o) : o)
} else r !== '' && (e[r] = i[r])
}
return e
}
function Ms(n, e, t, i = null) {
As(n, e, 7, [t, i])
}
const s9 = Mw()
let o9 = 0
function a9(n, e, t) {
const i = n.type,
r = (e ? e.appContext : n.appContext) || s9,
s = {
uid: o9++,
vnode: n,
type: i,
parent: e,
appContext: r,
root: null,
next: null,
subTree: null,
effect: null,
update: null,
job: null,
scope: new HT(!0),
render: null,
proxy: null,
exposed: null,
exposeProxy: null,
withProxy: null,
provides: e ? e.provides : Object.create(r.provides),
ids: e ? e.ids : ['', 0, 0],
accessCache: null,
renderCache: [],
components: null,
directives: null,
propsOptions: Lw(i, r),
emitsOptions: kw(i, r),
emit: null,
emitted: null,
propsDefaults: un,
inheritAttrs: i.inheritAttrs,
ctx: un,
data: un,
props: un,
attrs: un,
slots: un,
refs: un,
setupState: un,
setupContext: null,
suspense: t,
suspenseId: t ? t.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,
}
return (
(s.ctx = { _: s }),
(s.root = e ? e.root : s),
(s.emit = X8.bind(null, s)),
n.ce && n.ce(s),
s
)
}
let ui = null
const jo = () => ui || Zi
let sm, q1
{
const n = qm(),
e = (t, i) => {
let r
return (
(r = n[t]) || (r = n[t] = []),
r.push(i),
(s) => {
r.length > 1 ? r.forEach((o) => o(s)) : r[0](s)
}
)
}
;((sm = e('__VUE_INSTANCE_SETTERS__', (t) => (ui = t))),
(q1 = e('__VUE_SSR_SETTERS__', (t) => (ih = t))))
}
const Oh = (n) => {
const e = ui
return (
sm(n),
n.scope.on(),
() => {
;(n.scope.off(), sm(e))
}
)
},
z2 = () => {
;(ui && ui.scope.off(), sm(null))
}
function $w(n) {
return n.vnode.shapeFlag & 4
}
let ih = !1
function l9(n, e = !1, t = !1) {
e && q1(e)
const { props: i, children: r } = n.vnode,
s = $w(n)
;(F8(n, i, s, e), k8(n, r, t || e))
const o = s ? c9(n, e) : void 0
return (e && q1(!1), o)
}
function c9(n, e) {
const t = n.type
;((n.accessCache = Object.create(null)), (n.proxy = new Proxy(n.ctx, C8)))
const { setup: i } = t
if (i) {
Go()
const r = (n.setupContext = i.length > 1 ? d9(n) : null),
s = Oh(n),
o = Lh(i, n, 0, [n.props, r]),
a = OT(o)
if ((Wo(), s(), (a || n.sp) && !Ld(n) && _w(n), a)) {
if ((o.then(z2, z2), e))
return o
.then((l) => {
V2(n, l)
})
.catch((l) => {
Km(l, n, 0)
})
n.asyncDep = o
} else V2(n, o)
} else Gw(n)
}
function V2(n, e, t) {
;(Ct(e)
? n.type.__ssrInlineRender
? (n.ssrRender = e)
: (n.render = e)
: gn(e) && (n.setupState = ow(e)),
Gw(n))
}
function Gw(n, e, t) {
const i = n.type
n.render || (n.render = i.render || Qs)
{
const r = Oh(n)
Go()
try {
E8(n)
} finally {
;(Wo(), r())
}
}
}
const u9 = {
get(n, e) {
return (Pi(n, 'get', ''), n[e])
},
}
function d9(n) {
const e = (t) => {
n.exposed = t || {}
}
return { attrs: new Proxy(n.attrs, u9), slots: n.slots, emit: n.emit, expose: e }
}
function t0(n) {
return n.exposed
? n.exposeProxy ||
(n.exposeProxy = new Proxy(ow(t_(n.exposed)), {
get(e, t) {
if (t in e) return e[t]
if (t in Dd) return Dd[t](n)
},
has(e, t) {
return t in e || t in Dd
},
}))
: n.proxy
}
function h9(n, e = !0) {
return Ct(n) ? n.displayName || n.name : n.name || (e && n.__name)
}
function f9(n) {
return Ct(n) && '__vccOpts' in n
}
const We = (n, e) => r8(n, e, ih)
function Ba(n, e, t) {
const i = arguments.length
return i === 2
? gn(e) && !yt(e)
? au(e)
? Ae(n, null, [e])
: Ae(n, e)
: Ae(n, null, e)
: (i > 3 ? (t = Array.prototype.slice.call(arguments, 2)) : i === 3 && au(t) && (t = [t]),
Ae(n, e, t))
}
const p9 = '3.5.17'
/**
* @vue/runtime-dom v3.5.17
* (c) 2018-present Yuxi (Evan) You and Vue contributors
* @license MIT
**/ let X1
const H2 = typeof window < 'u' && window.trustedTypes
if (H2)
try {
X1 = H2.createPolicy('vue', { createHTML: (n) => n })
} catch (n) {}
const Ww = X1 ? (n) => X1.createHTML(n) : (n) => n,
m9 = 'http://www.w3.org/2000/svg',
g9 = 'http://www.w3.org/1998/Math/MathML',
To = typeof document < 'u' ? document : null,
$2 = To && To.createElement('template'),
y9 = {
insert: (n, e, t) => {
e.insertBefore(n, t || null)
},
remove: (n) => {
const e = n.parentNode
e && e.removeChild(n)
},
createElement: (n, e, t, i) => {
const r =
e === 'svg'
? To.createElementNS(m9, n)
: e === 'mathml'
? To.createElementNS(g9, n)
: t
? To.createElement(n, { is: t })
: To.createElement(n)
return (
n === 'select' && i && i.multiple != null && r.setAttribute('multiple', i.multiple),
r
)
},
createText: (n) => To.createTextNode(n),
createComment: (n) => To.createComment(n),
setText: (n, e) => {
n.nodeValue = e
},
setElementText: (n, e) => {
n.textContent = e
},
parentNode: (n) => n.parentNode,
nextSibling: (n) => n.nextSibling,
querySelector: (n) => To.querySelector(n),
setScopeId(n, e) {
n.setAttribute(e, '')
},
insertStaticContent(n, e, t, i, r, s) {
const o = t ? t.previousSibling : e.lastChild
if (r && (r === s || r.nextSibling))
for (; e.insertBefore(r.cloneNode(!0), t), !(r === s || !(r = r.nextSibling)); );
else {
$2.innerHTML = Ww(
i === 'svg'
? '')
: i === 'mathml'
? '')
: n
)
const a = $2.content
if (i === 'svg' || i === 'mathml') {
const l = a.firstChild
for (; l.firstChild; ) a.appendChild(l.firstChild)
a.removeChild(l)
}
e.insertBefore(a, t)
}
return [o ? o.nextSibling : e.firstChild, t ? t.previousSibling : e.lastChild]
},
},
sa = 'transition',
Ju = 'animation',
lu = Symbol('_vtc'),
Qw = {
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,
},
v9 = ti({}, f8, Qw),
Ja = (n, e = []) => {
yt(n) ? n.forEach((t) => t(...e)) : n && n(...e)
},
G2 = (n) => (n ? (yt(n) ? n.some((e) => e.length > 1) : n.length > 1) : !1)
function _9(n) {
const e = {}
for (const L in n) L in Qw || (e[L] = n[L])
if (n.css === !1) return e
const {
name: t = 'v',
type: i,
duration: r,
enterFromClass: s = ''.concat(t, '-enter-from'),
enterActiveClass: o = ''.concat(t, '-enter-active'),
enterToClass: a = ''.concat(t, '-enter-to'),
appearFromClass: l = s,
appearActiveClass: c = o,
appearToClass: u = a,
leaveFromClass: d = ''.concat(t, '-leave-from'),
leaveActiveClass: h = ''.concat(t, '-leave-active'),
leaveToClass: f = ''.concat(t, '-leave-to'),
} = n,
p = x9(r),
g = p && p[0],
y = p && p[1],
{
onBeforeEnter: m,
onEnter: v,
onEnterCancelled: x,
onLeave: _,
onLeaveCancelled: S,
onBeforeAppear: C = m,
onAppear: A = v,
onAppearCancelled: R = x,
} = e,
w = (L, U, T, F) => {
;((L._enterCancelled = F), ma(L, U ? u : a), ma(L, U ? c : o), T && T())
},
M = (L, U) => {
;((L._isLeaving = !1), ma(L, d), ma(L, f), ma(L, h), U && U())
},
I = (L) => (U, T) => {
const F = L ? A : v,
V = () => w(U, L, T)
;(Ja(F, [U, V]),
W2(() => {
;(ma(U, L ? l : s), Ls(U, L ? u : a), G2(F) || Q2(U, i, g, V))
}))
}
return ti(e, {
onBeforeEnter(L) {
;(Ja(m, [L]), Ls(L, s), Ls(L, o))
},
onBeforeAppear(L) {
;(Ja(C, [L]), Ls(L, l), Ls(L, c))
},
onEnter: I(!1),
onAppear: I(!0),
onLeave(L, U) {
L._isLeaving = !0
const T = () => M(L, U)
;(Ls(L, d),
L._enterCancelled ? (Ls(L, h), K1()) : (K1(), Ls(L, h)),
W2(() => {
L._isLeaving && (ma(L, d), Ls(L, f), G2(_) || Q2(L, i, y, T))
}),
Ja(_, [L, T]))
},
onEnterCancelled(L) {
;(w(L, !1, void 0, !0), Ja(x, [L]))
},
onAppearCancelled(L) {
;(w(L, !0, void 0, !0), Ja(R, [L]))
},
onLeaveCancelled(L) {
;(M(L), Ja(S, [L]))
},
})
}
function x9(n) {
if (n == null) return null
if (gn(n)) return [J0(n.enter), J0(n.leave)]
{
const e = J0(n)
return [e, e]
}
}
function J0(n) {
return AI(n)
}
function Ls(n, e) {
;(e.split(/\s+/).forEach((t) => t && n.classList.add(t)), (n[lu] || (n[lu] = new Set())).add(e))
}
function ma(n, e) {
e.split(/\s+/).forEach((i) => i && n.classList.remove(i))
const t = n[lu]
t && (t.delete(e), t.size || (n[lu] = void 0))
}
function W2(n) {
requestAnimationFrame(() => {
requestAnimationFrame(n)
})
}
let S9 = 0
function Q2(n, e, t, i) {
const r = (n._endId = ++S9),
s = () => {
r === n._endId && i()
}
if (t != null) return setTimeout(s, t)
const { type: o, timeout: a, propCount: l } = jw(n, e)
if (!o) return i()
const c = o + 'end'
let u = 0
const d = () => {
;(n.removeEventListener(c, h), s())
},
h = (f) => {
f.target === n && ++u >= l && d()
}
;(setTimeout(() => {
u < l && d()
}, a + 1),
n.addEventListener(c, h))
}
function jw(n, e) {
const t = window.getComputedStyle(n),
i = (p) => (t[p] || '').split(', '),
r = i(''.concat(sa, 'Delay')),
s = i(''.concat(sa, 'Duration')),
o = j2(r, s),
a = i(''.concat(Ju, 'Delay')),
l = i(''.concat(Ju, 'Duration')),
c = j2(a, l)
let u = null,
d = 0,
h = 0
e === sa
? o > 0 && ((u = sa), (d = o), (h = s.length))
: e === Ju
? c > 0 && ((u = Ju), (d = c), (h = l.length))
: ((d = Math.max(o, c)),
(u = d > 0 ? (o > c ? sa : Ju) : null),
(h = u ? (u === sa ? s.length : l.length) : 0))
const f = u === sa && /\b(transform|all)(,|$)/.test(i(''.concat(sa, 'Property')).toString())
return { type: u, timeout: d, propCount: h, hasTransform: f }
}
function j2(n, e) {
for (; n.length < e.length; ) n = n.concat(n)
return Math.max(...e.map((t, i) => q2(t) + q2(n[i])))
}
function q2(n) {
return n === 'auto' ? 0 : Number(n.slice(0, -1).replace(',', '.')) * 1e3
}
function K1() {
return document.body.offsetHeight
}
function A9(n, e, t) {
const i = n[lu]
;(i && (e = (e ? [e, ...i] : [...i]).join(' ')),
e == null ? n.removeAttribute('class') : t ? n.setAttribute('class', e) : (n.className = e))
}
const om = Symbol('_vod'),
qw = Symbol('_vsh'),
am = {
beforeMount(n, { value: e }, { transition: t }) {
;((n[om] = n.style.display === 'none' ? '' : n.style.display),
t && e ? t.beforeEnter(n) : ed(n, e))
},
mounted(n, { value: e }, { transition: t }) {
t && e && t.enter(n)
},
updated(n, { value: e, oldValue: t }, { transition: i }) {
!e != !t &&
(i
? e
? (i.beforeEnter(n), ed(n, !0), i.enter(n))
: i.leave(n, () => {
ed(n, !1)
})
: ed(n, e))
},
beforeUnmount(n, { value: e }) {
ed(n, e)
},
}
function ed(n, e) {
;((n.style.display = e ? n[om] : 'none'), (n[qw] = !e))
}
const b9 = Symbol(''),
T9 = /(^|;)\s*display\s*:/
function w9(n, e, t) {
const i = n.style,
r = wn(t)
let s = !1
if (t && !r) {
if (e)
if (wn(e))
for (const o of e.split(';')) {
const a = o.slice(0, o.indexOf(':')).trim()
t[a] == null && Ap(i, a, '')
}
else for (const o in e) t[o] == null && Ap(i, o, '')
for (const o in t) (o === 'display' && (s = !0), Ap(i, o, t[o]))
} else if (r) {
if (e !== t) {
const o = i[b9]
;(o && (t += ';' + o), (i.cssText = t), (s = T9.test(t)))
}
} else e && n.removeAttribute('style')
om in n && ((n[om] = s ? i.display : ''), n[qw] && (i.display = 'none'))
}
const X2 = /\s*!important$/
function Ap(n, e, t) {
if (yt(t)) t.forEach((i) => Ap(n, e, i))
else if ((t == null && (t = ''), e.startsWith('--'))) n.setProperty(e, t)
else {
const i = C9(n, e)
X2.test(t) ? n.setProperty(Wl(i), t.replace(X2, ''), 'important') : (n[i] = t)
}
}
const K2 = ['Webkit', 'Moz', 'ms'],
eg = {}
function C9(n, e) {
const t = eg[e]
if (t) return t
let i = ns(e)
if (i !== 'filter' && i in n) return (eg[e] = i)
i = jm(i)
for (let r = 0; r < K2.length; r++) {
const s = K2[r] + i
if (s in n) return (eg[e] = s)
}
return e
}
const Y2 = 'http://www.w3.org/1999/xlink'
function Z2(n, e, t, i, r, s = MI(e)) {
i && e.startsWith('xlink:')
? t == null
? n.removeAttributeNS(Y2, e.slice(6, e.length))
: n.setAttributeNS(Y2, e, t)
: t == null || (s && !kT(t))
? n.removeAttribute(e)
: n.setAttribute(e, s ? '' : za(t) ? String(t) : t)
}
function J2(n, e, t, i, r) {
if (e === 'innerHTML' || e === 'textContent') {
t != null && (n[e] = e === 'innerHTML' ? Ww(t) : t)
return
}
const s = n.tagName
if (e === 'value' && s !== 'PROGRESS' && !s.includes('-')) {
const a = s === 'OPTION' ? n.getAttribute('value') || '' : n.value,
l = t == null ? (n.type === 'checkbox' ? 'on' : '') : String(t)
;((a !== l || !('_value' in n)) && (n.value = l),
t == null && n.removeAttribute(e),
(n._value = t))
return
}
let o = !1
if (t === '' || t == null) {
const a = typeof n[e]
a === 'boolean'
? (t = kT(t))
: t == null && a === 'string'
? ((t = ''), (o = !0))
: a === 'number' && ((t = 0), (o = !0))
}
try {
n[e] = t
} catch (a) {}
o && n.removeAttribute(r || e)
}
function E9(n, e, t, i) {
n.addEventListener(e, t, i)
}
function M9(n, e, t, i) {
n.removeEventListener(e, t, i)
}
const eS = Symbol('_vei')
function R9(n, e, t, i, r = null) {
const s = n[eS] || (n[eS] = {}),
o = s[e]
if (i && o) o.value = i
else {
const [a, l] = I9(e)
if (i) {
const c = (s[e] = L9(i, r))
E9(n, a, c, l)
} else o && (M9(n, a, o, l), (s[e] = void 0))
}
}
const tS = /(?:Once|Passive|Capture)$/
function I9(n) {
let e
if (tS.test(n)) {
e = {}
let i
for (; (i = n.match(tS)); )
((n = n.slice(0, n.length - i[0].length)), (e[i[0].toLowerCase()] = !0))
}
return [n[2] === ':' ? n.slice(3) : Wl(n.slice(2)), e]
}
let tg = 0
const N9 = Promise.resolve(),
P9 = () => tg || (N9.then(() => (tg = 0)), (tg = Date.now()))
function L9(n, e) {
const t = (i) => {
if (!i._vts) i._vts = Date.now()
else if (i._vts <= t.attached) return
As(D9(i, t.value), e, 5, [i])
}
return ((t.value = n), (t.attached = P9()), t)
}
function D9(n, e) {
if (yt(e)) {
const t = n.stopImmediatePropagation
return (
(n.stopImmediatePropagation = () => {
;(t.call(n), (n._stopped = !0))
}),
e.map((i) => (r) => !r._stopped && i && i(r))
)
} else return e
}
const nS = (n) =>
n.charCodeAt(0) === 111 &&
n.charCodeAt(1) === 110 &&
n.charCodeAt(2) > 96 &&
n.charCodeAt(2) < 123,
F9 = (n, e, t, i, r, s) => {
const o = r === 'svg'
e === 'class'
? A9(n, i, o)
: e === 'style'
? w9(n, t, i)
: Gm(e)
? Gv(e) || R9(n, e, t, i, s)
: (
e[0] === '.'
? ((e = e.slice(1)), !0)
: e[0] === '^'
? ((e = e.slice(1)), !1)
: O9(n, e, i, o)
)
? (J2(n, e, i),
!n.tagName.includes('-') &&
(e === 'value' || e === 'checked' || e === 'selected') &&
Z2(n, e, i, o, s, e !== 'value'))
: n._isVueCE && (/[A-Z]/.test(e) || !wn(i))
? J2(n, ns(e), i, s, e)
: (e === 'true-value'
? (n._trueValue = i)
: e === 'false-value' && (n._falseValue = i),
Z2(n, e, i, o))
}
function O9(n, e, t, i) {
if (i) return !!(e === 'innerHTML' || e === 'textContent' || (e in n && nS(e) && Ct(t)))
if (
e === 'spellcheck' ||
e === 'draggable' ||
e === 'translate' ||
e === 'autocorrect' ||
e === 'form' ||
(e === 'list' && n.tagName === 'INPUT') ||
(e === 'type' && n.tagName === 'TEXTAREA')
)
return !1
if (e === 'width' || e === 'height') {
const r = n.tagName
if (r === 'IMG' || r === 'VIDEO' || r === 'CANVAS' || r === 'SOURCE') return !1
}
return nS(e) && wn(t) ? !1 : e in n
}
const Xw = new WeakMap(),
Kw = new WeakMap(),
lm = Symbol('_moveCb'),
iS = Symbol('_enterCb'),
B9 = (n) => (delete n.props.mode, n),
U9 = B9({
name: 'TransitionGroup',
props: ti({}, v9, { tag: String, moveClass: String }),
setup(n, { slots: e }) {
const t = jo(),
i = h8()
let r, s
return (
i_(() => {
if (!r.length) return
const o = n.moveClass || ''.concat(n.name || 'v', '-move')
if (!H9(r[0].el, t.vnode.el, o)) {
r = []
return
}
;(r.forEach(k9), r.forEach(z9))
const a = r.filter(V9)
;(K1(),
a.forEach((l) => {
const c = l.el,
u = c.style
;(Ls(c, o), (u.transform = u.webkitTransform = u.transitionDuration = ''))
const d = (c[lm] = (h) => {
;(h && h.target !== c) ||
((!h || /transform$/.test(h.propertyName)) &&
(c.removeEventListener('transitionend', d), (c[lm] = null), ma(c, o)))
})
c.addEventListener('transitionend', d)
}),
(r = []))
}),
() => {
const o = Ot(n),
a = _9(o)
let l = o.tag || Hn
if (((r = []), s))
for (let c = 0; c < s.length; c++) {
const u = s[c]
u.el &&
u.el instanceof Element &&
(r.push(u), eh(u, $1(u, a, i, t)), Xw.set(u, u.el.getBoundingClientRect()))
}
s = e.default ? vw(e.default()) : []
for (let c = 0; c < s.length; c++) {
const u = s[c]
u.key != null && eh(u, $1(u, a, i, t))
}
return Ae(l, null, s)
}
)
},
}),
Yw = U9
function k9(n) {
const e = n.el
;(e[lm] && e[lm](), e[iS] && e[iS]())
}
function z9(n) {
Kw.set(n, n.el.getBoundingClientRect())
}
function V9(n) {
const e = Xw.get(n),
t = Kw.get(n),
i = e.left - t.left,
r = e.top - t.top
if (i || r) {
const s = n.el.style
return (
(s.transform = s.webkitTransform = 'translate('.concat(i, 'px,').concat(r, 'px)')),
(s.transitionDuration = '0s'),
n
)
}
}
function H9(n, e, t) {
const i = n.cloneNode(),
r = n[lu]
;(r &&
r.forEach((a) => {
a.split(/\s+/).forEach((l) => l && i.classList.remove(l))
}),
t.split(/\s+/).forEach((a) => a && i.classList.add(a)),
(i.style.display = 'none'))
const s = e.nodeType === 1 ? e : e.parentNode
s.appendChild(i)
const { hasTransform: o } = jw(i)
return (s.removeChild(i), o)
}
const $9 = ['ctrl', 'shift', 'alt', 'meta'],
G9 = {
stop: (n) => n.stopPropagation(),
prevent: (n) => n.preventDefault(),
self: (n) => n.target !== n.currentTarget,
ctrl: (n) => !n.ctrlKey,
shift: (n) => !n.shiftKey,
alt: (n) => !n.altKey,
meta: (n) => !n.metaKey,
left: (n) => 'button' in n && n.button !== 0,
middle: (n) => 'button' in n && n.button !== 1,
right: (n) => 'button' in n && n.button !== 2,
exact: (n, e) => $9.some((t) => n[''.concat(t, 'Key')] && !e.includes(t)),
},
vf = (n, e) => {
const t = n._withMods || (n._withMods = {}),
i = e.join('.')
return (
t[i] ||
(t[i] = (r, ...s) => {
for (let o = 0; o < e.length; o++) {
const a = G9[e[o]]
if (a && a(r, e)) return
}
return n(r, ...s)
})
)
},
W9 = ti({ patchProp: F9 }, y9)
let rS
function Zw() {
return rS || (rS = V8(W9))
}
const sS = (...n) => {
Zw().render(...n)
},
Q9 = (...n) => {
const e = Zw().createApp(...n),
{ mount: t } = e
return (
(e.mount = (i) => {
const r = q9(i)
if (!r) return
const s = e._component
;(!Ct(s) && !s.render && !s.template && (s.template = r.innerHTML),
r.nodeType === 1 && (r.textContent = ''))
const o = t(r, !1, j9(r))
return (
r instanceof Element && (r.removeAttribute('v-cloak'), r.setAttribute('data-v-app', '')),
o
)
}),
e
)
}
function j9(n) {
if (n instanceof SVGElement) return 'svg'
if (typeof MathMLElement == 'function' && n instanceof MathMLElement) return 'mathml'
}
function q9(n) {
return wn(n) ? document.querySelector(n) : n
}
/*!
* pinia v3.0.3
* (c) 2025 Eduardo San Martin Morote
* @license MIT
*/ let Jw
const n0 = (n) => (Jw = n),
e5 = Symbol()
function Y1(n) {
return (
n &&
typeof n == 'object' &&
Object.prototype.toString.call(n) === '[object Object]' &&
typeof n.toJSON != 'function'
)
}
var Od
;(function (n) {
;((n.direct = 'direct'), (n.patchObject = 'patch object'), (n.patchFunction = 'patch function'))
})(Od || (Od = {}))
function X9() {
const n = jv(!0),
e = n.run(() => Dn({}))
let t = [],
i = []
const r = t_({
install(s) {
;(n0(r),
(r._a = s),
s.provide(e5, r),
(s.config.globalProperties.$pinia = r),
i.forEach((o) => t.push(o)),
(i = []))
},
use(s) {
return (this._a ? t.push(s) : i.push(s), this)
},
_p: t,
_a: null,
_e: n,
_s: new Map(),
state: e,
})
return r
}
const t5 = () => {}
function oS(n, e, t, i = t5) {
n.push(e)
const r = () => {
const s = n.indexOf(e)
s > -1 && (n.splice(s, 1), i())
}
return (!t && $T() && RI(r), r)
}
function Jl(n, ...e) {
n.slice().forEach((t) => {
t(...e)
})
}
const K9 = (n) => n(),
aS = Symbol(),
ng = Symbol()
function Z1(n, e) {
n instanceof Map && e instanceof Map
? e.forEach((t, i) => n.set(i, t))
: n instanceof Set && e instanceof Set && e.forEach(n.add, n)
for (const t in e) {
if (!e.hasOwnProperty(t)) continue
const i = e[t],
r = n[t]
Y1(r) && Y1(i) && n.hasOwnProperty(t) && !bn(i) && !ko(i) ? (n[t] = Z1(r, i)) : (n[t] = i)
}
return n
}
const Y9 = Symbol()
function Z9(n) {
return !Y1(n) || !Object.prototype.hasOwnProperty.call(n, Y9)
}
const { assign: ga } = Object
function J9(n) {
return !!(bn(n) && n.effect)
}
function eN(n, e, t, i) {
const { state: r, actions: s, getters: o } = e,
a = t.state.value[n]
let l
function c() {
a || (t.state.value[n] = r ? r() : {})
const u = JI(t.state.value[n])
return ga(
u,
s,
Object.keys(o || {}).reduce(
(d, h) => (
(d[h] = t_(
We(() => {
n0(t)
const f = t._s.get(n)
return o[h].call(f, f)
})
)),
d
),
{}
)
)
}
return ((l = n5(n, c, e, t, i, !0)), l)
}
function n5(n, e, t = {}, i, r, s) {
let o
const a = ga({ actions: {} }, t),
l = { deep: !0 }
let c,
u,
d = [],
h = [],
f
const p = i.state.value[n]
;(!s && !p && (i.state.value[n] = {}), Dn({}))
let g
function y(R) {
let w
;((c = u = !1),
typeof R == 'function'
? (R(i.state.value[n]), (w = { type: Od.patchFunction, storeId: n, events: f }))
: (Z1(i.state.value[n], R),
(w = { type: Od.patchObject, payload: R, storeId: n, events: f })))
const M = (g = Symbol())
;(Dh().then(() => {
g === M && (c = !0)
}),
(u = !0),
Jl(d, w, i.state.value[n]))
}
const m = s
? function () {
const { state: w } = t,
M = w ? w() : {}
this.$patch((I) => {
ga(I, M)
})
}
: t5
function v() {
;(o.stop(), (d = []), (h = []), i._s.delete(n))
}
const x = (R, w = '') => {
if (aS in R) return ((R[ng] = w), R)
const M = function () {
n0(i)
const I = Array.from(arguments),
L = [],
U = []
function T(Q) {
L.push(Q)
}
function F(Q) {
U.push(Q)
}
Jl(h, { args: I, name: M[ng], store: S, after: T, onError: F })
let V
try {
V = R.apply(this && this.$id === n ? this : S, I)
} catch (Q) {
throw (Jl(U, Q), Q)
}
return V instanceof Promise
? V.then((Q) => (Jl(L, Q), Q)).catch((Q) => (Jl(U, Q), Promise.reject(Q)))
: (Jl(L, V), V)
}
return ((M[aS] = !0), (M[ng] = w), M)
},
_ = {
_p: i,
$id: n,
$onAction: oS.bind(null, h),
$patch: y,
$reset: m,
$subscribe(R, w = {}) {
const M = oS(d, R, w.detached, () => I()),
I = o.run(() =>
Jn(
() => i.state.value[n],
(L) => {
;(w.flush === 'sync' ? u : c) && R({ storeId: n, type: Od.direct, events: f }, L)
},
ga({}, l, w)
)
)
return M
},
$dispose: v,
},
S = Zs(_)
i._s.set(n, S)
const A = ((i._a && i._a.runWithContext) || K9)(() =>
i._e.run(() => (o = jv()).run(() => e({ action: x })))
)
for (const R in A) {
const w = A[R]
if ((bn(w) && !J9(w)) || ko(w))
s || (p && Z9(w) && (bn(w) ? (w.value = p[R]) : Z1(w, p[R])), (i.state.value[n][R] = w))
else if (typeof w == 'function') {
const M = x(w, R)
;((A[R] = M), (a.actions[R] = w))
}
}
return (
ga(S, A),
ga(Ot(S), A),
Object.defineProperty(S, '$state', {
get: () => i.state.value[n],
set: (R) => {
y((w) => {
ga(w, R)
})
},
}),
i._p.forEach((R) => {
ga(
S,
o.run(() => R({ store: S, app: i._a, pinia: i, options: a }))
)
}),
p && s && t.hydrate && t.hydrate(S.$state, p),
(c = !0),
(u = !0),
S
)
}
/*! #__NO_SIDE_EFFECTS__ */ function i5(n, e, t) {
let i
const r = typeof e == 'function'
i = r ? t : e
function s(o, a) {
const l = D8()
return (
(o = o || (l ? Ji(e5, null) : null)),
o && n0(o),
(o = Jw),
o._s.has(n) || (r ? n5(n, e, i, o) : eN(n, i, o)),
o._s.get(n)
)
}
return ((s.$id = n), s)
}
function cm(n) {
const e = Ot(n),
t = {}
for (const i in e) {
const r = e[i]
r.effect
? (t[i] = We({
get: () => n[i],
set(s) {
n[i] = s
},
}))
: (bn(r) || ko(r)) && (t[i] = n8(n, i))
}
return t
}
function c_(n) {
return n && n.__esModule && Object.prototype.hasOwnProperty.call(n, 'default') ? n.default : n
}
var ig = { exports: {} },
lS
function tN() {
return (
lS ||
((lS = 1),
(function (n) {
var e = Object.prototype.hasOwnProperty,
t = '~'
function i() {}
Object.create && ((i.prototype = Object.create(null)), new i().__proto__ || (t = !1))
function r(l, c, u) {
;((this.fn = l), (this.context = c), (this.once = u || !1))
}
function s(l, c, u, d, h) {
if (typeof u != 'function') throw new TypeError('The listener must be a function')
var f = new r(u, d || l, h),
p = t ? t + c : c
return (
l._events[p]
? l._events[p].fn
? (l._events[p] = [l._events[p], f])
: l._events[p].push(f)
: ((l._events[p] = f), l._eventsCount++),
l
)
}
function o(l, c) {
--l._eventsCount === 0 ? (l._events = new i()) : delete l._events[c]
}
function a() {
;((this._events = new i()), (this._eventsCount = 0))
}
;((a.prototype.eventNames = function () {
var c = [],
u,
d
if (this._eventsCount === 0) return c
for (d in (u = this._events)) e.call(u, d) && c.push(t ? d.slice(1) : d)
return Object.getOwnPropertySymbols ? c.concat(Object.getOwnPropertySymbols(u)) : c
}),
(a.prototype.listeners = function (c) {
var u = t ? t + c : c,
d = this._events[u]
if (!d) return []
if (d.fn) return [d.fn]
for (var h = 0, f = d.length, p = new Array(f); h < f; h++) p[h] = d[h].fn
return p
}),
(a.prototype.listenerCount = function (c) {
var u = t ? t + c : c,
d = this._events[u]
return d ? (d.fn ? 1 : d.length) : 0
}),
(a.prototype.emit = function (c, u, d, h, f, p) {
var g = t ? t + c : c
if (!this._events[g]) return !1
var y = this._events[g],
m = arguments.length,
v,
x
if (y.fn) {
switch ((y.once && this.removeListener(c, y.fn, void 0, !0), m)) {
case 1:
return (y.fn.call(y.context), !0)
case 2:
return (y.fn.call(y.context, u), !0)
case 3:
return (y.fn.call(y.context, u, d), !0)
case 4:
return (y.fn.call(y.context, u, d, h), !0)
case 5:
return (y.fn.call(y.context, u, d, h, f), !0)
case 6:
return (y.fn.call(y.context, u, d, h, f, p), !0)
}
for (x = 1, v = new Array(m - 1); x < m; x++) v[x - 1] = arguments[x]
y.fn.apply(y.context, v)
} else {
var _ = y.length,
S
for (x = 0; x < _; x++)
switch ((y[x].once && this.removeListener(c, y[x].fn, void 0, !0), m)) {
case 1:
y[x].fn.call(y[x].context)
break
case 2:
y[x].fn.call(y[x].context, u)
break
case 3:
y[x].fn.call(y[x].context, u, d)
break
case 4:
y[x].fn.call(y[x].context, u, d, h)
break
default:
if (!v) for (S = 1, v = new Array(m - 1); S < m; S++) v[S - 1] = arguments[S]
y[x].fn.apply(y[x].context, v)
}
}
return !0
}),
(a.prototype.on = function (c, u, d) {
return s(this, c, u, d, !1)
}),
(a.prototype.once = function (c, u, d) {
return s(this, c, u, d, !0)
}),
(a.prototype.removeListener = function (c, u, d, h) {
var f = t ? t + c : c
if (!this._events[f]) return this
if (!u) return (o(this, f), this)
var p = this._events[f]
if (p.fn) p.fn === u && (!h || p.once) && (!d || p.context === d) && o(this, f)
else {
for (var g = 0, y = [], m = p.length; g < m; g++)
(p[g].fn !== u || (h && !p[g].once) || (d && p[g].context !== d)) && y.push(p[g])
y.length ? (this._events[f] = y.length === 1 ? y[0] : y) : o(this, f)
}
return this
}),
(a.prototype.removeAllListeners = function (c) {
var u
return (
c
? ((u = t ? t + c : c), this._events[u] && o(this, u))
: ((this._events = new i()), (this._eventsCount = 0)),
this
)
}),
(a.prototype.off = a.prototype.removeListener),
(a.prototype.addListener = a.prototype.on),
(a.prefixed = t),
(a.EventEmitter = a),
(n.exports = a))
})(ig)),
ig.exports
)
}
var nN = tN()
const u_ = c_(nN)
var Sr = ((n) => (
(n.ErrorReceived = 'ErrorReceived'),
(n.MessageReceived = 'MessageReceived'),
(n.StartSpeech = 'StartSpeech'),
(n.EndSpeech = 'EndSpeech'),
(n.StateChanged = 'StateChanged'),
n
))(Sr || {}),
Kr = ((n) => (
(n.WS_CLOSE = 'WS_CLOSE'),
(n.WS_ERROR = 'WS_ERROR'),
(n.WS_MESSAGE = 'WS_MESSAGE'),
(n.WS_OPEN = 'WS_OPEN'),
n
))(Kr || {}),
Bl = ((n) => (
(n.Player_EndSpeaking = 'Player_EndSpeaking'),
(n.Player_NoLegacy = 'Player_NoLegacy'),
(n.Player_StartSpeaking = 'Player_StartSpeaking'),
(n.Player_WaitNextAudioClip = 'Player_WaitNextAudioClip'),
n
))(Bl || {}),
J1 = ((n) => (
(n.Change_Status = 'Change_Status'),
(n.Chat_BinsizeError = 'Chat_BinsizeError'),
n
))(J1 || {})
class iN extends u_ {
constructor(t) {
super()
xe(this, 'engine')
xe(this, '_inited', !1)
this._init(t)
}
_init(t) {
this._inited ||
((this._inited = !0),
(this.engine = new WebSocket(t)),
this.engine.addEventListener('error', (i) => {
this.emit(Kr.WS_ERROR, i)
}),
this.engine.addEventListener('open', () => {
this.emit(Kr.WS_OPEN)
}),
this.engine.addEventListener('message', (i) => {
this.emit(Kr.WS_MESSAGE, i.data)
}),
this.engine.addEventListener('close', () => {
this.emit(Kr.WS_CLOSE)
}))
}
send(t) {
var i
;(i = this.engine) == null || i.send(t)
}
stop() {
var t
;(this.emit(Kr.WS_CLOSE), (this._inited = !1), (t = this.engine) == null || t.close())
}
}
var ya = ((n) => (
(n.Idle = 'Idle'),
(n.Listening = 'Listening'),
(n.Responding = 'Responding'),
(n.Thinking = 'Thinking'),
n
))(ya || {}),
qi = ((n) => ((n.closed = 'closed'), (n.open = 'open'), (n.waiting = 'waiting'), n))(qi || {})
class r5 extends Error {
constructor(e) {
;(super(e), (this.name = 'TimeoutError'))
}
}
class rN extends Error {
constructor(e) {
;(super(), (this.name = 'AbortError'), (this.message = e))
}
}
const cS = (n) => (globalThis.DOMException === void 0 ? new rN(n) : new DOMException(n)),
uS = (n) => {
const e = n.reason === void 0 ? cS('This operation was aborted.') : n.reason
return e instanceof Error ? e : cS(e)
}
function sN(n, e) {
const {
milliseconds: t,
fallback: i,
message: r,
customTimers: s = { setTimeout, clearTimeout },
} = e
let o, a
const c = new Promise((u, d) => {
if (typeof t != 'number' || Math.sign(t) !== 1)
throw new TypeError('Expected `milliseconds` to be a positive number, got `'.concat(t, '`'))
if (e.signal) {
const { signal: f } = e
;(f.aborted && d(uS(f)),
(a = () => {
d(uS(f))
}),
f.addEventListener('abort', a, { once: !0 }))
}
if (t === Number.POSITIVE_INFINITY) {
n.then(u, d)
return
}
const h = new r5()
;((o = s.setTimeout.call(
void 0,
() => {
if (i) {
try {
u(i())
} catch (f) {
d(f)
}
return
}
;(typeof n.cancel == 'function' && n.cancel(),
r === !1
? u()
: r instanceof Error
? d(r)
: ((h.message =
r != null ? r : 'Promise timed out after '.concat(t, ' milliseconds')),
d(h)))
},
t
)),
(async () => {
try {
u(await n)
} catch (f) {
d(f)
}
})())
}).finally(() => {
;(c.clear(), a && e.signal && e.signal.removeEventListener('abort', a))
})
return (
(c.clear = () => {
;(s.clearTimeout.call(void 0, o), (o = void 0))
}),
c
)
}
function oN(n, e, t) {
let i = 0,
r = n.length
for (; r > 0; ) {
const s = Math.trunc(r / 2)
let o = i + s
t(n[o], e) <= 0 ? ((i = ++o), (r -= s + 1)) : (r = s)
}
return i
}
var Gr
class aN {
constructor() {
oi(this, Gr, [])
}
enqueue(e, t) {
t = { priority: 0, ...t }
const i = { priority: t.priority, id: t.id, run: e }
if (this.size === 0 || dt(this, Gr)[this.size - 1].priority >= t.priority) {
dt(this, Gr).push(i)
return
}
const r = oN(dt(this, Gr), i, (s, o) => o.priority - s.priority)
dt(this, Gr).splice(r, 0, i)
}
setPriority(e, t) {
const i = dt(this, Gr).findIndex((s) => s.id === e)
if (i === -1)
throw new ReferenceError(
'No promise function with the id "'.concat(e, '" exists in the queue.')
)
const [r] = dt(this, Gr).splice(i, 1)
this.enqueue(r.run, { priority: t, id: e })
}
dequeue() {
const e = dt(this, Gr).shift()
return e == null ? void 0 : e.run
}
filter(e) {
return dt(this, Gr)
.filter((t) => t.priority === e.priority)
.map((t) => t.run)
}
get size() {
return dt(this, Gr).length
}
}
Gr = new WeakMap()
var eu,
tu,
Ta,
Rh,
nu,
Ih,
Wr,
iu,
Qi,
Nh,
Qr,
ru,
No,
Ph,
Vm,
Gt,
s5,
o5,
a5,
l5,
c5,
bp,
ey,
ty,
Tp,
u5,
wp
class lN extends u_ {
constructor(t) {
var i, r, s, o
super()
oi(this, Gt)
oi(this, eu)
oi(this, tu)
oi(this, Ta, 0)
oi(this, Rh)
oi(this, nu)
oi(this, Ih, 0)
oi(this, Wr)
oi(this, iu)
oi(this, Qi)
oi(this, Nh)
oi(this, Qr, 0)
oi(this, ru)
oi(this, No)
oi(this, Ph)
oi(this, Vm, BigInt(1))
xe(this, 'timeout')
if (
((t = {
carryoverConcurrencyCount: !1,
intervalCap: Number.POSITIVE_INFINITY,
interval: 0,
concurrency: Number.POSITIVE_INFINITY,
autoStart: !0,
queueClass: aN,
...t,
}),
!(typeof t.intervalCap == 'number' && t.intervalCap >= 1))
)
throw new TypeError(
'Expected `intervalCap` to be a number from 1 and up, got `'
.concat((r = (i = t.intervalCap) == null ? void 0 : i.toString()) != null ? r : '', '` (')
.concat(typeof t.intervalCap, ')')
)
if (t.interval === void 0 || !(Number.isFinite(t.interval) && t.interval >= 0))
throw new TypeError(
'Expected `interval` to be a finite number >= 0, got `'
.concat((o = (s = t.interval) == null ? void 0 : s.toString()) != null ? o : '', '` (')
.concat(typeof t.interval, ')')
)
;(En(this, eu, t.carryoverConcurrencyCount),
En(this, tu, t.intervalCap === Number.POSITIVE_INFINITY || t.interval === 0),
En(this, Rh, t.intervalCap),
En(this, nu, t.interval),
En(this, Qi, new t.queueClass()),
En(this, Nh, t.queueClass),
(this.concurrency = t.concurrency),
(this.timeout = t.timeout),
En(this, Ph, t.throwOnTimeout === !0),
En(this, No, t.autoStart === !1))
}
get concurrency() {
return dt(this, ru)
}
set concurrency(t) {
if (!(typeof t == 'number' && t >= 1))
throw new TypeError(
'Expected `concurrency` to be a number from 1 and up, got `'
.concat(t, '` (')
.concat(typeof t, ')')
)
;(En(this, ru, t), fi(this, Gt, Tp).call(this))
}
setPriority(t, i) {
dt(this, Qi).setPriority(t, i)
}
async add(t, i = {}) {
var r
return (
(r = i.id) != null || (i.id = (Yu(this, Vm)._++).toString()),
(i = { timeout: this.timeout, throwOnTimeout: dt(this, Ph), ...i }),
new Promise((s, o) => {
;(dt(this, Qi).enqueue(async () => {
var a
;(Yu(this, Qr)._++, Yu(this, Ta)._++)
try {
;(a = i.signal) == null || a.throwIfAborted()
let l = t({ signal: i.signal })
;(i.timeout && (l = sN(Promise.resolve(l), { milliseconds: i.timeout })),
i.signal && (l = Promise.race([l, fi(this, Gt, u5).call(this, i.signal)])))
const c = await l
;(s(c), this.emit('completed', c))
} catch (l) {
if (l instanceof r5 && !i.throwOnTimeout) {
s()
return
}
;(o(l), this.emit('error', l))
} finally {
fi(this, Gt, a5).call(this)
}
}, i),
this.emit('add'),
fi(this, Gt, bp).call(this))
})
)
}
async addAll(t, i) {
return Promise.all(t.map(async (r) => this.add(r, i)))
}
start() {
return dt(this, No) ? (En(this, No, !1), fi(this, Gt, Tp).call(this), this) : this
}
pause() {
En(this, No, !0)
}
clear() {
En(this, Qi, new (dt(this, Nh))())
}
async onEmpty() {
dt(this, Qi).size !== 0 && (await fi(this, Gt, wp).call(this, 'empty'))
}
async onSizeLessThan(t) {
dt(this, Qi).size < t ||
(await fi(this, Gt, wp).call(this, 'next', () => dt(this, Qi).size < t))
}
async onIdle() {
;(dt(this, Qr) === 0 && dt(this, Qi).size === 0) || (await fi(this, Gt, wp).call(this, 'idle'))
}
get size() {
return dt(this, Qi).size
}
sizeBy(t) {
return dt(this, Qi).filter(t).length
}
get pending() {
return dt(this, Qr)
}
get isPaused() {
return dt(this, No)
}
}
;((eu = new WeakMap()),
(tu = new WeakMap()),
(Ta = new WeakMap()),
(Rh = new WeakMap()),
(nu = new WeakMap()),
(Ih = new WeakMap()),
(Wr = new WeakMap()),
(iu = new WeakMap()),
(Qi = new WeakMap()),
(Nh = new WeakMap()),
(Qr = new WeakMap()),
(ru = new WeakMap()),
(No = new WeakMap()),
(Ph = new WeakMap()),
(Vm = new WeakMap()),
(Gt = new WeakSet()),
(s5 = function () {
return dt(this, tu) || dt(this, Ta) < dt(this, Rh)
}),
(o5 = function () {
return dt(this, Qr) < dt(this, ru)
}),
(a5 = function () {
;(Yu(this, Qr)._--, fi(this, Gt, bp).call(this), this.emit('next'))
}),
(l5 = function () {
;(fi(this, Gt, ty).call(this), fi(this, Gt, ey).call(this), En(this, iu, void 0))
}),
(c5 = function () {
const t = Date.now()
if (dt(this, Wr) === void 0) {
const i = dt(this, Ih) - t
if (i < 0) En(this, Ta, dt(this, eu) ? dt(this, Qr) : 0)
else
return (
dt(this, iu) === void 0 &&
En(
this,
iu,
setTimeout(() => {
fi(this, Gt, l5).call(this)
}, i)
),
!0
)
}
return !1
}),
(bp = function () {
if (dt(this, Qi).size === 0)
return (
dt(this, Wr) && clearInterval(dt(this, Wr)),
En(this, Wr, void 0),
this.emit('empty'),
dt(this, Qr) === 0 && this.emit('idle'),
!1
)
if (!dt(this, No)) {
const t = !dt(this, Gt, c5)
if (dt(this, Gt, s5) && dt(this, Gt, o5)) {
const i = dt(this, Qi).dequeue()
return i ? (this.emit('active'), i(), t && fi(this, Gt, ey).call(this), !0) : !1
}
}
return !1
}),
(ey = function () {
dt(this, tu) ||
dt(this, Wr) !== void 0 ||
(En(
this,
Wr,
setInterval(
() => {
fi(this, Gt, ty).call(this)
},
dt(this, nu)
)
),
En(this, Ih, Date.now() + dt(this, nu)))
}),
(ty = function () {
;(dt(this, Ta) === 0 &&
dt(this, Qr) === 0 &&
dt(this, Wr) &&
(clearInterval(dt(this, Wr)), En(this, Wr, void 0)),
En(this, Ta, dt(this, eu) ? dt(this, Qr) : 0),
fi(this, Gt, Tp).call(this))
}),
(Tp = function () {
for (; fi(this, Gt, bp).call(this); );
}),
(u5 = async function (t) {
return new Promise((i, r) => {
t.addEventListener(
'abort',
() => {
r(t.reason)
},
{ once: !0 }
)
})
}),
(wp = async function (t, i) {
return new Promise((r) => {
const s = () => {
;(i && !i()) || (this.off(t, s), r())
}
this.on(t, s)
})
}))
var td = {},
dS
function d5() {
if (dS) return td
;((dS = 1), (td.byteLength = a), (td.toByteArray = c), (td.fromByteArray = h))
for (
var n = [],
e = [],
t = typeof Uint8Array < 'u' ? Uint8Array : Array,
i = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/',
r = 0,
s = i.length;
r < s;
++r
)
((n[r] = i[r]), (e[i.charCodeAt(r)] = r))
;((e[45] = 62), (e[95] = 63))
function o(f) {
var p = f.length
if (p % 4 > 0) throw new Error('Invalid string. Length must be a multiple of 4')
var g = f.indexOf('=')
g === -1 && (g = p)
var y = g === p ? 0 : 4 - (g % 4)
return [g, y]
}
function a(f) {
var p = o(f),
g = p[0],
y = p[1]
return ((g + y) * 3) / 4 - y
}
function l(f, p, g) {
return ((p + g) * 3) / 4 - g
}
function c(f) {
var p,
g = o(f),
y = g[0],
m = g[1],
v = new t(l(f, y, m)),
x = 0,
_ = m > 0 ? y - 4 : y,
S
for (S = 0; S < _; S += 4)
((p =
(e[f.charCodeAt(S)] << 18) |
(e[f.charCodeAt(S + 1)] << 12) |
(e[f.charCodeAt(S + 2)] << 6) |
e[f.charCodeAt(S + 3)]),
(v[x++] = (p >> 16) & 255),
(v[x++] = (p >> 8) & 255),
(v[x++] = p & 255))
return (
m === 2 &&
((p = (e[f.charCodeAt(S)] << 2) | (e[f.charCodeAt(S + 1)] >> 4)), (v[x++] = p & 255)),
m === 1 &&
((p =
(e[f.charCodeAt(S)] << 10) |
(e[f.charCodeAt(S + 1)] << 4) |
(e[f.charCodeAt(S + 2)] >> 2)),
(v[x++] = (p >> 8) & 255),
(v[x++] = p & 255)),
v
)
}
function u(f) {
return n[(f >> 18) & 63] + n[(f >> 12) & 63] + n[(f >> 6) & 63] + n[f & 63]
}
function d(f, p, g) {
for (var y, m = [], v = p; v < g; v += 3)
((y = ((f[v] << 16) & 16711680) + ((f[v + 1] << 8) & 65280) + (f[v + 2] & 255)), m.push(u(y)))
return m.join('')
}
function h(f) {
for (var p, g = f.length, y = g % 3, m = [], v = 16383, x = 0, _ = g - y; x < _; x += v)
m.push(d(f, x, x + v > _ ? _ : x + v))
return (
y === 1
? ((p = f[g - 1]), m.push(n[p >> 2] + n[(p << 4) & 63] + '=='))
: y === 2 &&
((p = (f[g - 2] << 8) + f[g - 1]),
m.push(n[p >> 10] + n[(p >> 4) & 63] + n[(p << 2) & 63] + '=')),
m.join('')
)
}
return td
}
d5()
var rg = {},
_f = {}
/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh */ var hS
function cN() {
return (
hS ||
((hS = 1),
(_f.read = function (n, e, t, i, r) {
var s,
o,
a = r * 8 - i - 1,
l = (1 << a) - 1,
c = l >> 1,
u = -7,
d = t ? r - 1 : 0,
h = t ? -1 : 1,
f = n[e + d]
for (
d += h, s = f & ((1 << -u) - 1), f >>= -u, u += a;
u > 0;
s = s * 256 + n[e + d], d += h, u -= 8
);
for (
o = s & ((1 << -u) - 1), s >>= -u, u += i;
u > 0;
o = o * 256 + n[e + d], d += h, u -= 8
);
if (s === 0) s = 1 - c
else {
if (s === l) return o ? NaN : (f ? -1 : 1) * (1 / 0)
;((o = o + Math.pow(2, i)), (s = s - c))
}
return (f ? -1 : 1) * o * Math.pow(2, s - i)
}),
(_f.write = function (n, e, t, i, r, s) {
var o,
a,
l,
c = s * 8 - r - 1,
u = (1 << c) - 1,
d = u >> 1,
h = r === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0,
f = i ? 0 : s - 1,
p = i ? 1 : -1,
g = e < 0 || (e === 0 && 1 / e < 0) ? 1 : 0
for (
e = Math.abs(e),
isNaN(e) || e === 1 / 0
? ((a = isNaN(e) ? 1 : 0), (o = u))
: ((o = Math.floor(Math.log(e) / Math.LN2)),
e * (l = Math.pow(2, -o)) < 1 && (o--, (l *= 2)),
o + d >= 1 ? (e += h / l) : (e += h * Math.pow(2, 1 - d)),
e * l >= 2 && (o++, (l /= 2)),
o + d >= u
? ((a = 0), (o = u))
: o + d >= 1
? ((a = (e * l - 1) * Math.pow(2, r)), (o = o + d))
: ((a = e * Math.pow(2, d - 1) * Math.pow(2, r)), (o = 0)));
r >= 8;
n[t + f] = a & 255, f += p, a /= 256, r -= 8
);
for (o = (o << r) | a, c += r; c > 0; n[t + f] = o & 255, f += p, o /= 256, c -= 8);
n[t + f - p] |= g * 128
})),
_f
)
}
/*!
* The buffer module from node.js, for the browser.
*
* @author Feross Aboukhadijeh
* @license MIT
*/ var fS
function h5() {
return (
fS ||
((fS = 1),
(function (n) {
const e = d5(),
t = cN(),
i =
typeof Symbol == 'function' && typeof Symbol.for == 'function'
? Symbol.for('nodejs.util.inspect.custom')
: null
;((n.Buffer = a), (n.SlowBuffer = v), (n.INSPECT_MAX_BYTES = 50))
const r = 2147483647
;((n.kMaxLength = r),
(a.TYPED_ARRAY_SUPPORT = s()),
!a.TYPED_ARRAY_SUPPORT &&
typeof console < 'u' &&
typeof console.error == 'function' &&
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.'
))
function s() {
try {
const z = new Uint8Array(1),
E = {
foo: function () {
return 42
},
}
return (
Object.setPrototypeOf(E, Uint8Array.prototype),
Object.setPrototypeOf(z, E),
z.foo() === 42
)
} catch (z) {
return !1
}
}
;(Object.defineProperty(a.prototype, 'parent', {
enumerable: !0,
get: function () {
if (a.isBuffer(this)) return this.buffer
},
}),
Object.defineProperty(a.prototype, 'offset', {
enumerable: !0,
get: function () {
if (a.isBuffer(this)) return this.byteOffset
},
}))
function o(z) {
if (z > r) throw new RangeError('The value "' + z + '" is invalid for option "size"')
const E = new Uint8Array(z)
return (Object.setPrototypeOf(E, a.prototype), E)
}
function a(z, E, N) {
if (typeof z == 'number') {
if (typeof E == 'string')
throw new TypeError(
'The "string" argument must be of type string. Received type number'
)
return d(z)
}
return l(z, E, N)
}
a.poolSize = 8192
function l(z, E, N) {
if (typeof z == 'string') return h(z, E)
if (ArrayBuffer.isView(z)) return p(z)
if (z == null)
throw new TypeError(
'The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type ' +
typeof z
)
if (
D(z, ArrayBuffer) ||
(z && D(z.buffer, ArrayBuffer)) ||
(typeof SharedArrayBuffer < 'u' &&
(D(z, SharedArrayBuffer) || (z && D(z.buffer, SharedArrayBuffer))))
)
return g(z, E, N)
if (typeof z == 'number')
throw new TypeError(
'The "value" argument must not be of type number. Received type number'
)
const q = z.valueOf && z.valueOf()
if (q != null && q !== z) return a.from(q, E, N)
const Z = y(z)
if (Z) return Z
if (
typeof Symbol < 'u' &&
Symbol.toPrimitive != null &&
typeof z[Symbol.toPrimitive] == 'function'
)
return a.from(z[Symbol.toPrimitive]('string'), E, N)
throw new TypeError(
'The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type ' +
typeof z
)
}
;((a.from = function (z, E, N) {
return l(z, E, N)
}),
Object.setPrototypeOf(a.prototype, Uint8Array.prototype),
Object.setPrototypeOf(a, Uint8Array))
function c(z) {
if (typeof z != 'number') throw new TypeError('"size" argument must be of type number')
if (z < 0) throw new RangeError('The value "' + z + '" is invalid for option "size"')
}
function u(z, E, N) {
return (
c(z),
z <= 0
? o(z)
: E !== void 0
? typeof N == 'string'
? o(z).fill(E, N)
: o(z).fill(E)
: o(z)
)
}
a.alloc = function (z, E, N) {
return u(z, E, N)
}
function d(z) {
return (c(z), o(z < 0 ? 0 : m(z) | 0))
}
;((a.allocUnsafe = function (z) {
return d(z)
}),
(a.allocUnsafeSlow = function (z) {
return d(z)
}))
function h(z, E) {
if (((typeof E != 'string' || E === '') && (E = 'utf8'), !a.isEncoding(E)))
throw new TypeError('Unknown encoding: ' + E)
const N = x(z, E) | 0
let q = o(N)
const Z = q.write(z, E)
return (Z !== N && (q = q.slice(0, Z)), q)
}
function f(z) {
const E = z.length < 0 ? 0 : m(z.length) | 0,
N = o(E)
for (let q = 0; q < E; q += 1) N[q] = z[q] & 255
return N
}
function p(z) {
if (D(z, Uint8Array)) {
const E = new Uint8Array(z)
return g(E.buffer, E.byteOffset, E.byteLength)
}
return f(z)
}
function g(z, E, N) {
if (E < 0 || z.byteLength < E)
throw new RangeError('"offset" is outside of buffer bounds')
if (z.byteLength < E + (N || 0))
throw new RangeError('"length" is outside of buffer bounds')
let q
return (
E === void 0 && N === void 0
? (q = new Uint8Array(z))
: N === void 0
? (q = new Uint8Array(z, E))
: (q = new Uint8Array(z, E, N)),
Object.setPrototypeOf(q, a.prototype),
q
)
}
function y(z) {
if (a.isBuffer(z)) {
const E = m(z.length) | 0,
N = o(E)
return (N.length === 0 || z.copy(N, 0, 0, E), N)
}
if (z.length !== void 0) return typeof z.length != 'number' || W(z.length) ? o(0) : f(z)
if (z.type === 'Buffer' && Array.isArray(z.data)) return f(z.data)
}
function m(z) {
if (z >= r)
throw new RangeError(
'Attempt to allocate Buffer larger than maximum size: 0x' + r.toString(16) + ' bytes'
)
return z | 0
}
function v(z) {
return (+z != z && (z = 0), a.alloc(+z))
}
;((a.isBuffer = function (E) {
return E != null && E._isBuffer === !0 && E !== a.prototype
}),
(a.compare = function (E, N) {
if (
(D(E, Uint8Array) && (E = a.from(E, E.offset, E.byteLength)),
D(N, Uint8Array) && (N = a.from(N, N.offset, N.byteLength)),
!a.isBuffer(E) || !a.isBuffer(N))
)
throw new TypeError(
'The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array'
)
if (E === N) return 0
let q = E.length,
Z = N.length
for (let $ = 0, ae = Math.min(q, Z); $ < ae; ++$)
if (E[$] !== N[$]) {
;((q = E[$]), (Z = N[$]))
break
}
return q < Z ? -1 : Z < q ? 1 : 0
}),
(a.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
}
}),
(a.concat = function (E, N) {
if (!Array.isArray(E))
throw new TypeError('"list" argument must be an Array of Buffers')
if (E.length === 0) return a.alloc(0)
let q
if (N === void 0) for (N = 0, q = 0; q < E.length; ++q) N += E[q].length
const Z = a.allocUnsafe(N)
let $ = 0
for (q = 0; q < E.length; ++q) {
let ae = E[q]
if (D(ae, Uint8Array))
$ + ae.length > Z.length
? (a.isBuffer(ae) || (ae = a.from(ae)), ae.copy(Z, $))
: Uint8Array.prototype.set.call(Z, ae, $)
else if (a.isBuffer(ae)) ae.copy(Z, $)
else throw new TypeError('"list" argument must be an Array of Buffers')
$ += ae.length
}
return Z
}))
function x(z, E) {
if (a.isBuffer(z)) return z.length
if (ArrayBuffer.isView(z) || D(z, ArrayBuffer)) return z.byteLength
if (typeof z != 'string')
throw new TypeError(
'The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type ' +
typeof z
)
const N = z.length,
q = arguments.length > 2 && arguments[2] === !0
if (!q && N === 0) return 0
let Z = !1
for (;;)
switch (E) {
case 'ascii':
case 'latin1':
case 'binary':
return N
case 'utf8':
case 'utf-8':
return H(z).length
case 'ucs2':
case 'ucs-2':
case 'utf16le':
case 'utf-16le':
return N * 2
case 'hex':
return N >>> 1
case 'base64':
return j(z).length
default:
if (Z) return q ? -1 : H(z).length
;((E = ('' + E).toLowerCase()), (Z = !0))
}
}
a.byteLength = x
function _(z, E, N) {
let q = !1
if (
((E === void 0 || E < 0) && (E = 0),
E > this.length ||
((N === void 0 || N > this.length) && (N = this.length), N <= 0) ||
((N >>>= 0), (E >>>= 0), N <= E))
)
return ''
for (z || (z = 'utf8'); ; )
switch (z) {
case 'hex':
return se(this, E, N)
case 'utf8':
case 'utf-8':
return T(this, E, N)
case 'ascii':
return Q(this, E, N)
case 'latin1':
case 'binary':
return ee(this, E, N)
case 'base64':
return U(this, E, N)
case 'ucs2':
case 'ucs-2':
case 'utf16le':
case 'utf-16le':
return he(this, E, N)
default:
if (q) throw new TypeError('Unknown encoding: ' + z)
;((z = (z + '').toLowerCase()), (q = !0))
}
}
a.prototype._isBuffer = !0
function S(z, E, N) {
const q = z[E]
;((z[E] = z[N]), (z[N] = q))
}
;((a.prototype.swap16 = function () {
const E = this.length
if (E % 2 !== 0) throw new RangeError('Buffer size must be a multiple of 16-bits')
for (let N = 0; N < E; N += 2) S(this, N, N + 1)
return this
}),
(a.prototype.swap32 = function () {
const E = this.length
if (E % 4 !== 0) throw new RangeError('Buffer size must be a multiple of 32-bits')
for (let N = 0; N < E; N += 4) (S(this, N, N + 3), S(this, N + 1, N + 2))
return this
}),
(a.prototype.swap64 = function () {
const E = this.length
if (E % 8 !== 0) throw new RangeError('Buffer size must be a multiple of 64-bits')
for (let N = 0; N < E; N += 8)
(S(this, N, N + 7),
S(this, N + 1, N + 6),
S(this, N + 2, N + 5),
S(this, N + 3, N + 4))
return this
}),
(a.prototype.toString = function () {
const E = this.length
return E === 0 ? '' : arguments.length === 0 ? T(this, 0, E) : _.apply(this, arguments)
}),
(a.prototype.toLocaleString = a.prototype.toString),
(a.prototype.equals = function (E) {
if (!a.isBuffer(E)) throw new TypeError('Argument must be a Buffer')
return this === E ? !0 : a.compare(this, E) === 0
}),
(a.prototype.inspect = function () {
let E = ''
const N = n.INSPECT_MAX_BYTES
return (
(E = this.toString('hex', 0, N)
.replace(/(.{2})/g, '$1 ')
.trim()),
this.length > N && (E += ' ... '),
''
)
}),
i && (a.prototype[i] = a.prototype.inspect),
(a.prototype.compare = function (E, N, q, Z, $) {
if ((D(E, Uint8Array) && (E = a.from(E, E.offset, E.byteLength)), !a.isBuffer(E)))
throw new TypeError(
'The "target" argument must be one of type Buffer or Uint8Array. Received type ' +
typeof E
)
if (
(N === void 0 && (N = 0),
q === void 0 && (q = E ? E.length : 0),
Z === void 0 && (Z = 0),
$ === void 0 && ($ = this.length),
N < 0 || q > E.length || Z < 0 || $ > this.length)
)
throw new RangeError('out of range index')
if (Z >= $ && N >= q) return 0
if (Z >= $) return -1
if (N >= q) return 1
if (((N >>>= 0), (q >>>= 0), (Z >>>= 0), ($ >>>= 0), this === E)) return 0
let ae = $ - Z,
Ue = q - N
const Le = Math.min(ae, Ue),
Ve = this.slice(Z, $),
Je = E.slice(N, q)
for (let st = 0; st < Le; ++st)
if (Ve[st] !== Je[st]) {
;((ae = Ve[st]), (Ue = Je[st]))
break
}
return ae < Ue ? -1 : Ue < ae ? 1 : 0
}))
function C(z, E, N, q, Z) {
if (z.length === 0) return -1
if (
(typeof N == 'string'
? ((q = N), (N = 0))
: N > 2147483647
? (N = 2147483647)
: N < -2147483648 && (N = -2147483648),
(N = +N),
W(N) && (N = Z ? 0 : z.length - 1),
N < 0 && (N = z.length + N),
N >= z.length)
) {
if (Z) return -1
N = z.length - 1
} else if (N < 0)
if (Z) N = 0
else return -1
if ((typeof E == 'string' && (E = a.from(E, q)), a.isBuffer(E)))
return E.length === 0 ? -1 : A(z, E, N, q, Z)
if (typeof E == 'number')
return (
(E = E & 255),
typeof Uint8Array.prototype.indexOf == 'function'
? Z
? Uint8Array.prototype.indexOf.call(z, E, N)
: Uint8Array.prototype.lastIndexOf.call(z, E, N)
: A(z, [E], N, q, Z)
)
throw new TypeError('val must be string, number or Buffer')
}
function A(z, E, N, q, Z) {
let $ = 1,
ae = z.length,
Ue = E.length
if (
q !== void 0 &&
((q = String(q).toLowerCase()),
q === 'ucs2' || q === 'ucs-2' || q === 'utf16le' || q === 'utf-16le')
) {
if (z.length < 2 || E.length < 2) return -1
;(($ = 2), (ae /= 2), (Ue /= 2), (N /= 2))
}
function Le(Je, st) {
return $ === 1 ? Je[st] : Je.readUInt16BE(st * $)
}
let Ve
if (Z) {
let Je = -1
for (Ve = N; Ve < ae; Ve++)
if (Le(z, Ve) === Le(E, Je === -1 ? 0 : Ve - Je)) {
if ((Je === -1 && (Je = Ve), Ve - Je + 1 === Ue)) return Je * $
} else (Je !== -1 && (Ve -= Ve - Je), (Je = -1))
} else
for (N + Ue > ae && (N = ae - Ue), Ve = N; Ve >= 0; Ve--) {
let Je = !0
for (let st = 0; st < Ue; st++)
if (Le(z, Ve + st) !== Le(E, st)) {
Je = !1
break
}
if (Je) return Ve
}
return -1
}
;((a.prototype.includes = function (E, N, q) {
return this.indexOf(E, N, q) !== -1
}),
(a.prototype.indexOf = function (E, N, q) {
return C(this, E, N, q, !0)
}),
(a.prototype.lastIndexOf = function (E, N, q) {
return C(this, E, N, q, !1)
}))
function R(z, E, N, q) {
N = Number(N) || 0
const Z = z.length - N
q ? ((q = Number(q)), q > Z && (q = Z)) : (q = Z)
const $ = E.length
q > $ / 2 && (q = $ / 2)
let ae
for (ae = 0; ae < q; ++ae) {
const Ue = parseInt(E.substr(ae * 2, 2), 16)
if (W(Ue)) return ae
z[N + ae] = Ue
}
return ae
}
function w(z, E, N, q) {
return B(H(E, z.length - N), z, N, q)
}
function M(z, E, N, q) {
return B(P(E), z, N, q)
}
function I(z, E, N, q) {
return B(j(E), z, N, q)
}
function L(z, E, N, q) {
return B(k(E, z.length - N), z, N, q)
}
;((a.prototype.write = function (E, N, q, Z) {
if (N === void 0) ((Z = 'utf8'), (q = this.length), (N = 0))
else if (q === void 0 && typeof N == 'string') ((Z = N), (q = this.length), (N = 0))
else if (isFinite(N))
((N = N >>> 0),
isFinite(q) ? ((q = q >>> 0), Z === void 0 && (Z = 'utf8')) : ((Z = q), (q = void 0)))
else
throw new Error(
'Buffer.write(string, encoding, offset[, length]) is no longer supported'
)
const $ = this.length - N
if (
((q === void 0 || q > $) && (q = $),
(E.length > 0 && (q < 0 || N < 0)) || N > this.length)
)
throw new RangeError('Attempt to write outside buffer bounds')
Z || (Z = 'utf8')
let ae = !1
for (;;)
switch (Z) {
case 'hex':
return R(this, E, N, q)
case 'utf8':
case 'utf-8':
return w(this, E, N, q)
case 'ascii':
case 'latin1':
case 'binary':
return M(this, E, N, q)
case 'base64':
return I(this, E, N, q)
case 'ucs2':
case 'ucs-2':
case 'utf16le':
case 'utf-16le':
return L(this, E, N, q)
default:
if (ae) throw new TypeError('Unknown encoding: ' + Z)
;((Z = ('' + Z).toLowerCase()), (ae = !0))
}
}),
(a.prototype.toJSON = function () {
return { type: 'Buffer', data: Array.prototype.slice.call(this._arr || this, 0) }
}))
function U(z, E, N) {
return E === 0 && N === z.length ? e.fromByteArray(z) : e.fromByteArray(z.slice(E, N))
}
function T(z, E, N) {
N = Math.min(z.length, N)
const q = []
let Z = E
for (; Z < N; ) {
const $ = z[Z]
let ae = null,
Ue = $ > 239 ? 4 : $ > 223 ? 3 : $ > 191 ? 2 : 1
if (Z + Ue <= N) {
let Le, Ve, Je, st
switch (Ue) {
case 1:
$ < 128 && (ae = $)
break
case 2:
;((Le = z[Z + 1]),
(Le & 192) === 128 &&
((st = (($ & 31) << 6) | (Le & 63)), st > 127 && (ae = st)))
break
case 3:
;((Le = z[Z + 1]),
(Ve = z[Z + 2]),
(Le & 192) === 128 &&
(Ve & 192) === 128 &&
((st = (($ & 15) << 12) | ((Le & 63) << 6) | (Ve & 63)),
st > 2047 && (st < 55296 || st > 57343) && (ae = st)))
break
case 4:
;((Le = z[Z + 1]),
(Ve = z[Z + 2]),
(Je = z[Z + 3]),
(Le & 192) === 128 &&
(Ve & 192) === 128 &&
(Je & 192) === 128 &&
((st = (($ & 15) << 18) | ((Le & 63) << 12) | ((Ve & 63) << 6) | (Je & 63)),
st > 65535 && st < 1114112 && (ae = st)))
}
}
;(ae === null
? ((ae = 65533), (Ue = 1))
: ae > 65535 &&
((ae -= 65536), q.push(((ae >>> 10) & 1023) | 55296), (ae = 56320 | (ae & 1023))),
q.push(ae),
(Z += Ue))
}
return V(q)
}
const F = 4096
function V(z) {
const E = z.length
if (E <= F) return String.fromCharCode.apply(String, z)
let N = '',
q = 0
for (; q < E; ) N += String.fromCharCode.apply(String, z.slice(q, (q += F)))
return N
}
function Q(z, E, N) {
let q = ''
N = Math.min(z.length, N)
for (let Z = E; Z < N; ++Z) q += String.fromCharCode(z[Z] & 127)
return q
}
function ee(z, E, N) {
let q = ''
N = Math.min(z.length, N)
for (let Z = E; Z < N; ++Z) q += String.fromCharCode(z[Z])
return q
}
function se(z, E, N) {
const q = z.length
;((!E || E < 0) && (E = 0), (!N || N < 0 || N > q) && (N = q))
let Z = ''
for (let $ = E; $ < N; ++$) Z += G[z[$]]
return Z
}
function he(z, E, N) {
const q = z.slice(E, N)
let Z = ''
for (let $ = 0; $ < q.length - 1; $ += 2) Z += String.fromCharCode(q[$] + q[$ + 1] * 256)
return Z
}
a.prototype.slice = function (E, N) {
const q = this.length
;((E = ~~E),
(N = N === void 0 ? q : ~~N),
E < 0 ? ((E += q), E < 0 && (E = 0)) : E > q && (E = q),
N < 0 ? ((N += q), N < 0 && (N = 0)) : N > q && (N = q),
N < E && (N = E))
const Z = this.subarray(E, N)
return (Object.setPrototypeOf(Z, a.prototype), Z)
}
function ie(z, E, N) {
if (z % 1 !== 0 || z < 0) throw new RangeError('offset is not uint')
if (z + E > N) throw new RangeError('Trying to access beyond buffer length')
}
;((a.prototype.readUintLE = a.prototype.readUIntLE =
function (E, N, q) {
;((E = E >>> 0), (N = N >>> 0), q || ie(E, N, this.length))
let Z = this[E],
$ = 1,
ae = 0
for (; ++ae < N && ($ *= 256); ) Z += this[E + ae] * $
return Z
}),
(a.prototype.readUintBE = a.prototype.readUIntBE =
function (E, N, q) {
;((E = E >>> 0), (N = N >>> 0), q || ie(E, N, this.length))
let Z = this[E + --N],
$ = 1
for (; N > 0 && ($ *= 256); ) Z += this[E + --N] * $
return Z
}),
(a.prototype.readUint8 = a.prototype.readUInt8 =
function (E, N) {
return ((E = E >>> 0), N || ie(E, 1, this.length), this[E])
}),
(a.prototype.readUint16LE = a.prototype.readUInt16LE =
function (E, N) {
return ((E = E >>> 0), N || ie(E, 2, this.length), this[E] | (this[E + 1] << 8))
}),
(a.prototype.readUint16BE = a.prototype.readUInt16BE =
function (E, N) {
return ((E = E >>> 0), N || ie(E, 2, this.length), (this[E] << 8) | this[E + 1])
}),
(a.prototype.readUint32LE = a.prototype.readUInt32LE =
function (E, N) {
return (
(E = E >>> 0),
N || ie(E, 4, this.length),
(this[E] | (this[E + 1] << 8) | (this[E + 2] << 16)) + this[E + 3] * 16777216
)
}),
(a.prototype.readUint32BE = a.prototype.readUInt32BE =
function (E, N) {
return (
(E = E >>> 0),
N || ie(E, 4, this.length),
this[E] * 16777216 + ((this[E + 1] << 16) | (this[E + 2] << 8) | this[E + 3])
)
}),
(a.prototype.readBigUInt64LE = X(function (E) {
;((E = E >>> 0), ne(E, 'offset'))
const N = this[E],
q = this[E + 7]
;(N === void 0 || q === void 0) && b(E, this.length - 8)
const Z = N + this[++E] * 2 ** 8 + this[++E] * 2 ** 16 + this[++E] * 2 ** 24,
$ = this[++E] + this[++E] * 2 ** 8 + this[++E] * 2 ** 16 + q * 2 ** 24
return BigInt(Z) + (BigInt($) << BigInt(32))
})),
(a.prototype.readBigUInt64BE = X(function (E) {
;((E = E >>> 0), ne(E, 'offset'))
const N = this[E],
q = this[E + 7]
;(N === void 0 || q === void 0) && b(E, this.length - 8)
const Z = N * 2 ** 24 + this[++E] * 2 ** 16 + this[++E] * 2 ** 8 + this[++E],
$ = this[++E] * 2 ** 24 + this[++E] * 2 ** 16 + this[++E] * 2 ** 8 + q
return (BigInt(Z) << BigInt(32)) + BigInt($)
})),
(a.prototype.readIntLE = function (E, N, q) {
;((E = E >>> 0), (N = N >>> 0), q || ie(E, N, this.length))
let Z = this[E],
$ = 1,
ae = 0
for (; ++ae < N && ($ *= 256); ) Z += this[E + ae] * $
return (($ *= 128), Z >= $ && (Z -= Math.pow(2, 8 * N)), Z)
}),
(a.prototype.readIntBE = function (E, N, q) {
;((E = E >>> 0), (N = N >>> 0), q || ie(E, N, this.length))
let Z = N,
$ = 1,
ae = this[E + --Z]
for (; Z > 0 && ($ *= 256); ) ae += this[E + --Z] * $
return (($ *= 128), ae >= $ && (ae -= Math.pow(2, 8 * N)), ae)
}),
(a.prototype.readInt8 = function (E, N) {
return (
(E = E >>> 0),
N || ie(E, 1, this.length),
this[E] & 128 ? (255 - this[E] + 1) * -1 : this[E]
)
}),
(a.prototype.readInt16LE = function (E, N) {
;((E = E >>> 0), N || ie(E, 2, this.length))
const q = this[E] | (this[E + 1] << 8)
return q & 32768 ? q | 4294901760 : q
}),
(a.prototype.readInt16BE = function (E, N) {
;((E = E >>> 0), N || ie(E, 2, this.length))
const q = this[E + 1] | (this[E] << 8)
return q & 32768 ? q | 4294901760 : q
}),
(a.prototype.readInt32LE = function (E, N) {
return (
(E = E >>> 0),
N || ie(E, 4, this.length),
this[E] | (this[E + 1] << 8) | (this[E + 2] << 16) | (this[E + 3] << 24)
)
}),
(a.prototype.readInt32BE = function (E, N) {
return (
(E = E >>> 0),
N || ie(E, 4, this.length),
(this[E] << 24) | (this[E + 1] << 16) | (this[E + 2] << 8) | this[E + 3]
)
}),
(a.prototype.readBigInt64LE = X(function (E) {
;((E = E >>> 0), ne(E, 'offset'))
const N = this[E],
q = this[E + 7]
;(N === void 0 || q === void 0) && b(E, this.length - 8)
const Z = this[E + 4] + this[E + 5] * 2 ** 8 + this[E + 6] * 2 ** 16 + (q << 24)
return (
(BigInt(Z) << BigInt(32)) +
BigInt(N + this[++E] * 2 ** 8 + this[++E] * 2 ** 16 + this[++E] * 2 ** 24)
)
})),
(a.prototype.readBigInt64BE = X(function (E) {
;((E = E >>> 0), ne(E, 'offset'))
const N = this[E],
q = this[E + 7]
;(N === void 0 || q === void 0) && b(E, this.length - 8)
const Z = (N << 24) + this[++E] * 2 ** 16 + this[++E] * 2 ** 8 + this[++E]
return (
(BigInt(Z) << BigInt(32)) +
BigInt(this[++E] * 2 ** 24 + this[++E] * 2 ** 16 + this[++E] * 2 ** 8 + q)
)
})),
(a.prototype.readFloatLE = function (E, N) {
return ((E = E >>> 0), N || ie(E, 4, this.length), t.read(this, E, !0, 23, 4))
}),
(a.prototype.readFloatBE = function (E, N) {
return ((E = E >>> 0), N || ie(E, 4, this.length), t.read(this, E, !1, 23, 4))
}),
(a.prototype.readDoubleLE = function (E, N) {
return ((E = E >>> 0), N || ie(E, 8, this.length), t.read(this, E, !0, 52, 8))
}),
(a.prototype.readDoubleBE = function (E, N) {
return ((E = E >>> 0), N || ie(E, 8, this.length), t.read(this, E, !1, 52, 8))
}))
function re(z, E, N, q, Z, $) {
if (!a.isBuffer(z)) throw new TypeError('"buffer" argument must be a Buffer instance')
if (E > Z || E < $) throw new RangeError('"value" argument is out of bounds')
if (N + q > z.length) throw new RangeError('Index out of range')
}
;((a.prototype.writeUintLE = a.prototype.writeUIntLE =
function (E, N, q, Z) {
if (((E = +E), (N = N >>> 0), (q = q >>> 0), !Z)) {
const Ue = Math.pow(2, 8 * q) - 1
re(this, E, N, q, Ue, 0)
}
let $ = 1,
ae = 0
for (this[N] = E & 255; ++ae < q && ($ *= 256); ) this[N + ae] = (E / $) & 255
return N + q
}),
(a.prototype.writeUintBE = a.prototype.writeUIntBE =
function (E, N, q, Z) {
if (((E = +E), (N = N >>> 0), (q = q >>> 0), !Z)) {
const Ue = Math.pow(2, 8 * q) - 1
re(this, E, N, q, Ue, 0)
}
let $ = q - 1,
ae = 1
for (this[N + $] = E & 255; --$ >= 0 && (ae *= 256); ) this[N + $] = (E / ae) & 255
return N + q
}),
(a.prototype.writeUint8 = a.prototype.writeUInt8 =
function (E, N, q) {
return (
(E = +E),
(N = N >>> 0),
q || re(this, E, N, 1, 255, 0),
(this[N] = E & 255),
N + 1
)
}),
(a.prototype.writeUint16LE = a.prototype.writeUInt16LE =
function (E, N, q) {
return (
(E = +E),
(N = N >>> 0),
q || re(this, E, N, 2, 65535, 0),
(this[N] = E & 255),
(this[N + 1] = E >>> 8),
N + 2
)
}),
(a.prototype.writeUint16BE = a.prototype.writeUInt16BE =
function (E, N, q) {
return (
(E = +E),
(N = N >>> 0),
q || re(this, E, N, 2, 65535, 0),
(this[N] = E >>> 8),
(this[N + 1] = E & 255),
N + 2
)
}),
(a.prototype.writeUint32LE = a.prototype.writeUInt32LE =
function (E, N, q) {
return (
(E = +E),
(N = N >>> 0),
q || re(this, E, N, 4, 4294967295, 0),
(this[N + 3] = E >>> 24),
(this[N + 2] = E >>> 16),
(this[N + 1] = E >>> 8),
(this[N] = E & 255),
N + 4
)
}),
(a.prototype.writeUint32BE = a.prototype.writeUInt32BE =
function (E, N, q) {
return (
(E = +E),
(N = N >>> 0),
q || re(this, E, N, 4, 4294967295, 0),
(this[N] = E >>> 24),
(this[N + 1] = E >>> 16),
(this[N + 2] = E >>> 8),
(this[N + 3] = E & 255),
N + 4
)
}))
function Te(z, E, N, q, Z) {
te(E, q, Z, z, N, 7)
let $ = Number(E & BigInt(4294967295))
;((z[N++] = $),
($ = $ >> 8),
(z[N++] = $),
($ = $ >> 8),
(z[N++] = $),
($ = $ >> 8),
(z[N++] = $))
let ae = Number((E >> BigInt(32)) & BigInt(4294967295))
return (
(z[N++] = ae),
(ae = ae >> 8),
(z[N++] = ae),
(ae = ae >> 8),
(z[N++] = ae),
(ae = ae >> 8),
(z[N++] = ae),
N
)
}
function le(z, E, N, q, Z) {
te(E, q, Z, z, N, 7)
let $ = Number(E & BigInt(4294967295))
;((z[N + 7] = $),
($ = $ >> 8),
(z[N + 6] = $),
($ = $ >> 8),
(z[N + 5] = $),
($ = $ >> 8),
(z[N + 4] = $))
let ae = Number((E >> BigInt(32)) & BigInt(4294967295))
return (
(z[N + 3] = ae),
(ae = ae >> 8),
(z[N + 2] = ae),
(ae = ae >> 8),
(z[N + 1] = ae),
(ae = ae >> 8),
(z[N] = ae),
N + 8
)
}
;((a.prototype.writeBigUInt64LE = X(function (E, N = 0) {
return Te(this, E, N, BigInt(0), BigInt('0xffffffffffffffff'))
})),
(a.prototype.writeBigUInt64BE = X(function (E, N = 0) {
return le(this, E, N, BigInt(0), BigInt('0xffffffffffffffff'))
})),
(a.prototype.writeIntLE = function (E, N, q, Z) {
if (((E = +E), (N = N >>> 0), !Z)) {
const Le = Math.pow(2, 8 * q - 1)
re(this, E, N, q, Le - 1, -Le)
}
let $ = 0,
ae = 1,
Ue = 0
for (this[N] = E & 255; ++$ < q && (ae *= 256); )
(E < 0 && Ue === 0 && this[N + $ - 1] !== 0 && (Ue = 1),
(this[N + $] = (((E / ae) >> 0) - Ue) & 255))
return N + q
}),
(a.prototype.writeIntBE = function (E, N, q, Z) {
if (((E = +E), (N = N >>> 0), !Z)) {
const Le = Math.pow(2, 8 * q - 1)
re(this, E, N, q, Le - 1, -Le)
}
let $ = q - 1,
ae = 1,
Ue = 0
for (this[N + $] = E & 255; --$ >= 0 && (ae *= 256); )
(E < 0 && Ue === 0 && this[N + $ + 1] !== 0 && (Ue = 1),
(this[N + $] = (((E / ae) >> 0) - Ue) & 255))
return N + q
}),
(a.prototype.writeInt8 = function (E, N, q) {
return (
(E = +E),
(N = N >>> 0),
q || re(this, E, N, 1, 127, -128),
E < 0 && (E = 255 + E + 1),
(this[N] = E & 255),
N + 1
)
}),
(a.prototype.writeInt16LE = function (E, N, q) {
return (
(E = +E),
(N = N >>> 0),
q || re(this, E, N, 2, 32767, -32768),
(this[N] = E & 255),
(this[N + 1] = E >>> 8),
N + 2
)
}),
(a.prototype.writeInt16BE = function (E, N, q) {
return (
(E = +E),
(N = N >>> 0),
q || re(this, E, N, 2, 32767, -32768),
(this[N] = E >>> 8),
(this[N + 1] = E & 255),
N + 2
)
}),
(a.prototype.writeInt32LE = function (E, N, q) {
return (
(E = +E),
(N = N >>> 0),
q || re(this, E, N, 4, 2147483647, -2147483648),
(this[N] = E & 255),
(this[N + 1] = E >>> 8),
(this[N + 2] = E >>> 16),
(this[N + 3] = E >>> 24),
N + 4
)
}),
(a.prototype.writeInt32BE = function (E, N, q) {
return (
(E = +E),
(N = N >>> 0),
q || re(this, E, N, 4, 2147483647, -2147483648),
E < 0 && (E = 4294967295 + E + 1),
(this[N] = E >>> 24),
(this[N + 1] = E >>> 16),
(this[N + 2] = E >>> 8),
(this[N + 3] = E & 255),
N + 4
)
}),
(a.prototype.writeBigInt64LE = X(function (E, N = 0) {
return Te(this, E, N, -BigInt('0x8000000000000000'), BigInt('0x7fffffffffffffff'))
})),
(a.prototype.writeBigInt64BE = X(function (E, N = 0) {
return le(this, E, N, -BigInt('0x8000000000000000'), BigInt('0x7fffffffffffffff'))
})))
function fe(z, E, N, q, Z, $) {
if (N + q > z.length) throw new RangeError('Index out of range')
if (N < 0) throw new RangeError('Index out of range')
}
function we(z, E, N, q, Z) {
return ((E = +E), (N = N >>> 0), Z || fe(z, E, N, 4), t.write(z, E, N, q, 23, 4), N + 4)
}
;((a.prototype.writeFloatLE = function (E, N, q) {
return we(this, E, N, !0, q)
}),
(a.prototype.writeFloatBE = function (E, N, q) {
return we(this, E, N, !1, q)
}))
function Ee(z, E, N, q, Z) {
return ((E = +E), (N = N >>> 0), Z || fe(z, E, N, 8), t.write(z, E, N, q, 52, 8), N + 8)
}
;((a.prototype.writeDoubleLE = function (E, N, q) {
return Ee(this, E, N, !0, q)
}),
(a.prototype.writeDoubleBE = function (E, N, q) {
return Ee(this, E, N, !1, q)
}),
(a.prototype.copy = function (E, N, q, Z) {
if (!a.isBuffer(E)) throw new TypeError('argument should be a Buffer')
if (
(q || (q = 0),
!Z && Z !== 0 && (Z = this.length),
N >= E.length && (N = E.length),
N || (N = 0),
Z > 0 && Z < q && (Z = q),
Z === q || E.length === 0 || this.length === 0)
)
return 0
if (N < 0) throw new RangeError('targetStart out of bounds')
if (q < 0 || q >= this.length) throw new RangeError('Index out of range')
if (Z < 0) throw new RangeError('sourceEnd out of bounds')
;(Z > this.length && (Z = this.length), E.length - N < Z - q && (Z = E.length - N + q))
const $ = Z - q
return (
this === E && typeof Uint8Array.prototype.copyWithin == 'function'
? this.copyWithin(N, q, Z)
: Uint8Array.prototype.set.call(E, this.subarray(q, Z), N),
$
)
}),
(a.prototype.fill = function (E, N, q, Z) {
if (typeof E == 'string') {
if (
(typeof N == 'string'
? ((Z = N), (N = 0), (q = this.length))
: typeof q == 'string' && ((Z = q), (q = this.length)),
Z !== void 0 && typeof Z != 'string')
)
throw new TypeError('encoding must be a string')
if (typeof Z == 'string' && !a.isEncoding(Z))
throw new TypeError('Unknown encoding: ' + Z)
if (E.length === 1) {
const ae = E.charCodeAt(0)
;((Z === 'utf8' && ae < 128) || Z === 'latin1') && (E = ae)
}
} else typeof E == 'number' ? (E = E & 255) : typeof E == 'boolean' && (E = Number(E))
if (N < 0 || this.length < N || this.length < q)
throw new RangeError('Out of range index')
if (q <= N) return this
;((N = N >>> 0), (q = q === void 0 ? this.length : q >>> 0), E || (E = 0))
let $
if (typeof E == 'number') for ($ = N; $ < q; ++$) this[$] = E
else {
const ae = a.isBuffer(E) ? E : a.from(E, Z),
Ue = ae.length
if (Ue === 0)
throw new TypeError('The value "' + E + '" is invalid for argument "value"')
for ($ = 0; $ < q - N; ++$) this[$ + N] = ae[$ % Ue]
}
return this
}))
const Ie = {}
function ze(z, E, N) {
Ie[z] = class extends N {
constructor() {
;(super(),
Object.defineProperty(this, 'message', {
value: E.apply(this, arguments),
writable: !0,
configurable: !0,
}),
(this.name = ''.concat(this.name, ' [').concat(z, ']')),
this.stack,
delete this.name)
}
get code() {
return z
}
set code(Z) {
Object.defineProperty(this, 'code', {
configurable: !0,
enumerable: !0,
value: Z,
writable: !0,
})
}
toString() {
return ''.concat(this.name, ' [').concat(z, ']: ').concat(this.message)
}
}
}
;(ze(
'ERR_BUFFER_OUT_OF_BOUNDS',
function (z) {
return z
? ''.concat(z, ' is outside of buffer bounds')
: 'Attempt to access memory outside buffer bounds'
},
RangeError
),
ze(
'ERR_INVALID_ARG_TYPE',
function (z, E) {
return 'The "'
.concat(z, '" argument must be of type number. Received type ')
.concat(typeof E)
},
TypeError
),
ze(
'ERR_OUT_OF_RANGE',
function (z, E, N) {
let q = 'The value of "'.concat(z, '" is out of range.'),
Z = N
return (
Number.isInteger(N) && Math.abs(N) > 2 ** 32
? (Z = Be(String(N)))
: typeof N == 'bigint' &&
((Z = String(N)),
(N > BigInt(2) ** BigInt(32) || N < -(BigInt(2) ** BigInt(32))) && (Z = Be(Z)),
(Z += 'n')),
(q += ' It must be '.concat(E, '. Received ').concat(Z)),
q
)
},
RangeError
))
function Be(z) {
let E = '',
N = z.length
const q = z[0] === '-' ? 1 : 0
for (; N >= q + 4; N -= 3) E = '_'.concat(z.slice(N - 3, N)).concat(E)
return ''.concat(z.slice(0, N)).concat(E)
}
function it(z, E, N) {
;(ne(E, 'offset'), (z[E] === void 0 || z[E + N] === void 0) && b(E, z.length - (N + 1)))
}
function te(z, E, N, q, Z, $) {
if (z > N || z < E) {
const ae = typeof E == 'bigint' ? 'n' : ''
let Ue
throw (
E === 0 || E === BigInt(0)
? (Ue = '>= 0'
.concat(ae, ' and < 2')
.concat(ae, ' ** ')
.concat(($ + 1) * 8)
.concat(ae))
: (Ue =
'>= -(2'
.concat(ae, ' ** ')
.concat(($ + 1) * 8 - 1)
.concat(ae, ') and < 2 ** ') + ''.concat(($ + 1) * 8 - 1).concat(ae)),
new Ie.ERR_OUT_OF_RANGE('value', Ue, z)
)
}
it(q, Z, $)
}
function ne(z, E) {
if (typeof z != 'number') throw new Ie.ERR_INVALID_ARG_TYPE(E, 'number', z)
}
function b(z, E, N) {
throw Math.floor(z) !== z
? (ne(z, N), new Ie.ERR_OUT_OF_RANGE('offset', 'an integer', z))
: E < 0
? new Ie.ERR_BUFFER_OUT_OF_BOUNDS()
: new Ie.ERR_OUT_OF_RANGE('offset', '>= 0 and <= '.concat(E), z)
}
const oe = /[^+/0-9A-Za-z-_]/g
function J(z) {
if (((z = z.split('=')[0]), (z = z.trim().replace(oe, '')), z.length < 2)) return ''
for (; z.length % 4 !== 0; ) z = z + '='
return z
}
function H(z, E) {
E = E || 1 / 0
let N
const q = z.length
let Z = null
const $ = []
for (let ae = 0; ae < q; ++ae) {
if (((N = z.charCodeAt(ae)), N > 55295 && N < 57344)) {
if (!Z) {
if (N > 56319) {
;(E -= 3) > -1 && $.push(239, 191, 189)
continue
} else if (ae + 1 === q) {
;(E -= 3) > -1 && $.push(239, 191, 189)
continue
}
Z = N
continue
}
if (N < 56320) {
;((E -= 3) > -1 && $.push(239, 191, 189), (Z = N))
continue
}
N = (((Z - 55296) << 10) | (N - 56320)) + 65536
} else Z && (E -= 3) > -1 && $.push(239, 191, 189)
if (((Z = null), N < 128)) {
if ((E -= 1) < 0) break
$.push(N)
} else if (N < 2048) {
if ((E -= 2) < 0) break
$.push((N >> 6) | 192, (N & 63) | 128)
} else if (N < 65536) {
if ((E -= 3) < 0) break
$.push((N >> 12) | 224, ((N >> 6) & 63) | 128, (N & 63) | 128)
} else if (N < 1114112) {
if ((E -= 4) < 0) break
$.push((N >> 18) | 240, ((N >> 12) & 63) | 128, ((N >> 6) & 63) | 128, (N & 63) | 128)
} else throw new Error('Invalid code point')
}
return $
}
function P(z) {
const E = []
for (let N = 0; N < z.length; ++N) E.push(z.charCodeAt(N) & 255)
return E
}
function k(z, E) {
let N, q, Z
const $ = []
for (let ae = 0; ae < z.length && !((E -= 2) < 0); ++ae)
((N = z.charCodeAt(ae)), (q = N >> 8), (Z = N % 256), $.push(Z), $.push(q))
return $
}
function j(z) {
return e.toByteArray(J(z))
}
function B(z, E, N, q) {
let Z
for (Z = 0; Z < q && !(Z + N >= E.length || Z >= z.length); ++Z) E[Z + N] = z[Z]
return Z
}
function D(z, E) {
return (
z instanceof E ||
(z != null &&
z.constructor != null &&
z.constructor.name != null &&
z.constructor.name === E.name)
)
}
function W(z) {
return z !== z
}
const G = (function () {
const z = '0123456789abcdef',
E = new Array(256)
for (let N = 0; N < 16; ++N) {
const q = N * 16
for (let Z = 0; Z < 16; ++Z) E[q + Z] = z[N] + z[Z]
}
return E
})()
function X(z) {
return typeof BigInt > 'u' ? ue : z
}
function ue() {
throw new Error('BigInt not supported')
}
})(rg)),
rg
)
}
var uN = h5(),
sg,
pS
function dN() {
if (pS) return sg
pS = 1
const n = (f, p, g) => {
const y = f.indexOf(0, p),
m = Math.min(p + g, y === -1 ? f.length : y)
return f.slice(p, m).toString('utf8')
},
e = (f, p, g, y) => {
const m = p.write(f, g, y, 'utf8')
m < y && p.fill(0, g + m, g + y)
},
t = (f, p, g) => {
let y = f[0]
return (y >= g && (y = g - 1), p++, f.slice(p, p + y).toString('utf8'))
},
i = (f, p, g, y) => {
let m = Buffer.alloc(f, 'utf8'),
v = m.length
;(v >= y && (v = y - 1),
v > 255 && (v = 255),
(m[g] = v),
m.copy(p, g + 1, 0, v),
p.fill(0, g + 1 + v, g + y))
},
r = (f, p) => f.readUInt32LE(p, !0),
s = (f, p) => f.readUInt32BE(p, !0),
o = (f, p) => f.readInt32LE(p, !0),
a = (f, p) => f.readInt32BE(p, !0),
l = (f, p, g) => {
p.writeUInt32LE(f, g, !0)
},
c = (f, p, g) => {
p.writeUInt32BE(f, g, !0)
},
u = (f, p, g) => {
p.writeInt32LE(f, g, !0)
},
d = (f, p, g) => {
p.writeInt32BE(f, g, !0)
}
function h(f) {
const p = f.Buffer,
g = f.isLittleEndian === void 0 ? !0 : !!f.isLittleEndian,
y = f.is64bit === void 0 ? !0 : !!f.is64bit,
m = f.unpackUInt64LE,
v = f.unpackUInt64BE,
x = f.unpackInt64LE,
_ = f.unpackInt64BE,
S = f.packUInt64LE,
C = f.packUInt64BE,
A = f.packInt64LE,
R = f.packInt64BE,
w = {
x: [1, 1, null, null],
c: [
1,
1,
(T, F) => String.fromCharCode(T[F]),
(T, F, V) => {
F[V] = T.charCodeAt(0)
},
],
b: [
1,
1,
(T, F) => T.readInt8(F),
(T, F, V) => {
F.writeInt8(T, V, !0)
},
],
B: [
1,
1,
(T, F) => T[F],
(T, F, V) => {
F[V] = T
},
],
h: [
2,
2,
g ? (T, F) => T.readInt16LE(F) : (T, F) => T.readInt16BE(F),
g ? (T, F, V) => F.writeInt16LE(T, V, !0) : (T, F, V) => F.writeInt16BE(T, V, !0),
],
H: [
2,
2,
g ? (T, F) => T.readUInt16LE(F) : (T, F) => T.readUInt16BE(F),
g ? (T, F, V) => F.writeUInt16LE(T, V, !0) : (T, F, V) => F.writeUInt16BE(T, V, !0),
],
i: [4, 4, g ? o : a, g ? u : d],
I: [4, 4, g ? r : s, g ? l : c],
l: [4, 4, g ? o : a, g ? u : d],
L: [4, 4, g ? r : s, g ? l : c],
f: [
4,
4,
g ? (T, F) => T.readFloatLE(F) : (T, F) => T.readFloatBE(F),
g ? (T, F, V) => F.writeFloatLE(T, V, !0) : (T, F, V) => F.writeFloatBE(T, V, !0),
],
d: [
8,
8,
g ? (T, F) => T.readDoubleLE(F) : (T, F) => T.readDoubleBE(F),
g ? (T, F, V) => F.writeDoubleLE(T, V, !0) : (T, F, V) => F.writeDoubleBE(T, V, !0),
],
s: [1, 1, n, e],
p: [1, 1, t, i],
P: [y ? 8 : 4, y ? 8 : 4, g ? (y ? m : r) : y ? v : s, g ? (y ? S : l) : y ? C : c],
q: [8, 8, g ? x : _, g ? A : R],
Q: [8, 8, g ? m : v, g ? S : C],
'?': [
1,
1,
(T, F) => T[F] !== 0,
(T, F, V) => {
F[V] = T ? 1 : 0
},
],
},
M = {
x: [1, 1, null, null],
c: [
1,
1,
(T, F) => String.fromCharCode(T[F]),
(T, F, V) => {
F[V] = T.charCodeAt(0)
},
],
b: [
1,
1,
(T, F) => T.readInt8(F),
(T, F, V) => {
F.writeInt8(T, V, !0)
},
],
B: [
1,
1,
(T, F) => T[F],
(T, F, V) => {
F[V] = T
},
],
h: [2, 1, (T, F) => T.readInt16LE(F), (T, F, V) => F.writeInt16LE(T, V, !0)],
H: [2, 1, (T, F) => T.readUInt16LE(F), (T, F, V) => F.writeUInt16LE(T, V, !0)],
i: [4, 1, o, u],
I: [4, 1, r, l],
l: [4, 1, o, u],
L: [4, 1, r, l],
f: [4, 1, (T, F) => T.readFloatLE(F), (T, F, V) => F.writeFloatLE(T, V, !0)],
d: [8, 1, (T, F) => T.readDoubleLE(F), (T, F, V) => F.writeDoubleLE(T, V, !0)],
s: [1, 1, n, e],
p: [1, 1, t, i],
P: [y ? 8 : 4, 1, y ? m : r, y ? S : l],
q: [8, 1, x, A],
Q: [8, 1, m, S],
'?': [
1,
1,
(T, F) => T[F] !== 0,
(T, F, V) => {
F[V] = T ? 1 : 0
},
],
},
I = {
x: [1, 1, null, null],
c: [
1,
1,
(T, F) => String.fromCharCode(T[F]),
(T, F, V) => {
F[V] = T.charCodeAt(0)
},
],
b: [
1,
1,
(T, F) => T.readInt8(F),
(T, F, V) => {
F.writeInt8(T, V, !0)
},
],
B: [
1,
1,
(T, F) => T[F],
(T, F, V) => {
F[V] = T
},
],
h: [2, 1, (T, F) => T.readInt16BE(F), (T, F, V) => F.writeInt16BE(T, V, !0)],
H: [2, 1, (T, F) => T.readUInt16BE(F), (T, F, V) => F.writeUInt16BE(T, V, !0)],
i: [4, 1, a, d],
I: [4, 1, s, c],
l: [4, 1, a, d],
L: [4, 1, s, c],
f: [4, 1, (T, F) => T.readFloatBE(F), (T, F, V) => F.writeFloatBE(T, V, !0)],
d: [8, 1, (T, F) => T.readDoubleBE(F), (T, F, V) => F.writeDoubleBE(T, V, !0)],
s: [1, 1, n, e],
p: [1, 1, t, i],
P: [y ? 8 : 4, 1, y ? v : s, y ? C : c],
q: [8, 1, _, R],
Q: [8, 1, v, C],
'?': [
1,
1,
(T, F) => T[F] !== 0,
(T, F, V) => {
F[V] = T ? 1 : 0
},
],
}
let L = (T) => {
let F = T[0],
V = !0,
Q = w
switch (F) {
case '<':
Q = M
break
case '>':
case '!':
Q = I
break
case '=':
Q = g ? M : I
break
default:
V = !1
case '@':
Q = w
break
}
return { map: Q, skipFirst: V }
}
class U {
static sizeOf(F) {
let V = 0,
Q = null,
ee = 0,
se,
he,
ie,
re,
Te = L(F),
le = Te.map
for (Te.skipFirst && ee++, he = F.length; ee < he; ee++) {
if (((se = F[ee]), se >= '0' && se <= '9')) {
Q = Q === null ? se : Q + se
continue
}
;((ie = le[se]),
ie &&
((re = ie[1]),
re > 1 && (V = Math.ceil(V / re) * re),
(Q = Q ? parseInt(Q, 10) : 0),
se === 's' ? (V += Q || 0) : se === 'p' ? (V += Q || 1) : (V += ie[0] * (Q || 1)),
(Q = null)))
}
return V
}
static unpack(F, V, Q) {
return U.unpackFrom(F, V, Q, 0)
}
static unpackFrom(F, V, Q, ee) {
let se = [],
he = null,
ie = 0,
re = L(F),
Te = re.map
re.skipFirst && ie++
for (const le = F.length; ie < le; ie++) {
let fe = F[ie]
if (fe >= '0' && fe <= '9') {
he = he === null ? fe : he + fe
continue
}
const we = Te[fe]
if (!we) continue
let Ee = we[0]
const Ie = we[1]
;(Ie > 1 && (ee = Math.ceil(ee / Ie) * Ie), (he = he ? parseInt(he, 10) : 0))
let ze
fe === 's'
? ((ze = 1), (Ee = he))
: fe === 'p'
? ((ze = 1), (Ee = he || 1))
: (ze = he || 1)
let Be = we[2]
for (; ze > 0; ) {
if (Be) {
if (Q && ee + Ee >= V.length)
throw new Error("Reached end of buffer, can't unpack anymore data.")
se.push(Be(V, ee, he))
}
;((ee += Ee), ze--)
}
he = null
}
return se
}
static pack(F, V, Q) {
Array.isArray(V) || ((V = Array.prototype.slice.call(arguments, 1)), (Q = !0))
let ee = p.alloc(U.sizeOf(F)),
se = 0,
he = null,
ie = 0,
re = 0,
Te = L(F),
le = Te.map
Te.skipFirst && ie++
for (const fe = F.length; ie < fe; ie++) {
let we = F[ie]
if (we >= '0' && we <= '9') {
he = he === null ? we : he + we
continue
}
const Ee = le[we]
if (!Ee) continue
let Ie = Ee[0]
const ze = Ee[1]
;(ze > 1 && (se = Math.ceil(se / ze) * ze), (he = he ? parseInt(he, 10) : 0))
let Be
we === 's'
? ((Be = 1), (Ie = he))
: we === 'p'
? ((Be = 1), (Ie = he || 1))
: (Be = he || 1)
let it = Ee[3]
for (; Be > 0; ) {
if (it) {
if (Q && re >= V.length)
throw new Error('Reached end of data, no more elements to pack.')
;(it(V[re], ee, se, he), re++)
}
;((se += Ie), Be--)
}
he = null
}
return ee
}
}
return U
}
return ((sg = h), sg)
}
var og, mS
function hN() {
if (mS) return og
;((mS = 1), (og = e))
var n = null
try {
n = 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 (M) {}
function e(M, I, L) {
;((this.low = M | 0), (this.high = I | 0), (this.unsigned = !!L))
}
;(e.prototype.__isLong__, Object.defineProperty(e.prototype, '__isLong__', { value: !0 }))
function t(M) {
return (M && M.__isLong__) === !0
}
e.isLong = t
var i = {},
r = {}
function s(M, I) {
var L, U, T
return I
? ((M >>>= 0),
(T = 0 <= M && M < 256) && ((U = r[M]), U)
? U
: ((L = a(M, (M | 0) < 0 ? -1 : 0, !0)), T && (r[M] = L), L))
: ((M |= 0),
(T = -128 <= M && M < 128) && ((U = i[M]), U)
? U
: ((L = a(M, M < 0 ? -1 : 0, !1)), T && (i[M] = L), L))
}
e.fromInt = s
function o(M, I) {
if (isNaN(M)) return I ? v : m
if (I) {
if (M < 0) return v
if (M >= p) return A
} else {
if (M <= -g) return R
if (M + 1 >= g) return C
}
return M < 0 ? o(-M, I).neg() : a(M % f | 0, (M / f) | 0, I)
}
e.fromNumber = o
function a(M, I, L) {
return new e(M, I, L)
}
e.fromBits = a
var l = Math.pow
function c(M, I, L) {
if (M.length === 0) throw Error('empty string')
if (M === 'NaN' || M === 'Infinity' || M === '+Infinity' || M === '-Infinity') return m
if ((typeof I == 'number' ? ((L = I), (I = !1)) : (I = !!I), (L = L || 10), L < 2 || 36 < L))
throw RangeError('radix')
var U
if ((U = M.indexOf('-')) > 0) throw Error('interior hyphen')
if (U === 0) return c(M.substring(1), I, L).neg()
for (var T = o(l(L, 8)), F = m, V = 0; V < M.length; V += 8) {
var Q = Math.min(8, M.length - V),
ee = parseInt(M.substring(V, V + Q), L)
if (Q < 8) {
var se = o(l(L, Q))
F = F.mul(se).add(o(ee))
} else ((F = F.mul(T)), (F = F.add(o(ee))))
}
return ((F.unsigned = I), F)
}
e.fromString = c
function u(M, I) {
return typeof M == 'number'
? o(M, I)
: typeof M == 'string'
? c(M, I)
: a(M.low, M.high, typeof I == 'boolean' ? I : M.unsigned)
}
e.fromValue = u
var d = 65536,
h = 1 << 24,
f = d * d,
p = f * f,
g = p / 2,
y = s(h),
m = s(0)
e.ZERO = m
var v = s(0, !0)
e.UZERO = v
var x = s(1)
e.ONE = x
var _ = s(1, !0)
e.UONE = _
var S = s(-1)
e.NEG_ONE = S
var C = a(-1, 2147483647, !1)
e.MAX_VALUE = C
var A = a(-1, -1, !0)
e.MAX_UNSIGNED_VALUE = A
var R = a(0, -2147483648, !1)
e.MIN_VALUE = R
var w = e.prototype
return (
(w.toInt = function () {
return this.unsigned ? this.low >>> 0 : this.low
}),
(w.toNumber = function () {
return this.unsigned
? (this.high >>> 0) * f + (this.low >>> 0)
: this.high * f + (this.low >>> 0)
}),
(w.toString = function (I) {
if (((I = I || 10), I < 2 || 36 < I)) throw RangeError('radix')
if (this.isZero()) return '0'
if (this.isNegative())
if (this.eq(R)) {
var L = o(I),
U = this.div(L),
T = U.mul(L).sub(this)
return U.toString(I) + T.toInt().toString(I)
} else return '-' + this.neg().toString(I)
for (var F = o(l(I, 6), this.unsigned), V = this, Q = ''; ; ) {
var ee = V.div(F),
se = V.sub(ee.mul(F)).toInt() >>> 0,
he = se.toString(I)
if (((V = ee), V.isZero())) return he + Q
for (; he.length < 6; ) he = '0' + he
Q = '' + he + Q
}
}),
(w.getHighBits = function () {
return this.high
}),
(w.getHighBitsUnsigned = function () {
return this.high >>> 0
}),
(w.getLowBits = function () {
return this.low
}),
(w.getLowBitsUnsigned = function () {
return this.low >>> 0
}),
(w.getNumBitsAbs = function () {
if (this.isNegative()) return this.eq(R) ? 64 : this.neg().getNumBitsAbs()
for (
var I = this.high != 0 ? this.high : this.low, L = 31;
L > 0 && (I & (1 << L)) == 0;
L--
);
return this.high != 0 ? L + 33 : L + 1
}),
(w.isZero = function () {
return this.high === 0 && this.low === 0
}),
(w.eqz = w.isZero),
(w.isNegative = function () {
return !this.unsigned && this.high < 0
}),
(w.isPositive = function () {
return this.unsigned || this.high >= 0
}),
(w.isOdd = function () {
return (this.low & 1) === 1
}),
(w.isEven = function () {
return (this.low & 1) === 0
}),
(w.equals = function (I) {
return (
t(I) || (I = u(I)),
this.unsigned !== I.unsigned && this.high >>> 31 === 1 && I.high >>> 31 === 1
? !1
: this.high === I.high && this.low === I.low
)
}),
(w.eq = w.equals),
(w.notEquals = function (I) {
return !this.eq(I)
}),
(w.neq = w.notEquals),
(w.ne = w.notEquals),
(w.lessThan = function (I) {
return this.comp(I) < 0
}),
(w.lt = w.lessThan),
(w.lessThanOrEqual = function (I) {
return this.comp(I) <= 0
}),
(w.lte = w.lessThanOrEqual),
(w.le = w.lessThanOrEqual),
(w.greaterThan = function (I) {
return this.comp(I) > 0
}),
(w.gt = w.greaterThan),
(w.greaterThanOrEqual = function (I) {
return this.comp(I) >= 0
}),
(w.gte = w.greaterThanOrEqual),
(w.ge = w.greaterThanOrEqual),
(w.compare = function (I) {
if ((t(I) || (I = u(I)), this.eq(I))) return 0
var L = this.isNegative(),
U = I.isNegative()
return L && !U
? -1
: !L && U
? 1
: this.unsigned
? I.high >>> 0 > this.high >>> 0 ||
(I.high === this.high && I.low >>> 0 > this.low >>> 0)
? -1
: 1
: this.sub(I).isNegative()
? -1
: 1
}),
(w.comp = w.compare),
(w.negate = function () {
return !this.unsigned && this.eq(R) ? R : this.not().add(x)
}),
(w.neg = w.negate),
(w.add = function (I) {
t(I) || (I = u(I))
var L = this.high >>> 16,
U = this.high & 65535,
T = this.low >>> 16,
F = this.low & 65535,
V = I.high >>> 16,
Q = I.high & 65535,
ee = I.low >>> 16,
se = I.low & 65535,
he = 0,
ie = 0,
re = 0,
Te = 0
return (
(Te += F + se),
(re += Te >>> 16),
(Te &= 65535),
(re += T + ee),
(ie += re >>> 16),
(re &= 65535),
(ie += U + Q),
(he += ie >>> 16),
(ie &= 65535),
(he += L + V),
(he &= 65535),
a((re << 16) | Te, (he << 16) | ie, this.unsigned)
)
}),
(w.subtract = function (I) {
return (t(I) || (I = u(I)), this.add(I.neg()))
}),
(w.sub = w.subtract),
(w.multiply = function (I) {
if (this.isZero()) return m
if ((t(I) || (I = u(I)), n)) {
var L = n.mul(this.low, this.high, I.low, I.high)
return a(L, n.get_high(), this.unsigned)
}
if (I.isZero()) return m
if (this.eq(R)) return I.isOdd() ? R : m
if (I.eq(R)) return this.isOdd() ? R : m
if (this.isNegative())
return I.isNegative() ? this.neg().mul(I.neg()) : this.neg().mul(I).neg()
if (I.isNegative()) return this.mul(I.neg()).neg()
if (this.lt(y) && I.lt(y)) return o(this.toNumber() * I.toNumber(), this.unsigned)
var U = this.high >>> 16,
T = this.high & 65535,
F = this.low >>> 16,
V = this.low & 65535,
Q = I.high >>> 16,
ee = I.high & 65535,
se = I.low >>> 16,
he = I.low & 65535,
ie = 0,
re = 0,
Te = 0,
le = 0
return (
(le += V * he),
(Te += le >>> 16),
(le &= 65535),
(Te += F * he),
(re += Te >>> 16),
(Te &= 65535),
(Te += V * se),
(re += Te >>> 16),
(Te &= 65535),
(re += T * he),
(ie += re >>> 16),
(re &= 65535),
(re += F * se),
(ie += re >>> 16),
(re &= 65535),
(re += V * ee),
(ie += re >>> 16),
(re &= 65535),
(ie += U * he + T * se + F * ee + V * Q),
(ie &= 65535),
a((Te << 16) | le, (ie << 16) | re, this.unsigned)
)
}),
(w.mul = w.multiply),
(w.divide = function (I) {
if ((t(I) || (I = u(I)), I.isZero())) throw Error('division by zero')
if (n) {
if (!this.unsigned && this.high === -2147483648 && I.low === -1 && I.high === -1)
return this
var L = (this.unsigned ? n.div_u : n.div_s)(this.low, this.high, I.low, I.high)
return a(L, n.get_high(), this.unsigned)
}
if (this.isZero()) return this.unsigned ? v : m
var U, T, F
if (this.unsigned) {
if ((I.unsigned || (I = I.toUnsigned()), I.gt(this))) return v
if (I.gt(this.shru(1))) return _
F = v
} else {
if (this.eq(R)) {
if (I.eq(x) || I.eq(S)) return R
if (I.eq(R)) return x
var V = this.shr(1)
return (
(U = V.div(I).shl(1)),
U.eq(m)
? I.isNegative()
? x
: S
: ((T = this.sub(I.mul(U))), (F = U.add(T.div(I))), F)
)
} else if (I.eq(R)) return this.unsigned ? v : m
if (this.isNegative())
return I.isNegative() ? this.neg().div(I.neg()) : this.neg().div(I).neg()
if (I.isNegative()) return this.div(I.neg()).neg()
F = m
}
for (T = this; T.gte(I); ) {
U = Math.max(1, Math.floor(T.toNumber() / I.toNumber()))
for (
var Q = Math.ceil(Math.log(U) / Math.LN2),
ee = Q <= 48 ? 1 : l(2, Q - 48),
se = o(U),
he = se.mul(I);
he.isNegative() || he.gt(T);
)
((U -= ee), (se = o(U, this.unsigned)), (he = se.mul(I)))
;(se.isZero() && (se = x), (F = F.add(se)), (T = T.sub(he)))
}
return F
}),
(w.div = w.divide),
(w.modulo = function (I) {
if ((t(I) || (I = u(I)), n)) {
var L = (this.unsigned ? n.rem_u : n.rem_s)(this.low, this.high, I.low, I.high)
return a(L, n.get_high(), this.unsigned)
}
return this.sub(this.div(I).mul(I))
}),
(w.mod = w.modulo),
(w.rem = w.modulo),
(w.not = function () {
return a(~this.low, ~this.high, this.unsigned)
}),
(w.and = function (I) {
return (t(I) || (I = u(I)), a(this.low & I.low, this.high & I.high, this.unsigned))
}),
(w.or = function (I) {
return (t(I) || (I = u(I)), a(this.low | I.low, this.high | I.high, this.unsigned))
}),
(w.xor = function (I) {
return (t(I) || (I = u(I)), a(this.low ^ I.low, this.high ^ I.high, this.unsigned))
}),
(w.shiftLeft = function (I) {
return (
t(I) && (I = I.toInt()),
(I &= 63) === 0
? this
: I < 32
? a(this.low << I, (this.high << I) | (this.low >>> (32 - I)), this.unsigned)
: a(0, this.low << (I - 32), this.unsigned)
)
}),
(w.shl = w.shiftLeft),
(w.shiftRight = function (I) {
return (
t(I) && (I = I.toInt()),
(I &= 63) === 0
? this
: I < 32
? a((this.low >>> I) | (this.high << (32 - I)), this.high >> I, this.unsigned)
: a(this.high >> (I - 32), this.high >= 0 ? 0 : -1, this.unsigned)
)
}),
(w.shr = w.shiftRight),
(w.shiftRightUnsigned = function (I) {
if ((t(I) && (I = I.toInt()), (I &= 63), I === 0)) return this
var L = this.high
if (I < 32) {
var U = this.low
return a((U >>> I) | (L << (32 - I)), L >>> I, this.unsigned)
} else return I === 32 ? a(L, 0, this.unsigned) : a(L >>> (I - 32), 0, this.unsigned)
}),
(w.shru = w.shiftRightUnsigned),
(w.shr_u = w.shiftRightUnsigned),
(w.toSigned = function () {
return this.unsigned ? a(this.low, this.high, !1) : this
}),
(w.toUnsigned = function () {
return this.unsigned ? this : a(this.low, this.high, !0)
}),
(w.toBytes = function (I) {
return I ? this.toBytesLE() : this.toBytesBE()
}),
(w.toBytesLE = function () {
var I = this.high,
L = this.low
return [
L & 255,
(L >>> 8) & 255,
(L >>> 16) & 255,
L >>> 24,
I & 255,
(I >>> 8) & 255,
(I >>> 16) & 255,
I >>> 24,
]
}),
(w.toBytesBE = function () {
var I = this.high,
L = this.low
return [
I >>> 24,
(I >>> 16) & 255,
(I >>> 8) & 255,
I & 255,
L >>> 24,
(L >>> 16) & 255,
(L >>> 8) & 255,
L & 255,
]
}),
(e.fromBytes = function (I, L, U) {
return U ? e.fromBytesLE(I, L) : e.fromBytesBE(I, L)
}),
(e.fromBytesLE = function (I, L) {
return new e(
I[0] | (I[1] << 8) | (I[2] << 16) | (I[3] << 24),
I[4] | (I[5] << 8) | (I[6] << 16) | (I[7] << 24),
L
)
}),
(e.fromBytesBE = function (I, L) {
return new e(
(I[4] << 24) | (I[5] << 16) | (I[6] << 8) | I[7],
(I[0] << 24) | (I[1] << 16) | (I[2] << 8) | I[3],
L
)
}),
og
)
}
var ag, gS
function fN() {
if (gS) return ag
gS = 1
const n = hN(),
e = (a, l) => n.fromBits(a.readInt32LE(l), a.readInt32LE(l + 4), !0),
t = (a, l) => n.fromBits(a.readInt32BE(l + 4), a.readInt32BE(l), !0),
i = (a, l) => n.fromBits(a.readInt32LE(l), a.readInt32LE(l + 4), !1),
r = (a, l) => n.fromBits(a.readInt32BE(l + 4), a.readInt32BE(l), !1),
s = (a, l, c) => {
;(a instanceof n ||
(typeof a == 'number' ? (a = n.fromNumber(a)) : (a = n.fromString(a || ''))),
l.writeInt32LE(a.getLowBits(), c, !0),
l.writeInt32LE(a.getHighBits(), c + 4, !0))
},
o = (a, l, c) => {
;(a instanceof n ||
(typeof a == 'number' ? (a = n.fromNumber(a)) : (a = n.fromString(a || ''))),
l.writeInt32BE(a.getHighBits(), c, !0),
l.writeInt32BE(a.getLowBits(), c + 4, !0))
}
return (
(ag = {
unpackUInt64LE: e,
unpackUInt64BE: t,
unpackInt64LE: i,
unpackInt64BE: r,
packUInt64LE: s,
packUInt64BE: o,
packInt64LE: s,
packInt64BE: o,
}),
ag
)
}
var lg, yS
function pN() {
return (
yS ||
((yS = 1),
(lg = dN()(
Object.assign(
{
Buffer: h5().Buffer,
isLittleEndian:
typeof Uint8Array !== void 0
? new Uint8Array(new Uint32Array([305419896]).buffer)[0] === 120
: !0,
is64bit:
typeof navigator !== void 0
? /WOW64|Win64|arm64|ia64|x64;|Mac OS X/i.test(navigator.userAgent)
: !0,
},
fN()
)
))),
lg
)
}
var mN = pN()
const gN = c_(mN),
yN = async function (n, e = ' {
let e = '',
t = crypto.getRandomValues(new Uint8Array((n |= 0)))
for (; n--; ) e += vN[t[n] & 63]
return e
}
class d_ {
constructor(e, t) {
xe(this, 'id', _N())
xe(this, 'analyserNode')
xe(this, 'audioCtx')
xe(this, 'autoPlay', !0)
xe(this, 'bufferSource')
xe(this, 'convertValue', 32768)
xe(this, 'ee')
xe(this, 'gainNode')
xe(this, 'option', {
inputCodec: 'Int16',
channels: 1,
sampleRate: 8e3,
fftSize: 2048,
onended: () => {},
isMute: !1,
})
xe(this, 'samplesList', [])
xe(this, 'startTime')
xe(this, 'typedArray')
xe(this, '_firstStartRelativeTime')
xe(this, '_firstStartAbsoluteTime')
;((this.ee = t), this.init(e))
}
static isTypedArray(e) {
return (
(e.byteLength && e.buffer && e.buffer.constructor === ArrayBuffer) ||
e.constructor === ArrayBuffer
)
}
async continue() {
await this.audioCtx.resume()
}
destroy() {
var e
;((this.samplesList = []), (e = this.audioCtx) == null || e.close(), (this.audioCtx = void 0))
}
feed(e) {
let { audio: t } = e
const { end_of_batch: i } = e
if (!t) return
;(this._isSupported(t), (t = this._getFormattedValue(t)))
const r = new Float32Array(t.length)
r.set(t, 0)
const s = { data: r, end_of_batch: i }
;(this.samplesList.push(s), this.flush(s, this.samplesList.length - 1))
}
flush(e, t) {
if (!(e && this.autoPlay && this.audioCtx)) return
const { data: i, end_of_batch: r } = e
;(this.bufferSource && (this.bufferSource.onended = () => {}),
(this.bufferSource = this.audioCtx.createBufferSource()),
typeof this.option.onended == 'function' &&
(this.bufferSource.onended = () => {
;(!r && t === this.samplesList.length - 1 && this.ee.emit(Bl.Player_WaitNextAudioClip),
this.option.onended())
}))
const s = i.length / this.option.channels,
o = this.audioCtx.createBuffer(this.option.channels, s, this.option.sampleRate)
for (let a = 0; a < this.option.channels; a++) {
const l = o.getChannelData(a)
let c = a,
u = 50
for (let d = 0; d < s; d++)
((l[d] = i[c]),
d < 50 && (l[d] = (l[d] * d) / 50),
d >= s - 51 && (l[d] = (l[d] * u--) / 50),
(c += 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),
this._firstStartAbsoluteTime === void 0 && (this._firstStartAbsoluteTime = Date.now()),
this._firstStartRelativeTime === void 0 &&
((this._firstStartRelativeTime = this.startTime),
this.ee.emit(Bl.Player_StartSpeaking, this)),
(this.startTime += o.duration))
}
init(e) {
;((this.option = Object.assign(this.option, e)),
(this.convertValue = this._getConvertValue()),
(this.typedArray = this._getTypedArray()),
this.initAudioContext())
}
initAudioContext() {
;((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))
}
setMute(e) {
this.gainNode.gain.value = e ? 0 : 1
}
async pause() {
await this.audioCtx.suspend()
}
async updateAutoPlay(e) {
this.autoPlay !== e && e
? ((this.autoPlay = e),
this.samplesList.forEach((t, i) => {
this.flush(t, i)
}))
: (this.autoPlay = e)
}
volume(e) {
this.gainNode.gain.value = e
}
_getFormattedValue(e) {
const t = this.typedArray
e.constructor === ArrayBuffer ? (e = new t(e)) : (e = new t(e.buffer))
const i = new Float32Array(e.length)
for (let r = 0; r < e.length; r++) i[r] = e[r] / this.convertValue
return i
}
_isSupported(e) {
if (!d_.isTypedArray(e)) throw new Error('请传入ArrayBuffer或者任意TypedArray')
return !0
}
_getConvertValue() {
const 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]
}
_getTypedArray() {
const 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]
}
}
const xN = { int16: 'Int16', int32: 'Int32', float32: 'Float32' },
SN = { int16: Int16Array, int32: Int32Array, float32: Float32Array }
class AN {
constructor(e) {
xe(this, 'ee')
xe(this, '_motionDataGroupHandlerQueue', new lN({ concurrency: 1 }))
xe(this, '_motionDataGroups', [])
xe(this, '_arkit_face_sample_rate')
xe(this, '_arkit_face_channel_names')
xe(this, '_tts2face_sample_rate')
xe(this, '_tts2face_channel_names')
xe(this, '_maxBatchId')
xe(this, '_arkitFaceShape')
xe(this, '_tts2FaceShape')
this.ee = e
}
add(e) {
const { avatar_motion_data: t } = e
this._motionDataGroupHandlerQueue.add(async () => await this._motionDataGroupHandler(t))
}
clear() {
;(this._motionDataGroups.forEach((e) => {
var t
;(t = e.player) == null || t.destroy()
}),
(this._motionDataGroups = []))
}
setMute(e) {
this._motionDataGroups.forEach((t) => {
var i
;(i = t.player) == null || i.setMute(e)
})
}
getArkitFaceFrame() {
return { arkitFace: this._getArkitFaceFrame() }
}
getLastBatchId() {
let e
return (
this._motionDataGroups.forEach((t) => {
t.batch_id && (e = t.batch_id)
}),
e
)
}
getTtt2FaceFrame() {
return { tts2Face: this._getTts2FaceFrame() }
}
interrupt() {
;(this._motionDataGroups.forEach((e) => {
var t
;(e.batch_id && (this._maxBatchId = e.batch_id), (t = e.player) == null || t.destroy())
}),
(this._motionDataGroups = []))
}
_getArkitFaceFrame() {
if (!this._motionDataGroups.length) return null
const e = this._motionDataGroups.find((r) => r.player)
if (!e) return null
const { arkitFaceArrayBufferArray: t, player: i } = e
if (
i &&
i._firstStartAbsoluteTime &&
t &&
t.length > 0 &&
this._arkitFaceShape &&
this._arkit_face_sample_rate
) {
const r = Date.now() - i._firstStartAbsoluteTime
let s = 0,
o
i.samplesList.forEach((h, f) => {
;(o === void 0 && h.startTime !== void 0 && (o = h.startTime),
h.startTime !== void 0 && h.startTime - o <= r / 1e3 && (s = f))
})
const a = i.samplesList[s],
l = r - a.startTime * 1e3,
c = Math.floor((l / 1e3) * this._arkit_face_sample_rate),
u = new Float32Array(t[s]),
d =
u == null
? void 0
: u.slice(c * this._arkitFaceShape, c * this._arkitFaceShape + this._arkitFaceShape)
if (d != null && d.length) {
const h = {}
return (
(this._arkit_face_channel_names || []).forEach((p, g) => {
Object.assign(h, { [p]: d[g] })
}),
h
)
}
return null
}
return null
}
_getTts2FaceFrame() {
if (!this._motionDataGroups.length) return null
const e = this._motionDataGroups.find((r) => r.player)
if (!e) return null
const { tts2faceArrayBufferArray: t, player: i } = e
if (
i &&
i._firstStartAbsoluteTime &&
t &&
t.length > 0 &&
this._tts2FaceShape &&
this._tts2face_sample_rate
) {
const r = Date.now() - i._firstStartAbsoluteTime
let s = 0,
o
i.samplesList.forEach((h, f) => {
;(o === void 0 && h.startTime !== void 0 && (o = h.startTime),
h.startTime !== void 0 && h.startTime - o <= r / 1e3 && (s = f))
})
const a = i.samplesList[s],
l = r - a.startTime * 1e3,
c = Math.floor((l / 1e3) * this._tts2face_sample_rate),
u = new Float32Array(t[s]),
d =
u == null
? void 0
: u.slice(c * this._tts2FaceShape, c * this._tts2FaceShape + this._tts2FaceShape)
return d != null && d.length ? d : null
}
return null
}
async _motionDataGroupHandler(e) {
try {
const {
first_package: t,
motion_data_slice: i,
segment_num: r,
binary_size: s,
use_binary_frame: o,
is_audio_mute: a,
} = e
if (t) {
const l = this._motionDataGroups[this._motionDataGroups.length - 1]
;(l &&
l.segment_num !== l.motion_data_slices.length &&
this.ee.emit(Sr.ErrorReceived, 'lost data packets'),
this._motionDataGroups.push({
first_package: t,
binary_size: s,
segment_num: r,
use_binary_frame: o,
motion_data_slices: [],
merged_motion_data: new Uint8Array(s),
}))
} else {
if (this._motionDataGroups.length === 0 || !i) return
const l = this._motionDataGroups[this._motionDataGroups.length - 1],
c = this._motionDataGroups[this._motionDataGroups.length - 2]
if ((l.motion_data_slices.push(i), l.motion_data_slices.length === l.segment_num)) {
const u = l.motion_data_slices[0],
{ parsedData: d, jsonSize: h, binSize: f } = await yN(u)
;((l.jsonSize = h), (l.binSize = f))
const p = u.slice(12 + l.jsonSize)
if (
(p.size !== l.binSize && this.ee.emit(J1.Chat_BinsizeError),
!this._connectBatch(d, l, c))
)
return
;(await this._handleArkitFaceConfig(d, l, c, p),
await this._handleAudioConfig(d, l, c, p, a || !1),
this._handleEvents(d))
}
}
} catch (t) {
;(console.error('err', t), this.ee.emit(Sr.ErrorReceived, t.message))
}
}
async _handleAudioConfig(e, t, i, r, s) {
const { data_records: o = {}, end_of_batch: a } = e,
{ audio: l } = o
if (l) {
const { sample_rate: c, shape: u, data_offset: d, data_type: h } = l,
f = xN[h],
p = SN[h]
if (
t.player === void 0 &&
(i && i.player && i.batch_id === t.batch_id
? (t.player = i.player)
: c &&
(t.player = new d_(
{
inputCodec: f,
channels: 1,
sampleRate: c,
fftSize: 1024,
isMute: s,
onended: (S) => {
if (!S) return
const { end_of_batch: C, lastMotionGroup: A } = S
if (C) {
const { batch_id: R, player: w } = A
;(this.ee.emit(Bl.Player_EndSpeaking, w),
(this._motionDataGroups = this._motionDataGroups.filter(
(M) => M.batch_id > R
)),
this._motionDataGroups.length && this._motionDataGroups[0].player
? this._motionDataGroups[0].player.updateAutoPlay(!0)
: this.ee.emit(Bl.Player_NoLegacy))
}
},
},
this.ee
)),
a)
) {
const S = t.player.option.onended
t.player.option.onended = () => {
S({ end_of_batch: a, lastMotionGroup: t })
}
}
const g = u.reduce((S, C) => S * C, f === 'Int16' ? 2 : 4),
y = d,
m = d + g,
x = await r.slice(y, m).arrayBuffer(),
_ = this._motionDataGroups.find((S) => S.player)
;(this._motionDataGroups.length &&
t.player &&
_ &&
_.player !== t.player &&
(t.player.autoPlay = !1),
t.player && t.player.feed({ audio: new p(x), end_of_batch: a }))
} else i && i.player && t.batch_id === i.batch_id && (t.player = i.player)
}
async _handleArkitFaceConfig(e, t, i, r) {
const { data_records: s = {} } = e,
{ arkit_face: o } = s
if (o) {
const { channel_names: a, shape: l, data_offset: c, sample_rate: u } = o
if (
(a &&
!this._arkit_face_channel_names &&
((this._arkit_face_channel_names = a), (this._arkit_face_sample_rate = u)),
t.arkitFaceArrayBufferArray === void 0)
) {
i && i.arkitFaceArrayBufferArray && i.batch_id === t.batch_id
? (t.arkitFaceArrayBufferArray = i.arkitFaceArrayBufferArray)
: (t.arkitFaceArrayBufferArray = [])
const d = l.reduce((p, g) => p * g, 4)
this._arkitFaceShape = l[1]
const f = await r.slice(c, c + d).arrayBuffer()
t.arkitFaceArrayBufferArray.push(f)
}
} else
i &&
i.arkitFaceArrayBufferArray &&
t.batch_id === i.batch_id &&
(t.arkitFaceArrayBufferArray = i.arkitFaceArrayBufferArray)
}
async _handletts2faceConfig(e, t, i, r) {
const { data_records: s = {} } = e,
{ tts2face: o } = s
if (o) {
const { channel_names: a, shape: l, data_offset: c, sample_rate: u } = o
if (
(a &&
!this._tts2face_channel_names &&
((this._tts2face_channel_names = a), (this._tts2face_sample_rate = u)),
t.tts2faceArrayBufferArray === void 0)
) {
i && i.tts2faceArrayBufferArray && i.batch_id === t.batch_id
? (t.tts2faceArrayBufferArray = i.tts2faceArrayBufferArray)
: (t.tts2faceArrayBufferArray = [])
const d = l.reduce((p, g) => p * g, 4)
this._tts2FaceShape = l[1]
const f = await r.slice(c, c + d).arrayBuffer()
t.tts2faceArrayBufferArray.push(f)
}
} else
i &&
i.tts2faceArrayBufferArray &&
t.batch_id === i.batch_id &&
(t.tts2faceArrayBufferArray = i.tts2faceArrayBufferArray)
}
_handleEvents(e) {
const { events: t } = e
t &&
t.length &&
t.forEach((i) => {
switch (i.event_type) {
case 'interrupt_speech':
break
case 'change_status':
this.ee.emit(J1.Change_Status, i)
break
}
})
}
_connectBatch(e, t, i) {
let r = !0
return (
e.batch_id && t.batch_id === void 0 && (t.batch_id = e.batch_id),
!t.batch_id && i && i.batch_id && (t.batch_id = i.batch_id),
e.batch_name && t.batch_name === void 0 && (t.batch_name = e.batch_name),
this._maxBatchId && t.batch_id && t.batch_id <= this._maxBatchId && (this.clear(), (r = !1)),
r
)
}
}
const Sl = class Sl {
constructor(e, t) {
let i, r
this.promise = new Promise((c, u) => {
;((i = c), (r = u))
})
const s = i.bind(this),
o = r.bind(this),
a = (...c) => {
s(...c)
},
l = (c) => {
o(c)
}
;(e(a.bind(this), l.bind(this)), (this.abortHandler = t), (this.id = Sl.idGen++))
}
then(e) {
return new Sl((t, i) => {
this.promise = this.promise
.then((...r) => {
const s = e(...r)
s instanceof Promise || s instanceof Sl
? s.then((...o) => {
t(...o)
})
: t(s)
})
.catch((r) => {
i(r)
})
}, this.abortHandler)
}
catch(e) {
return new Sl((t) => {
this.promise = this.promise
.then((...i) => {
t(...i)
})
.catch(e)
}, this.abortHandler)
}
abort(e) {
this.abortHandler && this.abortHandler(e)
}
}
xe(Sl, 'idGen', 0)
let rh = Sl
class Cp extends Error {
constructor(e) {
super(e)
}
}
;(function () {
const n = new Float32Array(1),
e = new Int32Array(n.buffer)
return function (t) {
n[0] = t
const i = e[0]
let r = (i >> 16) & 32768,
s = (i >> 12) & 2047
const o = (i >> 23) & 255
return o < 103
? r
: o > 142
? ((r |= 31744), (r |= (o == 255 ? 0 : 1) && i & 8388607), r)
: o < 113
? ((s |= 2048), (r |= (s >> (114 - o)) + ((s >> (113 - o)) & 1)), r)
: ((r |= ((o - 112) << 10) | (s >> 1)), (r += s & 1), r)
}
})()
const Vi = (function () {
const n = new Float32Array(1),
e = new Int32Array(n.buffer)
return function (t) {
return ((n[0] = t), e[0])
}
})(),
bN = function (n, e) {
return n[e] + (n[e + 1] << 8) + (n[e + 2] << 16) + (n[e + 3] << 24)
},
h_ = function (n, e, t = !0, i) {
const r = new AbortController(),
s = r.signal
let o = !1
const a = (l) => {
;(r.abort(l), (o = !0))
}
return new rh((l, c) => {
const u = { signal: s }
;(i && (u.headers = i),
fetch(n, u)
.then(async (d) => {
if (!d.ok) {
const m = await d.text()
c(
new Error(
'Fetch failed: '.concat(d.status, ' ').concat(d.statusText, ' ').concat(m)
)
)
return
}
const h = d.body.getReader()
let f = 0,
p = d.headers.get('Content-Length'),
g = p ? parseInt(p) : void 0
const y = []
for (; !o; )
try {
const { value: m, done: v } = await h.read()
if (v) {
if ((e && e(100, '100%', m, g), t)) {
const S = new Blob(y).arrayBuffer()
l(S)
} else l()
break
}
f += m.length
let x, _
;(g !== void 0 && ((x = (f / g) * 100), (_ = ''.concat(x.toFixed(2), '%'))),
t && y.push(m),
e && e(x, _, m, g))
} catch (m) {
c(m)
return
}
})
.catch((d) => {
c(new Cp(d))
}))
}, a)
},
yi = function (n, e, t) {
return Math.max(Math.min(n, t), e)
},
ec = function () {
return performance.now() / 1e3
},
Cc = (n) => {
if (
(n.geometry && (n.geometry.dispose(), (n.geometry = null)),
n.material && (n.material.dispose(), (n.material = null)),
n.children)
)
for (let e of n.children) Cc(e)
},
ms = (n, e) =>
new Promise((t) => {
window.setTimeout(
() => {
t(n())
},
e ? 1 : 50
)
}),
Gc = (n = 0) => {
switch (n) {
case 1:
return 9
case 2:
return 24
}
return 0
},
f_ = () => {
let n, e
return {
promise: new Promise((i, r) => {
;((n = i), (e = r))
}),
resolve: n,
reject: e,
}
},
cg = (n) => {
let e, t
return (
n || (n = () => {}),
{
promise: new rh((r, s) => {
;((e = r), (t = s))
}, n),
resolve: e,
reject: t,
}
)
}
class TN {
constructor(e, t, i) {
;((this.major = e), (this.minor = t), (this.patch = i))
}
toString() {
return ''.concat(this.major, '_').concat(this.minor, '_').concat(this.patch)
}
}
function p_() {
const n = navigator.userAgent
return n.indexOf('iPhone') > 0 || n.indexOf('iPad') > 0
}
function f5() {
if (p_()) {
const n = navigator.userAgent.match(/OS (\d+)_(\d+)_?(\d+)?/)
return new TN(parseInt(n[1] || 0, 10), parseInt(n[2] || 0, 10), parseInt(n[3] || 0, 10))
} else return null
}
const wN = 14,
Xd = class Xd {
constructor(e = 0) {
;((this.sphericalHarmonicsDegree = e),
(this.sphericalHarmonicsCount = Gc(this.sphericalHarmonicsDegree)),
(this.componentCount = this.sphericalHarmonicsCount + wN),
(this.defaultSphericalHarmonics = new Array(this.sphericalHarmonicsCount).fill(0)),
(this.splats = []),
(this.splatCount = 0))
}
static createSplat(e = 0) {
const t = [0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0]
let i = Gc(e)
for (let r = 0; r < i; r++) t.push(0)
return t
}
addSplat(e) {
;(this.splats.push(e), this.splatCount++)
}
getSplat(e) {
return this.splats[e]
}
addDefaultSplat() {
const e = Xd.createSplat(this.sphericalHarmonicsDegree)
return (this.addSplat(e), e)
}
addSplatFromComonents(e, t, i, r, s, o, a, l, c, u, d, h, f, p, ...g) {
const y = [e, t, i, r, s, o, a, l, c, u, d, h, f, p, ...this.defaultSphericalHarmonics]
for (let m = 0; m < g.length && m < this.sphericalHarmonicsCount; m++) y[m] = g[m]
return (this.addSplat(y), y)
}
addSplatFromArray(e, t) {
const i = e.splats[t],
r = Xd.createSplat(this.sphericalHarmonicsDegree)
for (let s = 0; s < this.componentCount && s < i.length; s++) r[s] = i[s]
this.addSplat(r)
}
}
xe(Xd, '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,
})
let lt = Xd
/**
* @license
* Copyright 2010-2025 Three.js Authors
* SPDX-License-Identifier: MIT
*/ const m_ = '173',
tc = { ROTATE: 0, DOLLY: 1, PAN: 2 },
nc = { ROTATE: 0, PAN: 1, DOLLY_PAN: 2, DOLLY_ROTATE: 3 },
CN = 0,
vS = 1,
EN = 2,
p5 = 1,
MN = 2,
br = 3,
bs = 0,
Fi = 1,
Er = 2,
La = 0,
zo = 1,
_S = 2,
xS = 3,
SS = 4,
m5 = 5,
ml = 100,
RN = 101,
IN = 102,
NN = 103,
PN = 104,
LN = 200,
DN = 201,
FN = 202,
ON = 203,
sh = 204,
oh = 205,
BN = 206,
UN = 207,
kN = 208,
zN = 209,
VN = 210,
HN = 211,
$N = 212,
GN = 213,
WN = 214,
ny = 0,
iy = 1,
ry = 2,
cu = 3,
sy = 4,
oy = 5,
ay = 6,
ly = 7,
g5 = 0,
QN = 1,
jN = 2,
_s = 0,
qN = 1,
XN = 2,
KN = 3,
YN = 4,
ZN = 5,
JN = 6,
eP = 7,
AS = 'attached',
tP = 'detached',
g_ = 300,
Ul = 301,
kl = 302,
cy = 303,
uy = 304,
i0 = 306,
uu = 1e3,
wa = 1001,
um = 1002,
_i = 1003,
y5 = 1004,
Td = 1005,
Ir = 1006,
Ep = 1007,
$s = 1008,
nP = 1008,
eo = 1009,
v5 = 1010,
_5 = 1011,
ah = 1012,
r0 = 1013,
Ni = 1014,
ir = 1015,
Ts = 1016,
y_ = 1017,
v_ = 1018,
du = 1020,
x5 = 35902,
S5 = 1021,
A5 = 1022,
Di = 1023,
b5 = 1024,
T5 = 1025,
Il = 1026,
hu = 1027,
__ = 1028,
s0 = 1029,
lh = 1030,
x_ = 1031,
Co = 1033,
Mp = 33776,
Rp = 33777,
Ip = 33778,
Np = 33779,
dy = 35840,
hy = 35841,
fy = 35842,
py = 35843,
my = 36196,
gy = 37492,
yy = 37496,
vy = 37808,
_y = 37809,
xy = 37810,
Sy = 37811,
Ay = 37812,
by = 37813,
Ty = 37814,
wy = 37815,
Cy = 37816,
Ey = 37817,
My = 37818,
Ry = 37819,
Iy = 37820,
Ny = 37821,
Pp = 36492,
Py = 36494,
Ly = 36495,
w5 = 36283,
Dy = 36284,
Fy = 36285,
Oy = 36286,
Jr = 2200,
zl = 2201,
iP = 2202,
ch = 2300,
uh = 2301,
ug = 2302,
Lc = 2400,
Dc = 2401,
dm = 2402,
S_ = 2500,
rP = 2501,
sP = 0,
C5 = 1,
By = 2,
oP = 3200,
aP = 3201,
hm = 0,
E5 = 1,
Vs = '',
pi = 'srgb',
Bi = 'srgb-linear',
fm = 'linear',
Jt = 'srgb',
ic = 7680,
bS = 519,
lP = 512,
M5 = 513,
cP = 514,
R5 = 515,
uP = 516,
dP = 517,
hP = 518,
fP = 519,
pm = 35044,
Ca = 35048,
TS = '300 es',
Nr = 2e3,
qo = 2001
class so {
addEventListener(e, t) {
this._listeners === void 0 && (this._listeners = {})
const i = this._listeners
;(i[e] === void 0 && (i[e] = []), i[e].indexOf(t) === -1 && i[e].push(t))
}
hasEventListener(e, t) {
const i = this._listeners
return i === void 0 ? !1 : i[e] !== void 0 && i[e].indexOf(t) !== -1
}
removeEventListener(e, t) {
const i = this._listeners
if (i === void 0) return
const r = i[e]
if (r !== void 0) {
const s = r.indexOf(t)
s !== -1 && r.splice(s, 1)
}
}
dispatchEvent(e) {
const t = this._listeners
if (t === void 0) return
const i = t[e.type]
if (i !== void 0) {
e.target = this
const r = i.slice(0)
for (let s = 0, o = r.length; s < o; s++) r[s].call(this, e)
e.target = null
}
}
}
const wi = [
'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',
]
let wS = 1234567
const Bd = Math.PI / 180,
fu = 180 / Math.PI
function xs() {
const n = (Math.random() * 4294967295) | 0,
e = (Math.random() * 4294967295) | 0,
t = (Math.random() * 4294967295) | 0,
i = (Math.random() * 4294967295) | 0
return (
wi[n & 255] +
wi[(n >> 8) & 255] +
wi[(n >> 16) & 255] +
wi[(n >> 24) & 255] +
'-' +
wi[e & 255] +
wi[(e >> 8) & 255] +
'-' +
wi[((e >> 16) & 15) | 64] +
wi[(e >> 24) & 255] +
'-' +
wi[(t & 63) | 128] +
wi[(t >> 8) & 255] +
'-' +
wi[(t >> 16) & 255] +
wi[(t >> 24) & 255] +
wi[i & 255] +
wi[(i >> 8) & 255] +
wi[(i >> 16) & 255] +
wi[(i >> 24) & 255]
).toLowerCase()
}
function Nt(n, e, t) {
return Math.max(e, Math.min(t, n))
}
function A_(n, e) {
return ((n % e) + e) % e
}
function pP(n, e, t, i, r) {
return i + ((n - e) * (r - i)) / (t - e)
}
function mP(n, e, t) {
return n !== e ? (t - n) / (e - n) : 0
}
function Ud(n, e, t) {
return (1 - t) * n + t * e
}
function gP(n, e, t, i) {
return Ud(n, e, 1 - Math.exp(-t * i))
}
function yP(n, e = 1) {
return e - Math.abs(A_(n, e * 2) - e)
}
function vP(n, e, t) {
return n <= e ? 0 : n >= t ? 1 : ((n = (n - e) / (t - e)), n * n * (3 - 2 * n))
}
function _P(n, e, t) {
return n <= e ? 0 : n >= t ? 1 : ((n = (n - e) / (t - e)), n * n * n * (n * (n * 6 - 15) + 10))
}
function xP(n, e) {
return n + Math.floor(Math.random() * (e - n + 1))
}
function SP(n, e) {
return n + Math.random() * (e - n)
}
function AP(n) {
return n * (0.5 - Math.random())
}
function bP(n) {
n !== void 0 && (wS = n)
let e = (wS += 1831565813)
return (
(e = Math.imul(e ^ (e >>> 15), e | 1)),
(e ^= e + Math.imul(e ^ (e >>> 7), e | 61)),
((e ^ (e >>> 14)) >>> 0) / 4294967296
)
}
function TP(n) {
return n * Bd
}
function wP(n) {
return n * fu
}
function CP(n) {
return (n & (n - 1)) === 0 && n !== 0
}
function EP(n) {
return Math.pow(2, Math.ceil(Math.log(n) / Math.LN2))
}
function MP(n) {
return Math.pow(2, Math.floor(Math.log(n) / Math.LN2))
}
function RP(n, e, t, i, r) {
const s = Math.cos,
o = Math.sin,
a = s(t / 2),
l = o(t / 2),
c = s((e + i) / 2),
u = o((e + i) / 2),
d = s((e - i) / 2),
h = o((e - i) / 2),
f = s((i - e) / 2),
p = o((i - e) / 2)
switch (r) {
case 'XYX':
n.set(a * u, l * d, l * h, a * c)
break
case 'YZY':
n.set(l * h, a * u, l * d, a * c)
break
case 'ZXZ':
n.set(l * d, l * h, a * u, a * c)
break
case 'XZX':
n.set(a * u, l * p, l * f, a * c)
break
case 'YXY':
n.set(l * f, a * u, l * p, a * c)
break
case 'ZYZ':
n.set(l * p, l * f, a * u, a * c)
break
default:
console.warn(
'THREE.MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: ' + r
)
}
}
function fs(n, e) {
switch (e.constructor) {
case Float32Array:
return n
case Uint32Array:
return n / 4294967295
case Uint16Array:
return n / 65535
case Uint8Array:
return n / 255
case Int32Array:
return Math.max(n / 2147483647, -1)
case Int16Array:
return Math.max(n / 32767, -1)
case Int8Array:
return Math.max(n / 127, -1)
default:
throw new Error('Invalid component type.')
}
}
function ln(n, e) {
switch (e.constructor) {
case Float32Array:
return n
case Uint32Array:
return Math.round(n * 4294967295)
case Uint16Array:
return Math.round(n * 65535)
case Uint8Array:
return Math.round(n * 255)
case Int32Array:
return Math.round(n * 2147483647)
case Int16Array:
return Math.round(n * 32767)
case Int8Array:
return Math.round(n * 127)
default:
throw new Error('Invalid component type.')
}
}
const Ea = {
DEG2RAD: Bd,
RAD2DEG: fu,
generateUUID: xs,
clamp: Nt,
euclideanModulo: A_,
mapLinear: pP,
inverseLerp: mP,
lerp: Ud,
damp: gP,
pingpong: yP,
smoothstep: vP,
smootherstep: _P,
randInt: xP,
randFloat: SP,
randFloatSpread: AP,
seededRandom: bP,
degToRad: TP,
radToDeg: wP,
isPowerOfTwo: CP,
ceilPowerOfTwo: EP,
floorPowerOfTwo: MP,
setQuaternionFromProperEuler: RP,
normalize: ln,
denormalize: fs,
}
class qe {
constructor(e = 0, t = 0) {
;((qe.prototype.isVector2 = !0), (this.x = e), (this.y = t))
}
get width() {
return this.x
}
set width(e) {
this.x = e
}
get height() {
return this.y
}
set height(e) {
this.y = e
}
set(e, t) {
return ((this.x = e), (this.y = t), this)
}
setScalar(e) {
return ((this.x = e), (this.y = e), this)
}
setX(e) {
return ((this.x = e), this)
}
setY(e) {
return ((this.y = e), this)
}
setComponent(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
}
getComponent(e) {
switch (e) {
case 0:
return this.x
case 1:
return this.y
default:
throw new Error('index is out of range: ' + e)
}
}
clone() {
return new this.constructor(this.x, this.y)
}
copy(e) {
return ((this.x = e.x), (this.y = e.y), this)
}
add(e) {
return ((this.x += e.x), (this.y += e.y), this)
}
addScalar(e) {
return ((this.x += e), (this.y += e), this)
}
addVectors(e, t) {
return ((this.x = e.x + t.x), (this.y = e.y + t.y), this)
}
addScaledVector(e, t) {
return ((this.x += e.x * t), (this.y += e.y * t), this)
}
sub(e) {
return ((this.x -= e.x), (this.y -= e.y), this)
}
subScalar(e) {
return ((this.x -= e), (this.y -= e), this)
}
subVectors(e, t) {
return ((this.x = e.x - t.x), (this.y = e.y - t.y), this)
}
multiply(e) {
return ((this.x *= e.x), (this.y *= e.y), this)
}
multiplyScalar(e) {
return ((this.x *= e), (this.y *= e), this)
}
divide(e) {
return ((this.x /= e.x), (this.y /= e.y), this)
}
divideScalar(e) {
return this.multiplyScalar(1 / e)
}
applyMatrix3(e) {
const t = this.x,
i = this.y,
r = e.elements
return ((this.x = r[0] * t + r[3] * i + r[6]), (this.y = r[1] * t + r[4] * i + r[7]), this)
}
min(e) {
return ((this.x = Math.min(this.x, e.x)), (this.y = Math.min(this.y, e.y)), this)
}
max(e) {
return ((this.x = Math.max(this.x, e.x)), (this.y = Math.max(this.y, e.y)), this)
}
clamp(e, t) {
return ((this.x = Nt(this.x, e.x, t.x)), (this.y = Nt(this.y, e.y, t.y)), this)
}
clampScalar(e, t) {
return ((this.x = Nt(this.x, e, t)), (this.y = Nt(this.y, e, t)), this)
}
clampLength(e, t) {
const i = this.length()
return this.divideScalar(i || 1).multiplyScalar(Nt(i, e, t))
}
floor() {
return ((this.x = Math.floor(this.x)), (this.y = Math.floor(this.y)), this)
}
ceil() {
return ((this.x = Math.ceil(this.x)), (this.y = Math.ceil(this.y)), this)
}
round() {
return ((this.x = Math.round(this.x)), (this.y = Math.round(this.y)), this)
}
roundToZero() {
return ((this.x = Math.trunc(this.x)), (this.y = Math.trunc(this.y)), this)
}
negate() {
return ((this.x = -this.x), (this.y = -this.y), this)
}
dot(e) {
return this.x * e.x + this.y * e.y
}
cross(e) {
return this.x * e.y - this.y * e.x
}
lengthSq() {
return this.x * this.x + this.y * this.y
}
length() {
return Math.sqrt(this.x * this.x + this.y * this.y)
}
manhattanLength() {
return Math.abs(this.x) + Math.abs(this.y)
}
normalize() {
return this.divideScalar(this.length() || 1)
}
angle() {
return Math.atan2(-this.y, -this.x) + Math.PI
}
angleTo(e) {
const t = Math.sqrt(this.lengthSq() * e.lengthSq())
if (t === 0) return Math.PI / 2
const i = this.dot(e) / t
return Math.acos(Nt(i, -1, 1))
}
distanceTo(e) {
return Math.sqrt(this.distanceToSquared(e))
}
distanceToSquared(e) {
const t = this.x - e.x,
i = this.y - e.y
return t * t + i * i
}
manhattanDistanceTo(e) {
return Math.abs(this.x - e.x) + Math.abs(this.y - e.y)
}
setLength(e) {
return this.normalize().multiplyScalar(e)
}
lerp(e, t) {
return ((this.x += (e.x - this.x) * t), (this.y += (e.y - this.y) * t), this)
}
lerpVectors(e, t, i) {
return ((this.x = e.x + (t.x - e.x) * i), (this.y = e.y + (t.y - e.y) * i), this)
}
equals(e) {
return e.x === this.x && e.y === this.y
}
fromArray(e, t = 0) {
return ((this.x = e[t]), (this.y = e[t + 1]), this)
}
toArray(e = [], t = 0) {
return ((e[t] = this.x), (e[t + 1] = this.y), e)
}
fromBufferAttribute(e, t) {
return ((this.x = e.getX(t)), (this.y = e.getY(t)), this)
}
rotateAround(e, t) {
const i = Math.cos(t),
r = Math.sin(t),
s = this.x - e.x,
o = this.y - e.y
return ((this.x = s * i - o * r + e.x), (this.y = s * r + o * i + e.y), this)
}
random() {
return ((this.x = Math.random()), (this.y = Math.random()), this)
}
*[Symbol.iterator]() {
;(yield this.x, yield this.y)
}
}
class mt {
constructor(e, t, i, r, s, o, a, l, c) {
;((mt.prototype.isMatrix3 = !0),
(this.elements = [1, 0, 0, 0, 1, 0, 0, 0, 1]),
e !== void 0 && this.set(e, t, i, r, s, o, a, l, c))
}
set(e, t, i, r, s, o, a, l, c) {
const u = this.elements
return (
(u[0] = e),
(u[1] = r),
(u[2] = a),
(u[3] = t),
(u[4] = s),
(u[5] = l),
(u[6] = i),
(u[7] = o),
(u[8] = c),
this
)
}
identity() {
return (this.set(1, 0, 0, 0, 1, 0, 0, 0, 1), this)
}
copy(e) {
const t = this.elements,
i = e.elements
return (
(t[0] = i[0]),
(t[1] = i[1]),
(t[2] = i[2]),
(t[3] = i[3]),
(t[4] = i[4]),
(t[5] = i[5]),
(t[6] = i[6]),
(t[7] = i[7]),
(t[8] = i[8]),
this
)
}
extractBasis(e, t, i) {
return (
e.setFromMatrix3Column(this, 0),
t.setFromMatrix3Column(this, 1),
i.setFromMatrix3Column(this, 2),
this
)
}
setFromMatrix4(e) {
const 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)
}
multiply(e) {
return this.multiplyMatrices(this, e)
}
premultiply(e) {
return this.multiplyMatrices(e, this)
}
multiplyMatrices(e, t) {
const i = e.elements,
r = t.elements,
s = this.elements,
o = i[0],
a = i[3],
l = i[6],
c = i[1],
u = i[4],
d = i[7],
h = i[2],
f = i[5],
p = i[8],
g = r[0],
y = r[3],
m = r[6],
v = r[1],
x = r[4],
_ = r[7],
S = r[2],
C = r[5],
A = r[8]
return (
(s[0] = o * g + a * v + l * S),
(s[3] = o * y + a * x + l * C),
(s[6] = o * m + a * _ + l * A),
(s[1] = c * g + u * v + d * S),
(s[4] = c * y + u * x + d * C),
(s[7] = c * m + u * _ + d * A),
(s[2] = h * g + f * v + p * S),
(s[5] = h * y + f * x + p * C),
(s[8] = h * m + f * _ + p * A),
this
)
}
multiplyScalar(e) {
const 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
)
}
determinant() {
const e = this.elements,
t = e[0],
i = e[1],
r = e[2],
s = e[3],
o = e[4],
a = e[5],
l = e[6],
c = e[7],
u = e[8]
return t * o * u - t * a * c - i * s * u + i * a * l + r * s * c - r * o * l
}
invert() {
const e = this.elements,
t = e[0],
i = e[1],
r = e[2],
s = e[3],
o = e[4],
a = e[5],
l = e[6],
c = e[7],
u = e[8],
d = u * o - a * c,
h = a * l - u * s,
f = c * s - o * l,
p = t * d + i * h + r * f
if (p === 0) return this.set(0, 0, 0, 0, 0, 0, 0, 0, 0)
const g = 1 / p
return (
(e[0] = d * g),
(e[1] = (r * c - u * i) * g),
(e[2] = (a * i - r * o) * g),
(e[3] = h * g),
(e[4] = (u * t - r * l) * g),
(e[5] = (r * s - a * t) * g),
(e[6] = f * g),
(e[7] = (i * l - c * t) * g),
(e[8] = (o * t - i * s) * g),
this
)
}
transpose() {
let e
const 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
)
}
getNormalMatrix(e) {
return this.setFromMatrix4(e).invert().transpose()
}
transposeIntoArray(e) {
const 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
)
}
setUvTransform(e, t, i, r, s, o, a) {
const l = Math.cos(s),
c = Math.sin(s)
return (
this.set(
i * l,
i * c,
-i * (l * o + c * a) + o + e,
-r * c,
r * l,
-r * (-c * o + l * a) + a + t,
0,
0,
1
),
this
)
}
scale(e, t) {
return (this.premultiply(dg.makeScale(e, t)), this)
}
rotate(e) {
return (this.premultiply(dg.makeRotation(-e)), this)
}
translate(e, t) {
return (this.premultiply(dg.makeTranslation(e, t)), this)
}
makeTranslation(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
)
}
makeRotation(e) {
const t = Math.cos(e),
i = Math.sin(e)
return (this.set(t, -i, 0, i, t, 0, 0, 0, 1), this)
}
makeScale(e, t) {
return (this.set(e, 0, 0, 0, t, 0, 0, 0, 1), this)
}
equals(e) {
const t = this.elements,
i = e.elements
for (let r = 0; r < 9; r++) if (t[r] !== i[r]) return !1
return !0
}
fromArray(e, t = 0) {
for (let i = 0; i < 9; i++) this.elements[i] = e[i + t]
return this
}
toArray(e = [], t = 0) {
const i = this.elements
return (
(e[t] = i[0]),
(e[t + 1] = i[1]),
(e[t + 2] = i[2]),
(e[t + 3] = i[3]),
(e[t + 4] = i[4]),
(e[t + 5] = i[5]),
(e[t + 6] = i[6]),
(e[t + 7] = i[7]),
(e[t + 8] = i[8]),
e
)
}
clone() {
return new this.constructor().fromArray(this.elements)
}
}
const dg = new mt()
function I5(n) {
for (let e = n.length - 1; e >= 0; --e) if (n[e] >= 65535) return !0
return !1
}
function dh(n) {
return document.createElementNS('http://www.w3.org/1999/xhtml', n)
}
function IP() {
const n = dh('canvas')
return ((n.style.display = 'block'), n)
}
const CS = {}
function Ec(n) {
n in CS || ((CS[n] = !0), console.warn(n))
}
function NP(n, e, t) {
return new Promise(function (i, r) {
function s() {
switch (n.clientWaitSync(e, n.SYNC_FLUSH_COMMANDS_BIT, 0)) {
case n.WAIT_FAILED:
r()
break
case n.TIMEOUT_EXPIRED:
setTimeout(s, t)
break
default:
i()
}
}
setTimeout(s, t)
})
}
function PP(n) {
const e = n.elements
;((e[2] = 0.5 * e[2] + 0.5 * e[3]),
(e[6] = 0.5 * e[6] + 0.5 * e[7]),
(e[10] = 0.5 * e[10] + 0.5 * e[11]),
(e[14] = 0.5 * e[14] + 0.5 * e[15]))
}
function LP(n) {
const e = n.elements
e[11] === -1 ? ((e[10] = -e[10] - 1), (e[14] = -e[14])) : ((e[10] = -e[10]), (e[14] = -e[14] + 1))
}
const ES = new mt().set(
0.4123908,
0.3575843,
0.1804808,
0.212639,
0.7151687,
0.0721923,
0.0193308,
0.1191948,
0.9505322
),
MS = new mt().set(
3.2409699,
-1.5373832,
-0.4986108,
-0.9692436,
1.8759675,
0.0415551,
0.0556301,
-0.203977,
1.0569715
)
function DP() {
const n = {
enabled: !0,
workingColorSpace: Bi,
spaces: {},
convert: function (r, s, o) {
return (
this.enabled === !1 ||
s === o ||
!s ||
!o ||
(this.spaces[s].transfer === Jt && ((r.r = Vo(r.r)), (r.g = Vo(r.g)), (r.b = Vo(r.b))),
this.spaces[s].primaries !== this.spaces[o].primaries &&
(r.applyMatrix3(this.spaces[s].toXYZ), r.applyMatrix3(this.spaces[o].fromXYZ)),
this.spaces[o].transfer === Jt && ((r.r = Wc(r.r)), (r.g = Wc(r.g)), (r.b = Wc(r.b)))),
r
)
},
fromWorkingColorSpace: function (r, s) {
return this.convert(r, this.workingColorSpace, s)
},
toWorkingColorSpace: function (r, s) {
return this.convert(r, s, this.workingColorSpace)
},
getPrimaries: function (r) {
return this.spaces[r].primaries
},
getTransfer: function (r) {
return r === Vs ? fm : this.spaces[r].transfer
},
getLuminanceCoefficients: function (r, s = this.workingColorSpace) {
return r.fromArray(this.spaces[s].luminanceCoefficients)
},
define: function (r) {
Object.assign(this.spaces, r)
},
_getMatrix: function (r, s, o) {
return r.copy(this.spaces[s].toXYZ).multiply(this.spaces[o].fromXYZ)
},
_getDrawingBufferColorSpace: function (r) {
return this.spaces[r].outputColorSpaceConfig.drawingBufferColorSpace
},
_getUnpackColorSpace: function (r = this.workingColorSpace) {
return this.spaces[r].workingColorSpaceConfig.unpackColorSpace
},
},
e = [0.64, 0.33, 0.3, 0.6, 0.15, 0.06],
t = [0.2126, 0.7152, 0.0722],
i = [0.3127, 0.329]
return (
n.define({
[Bi]: {
primaries: e,
whitePoint: i,
transfer: fm,
toXYZ: ES,
fromXYZ: MS,
luminanceCoefficients: t,
workingColorSpaceConfig: { unpackColorSpace: pi },
outputColorSpaceConfig: { drawingBufferColorSpace: pi },
},
[pi]: {
primaries: e,
whitePoint: i,
transfer: Jt,
toXYZ: ES,
fromXYZ: MS,
luminanceCoefficients: t,
outputColorSpaceConfig: { drawingBufferColorSpace: pi },
},
}),
n
)
}
const wt = DP()
function Vo(n) {
return n < 0.04045 ? n * 0.0773993808 : Math.pow(n * 0.9478672986 + 0.0521327014, 2.4)
}
function Wc(n) {
return n < 0.0031308 ? n * 12.92 : 1.055 * Math.pow(n, 0.41666) - 0.055
}
let rc
class FP {
static getDataURL(e) {
if (/^data:/i.test(e.src) || typeof HTMLCanvasElement > 'u') return e.src
let t
if (e instanceof HTMLCanvasElement) t = e
else {
;(rc === void 0 && (rc = dh('canvas')), (rc.width = e.width), (rc.height = e.height))
const i = rc.getContext('2d')
;(e instanceof ImageData ? i.putImageData(e, 0, 0) : i.drawImage(e, 0, 0, e.width, e.height),
(t = rc))
}
return t.toDataURL('image/png')
}
static sRGBToLinear(e) {
if (
(typeof HTMLImageElement < 'u' && e instanceof HTMLImageElement) ||
(typeof HTMLCanvasElement < 'u' && e instanceof HTMLCanvasElement) ||
(typeof ImageBitmap < 'u' && e instanceof ImageBitmap)
) {
const t = dh('canvas')
;((t.width = e.width), (t.height = e.height))
const i = t.getContext('2d')
i.drawImage(e, 0, 0, e.width, e.height)
const r = i.getImageData(0, 0, e.width, e.height),
s = r.data
for (let o = 0; o < s.length; o++) s[o] = Vo(s[o] / 255) * 255
return (i.putImageData(r, 0, 0), t)
} else if (e.data) {
const t = e.data.slice(0)
for (let i = 0; i < t.length; i++)
t instanceof Uint8Array || t instanceof Uint8ClampedArray
? (t[i] = Math.floor(Vo(t[i] / 255) * 255))
: (t[i] = Vo(t[i]))
return { data: t, width: e.width, height: e.height }
} else
return (
console.warn(
'THREE.ImageUtils.sRGBToLinear(): Unsupported image type. No color space conversion applied.'
),
e
)
}
}
let OP = 0
class N5 {
constructor(e = null) {
;((this.isSource = !0),
Object.defineProperty(this, 'id', { value: OP++ }),
(this.uuid = xs()),
(this.data = e),
(this.dataReady = !0),
(this.version = 0))
}
set needsUpdate(e) {
e === !0 && this.version++
}
toJSON(e) {
const t = e === void 0 || typeof e == 'string'
if (!t && e.images[this.uuid] !== void 0) return e.images[this.uuid]
const i = { uuid: this.uuid, url: '' },
r = this.data
if (r !== null) {
let s
if (Array.isArray(r)) {
s = []
for (let o = 0, a = r.length; o < a; o++)
r[o].isDataTexture ? s.push(hg(r[o].image)) : s.push(hg(r[o]))
} else s = hg(r)
i.url = s
}
return (t || (e.images[this.uuid] = i), i)
}
}
function hg(n) {
return (typeof HTMLImageElement < 'u' && n instanceof HTMLImageElement) ||
(typeof HTMLCanvasElement < 'u' && n instanceof HTMLCanvasElement) ||
(typeof ImageBitmap < 'u' && n instanceof ImageBitmap)
? FP.getDataURL(n)
: n.data
? {
data: Array.from(n.data),
width: n.width,
height: n.height,
type: n.data.constructor.name,
}
: (console.warn('THREE.Texture: Unable to serialize Texture.'), {})
}
let BP = 0
class Wn extends so {
constructor(
e = Wn.DEFAULT_IMAGE,
t = Wn.DEFAULT_MAPPING,
i = wa,
r = wa,
s = Ir,
o = $s,
a = Di,
l = eo,
c = Wn.DEFAULT_ANISOTROPY,
u = Vs
) {
;(super(),
(this.isTexture = !0),
Object.defineProperty(this, 'id', { value: BP++ }),
(this.uuid = xs()),
(this.name = ''),
(this.source = new N5(e)),
(this.mipmaps = []),
(this.mapping = t),
(this.channel = 0),
(this.wrapS = i),
(this.wrapT = r),
(this.magFilter = s),
(this.minFilter = o),
(this.anisotropy = c),
(this.format = a),
(this.internalFormat = null),
(this.type = l),
(this.offset = new qe(0, 0)),
(this.repeat = new qe(1, 1)),
(this.center = new qe(0, 0)),
(this.rotation = 0),
(this.matrixAutoUpdate = !0),
(this.matrix = new mt()),
(this.generateMipmaps = !0),
(this.premultiplyAlpha = !1),
(this.flipY = !0),
(this.unpackAlignment = 4),
(this.colorSpace = u),
(this.userData = {}),
(this.version = 0),
(this.onUpdate = null),
(this.renderTarget = null),
(this.isRenderTargetTexture = !1),
(this.pmremVersion = 0))
}
get image() {
return this.source.data
}
set image(e = null) {
this.source.data = e
}
updateMatrix() {
this.matrix.setUvTransform(
this.offset.x,
this.offset.y,
this.repeat.x,
this.repeat.y,
this.rotation,
this.center.x,
this.center.y
)
}
clone() {
return new this.constructor().copy(this)
}
copy(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
)
}
toJSON(e) {
const t = e === void 0 || typeof e == 'string'
if (!t && e.textures[this.uuid] !== void 0) return e.textures[this.uuid]
const i = {
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 && (i.userData = this.userData),
t || (e.textures[this.uuid] = i),
i
)
}
dispose() {
this.dispatchEvent({ type: 'dispose' })
}
transformUv(e) {
if (this.mapping !== g_) return e
if ((e.applyMatrix3(this.matrix), e.x < 0 || e.x > 1))
switch (this.wrapS) {
case uu:
e.x = e.x - Math.floor(e.x)
break
case wa:
e.x = e.x < 0 ? 0 : 1
break
case um:
Math.abs(Math.floor(e.x) % 2) === 1
? (e.x = Math.ceil(e.x) - e.x)
: (e.x = e.x - Math.floor(e.x))
break
}
if (e.y < 0 || e.y > 1)
switch (this.wrapT) {
case uu:
e.y = e.y - Math.floor(e.y)
break
case wa:
e.y = e.y < 0 ? 0 : 1
break
case um:
Math.abs(Math.floor(e.y) % 2) === 1
? (e.y = Math.ceil(e.y) - e.y)
: (e.y = e.y - Math.floor(e.y))
break
}
return (this.flipY && (e.y = 1 - e.y), e)
}
set needsUpdate(e) {
e === !0 && (this.version++, (this.source.needsUpdate = !0))
}
set needsPMREMUpdate(e) {
e === !0 && this.pmremVersion++
}
}
Wn.DEFAULT_IMAGE = null
Wn.DEFAULT_MAPPING = g_
Wn.DEFAULT_ANISOTROPY = 1
class Mt {
constructor(e = 0, t = 0, i = 0, r = 1) {
;((Mt.prototype.isVector4 = !0), (this.x = e), (this.y = t), (this.z = i), (this.w = r))
}
get width() {
return this.z
}
set width(e) {
this.z = e
}
get height() {
return this.w
}
set height(e) {
this.w = e
}
set(e, t, i, r) {
return ((this.x = e), (this.y = t), (this.z = i), (this.w = r), this)
}
setScalar(e) {
return ((this.x = e), (this.y = e), (this.z = e), (this.w = e), this)
}
setX(e) {
return ((this.x = e), this)
}
setY(e) {
return ((this.y = e), this)
}
setZ(e) {
return ((this.z = e), this)
}
setW(e) {
return ((this.w = e), this)
}
setComponent(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
}
getComponent(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)
}
}
clone() {
return new this.constructor(this.x, this.y, this.z, this.w)
}
copy(e) {
return (
(this.x = e.x),
(this.y = e.y),
(this.z = e.z),
(this.w = e.w !== void 0 ? e.w : 1),
this
)
}
add(e) {
return ((this.x += e.x), (this.y += e.y), (this.z += e.z), (this.w += e.w), this)
}
addScalar(e) {
return ((this.x += e), (this.y += e), (this.z += e), (this.w += e), this)
}
addVectors(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
)
}
addScaledVector(e, t) {
return (
(this.x += e.x * t),
(this.y += e.y * t),
(this.z += e.z * t),
(this.w += e.w * t),
this
)
}
sub(e) {
return ((this.x -= e.x), (this.y -= e.y), (this.z -= e.z), (this.w -= e.w), this)
}
subScalar(e) {
return ((this.x -= e), (this.y -= e), (this.z -= e), (this.w -= e), this)
}
subVectors(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
)
}
multiply(e) {
return ((this.x *= e.x), (this.y *= e.y), (this.z *= e.z), (this.w *= e.w), this)
}
multiplyScalar(e) {
return ((this.x *= e), (this.y *= e), (this.z *= e), (this.w *= e), this)
}
applyMatrix4(e) {
const t = this.x,
i = this.y,
r = this.z,
s = this.w,
o = e.elements
return (
(this.x = o[0] * t + o[4] * i + o[8] * r + o[12] * s),
(this.y = o[1] * t + o[5] * i + o[9] * r + o[13] * s),
(this.z = o[2] * t + o[6] * i + o[10] * r + o[14] * s),
(this.w = o[3] * t + o[7] * i + o[11] * r + o[15] * s),
this
)
}
divide(e) {
return ((this.x /= e.x), (this.y /= e.y), (this.z /= e.z), (this.w /= e.w), this)
}
divideScalar(e) {
return this.multiplyScalar(1 / e)
}
setAxisAngleFromQuaternion(e) {
this.w = 2 * Math.acos(e.w)
const 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
)
}
setAxisAngleFromRotationMatrix(e) {
let t, i, r, s
const l = e.elements,
c = l[0],
u = l[4],
d = l[8],
h = l[1],
f = l[5],
p = l[9],
g = l[2],
y = l[6],
m = l[10]
if (Math.abs(u - h) < 0.01 && Math.abs(d - g) < 0.01 && Math.abs(p - y) < 0.01) {
if (
Math.abs(u + h) < 0.1 &&
Math.abs(d + g) < 0.1 &&
Math.abs(p + y) < 0.1 &&
Math.abs(c + f + m - 3) < 0.1
)
return (this.set(1, 0, 0, 0), this)
t = Math.PI
const x = (c + 1) / 2,
_ = (f + 1) / 2,
S = (m + 1) / 2,
C = (u + h) / 4,
A = (d + g) / 4,
R = (p + y) / 4
return (
x > _ && x > S
? x < 0.01
? ((i = 0), (r = 0.707106781), (s = 0.707106781))
: ((i = Math.sqrt(x)), (r = C / i), (s = A / i))
: _ > S
? _ < 0.01
? ((i = 0.707106781), (r = 0), (s = 0.707106781))
: ((r = Math.sqrt(_)), (i = C / r), (s = R / r))
: S < 0.01
? ((i = 0.707106781), (r = 0.707106781), (s = 0))
: ((s = Math.sqrt(S)), (i = A / s), (r = R / s)),
this.set(i, r, s, t),
this
)
}
let v = Math.sqrt((y - p) * (y - p) + (d - g) * (d - g) + (h - u) * (h - u))
return (
Math.abs(v) < 0.001 && (v = 1),
(this.x = (y - p) / v),
(this.y = (d - g) / v),
(this.z = (h - u) / v),
(this.w = Math.acos((c + f + m - 1) / 2)),
this
)
}
setFromMatrixPosition(e) {
const t = e.elements
return ((this.x = t[12]), (this.y = t[13]), (this.z = t[14]), (this.w = t[15]), this)
}
min(e) {
return (
(this.x = Math.min(this.x, e.x)),
(this.y = Math.min(this.y, e.y)),
(this.z = Math.min(this.z, e.z)),
(this.w = Math.min(this.w, e.w)),
this
)
}
max(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
)
}
clamp(e, t) {
return (
(this.x = Nt(this.x, e.x, t.x)),
(this.y = Nt(this.y, e.y, t.y)),
(this.z = Nt(this.z, e.z, t.z)),
(this.w = Nt(this.w, e.w, t.w)),
this
)
}
clampScalar(e, t) {
return (
(this.x = Nt(this.x, e, t)),
(this.y = Nt(this.y, e, t)),
(this.z = Nt(this.z, e, t)),
(this.w = Nt(this.w, e, t)),
this
)
}
clampLength(e, t) {
const i = this.length()
return this.divideScalar(i || 1).multiplyScalar(Nt(i, e, t))
}
floor() {
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
)
}
ceil() {
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
)
}
round() {
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
)
}
roundToZero() {
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
)
}
negate() {
return ((this.x = -this.x), (this.y = -this.y), (this.z = -this.z), (this.w = -this.w), this)
}
dot(e) {
return this.x * e.x + this.y * e.y + this.z * e.z + this.w * e.w
}
lengthSq() {
return this.x * this.x + this.y * this.y + this.z * this.z + this.w * this.w
}
length() {
return Math.sqrt(this.x * this.x + this.y * this.y + this.z * this.z + this.w * this.w)
}
manhattanLength() {
return Math.abs(this.x) + Math.abs(this.y) + Math.abs(this.z) + Math.abs(this.w)
}
normalize() {
return this.divideScalar(this.length() || 1)
}
setLength(e) {
return this.normalize().multiplyScalar(e)
}
lerp(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
)
}
lerpVectors(e, t, i) {
return (
(this.x = e.x + (t.x - e.x) * i),
(this.y = e.y + (t.y - e.y) * i),
(this.z = e.z + (t.z - e.z) * i),
(this.w = e.w + (t.w - e.w) * i),
this
)
}
equals(e) {
return e.x === this.x && e.y === this.y && e.z === this.z && e.w === this.w
}
fromArray(e, t = 0) {
return ((this.x = e[t]), (this.y = e[t + 1]), (this.z = e[t + 2]), (this.w = e[t + 3]), this)
}
toArray(e = [], t = 0) {
return ((e[t] = this.x), (e[t + 1] = this.y), (e[t + 2] = this.z), (e[t + 3] = this.w), e)
}
fromBufferAttribute(e, t) {
return (
(this.x = e.getX(t)),
(this.y = e.getY(t)),
(this.z = e.getZ(t)),
(this.w = e.getW(t)),
this
)
}
random() {
return (
(this.x = Math.random()),
(this.y = Math.random()),
(this.z = Math.random()),
(this.w = Math.random()),
this
)
}
*[Symbol.iterator]() {
;(yield this.x, yield this.y, yield this.z, yield this.w)
}
}
class Bh extends so {
constructor(e = 1, t = 1, i = {}) {
;(super(),
(this.isRenderTarget = !0),
(this.width = e),
(this.height = t),
(this.depth = 1),
(this.scissor = new Mt(0, 0, e, t)),
(this.scissorTest = !1),
(this.viewport = new Mt(0, 0, e, t)))
const r = { width: e, height: t, depth: 1 }
i = Object.assign(
{
generateMipmaps: !1,
internalFormat: null,
minFilter: Ir,
depthBuffer: !0,
stencilBuffer: !1,
resolveDepthBuffer: !0,
resolveStencilBuffer: !0,
depthTexture: null,
samples: 0,
count: 1,
},
i
)
const s = new Wn(
r,
i.mapping,
i.wrapS,
i.wrapT,
i.magFilter,
i.minFilter,
i.format,
i.type,
i.anisotropy,
i.colorSpace
)
;((s.flipY = !1),
(s.generateMipmaps = i.generateMipmaps),
(s.internalFormat = i.internalFormat),
(this.textures = []))
const o = i.count
for (let a = 0; a < o; a++)
((this.textures[a] = s.clone()),
(this.textures[a].isRenderTargetTexture = !0),
(this.textures[a].renderTarget = this))
;((this.depthBuffer = i.depthBuffer),
(this.stencilBuffer = i.stencilBuffer),
(this.resolveDepthBuffer = i.resolveDepthBuffer),
(this.resolveStencilBuffer = i.resolveStencilBuffer),
(this._depthTexture = null),
(this.depthTexture = i.depthTexture),
(this.samples = i.samples))
}
get texture() {
return this.textures[0]
}
set texture(e) {
this.textures[0] = e
}
set depthTexture(e) {
;(this._depthTexture !== null && (this._depthTexture.renderTarget = null),
e !== null && (e.renderTarget = this),
(this._depthTexture = e))
}
get depthTexture() {
return this._depthTexture
}
setSize(e, t, i = 1) {
if (this.width !== e || this.height !== t || this.depth !== i) {
;((this.width = e), (this.height = t), (this.depth = i))
for (let r = 0, s = this.textures.length; r < s; r++)
((this.textures[r].image.width = e),
(this.textures[r].image.height = t),
(this.textures[r].image.depth = i))
this.dispose()
}
;(this.viewport.set(0, 0, e, t), this.scissor.set(0, 0, e, t))
}
clone() {
return new this.constructor().copy(this)
}
copy(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 (let i = 0, r = e.textures.length; i < r; i++)
((this.textures[i] = e.textures[i].clone()),
(this.textures[i].isRenderTargetTexture = !0),
(this.textures[i].renderTarget = this))
const t = Object.assign({}, e.texture.image)
return (
(this.texture.source = new N5(t)),
(this.depthBuffer = e.depthBuffer),
(this.stencilBuffer = e.stencilBuffer),
(this.resolveDepthBuffer = e.resolveDepthBuffer),
(this.resolveStencilBuffer = e.resolveStencilBuffer),
e.depthTexture !== null && (this.depthTexture = e.depthTexture.clone()),
(this.samples = e.samples),
this
)
}
dispose() {
this.dispatchEvent({ type: 'dispose' })
}
}
class Ua extends Bh {
constructor(e = 1, t = 1, i = {}) {
;(super(e, t, i), (this.isWebGLRenderTarget = !0))
}
}
class b_ extends Wn {
constructor(e = null, t = 1, i = 1, r = 1) {
;(super(null),
(this.isDataArrayTexture = !0),
(this.image = { data: e, width: t, height: i, depth: r }),
(this.magFilter = _i),
(this.minFilter = _i),
(this.wrapR = wa),
(this.generateMipmaps = !1),
(this.flipY = !1),
(this.unpackAlignment = 1),
(this.layerUpdates = new Set()))
}
addLayerUpdate(e) {
this.layerUpdates.add(e)
}
clearLayerUpdates() {
this.layerUpdates.clear()
}
}
class UP extends Wn {
constructor(e = null, t = 1, i = 1, r = 1) {
;(super(null),
(this.isData3DTexture = !0),
(this.image = { data: e, width: t, height: i, depth: r }),
(this.magFilter = _i),
(this.minFilter = _i),
(this.wrapR = wa),
(this.generateMipmaps = !1),
(this.flipY = !1),
(this.unpackAlignment = 1))
}
}
class Qt {
constructor(e = 0, t = 0, i = 0, r = 1) {
;((this.isQuaternion = !0), (this._x = e), (this._y = t), (this._z = i), (this._w = r))
}
static slerpFlat(e, t, i, r, s, o, a) {
let l = i[r + 0],
c = i[r + 1],
u = i[r + 2],
d = i[r + 3]
const h = s[o + 0],
f = s[o + 1],
p = s[o + 2],
g = s[o + 3]
if (a === 0) {
;((e[t + 0] = l), (e[t + 1] = c), (e[t + 2] = u), (e[t + 3] = d))
return
}
if (a === 1) {
;((e[t + 0] = h), (e[t + 1] = f), (e[t + 2] = p), (e[t + 3] = g))
return
}
if (d !== g || l !== h || c !== f || u !== p) {
let y = 1 - a
const m = l * h + c * f + u * p + d * g,
v = m >= 0 ? 1 : -1,
x = 1 - m * m
if (x > Number.EPSILON) {
const S = Math.sqrt(x),
C = Math.atan2(S, m * v)
;((y = Math.sin(y * C) / S), (a = Math.sin(a * C) / S))
}
const _ = a * v
if (
((l = l * y + h * _),
(c = c * y + f * _),
(u = u * y + p * _),
(d = d * y + g * _),
y === 1 - a)
) {
const S = 1 / Math.sqrt(l * l + c * c + u * u + d * d)
;((l *= S), (c *= S), (u *= S), (d *= S))
}
}
;((e[t] = l), (e[t + 1] = c), (e[t + 2] = u), (e[t + 3] = d))
}
static multiplyQuaternionsFlat(e, t, i, r, s, o) {
const a = i[r],
l = i[r + 1],
c = i[r + 2],
u = i[r + 3],
d = s[o],
h = s[o + 1],
f = s[o + 2],
p = s[o + 3]
return (
(e[t] = a * p + u * d + l * f - c * h),
(e[t + 1] = l * p + u * h + c * d - a * f),
(e[t + 2] = c * p + u * f + a * h - l * d),
(e[t + 3] = u * p - a * d - l * h - c * f),
e
)
}
get x() {
return this._x
}
set x(e) {
;((this._x = e), this._onChangeCallback())
}
get y() {
return this._y
}
set y(e) {
;((this._y = e), this._onChangeCallback())
}
get z() {
return this._z
}
set z(e) {
;((this._z = e), this._onChangeCallback())
}
get w() {
return this._w
}
set w(e) {
;((this._w = e), this._onChangeCallback())
}
set(e, t, i, r) {
return (
(this._x = e),
(this._y = t),
(this._z = i),
(this._w = r),
this._onChangeCallback(),
this
)
}
clone() {
return new this.constructor(this._x, this._y, this._z, this._w)
}
copy(e) {
return (
(this._x = e.x),
(this._y = e.y),
(this._z = e.z),
(this._w = e.w),
this._onChangeCallback(),
this
)
}
setFromEuler(e, t = !0) {
const i = e._x,
r = e._y,
s = e._z,
o = e._order,
a = Math.cos,
l = Math.sin,
c = a(i / 2),
u = a(r / 2),
d = a(s / 2),
h = l(i / 2),
f = l(r / 2),
p = l(s / 2)
switch (o) {
case 'XYZ':
;((this._x = h * u * d + c * f * p),
(this._y = c * f * d - h * u * p),
(this._z = c * u * p + h * f * d),
(this._w = c * u * d - h * f * p))
break
case 'YXZ':
;((this._x = h * u * d + c * f * p),
(this._y = c * f * d - h * u * p),
(this._z = c * u * p - h * f * d),
(this._w = c * u * d + h * f * p))
break
case 'ZXY':
;((this._x = h * u * d - c * f * p),
(this._y = c * f * d + h * u * p),
(this._z = c * u * p + h * f * d),
(this._w = c * u * d - h * f * p))
break
case 'ZYX':
;((this._x = h * u * d - c * f * p),
(this._y = c * f * d + h * u * p),
(this._z = c * u * p - h * f * d),
(this._w = c * u * d + h * f * p))
break
case 'YZX':
;((this._x = h * u * d + c * f * p),
(this._y = c * f * d + h * u * p),
(this._z = c * u * p - h * f * d),
(this._w = c * u * d - h * f * p))
break
case 'XZY':
;((this._x = h * u * d - c * f * p),
(this._y = c * f * d - h * u * p),
(this._z = c * u * p + h * f * d),
(this._w = c * u * d + h * f * p))
break
default:
console.warn('THREE.Quaternion: .setFromEuler() encountered an unknown order: ' + o)
}
return (t === !0 && this._onChangeCallback(), this)
}
setFromAxisAngle(e, t) {
const i = t / 2,
r = Math.sin(i)
return (
(this._x = e.x * r),
(this._y = e.y * r),
(this._z = e.z * r),
(this._w = Math.cos(i)),
this._onChangeCallback(),
this
)
}
setFromRotationMatrix(e) {
const t = e.elements,
i = t[0],
r = t[4],
s = t[8],
o = t[1],
a = t[5],
l = t[9],
c = t[2],
u = t[6],
d = t[10],
h = i + a + d
if (h > 0) {
const f = 0.5 / Math.sqrt(h + 1)
;((this._w = 0.25 / f),
(this._x = (u - l) * f),
(this._y = (s - c) * f),
(this._z = (o - r) * f))
} else if (i > a && i > d) {
const f = 2 * Math.sqrt(1 + i - a - d)
;((this._w = (u - l) / f),
(this._x = 0.25 * f),
(this._y = (r + o) / f),
(this._z = (s + c) / f))
} else if (a > d) {
const f = 2 * Math.sqrt(1 + a - i - d)
;((this._w = (s - c) / f),
(this._x = (r + o) / f),
(this._y = 0.25 * f),
(this._z = (l + u) / f))
} else {
const f = 2 * Math.sqrt(1 + d - i - a)
;((this._w = (o - r) / f),
(this._x = (s + c) / f),
(this._y = (l + u) / f),
(this._z = 0.25 * f))
}
return (this._onChangeCallback(), this)
}
setFromUnitVectors(e, t) {
let i = e.dot(t) + 1
return (
i < Number.EPSILON
? ((i = 0),
Math.abs(e.x) > Math.abs(e.z)
? ((this._x = -e.y), (this._y = e.x), (this._z = 0), (this._w = i))
: ((this._x = 0), (this._y = -e.z), (this._z = e.y), (this._w = i)))
: ((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 = i)),
this.normalize()
)
}
angleTo(e) {
return 2 * Math.acos(Math.abs(Nt(this.dot(e), -1, 1)))
}
rotateTowards(e, t) {
const i = this.angleTo(e)
if (i === 0) return this
const r = Math.min(1, t / i)
return (this.slerp(e, r), this)
}
identity() {
return this.set(0, 0, 0, 1)
}
invert() {
return this.conjugate()
}
conjugate() {
return ((this._x *= -1), (this._y *= -1), (this._z *= -1), this._onChangeCallback(), this)
}
dot(e) {
return this._x * e._x + this._y * e._y + this._z * e._z + this._w * e._w
}
lengthSq() {
return this._x * this._x + this._y * this._y + this._z * this._z + this._w * this._w
}
length() {
return Math.sqrt(this._x * this._x + this._y * this._y + this._z * this._z + this._w * this._w)
}
normalize() {
let e = this.length()
return (
e === 0
? ((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
)
}
multiply(e) {
return this.multiplyQuaternions(this, e)
}
premultiply(e) {
return this.multiplyQuaternions(e, this)
}
multiplyQuaternions(e, t) {
const i = e._x,
r = e._y,
s = e._z,
o = e._w,
a = t._x,
l = t._y,
c = t._z,
u = t._w
return (
(this._x = i * u + o * a + r * c - s * l),
(this._y = r * u + o * l + s * a - i * c),
(this._z = s * u + o * c + i * l - r * a),
(this._w = o * u - i * a - r * l - s * c),
this._onChangeCallback(),
this
)
}
slerp(e, t) {
if (t === 0) return this
if (t === 1) return this.copy(e)
const i = this._x,
r = this._y,
s = this._z,
o = this._w
let a = o * e._w + i * e._x + r * e._y + s * e._z
if (
(a < 0
? ((this._w = -e._w), (this._x = -e._x), (this._y = -e._y), (this._z = -e._z), (a = -a))
: this.copy(e),
a >= 1)
)
return ((this._w = o), (this._x = i), (this._y = r), (this._z = s), this)
const l = 1 - a * a
if (l <= Number.EPSILON) {
const f = 1 - t
return (
(this._w = f * o + t * this._w),
(this._x = f * i + t * this._x),
(this._y = f * r + t * this._y),
(this._z = f * s + t * this._z),
this.normalize(),
this
)
}
const c = Math.sqrt(l),
u = Math.atan2(c, a),
d = Math.sin((1 - t) * u) / c,
h = Math.sin(t * u) / c
return (
(this._w = o * d + this._w * h),
(this._x = i * d + this._x * h),
(this._y = r * d + this._y * h),
(this._z = s * d + this._z * h),
this._onChangeCallback(),
this
)
}
slerpQuaternions(e, t, i) {
return this.copy(e).slerp(t, i)
}
random() {
const e = 2 * Math.PI * Math.random(),
t = 2 * Math.PI * Math.random(),
i = Math.random(),
r = Math.sqrt(1 - i),
s = Math.sqrt(i)
return this.set(r * Math.sin(e), r * Math.cos(e), s * Math.sin(t), s * Math.cos(t))
}
equals(e) {
return e._x === this._x && e._y === this._y && e._z === this._z && e._w === this._w
}
fromArray(e, t = 0) {
return (
(this._x = e[t]),
(this._y = e[t + 1]),
(this._z = e[t + 2]),
(this._w = e[t + 3]),
this._onChangeCallback(),
this
)
}
toArray(e = [], t = 0) {
return ((e[t] = this._x), (e[t + 1] = this._y), (e[t + 2] = this._z), (e[t + 3] = this._w), e)
}
fromBufferAttribute(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
)
}
toJSON() {
return this.toArray()
}
_onChange(e) {
return ((this._onChangeCallback = e), this)
}
_onChangeCallback() {}
*[Symbol.iterator]() {
;(yield this._x, yield this._y, yield this._z, yield this._w)
}
}
class Y {
constructor(e = 0, t = 0, i = 0) {
;((Y.prototype.isVector3 = !0), (this.x = e), (this.y = t), (this.z = i))
}
set(e, t, i) {
return (i === void 0 && (i = this.z), (this.x = e), (this.y = t), (this.z = i), this)
}
setScalar(e) {
return ((this.x = e), (this.y = e), (this.z = e), this)
}
setX(e) {
return ((this.x = e), this)
}
setY(e) {
return ((this.y = e), this)
}
setZ(e) {
return ((this.z = e), this)
}
setComponent(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
}
getComponent(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)
}
}
clone() {
return new this.constructor(this.x, this.y, this.z)
}
copy(e) {
return ((this.x = e.x), (this.y = e.y), (this.z = e.z), this)
}
add(e) {
return ((this.x += e.x), (this.y += e.y), (this.z += e.z), this)
}
addScalar(e) {
return ((this.x += e), (this.y += e), (this.z += e), this)
}
addVectors(e, t) {
return ((this.x = e.x + t.x), (this.y = e.y + t.y), (this.z = e.z + t.z), this)
}
addScaledVector(e, t) {
return ((this.x += e.x * t), (this.y += e.y * t), (this.z += e.z * t), this)
}
sub(e) {
return ((this.x -= e.x), (this.y -= e.y), (this.z -= e.z), this)
}
subScalar(e) {
return ((this.x -= e), (this.y -= e), (this.z -= e), this)
}
subVectors(e, t) {
return ((this.x = e.x - t.x), (this.y = e.y - t.y), (this.z = e.z - t.z), this)
}
multiply(e) {
return ((this.x *= e.x), (this.y *= e.y), (this.z *= e.z), this)
}
multiplyScalar(e) {
return ((this.x *= e), (this.y *= e), (this.z *= e), this)
}
multiplyVectors(e, t) {
return ((this.x = e.x * t.x), (this.y = e.y * t.y), (this.z = e.z * t.z), this)
}
applyEuler(e) {
return this.applyQuaternion(RS.setFromEuler(e))
}
applyAxisAngle(e, t) {
return this.applyQuaternion(RS.setFromAxisAngle(e, t))
}
applyMatrix3(e) {
const t = this.x,
i = this.y,
r = this.z,
s = e.elements
return (
(this.x = s[0] * t + s[3] * i + s[6] * r),
(this.y = s[1] * t + s[4] * i + s[7] * r),
(this.z = s[2] * t + s[5] * i + s[8] * r),
this
)
}
applyNormalMatrix(e) {
return this.applyMatrix3(e).normalize()
}
applyMatrix4(e) {
const t = this.x,
i = this.y,
r = this.z,
s = e.elements,
o = 1 / (s[3] * t + s[7] * i + s[11] * r + s[15])
return (
(this.x = (s[0] * t + s[4] * i + s[8] * r + s[12]) * o),
(this.y = (s[1] * t + s[5] * i + s[9] * r + s[13]) * o),
(this.z = (s[2] * t + s[6] * i + s[10] * r + s[14]) * o),
this
)
}
applyQuaternion(e) {
const t = this.x,
i = this.y,
r = this.z,
s = e.x,
o = e.y,
a = e.z,
l = e.w,
c = 2 * (o * r - a * i),
u = 2 * (a * t - s * r),
d = 2 * (s * i - o * t)
return (
(this.x = t + l * c + o * d - a * u),
(this.y = i + l * u + a * c - s * d),
(this.z = r + l * d + s * u - o * c),
this
)
}
project(e) {
return this.applyMatrix4(e.matrixWorldInverse).applyMatrix4(e.projectionMatrix)
}
unproject(e) {
return this.applyMatrix4(e.projectionMatrixInverse).applyMatrix4(e.matrixWorld)
}
transformDirection(e) {
const t = this.x,
i = this.y,
r = this.z,
s = e.elements
return (
(this.x = s[0] * t + s[4] * i + s[8] * r),
(this.y = s[1] * t + s[5] * i + s[9] * r),
(this.z = s[2] * t + s[6] * i + s[10] * r),
this.normalize()
)
}
divide(e) {
return ((this.x /= e.x), (this.y /= e.y), (this.z /= e.z), this)
}
divideScalar(e) {
return this.multiplyScalar(1 / e)
}
min(e) {
return (
(this.x = Math.min(this.x, e.x)),
(this.y = Math.min(this.y, e.y)),
(this.z = Math.min(this.z, e.z)),
this
)
}
max(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
)
}
clamp(e, t) {
return (
(this.x = Nt(this.x, e.x, t.x)),
(this.y = Nt(this.y, e.y, t.y)),
(this.z = Nt(this.z, e.z, t.z)),
this
)
}
clampScalar(e, t) {
return (
(this.x = Nt(this.x, e, t)),
(this.y = Nt(this.y, e, t)),
(this.z = Nt(this.z, e, t)),
this
)
}
clampLength(e, t) {
const i = this.length()
return this.divideScalar(i || 1).multiplyScalar(Nt(i, e, t))
}
floor() {
return (
(this.x = Math.floor(this.x)),
(this.y = Math.floor(this.y)),
(this.z = Math.floor(this.z)),
this
)
}
ceil() {
return (
(this.x = Math.ceil(this.x)),
(this.y = Math.ceil(this.y)),
(this.z = Math.ceil(this.z)),
this
)
}
round() {
return (
(this.x = Math.round(this.x)),
(this.y = Math.round(this.y)),
(this.z = Math.round(this.z)),
this
)
}
roundToZero() {
return (
(this.x = Math.trunc(this.x)),
(this.y = Math.trunc(this.y)),
(this.z = Math.trunc(this.z)),
this
)
}
negate() {
return ((this.x = -this.x), (this.y = -this.y), (this.z = -this.z), this)
}
dot(e) {
return this.x * e.x + this.y * e.y + this.z * e.z
}
lengthSq() {
return this.x * this.x + this.y * this.y + this.z * this.z
}
length() {
return Math.sqrt(this.x * this.x + this.y * this.y + this.z * this.z)
}
manhattanLength() {
return Math.abs(this.x) + Math.abs(this.y) + Math.abs(this.z)
}
normalize() {
return this.divideScalar(this.length() || 1)
}
setLength(e) {
return this.normalize().multiplyScalar(e)
}
lerp(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
)
}
lerpVectors(e, t, i) {
return (
(this.x = e.x + (t.x - e.x) * i),
(this.y = e.y + (t.y - e.y) * i),
(this.z = e.z + (t.z - e.z) * i),
this
)
}
cross(e) {
return this.crossVectors(this, e)
}
crossVectors(e, t) {
const i = e.x,
r = e.y,
s = e.z,
o = t.x,
a = t.y,
l = t.z
return ((this.x = r * l - s * a), (this.y = s * o - i * l), (this.z = i * a - r * o), this)
}
projectOnVector(e) {
const t = e.lengthSq()
if (t === 0) return this.set(0, 0, 0)
const i = e.dot(this) / t
return this.copy(e).multiplyScalar(i)
}
projectOnPlane(e) {
return (fg.copy(this).projectOnVector(e), this.sub(fg))
}
reflect(e) {
return this.sub(fg.copy(e).multiplyScalar(2 * this.dot(e)))
}
angleTo(e) {
const t = Math.sqrt(this.lengthSq() * e.lengthSq())
if (t === 0) return Math.PI / 2
const i = this.dot(e) / t
return Math.acos(Nt(i, -1, 1))
}
distanceTo(e) {
return Math.sqrt(this.distanceToSquared(e))
}
distanceToSquared(e) {
const t = this.x - e.x,
i = this.y - e.y,
r = this.z - e.z
return t * t + i * i + r * r
}
manhattanDistanceTo(e) {
return Math.abs(this.x - e.x) + Math.abs(this.y - e.y) + Math.abs(this.z - e.z)
}
setFromSpherical(e) {
return this.setFromSphericalCoords(e.radius, e.phi, e.theta)
}
setFromSphericalCoords(e, t, i) {
const r = Math.sin(t) * e
return (
(this.x = r * Math.sin(i)),
(this.y = Math.cos(t) * e),
(this.z = r * Math.cos(i)),
this
)
}
setFromCylindrical(e) {
return this.setFromCylindricalCoords(e.radius, e.theta, e.y)
}
setFromCylindricalCoords(e, t, i) {
return ((this.x = e * Math.sin(t)), (this.y = i), (this.z = e * Math.cos(t)), this)
}
setFromMatrixPosition(e) {
const t = e.elements
return ((this.x = t[12]), (this.y = t[13]), (this.z = t[14]), this)
}
setFromMatrixScale(e) {
const t = this.setFromMatrixColumn(e, 0).length(),
i = this.setFromMatrixColumn(e, 1).length(),
r = this.setFromMatrixColumn(e, 2).length()
return ((this.x = t), (this.y = i), (this.z = r), this)
}
setFromMatrixColumn(e, t) {
return this.fromArray(e.elements, t * 4)
}
setFromMatrix3Column(e, t) {
return this.fromArray(e.elements, t * 3)
}
setFromEuler(e) {
return ((this.x = e._x), (this.y = e._y), (this.z = e._z), this)
}
setFromColor(e) {
return ((this.x = e.r), (this.y = e.g), (this.z = e.b), this)
}
equals(e) {
return e.x === this.x && e.y === this.y && e.z === this.z
}
fromArray(e, t = 0) {
return ((this.x = e[t]), (this.y = e[t + 1]), (this.z = e[t + 2]), this)
}
toArray(e = [], t = 0) {
return ((e[t] = this.x), (e[t + 1] = this.y), (e[t + 2] = this.z), e)
}
fromBufferAttribute(e, t) {
return ((this.x = e.getX(t)), (this.y = e.getY(t)), (this.z = e.getZ(t)), this)
}
random() {
return ((this.x = Math.random()), (this.y = Math.random()), (this.z = Math.random()), this)
}
randomDirection() {
const e = Math.random() * Math.PI * 2,
t = Math.random() * 2 - 1,
i = Math.sqrt(1 - t * t)
return ((this.x = i * Math.cos(e)), (this.y = t), (this.z = i * Math.sin(e)), this)
}
*[Symbol.iterator]() {
;(yield this.x, yield this.y, yield this.z)
}
}
const fg = new Y(),
RS = new Qt()
class rr {
constructor(e = new Y(1 / 0, 1 / 0, 1 / 0), t = new Y(-1 / 0, -1 / 0, -1 / 0)) {
;((this.isBox3 = !0), (this.min = e), (this.max = t))
}
set(e, t) {
return (this.min.copy(e), this.max.copy(t), this)
}
setFromArray(e) {
this.makeEmpty()
for (let t = 0, i = e.length; t < i; t += 3) this.expandByPoint(ls.fromArray(e, t))
return this
}
setFromBufferAttribute(e) {
this.makeEmpty()
for (let t = 0, i = e.count; t < i; t++) this.expandByPoint(ls.fromBufferAttribute(e, t))
return this
}
setFromPoints(e) {
this.makeEmpty()
for (let t = 0, i = e.length; t < i; t++) this.expandByPoint(e[t])
return this
}
setFromCenterAndSize(e, t) {
const i = ls.copy(t).multiplyScalar(0.5)
return (this.min.copy(e).sub(i), this.max.copy(e).add(i), this)
}
setFromObject(e, t = !1) {
return (this.makeEmpty(), this.expandByObject(e, t))
}
clone() {
return new this.constructor().copy(this)
}
copy(e) {
return (this.min.copy(e.min), this.max.copy(e.max), this)
}
makeEmpty() {
return (
(this.min.x = this.min.y = this.min.z = 1 / 0),
(this.max.x = this.max.y = this.max.z = -1 / 0),
this
)
}
isEmpty() {
return this.max.x < this.min.x || this.max.y < this.min.y || this.max.z < this.min.z
}
getCenter(e) {
return this.isEmpty() ? e.set(0, 0, 0) : e.addVectors(this.min, this.max).multiplyScalar(0.5)
}
getSize(e) {
return this.isEmpty() ? e.set(0, 0, 0) : e.subVectors(this.max, this.min)
}
expandByPoint(e) {
return (this.min.min(e), this.max.max(e), this)
}
expandByVector(e) {
return (this.min.sub(e), this.max.add(e), this)
}
expandByScalar(e) {
return (this.min.addScalar(-e), this.max.addScalar(e), this)
}
expandByObject(e, t = !1) {
e.updateWorldMatrix(!1, !1)
const i = e.geometry
if (i !== void 0) {
const s = i.getAttribute('position')
if (t === !0 && s !== void 0 && e.isInstancedMesh !== !0)
for (let o = 0, a = s.count; o < a; o++)
(e.isMesh === !0 ? e.getVertexPosition(o, ls) : ls.fromBufferAttribute(s, o),
ls.applyMatrix4(e.matrixWorld),
this.expandByPoint(ls))
else
(e.boundingBox !== void 0
? (e.boundingBox === null && e.computeBoundingBox(), xf.copy(e.boundingBox))
: (i.boundingBox === null && i.computeBoundingBox(), xf.copy(i.boundingBox)),
xf.applyMatrix4(e.matrixWorld),
this.union(xf))
}
const r = e.children
for (let s = 0, o = r.length; s < o; s++) this.expandByObject(r[s], t)
return this
}
containsPoint(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
)
}
containsBox(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
)
}
getParameter(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)
)
}
intersectsBox(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
)
}
intersectsSphere(e) {
return (this.clampPoint(e.center, ls), ls.distanceToSquared(e.center) <= e.radius * e.radius)
}
intersectsPlane(e) {
let t, i
return (
e.normal.x > 0
? ((t = e.normal.x * this.min.x), (i = e.normal.x * this.max.x))
: ((t = e.normal.x * this.max.x), (i = e.normal.x * this.min.x)),
e.normal.y > 0
? ((t += e.normal.y * this.min.y), (i += e.normal.y * this.max.y))
: ((t += e.normal.y * this.max.y), (i += e.normal.y * this.min.y)),
e.normal.z > 0
? ((t += e.normal.z * this.min.z), (i += e.normal.z * this.max.z))
: ((t += e.normal.z * this.max.z), (i += e.normal.z * this.min.z)),
t <= -e.constant && i >= -e.constant
)
}
intersectsTriangle(e) {
if (this.isEmpty()) return !1
;(this.getCenter(nd),
Sf.subVectors(this.max, nd),
sc.subVectors(e.a, nd),
oc.subVectors(e.b, nd),
ac.subVectors(e.c, nd),
oa.subVectors(oc, sc),
aa.subVectors(ac, oc),
el.subVectors(sc, ac))
let t = [
0,
-oa.z,
oa.y,
0,
-aa.z,
aa.y,
0,
-el.z,
el.y,
oa.z,
0,
-oa.x,
aa.z,
0,
-aa.x,
el.z,
0,
-el.x,
-oa.y,
oa.x,
0,
-aa.y,
aa.x,
0,
-el.y,
el.x,
0,
]
return !pg(t, sc, oc, ac, Sf) || ((t = [1, 0, 0, 0, 1, 0, 0, 0, 1]), !pg(t, sc, oc, ac, Sf))
? !1
: (Af.crossVectors(oa, aa), (t = [Af.x, Af.y, Af.z]), pg(t, sc, oc, ac, Sf))
}
clampPoint(e, t) {
return t.copy(e).clamp(this.min, this.max)
}
distanceToPoint(e) {
return this.clampPoint(e, ls).distanceTo(e)
}
getBoundingSphere(e) {
return (
this.isEmpty()
? e.makeEmpty()
: (this.getCenter(e.center), (e.radius = this.getSize(ls).length() * 0.5)),
e
)
}
intersect(e) {
return (this.min.max(e.min), this.max.min(e.max), this.isEmpty() && this.makeEmpty(), this)
}
union(e) {
return (this.min.min(e.min), this.max.max(e.max), this)
}
applyMatrix4(e) {
return this.isEmpty()
? this
: (po[0].set(this.min.x, this.min.y, this.min.z).applyMatrix4(e),
po[1].set(this.min.x, this.min.y, this.max.z).applyMatrix4(e),
po[2].set(this.min.x, this.max.y, this.min.z).applyMatrix4(e),
po[3].set(this.min.x, this.max.y, this.max.z).applyMatrix4(e),
po[4].set(this.max.x, this.min.y, this.min.z).applyMatrix4(e),
po[5].set(this.max.x, this.min.y, this.max.z).applyMatrix4(e),
po[6].set(this.max.x, this.max.y, this.min.z).applyMatrix4(e),
po[7].set(this.max.x, this.max.y, this.max.z).applyMatrix4(e),
this.setFromPoints(po),
this)
}
translate(e) {
return (this.min.add(e), this.max.add(e), this)
}
equals(e) {
return e.min.equals(this.min) && e.max.equals(this.max)
}
}
const po = [new Y(), new Y(), new Y(), new Y(), new Y(), new Y(), new Y(), new Y()],
ls = new Y(),
xf = new rr(),
sc = new Y(),
oc = new Y(),
ac = new Y(),
oa = new Y(),
aa = new Y(),
el = new Y(),
nd = new Y(),
Sf = new Y(),
Af = new Y(),
tl = new Y()
function pg(n, e, t, i, r) {
for (let s = 0, o = n.length - 3; s <= o; s += 3) {
tl.fromArray(n, s)
const a = r.x * Math.abs(tl.x) + r.y * Math.abs(tl.y) + r.z * Math.abs(tl.z),
l = e.dot(tl),
c = t.dot(tl),
u = i.dot(tl)
if (Math.max(-Math.max(l, c, u), Math.min(l, c, u)) > a) return !1
}
return !0
}
const kP = new rr(),
id = new Y(),
mg = new Y()
class oo {
constructor(e = new Y(), t = -1) {
;((this.isSphere = !0), (this.center = e), (this.radius = t))
}
set(e, t) {
return (this.center.copy(e), (this.radius = t), this)
}
setFromPoints(e, t) {
const i = this.center
t !== void 0 ? i.copy(t) : kP.setFromPoints(e).getCenter(i)
let r = 0
for (let s = 0, o = e.length; s < o; s++) r = Math.max(r, i.distanceToSquared(e[s]))
return ((this.radius = Math.sqrt(r)), this)
}
copy(e) {
return (this.center.copy(e.center), (this.radius = e.radius), this)
}
isEmpty() {
return this.radius < 0
}
makeEmpty() {
return (this.center.set(0, 0, 0), (this.radius = -1), this)
}
containsPoint(e) {
return e.distanceToSquared(this.center) <= this.radius * this.radius
}
distanceToPoint(e) {
return e.distanceTo(this.center) - this.radius
}
intersectsSphere(e) {
const t = this.radius + e.radius
return e.center.distanceToSquared(this.center) <= t * t
}
intersectsBox(e) {
return e.intersectsSphere(this)
}
intersectsPlane(e) {
return Math.abs(e.distanceToPoint(this.center)) <= this.radius
}
clampPoint(e, t) {
const i = this.center.distanceToSquared(e)
return (
t.copy(e),
i > this.radius * this.radius &&
(t.sub(this.center).normalize(), t.multiplyScalar(this.radius).add(this.center)),
t
)
}
getBoundingBox(e) {
return this.isEmpty()
? (e.makeEmpty(), e)
: (e.set(this.center, this.center), e.expandByScalar(this.radius), e)
}
applyMatrix4(e) {
return (this.center.applyMatrix4(e), (this.radius = this.radius * e.getMaxScaleOnAxis()), this)
}
translate(e) {
return (this.center.add(e), this)
}
expandByPoint(e) {
if (this.isEmpty()) return (this.center.copy(e), (this.radius = 0), this)
id.subVectors(e, this.center)
const t = id.lengthSq()
if (t > this.radius * this.radius) {
const i = Math.sqrt(t),
r = (i - this.radius) * 0.5
;(this.center.addScaledVector(id, r / i), (this.radius += r))
}
return this
}
union(e) {
return e.isEmpty()
? this
: this.isEmpty()
? (this.copy(e), this)
: (this.center.equals(e.center) === !0
? (this.radius = Math.max(this.radius, e.radius))
: (mg.subVectors(e.center, this.center).setLength(e.radius),
this.expandByPoint(id.copy(e.center).add(mg)),
this.expandByPoint(id.copy(e.center).sub(mg))),
this)
}
equals(e) {
return e.center.equals(this.center) && e.radius === this.radius
}
clone() {
return new this.constructor().copy(this)
}
}
const mo = new Y(),
gg = new Y(),
bf = new Y(),
la = new Y(),
yg = new Y(),
Tf = new Y(),
vg = new Y()
let Uh = class {
constructor(e = new Y(), t = new Y(0, 0, -1)) {
;((this.origin = e), (this.direction = t))
}
set(e, t) {
return (this.origin.copy(e), this.direction.copy(t), this)
}
copy(e) {
return (this.origin.copy(e.origin), this.direction.copy(e.direction), this)
}
at(e, t) {
return t.copy(this.origin).addScaledVector(this.direction, e)
}
lookAt(e) {
return (this.direction.copy(e).sub(this.origin).normalize(), this)
}
recast(e) {
return (this.origin.copy(this.at(e, mo)), this)
}
closestPointToPoint(e, t) {
t.subVectors(e, this.origin)
const i = t.dot(this.direction)
return i < 0 ? t.copy(this.origin) : t.copy(this.origin).addScaledVector(this.direction, i)
}
distanceToPoint(e) {
return Math.sqrt(this.distanceSqToPoint(e))
}
distanceSqToPoint(e) {
const t = mo.subVectors(e, this.origin).dot(this.direction)
return t < 0
? this.origin.distanceToSquared(e)
: (mo.copy(this.origin).addScaledVector(this.direction, t), mo.distanceToSquared(e))
}
distanceSqToSegment(e, t, i, r) {
;(gg.copy(e).add(t).multiplyScalar(0.5),
bf.copy(t).sub(e).normalize(),
la.copy(this.origin).sub(gg))
const s = e.distanceTo(t) * 0.5,
o = -this.direction.dot(bf),
a = la.dot(this.direction),
l = -la.dot(bf),
c = la.lengthSq(),
u = Math.abs(1 - o * o)
let d, h, f, p
if (u > 0)
if (((d = o * l - a), (h = o * a - l), (p = s * u), d >= 0))
if (h >= -p)
if (h <= p) {
const g = 1 / u
;((d *= g), (h *= g), (f = d * (d + o * h + 2 * a) + h * (o * d + h + 2 * l) + c))
} else ((h = s), (d = Math.max(0, -(o * h + a))), (f = -d * d + h * (h + 2 * l) + c))
else ((h = -s), (d = Math.max(0, -(o * h + a))), (f = -d * d + h * (h + 2 * l) + c))
else
h <= -p
? ((d = Math.max(0, -(-o * s + a))),
(h = d > 0 ? -s : Math.min(Math.max(-s, -l), s)),
(f = -d * d + h * (h + 2 * l) + c))
: h <= p
? ((d = 0), (h = Math.min(Math.max(-s, -l), s)), (f = h * (h + 2 * l) + c))
: ((d = Math.max(0, -(o * s + a))),
(h = d > 0 ? s : Math.min(Math.max(-s, -l), s)),
(f = -d * d + h * (h + 2 * l) + c))
else ((h = o > 0 ? -s : s), (d = Math.max(0, -(o * h + a))), (f = -d * d + h * (h + 2 * l) + c))
return (
i && i.copy(this.origin).addScaledVector(this.direction, d),
r && r.copy(gg).addScaledVector(bf, h),
f
)
}
intersectSphere(e, t) {
mo.subVectors(e.center, this.origin)
const i = mo.dot(this.direction),
r = mo.dot(mo) - i * i,
s = e.radius * e.radius
if (r > s) return null
const o = Math.sqrt(s - r),
a = i - o,
l = i + o
return l < 0 ? null : a < 0 ? this.at(l, t) : this.at(a, t)
}
intersectsSphere(e) {
return this.distanceSqToPoint(e.center) <= e.radius * e.radius
}
distanceToPlane(e) {
const t = e.normal.dot(this.direction)
if (t === 0) return e.distanceToPoint(this.origin) === 0 ? 0 : null
const i = -(this.origin.dot(e.normal) + e.constant) / t
return i >= 0 ? i : null
}
intersectPlane(e, t) {
const i = this.distanceToPlane(e)
return i === null ? null : this.at(i, t)
}
intersectsPlane(e) {
const t = e.distanceToPoint(this.origin)
return t === 0 || e.normal.dot(this.direction) * t < 0
}
intersectBox(e, t) {
let i, r, s, o, a, l
const c = 1 / this.direction.x,
u = 1 / this.direction.y,
d = 1 / this.direction.z,
h = this.origin
return (
c >= 0
? ((i = (e.min.x - h.x) * c), (r = (e.max.x - h.x) * c))
: ((i = (e.max.x - h.x) * c), (r = (e.min.x - h.x) * c)),
u >= 0
? ((s = (e.min.y - h.y) * u), (o = (e.max.y - h.y) * u))
: ((s = (e.max.y - h.y) * u), (o = (e.min.y - h.y) * u)),
i > o ||
s > r ||
((s > i || isNaN(i)) && (i = s),
(o < r || isNaN(r)) && (r = o),
d >= 0
? ((a = (e.min.z - h.z) * d), (l = (e.max.z - h.z) * d))
: ((a = (e.max.z - h.z) * d), (l = (e.min.z - h.z) * d)),
i > l || a > r) ||
((a > i || i !== i) && (i = a), (l < r || r !== r) && (r = l), r < 0)
? null
: this.at(i >= 0 ? i : r, t)
)
}
intersectsBox(e) {
return this.intersectBox(e, mo) !== null
}
intersectTriangle(e, t, i, r, s) {
;(yg.subVectors(t, e), Tf.subVectors(i, e), vg.crossVectors(yg, Tf))
let o = this.direction.dot(vg),
a
if (o > 0) {
if (r) return null
a = 1
} else if (o < 0) ((a = -1), (o = -o))
else return null
la.subVectors(this.origin, e)
const l = a * this.direction.dot(Tf.crossVectors(la, Tf))
if (l < 0) return null
const c = a * this.direction.dot(yg.cross(la))
if (c < 0 || l + c > o) return null
const u = -a * la.dot(vg)
return u < 0 ? null : this.at(u / o, s)
}
applyMatrix4(e) {
return (this.origin.applyMatrix4(e), this.direction.transformDirection(e), this)
}
equals(e) {
return e.origin.equals(this.origin) && e.direction.equals(this.direction)
}
clone() {
return new this.constructor().copy(this)
}
}
class Xe {
constructor(e, t, i, r, s, o, a, l, c, u, d, h, f, p, g, y) {
;((Xe.prototype.isMatrix4 = !0),
(this.elements = [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1]),
e !== void 0 && this.set(e, t, i, r, s, o, a, l, c, u, d, h, f, p, g, y))
}
set(e, t, i, r, s, o, a, l, c, u, d, h, f, p, g, y) {
const m = this.elements
return (
(m[0] = e),
(m[4] = t),
(m[8] = i),
(m[12] = r),
(m[1] = s),
(m[5] = o),
(m[9] = a),
(m[13] = l),
(m[2] = c),
(m[6] = u),
(m[10] = d),
(m[14] = h),
(m[3] = f),
(m[7] = p),
(m[11] = g),
(m[15] = y),
this
)
}
identity() {
return (this.set(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1), this)
}
clone() {
return new Xe().fromArray(this.elements)
}
copy(e) {
const t = this.elements,
i = e.elements
return (
(t[0] = i[0]),
(t[1] = i[1]),
(t[2] = i[2]),
(t[3] = i[3]),
(t[4] = i[4]),
(t[5] = i[5]),
(t[6] = i[6]),
(t[7] = i[7]),
(t[8] = i[8]),
(t[9] = i[9]),
(t[10] = i[10]),
(t[11] = i[11]),
(t[12] = i[12]),
(t[13] = i[13]),
(t[14] = i[14]),
(t[15] = i[15]),
this
)
}
copyPosition(e) {
const t = this.elements,
i = e.elements
return ((t[12] = i[12]), (t[13] = i[13]), (t[14] = i[14]), this)
}
setFromMatrix3(e) {
const 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
)
}
extractBasis(e, t, i) {
return (
e.setFromMatrixColumn(this, 0),
t.setFromMatrixColumn(this, 1),
i.setFromMatrixColumn(this, 2),
this
)
}
makeBasis(e, t, i) {
return (this.set(e.x, t.x, i.x, 0, e.y, t.y, i.y, 0, e.z, t.z, i.z, 0, 0, 0, 0, 1), this)
}
extractRotation(e) {
const t = this.elements,
i = e.elements,
r = 1 / lc.setFromMatrixColumn(e, 0).length(),
s = 1 / lc.setFromMatrixColumn(e, 1).length(),
o = 1 / lc.setFromMatrixColumn(e, 2).length()
return (
(t[0] = i[0] * r),
(t[1] = i[1] * r),
(t[2] = i[2] * r),
(t[3] = 0),
(t[4] = i[4] * s),
(t[5] = i[5] * s),
(t[6] = i[6] * s),
(t[7] = 0),
(t[8] = i[8] * o),
(t[9] = i[9] * o),
(t[10] = i[10] * o),
(t[11] = 0),
(t[12] = 0),
(t[13] = 0),
(t[14] = 0),
(t[15] = 1),
this
)
}
makeRotationFromEuler(e) {
const t = this.elements,
i = e.x,
r = e.y,
s = e.z,
o = Math.cos(i),
a = Math.sin(i),
l = Math.cos(r),
c = Math.sin(r),
u = Math.cos(s),
d = Math.sin(s)
if (e.order === 'XYZ') {
const h = o * u,
f = o * d,
p = a * u,
g = a * d
;((t[0] = l * u),
(t[4] = -l * d),
(t[8] = c),
(t[1] = f + p * c),
(t[5] = h - g * c),
(t[9] = -a * l),
(t[2] = g - h * c),
(t[6] = p + f * c),
(t[10] = o * l))
} else if (e.order === 'YXZ') {
const h = l * u,
f = l * d,
p = c * u,
g = c * d
;((t[0] = h + g * a),
(t[4] = p * a - f),
(t[8] = o * c),
(t[1] = o * d),
(t[5] = o * u),
(t[9] = -a),
(t[2] = f * a - p),
(t[6] = g + h * a),
(t[10] = o * l))
} else if (e.order === 'ZXY') {
const h = l * u,
f = l * d,
p = c * u,
g = c * d
;((t[0] = h - g * a),
(t[4] = -o * d),
(t[8] = p + f * a),
(t[1] = f + p * a),
(t[5] = o * u),
(t[9] = g - h * a),
(t[2] = -o * c),
(t[6] = a),
(t[10] = o * l))
} else if (e.order === 'ZYX') {
const h = o * u,
f = o * d,
p = a * u,
g = a * d
;((t[0] = l * u),
(t[4] = p * c - f),
(t[8] = h * c + g),
(t[1] = l * d),
(t[5] = g * c + h),
(t[9] = f * c - p),
(t[2] = -c),
(t[6] = a * l),
(t[10] = o * l))
} else if (e.order === 'YZX') {
const h = o * l,
f = o * c,
p = a * l,
g = a * c
;((t[0] = l * u),
(t[4] = g - h * d),
(t[8] = p * d + f),
(t[1] = d),
(t[5] = o * u),
(t[9] = -a * u),
(t[2] = -c * u),
(t[6] = f * d + p),
(t[10] = h - g * d))
} else if (e.order === 'XZY') {
const h = o * l,
f = o * c,
p = a * l,
g = a * c
;((t[0] = l * u),
(t[4] = -d),
(t[8] = c * u),
(t[1] = h * d + g),
(t[5] = o * u),
(t[9] = f * d - p),
(t[2] = p * d - f),
(t[6] = a * u),
(t[10] = g * d + h))
}
return (
(t[3] = 0),
(t[7] = 0),
(t[11] = 0),
(t[12] = 0),
(t[13] = 0),
(t[14] = 0),
(t[15] = 1),
this
)
}
makeRotationFromQuaternion(e) {
return this.compose(zP, e, VP)
}
lookAt(e, t, i) {
const r = this.elements
return (
fr.subVectors(e, t),
fr.lengthSq() === 0 && (fr.z = 1),
fr.normalize(),
ca.crossVectors(i, fr),
ca.lengthSq() === 0 &&
(Math.abs(i.z) === 1 ? (fr.x += 1e-4) : (fr.z += 1e-4),
fr.normalize(),
ca.crossVectors(i, fr)),
ca.normalize(),
wf.crossVectors(fr, ca),
(r[0] = ca.x),
(r[4] = wf.x),
(r[8] = fr.x),
(r[1] = ca.y),
(r[5] = wf.y),
(r[9] = fr.y),
(r[2] = ca.z),
(r[6] = wf.z),
(r[10] = fr.z),
this
)
}
multiply(e) {
return this.multiplyMatrices(this, e)
}
premultiply(e) {
return this.multiplyMatrices(e, this)
}
multiplyMatrices(e, t) {
const i = e.elements,
r = t.elements,
s = this.elements,
o = i[0],
a = i[4],
l = i[8],
c = i[12],
u = i[1],
d = i[5],
h = i[9],
f = i[13],
p = i[2],
g = i[6],
y = i[10],
m = i[14],
v = i[3],
x = i[7],
_ = i[11],
S = i[15],
C = r[0],
A = r[4],
R = r[8],
w = r[12],
M = r[1],
I = r[5],
L = r[9],
U = r[13],
T = r[2],
F = r[6],
V = r[10],
Q = r[14],
ee = r[3],
se = r[7],
he = r[11],
ie = r[15]
return (
(s[0] = o * C + a * M + l * T + c * ee),
(s[4] = o * A + a * I + l * F + c * se),
(s[8] = o * R + a * L + l * V + c * he),
(s[12] = o * w + a * U + l * Q + c * ie),
(s[1] = u * C + d * M + h * T + f * ee),
(s[5] = u * A + d * I + h * F + f * se),
(s[9] = u * R + d * L + h * V + f * he),
(s[13] = u * w + d * U + h * Q + f * ie),
(s[2] = p * C + g * M + y * T + m * ee),
(s[6] = p * A + g * I + y * F + m * se),
(s[10] = p * R + g * L + y * V + m * he),
(s[14] = p * w + g * U + y * Q + m * ie),
(s[3] = v * C + x * M + _ * T + S * ee),
(s[7] = v * A + x * I + _ * F + S * se),
(s[11] = v * R + x * L + _ * V + S * he),
(s[15] = v * w + x * U + _ * Q + S * ie),
this
)
}
multiplyScalar(e) {
const t = this.elements
return (
(t[0] *= e),
(t[4] *= e),
(t[8] *= e),
(t[12] *= e),
(t[1] *= e),
(t[5] *= e),
(t[9] *= e),
(t[13] *= e),
(t[2] *= e),
(t[6] *= e),
(t[10] *= e),
(t[14] *= e),
(t[3] *= e),
(t[7] *= e),
(t[11] *= e),
(t[15] *= e),
this
)
}
determinant() {
const e = this.elements,
t = e[0],
i = e[4],
r = e[8],
s = e[12],
o = e[1],
a = e[5],
l = e[9],
c = e[13],
u = e[2],
d = e[6],
h = e[10],
f = e[14],
p = e[3],
g = e[7],
y = e[11],
m = e[15]
return (
p * (+s * l * d - r * c * d - s * a * h + i * c * h + r * a * f - i * l * f) +
g * (+t * l * f - t * c * h + s * o * h - r * o * f + r * c * u - s * l * u) +
y * (+t * c * d - t * a * f - s * o * d + i * o * f + s * a * u - i * c * u) +
m * (-r * a * u - t * l * d + t * a * h + r * o * d - i * o * h + i * l * u)
)
}
transpose() {
const e = this.elements
let t
return (
(t = e[1]),
(e[1] = e[4]),
(e[4] = t),
(t = e[2]),
(e[2] = e[8]),
(e[8] = t),
(t = e[6]),
(e[6] = e[9]),
(e[9] = t),
(t = e[3]),
(e[3] = e[12]),
(e[12] = t),
(t = e[7]),
(e[7] = e[13]),
(e[13] = t),
(t = e[11]),
(e[11] = e[14]),
(e[14] = t),
this
)
}
setPosition(e, t, i) {
const 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] = i)),
this
)
}
invert() {
const e = this.elements,
t = e[0],
i = e[1],
r = e[2],
s = e[3],
o = e[4],
a = e[5],
l = e[6],
c = e[7],
u = e[8],
d = e[9],
h = e[10],
f = e[11],
p = e[12],
g = e[13],
y = e[14],
m = e[15],
v = d * y * c - g * h * c + g * l * f - a * y * f - d * l * m + a * h * m,
x = p * h * c - u * y * c - p * l * f + o * y * f + u * l * m - o * h * m,
_ = u * g * c - p * d * c + p * a * f - o * g * f - u * a * m + o * d * m,
S = p * d * l - u * g * l - p * a * h + o * g * h + u * a * y - o * d * y,
C = t * v + i * x + r * _ + s * S
if (C === 0) return this.set(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)
const A = 1 / C
return (
(e[0] = v * A),
(e[1] = (g * h * s - d * y * s - g * r * f + i * y * f + d * r * m - i * h * m) * A),
(e[2] = (a * y * s - g * l * s + g * r * c - i * y * c - a * r * m + i * l * m) * A),
(e[3] = (d * l * s - a * h * s - d * r * c + i * h * c + a * r * f - i * l * f) * A),
(e[4] = x * A),
(e[5] = (u * y * s - p * h * s + p * r * f - t * y * f - u * r * m + t * h * m) * A),
(e[6] = (p * l * s - o * y * s - p * r * c + t * y * c + o * r * m - t * l * m) * A),
(e[7] = (o * h * s - u * l * s + u * r * c - t * h * c - o * r * f + t * l * f) * A),
(e[8] = _ * A),
(e[9] = (p * d * s - u * g * s - p * i * f + t * g * f + u * i * m - t * d * m) * A),
(e[10] = (o * g * s - p * a * s + p * i * c - t * g * c - o * i * m + t * a * m) * A),
(e[11] = (u * a * s - o * d * s - u * i * c + t * d * c + o * i * f - t * a * f) * A),
(e[12] = S * A),
(e[13] = (u * g * r - p * d * r + p * i * h - t * g * h - u * i * y + t * d * y) * A),
(e[14] = (p * a * r - o * g * r - p * i * l + t * g * l + o * i * y - t * a * y) * A),
(e[15] = (o * d * r - u * a * r + u * i * l - t * d * l - o * i * h + t * a * h) * A),
this
)
}
scale(e) {
const t = this.elements,
i = e.x,
r = e.y,
s = e.z
return (
(t[0] *= i),
(t[4] *= r),
(t[8] *= s),
(t[1] *= i),
(t[5] *= r),
(t[9] *= s),
(t[2] *= i),
(t[6] *= r),
(t[10] *= s),
(t[3] *= i),
(t[7] *= r),
(t[11] *= s),
this
)
}
getMaxScaleOnAxis() {
const e = this.elements,
t = e[0] * e[0] + e[1] * e[1] + e[2] * e[2],
i = 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, i, r))
}
makeTranslation(e, t, i) {
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, i, 0, 0, 0, 1),
this
)
}
makeRotationX(e) {
const t = Math.cos(e),
i = Math.sin(e)
return (this.set(1, 0, 0, 0, 0, t, -i, 0, 0, i, t, 0, 0, 0, 0, 1), this)
}
makeRotationY(e) {
const t = Math.cos(e),
i = Math.sin(e)
return (this.set(t, 0, i, 0, 0, 1, 0, 0, -i, 0, t, 0, 0, 0, 0, 1), this)
}
makeRotationZ(e) {
const t = Math.cos(e),
i = Math.sin(e)
return (this.set(t, -i, 0, 0, i, t, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1), this)
}
makeRotationAxis(e, t) {
const i = Math.cos(t),
r = Math.sin(t),
s = 1 - i,
o = e.x,
a = e.y,
l = e.z,
c = s * o,
u = s * a
return (
this.set(
c * o + i,
c * a - r * l,
c * l + r * a,
0,
c * a + r * l,
u * a + i,
u * l - r * o,
0,
c * l - r * a,
u * l + r * o,
s * l * l + i,
0,
0,
0,
0,
1
),
this
)
}
makeScale(e, t, i) {
return (this.set(e, 0, 0, 0, 0, t, 0, 0, 0, 0, i, 0, 0, 0, 0, 1), this)
}
makeShear(e, t, i, r, s, o) {
return (this.set(1, i, s, 0, e, 1, o, 0, t, r, 1, 0, 0, 0, 0, 1), this)
}
compose(e, t, i) {
const r = this.elements,
s = t._x,
o = t._y,
a = t._z,
l = t._w,
c = s + s,
u = o + o,
d = a + a,
h = s * c,
f = s * u,
p = s * d,
g = o * u,
y = o * d,
m = a * d,
v = l * c,
x = l * u,
_ = l * d,
S = i.x,
C = i.y,
A = i.z
return (
(r[0] = (1 - (g + m)) * S),
(r[1] = (f + _) * S),
(r[2] = (p - x) * S),
(r[3] = 0),
(r[4] = (f - _) * C),
(r[5] = (1 - (h + m)) * C),
(r[6] = (y + v) * C),
(r[7] = 0),
(r[8] = (p + x) * A),
(r[9] = (y - v) * A),
(r[10] = (1 - (h + g)) * A),
(r[11] = 0),
(r[12] = e.x),
(r[13] = e.y),
(r[14] = e.z),
(r[15] = 1),
this
)
}
decompose(e, t, i) {
const r = this.elements
let s = lc.set(r[0], r[1], r[2]).length()
const o = lc.set(r[4], r[5], r[6]).length(),
a = lc.set(r[8], r[9], r[10]).length()
;(this.determinant() < 0 && (s = -s),
(e.x = r[12]),
(e.y = r[13]),
(e.z = r[14]),
cs.copy(this))
const c = 1 / s,
u = 1 / o,
d = 1 / a
return (
(cs.elements[0] *= c),
(cs.elements[1] *= c),
(cs.elements[2] *= c),
(cs.elements[4] *= u),
(cs.elements[5] *= u),
(cs.elements[6] *= u),
(cs.elements[8] *= d),
(cs.elements[9] *= d),
(cs.elements[10] *= d),
t.setFromRotationMatrix(cs),
(i.x = s),
(i.y = o),
(i.z = a),
this
)
}
makePerspective(e, t, i, r, s, o, a = Nr) {
const l = this.elements,
c = (2 * s) / (t - e),
u = (2 * s) / (i - r),
d = (t + e) / (t - e),
h = (i + r) / (i - r)
let f, p
if (a === Nr) ((f = -(o + s) / (o - s)), (p = (-2 * o * s) / (o - s)))
else if (a === qo) ((f = -o / (o - s)), (p = (-o * s) / (o - s)))
else throw new Error('THREE.Matrix4.makePerspective(): Invalid coordinate system: ' + a)
return (
(l[0] = c),
(l[4] = 0),
(l[8] = d),
(l[12] = 0),
(l[1] = 0),
(l[5] = u),
(l[9] = h),
(l[13] = 0),
(l[2] = 0),
(l[6] = 0),
(l[10] = f),
(l[14] = p),
(l[3] = 0),
(l[7] = 0),
(l[11] = -1),
(l[15] = 0),
this
)
}
makeOrthographic(e, t, i, r, s, o, a = Nr) {
const l = this.elements,
c = 1 / (t - e),
u = 1 / (i - r),
d = 1 / (o - s),
h = (t + e) * c,
f = (i + r) * u
let p, g
if (a === Nr) ((p = (o + s) * d), (g = -2 * d))
else if (a === qo) ((p = s * d), (g = -1 * d))
else throw new Error('THREE.Matrix4.makeOrthographic(): Invalid coordinate system: ' + a)
return (
(l[0] = 2 * c),
(l[4] = 0),
(l[8] = 0),
(l[12] = -h),
(l[1] = 0),
(l[5] = 2 * u),
(l[9] = 0),
(l[13] = -f),
(l[2] = 0),
(l[6] = 0),
(l[10] = g),
(l[14] = -p),
(l[3] = 0),
(l[7] = 0),
(l[11] = 0),
(l[15] = 1),
this
)
}
equals(e) {
const t = this.elements,
i = e.elements
for (let r = 0; r < 16; r++) if (t[r] !== i[r]) return !1
return !0
}
fromArray(e, t = 0) {
for (let i = 0; i < 16; i++) this.elements[i] = e[i + t]
return this
}
toArray(e = [], t = 0) {
const i = this.elements
return (
(e[t] = i[0]),
(e[t + 1] = i[1]),
(e[t + 2] = i[2]),
(e[t + 3] = i[3]),
(e[t + 4] = i[4]),
(e[t + 5] = i[5]),
(e[t + 6] = i[6]),
(e[t + 7] = i[7]),
(e[t + 8] = i[8]),
(e[t + 9] = i[9]),
(e[t + 10] = i[10]),
(e[t + 11] = i[11]),
(e[t + 12] = i[12]),
(e[t + 13] = i[13]),
(e[t + 14] = i[14]),
(e[t + 15] = i[15]),
e
)
}
}
const lc = new Y(),
cs = new Xe(),
zP = new Y(0, 0, 0),
VP = new Y(1, 1, 1),
ca = new Y(),
wf = new Y(),
fr = new Y(),
IS = new Xe(),
NS = new Qt()
class ws {
constructor(e = 0, t = 0, i = 0, r = ws.DEFAULT_ORDER) {
;((this.isEuler = !0), (this._x = e), (this._y = t), (this._z = i), (this._order = r))
}
get x() {
return this._x
}
set x(e) {
;((this._x = e), this._onChangeCallback())
}
get y() {
return this._y
}
set y(e) {
;((this._y = e), this._onChangeCallback())
}
get z() {
return this._z
}
set z(e) {
;((this._z = e), this._onChangeCallback())
}
get order() {
return this._order
}
set order(e) {
;((this._order = e), this._onChangeCallback())
}
set(e, t, i, r = this._order) {
return (
(this._x = e),
(this._y = t),
(this._z = i),
(this._order = r),
this._onChangeCallback(),
this
)
}
clone() {
return new this.constructor(this._x, this._y, this._z, this._order)
}
copy(e) {
return (
(this._x = e._x),
(this._y = e._y),
(this._z = e._z),
(this._order = e._order),
this._onChangeCallback(),
this
)
}
setFromRotationMatrix(e, t = this._order, i = !0) {
const r = e.elements,
s = r[0],
o = r[4],
a = r[8],
l = r[1],
c = r[5],
u = r[9],
d = r[2],
h = r[6],
f = r[10]
switch (t) {
case 'XYZ':
;((this._y = Math.asin(Nt(a, -1, 1))),
Math.abs(a) < 0.9999999
? ((this._x = Math.atan2(-u, f)), (this._z = Math.atan2(-o, s)))
: ((this._x = Math.atan2(h, c)), (this._z = 0)))
break
case 'YXZ':
;((this._x = Math.asin(-Nt(u, -1, 1))),
Math.abs(u) < 0.9999999
? ((this._y = Math.atan2(a, f)), (this._z = Math.atan2(l, c)))
: ((this._y = Math.atan2(-d, s)), (this._z = 0)))
break
case 'ZXY':
;((this._x = Math.asin(Nt(h, -1, 1))),
Math.abs(h) < 0.9999999
? ((this._y = Math.atan2(-d, f)), (this._z = Math.atan2(-o, c)))
: ((this._y = 0), (this._z = Math.atan2(l, s))))
break
case 'ZYX':
;((this._y = Math.asin(-Nt(d, -1, 1))),
Math.abs(d) < 0.9999999
? ((this._x = Math.atan2(h, f)), (this._z = Math.atan2(l, s)))
: ((this._x = 0), (this._z = Math.atan2(-o, c))))
break
case 'YZX':
;((this._z = Math.asin(Nt(l, -1, 1))),
Math.abs(l) < 0.9999999
? ((this._x = Math.atan2(-u, c)), (this._y = Math.atan2(-d, s)))
: ((this._x = 0), (this._y = Math.atan2(a, f))))
break
case 'XZY':
;((this._z = Math.asin(-Nt(o, -1, 1))),
Math.abs(o) < 0.9999999
? ((this._x = Math.atan2(h, c)), (this._y = Math.atan2(a, s)))
: ((this._x = Math.atan2(-u, f)), (this._y = 0)))
break
default:
console.warn('THREE.Euler: .setFromRotationMatrix() encountered an unknown order: ' + t)
}
return ((this._order = t), i === !0 && this._onChangeCallback(), this)
}
setFromQuaternion(e, t, i) {
return (IS.makeRotationFromQuaternion(e), this.setFromRotationMatrix(IS, t, i))
}
setFromVector3(e, t = this._order) {
return this.set(e.x, e.y, e.z, t)
}
reorder(e) {
return (NS.setFromEuler(this), this.setFromQuaternion(NS, e))
}
equals(e) {
return e._x === this._x && e._y === this._y && e._z === this._z && e._order === this._order
}
fromArray(e) {
return (
(this._x = e[0]),
(this._y = e[1]),
(this._z = e[2]),
e[3] !== void 0 && (this._order = e[3]),
this._onChangeCallback(),
this
)
}
toArray(e = [], t = 0) {
return (
(e[t] = this._x),
(e[t + 1] = this._y),
(e[t + 2] = this._z),
(e[t + 3] = this._order),
e
)
}
_onChange(e) {
return ((this._onChangeCallback = e), this)
}
_onChangeCallback() {}
*[Symbol.iterator]() {
;(yield this._x, yield this._y, yield this._z, yield this._order)
}
}
ws.DEFAULT_ORDER = 'XYZ'
class P5 {
constructor() {
this.mask = 1
}
set(e) {
this.mask = ((1 << e) | 0) >>> 0
}
enable(e) {
this.mask |= (1 << e) | 0
}
enableAll() {
this.mask = -1
}
toggle(e) {
this.mask ^= (1 << e) | 0
}
disable(e) {
this.mask &= ~((1 << e) | 0)
}
disableAll() {
this.mask = 0
}
test(e) {
return (this.mask & e.mask) !== 0
}
isEnabled(e) {
return (this.mask & ((1 << e) | 0)) !== 0
}
}
let HP = 0
const PS = new Y(),
cc = new Qt(),
go = new Xe(),
Cf = new Y(),
rd = new Y(),
$P = new Y(),
GP = new Qt(),
LS = new Y(1, 0, 0),
DS = new Y(0, 1, 0),
FS = new Y(0, 0, 1),
OS = { type: 'added' },
WP = { type: 'removed' },
uc = { type: 'childadded', child: null },
_g = { type: 'childremoved', child: null }
class rn extends so {
constructor() {
;(super(),
(this.isObject3D = !0),
Object.defineProperty(this, 'id', { value: HP++ }),
(this.uuid = xs()),
(this.name = ''),
(this.type = 'Object3D'),
(this.parent = null),
(this.children = []),
(this.up = rn.DEFAULT_UP.clone()))
const e = new Y(),
t = new ws(),
i = new Qt(),
r = new Y(1, 1, 1)
function s() {
i.setFromEuler(t, !1)
}
function o() {
t.setFromQuaternion(i, void 0, !1)
}
;(t._onChange(s),
i._onChange(o),
Object.defineProperties(this, {
position: { configurable: !0, enumerable: !0, value: e },
rotation: { configurable: !0, enumerable: !0, value: t },
quaternion: { configurable: !0, enumerable: !0, value: i },
scale: { configurable: !0, enumerable: !0, value: r },
modelViewMatrix: { value: new Xe() },
normalMatrix: { value: new mt() },
}),
(this.matrix = new Xe()),
(this.matrixWorld = new Xe()),
(this.matrixAutoUpdate = rn.DEFAULT_MATRIX_AUTO_UPDATE),
(this.matrixWorldAutoUpdate = rn.DEFAULT_MATRIX_WORLD_AUTO_UPDATE),
(this.matrixWorldNeedsUpdate = !1),
(this.layers = new P5()),
(this.visible = !0),
(this.castShadow = !1),
(this.receiveShadow = !1),
(this.frustumCulled = !0),
(this.renderOrder = 0),
(this.animations = []),
(this.userData = {}))
}
onBeforeShadow() {}
onAfterShadow() {}
onBeforeRender() {}
onAfterRender() {}
applyMatrix4(e) {
;(this.matrixAutoUpdate && this.updateMatrix(),
this.matrix.premultiply(e),
this.matrix.decompose(this.position, this.quaternion, this.scale))
}
applyQuaternion(e) {
return (this.quaternion.premultiply(e), this)
}
setRotationFromAxisAngle(e, t) {
this.quaternion.setFromAxisAngle(e, t)
}
setRotationFromEuler(e) {
this.quaternion.setFromEuler(e, !0)
}
setRotationFromMatrix(e) {
this.quaternion.setFromRotationMatrix(e)
}
setRotationFromQuaternion(e) {
this.quaternion.copy(e)
}
rotateOnAxis(e, t) {
return (cc.setFromAxisAngle(e, t), this.quaternion.multiply(cc), this)
}
rotateOnWorldAxis(e, t) {
return (cc.setFromAxisAngle(e, t), this.quaternion.premultiply(cc), this)
}
rotateX(e) {
return this.rotateOnAxis(LS, e)
}
rotateY(e) {
return this.rotateOnAxis(DS, e)
}
rotateZ(e) {
return this.rotateOnAxis(FS, e)
}
translateOnAxis(e, t) {
return (
PS.copy(e).applyQuaternion(this.quaternion),
this.position.add(PS.multiplyScalar(t)),
this
)
}
translateX(e) {
return this.translateOnAxis(LS, e)
}
translateY(e) {
return this.translateOnAxis(DS, e)
}
translateZ(e) {
return this.translateOnAxis(FS, e)
}
localToWorld(e) {
return (this.updateWorldMatrix(!0, !1), e.applyMatrix4(this.matrixWorld))
}
worldToLocal(e) {
return (this.updateWorldMatrix(!0, !1), e.applyMatrix4(go.copy(this.matrixWorld).invert()))
}
lookAt(e, t, i) {
e.isVector3 ? Cf.copy(e) : Cf.set(e, t, i)
const r = this.parent
;(this.updateWorldMatrix(!0, !1),
rd.setFromMatrixPosition(this.matrixWorld),
this.isCamera || this.isLight ? go.lookAt(rd, Cf, this.up) : go.lookAt(Cf, rd, this.up),
this.quaternion.setFromRotationMatrix(go),
r &&
(go.extractRotation(r.matrixWorld),
cc.setFromRotationMatrix(go),
this.quaternion.premultiply(cc.invert())))
}
add(e) {
if (arguments.length > 1) {
for (let 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(OS),
(uc.child = e),
this.dispatchEvent(uc),
(uc.child = null))
: console.error('THREE.Object3D.add: object not an instance of THREE.Object3D.', e),
this)
}
remove(e) {
if (arguments.length > 1) {
for (let i = 0; i < arguments.length; i++) this.remove(arguments[i])
return this
}
const t = this.children.indexOf(e)
return (
t !== -1 &&
((e.parent = null),
this.children.splice(t, 1),
e.dispatchEvent(WP),
(_g.child = e),
this.dispatchEvent(_g),
(_g.child = null)),
this
)
}
removeFromParent() {
const e = this.parent
return (e !== null && e.remove(this), this)
}
clear() {
return this.remove(...this.children)
}
attach(e) {
return (
this.updateWorldMatrix(!0, !1),
go.copy(this.matrixWorld).invert(),
e.parent !== null && (e.parent.updateWorldMatrix(!0, !1), go.multiply(e.parent.matrixWorld)),
e.applyMatrix4(go),
e.removeFromParent(),
(e.parent = this),
this.children.push(e),
e.updateWorldMatrix(!1, !0),
e.dispatchEvent(OS),
(uc.child = e),
this.dispatchEvent(uc),
(uc.child = null),
this
)
}
getObjectById(e) {
return this.getObjectByProperty('id', e)
}
getObjectByName(e) {
return this.getObjectByProperty('name', e)
}
getObjectByProperty(e, t) {
if (this[e] === t) return this
for (let i = 0, r = this.children.length; i < r; i++) {
const o = this.children[i].getObjectByProperty(e, t)
if (o !== void 0) return o
}
}
getObjectsByProperty(e, t, i = []) {
this[e] === t && i.push(this)
const r = this.children
for (let s = 0, o = r.length; s < o; s++) r[s].getObjectsByProperty(e, t, i)
return i
}
getWorldPosition(e) {
return (this.updateWorldMatrix(!0, !1), e.setFromMatrixPosition(this.matrixWorld))
}
getWorldQuaternion(e) {
return (this.updateWorldMatrix(!0, !1), this.matrixWorld.decompose(rd, e, $P), e)
}
getWorldScale(e) {
return (this.updateWorldMatrix(!0, !1), this.matrixWorld.decompose(rd, GP, e), e)
}
getWorldDirection(e) {
this.updateWorldMatrix(!0, !1)
const t = this.matrixWorld.elements
return e.set(t[8], t[9], t[10]).normalize()
}
raycast() {}
traverse(e) {
e(this)
const t = this.children
for (let i = 0, r = t.length; i < r; i++) t[i].traverse(e)
}
traverseVisible(e) {
if (this.visible === !1) return
e(this)
const t = this.children
for (let i = 0, r = t.length; i < r; i++) t[i].traverseVisible(e)
}
traverseAncestors(e) {
const t = this.parent
t !== null && (e(t), t.traverseAncestors(e))
}
updateMatrix() {
;(this.matrix.compose(this.position, this.quaternion, this.scale),
(this.matrixWorldNeedsUpdate = !0))
}
updateMatrixWorld(e) {
;(this.matrixAutoUpdate && this.updateMatrix(),
(this.matrixWorldNeedsUpdate || e) &&
(this.matrixWorldAutoUpdate === !0 &&
(this.parent === null
? this.matrixWorld.copy(this.matrix)
: this.matrixWorld.multiplyMatrices(this.parent.matrixWorld, this.matrix)),
(this.matrixWorldNeedsUpdate = !1),
(e = !0)))
const t = this.children
for (let i = 0, r = t.length; i < r; i++) t[i].updateMatrixWorld(e)
}
updateWorldMatrix(e, t) {
const i = this.parent
if (
(e === !0 && i !== null && i.updateWorldMatrix(!0, !1),
this.matrixAutoUpdate && this.updateMatrix(),
this.matrixWorldAutoUpdate === !0 &&
(this.parent === null
? this.matrixWorld.copy(this.matrix)
: this.matrixWorld.multiplyMatrices(this.parent.matrixWorld, this.matrix)),
t === !0)
) {
const r = this.children
for (let s = 0, o = r.length; s < o; s++) r[s].updateWorldMatrix(!1, !0)
}
}
toJSON(e) {
const t = e === void 0 || typeof e == 'string',
i = {}
t &&
((e = {
geometries: {},
materials: {},
textures: {},
images: {},
shapes: {},
skeletons: {},
animations: {},
nodes: {},
}),
(i.metadata = { version: 4.6, type: 'Object', generator: 'Object3D.toJSON' }))
const r = {}
;((r.uuid = this.uuid),
(r.type = this.type),
this.name !== '' && (r.name = this.name),
this.castShadow === !0 && (r.castShadow = !0),
this.receiveShadow === !0 && (r.receiveShadow = !0),
this.visible === !1 && (r.visible = !1),
this.frustumCulled === !1 && (r.frustumCulled = !1),
this.renderOrder !== 0 && (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()),
this.matrixAutoUpdate === !1 && (r.matrixAutoUpdate = !1),
this.isInstancedMesh &&
((r.type = 'InstancedMesh'),
(r.count = this.count),
(r.instanceMatrix = this.instanceMatrix.toJSON()),
this.instanceColor !== null && (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((a) => ({
boxInitialized: a.boxInitialized,
boxMin: a.box.min.toArray(),
boxMax: a.box.max.toArray(),
sphereInitialized: a.sphereInitialized,
sphereRadius: a.sphere.radius,
sphereCenter: a.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)),
this._colorsTexture !== null && (r.colorsTexture = this._colorsTexture.toJSON(e)),
this.boundingSphere !== null &&
(r.boundingSphere = {
center: r.boundingSphere.center.toArray(),
radius: r.boundingSphere.radius,
}),
this.boundingBox !== null &&
(r.boundingBox = { min: r.boundingBox.min.toArray(), max: r.boundingBox.max.toArray() })))
function s(a, l) {
return (a[l.uuid] === void 0 && (a[l.uuid] = l.toJSON(e)), l.uuid)
}
if (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 &&
this.environment.isRenderTargetTexture !== !0 &&
(r.environment = this.environment.toJSON(e).uuid))
else if (this.isMesh || this.isLine || this.isPoints) {
r.geometry = s(e.geometries, this.geometry)
const a = this.geometry.parameters
if (a !== void 0 && a.shapes !== void 0) {
const l = a.shapes
if (Array.isArray(l))
for (let c = 0, u = l.length; c < u; c++) {
const d = l[c]
s(e.shapes, d)
}
else s(e.shapes, l)
}
}
if (
(this.isSkinnedMesh &&
((r.bindMode = this.bindMode),
(r.bindMatrix = this.bindMatrix.toArray()),
this.skeleton !== void 0 &&
(s(e.skeletons, this.skeleton), (r.skeleton = this.skeleton.uuid))),
this.material !== void 0)
)
if (Array.isArray(this.material)) {
const a = []
for (let l = 0, c = this.material.length; l < c; l++)
a.push(s(e.materials, this.material[l]))
r.material = a
} else r.material = s(e.materials, this.material)
if (this.children.length > 0) {
r.children = []
for (let a = 0; a < this.children.length; a++)
r.children.push(this.children[a].toJSON(e).object)
}
if (this.animations.length > 0) {
r.animations = []
for (let a = 0; a < this.animations.length; a++) {
const l = this.animations[a]
r.animations.push(s(e.animations, l))
}
}
if (t) {
const a = o(e.geometries),
l = o(e.materials),
c = o(e.textures),
u = o(e.images),
d = o(e.shapes),
h = o(e.skeletons),
f = o(e.animations),
p = o(e.nodes)
;(a.length > 0 && (i.geometries = a),
l.length > 0 && (i.materials = l),
c.length > 0 && (i.textures = c),
u.length > 0 && (i.images = u),
d.length > 0 && (i.shapes = d),
h.length > 0 && (i.skeletons = h),
f.length > 0 && (i.animations = f),
p.length > 0 && (i.nodes = p))
}
return ((i.object = r), i)
function o(a) {
const l = []
for (const c in a) {
const u = a[c]
;(delete u.metadata, l.push(u))
}
return l
}
}
clone(e) {
return new this.constructor().copy(this, e)
}
copy(e, t = !0) {
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))),
t === !0)
)
for (let i = 0; i < e.children.length; i++) {
const r = e.children[i]
this.add(r.clone())
}
return this
}
}
rn.DEFAULT_UP = new Y(0, 1, 0)
rn.DEFAULT_MATRIX_AUTO_UPDATE = !0
rn.DEFAULT_MATRIX_WORLD_AUTO_UPDATE = !0
const us = new Y(),
yo = new Y(),
xg = new Y(),
vo = new Y(),
dc = new Y(),
hc = new Y(),
BS = new Y(),
Sg = new Y(),
Ag = new Y(),
bg = new Y(),
Tg = new Mt(),
wg = new Mt(),
Cg = new Mt()
class ps {
constructor(e = new Y(), t = new Y(), i = new Y()) {
;((this.a = e), (this.b = t), (this.c = i))
}
static getNormal(e, t, i, r) {
;(r.subVectors(i, t), us.subVectors(e, t), r.cross(us))
const s = r.lengthSq()
return s > 0 ? r.multiplyScalar(1 / Math.sqrt(s)) : r.set(0, 0, 0)
}
static getBarycoord(e, t, i, r, s) {
;(us.subVectors(r, t), yo.subVectors(i, t), xg.subVectors(e, t))
const o = us.dot(us),
a = us.dot(yo),
l = us.dot(xg),
c = yo.dot(yo),
u = yo.dot(xg),
d = o * c - a * a
if (d === 0) return (s.set(0, 0, 0), null)
const h = 1 / d,
f = (c * l - a * u) * h,
p = (o * u - a * l) * h
return s.set(1 - f - p, p, f)
}
static containsPoint(e, t, i, r) {
return this.getBarycoord(e, t, i, r, vo) === null
? !1
: vo.x >= 0 && vo.y >= 0 && vo.x + vo.y <= 1
}
static getInterpolation(e, t, i, r, s, o, a, l) {
return this.getBarycoord(e, t, i, r, vo) === null
? ((l.x = 0), (l.y = 0), 'z' in l && (l.z = 0), 'w' in l && (l.w = 0), null)
: (l.setScalar(0),
l.addScaledVector(s, vo.x),
l.addScaledVector(o, vo.y),
l.addScaledVector(a, vo.z),
l)
}
static getInterpolatedAttribute(e, t, i, r, s, o) {
return (
Tg.setScalar(0),
wg.setScalar(0),
Cg.setScalar(0),
Tg.fromBufferAttribute(e, t),
wg.fromBufferAttribute(e, i),
Cg.fromBufferAttribute(e, r),
o.setScalar(0),
o.addScaledVector(Tg, s.x),
o.addScaledVector(wg, s.y),
o.addScaledVector(Cg, s.z),
o
)
}
static isFrontFacing(e, t, i, r) {
return (us.subVectors(i, t), yo.subVectors(e, t), us.cross(yo).dot(r) < 0)
}
set(e, t, i) {
return (this.a.copy(e), this.b.copy(t), this.c.copy(i), this)
}
setFromPointsAndIndices(e, t, i, r) {
return (this.a.copy(e[t]), this.b.copy(e[i]), this.c.copy(e[r]), this)
}
setFromAttributeAndIndices(e, t, i, r) {
return (
this.a.fromBufferAttribute(e, t),
this.b.fromBufferAttribute(e, i),
this.c.fromBufferAttribute(e, r),
this
)
}
clone() {
return new this.constructor().copy(this)
}
copy(e) {
return (this.a.copy(e.a), this.b.copy(e.b), this.c.copy(e.c), this)
}
getArea() {
return (
us.subVectors(this.c, this.b),
yo.subVectors(this.a, this.b),
us.cross(yo).length() * 0.5
)
}
getMidpoint(e) {
return e
.addVectors(this.a, this.b)
.add(this.c)
.multiplyScalar(1 / 3)
}
getNormal(e) {
return ps.getNormal(this.a, this.b, this.c, e)
}
getPlane(e) {
return e.setFromCoplanarPoints(this.a, this.b, this.c)
}
getBarycoord(e, t) {
return ps.getBarycoord(e, this.a, this.b, this.c, t)
}
getInterpolation(e, t, i, r, s) {
return ps.getInterpolation(e, this.a, this.b, this.c, t, i, r, s)
}
containsPoint(e) {
return ps.containsPoint(e, this.a, this.b, this.c)
}
isFrontFacing(e) {
return ps.isFrontFacing(this.a, this.b, this.c, e)
}
intersectsBox(e) {
return e.intersectsTriangle(this)
}
closestPointToPoint(e, t) {
const i = this.a,
r = this.b,
s = this.c
let o, a
;(dc.subVectors(r, i), hc.subVectors(s, i), Sg.subVectors(e, i))
const l = dc.dot(Sg),
c = hc.dot(Sg)
if (l <= 0 && c <= 0) return t.copy(i)
Ag.subVectors(e, r)
const u = dc.dot(Ag),
d = hc.dot(Ag)
if (u >= 0 && d <= u) return t.copy(r)
const h = l * d - u * c
if (h <= 0 && l >= 0 && u <= 0) return ((o = l / (l - u)), t.copy(i).addScaledVector(dc, o))
bg.subVectors(e, s)
const f = dc.dot(bg),
p = hc.dot(bg)
if (p >= 0 && f <= p) return t.copy(s)
const g = f * c - l * p
if (g <= 0 && c >= 0 && p <= 0) return ((a = c / (c - p)), t.copy(i).addScaledVector(hc, a))
const y = u * p - f * d
if (y <= 0 && d - u >= 0 && f - p >= 0)
return (
BS.subVectors(s, r),
(a = (d - u) / (d - u + (f - p))),
t.copy(r).addScaledVector(BS, a)
)
const m = 1 / (y + g + h)
return ((o = g * m), (a = h * m), t.copy(i).addScaledVector(dc, o).addScaledVector(hc, a))
}
equals(e) {
return e.a.equals(this.a) && e.b.equals(this.b) && e.c.equals(this.c)
}
}
const L5 = {
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,
},
ua = { h: 0, s: 0, l: 0 },
Ef = { h: 0, s: 0, l: 0 }
function Eg(n, e, t) {
return (
t < 0 && (t += 1),
t > 1 && (t -= 1),
t < 1 / 6 ? n + (e - n) * 6 * t : t < 1 / 2 ? e : t < 2 / 3 ? n + (e - n) * 6 * (2 / 3 - t) : n
)
}
class gt {
constructor(e, t, i) {
return ((this.isColor = !0), (this.r = 1), (this.g = 1), (this.b = 1), this.set(e, t, i))
}
set(e, t, i) {
if (t === void 0 && i === void 0) {
const r = e
r && r.isColor
? this.copy(r)
: typeof r == 'number'
? this.setHex(r)
: typeof r == 'string' && this.setStyle(r)
} else this.setRGB(e, t, i)
return this
}
setScalar(e) {
return ((this.r = e), (this.g = e), (this.b = e), this)
}
setHex(e, t = pi) {
return (
(e = Math.floor(e)),
(this.r = ((e >> 16) & 255) / 255),
(this.g = ((e >> 8) & 255) / 255),
(this.b = (e & 255) / 255),
wt.toWorkingColorSpace(this, t),
this
)
}
setRGB(e, t, i, r = wt.workingColorSpace) {
return ((this.r = e), (this.g = t), (this.b = i), wt.toWorkingColorSpace(this, r), this)
}
setHSL(e, t, i, r = wt.workingColorSpace) {
if (((e = A_(e, 1)), (t = Nt(t, 0, 1)), (i = Nt(i, 0, 1)), t === 0))
this.r = this.g = this.b = i
else {
const s = i <= 0.5 ? i * (1 + t) : i + t - i * t,
o = 2 * i - s
;((this.r = Eg(o, s, e + 1 / 3)), (this.g = Eg(o, s, e)), (this.b = Eg(o, s, e - 1 / 3)))
}
return (wt.toWorkingColorSpace(this, r), this)
}
setStyle(e, t = pi) {
function i(s) {
s !== void 0 &&
parseFloat(s) < 1 &&
console.warn('THREE.Color: Alpha component of ' + e + ' will be ignored.')
}
let r
if ((r = /^(\w+)\(([^\)]*)\)/.exec(e))) {
let s
const o = r[1],
a = r[2]
switch (o) {
case 'rgb':
case 'rgba':
if ((s = /^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(a)))
return (
i(s[4]),
this.setRGB(
Math.min(255, parseInt(s[1], 10)) / 255,
Math.min(255, parseInt(s[2], 10)) / 255,
Math.min(255, parseInt(s[3], 10)) / 255,
t
)
)
if ((s = /^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(a)))
return (
i(s[4]),
this.setRGB(
Math.min(100, parseInt(s[1], 10)) / 100,
Math.min(100, parseInt(s[2], 10)) / 100,
Math.min(100, parseInt(s[3], 10)) / 100,
t
)
)
break
case 'hsl':
case 'hsla':
if (
(s =
/^\s*(\d*\.?\d+)\s*,\s*(\d*\.?\d+)\%\s*,\s*(\d*\.?\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(
a
))
)
return (
i(s[4]),
this.setHSL(parseFloat(s[1]) / 360, parseFloat(s[2]) / 100, parseFloat(s[3]) / 100, t)
)
break
default:
console.warn('THREE.Color: Unknown color model ' + e)
}
} else if ((r = /^\#([A-Fa-f\d]+)$/.exec(e))) {
const s = r[1],
o = s.length
if (o === 3)
return this.setRGB(
parseInt(s.charAt(0), 16) / 15,
parseInt(s.charAt(1), 16) / 15,
parseInt(s.charAt(2), 16) / 15,
t
)
if (o === 6) return this.setHex(parseInt(s, 16), t)
console.warn('THREE.Color: Invalid hex color ' + e)
} else if (e && e.length > 0) return this.setColorName(e, t)
return this
}
setColorName(e, t = pi) {
const i = L5[e.toLowerCase()]
return (
i !== void 0 ? this.setHex(i, t) : console.warn('THREE.Color: Unknown color ' + e),
this
)
}
clone() {
return new this.constructor(this.r, this.g, this.b)
}
copy(e) {
return ((this.r = e.r), (this.g = e.g), (this.b = e.b), this)
}
copySRGBToLinear(e) {
return ((this.r = Vo(e.r)), (this.g = Vo(e.g)), (this.b = Vo(e.b)), this)
}
copyLinearToSRGB(e) {
return ((this.r = Wc(e.r)), (this.g = Wc(e.g)), (this.b = Wc(e.b)), this)
}
convertSRGBToLinear() {
return (this.copySRGBToLinear(this), this)
}
convertLinearToSRGB() {
return (this.copyLinearToSRGB(this), this)
}
getHex(e = pi) {
return (
wt.fromWorkingColorSpace(Ci.copy(this), e),
Math.round(Nt(Ci.r * 255, 0, 255)) * 65536 +
Math.round(Nt(Ci.g * 255, 0, 255)) * 256 +
Math.round(Nt(Ci.b * 255, 0, 255))
)
}
getHexString(e = pi) {
return ('000000' + this.getHex(e).toString(16)).slice(-6)
}
getHSL(e, t = wt.workingColorSpace) {
wt.fromWorkingColorSpace(Ci.copy(this), t)
const i = Ci.r,
r = Ci.g,
s = Ci.b,
o = Math.max(i, r, s),
a = Math.min(i, r, s)
let l, c
const u = (a + o) / 2
if (a === o) ((l = 0), (c = 0))
else {
const d = o - a
switch (((c = u <= 0.5 ? d / (o + a) : d / (2 - o - a)), o)) {
case i:
l = (r - s) / d + (r < s ? 6 : 0)
break
case r:
l = (s - i) / d + 2
break
case s:
l = (i - r) / d + 4
break
}
l /= 6
}
return ((e.h = l), (e.s = c), (e.l = u), e)
}
getRGB(e, t = wt.workingColorSpace) {
return (wt.fromWorkingColorSpace(Ci.copy(this), t), (e.r = Ci.r), (e.g = Ci.g), (e.b = Ci.b), e)
}
getStyle(e = pi) {
wt.fromWorkingColorSpace(Ci.copy(this), e)
const t = Ci.r,
i = Ci.g,
r = Ci.b
return e !== pi
? 'color('
.concat(e, ' ')
.concat(t.toFixed(3), ' ')
.concat(i.toFixed(3), ' ')
.concat(r.toFixed(3), ')')
: 'rgb('
.concat(Math.round(t * 255), ',')
.concat(Math.round(i * 255), ',')
.concat(Math.round(r * 255), ')')
}
offsetHSL(e, t, i) {
return (this.getHSL(ua), this.setHSL(ua.h + e, ua.s + t, ua.l + i))
}
add(e) {
return ((this.r += e.r), (this.g += e.g), (this.b += e.b), this)
}
addColors(e, t) {
return ((this.r = e.r + t.r), (this.g = e.g + t.g), (this.b = e.b + t.b), this)
}
addScalar(e) {
return ((this.r += e), (this.g += e), (this.b += e), this)
}
sub(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
)
}
multiply(e) {
return ((this.r *= e.r), (this.g *= e.g), (this.b *= e.b), this)
}
multiplyScalar(e) {
return ((this.r *= e), (this.g *= e), (this.b *= e), this)
}
lerp(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
)
}
lerpColors(e, t, i) {
return (
(this.r = e.r + (t.r - e.r) * i),
(this.g = e.g + (t.g - e.g) * i),
(this.b = e.b + (t.b - e.b) * i),
this
)
}
lerpHSL(e, t) {
;(this.getHSL(ua), e.getHSL(Ef))
const i = Ud(ua.h, Ef.h, t),
r = Ud(ua.s, Ef.s, t),
s = Ud(ua.l, Ef.l, t)
return (this.setHSL(i, r, s), this)
}
setFromVector3(e) {
return ((this.r = e.x), (this.g = e.y), (this.b = e.z), this)
}
applyMatrix3(e) {
const t = this.r,
i = this.g,
r = this.b,
s = e.elements
return (
(this.r = s[0] * t + s[3] * i + s[6] * r),
(this.g = s[1] * t + s[4] * i + s[7] * r),
(this.b = s[2] * t + s[5] * i + s[8] * r),
this
)
}
equals(e) {
return e.r === this.r && e.g === this.g && e.b === this.b
}
fromArray(e, t = 0) {
return ((this.r = e[t]), (this.g = e[t + 1]), (this.b = e[t + 2]), this)
}
toArray(e = [], t = 0) {
return ((e[t] = this.r), (e[t + 1] = this.g), (e[t + 2] = this.b), e)
}
fromBufferAttribute(e, t) {
return ((this.r = e.getX(t)), (this.g = e.getY(t)), (this.b = e.getZ(t)), this)
}
toJSON() {
return this.getHex()
}
*[Symbol.iterator]() {
;(yield this.r, yield this.g, yield this.b)
}
}
const Ci = new gt()
gt.NAMES = L5
let QP = 0
class es extends so {
constructor() {
;(super(),
(this.isMaterial = !0),
Object.defineProperty(this, 'id', { value: QP++ }),
(this.uuid = xs()),
(this.name = ''),
(this.type = 'Material'),
(this.blending = zo),
(this.side = bs),
(this.vertexColors = !1),
(this.opacity = 1),
(this.transparent = !1),
(this.alphaHash = !1),
(this.blendSrc = sh),
(this.blendDst = oh),
(this.blendEquation = ml),
(this.blendSrcAlpha = null),
(this.blendDstAlpha = null),
(this.blendEquationAlpha = null),
(this.blendColor = new gt(0, 0, 0)),
(this.blendAlpha = 0),
(this.depthFunc = cu),
(this.depthTest = !0),
(this.depthWrite = !0),
(this.stencilWriteMask = 255),
(this.stencilFunc = bS),
(this.stencilRef = 0),
(this.stencilFuncMask = 255),
(this.stencilFail = ic),
(this.stencilZFail = ic),
(this.stencilZPass = ic),
(this.stencilWrite = !1),
(this.clippingPlanes = null),
(this.clipIntersection = !1),
(this.clipShadows = !1),
(this.shadowSide = null),
(this.colorWrite = !0),
(this.precision = null),
(this.polygonOffset = !1),
(this.polygonOffsetFactor = 0),
(this.polygonOffsetUnits = 0),
(this.dithering = !1),
(this.alphaToCoverage = !1),
(this.premultipliedAlpha = !1),
(this.forceSinglePass = !1),
(this.visible = !0),
(this.toneMapped = !0),
(this.userData = {}),
(this.version = 0),
(this._alphaTest = 0))
}
get alphaTest() {
return this._alphaTest
}
set alphaTest(e) {
;(this._alphaTest > 0 != e > 0 && this.version++, (this._alphaTest = e))
}
onBeforeRender() {}
onBeforeCompile() {}
customProgramCacheKey() {
return this.onBeforeCompile.toString()
}
setValues(e) {
if (e !== void 0)
for (const t in e) {
const i = e[t]
if (i === void 0) {
console.warn("THREE.Material: parameter '".concat(t, "' has value of undefined."))
continue
}
const r = this[t]
if (r === void 0) {
console.warn(
"THREE.Material: '".concat(t, "' is not a property of THREE.").concat(this.type, '.')
)
continue
}
r && r.isColor ? r.set(i) : r && r.isVector3 && i && i.isVector3 ? r.copy(i) : (this[t] = i)
}
}
toJSON(e) {
const t = e === void 0 || typeof e == 'string'
t && (e = { textures: {}, images: {} })
const i = { metadata: { version: 4.6, type: 'Material', generator: 'Material.toJSON' } }
;((i.uuid = this.uuid),
(i.type = this.type),
this.name !== '' && (i.name = this.name),
this.color && this.color.isColor && (i.color = this.color.getHex()),
this.roughness !== void 0 && (i.roughness = this.roughness),
this.metalness !== void 0 && (i.metalness = this.metalness),
this.sheen !== void 0 && (i.sheen = this.sheen),
this.sheenColor && this.sheenColor.isColor && (i.sheenColor = this.sheenColor.getHex()),
this.sheenRoughness !== void 0 && (i.sheenRoughness = this.sheenRoughness),
this.emissive && this.emissive.isColor && (i.emissive = this.emissive.getHex()),
this.emissiveIntensity !== void 0 &&
this.emissiveIntensity !== 1 &&
(i.emissiveIntensity = this.emissiveIntensity),
this.specular && this.specular.isColor && (i.specular = this.specular.getHex()),
this.specularIntensity !== void 0 && (i.specularIntensity = this.specularIntensity),
this.specularColor &&
this.specularColor.isColor &&
(i.specularColor = this.specularColor.getHex()),
this.shininess !== void 0 && (i.shininess = this.shininess),
this.clearcoat !== void 0 && (i.clearcoat = this.clearcoat),
this.clearcoatRoughness !== void 0 && (i.clearcoatRoughness = this.clearcoatRoughness),
this.clearcoatMap &&
this.clearcoatMap.isTexture &&
(i.clearcoatMap = this.clearcoatMap.toJSON(e).uuid),
this.clearcoatRoughnessMap &&
this.clearcoatRoughnessMap.isTexture &&
(i.clearcoatRoughnessMap = this.clearcoatRoughnessMap.toJSON(e).uuid),
this.clearcoatNormalMap &&
this.clearcoatNormalMap.isTexture &&
((i.clearcoatNormalMap = this.clearcoatNormalMap.toJSON(e).uuid),
(i.clearcoatNormalScale = this.clearcoatNormalScale.toArray())),
this.dispersion !== void 0 && (i.dispersion = this.dispersion),
this.iridescence !== void 0 && (i.iridescence = this.iridescence),
this.iridescenceIOR !== void 0 && (i.iridescenceIOR = this.iridescenceIOR),
this.iridescenceThicknessRange !== void 0 &&
(i.iridescenceThicknessRange = this.iridescenceThicknessRange),
this.iridescenceMap &&
this.iridescenceMap.isTexture &&
(i.iridescenceMap = this.iridescenceMap.toJSON(e).uuid),
this.iridescenceThicknessMap &&
this.iridescenceThicknessMap.isTexture &&
(i.iridescenceThicknessMap = this.iridescenceThicknessMap.toJSON(e).uuid),
this.anisotropy !== void 0 && (i.anisotropy = this.anisotropy),
this.anisotropyRotation !== void 0 && (i.anisotropyRotation = this.anisotropyRotation),
this.anisotropyMap &&
this.anisotropyMap.isTexture &&
(i.anisotropyMap = this.anisotropyMap.toJSON(e).uuid),
this.map && this.map.isTexture && (i.map = this.map.toJSON(e).uuid),
this.matcap && this.matcap.isTexture && (i.matcap = this.matcap.toJSON(e).uuid),
this.alphaMap && this.alphaMap.isTexture && (i.alphaMap = this.alphaMap.toJSON(e).uuid),
this.lightMap &&
this.lightMap.isTexture &&
((i.lightMap = this.lightMap.toJSON(e).uuid),
(i.lightMapIntensity = this.lightMapIntensity)),
this.aoMap &&
this.aoMap.isTexture &&
((i.aoMap = this.aoMap.toJSON(e).uuid), (i.aoMapIntensity = this.aoMapIntensity)),
this.bumpMap &&
this.bumpMap.isTexture &&
((i.bumpMap = this.bumpMap.toJSON(e).uuid), (i.bumpScale = this.bumpScale)),
this.normalMap &&
this.normalMap.isTexture &&
((i.normalMap = this.normalMap.toJSON(e).uuid),
(i.normalMapType = this.normalMapType),
(i.normalScale = this.normalScale.toArray())),
this.displacementMap &&
this.displacementMap.isTexture &&
((i.displacementMap = this.displacementMap.toJSON(e).uuid),
(i.displacementScale = this.displacementScale),
(i.displacementBias = this.displacementBias)),
this.roughnessMap &&
this.roughnessMap.isTexture &&
(i.roughnessMap = this.roughnessMap.toJSON(e).uuid),
this.metalnessMap &&
this.metalnessMap.isTexture &&
(i.metalnessMap = this.metalnessMap.toJSON(e).uuid),
this.emissiveMap &&
this.emissiveMap.isTexture &&
(i.emissiveMap = this.emissiveMap.toJSON(e).uuid),
this.specularMap &&
this.specularMap.isTexture &&
(i.specularMap = this.specularMap.toJSON(e).uuid),
this.specularIntensityMap &&
this.specularIntensityMap.isTexture &&
(i.specularIntensityMap = this.specularIntensityMap.toJSON(e).uuid),
this.specularColorMap &&
this.specularColorMap.isTexture &&
(i.specularColorMap = this.specularColorMap.toJSON(e).uuid),
this.envMap &&
this.envMap.isTexture &&
((i.envMap = this.envMap.toJSON(e).uuid),
this.combine !== void 0 && (i.combine = this.combine)),
this.envMapRotation !== void 0 && (i.envMapRotation = this.envMapRotation.toArray()),
this.envMapIntensity !== void 0 && (i.envMapIntensity = this.envMapIntensity),
this.reflectivity !== void 0 && (i.reflectivity = this.reflectivity),
this.refractionRatio !== void 0 && (i.refractionRatio = this.refractionRatio),
this.gradientMap &&
this.gradientMap.isTexture &&
(i.gradientMap = this.gradientMap.toJSON(e).uuid),
this.transmission !== void 0 && (i.transmission = this.transmission),
this.transmissionMap &&
this.transmissionMap.isTexture &&
(i.transmissionMap = this.transmissionMap.toJSON(e).uuid),
this.thickness !== void 0 && (i.thickness = this.thickness),
this.thicknessMap &&
this.thicknessMap.isTexture &&
(i.thicknessMap = this.thicknessMap.toJSON(e).uuid),
this.attenuationDistance !== void 0 &&
this.attenuationDistance !== 1 / 0 &&
(i.attenuationDistance = this.attenuationDistance),
this.attenuationColor !== void 0 && (i.attenuationColor = this.attenuationColor.getHex()),
this.size !== void 0 && (i.size = this.size),
this.shadowSide !== null && (i.shadowSide = this.shadowSide),
this.sizeAttenuation !== void 0 && (i.sizeAttenuation = this.sizeAttenuation),
this.blending !== zo && (i.blending = this.blending),
this.side !== bs && (i.side = this.side),
this.vertexColors === !0 && (i.vertexColors = !0),
this.opacity < 1 && (i.opacity = this.opacity),
this.transparent === !0 && (i.transparent = !0),
this.blendSrc !== sh && (i.blendSrc = this.blendSrc),
this.blendDst !== oh && (i.blendDst = this.blendDst),
this.blendEquation !== ml && (i.blendEquation = this.blendEquation),
this.blendSrcAlpha !== null && (i.blendSrcAlpha = this.blendSrcAlpha),
this.blendDstAlpha !== null && (i.blendDstAlpha = this.blendDstAlpha),
this.blendEquationAlpha !== null && (i.blendEquationAlpha = this.blendEquationAlpha),
this.blendColor && this.blendColor.isColor && (i.blendColor = this.blendColor.getHex()),
this.blendAlpha !== 0 && (i.blendAlpha = this.blendAlpha),
this.depthFunc !== cu && (i.depthFunc = this.depthFunc),
this.depthTest === !1 && (i.depthTest = this.depthTest),
this.depthWrite === !1 && (i.depthWrite = this.depthWrite),
this.colorWrite === !1 && (i.colorWrite = this.colorWrite),
this.stencilWriteMask !== 255 && (i.stencilWriteMask = this.stencilWriteMask),
this.stencilFunc !== bS && (i.stencilFunc = this.stencilFunc),
this.stencilRef !== 0 && (i.stencilRef = this.stencilRef),
this.stencilFuncMask !== 255 && (i.stencilFuncMask = this.stencilFuncMask),
this.stencilFail !== ic && (i.stencilFail = this.stencilFail),
this.stencilZFail !== ic && (i.stencilZFail = this.stencilZFail),
this.stencilZPass !== ic && (i.stencilZPass = this.stencilZPass),
this.stencilWrite === !0 && (i.stencilWrite = this.stencilWrite),
this.rotation !== void 0 && this.rotation !== 0 && (i.rotation = this.rotation),
this.polygonOffset === !0 && (i.polygonOffset = !0),
this.polygonOffsetFactor !== 0 && (i.polygonOffsetFactor = this.polygonOffsetFactor),
this.polygonOffsetUnits !== 0 && (i.polygonOffsetUnits = this.polygonOffsetUnits),
this.linewidth !== void 0 && this.linewidth !== 1 && (i.linewidth = this.linewidth),
this.dashSize !== void 0 && (i.dashSize = this.dashSize),
this.gapSize !== void 0 && (i.gapSize = this.gapSize),
this.scale !== void 0 && (i.scale = this.scale),
this.dithering === !0 && (i.dithering = !0),
this.alphaTest > 0 && (i.alphaTest = this.alphaTest),
this.alphaHash === !0 && (i.alphaHash = !0),
this.alphaToCoverage === !0 && (i.alphaToCoverage = !0),
this.premultipliedAlpha === !0 && (i.premultipliedAlpha = !0),
this.forceSinglePass === !0 && (i.forceSinglePass = !0),
this.wireframe === !0 && (i.wireframe = !0),
this.wireframeLinewidth > 1 && (i.wireframeLinewidth = this.wireframeLinewidth),
this.wireframeLinecap !== 'round' && (i.wireframeLinecap = this.wireframeLinecap),
this.wireframeLinejoin !== 'round' && (i.wireframeLinejoin = this.wireframeLinejoin),
this.flatShading === !0 && (i.flatShading = !0),
this.visible === !1 && (i.visible = !1),
this.toneMapped === !1 && (i.toneMapped = !1),
this.fog === !1 && (i.fog = !1),
Object.keys(this.userData).length > 0 && (i.userData = this.userData))
function r(s) {
const o = []
for (const a in s) {
const l = s[a]
;(delete l.metadata, o.push(l))
}
return o
}
if (t) {
const s = r(e.textures),
o = r(e.images)
;(s.length > 0 && (i.textures = s), o.length > 0 && (i.images = o))
}
return i
}
clone() {
return new this.constructor().copy(this)
}
copy(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))
const t = e.clippingPlanes
let i = null
if (t !== null) {
const r = t.length
i = new Array(r)
for (let s = 0; s !== r; ++s) i[s] = t[s].clone()
}
return (
(this.clippingPlanes = i),
(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
)
}
dispose() {
this.dispatchEvent({ type: 'dispose' })
}
set needsUpdate(e) {
e === !0 && this.version++
}
onBuild() {
console.warn('Material: onBuild() has been removed.')
}
}
class Yr extends es {
constructor(e) {
;(super(),
(this.isMeshBasicMaterial = !0),
(this.type = 'MeshBasicMaterial'),
(this.color = new gt(16777215)),
(this.map = null),
(this.lightMap = null),
(this.lightMapIntensity = 1),
(this.aoMap = null),
(this.aoMapIntensity = 1),
(this.specularMap = null),
(this.alphaMap = null),
(this.envMap = null),
(this.envMapRotation = new ws()),
(this.combine = g5),
(this.reflectivity = 1),
(this.refractionRatio = 0.98),
(this.wireframe = !1),
(this.wireframeLinewidth = 1),
(this.wireframeLinecap = 'round'),
(this.wireframeLinejoin = 'round'),
(this.fog = !0),
this.setValues(e))
}
copy(e) {
return (
super.copy(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
)
}
}
const Do = jP()
function jP() {
const n = new ArrayBuffer(4),
e = new Float32Array(n),
t = new Uint32Array(n),
i = new Uint32Array(512),
r = new Uint32Array(512)
for (let l = 0; l < 256; ++l) {
const c = l - 127
c < -27
? ((i[l] = 0), (i[l | 256] = 32768), (r[l] = 24), (r[l | 256] = 24))
: c < -14
? ((i[l] = 1024 >> (-c - 14)),
(i[l | 256] = (1024 >> (-c - 14)) | 32768),
(r[l] = -c - 1),
(r[l | 256] = -c - 1))
: c <= 15
? ((i[l] = (c + 15) << 10),
(i[l | 256] = ((c + 15) << 10) | 32768),
(r[l] = 13),
(r[l | 256] = 13))
: c < 128
? ((i[l] = 31744), (i[l | 256] = 64512), (r[l] = 24), (r[l | 256] = 24))
: ((i[l] = 31744), (i[l | 256] = 64512), (r[l] = 13), (r[l | 256] = 13))
}
const s = new Uint32Array(2048),
o = new Uint32Array(64),
a = new Uint32Array(64)
for (let l = 1; l < 1024; ++l) {
let c = l << 13,
u = 0
for (; (c & 8388608) === 0; ) ((c <<= 1), (u -= 8388608))
;((c &= -8388609), (u += 947912704), (s[l] = c | u))
}
for (let l = 1024; l < 2048; ++l) s[l] = 939524096 + ((l - 1024) << 13)
for (let l = 1; l < 31; ++l) o[l] = l << 23
;((o[31] = 1199570944), (o[32] = 2147483648))
for (let l = 33; l < 63; ++l) o[l] = 2147483648 + ((l - 32) << 23)
o[63] = 3347054592
for (let l = 1; l < 64; ++l) l !== 32 && (a[l] = 1024)
return {
floatView: e,
uint32View: t,
baseTable: i,
shiftTable: r,
mantissaTable: s,
exponentTable: o,
offsetTable: a,
}
}
function qP(n) {
;(Math.abs(n) > 65504 && console.warn('THREE.DataUtils.toHalfFloat(): Value out of range.'),
(n = Nt(n, -65504, 65504)),
(Do.floatView[0] = n))
const e = Do.uint32View[0],
t = (e >> 23) & 511
return Do.baseTable[t] + ((e & 8388607) >> Do.shiftTable[t])
}
function XP(n) {
const e = n >> 10
return (
(Do.uint32View[0] = Do.mantissaTable[Do.offsetTable[e] + (n & 1023)] + Do.exponentTable[e]),
Do.floatView[0]
)
}
const hh = { toHalfFloat: qP, fromHalfFloat: XP },
zn = new Y(),
Mf = new qe()
let KP = 0
class xi {
constructor(e, t, i = !1) {
if (Array.isArray(e))
throw new TypeError('THREE.BufferAttribute: array should be a Typed Array.')
;((this.isBufferAttribute = !0),
Object.defineProperty(this, 'id', { value: KP++ }),
(this.name = ''),
(this.array = e),
(this.itemSize = t),
(this.count = e !== void 0 ? e.length / t : 0),
(this.normalized = i),
(this.usage = pm),
(this.updateRanges = []),
(this.gpuType = ir),
(this.version = 0))
}
onUploadCallback() {}
set needsUpdate(e) {
e === !0 && this.version++
}
setUsage(e) {
return ((this.usage = e), this)
}
addUpdateRange(e, t) {
this.updateRanges.push({ start: e, count: t })
}
clearUpdateRanges() {
this.updateRanges.length = 0
}
copy(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
)
}
copyAt(e, t, i) {
;((e *= this.itemSize), (i *= t.itemSize))
for (let r = 0, s = this.itemSize; r < s; r++) this.array[e + r] = t.array[i + r]
return this
}
copyArray(e) {
return (this.array.set(e), this)
}
applyMatrix3(e) {
if (this.itemSize === 2)
for (let t = 0, i = this.count; t < i; t++)
(Mf.fromBufferAttribute(this, t), Mf.applyMatrix3(e), this.setXY(t, Mf.x, Mf.y))
else if (this.itemSize === 3)
for (let t = 0, i = this.count; t < i; t++)
(zn.fromBufferAttribute(this, t), zn.applyMatrix3(e), this.setXYZ(t, zn.x, zn.y, zn.z))
return this
}
applyMatrix4(e) {
for (let t = 0, i = this.count; t < i; t++)
(zn.fromBufferAttribute(this, t), zn.applyMatrix4(e), this.setXYZ(t, zn.x, zn.y, zn.z))
return this
}
applyNormalMatrix(e) {
for (let t = 0, i = this.count; t < i; t++)
(zn.fromBufferAttribute(this, t), zn.applyNormalMatrix(e), this.setXYZ(t, zn.x, zn.y, zn.z))
return this
}
transformDirection(e) {
for (let t = 0, i = this.count; t < i; t++)
(zn.fromBufferAttribute(this, t), zn.transformDirection(e), this.setXYZ(t, zn.x, zn.y, zn.z))
return this
}
set(e, t = 0) {
return (this.array.set(e, t), this)
}
getComponent(e, t) {
let i = this.array[e * this.itemSize + t]
return (this.normalized && (i = fs(i, this.array)), i)
}
setComponent(e, t, i) {
return (
this.normalized && (i = ln(i, this.array)),
(this.array[e * this.itemSize + t] = i),
this
)
}
getX(e) {
let t = this.array[e * this.itemSize]
return (this.normalized && (t = fs(t, this.array)), t)
}
setX(e, t) {
return (this.normalized && (t = ln(t, this.array)), (this.array[e * this.itemSize] = t), this)
}
getY(e) {
let t = this.array[e * this.itemSize + 1]
return (this.normalized && (t = fs(t, this.array)), t)
}
setY(e, t) {
return (
this.normalized && (t = ln(t, this.array)),
(this.array[e * this.itemSize + 1] = t),
this
)
}
getZ(e) {
let t = this.array[e * this.itemSize + 2]
return (this.normalized && (t = fs(t, this.array)), t)
}
setZ(e, t) {
return (
this.normalized && (t = ln(t, this.array)),
(this.array[e * this.itemSize + 2] = t),
this
)
}
getW(e) {
let t = this.array[e * this.itemSize + 3]
return (this.normalized && (t = fs(t, this.array)), t)
}
setW(e, t) {
return (
this.normalized && (t = ln(t, this.array)),
(this.array[e * this.itemSize + 3] = t),
this
)
}
setXY(e, t, i) {
return (
(e *= this.itemSize),
this.normalized && ((t = ln(t, this.array)), (i = ln(i, this.array))),
(this.array[e + 0] = t),
(this.array[e + 1] = i),
this
)
}
setXYZ(e, t, i, r) {
return (
(e *= this.itemSize),
this.normalized &&
((t = ln(t, this.array)), (i = ln(i, this.array)), (r = ln(r, this.array))),
(this.array[e + 0] = t),
(this.array[e + 1] = i),
(this.array[e + 2] = r),
this
)
}
setXYZW(e, t, i, r, s) {
return (
(e *= this.itemSize),
this.normalized &&
((t = ln(t, this.array)),
(i = ln(i, this.array)),
(r = ln(r, this.array)),
(s = ln(s, this.array))),
(this.array[e + 0] = t),
(this.array[e + 1] = i),
(this.array[e + 2] = r),
(this.array[e + 3] = s),
this
)
}
onUpload(e) {
return ((this.onUploadCallback = e), this)
}
clone() {
return new this.constructor(this.array, this.itemSize).copy(this)
}
toJSON() {
const 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 !== pm && (e.usage = this.usage),
e
)
}
}
class D5 extends xi {
constructor(e, t, i) {
super(new Uint16Array(e), t, i)
}
}
class F5 extends xi {
constructor(e, t, i) {
super(new Uint32Array(e), t, i)
}
}
class Si extends xi {
constructor(e, t, i) {
super(new Float32Array(e), t, i)
}
}
let YP = 0
const Hr = new Xe(),
Mg = new rn(),
fc = new Y(),
pr = new rr(),
sd = new rr(),
ai = new Y()
class Ui extends so {
constructor() {
;(super(),
(this.isBufferGeometry = !0),
Object.defineProperty(this, 'id', { value: YP++ }),
(this.uuid = xs()),
(this.name = ''),
(this.type = 'BufferGeometry'),
(this.index = null),
(this.indirect = null),
(this.attributes = {}),
(this.morphAttributes = {}),
(this.morphTargetsRelative = !1),
(this.groups = []),
(this.boundingBox = null),
(this.boundingSphere = null),
(this.drawRange = { start: 0, count: 1 / 0 }),
(this.userData = {}))
}
getIndex() {
return this.index
}
setIndex(e) {
return (Array.isArray(e) ? (this.index = new (I5(e) ? F5 : D5)(e, 1)) : (this.index = e), this)
}
setIndirect(e) {
return ((this.indirect = e), this)
}
getIndirect() {
return this.indirect
}
getAttribute(e) {
return this.attributes[e]
}
setAttribute(e, t) {
return ((this.attributes[e] = t), this)
}
deleteAttribute(e) {
return (delete this.attributes[e], this)
}
hasAttribute(e) {
return this.attributes[e] !== void 0
}
addGroup(e, t, i = 0) {
this.groups.push({ start: e, count: t, materialIndex: i })
}
clearGroups() {
this.groups = []
}
setDrawRange(e, t) {
;((this.drawRange.start = e), (this.drawRange.count = t))
}
applyMatrix4(e) {
const t = this.attributes.position
t !== void 0 && (t.applyMatrix4(e), (t.needsUpdate = !0))
const i = this.attributes.normal
if (i !== void 0) {
const s = new mt().getNormalMatrix(e)
;(i.applyNormalMatrix(s), (i.needsUpdate = !0))
}
const r = this.attributes.tangent
return (
r !== void 0 && (r.transformDirection(e), (r.needsUpdate = !0)),
this.boundingBox !== null && this.computeBoundingBox(),
this.boundingSphere !== null && this.computeBoundingSphere(),
this
)
}
applyQuaternion(e) {
return (Hr.makeRotationFromQuaternion(e), this.applyMatrix4(Hr), this)
}
rotateX(e) {
return (Hr.makeRotationX(e), this.applyMatrix4(Hr), this)
}
rotateY(e) {
return (Hr.makeRotationY(e), this.applyMatrix4(Hr), this)
}
rotateZ(e) {
return (Hr.makeRotationZ(e), this.applyMatrix4(Hr), this)
}
translate(e, t, i) {
return (Hr.makeTranslation(e, t, i), this.applyMatrix4(Hr), this)
}
scale(e, t, i) {
return (Hr.makeScale(e, t, i), this.applyMatrix4(Hr), this)
}
lookAt(e) {
return (Mg.lookAt(e), Mg.updateMatrix(), this.applyMatrix4(Mg.matrix), this)
}
center() {
return (
this.computeBoundingBox(),
this.boundingBox.getCenter(fc).negate(),
this.translate(fc.x, fc.y, fc.z),
this
)
}
setFromPoints(e) {
const t = this.getAttribute('position')
if (t === void 0) {
const i = []
for (let r = 0, s = e.length; r < s; r++) {
const o = e[r]
i.push(o.x, o.y, o.z || 0)
}
this.setAttribute('position', new Si(i, 3))
} else {
const i = Math.min(e.length, t.count)
for (let r = 0; r < i; r++) {
const s = e[r]
t.setXYZ(r, s.x, s.y, s.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
}
computeBoundingBox() {
this.boundingBox === null && (this.boundingBox = new rr())
const e = this.attributes.position,
t = this.morphAttributes.position
if (e && e.isGLBufferAttribute) {
;(console.error(
'THREE.BufferGeometry.computeBoundingBox(): GLBufferAttribute requires a manual bounding box.',
this
),
this.boundingBox.set(new Y(-1 / 0, -1 / 0, -1 / 0), new Y(1 / 0, 1 / 0, 1 / 0)))
return
}
if (e !== void 0) {
if ((this.boundingBox.setFromBufferAttribute(e), t))
for (let i = 0, r = t.length; i < r; i++) {
const s = t[i]
;(pr.setFromBufferAttribute(s),
this.morphTargetsRelative
? (ai.addVectors(this.boundingBox.min, pr.min),
this.boundingBox.expandByPoint(ai),
ai.addVectors(this.boundingBox.max, pr.max),
this.boundingBox.expandByPoint(ai))
: (this.boundingBox.expandByPoint(pr.min), this.boundingBox.expandByPoint(pr.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
)
}
computeBoundingSphere() {
this.boundingSphere === null && (this.boundingSphere = new oo())
const e = this.attributes.position,
t = this.morphAttributes.position
if (e && e.isGLBufferAttribute) {
;(console.error(
'THREE.BufferGeometry.computeBoundingSphere(): GLBufferAttribute requires a manual bounding sphere.',
this
),
this.boundingSphere.set(new Y(), 1 / 0))
return
}
if (e) {
const i = this.boundingSphere.center
if ((pr.setFromBufferAttribute(e), t))
for (let s = 0, o = t.length; s < o; s++) {
const a = t[s]
;(sd.setFromBufferAttribute(a),
this.morphTargetsRelative
? (ai.addVectors(pr.min, sd.min),
pr.expandByPoint(ai),
ai.addVectors(pr.max, sd.max),
pr.expandByPoint(ai))
: (pr.expandByPoint(sd.min), pr.expandByPoint(sd.max)))
}
pr.getCenter(i)
let r = 0
for (let s = 0, o = e.count; s < o; s++)
(ai.fromBufferAttribute(e, s), (r = Math.max(r, i.distanceToSquared(ai))))
if (t)
for (let s = 0, o = t.length; s < o; s++) {
const a = t[s],
l = this.morphTargetsRelative
for (let c = 0, u = a.count; c < u; c++)
(ai.fromBufferAttribute(a, c),
l && (fc.fromBufferAttribute(e, c), ai.add(fc)),
(r = Math.max(r, i.distanceToSquared(ai))))
}
;((this.boundingSphere.radius = Math.sqrt(r)),
isNaN(this.boundingSphere.radius) &&
console.error(
'THREE.BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The "position" attribute is likely to have NaN values.',
this
))
}
}
computeTangents() {
const e = this.index,
t = this.attributes
if (e === null || t.position === void 0 || t.normal === void 0 || t.uv === void 0) {
console.error(
'THREE.BufferGeometry: .computeTangents() failed. Missing required attributes (index, position, normal or uv)'
)
return
}
const i = t.position,
r = t.normal,
s = t.uv
this.hasAttribute('tangent') === !1 &&
this.setAttribute('tangent', new xi(new Float32Array(4 * i.count), 4))
const o = this.getAttribute('tangent'),
a = [],
l = []
for (let R = 0; R < i.count; R++) ((a[R] = new Y()), (l[R] = new Y()))
const c = new Y(),
u = new Y(),
d = new Y(),
h = new qe(),
f = new qe(),
p = new qe(),
g = new Y(),
y = new Y()
function m(R, w, M) {
;(c.fromBufferAttribute(i, R),
u.fromBufferAttribute(i, w),
d.fromBufferAttribute(i, M),
h.fromBufferAttribute(s, R),
f.fromBufferAttribute(s, w),
p.fromBufferAttribute(s, M),
u.sub(c),
d.sub(c),
f.sub(h),
p.sub(h))
const I = 1 / (f.x * p.y - p.x * f.y)
isFinite(I) &&
(g.copy(u).multiplyScalar(p.y).addScaledVector(d, -f.y).multiplyScalar(I),
y.copy(d).multiplyScalar(f.x).addScaledVector(u, -p.x).multiplyScalar(I),
a[R].add(g),
a[w].add(g),
a[M].add(g),
l[R].add(y),
l[w].add(y),
l[M].add(y))
}
let v = this.groups
v.length === 0 && (v = [{ start: 0, count: e.count }])
for (let R = 0, w = v.length; R < w; ++R) {
const M = v[R],
I = M.start,
L = M.count
for (let U = I, T = I + L; U < T; U += 3) m(e.getX(U + 0), e.getX(U + 1), e.getX(U + 2))
}
const x = new Y(),
_ = new Y(),
S = new Y(),
C = new Y()
function A(R) {
;(S.fromBufferAttribute(r, R), C.copy(S))
const w = a[R]
;(x.copy(w), x.sub(S.multiplyScalar(S.dot(w))).normalize(), _.crossVectors(C, w))
const I = _.dot(l[R]) < 0 ? -1 : 1
o.setXYZW(R, x.x, x.y, x.z, I)
}
for (let R = 0, w = v.length; R < w; ++R) {
const M = v[R],
I = M.start,
L = M.count
for (let U = I, T = I + L; U < T; U += 3)
(A(e.getX(U + 0)), A(e.getX(U + 1)), A(e.getX(U + 2)))
}
}
computeVertexNormals() {
const e = this.index,
t = this.getAttribute('position')
if (t !== void 0) {
let i = this.getAttribute('normal')
if (i === void 0)
((i = new xi(new Float32Array(t.count * 3), 3)), this.setAttribute('normal', i))
else for (let h = 0, f = i.count; h < f; h++) i.setXYZ(h, 0, 0, 0)
const r = new Y(),
s = new Y(),
o = new Y(),
a = new Y(),
l = new Y(),
c = new Y(),
u = new Y(),
d = new Y()
if (e)
for (let h = 0, f = e.count; h < f; h += 3) {
const p = e.getX(h + 0),
g = e.getX(h + 1),
y = e.getX(h + 2)
;(r.fromBufferAttribute(t, p),
s.fromBufferAttribute(t, g),
o.fromBufferAttribute(t, y),
u.subVectors(o, s),
d.subVectors(r, s),
u.cross(d),
a.fromBufferAttribute(i, p),
l.fromBufferAttribute(i, g),
c.fromBufferAttribute(i, y),
a.add(u),
l.add(u),
c.add(u),
i.setXYZ(p, a.x, a.y, a.z),
i.setXYZ(g, l.x, l.y, l.z),
i.setXYZ(y, c.x, c.y, c.z))
}
else
for (let h = 0, f = t.count; h < f; h += 3)
(r.fromBufferAttribute(t, h + 0),
s.fromBufferAttribute(t, h + 1),
o.fromBufferAttribute(t, h + 2),
u.subVectors(o, s),
d.subVectors(r, s),
u.cross(d),
i.setXYZ(h + 0, u.x, u.y, u.z),
i.setXYZ(h + 1, u.x, u.y, u.z),
i.setXYZ(h + 2, u.x, u.y, u.z))
;(this.normalizeNormals(), (i.needsUpdate = !0))
}
}
normalizeNormals() {
const e = this.attributes.normal
for (let t = 0, i = e.count; t < i; t++)
(ai.fromBufferAttribute(e, t), ai.normalize(), e.setXYZ(t, ai.x, ai.y, ai.z))
}
toNonIndexed() {
function e(a, l) {
const c = a.array,
u = a.itemSize,
d = a.normalized,
h = new c.constructor(l.length * u)
let f = 0,
p = 0
for (let g = 0, y = l.length; g < y; g++) {
a.isInterleavedBufferAttribute ? (f = l[g] * a.data.stride + a.offset) : (f = l[g] * u)
for (let m = 0; m < u; m++) h[p++] = c[f++]
}
return new xi(h, u, d)
}
if (this.index === null)
return (
console.warn('THREE.BufferGeometry.toNonIndexed(): BufferGeometry is already non-indexed.'),
this
)
const t = new Ui(),
i = this.index.array,
r = this.attributes
for (const a in r) {
const l = r[a],
c = e(l, i)
t.setAttribute(a, c)
}
const s = this.morphAttributes
for (const a in s) {
const l = [],
c = s[a]
for (let u = 0, d = c.length; u < d; u++) {
const h = c[u],
f = e(h, i)
l.push(f)
}
t.morphAttributes[a] = l
}
t.morphTargetsRelative = this.morphTargetsRelative
const o = this.groups
for (let a = 0, l = o.length; a < l; a++) {
const c = o[a]
t.addGroup(c.start, c.count, c.materialIndex)
}
return t
}
toJSON() {
const 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),
this.parameters !== void 0)
) {
const l = this.parameters
for (const c in l) l[c] !== void 0 && (e[c] = l[c])
return e
}
e.data = { attributes: {} }
const t = this.index
t !== null &&
(e.data.index = {
type: t.array.constructor.name,
array: Array.prototype.slice.call(t.array),
})
const i = this.attributes
for (const l in i) {
const c = i[l]
e.data.attributes[l] = c.toJSON(e.data)
}
const r = {}
let s = !1
for (const l in this.morphAttributes) {
const c = this.morphAttributes[l],
u = []
for (let d = 0, h = c.length; d < h; d++) {
const f = c[d]
u.push(f.toJSON(e.data))
}
u.length > 0 && ((r[l] = u), (s = !0))
}
s && ((e.data.morphAttributes = r), (e.data.morphTargetsRelative = this.morphTargetsRelative))
const o = this.groups
o.length > 0 && (e.data.groups = JSON.parse(JSON.stringify(o)))
const a = this.boundingSphere
return (
a !== null && (e.data.boundingSphere = { center: a.center.toArray(), radius: a.radius }),
e
)
}
clone() {
return new this.constructor().copy(this)
}
copy(e) {
;((this.index = null),
(this.attributes = {}),
(this.morphAttributes = {}),
(this.groups = []),
(this.boundingBox = null),
(this.boundingSphere = null))
const t = {}
this.name = e.name
const i = e.index
i !== null && this.setIndex(i.clone(t))
const r = e.attributes
for (const c in r) {
const u = r[c]
this.setAttribute(c, u.clone(t))
}
const s = e.morphAttributes
for (const c in s) {
const u = [],
d = s[c]
for (let h = 0, f = d.length; h < f; h++) u.push(d[h].clone(t))
this.morphAttributes[c] = u
}
this.morphTargetsRelative = e.morphTargetsRelative
const o = e.groups
for (let c = 0, u = o.length; c < u; c++) {
const d = o[c]
this.addGroup(d.start, d.count, d.materialIndex)
}
const a = e.boundingBox
a !== null && (this.boundingBox = a.clone())
const l = e.boundingSphere
return (
l !== null && (this.boundingSphere = l.clone()),
(this.drawRange.start = e.drawRange.start),
(this.drawRange.count = e.drawRange.count),
(this.userData = e.userData),
this
)
}
dispose() {
this.dispatchEvent({ type: 'dispose' })
}
}
const US = new Xe(),
nl = new Uh(),
Rf = new oo(),
kS = new Y(),
If = new Y(),
Nf = new Y(),
Pf = new Y(),
Rg = new Y(),
Lf = new Y(),
zS = new Y(),
Df = new Y()
class pn extends rn {
constructor(e = new Ui(), t = new Yr()) {
;(super(),
(this.isMesh = !0),
(this.type = 'Mesh'),
(this.geometry = e),
(this.material = t),
this.updateMorphTargets())
}
copy(e, t) {
return (
super.copy(e, t),
e.morphTargetInfluences !== void 0 &&
(this.morphTargetInfluences = e.morphTargetInfluences.slice()),
e.morphTargetDictionary !== void 0 &&
(this.morphTargetDictionary = Object.assign({}, e.morphTargetDictionary)),
(this.material = Array.isArray(e.material) ? e.material.slice() : e.material),
(this.geometry = e.geometry),
this
)
}
updateMorphTargets() {
const t = this.geometry.morphAttributes,
i = Object.keys(t)
if (i.length > 0) {
const r = t[i[0]]
if (r !== void 0) {
;((this.morphTargetInfluences = []), (this.morphTargetDictionary = {}))
for (let s = 0, o = r.length; s < o; s++) {
const a = r[s].name || String(s)
;(this.morphTargetInfluences.push(0), (this.morphTargetDictionary[a] = s))
}
}
}
}
getVertexPosition(e, t) {
const i = this.geometry,
r = i.attributes.position,
s = i.morphAttributes.position,
o = i.morphTargetsRelative
t.fromBufferAttribute(r, e)
const a = this.morphTargetInfluences
if (s && a) {
Lf.set(0, 0, 0)
for (let l = 0, c = s.length; l < c; l++) {
const u = a[l],
d = s[l]
u !== 0 &&
(Rg.fromBufferAttribute(d, e),
o ? Lf.addScaledVector(Rg, u) : Lf.addScaledVector(Rg.sub(t), u))
}
t.add(Lf)
}
return t
}
raycast(e, t) {
const i = this.geometry,
r = this.material,
s = this.matrixWorld
r !== void 0 &&
(i.boundingSphere === null && i.computeBoundingSphere(),
Rf.copy(i.boundingSphere),
Rf.applyMatrix4(s),
nl.copy(e.ray).recast(e.near),
!(
Rf.containsPoint(nl.origin) === !1 &&
(nl.intersectSphere(Rf, kS) === null ||
nl.origin.distanceToSquared(kS) > (e.far - e.near) ** 2)
) &&
(US.copy(s).invert(),
nl.copy(e.ray).applyMatrix4(US),
!(i.boundingBox !== null && nl.intersectsBox(i.boundingBox) === !1) &&
this._computeIntersections(e, t, nl)))
}
_computeIntersections(e, t, i) {
let r
const s = this.geometry,
o = this.material,
a = s.index,
l = s.attributes.position,
c = s.attributes.uv,
u = s.attributes.uv1,
d = s.attributes.normal,
h = s.groups,
f = s.drawRange
if (a !== null)
if (Array.isArray(o))
for (let p = 0, g = h.length; p < g; p++) {
const y = h[p],
m = o[y.materialIndex],
v = Math.max(y.start, f.start),
x = Math.min(a.count, Math.min(y.start + y.count, f.start + f.count))
for (let _ = v, S = x; _ < S; _ += 3) {
const C = a.getX(_),
A = a.getX(_ + 1),
R = a.getX(_ + 2)
;((r = Ff(this, m, e, i, c, u, d, C, A, R)),
r &&
((r.faceIndex = Math.floor(_ / 3)),
(r.face.materialIndex = y.materialIndex),
t.push(r)))
}
}
else {
const p = Math.max(0, f.start),
g = Math.min(a.count, f.start + f.count)
for (let y = p, m = g; y < m; y += 3) {
const v = a.getX(y),
x = a.getX(y + 1),
_ = a.getX(y + 2)
;((r = Ff(this, o, e, i, c, u, d, v, x, _)),
r && ((r.faceIndex = Math.floor(y / 3)), t.push(r)))
}
}
else if (l !== void 0)
if (Array.isArray(o))
for (let p = 0, g = h.length; p < g; p++) {
const y = h[p],
m = o[y.materialIndex],
v = Math.max(y.start, f.start),
x = Math.min(l.count, Math.min(y.start + y.count, f.start + f.count))
for (let _ = v, S = x; _ < S; _ += 3) {
const C = _,
A = _ + 1,
R = _ + 2
;((r = Ff(this, m, e, i, c, u, d, C, A, R)),
r &&
((r.faceIndex = Math.floor(_ / 3)),
(r.face.materialIndex = y.materialIndex),
t.push(r)))
}
}
else {
const p = Math.max(0, f.start),
g = Math.min(l.count, f.start + f.count)
for (let y = p, m = g; y < m; y += 3) {
const v = y,
x = y + 1,
_ = y + 2
;((r = Ff(this, o, e, i, c, u, d, v, x, _)),
r && ((r.faceIndex = Math.floor(y / 3)), t.push(r)))
}
}
}
}
function ZP(n, e, t, i, r, s, o, a) {
let l
if (
(e.side === Fi
? (l = i.intersectTriangle(o, s, r, !0, a))
: (l = i.intersectTriangle(r, s, o, e.side === bs, a)),
l === null)
)
return null
;(Df.copy(a), Df.applyMatrix4(n.matrixWorld))
const c = t.ray.origin.distanceTo(Df)
return c < t.near || c > t.far ? null : { distance: c, point: Df.clone(), object: n }
}
function Ff(n, e, t, i, r, s, o, a, l, c) {
;(n.getVertexPosition(a, If), n.getVertexPosition(l, Nf), n.getVertexPosition(c, Pf))
const u = ZP(n, e, t, i, If, Nf, Pf, zS)
if (u) {
const d = new Y()
;(ps.getBarycoord(zS, If, Nf, Pf, d),
r && (u.uv = ps.getInterpolatedAttribute(r, a, l, c, d, new qe())),
s && (u.uv1 = ps.getInterpolatedAttribute(s, a, l, c, d, new qe())),
o &&
((u.normal = ps.getInterpolatedAttribute(o, a, l, c, d, new Y())),
u.normal.dot(i.direction) > 0 && u.normal.multiplyScalar(-1)))
const h = { a, b: l, c, normal: new Y(), materialIndex: 0 }
;(ps.getNormal(If, Nf, Pf, h.normal), (u.face = h), (u.barycoord = d))
}
return u
}
class Lu extends Ui {
constructor(e = 1, t = 1, i = 1, r = 1, s = 1, o = 1) {
;(super(),
(this.type = 'BoxGeometry'),
(this.parameters = {
width: e,
height: t,
depth: i,
widthSegments: r,
heightSegments: s,
depthSegments: o,
}))
const a = this
;((r = Math.floor(r)), (s = Math.floor(s)), (o = Math.floor(o)))
const l = [],
c = [],
u = [],
d = []
let h = 0,
f = 0
;(p('z', 'y', 'x', -1, -1, i, t, e, o, s, 0),
p('z', 'y', 'x', 1, -1, i, t, -e, o, s, 1),
p('x', 'z', 'y', 1, 1, e, i, t, r, o, 2),
p('x', 'z', 'y', 1, -1, e, i, -t, r, o, 3),
p('x', 'y', 'z', 1, -1, e, t, i, r, s, 4),
p('x', 'y', 'z', -1, -1, e, t, -i, r, s, 5),
this.setIndex(l),
this.setAttribute('position', new Si(c, 3)),
this.setAttribute('normal', new Si(u, 3)),
this.setAttribute('uv', new Si(d, 2)))
function p(g, y, m, v, x, _, S, C, A, R, w) {
const M = _ / A,
I = S / R,
L = _ / 2,
U = S / 2,
T = C / 2,
F = A + 1,
V = R + 1
let Q = 0,
ee = 0
const se = new Y()
for (let he = 0; he < V; he++) {
const ie = he * I - U
for (let re = 0; re < F; re++) {
const Te = re * M - L
;((se[g] = Te * v),
(se[y] = ie * x),
(se[m] = T),
c.push(se.x, se.y, se.z),
(se[g] = 0),
(se[y] = 0),
(se[m] = C > 0 ? 1 : -1),
u.push(se.x, se.y, se.z),
d.push(re / A),
d.push(1 - he / R),
(Q += 1))
}
}
for (let he = 0; he < R; he++)
for (let ie = 0; ie < A; ie++) {
const re = h + ie + F * he,
Te = h + ie + F * (he + 1),
le = h + (ie + 1) + F * (he + 1),
fe = h + (ie + 1) + F * he
;(l.push(re, Te, fe), l.push(Te, le, fe), (ee += 6))
}
;(a.addGroup(f, ee, w), (f += ee), (h += Q))
}
}
copy(e) {
return (super.copy(e), (this.parameters = Object.assign({}, e.parameters)), this)
}
static fromJSON(e) {
return new Lu(e.width, e.height, e.depth, e.widthSegments, e.heightSegments, e.depthSegments)
}
}
function pu(n) {
const e = {}
for (const t in n) {
e[t] = {}
for (const i in n[t]) {
const r = n[t][i]
r &&
(r.isColor ||
r.isMatrix3 ||
r.isMatrix4 ||
r.isVector2 ||
r.isVector3 ||
r.isVector4 ||
r.isTexture ||
r.isQuaternion)
? r.isRenderTargetTexture
? (console.warn(
'UniformsUtils: Textures of render targets cannot be cloned via cloneUniforms() or mergeUniforms().'
),
(e[t][i] = null))
: (e[t][i] = r.clone())
: Array.isArray(r)
? (e[t][i] = r.slice())
: (e[t][i] = r)
}
}
return e
}
function Gi(n) {
const e = {}
for (let t = 0; t < n.length; t++) {
const i = pu(n[t])
for (const r in i) e[r] = i[r]
}
return e
}
function JP(n) {
const e = []
for (let t = 0; t < n.length; t++) e.push(n[t].clone())
return e
}
function O5(n) {
const e = n.getRenderTarget()
return e === null
? n.outputColorSpace
: e.isXRRenderTarget === !0
? e.texture.colorSpace
: wt.workingColorSpace
}
const eL = { clone: pu, merge: Gi }
var tL =
'void main() {\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}',
nL = 'void main() {\n gl_FragColor = vec4( 1.0, 0.0, 0.0, 1.0 );\n}'
class Pr extends es {
constructor(e) {
;(super(),
(this.isShaderMaterial = !0),
(this.type = 'ShaderMaterial'),
(this.defines = {}),
(this.uniforms = {}),
(this.uniformsGroups = []),
(this.vertexShader = tL),
(this.fragmentShader = nL),
(this.linewidth = 1),
(this.wireframe = !1),
(this.wireframeLinewidth = 1),
(this.fog = !1),
(this.lights = !1),
(this.clipping = !1),
(this.forceSinglePass = !0),
(this.extensions = { clipCullDistance: !1, multiDraw: !1 }),
(this.defaultAttributeValues = { color: [1, 1, 1], uv: [0, 0], uv1: [0, 0] }),
(this.index0AttributeName = void 0),
(this.uniformsNeedUpdate = !1),
(this.glslVersion = null),
e !== void 0 && this.setValues(e))
}
copy(e) {
return (
super.copy(e),
(this.fragmentShader = e.fragmentShader),
(this.vertexShader = e.vertexShader),
(this.uniforms = pu(e.uniforms)),
(this.uniformsGroups = JP(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
)
}
toJSON(e) {
const t = super.toJSON(e)
;((t.glslVersion = this.glslVersion), (t.uniforms = {}))
for (const r in this.uniforms) {
const o = this.uniforms[r].value
o && o.isTexture
? (t.uniforms[r] = { type: 't', value: o.toJSON(e).uuid })
: o && o.isColor
? (t.uniforms[r] = { type: 'c', value: o.getHex() })
: o && o.isVector2
? (t.uniforms[r] = { type: 'v2', value: o.toArray() })
: o && o.isVector3
? (t.uniforms[r] = { type: 'v3', value: o.toArray() })
: o && o.isVector4
? (t.uniforms[r] = { type: 'v4', value: o.toArray() })
: o && o.isMatrix3
? (t.uniforms[r] = { type: 'm3', value: o.toArray() })
: o && o.isMatrix4
? (t.uniforms[r] = { type: 'm4', value: o.toArray() })
: (t.uniforms[r] = { value: o })
}
;(Object.keys(this.defines).length > 0 && (t.defines = this.defines),
(t.vertexShader = this.vertexShader),
(t.fragmentShader = this.fragmentShader),
(t.lights = this.lights),
(t.clipping = this.clipping))
const i = {}
for (const r in this.extensions) this.extensions[r] === !0 && (i[r] = !0)
return (Object.keys(i).length > 0 && (t.extensions = i), t)
}
}
class B5 extends rn {
constructor() {
;(super(),
(this.isCamera = !0),
(this.type = 'Camera'),
(this.matrixWorldInverse = new Xe()),
(this.projectionMatrix = new Xe()),
(this.projectionMatrixInverse = new Xe()),
(this.coordinateSystem = Nr))
}
copy(e, t) {
return (
super.copy(e, t),
this.matrixWorldInverse.copy(e.matrixWorldInverse),
this.projectionMatrix.copy(e.projectionMatrix),
this.projectionMatrixInverse.copy(e.projectionMatrixInverse),
(this.coordinateSystem = e.coordinateSystem),
this
)
}
getWorldDirection(e) {
return super.getWorldDirection(e).negate()
}
updateMatrixWorld(e) {
;(super.updateMatrixWorld(e), this.matrixWorldInverse.copy(this.matrixWorld).invert())
}
updateWorldMatrix(e, t) {
;(super.updateWorldMatrix(e, t), this.matrixWorldInverse.copy(this.matrixWorld).invert())
}
clone() {
return new this.constructor().copy(this)
}
}
const da = new Y(),
VS = new qe(),
HS = new qe()
class Ki extends B5 {
constructor(e = 50, t = 1, i = 0.1, r = 2e3) {
;(super(),
(this.isPerspectiveCamera = !0),
(this.type = 'PerspectiveCamera'),
(this.fov = e),
(this.zoom = 1),
(this.near = i),
(this.far = r),
(this.focus = 10),
(this.aspect = t),
(this.view = null),
(this.filmGauge = 35),
(this.filmOffset = 0),
this.updateProjectionMatrix())
}
copy(e, t) {
return (
super.copy(e, t),
(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 = e.view === null ? null : Object.assign({}, e.view)),
(this.filmGauge = e.filmGauge),
(this.filmOffset = e.filmOffset),
this
)
}
setFocalLength(e) {
const t = (0.5 * this.getFilmHeight()) / e
;((this.fov = fu * 2 * Math.atan(t)), this.updateProjectionMatrix())
}
getFocalLength() {
const e = Math.tan(Bd * 0.5 * this.fov)
return (0.5 * this.getFilmHeight()) / e
}
getEffectiveFOV() {
return fu * 2 * Math.atan(Math.tan(Bd * 0.5 * this.fov) / this.zoom)
}
getFilmWidth() {
return this.filmGauge * Math.min(this.aspect, 1)
}
getFilmHeight() {
return this.filmGauge / Math.max(this.aspect, 1)
}
getViewBounds(e, t, i) {
;(da.set(-1, -1, 0.5).applyMatrix4(this.projectionMatrixInverse),
t.set(da.x, da.y).multiplyScalar(-e / da.z),
da.set(1, 1, 0.5).applyMatrix4(this.projectionMatrixInverse),
i.set(da.x, da.y).multiplyScalar(-e / da.z))
}
getViewSize(e, t) {
return (this.getViewBounds(e, VS, HS), t.subVectors(HS, VS))
}
setViewOffset(e, t, i, r, s, o) {
;((this.aspect = e / t),
this.view === null &&
(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 = i),
(this.view.offsetY = r),
(this.view.width = s),
(this.view.height = o),
this.updateProjectionMatrix())
}
clearViewOffset() {
;(this.view !== null && (this.view.enabled = !1), this.updateProjectionMatrix())
}
updateProjectionMatrix() {
const e = this.near
let t = (e * Math.tan(Bd * 0.5 * this.fov)) / this.zoom,
i = 2 * t,
r = this.aspect * i,
s = -0.5 * r
const o = this.view
if (this.view !== null && this.view.enabled) {
const l = o.fullWidth,
c = o.fullHeight
;((s += (o.offsetX * r) / l),
(t -= (o.offsetY * i) / c),
(r *= o.width / l),
(i *= o.height / c))
}
const a = this.filmOffset
;(a !== 0 && (s += (e * a) / this.getFilmWidth()),
this.projectionMatrix.makePerspective(s, s + r, t, t - i, e, this.far, this.coordinateSystem),
this.projectionMatrixInverse.copy(this.projectionMatrix).invert())
}
toJSON(e) {
const t = super.toJSON(e)
return (
(t.object.fov = this.fov),
(t.object.zoom = this.zoom),
(t.object.near = this.near),
(t.object.far = this.far),
(t.object.focus = this.focus),
(t.object.aspect = this.aspect),
this.view !== null && (t.object.view = Object.assign({}, this.view)),
(t.object.filmGauge = this.filmGauge),
(t.object.filmOffset = this.filmOffset),
t
)
}
}
const pc = -90,
mc = 1
class iL extends rn {
constructor(e, t, i) {
;(super(),
(this.type = 'CubeCamera'),
(this.renderTarget = i),
(this.coordinateSystem = null),
(this.activeMipmapLevel = 0))
const r = new Ki(pc, mc, e, t)
;((r.layers = this.layers), this.add(r))
const s = new Ki(pc, mc, e, t)
;((s.layers = this.layers), this.add(s))
const o = new Ki(pc, mc, e, t)
;((o.layers = this.layers), this.add(o))
const a = new Ki(pc, mc, e, t)
;((a.layers = this.layers), this.add(a))
const l = new Ki(pc, mc, e, t)
;((l.layers = this.layers), this.add(l))
const c = new Ki(pc, mc, e, t)
;((c.layers = this.layers), this.add(c))
}
updateCoordinateSystem() {
const e = this.coordinateSystem,
t = this.children.concat(),
[i, r, s, o, a, l] = t
for (const c of t) this.remove(c)
if (e === Nr)
(i.up.set(0, 1, 0),
i.lookAt(1, 0, 0),
r.up.set(0, 1, 0),
r.lookAt(-1, 0, 0),
s.up.set(0, 0, -1),
s.lookAt(0, 1, 0),
o.up.set(0, 0, 1),
o.lookAt(0, -1, 0),
a.up.set(0, 1, 0),
a.lookAt(0, 0, 1),
l.up.set(0, 1, 0),
l.lookAt(0, 0, -1))
else if (e === qo)
(i.up.set(0, -1, 0),
i.lookAt(-1, 0, 0),
r.up.set(0, -1, 0),
r.lookAt(1, 0, 0),
s.up.set(0, 0, 1),
s.lookAt(0, 1, 0),
o.up.set(0, 0, -1),
o.lookAt(0, -1, 0),
a.up.set(0, -1, 0),
a.lookAt(0, 0, 1),
l.up.set(0, -1, 0),
l.lookAt(0, 0, -1))
else
throw new Error('THREE.CubeCamera.updateCoordinateSystem(): Invalid coordinate system: ' + e)
for (const c of t) (this.add(c), c.updateMatrixWorld())
}
update(e, t) {
this.parent === null && this.updateMatrixWorld()
const { renderTarget: i, activeMipmapLevel: r } = this
this.coordinateSystem !== e.coordinateSystem &&
((this.coordinateSystem = e.coordinateSystem), this.updateCoordinateSystem())
const [s, o, a, l, c, u] = this.children,
d = e.getRenderTarget(),
h = e.getActiveCubeFace(),
f = e.getActiveMipmapLevel(),
p = e.xr.enabled
e.xr.enabled = !1
const g = i.texture.generateMipmaps
;((i.texture.generateMipmaps = !1),
e.setRenderTarget(i, 0, r),
e.render(t, s),
e.setRenderTarget(i, 1, r),
e.render(t, o),
e.setRenderTarget(i, 2, r),
e.render(t, a),
e.setRenderTarget(i, 3, r),
e.render(t, l),
e.setRenderTarget(i, 4, r),
e.render(t, c),
(i.texture.generateMipmaps = g),
e.setRenderTarget(i, 5, r),
e.render(t, u),
e.setRenderTarget(d, h, f),
(e.xr.enabled = p),
(i.texture.needsPMREMUpdate = !0))
}
}
class U5 extends Wn {
constructor(e, t, i, r, s, o, a, l, c, u) {
;((e = e !== void 0 ? e : []),
(t = t !== void 0 ? t : Ul),
super(e, t, i, r, s, o, a, l, c, u),
(this.isCubeTexture = !0),
(this.flipY = !1))
}
get images() {
return this.image
}
set images(e) {
this.image = e
}
}
class rL extends Ua {
constructor(e = 1, t = {}) {
;(super(e, e, t), (this.isWebGLCubeRenderTarget = !0))
const i = { width: e, height: e, depth: 1 },
r = [i, i, i, i, i, i]
;((this.texture = new U5(
r,
t.mapping,
t.wrapS,
t.wrapT,
t.magFilter,
t.minFilter,
t.format,
t.type,
t.anisotropy,
t.colorSpace
)),
(this.texture.isRenderTargetTexture = !0),
(this.texture.generateMipmaps = t.generateMipmaps !== void 0 ? t.generateMipmaps : !1),
(this.texture.minFilter = t.minFilter !== void 0 ? t.minFilter : Ir))
}
fromEquirectangularTexture(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))
const i = {
uniforms: { tEquirect: { value: null } },
vertexShader:
'\n\n varying vec3 vWorldDirection;\n\n vec3 transformDirection( in vec3 dir, in mat4 matrix ) {\n\n return normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );\n\n }\n\n void main() {\n\n vWorldDirection = transformDirection( position, modelMatrix );\n\n #include \n #include \n\n }\n ',
fragmentShader:
'\n\n uniform sampler2D tEquirect;\n\n varying vec3 vWorldDirection;\n\n #include \n\n void main() {\n\n vec3 direction = normalize( vWorldDirection );\n\n vec2 sampleUV = equirectUv( direction );\n\n gl_FragColor = texture2D( tEquirect, sampleUV );\n\n }\n ',
},
r = new Lu(5, 5, 5),
s = new Pr({
name: 'CubemapFromEquirect',
uniforms: pu(i.uniforms),
vertexShader: i.vertexShader,
fragmentShader: i.fragmentShader,
side: Fi,
blending: La,
})
s.uniforms.tEquirect.value = t
const o = new pn(r, s),
a = t.minFilter
return (
t.minFilter === $s && (t.minFilter = Ir),
new iL(1, 10, this).update(e, o),
(t.minFilter = a),
o.geometry.dispose(),
o.material.dispose(),
this
)
}
clear(e, t, i, r) {
const s = e.getRenderTarget()
for (let o = 0; o < 6; o++) (e.setRenderTarget(this, o), e.clear(t, i, r))
e.setRenderTarget(s)
}
}
class bl extends rn {
constructor() {
;(super(), (this.isGroup = !0), (this.type = 'Group'))
}
}
const sL = { type: 'move' }
class Ig {
constructor() {
;((this._targetRay = null), (this._grip = null), (this._hand = null))
}
getHandSpace() {
return (
this._hand === null &&
((this._hand = new bl()),
(this._hand.matrixAutoUpdate = !1),
(this._hand.visible = !1),
(this._hand.joints = {}),
(this._hand.inputState = { pinching: !1 })),
this._hand
)
}
getTargetRaySpace() {
return (
this._targetRay === null &&
((this._targetRay = new bl()),
(this._targetRay.matrixAutoUpdate = !1),
(this._targetRay.visible = !1),
(this._targetRay.hasLinearVelocity = !1),
(this._targetRay.linearVelocity = new Y()),
(this._targetRay.hasAngularVelocity = !1),
(this._targetRay.angularVelocity = new Y())),
this._targetRay
)
}
getGripSpace() {
return (
this._grip === null &&
((this._grip = new bl()),
(this._grip.matrixAutoUpdate = !1),
(this._grip.visible = !1),
(this._grip.hasLinearVelocity = !1),
(this._grip.linearVelocity = new Y()),
(this._grip.hasAngularVelocity = !1),
(this._grip.angularVelocity = new Y())),
this._grip
)
}
dispatchEvent(e) {
return (
this._targetRay !== null && this._targetRay.dispatchEvent(e),
this._grip !== null && this._grip.dispatchEvent(e),
this._hand !== null && this._hand.dispatchEvent(e),
this
)
}
connect(e) {
if (e && e.hand) {
const t = this._hand
if (t) for (const i of e.hand.values()) this._getHandJoint(t, i)
}
return (this.dispatchEvent({ type: 'connected', data: e }), this)
}
disconnect(e) {
return (
this.dispatchEvent({ type: 'disconnected', data: e }),
this._targetRay !== null && (this._targetRay.visible = !1),
this._grip !== null && (this._grip.visible = !1),
this._hand !== null && (this._hand.visible = !1),
this
)
}
update(e, t, i) {
let r = null,
s = null,
o = null
const a = this._targetRay,
l = this._grip,
c = this._hand
if (e && t.session.visibilityState !== 'visible-blurred') {
if (c && e.hand) {
o = !0
for (const g of e.hand.values()) {
const y = t.getJointPose(g, i),
m = this._getHandJoint(c, g)
;(y !== null &&
(m.matrix.fromArray(y.transform.matrix),
m.matrix.decompose(m.position, m.rotation, m.scale),
(m.matrixWorldNeedsUpdate = !0),
(m.jointRadius = y.radius)),
(m.visible = y !== null))
}
const u = c.joints['index-finger-tip'],
d = c.joints['thumb-tip'],
h = u.position.distanceTo(d.position),
f = 0.02,
p = 0.005
c.inputState.pinching && h > f + p
? ((c.inputState.pinching = !1),
this.dispatchEvent({ type: 'pinchend', handedness: e.handedness, target: this }))
: !c.inputState.pinching &&
h <= f - p &&
((c.inputState.pinching = !0),
this.dispatchEvent({ type: 'pinchstart', handedness: e.handedness, target: this }))
} else
l !== null &&
e.gripSpace &&
((s = t.getPose(e.gripSpace, i)),
s !== null &&
(l.matrix.fromArray(s.transform.matrix),
l.matrix.decompose(l.position, l.rotation, l.scale),
(l.matrixWorldNeedsUpdate = !0),
s.linearVelocity
? ((l.hasLinearVelocity = !0), l.linearVelocity.copy(s.linearVelocity))
: (l.hasLinearVelocity = !1),
s.angularVelocity
? ((l.hasAngularVelocity = !0), l.angularVelocity.copy(s.angularVelocity))
: (l.hasAngularVelocity = !1)))
a !== null &&
((r = t.getPose(e.targetRaySpace, i)),
r === null && s !== null && (r = s),
r !== null &&
(a.matrix.fromArray(r.transform.matrix),
a.matrix.decompose(a.position, a.rotation, a.scale),
(a.matrixWorldNeedsUpdate = !0),
r.linearVelocity
? ((a.hasLinearVelocity = !0), a.linearVelocity.copy(r.linearVelocity))
: (a.hasLinearVelocity = !1),
r.angularVelocity
? ((a.hasAngularVelocity = !0), a.angularVelocity.copy(r.angularVelocity))
: (a.hasAngularVelocity = !1),
this.dispatchEvent(sL)))
}
return (
a !== null && (a.visible = r !== null),
l !== null && (l.visible = s !== null),
c !== null && (c.visible = o !== null),
this
)
}
_getHandJoint(e, t) {
if (e.joints[t.jointName] === void 0) {
const i = new bl()
;((i.matrixAutoUpdate = !1), (i.visible = !1), (e.joints[t.jointName] = i), e.add(i))
}
return e.joints[t.jointName]
}
}
class oL extends rn {
constructor() {
;(super(),
(this.isScene = !0),
(this.type = 'Scene'),
(this.background = null),
(this.environment = null),
(this.fog = null),
(this.backgroundBlurriness = 0),
(this.backgroundIntensity = 1),
(this.backgroundRotation = new ws()),
(this.environmentIntensity = 1),
(this.environmentRotation = new ws()),
(this.overrideMaterial = null),
typeof __THREE_DEVTOOLS__ < 'u' &&
__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent('observe', { detail: this })))
}
copy(e, t) {
return (
super.copy(e, t),
e.background !== null && (this.background = e.background.clone()),
e.environment !== null && (this.environment = e.environment.clone()),
e.fog !== null && (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),
e.overrideMaterial !== null && (this.overrideMaterial = e.overrideMaterial.clone()),
(this.matrixAutoUpdate = e.matrixAutoUpdate),
this
)
}
toJSON(e) {
const t = super.toJSON(e)
return (
this.fog !== null && (t.object.fog = this.fog.toJSON()),
this.backgroundBlurriness > 0 && (t.object.backgroundBlurriness = this.backgroundBlurriness),
this.backgroundIntensity !== 1 && (t.object.backgroundIntensity = this.backgroundIntensity),
(t.object.backgroundRotation = this.backgroundRotation.toArray()),
this.environmentIntensity !== 1 &&
(t.object.environmentIntensity = this.environmentIntensity),
(t.object.environmentRotation = this.environmentRotation.toArray()),
t
)
}
}
class T_ {
constructor(e, t) {
;((this.isInterleavedBuffer = !0),
(this.array = e),
(this.stride = t),
(this.count = e !== void 0 ? e.length / t : 0),
(this.usage = pm),
(this.updateRanges = []),
(this.version = 0),
(this.uuid = xs()))
}
onUploadCallback() {}
set needsUpdate(e) {
e === !0 && this.version++
}
setUsage(e) {
return ((this.usage = e), this)
}
addUpdateRange(e, t) {
this.updateRanges.push({ start: e, count: t })
}
clearUpdateRanges() {
this.updateRanges.length = 0
}
copy(e) {
return (
(this.array = new e.array.constructor(e.array)),
(this.count = e.count),
(this.stride = e.stride),
(this.usage = e.usage),
this
)
}
copyAt(e, t, i) {
;((e *= this.stride), (i *= t.stride))
for (let r = 0, s = this.stride; r < s; r++) this.array[e + r] = t.array[i + r]
return this
}
set(e, t = 0) {
return (this.array.set(e, t), this)
}
clone(e) {
;(e.arrayBuffers === void 0 && (e.arrayBuffers = {}),
this.array.buffer._uuid === void 0 && (this.array.buffer._uuid = xs()),
e.arrayBuffers[this.array.buffer._uuid] === void 0 &&
(e.arrayBuffers[this.array.buffer._uuid] = this.array.slice(0).buffer))
const t = new this.array.constructor(e.arrayBuffers[this.array.buffer._uuid]),
i = new this.constructor(t, this.stride)
return (i.setUsage(this.usage), i)
}
onUpload(e) {
return ((this.onUploadCallback = e), this)
}
toJSON(e) {
return (
e.arrayBuffers === void 0 && (e.arrayBuffers = {}),
this.array.buffer._uuid === void 0 && (this.array.buffer._uuid = xs()),
e.arrayBuffers[this.array.buffer._uuid] === void 0 &&
(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,
}
)
}
}
const Hi = new Y()
class o0 {
constructor(e, t, i, r = !1) {
;((this.isInterleavedBufferAttribute = !0),
(this.name = ''),
(this.data = e),
(this.itemSize = t),
(this.offset = i),
(this.normalized = r))
}
get count() {
return this.data.count
}
get array() {
return this.data.array
}
set needsUpdate(e) {
this.data.needsUpdate = e
}
applyMatrix4(e) {
for (let t = 0, i = this.data.count; t < i; t++)
(Hi.fromBufferAttribute(this, t), Hi.applyMatrix4(e), this.setXYZ(t, Hi.x, Hi.y, Hi.z))
return this
}
applyNormalMatrix(e) {
for (let t = 0, i = this.count; t < i; t++)
(Hi.fromBufferAttribute(this, t), Hi.applyNormalMatrix(e), this.setXYZ(t, Hi.x, Hi.y, Hi.z))
return this
}
transformDirection(e) {
for (let t = 0, i = this.count; t < i; t++)
(Hi.fromBufferAttribute(this, t), Hi.transformDirection(e), this.setXYZ(t, Hi.x, Hi.y, Hi.z))
return this
}
getComponent(e, t) {
let i = this.array[e * this.data.stride + this.offset + t]
return (this.normalized && (i = fs(i, this.array)), i)
}
setComponent(e, t, i) {
return (
this.normalized && (i = ln(i, this.array)),
(this.data.array[e * this.data.stride + this.offset + t] = i),
this
)
}
setX(e, t) {
return (
this.normalized && (t = ln(t, this.array)),
(this.data.array[e * this.data.stride + this.offset] = t),
this
)
}
setY(e, t) {
return (
this.normalized && (t = ln(t, this.array)),
(this.data.array[e * this.data.stride + this.offset + 1] = t),
this
)
}
setZ(e, t) {
return (
this.normalized && (t = ln(t, this.array)),
(this.data.array[e * this.data.stride + this.offset + 2] = t),
this
)
}
setW(e, t) {
return (
this.normalized && (t = ln(t, this.array)),
(this.data.array[e * this.data.stride + this.offset + 3] = t),
this
)
}
getX(e) {
let t = this.data.array[e * this.data.stride + this.offset]
return (this.normalized && (t = fs(t, this.array)), t)
}
getY(e) {
let t = this.data.array[e * this.data.stride + this.offset + 1]
return (this.normalized && (t = fs(t, this.array)), t)
}
getZ(e) {
let t = this.data.array[e * this.data.stride + this.offset + 2]
return (this.normalized && (t = fs(t, this.array)), t)
}
getW(e) {
let t = this.data.array[e * this.data.stride + this.offset + 3]
return (this.normalized && (t = fs(t, this.array)), t)
}
setXY(e, t, i) {
return (
(e = e * this.data.stride + this.offset),
this.normalized && ((t = ln(t, this.array)), (i = ln(i, this.array))),
(this.data.array[e + 0] = t),
(this.data.array[e + 1] = i),
this
)
}
setXYZ(e, t, i, r) {
return (
(e = e * this.data.stride + this.offset),
this.normalized &&
((t = ln(t, this.array)), (i = ln(i, this.array)), (r = ln(r, this.array))),
(this.data.array[e + 0] = t),
(this.data.array[e + 1] = i),
(this.data.array[e + 2] = r),
this
)
}
setXYZW(e, t, i, r, s) {
return (
(e = e * this.data.stride + this.offset),
this.normalized &&
((t = ln(t, this.array)),
(i = ln(i, this.array)),
(r = ln(r, this.array)),
(s = ln(s, this.array))),
(this.data.array[e + 0] = t),
(this.data.array[e + 1] = i),
(this.data.array[e + 2] = r),
(this.data.array[e + 3] = s),
this
)
}
clone(e) {
if (e === void 0) {
console.log(
'THREE.InterleavedBufferAttribute.clone(): Cloning an interleaved buffer attribute will de-interleave buffer data.'
)
const t = []
for (let i = 0; i < this.count; i++) {
const r = i * this.data.stride + this.offset
for (let s = 0; s < this.itemSize; s++) t.push(this.data.array[r + s])
}
return new xi(new this.array.constructor(t), this.itemSize, this.normalized)
} else
return (
e.interleavedBuffers === void 0 && (e.interleavedBuffers = {}),
e.interleavedBuffers[this.data.uuid] === void 0 &&
(e.interleavedBuffers[this.data.uuid] = this.data.clone(e)),
new o0(e.interleavedBuffers[this.data.uuid], this.itemSize, this.offset, this.normalized)
)
}
toJSON(e) {
if (e === void 0) {
console.log(
'THREE.InterleavedBufferAttribute.toJSON(): Serializing an interleaved buffer attribute will de-interleave buffer data.'
)
const t = []
for (let i = 0; i < this.count; i++) {
const r = i * this.data.stride + this.offset
for (let s = 0; s < this.itemSize; s++) t.push(this.data.array[r + s])
}
return {
itemSize: this.itemSize,
type: this.array.constructor.name,
array: t,
normalized: this.normalized,
}
} else
return (
e.interleavedBuffers === void 0 && (e.interleavedBuffers = {}),
e.interleavedBuffers[this.data.uuid] === void 0 &&
(e.interleavedBuffers[this.data.uuid] = this.data.toJSON(e)),
{
isInterleavedBufferAttribute: !0,
itemSize: this.itemSize,
data: this.data.uuid,
offset: this.offset,
normalized: this.normalized,
}
)
}
}
const $S = new Y(),
GS = new Mt(),
WS = new Mt(),
aL = new Y(),
QS = new Xe(),
Of = new Y(),
Ng = new oo(),
jS = new Xe(),
Pg = new Uh()
class lL extends pn {
constructor(e, t) {
;(super(e, t),
(this.isSkinnedMesh = !0),
(this.type = 'SkinnedMesh'),
(this.bindMode = AS),
(this.bindMatrix = new Xe()),
(this.bindMatrixInverse = new Xe()),
(this.boundingBox = null),
(this.boundingSphere = null))
}
computeBoundingBox() {
const e = this.geometry
;(this.boundingBox === null && (this.boundingBox = new rr()), this.boundingBox.makeEmpty())
const t = e.getAttribute('position')
for (let i = 0; i < t.count; i++)
(this.getVertexPosition(i, Of), this.boundingBox.expandByPoint(Of))
}
computeBoundingSphere() {
const e = this.geometry
;(this.boundingSphere === null && (this.boundingSphere = new oo()),
this.boundingSphere.makeEmpty())
const t = e.getAttribute('position')
for (let i = 0; i < t.count; i++)
(this.getVertexPosition(i, Of), this.boundingSphere.expandByPoint(Of))
}
copy(e, t) {
return (
super.copy(e, t),
(this.bindMode = e.bindMode),
this.bindMatrix.copy(e.bindMatrix),
this.bindMatrixInverse.copy(e.bindMatrixInverse),
(this.skeleton = e.skeleton),
e.boundingBox !== null && (this.boundingBox = e.boundingBox.clone()),
e.boundingSphere !== null && (this.boundingSphere = e.boundingSphere.clone()),
this
)
}
raycast(e, t) {
const i = this.material,
r = this.matrixWorld
i !== void 0 &&
(this.boundingSphere === null && this.computeBoundingSphere(),
Ng.copy(this.boundingSphere),
Ng.applyMatrix4(r),
e.ray.intersectsSphere(Ng) !== !1 &&
(jS.copy(r).invert(),
Pg.copy(e.ray).applyMatrix4(jS),
!(this.boundingBox !== null && Pg.intersectsBox(this.boundingBox) === !1) &&
this._computeIntersections(e, t, Pg)))
}
getVertexPosition(e, t) {
return (super.getVertexPosition(e, t), this.applyBoneTransform(e, t), t)
}
bind(e, t) {
;((this.skeleton = e),
t === void 0 &&
(this.updateMatrixWorld(!0), this.skeleton.calculateInverses(), (t = this.matrixWorld)),
this.bindMatrix.copy(t),
this.bindMatrixInverse.copy(t).invert())
}
pose() {
this.skeleton.pose()
}
normalizeSkinWeights() {
const e = new Mt(),
t = this.geometry.attributes.skinWeight
for (let i = 0, r = t.count; i < r; i++) {
e.fromBufferAttribute(t, i)
const s = 1 / e.manhattanLength()
;(s !== 1 / 0 ? e.multiplyScalar(s) : e.set(1, 0, 0, 0), t.setXYZW(i, e.x, e.y, e.z, e.w))
}
}
updateMatrixWorld(e) {
;(super.updateMatrixWorld(e),
this.bindMode === AS
? this.bindMatrixInverse.copy(this.matrixWorld).invert()
: this.bindMode === tP
? this.bindMatrixInverse.copy(this.bindMatrix).invert()
: console.warn('THREE.SkinnedMesh: Unrecognized bindMode: ' + this.bindMode))
}
applyBoneTransform(e, t) {
const i = this.skeleton,
r = this.geometry
;(GS.fromBufferAttribute(r.attributes.skinIndex, e),
WS.fromBufferAttribute(r.attributes.skinWeight, e),
$S.copy(t).applyMatrix4(this.bindMatrix),
t.set(0, 0, 0))
for (let s = 0; s < 4; s++) {
const o = WS.getComponent(s)
if (o !== 0) {
const a = GS.getComponent(s)
;(QS.multiplyMatrices(i.bones[a].matrixWorld, i.boneInverses[a]),
t.addScaledVector(aL.copy($S).applyMatrix4(QS), o))
}
}
return t.applyMatrix4(this.bindMatrixInverse)
}
}
class fh extends rn {
constructor() {
;(super(), (this.isBone = !0), (this.type = 'Bone'))
}
}
class _r extends Wn {
constructor(e = null, t = 1, i = 1, r, s, o, a, l, c = _i, u = _i, d, h) {
;(super(null, o, a, l, c, u, r, s, d, h),
(this.isDataTexture = !0),
(this.image = { data: e, width: t, height: i }),
(this.generateMipmaps = !1),
(this.flipY = !1),
(this.unpackAlignment = 1))
}
}
const qS = new Xe(),
cL = new Xe()
class a0 {
constructor(e = [], t = []) {
;((this.uuid = xs()),
(this.bones = e.slice(0)),
(this.boneInverses = t),
(this.boneMatrices = null),
(this.boneTexture = null),
this.init())
}
init() {
const e = this.bones,
t = this.boneInverses
if (((this.boneMatrices = new Float32Array(e.length * 16)), t.length === 0))
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 (let i = 0, r = this.bones.length; i < r; i++) this.boneInverses.push(new Xe())
}
}
calculateInverses() {
this.boneInverses.length = 0
for (let e = 0, t = this.bones.length; e < t; e++) {
const i = new Xe()
;(this.bones[e] && i.copy(this.bones[e].matrixWorld).invert(), this.boneInverses.push(i))
}
}
pose() {
for (let e = 0, t = this.bones.length; e < t; e++) {
const i = this.bones[e]
i && i.matrixWorld.copy(this.boneInverses[e]).invert()
}
for (let e = 0, t = this.bones.length; e < t; e++) {
const i = this.bones[e]
i &&
(i.parent && i.parent.isBone
? (i.matrix.copy(i.parent.matrixWorld).invert(), i.matrix.multiply(i.matrixWorld))
: i.matrix.copy(i.matrixWorld),
i.matrix.decompose(i.position, i.quaternion, i.scale))
}
}
update() {
const e = this.bones,
t = this.boneInverses,
i = this.boneMatrices,
r = this.boneTexture
for (let s = 0, o = e.length; s < o; s++) {
const a = e[s] ? e[s].matrixWorld : cL
;(qS.multiplyMatrices(a, t[s]), qS.toArray(i, s * 16))
}
r !== null && (r.needsUpdate = !0)
}
clone() {
return new a0(this.bones, this.boneInverses)
}
computeBoneTexture() {
let e = Math.sqrt(this.bones.length * 4)
;((e = Math.ceil(e / 4) * 4), (e = Math.max(e, 4)))
const t = new Float32Array(e * e * 4)
t.set(this.boneMatrices)
const i = new _r(t, e, e, Di, ir)
return ((i.needsUpdate = !0), (this.boneMatrices = t), (this.boneTexture = i), this)
}
getBoneByName(e) {
for (let t = 0, i = this.bones.length; t < i; t++) {
const r = this.bones[t]
if (r.name === e) return r
}
}
dispose() {
this.boneTexture !== null && (this.boneTexture.dispose(), (this.boneTexture = null))
}
fromJSON(e, t) {
this.uuid = e.uuid
for (let i = 0, r = e.bones.length; i < r; i++) {
const s = e.bones[i]
let o = t[s]
;(o === void 0 &&
(console.warn('THREE.Skeleton: No bone found with UUID:', s), (o = new fh())),
this.bones.push(o),
this.boneInverses.push(new Xe().fromArray(e.boneInverses[i])))
}
return (this.init(), this)
}
toJSON() {
const e = {
metadata: { version: 4.6, type: 'Skeleton', generator: 'Skeleton.toJSON' },
bones: [],
boneInverses: [],
}
e.uuid = this.uuid
const t = this.bones,
i = this.boneInverses
for (let r = 0, s = t.length; r < s; r++) {
const o = t[r]
e.bones.push(o.uuid)
const a = i[r]
e.boneInverses.push(a.toArray())
}
return e
}
}
class Xo extends xi {
constructor(e, t, i, r = 1) {
;(super(e, t, i), (this.isInstancedBufferAttribute = !0), (this.meshPerAttribute = r))
}
copy(e) {
return (super.copy(e), (this.meshPerAttribute = e.meshPerAttribute), this)
}
toJSON() {
const e = super.toJSON()
return ((e.meshPerAttribute = this.meshPerAttribute), (e.isInstancedBufferAttribute = !0), e)
}
}
const gc = new Xe(),
XS = new Xe(),
Bf = [],
KS = new rr(),
uL = new Xe(),
od = new pn(),
ad = new oo()
class dL extends pn {
constructor(e, t, i) {
;(super(e, t),
(this.isInstancedMesh = !0),
(this.instanceMatrix = new Xo(new Float32Array(i * 16), 16)),
(this.instanceColor = null),
(this.morphTexture = null),
(this.count = i),
(this.boundingBox = null),
(this.boundingSphere = null))
for (let r = 0; r < i; r++) this.setMatrixAt(r, uL)
}
computeBoundingBox() {
const e = this.geometry,
t = this.count
;(this.boundingBox === null && (this.boundingBox = new rr()),
e.boundingBox === null && e.computeBoundingBox(),
this.boundingBox.makeEmpty())
for (let i = 0; i < t; i++)
(this.getMatrixAt(i, gc), KS.copy(e.boundingBox).applyMatrix4(gc), this.boundingBox.union(KS))
}
computeBoundingSphere() {
const e = this.geometry,
t = this.count
;(this.boundingSphere === null && (this.boundingSphere = new oo()),
e.boundingSphere === null && e.computeBoundingSphere(),
this.boundingSphere.makeEmpty())
for (let i = 0; i < t; i++)
(this.getMatrixAt(i, gc),
ad.copy(e.boundingSphere).applyMatrix4(gc),
this.boundingSphere.union(ad))
}
copy(e, t) {
return (
super.copy(e, t),
this.instanceMatrix.copy(e.instanceMatrix),
e.morphTexture !== null && (this.morphTexture = e.morphTexture.clone()),
e.instanceColor !== null && (this.instanceColor = e.instanceColor.clone()),
(this.count = e.count),
e.boundingBox !== null && (this.boundingBox = e.boundingBox.clone()),
e.boundingSphere !== null && (this.boundingSphere = e.boundingSphere.clone()),
this
)
}
getColorAt(e, t) {
t.fromArray(this.instanceColor.array, e * 3)
}
getMatrixAt(e, t) {
t.fromArray(this.instanceMatrix.array, e * 16)
}
getMorphAt(e, t) {
const i = t.morphTargetInfluences,
r = this.morphTexture.source.data.data,
s = i.length + 1,
o = e * s + 1
for (let a = 0; a < i.length; a++) i[a] = r[o + a]
}
raycast(e, t) {
const i = this.matrixWorld,
r = this.count
if (
((od.geometry = this.geometry),
(od.material = this.material),
od.material !== void 0 &&
(this.boundingSphere === null && this.computeBoundingSphere(),
ad.copy(this.boundingSphere),
ad.applyMatrix4(i),
e.ray.intersectsSphere(ad) !== !1))
)
for (let s = 0; s < r; s++) {
;(this.getMatrixAt(s, gc),
XS.multiplyMatrices(i, gc),
(od.matrixWorld = XS),
od.raycast(e, Bf))
for (let o = 0, a = Bf.length; o < a; o++) {
const l = Bf[o]
;((l.instanceId = s), (l.object = this), t.push(l))
}
Bf.length = 0
}
}
setColorAt(e, t) {
;(this.instanceColor === null &&
(this.instanceColor = new Xo(new Float32Array(this.instanceMatrix.count * 3).fill(1), 3)),
t.toArray(this.instanceColor.array, e * 3))
}
setMatrixAt(e, t) {
t.toArray(this.instanceMatrix.array, e * 16)
}
setMorphAt(e, t) {
const i = t.morphTargetInfluences,
r = i.length + 1
this.morphTexture === null &&
(this.morphTexture = new _r(new Float32Array(r * this.count), r, this.count, __, ir))
const s = this.morphTexture.source.data.data
let o = 0
for (let c = 0; c < i.length; c++) o += i[c]
const a = this.geometry.morphTargetsRelative ? 1 : 1 - o,
l = r * e
;((s[l] = a), s.set(i, l + 1))
}
updateMorphTargets() {}
dispose() {
return (
this.dispatchEvent({ type: 'dispose' }),
this.morphTexture !== null && (this.morphTexture.dispose(), (this.morphTexture = null)),
this
)
}
}
const Lg = new Y(),
hL = new Y(),
fL = new mt()
class Eo {
constructor(e = new Y(1, 0, 0), t = 0) {
;((this.isPlane = !0), (this.normal = e), (this.constant = t))
}
set(e, t) {
return (this.normal.copy(e), (this.constant = t), this)
}
setComponents(e, t, i, r) {
return (this.normal.set(e, t, i), (this.constant = r), this)
}
setFromNormalAndCoplanarPoint(e, t) {
return (this.normal.copy(e), (this.constant = -t.dot(this.normal)), this)
}
setFromCoplanarPoints(e, t, i) {
const r = Lg.subVectors(i, t).cross(hL.subVectors(e, t)).normalize()
return (this.setFromNormalAndCoplanarPoint(r, e), this)
}
copy(e) {
return (this.normal.copy(e.normal), (this.constant = e.constant), this)
}
normalize() {
const e = 1 / this.normal.length()
return (this.normal.multiplyScalar(e), (this.constant *= e), this)
}
negate() {
return ((this.constant *= -1), this.normal.negate(), this)
}
distanceToPoint(e) {
return this.normal.dot(e) + this.constant
}
distanceToSphere(e) {
return this.distanceToPoint(e.center) - e.radius
}
projectPoint(e, t) {
return t.copy(e).addScaledVector(this.normal, -this.distanceToPoint(e))
}
intersectLine(e, t) {
const i = e.delta(Lg),
r = this.normal.dot(i)
if (r === 0) return this.distanceToPoint(e.start) === 0 ? t.copy(e.start) : null
const s = -(e.start.dot(this.normal) + this.constant) / r
return s < 0 || s > 1 ? null : t.copy(e.start).addScaledVector(i, s)
}
intersectsLine(e) {
const t = this.distanceToPoint(e.start),
i = this.distanceToPoint(e.end)
return (t < 0 && i > 0) || (i < 0 && t > 0)
}
intersectsBox(e) {
return e.intersectsPlane(this)
}
intersectsSphere(e) {
return e.intersectsPlane(this)
}
coplanarPoint(e) {
return e.copy(this.normal).multiplyScalar(-this.constant)
}
applyMatrix4(e, t) {
const i = t || fL.getNormalMatrix(e),
r = this.coplanarPoint(Lg).applyMatrix4(e),
s = this.normal.applyMatrix3(i).normalize()
return ((this.constant = -r.dot(s)), this)
}
translate(e) {
return ((this.constant -= e.dot(this.normal)), this)
}
equals(e) {
return e.normal.equals(this.normal) && e.constant === this.constant
}
clone() {
return new this.constructor().copy(this)
}
}
const il = new oo(),
Uf = new Y()
class w_ {
constructor(e = new Eo(), t = new Eo(), i = new Eo(), r = new Eo(), s = new Eo(), o = new Eo()) {
this.planes = [e, t, i, r, s, o]
}
set(e, t, i, r, s, o) {
const a = this.planes
return (
a[0].copy(e),
a[1].copy(t),
a[2].copy(i),
a[3].copy(r),
a[4].copy(s),
a[5].copy(o),
this
)
}
copy(e) {
const t = this.planes
for (let i = 0; i < 6; i++) t[i].copy(e.planes[i])
return this
}
setFromProjectionMatrix(e, t = Nr) {
const i = this.planes,
r = e.elements,
s = r[0],
o = r[1],
a = r[2],
l = r[3],
c = r[4],
u = r[5],
d = r[6],
h = r[7],
f = r[8],
p = r[9],
g = r[10],
y = r[11],
m = r[12],
v = r[13],
x = r[14],
_ = r[15]
if (
(i[0].setComponents(l - s, h - c, y - f, _ - m).normalize(),
i[1].setComponents(l + s, h + c, y + f, _ + m).normalize(),
i[2].setComponents(l + o, h + u, y + p, _ + v).normalize(),
i[3].setComponents(l - o, h - u, y - p, _ - v).normalize(),
i[4].setComponents(l - a, h - d, y - g, _ - x).normalize(),
t === Nr)
)
i[5].setComponents(l + a, h + d, y + g, _ + x).normalize()
else if (t === qo) i[5].setComponents(a, d, g, x).normalize()
else throw new Error('THREE.Frustum.setFromProjectionMatrix(): Invalid coordinate system: ' + t)
return this
}
intersectsObject(e) {
if (e.boundingSphere !== void 0)
(e.boundingSphere === null && e.computeBoundingSphere(),
il.copy(e.boundingSphere).applyMatrix4(e.matrixWorld))
else {
const t = e.geometry
;(t.boundingSphere === null && t.computeBoundingSphere(),
il.copy(t.boundingSphere).applyMatrix4(e.matrixWorld))
}
return this.intersectsSphere(il)
}
intersectsSprite(e) {
return (
il.center.set(0, 0, 0),
(il.radius = 0.7071067811865476),
il.applyMatrix4(e.matrixWorld),
this.intersectsSphere(il)
)
}
intersectsSphere(e) {
const t = this.planes,
i = e.center,
r = -e.radius
for (let s = 0; s < 6; s++) if (t[s].distanceToPoint(i) < r) return !1
return !0
}
intersectsBox(e) {
const t = this.planes
for (let i = 0; i < 6; i++) {
const r = t[i]
if (
((Uf.x = r.normal.x > 0 ? e.max.x : e.min.x),
(Uf.y = r.normal.y > 0 ? e.max.y : e.min.y),
(Uf.z = r.normal.z > 0 ? e.max.z : e.min.z),
r.distanceToPoint(Uf) < 0)
)
return !1
}
return !0
}
containsPoint(e) {
const t = this.planes
for (let i = 0; i < 6; i++) if (t[i].distanceToPoint(e) < 0) return !1
return !0
}
clone() {
return new this.constructor().copy(this)
}
}
class k5 extends es {
constructor(e) {
;(super(),
(this.isLineBasicMaterial = !0),
(this.type = 'LineBasicMaterial'),
(this.color = new gt(16777215)),
(this.map = null),
(this.linewidth = 1),
(this.linecap = 'round'),
(this.linejoin = 'round'),
(this.fog = !0),
this.setValues(e))
}
copy(e) {
return (
super.copy(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
)
}
}
const mm = new Y(),
gm = new Y(),
YS = new Xe(),
ld = new Uh(),
kf = new oo(),
Dg = new Y(),
ZS = new Y()
class C_ extends rn {
constructor(e = new Ui(), t = new k5()) {
;(super(),
(this.isLine = !0),
(this.type = 'Line'),
(this.geometry = e),
(this.material = t),
this.updateMorphTargets())
}
copy(e, t) {
return (
super.copy(e, t),
(this.material = Array.isArray(e.material) ? e.material.slice() : e.material),
(this.geometry = e.geometry),
this
)
}
computeLineDistances() {
const e = this.geometry
if (e.index === null) {
const t = e.attributes.position,
i = [0]
for (let r = 1, s = t.count; r < s; r++)
(mm.fromBufferAttribute(t, r - 1),
gm.fromBufferAttribute(t, r),
(i[r] = i[r - 1]),
(i[r] += mm.distanceTo(gm)))
e.setAttribute('lineDistance', new Si(i, 1))
} else
console.warn(
'THREE.Line.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.'
)
return this
}
raycast(e, t) {
const i = this.geometry,
r = this.matrixWorld,
s = e.params.Line.threshold,
o = i.drawRange
if (
(i.boundingSphere === null && i.computeBoundingSphere(),
kf.copy(i.boundingSphere),
kf.applyMatrix4(r),
(kf.radius += s),
e.ray.intersectsSphere(kf) === !1)
)
return
;(YS.copy(r).invert(), ld.copy(e.ray).applyMatrix4(YS))
const a = s / ((this.scale.x + this.scale.y + this.scale.z) / 3),
l = a * a,
c = this.isLineSegments ? 2 : 1,
u = i.index,
h = i.attributes.position
if (u !== null) {
const f = Math.max(0, o.start),
p = Math.min(u.count, o.start + o.count)
for (let g = f, y = p - 1; g < y; g += c) {
const m = u.getX(g),
v = u.getX(g + 1),
x = zf(this, e, ld, l, m, v, g)
x && t.push(x)
}
if (this.isLineLoop) {
const g = u.getX(p - 1),
y = u.getX(f),
m = zf(this, e, ld, l, g, y, p - 1)
m && t.push(m)
}
} else {
const f = Math.max(0, o.start),
p = Math.min(h.count, o.start + o.count)
for (let g = f, y = p - 1; g < y; g += c) {
const m = zf(this, e, ld, l, g, g + 1, g)
m && t.push(m)
}
if (this.isLineLoop) {
const g = zf(this, e, ld, l, p - 1, f, p - 1)
g && t.push(g)
}
}
}
updateMorphTargets() {
const t = this.geometry.morphAttributes,
i = Object.keys(t)
if (i.length > 0) {
const r = t[i[0]]
if (r !== void 0) {
;((this.morphTargetInfluences = []), (this.morphTargetDictionary = {}))
for (let s = 0, o = r.length; s < o; s++) {
const a = r[s].name || String(s)
;(this.morphTargetInfluences.push(0), (this.morphTargetDictionary[a] = s))
}
}
}
}
}
function zf(n, e, t, i, r, s, o) {
const a = n.geometry.attributes.position
if (
(mm.fromBufferAttribute(a, r),
gm.fromBufferAttribute(a, s),
t.distanceSqToSegment(mm, gm, Dg, ZS) > i)
)
return
Dg.applyMatrix4(n.matrixWorld)
const c = e.ray.origin.distanceTo(Dg)
if (!(c < e.near || c > e.far))
return {
distance: c,
point: ZS.clone().applyMatrix4(n.matrixWorld),
index: o,
face: null,
faceIndex: null,
barycoord: null,
object: n,
}
}
const JS = new Y(),
eA = new Y()
class pL extends C_ {
constructor(e, t) {
;(super(e, t), (this.isLineSegments = !0), (this.type = 'LineSegments'))
}
computeLineDistances() {
const e = this.geometry
if (e.index === null) {
const t = e.attributes.position,
i = []
for (let r = 0, s = t.count; r < s; r += 2)
(JS.fromBufferAttribute(t, r),
eA.fromBufferAttribute(t, r + 1),
(i[r] = r === 0 ? 0 : i[r - 1]),
(i[r + 1] = i[r] + JS.distanceTo(eA)))
e.setAttribute('lineDistance', new Si(i, 1))
} else
console.warn(
'THREE.LineSegments.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.'
)
return this
}
}
class mL extends C_ {
constructor(e, t) {
;(super(e, t), (this.isLineLoop = !0), (this.type = 'LineLoop'))
}
}
class z5 extends es {
constructor(e) {
;(super(),
(this.isPointsMaterial = !0),
(this.type = 'PointsMaterial'),
(this.color = new gt(16777215)),
(this.map = null),
(this.alphaMap = null),
(this.size = 1),
(this.sizeAttenuation = !0),
(this.fog = !0),
this.setValues(e))
}
copy(e) {
return (
super.copy(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
)
}
}
const tA = new Xe(),
Uy = new Uh(),
Vf = new oo(),
Hf = new Y()
class gL extends rn {
constructor(e = new Ui(), t = new z5()) {
;(super(),
(this.isPoints = !0),
(this.type = 'Points'),
(this.geometry = e),
(this.material = t),
this.updateMorphTargets())
}
copy(e, t) {
return (
super.copy(e, t),
(this.material = Array.isArray(e.material) ? e.material.slice() : e.material),
(this.geometry = e.geometry),
this
)
}
raycast(e, t) {
const i = this.geometry,
r = this.matrixWorld,
s = e.params.Points.threshold,
o = i.drawRange
if (
(i.boundingSphere === null && i.computeBoundingSphere(),
Vf.copy(i.boundingSphere),
Vf.applyMatrix4(r),
(Vf.radius += s),
e.ray.intersectsSphere(Vf) === !1)
)
return
;(tA.copy(r).invert(), Uy.copy(e.ray).applyMatrix4(tA))
const a = s / ((this.scale.x + this.scale.y + this.scale.z) / 3),
l = a * a,
c = i.index,
d = i.attributes.position
if (c !== null) {
const h = Math.max(0, o.start),
f = Math.min(c.count, o.start + o.count)
for (let p = h, g = f; p < g; p++) {
const y = c.getX(p)
;(Hf.fromBufferAttribute(d, y), nA(Hf, y, l, r, e, t, this))
}
} else {
const h = Math.max(0, o.start),
f = Math.min(d.count, o.start + o.count)
for (let p = h, g = f; p < g; p++) (Hf.fromBufferAttribute(d, p), nA(Hf, p, l, r, e, t, this))
}
}
updateMorphTargets() {
const t = this.geometry.morphAttributes,
i = Object.keys(t)
if (i.length > 0) {
const r = t[i[0]]
if (r !== void 0) {
;((this.morphTargetInfluences = []), (this.morphTargetDictionary = {}))
for (let s = 0, o = r.length; s < o; s++) {
const a = r[s].name || String(s)
;(this.morphTargetInfluences.push(0), (this.morphTargetDictionary[a] = s))
}
}
}
}
}
function nA(n, e, t, i, r, s, o) {
const a = Uy.distanceSqToPoint(n)
if (a < t) {
const l = new Y()
;(Uy.closestPointToPoint(n, l), l.applyMatrix4(i))
const c = r.ray.origin.distanceTo(l)
if (c < r.near || c > r.far) return
s.push({
distance: c,
distanceToRay: Math.sqrt(a),
point: l,
index: e,
face: null,
faceIndex: null,
barycoord: null,
object: o,
})
}
}
class V5 extends Wn {
constructor(e, t) {
;(super({ width: e, height: t }),
(this.isFramebufferTexture = !0),
(this.magFilter = _i),
(this.minFilter = _i),
(this.generateMipmaps = !1),
(this.needsUpdate = !0))
}
}
class Ha extends Wn {
constructor(e, t, i, r, s, o, a, l, c, u = Il) {
if (u !== Il && u !== hu)
throw new Error(
'DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat'
)
;(i === void 0 && u === Il && (i = Ni),
i === void 0 && u === hu && (i = du),
super(null, r, s, o, a, l, u, i, c),
(this.isDepthTexture = !0),
(this.image = { width: e, height: t }),
(this.magFilter = a !== void 0 ? a : _i),
(this.minFilter = l !== void 0 ? l : _i),
(this.flipY = !1),
(this.generateMipmaps = !1),
(this.compareFunction = null))
}
copy(e) {
return (super.copy(e), (this.compareFunction = e.compareFunction), this)
}
toJSON(e) {
const t = super.toJSON(e)
return (this.compareFunction !== null && (t.compareFunction = this.compareFunction), t)
}
}
class ph extends Ui {
constructor(e = 1, t = 1, i = 1, r = 32, s = 1, o = !1, a = 0, l = Math.PI * 2) {
;(super(),
(this.type = 'CylinderGeometry'),
(this.parameters = {
radiusTop: e,
radiusBottom: t,
height: i,
radialSegments: r,
heightSegments: s,
openEnded: o,
thetaStart: a,
thetaLength: l,
}))
const c = this
;((r = Math.floor(r)), (s = Math.floor(s)))
const u = [],
d = [],
h = [],
f = []
let p = 0
const g = [],
y = i / 2
let m = 0
;(v(),
o === !1 && (e > 0 && x(!0), t > 0 && x(!1)),
this.setIndex(u),
this.setAttribute('position', new Si(d, 3)),
this.setAttribute('normal', new Si(h, 3)),
this.setAttribute('uv', new Si(f, 2)))
function v() {
const _ = new Y(),
S = new Y()
let C = 0
const A = (t - e) / i
for (let R = 0; R <= s; R++) {
const w = [],
M = R / s,
I = M * (t - e) + e
for (let L = 0; L <= r; L++) {
const U = L / r,
T = U * l + a,
F = Math.sin(T),
V = Math.cos(T)
;((S.x = I * F),
(S.y = -M * i + y),
(S.z = I * V),
d.push(S.x, S.y, S.z),
_.set(F, A, V).normalize(),
h.push(_.x, _.y, _.z),
f.push(U, 1 - M),
w.push(p++))
}
g.push(w)
}
for (let R = 0; R < r; R++)
for (let w = 0; w < s; w++) {
const M = g[w][R],
I = g[w + 1][R],
L = g[w + 1][R + 1],
U = g[w][R + 1]
;((e > 0 || w !== 0) && (u.push(M, I, U), (C += 3)),
(t > 0 || w !== s - 1) && (u.push(I, L, U), (C += 3)))
}
;(c.addGroup(m, C, 0), (m += C))
}
function x(_) {
const S = p,
C = new qe(),
A = new Y()
let R = 0
const w = _ === !0 ? e : t,
M = _ === !0 ? 1 : -1
for (let L = 1; L <= r; L++) (d.push(0, y * M, 0), h.push(0, M, 0), f.push(0.5, 0.5), p++)
const I = p
for (let L = 0; L <= r; L++) {
const T = (L / r) * l + a,
F = Math.cos(T),
V = Math.sin(T)
;((A.x = w * V),
(A.y = y * M),
(A.z = w * F),
d.push(A.x, A.y, A.z),
h.push(0, M, 0),
(C.x = F * 0.5 + 0.5),
(C.y = V * 0.5 * M + 0.5),
f.push(C.x, C.y),
p++)
}
for (let L = 0; L < r; L++) {
const U = S + L,
T = I + L
;(_ === !0 ? u.push(T, T + 1, U) : u.push(T + 1, T, U), (R += 3))
}
;(c.addGroup(m, R, _ === !0 ? 1 : 2), (m += R))
}
}
copy(e) {
return (super.copy(e), (this.parameters = Object.assign({}, e.parameters)), this)
}
static fromJSON(e) {
return new ph(
e.radiusTop,
e.radiusBottom,
e.height,
e.radialSegments,
e.heightSegments,
e.openEnded,
e.thetaStart,
e.thetaLength
)
}
}
class E_ extends ph {
constructor(e = 1, t = 1, i = 32, r = 1, s = !1, o = 0, a = Math.PI * 2) {
;(super(0, e, t, i, r, s, o, a),
(this.type = 'ConeGeometry'),
(this.parameters = {
radius: e,
height: t,
radialSegments: i,
heightSegments: r,
openEnded: s,
thetaStart: o,
thetaLength: a,
}))
}
static fromJSON(e) {
return new E_(
e.radius,
e.height,
e.radialSegments,
e.heightSegments,
e.openEnded,
e.thetaStart,
e.thetaLength
)
}
}
class mu extends Ui {
constructor(e = 1, t = 1, i = 1, r = 1) {
;(super(),
(this.type = 'PlaneGeometry'),
(this.parameters = { width: e, height: t, widthSegments: i, heightSegments: r }))
const s = e / 2,
o = t / 2,
a = Math.floor(i),
l = Math.floor(r),
c = a + 1,
u = l + 1,
d = e / a,
h = t / l,
f = [],
p = [],
g = [],
y = []
for (let m = 0; m < u; m++) {
const v = m * h - o
for (let x = 0; x < c; x++) {
const _ = x * d - s
;(p.push(_, -v, 0), g.push(0, 0, 1), y.push(x / a), y.push(1 - m / l))
}
}
for (let m = 0; m < l; m++)
for (let v = 0; v < a; v++) {
const x = v + c * m,
_ = v + c * (m + 1),
S = v + 1 + c * (m + 1),
C = v + 1 + c * m
;(f.push(x, _, C), f.push(_, S, C))
}
;(this.setIndex(f),
this.setAttribute('position', new Si(p, 3)),
this.setAttribute('normal', new Si(g, 3)),
this.setAttribute('uv', new Si(y, 2)))
}
copy(e) {
return (super.copy(e), (this.parameters = Object.assign({}, e.parameters)), this)
}
static fromJSON(e) {
return new mu(e.width, e.height, e.widthSegments, e.heightSegments)
}
}
class ym extends Ui {
constructor(e = 1, t = 32, i = 16, r = 0, s = Math.PI * 2, o = 0, a = Math.PI) {
;(super(),
(this.type = 'SphereGeometry'),
(this.parameters = {
radius: e,
widthSegments: t,
heightSegments: i,
phiStart: r,
phiLength: s,
thetaStart: o,
thetaLength: a,
}),
(t = Math.max(3, Math.floor(t))),
(i = Math.max(2, Math.floor(i))))
const l = Math.min(o + a, Math.PI)
let c = 0
const u = [],
d = new Y(),
h = new Y(),
f = [],
p = [],
g = [],
y = []
for (let m = 0; m <= i; m++) {
const v = [],
x = m / i
let _ = 0
m === 0 && o === 0 ? (_ = 0.5 / t) : m === i && l === Math.PI && (_ = -0.5 / t)
for (let S = 0; S <= t; S++) {
const C = S / t
;((d.x = -e * Math.cos(r + C * s) * Math.sin(o + x * a)),
(d.y = e * Math.cos(o + x * a)),
(d.z = e * Math.sin(r + C * s) * Math.sin(o + x * a)),
p.push(d.x, d.y, d.z),
h.copy(d).normalize(),
g.push(h.x, h.y, h.z),
y.push(C + _, 1 - x),
v.push(c++))
}
u.push(v)
}
for (let m = 0; m < i; m++)
for (let v = 0; v < t; v++) {
const x = u[m][v + 1],
_ = u[m][v],
S = u[m + 1][v],
C = u[m + 1][v + 1]
;((m !== 0 || o > 0) && f.push(x, _, C), (m !== i - 1 || l < Math.PI) && f.push(_, S, C))
}
;(this.setIndex(f),
this.setAttribute('position', new Si(p, 3)),
this.setAttribute('normal', new Si(g, 3)),
this.setAttribute('uv', new Si(y, 2)))
}
copy(e) {
return (super.copy(e), (this.parameters = Object.assign({}, e.parameters)), this)
}
static fromJSON(e) {
return new ym(
e.radius,
e.widthSegments,
e.heightSegments,
e.phiStart,
e.phiLength,
e.thetaStart,
e.thetaLength
)
}
}
class M_ extends es {
constructor(e) {
;(super(),
(this.isMeshStandardMaterial = !0),
(this.type = 'MeshStandardMaterial'),
(this.defines = { STANDARD: '' }),
(this.color = new gt(16777215)),
(this.roughness = 1),
(this.metalness = 0),
(this.map = null),
(this.lightMap = null),
(this.lightMapIntensity = 1),
(this.aoMap = null),
(this.aoMapIntensity = 1),
(this.emissive = new gt(0)),
(this.emissiveIntensity = 1),
(this.emissiveMap = null),
(this.bumpMap = null),
(this.bumpScale = 1),
(this.normalMap = null),
(this.normalMapType = hm),
(this.normalScale = new qe(1, 1)),
(this.displacementMap = null),
(this.displacementScale = 1),
(this.displacementBias = 0),
(this.roughnessMap = null),
(this.metalnessMap = null),
(this.alphaMap = null),
(this.envMap = null),
(this.envMapRotation = new ws()),
(this.envMapIntensity = 1),
(this.wireframe = !1),
(this.wireframeLinewidth = 1),
(this.wireframeLinecap = 'round'),
(this.wireframeLinejoin = 'round'),
(this.flatShading = !1),
(this.fog = !0),
this.setValues(e))
}
copy(e) {
return (
super.copy(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
)
}
}
class ao extends M_ {
constructor(e) {
;(super(),
(this.isMeshPhysicalMaterial = !0),
(this.defines = { STANDARD: '', PHYSICAL: '' }),
(this.type = 'MeshPhysicalMaterial'),
(this.anisotropyRotation = 0),
(this.anisotropyMap = null),
(this.clearcoatMap = null),
(this.clearcoatRoughness = 0),
(this.clearcoatRoughnessMap = null),
(this.clearcoatNormalScale = new qe(1, 1)),
(this.clearcoatNormalMap = null),
(this.ior = 1.5),
Object.defineProperty(this, 'reflectivity', {
get: function () {
return Nt((2.5 * (this.ior - 1)) / (this.ior + 1), 0, 1)
},
set: function (t) {
this.ior = (1 + 0.4 * t) / (1 - 0.4 * t)
},
}),
(this.iridescenceMap = null),
(this.iridescenceIOR = 1.3),
(this.iridescenceThicknessRange = [100, 400]),
(this.iridescenceThicknessMap = null),
(this.sheenColor = new gt(0)),
(this.sheenColorMap = null),
(this.sheenRoughness = 1),
(this.sheenRoughnessMap = null),
(this.transmissionMap = null),
(this.thickness = 0),
(this.thicknessMap = null),
(this.attenuationDistance = 1 / 0),
(this.attenuationColor = new gt(1, 1, 1)),
(this.specularIntensity = 1),
(this.specularIntensityMap = null),
(this.specularColor = new gt(1, 1, 1)),
(this.specularColorMap = null),
(this._anisotropy = 0),
(this._clearcoat = 0),
(this._dispersion = 0),
(this._iridescence = 0),
(this._sheen = 0),
(this._transmission = 0),
this.setValues(e))
}
get anisotropy() {
return this._anisotropy
}
set anisotropy(e) {
;(this._anisotropy > 0 != e > 0 && this.version++, (this._anisotropy = e))
}
get clearcoat() {
return this._clearcoat
}
set clearcoat(e) {
;(this._clearcoat > 0 != e > 0 && this.version++, (this._clearcoat = e))
}
get iridescence() {
return this._iridescence
}
set iridescence(e) {
;(this._iridescence > 0 != e > 0 && this.version++, (this._iridescence = e))
}
get dispersion() {
return this._dispersion
}
set dispersion(e) {
;(this._dispersion > 0 != e > 0 && this.version++, (this._dispersion = e))
}
get sheen() {
return this._sheen
}
set sheen(e) {
;(this._sheen > 0 != e > 0 && this.version++, (this._sheen = e))
}
get transmission() {
return this._transmission
}
set transmission(e) {
;(this._transmission > 0 != e > 0 && this.version++, (this._transmission = e))
}
copy(e) {
return (
super.copy(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 = [...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
)
}
}
class yL extends es {
constructor(e) {
;(super(),
(this.isMeshDepthMaterial = !0),
(this.type = 'MeshDepthMaterial'),
(this.depthPacking = oP),
(this.map = null),
(this.alphaMap = null),
(this.displacementMap = null),
(this.displacementScale = 1),
(this.displacementBias = 0),
(this.wireframe = !1),
(this.wireframeLinewidth = 1),
this.setValues(e))
}
copy(e) {
return (
super.copy(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
)
}
}
class vL extends es {
constructor(e) {
;(super(),
(this.isMeshDistanceMaterial = !0),
(this.type = 'MeshDistanceMaterial'),
(this.map = null),
(this.alphaMap = null),
(this.displacementMap = null),
(this.displacementScale = 1),
(this.displacementBias = 0),
this.setValues(e))
}
copy(e) {
return (
super.copy(e),
(this.map = e.map),
(this.alphaMap = e.alphaMap),
(this.displacementMap = e.displacementMap),
(this.displacementScale = e.displacementScale),
(this.displacementBias = e.displacementBias),
this
)
}
}
function $f(n, e, t) {
return !n || (!t && n.constructor === e)
? n
: typeof e.BYTES_PER_ELEMENT == 'number'
? new e(n)
: Array.prototype.slice.call(n)
}
function _L(n) {
return ArrayBuffer.isView(n) && !(n instanceof DataView)
}
function xL(n) {
function e(r, s) {
return n[r] - n[s]
}
const t = n.length,
i = new Array(t)
for (let r = 0; r !== t; ++r) i[r] = r
return (i.sort(e), i)
}
function iA(n, e, t) {
const i = n.length,
r = new n.constructor(i)
for (let s = 0, o = 0; o !== i; ++s) {
const a = t[s] * e
for (let l = 0; l !== e; ++l) r[o++] = n[a + l]
}
return r
}
function H5(n, e, t, i) {
let r = 1,
s = n[0]
for (; s !== void 0 && s[i] === void 0; ) s = n[r++]
if (s === void 0) return
let o = s[i]
if (o !== void 0)
if (Array.isArray(o))
do ((o = s[i]), o !== void 0 && (e.push(s.time), t.push.apply(t, o)), (s = n[r++]))
while (s !== void 0)
else if (o.toArray !== void 0)
do ((o = s[i]), o !== void 0 && (e.push(s.time), o.toArray(t, t.length)), (s = n[r++]))
while (s !== void 0)
else
do ((o = s[i]), o !== void 0 && (e.push(s.time), t.push(o)), (s = n[r++]))
while (s !== void 0)
}
class kh {
constructor(e, t, i, r) {
;((this.parameterPositions = e),
(this._cachedIndex = 0),
(this.resultBuffer = r !== void 0 ? r : new t.constructor(i)),
(this.sampleValues = t),
(this.valueSize = i),
(this.settings = null),
(this.DefaultSettings_ = {}))
}
evaluate(e) {
const t = this.parameterPositions
let i = this._cachedIndex,
r = t[i],
s = t[i - 1]
e: {
t: {
let o
n: {
i: if (!(e < r)) {
for (let a = i + 2; ; ) {
if (r === void 0) {
if (e < s) break i
return ((i = t.length), (this._cachedIndex = i), this.copySampleValue_(i - 1))
}
if (i === a) break
if (((s = r), (r = t[++i]), e < r)) break t
}
o = t.length
break n
}
if (!(e >= s)) {
const a = t[1]
e < a && ((i = 2), (s = a))
for (let l = i - 2; ; ) {
if (s === void 0) return ((this._cachedIndex = 0), this.copySampleValue_(0))
if (i === l) break
if (((r = s), (s = t[--i - 1]), e >= s)) break t
}
;((o = i), (i = 0))
break n
}
break e
}
for (; i < o; ) {
const a = (i + o) >>> 1
e < t[a] ? (o = a) : (i = a + 1)
}
if (((r = t[i]), (s = t[i - 1]), s === void 0))
return ((this._cachedIndex = 0), this.copySampleValue_(0))
if (r === void 0)
return ((i = t.length), (this._cachedIndex = i), this.copySampleValue_(i - 1))
}
;((this._cachedIndex = i), this.intervalChanged_(i, s, r))
}
return this.interpolate_(i, s, e, r)
}
getSettings_() {
return this.settings || this.DefaultSettings_
}
copySampleValue_(e) {
const t = this.resultBuffer,
i = this.sampleValues,
r = this.valueSize,
s = e * r
for (let o = 0; o !== r; ++o) t[o] = i[s + o]
return t
}
interpolate_() {
throw new Error('call to abstract method')
}
intervalChanged_() {}
}
class SL extends kh {
constructor(e, t, i, r) {
;(super(e, t, i, r),
(this._weightPrev = -0),
(this._offsetPrev = -0),
(this._weightNext = -0),
(this._offsetNext = -0),
(this.DefaultSettings_ = { endingStart: Lc, endingEnd: Lc }))
}
intervalChanged_(e, t, i) {
const r = this.parameterPositions
let s = e - 2,
o = e + 1,
a = r[s],
l = r[o]
if (a === void 0)
switch (this.getSettings_().endingStart) {
case Dc:
;((s = e), (a = 2 * t - i))
break
case dm:
;((s = r.length - 2), (a = t + r[s] - r[s + 1]))
break
default:
;((s = e), (a = i))
}
if (l === void 0)
switch (this.getSettings_().endingEnd) {
case Dc:
;((o = e), (l = 2 * i - t))
break
case dm:
;((o = 1), (l = i + r[1] - r[0]))
break
default:
;((o = e - 1), (l = t))
}
const c = (i - t) * 0.5,
u = this.valueSize
;((this._weightPrev = c / (t - a)),
(this._weightNext = c / (l - i)),
(this._offsetPrev = s * u),
(this._offsetNext = o * u))
}
interpolate_(e, t, i, r) {
const s = this.resultBuffer,
o = this.sampleValues,
a = this.valueSize,
l = e * a,
c = l - a,
u = this._offsetPrev,
d = this._offsetNext,
h = this._weightPrev,
f = this._weightNext,
p = (i - t) / (r - t),
g = p * p,
y = g * p,
m = -h * y + 2 * h * g - h * p,
v = (1 + h) * y + (-1.5 - 2 * h) * g + (-0.5 + h) * p + 1,
x = (-1 - f) * y + (1.5 + f) * g + 0.5 * p,
_ = f * y - f * g
for (let S = 0; S !== a; ++S) s[S] = m * o[u + S] + v * o[c + S] + x * o[l + S] + _ * o[d + S]
return s
}
}
class $5 extends kh {
constructor(e, t, i, r) {
super(e, t, i, r)
}
interpolate_(e, t, i, r) {
const s = this.resultBuffer,
o = this.sampleValues,
a = this.valueSize,
l = e * a,
c = l - a,
u = (i - t) / (r - t),
d = 1 - u
for (let h = 0; h !== a; ++h) s[h] = o[c + h] * d + o[l + h] * u
return s
}
}
class AL extends kh {
constructor(e, t, i, r) {
super(e, t, i, r)
}
interpolate_(e) {
return this.copySampleValue_(e - 1)
}
}
class lo {
constructor(e, t, i, r) {
if (e === void 0) throw new Error('THREE.KeyframeTrack: track name is undefined')
if (t === void 0 || t.length === 0)
throw new Error('THREE.KeyframeTrack: no keyframes in track named ' + e)
;((this.name = e),
(this.times = $f(t, this.TimeBufferType)),
(this.values = $f(i, this.ValueBufferType)),
this.setInterpolation(r || this.DefaultInterpolation))
}
static toJSON(e) {
const t = e.constructor
let i
if (t.toJSON !== this.toJSON) i = t.toJSON(e)
else {
i = { name: e.name, times: $f(e.times, Array), values: $f(e.values, Array) }
const r = e.getInterpolation()
r !== e.DefaultInterpolation && (i.interpolation = r)
}
return ((i.type = e.ValueTypeName), i)
}
InterpolantFactoryMethodDiscrete(e) {
return new AL(this.times, this.values, this.getValueSize(), e)
}
InterpolantFactoryMethodLinear(e) {
return new $5(this.times, this.values, this.getValueSize(), e)
}
InterpolantFactoryMethodSmooth(e) {
return new SL(this.times, this.values, this.getValueSize(), e)
}
setInterpolation(e) {
let t
switch (e) {
case ch:
t = this.InterpolantFactoryMethodDiscrete
break
case uh:
t = this.InterpolantFactoryMethodLinear
break
case ug:
t = this.InterpolantFactoryMethodSmooth
break
}
if (t === void 0) {
const i =
'unsupported interpolation for ' + this.ValueTypeName + ' keyframe track named ' + this.name
if (this.createInterpolant === void 0)
if (e !== this.DefaultInterpolation) this.setInterpolation(this.DefaultInterpolation)
else throw new Error(i)
return (console.warn('THREE.KeyframeTrack:', i), this)
}
return ((this.createInterpolant = t), this)
}
getInterpolation() {
switch (this.createInterpolant) {
case this.InterpolantFactoryMethodDiscrete:
return ch
case this.InterpolantFactoryMethodLinear:
return uh
case this.InterpolantFactoryMethodSmooth:
return ug
}
}
getValueSize() {
return this.values.length / this.times.length
}
shift(e) {
if (e !== 0) {
const t = this.times
for (let i = 0, r = t.length; i !== r; ++i) t[i] += e
}
return this
}
scale(e) {
if (e !== 1) {
const t = this.times
for (let i = 0, r = t.length; i !== r; ++i) t[i] *= e
}
return this
}
trim(e, t) {
const i = this.times,
r = i.length
let s = 0,
o = r - 1
for (; s !== r && i[s] < e; ) ++s
for (; o !== -1 && i[o] > t; ) --o
if ((++o, s !== 0 || o !== r)) {
s >= o && ((o = Math.max(o, 1)), (s = o - 1))
const a = this.getValueSize()
;((this.times = i.slice(s, o)), (this.values = this.values.slice(s * a, o * a)))
}
return this
}
validate() {
let e = !0
const t = this.getValueSize()
t - Math.floor(t) !== 0 &&
(console.error('THREE.KeyframeTrack: Invalid value size in track.', this), (e = !1))
const i = this.times,
r = this.values,
s = i.length
s === 0 && (console.error('THREE.KeyframeTrack: Track is empty.', this), (e = !1))
let o = null
for (let a = 0; a !== s; a++) {
const l = i[a]
if (typeof l == 'number' && isNaN(l)) {
;(console.error('THREE.KeyframeTrack: Time is not a valid number.', this, a, l), (e = !1))
break
}
if (o !== null && o > l) {
;(console.error('THREE.KeyframeTrack: Out of order keys.', this, a, l, o), (e = !1))
break
}
o = l
}
if (r !== void 0 && _L(r))
for (let a = 0, l = r.length; a !== l; ++a) {
const c = r[a]
if (isNaN(c)) {
;(console.error('THREE.KeyframeTrack: Value is not a valid number.', this, a, c),
(e = !1))
break
}
}
return e
}
optimize() {
const e = this.times.slice(),
t = this.values.slice(),
i = this.getValueSize(),
r = this.getInterpolation() === ug,
s = e.length - 1
let o = 1
for (let a = 1; a < s; ++a) {
let l = !1
const c = e[a],
u = e[a + 1]
if (c !== u && (a !== 1 || c !== e[0]))
if (r) l = !0
else {
const d = a * i,
h = d - i,
f = d + i
for (let p = 0; p !== i; ++p) {
const g = t[d + p]
if (g !== t[h + p] || g !== t[f + p]) {
l = !0
break
}
}
}
if (l) {
if (a !== o) {
e[o] = e[a]
const d = a * i,
h = o * i
for (let f = 0; f !== i; ++f) t[h + f] = t[d + f]
}
++o
}
}
if (s > 0) {
e[o] = e[s]
for (let a = s * i, l = o * i, c = 0; c !== i; ++c) t[l + c] = t[a + c]
++o
}
return (
o !== e.length
? ((this.times = e.slice(0, o)), (this.values = t.slice(0, o * i)))
: ((this.times = e), (this.values = t)),
this
)
}
clone() {
const e = this.times.slice(),
t = this.values.slice(),
i = this.constructor,
r = new i(this.name, e, t)
return ((r.createInterpolant = this.createInterpolant), r)
}
}
lo.prototype.TimeBufferType = Float32Array
lo.prototype.ValueBufferType = Float32Array
lo.prototype.DefaultInterpolation = uh
class Du extends lo {
constructor(e, t, i) {
super(e, t, i)
}
}
Du.prototype.ValueTypeName = 'bool'
Du.prototype.ValueBufferType = Array
Du.prototype.DefaultInterpolation = ch
Du.prototype.InterpolantFactoryMethodLinear = void 0
Du.prototype.InterpolantFactoryMethodSmooth = void 0
class G5 extends lo {}
G5.prototype.ValueTypeName = 'color'
class gu extends lo {}
gu.prototype.ValueTypeName = 'number'
class bL extends kh {
constructor(e, t, i, r) {
super(e, t, i, r)
}
interpolate_(e, t, i, r) {
const s = this.resultBuffer,
o = this.sampleValues,
a = this.valueSize,
l = (i - t) / (r - t)
let c = e * a
for (let u = c + a; c !== u; c += 4) Qt.slerpFlat(s, 0, o, c - a, o, c, l)
return s
}
}
class yu extends lo {
InterpolantFactoryMethodLinear(e) {
return new bL(this.times, this.values, this.getValueSize(), e)
}
}
yu.prototype.ValueTypeName = 'quaternion'
yu.prototype.InterpolantFactoryMethodSmooth = void 0
class Fu extends lo {
constructor(e, t, i) {
super(e, t, i)
}
}
Fu.prototype.ValueTypeName = 'string'
Fu.prototype.ValueBufferType = Array
Fu.prototype.DefaultInterpolation = ch
Fu.prototype.InterpolantFactoryMethodLinear = void 0
Fu.prototype.InterpolantFactoryMethodSmooth = void 0
class vu extends lo {}
vu.prototype.ValueTypeName = 'vector'
class ky {
constructor(e = '', t = -1, i = [], r = S_) {
;((this.name = e),
(this.tracks = i),
(this.duration = t),
(this.blendMode = r),
(this.uuid = xs()),
this.duration < 0 && this.resetDuration())
}
static parse(e) {
const t = [],
i = e.tracks,
r = 1 / (e.fps || 1)
for (let o = 0, a = i.length; o !== a; ++o) t.push(wL(i[o]).scale(r))
const s = new this(e.name, e.duration, t, e.blendMode)
return ((s.uuid = e.uuid), s)
}
static toJSON(e) {
const t = [],
i = e.tracks,
r = { name: e.name, duration: e.duration, tracks: t, uuid: e.uuid, blendMode: e.blendMode }
for (let s = 0, o = i.length; s !== o; ++s) t.push(lo.toJSON(i[s]))
return r
}
static CreateFromMorphTargetSequence(e, t, i, r) {
const s = t.length,
o = []
for (let a = 0; a < s; a++) {
let l = [],
c = []
;(l.push((a + s - 1) % s, a, (a + 1) % s), c.push(0, 1, 0))
const u = xL(l)
;((l = iA(l, 1, u)),
(c = iA(c, 1, u)),
!r && l[0] === 0 && (l.push(s), c.push(c[0])),
o.push(new gu('.morphTargetInfluences[' + t[a].name + ']', l, c).scale(1 / i)))
}
return new this(e, -1, o)
}
static findByName(e, t) {
let i = e
if (!Array.isArray(e)) {
const r = e
i = (r.geometry && r.geometry.animations) || r.animations
}
for (let r = 0; r < i.length; r++) if (i[r].name === t) return i[r]
return null
}
static CreateClipsFromMorphTargetSequences(e, t, i) {
const r = {},
s = /^([\w-]*?)([\d]+)$/
for (let a = 0, l = e.length; a < l; a++) {
const c = e[a],
u = c.name.match(s)
if (u && u.length > 1) {
const d = u[1]
let h = r[d]
;(h || (r[d] = h = []), h.push(c))
}
}
const o = []
for (const a in r) o.push(this.CreateFromMorphTargetSequence(a, r[a], t, i))
return o
}
static parseAnimation(e, t) {
if (!e) return (console.error('THREE.AnimationClip: No animation in JSONLoader data.'), null)
const i = function (d, h, f, p, g) {
if (f.length !== 0) {
const y = [],
m = []
;(H5(f, y, m, p), y.length !== 0 && g.push(new d(h, y, m)))
}
},
r = [],
s = e.name || 'default',
o = e.fps || 30,
a = e.blendMode
let l = e.length || -1
const c = e.hierarchy || []
for (let d = 0; d < c.length; d++) {
const h = c[d].keys
if (!(!h || h.length === 0))
if (h[0].morphTargets) {
const f = {}
let p
for (p = 0; p < h.length; p++)
if (h[p].morphTargets)
for (let g = 0; g < h[p].morphTargets.length; g++) f[h[p].morphTargets[g]] = -1
for (const g in f) {
const y = [],
m = []
for (let v = 0; v !== h[p].morphTargets.length; ++v) {
const x = h[p]
;(y.push(x.time), m.push(x.morphTarget === g ? 1 : 0))
}
r.push(new gu('.morphTargetInfluence[' + g + ']', y, m))
}
l = f.length * o
} else {
const f = '.bones[' + t[d].name + ']'
;(i(vu, f + '.position', h, 'pos', r),
i(yu, f + '.quaternion', h, 'rot', r),
i(vu, f + '.scale', h, 'scl', r))
}
}
return r.length === 0 ? null : new this(s, l, r, a)
}
resetDuration() {
const e = this.tracks
let t = 0
for (let i = 0, r = e.length; i !== r; ++i) {
const s = this.tracks[i]
t = Math.max(t, s.times[s.times.length - 1])
}
return ((this.duration = t), this)
}
trim() {
for (let e = 0; e < this.tracks.length; e++) this.tracks[e].trim(0, this.duration)
return this
}
validate() {
let e = !0
for (let t = 0; t < this.tracks.length; t++) e = e && this.tracks[t].validate()
return e
}
optimize() {
for (let e = 0; e < this.tracks.length; e++) this.tracks[e].optimize()
return this
}
clone() {
const e = []
for (let t = 0; t < this.tracks.length; t++) e.push(this.tracks[t].clone())
return new this.constructor(this.name, this.duration, e, this.blendMode)
}
toJSON() {
return this.constructor.toJSON(this)
}
}
function TL(n) {
switch (n.toLowerCase()) {
case 'scalar':
case 'double':
case 'float':
case 'number':
case 'integer':
return gu
case 'vector':
case 'vector2':
case 'vector3':
case 'vector4':
return vu
case 'color':
return G5
case 'quaternion':
return yu
case 'bool':
case 'boolean':
return Du
case 'string':
return Fu
}
throw new Error('THREE.KeyframeTrack: Unsupported typeName: ' + n)
}
function wL(n) {
if (n.type === void 0) throw new Error('THREE.KeyframeTrack: track type undefined, can not parse')
const e = TL(n.type)
if (n.times === void 0) {
const t = [],
i = []
;(H5(n.keys, t, i, 'value'), (n.times = t), (n.values = i))
}
return e.parse !== void 0 ? e.parse(n) : new e(n.name, n.times, n.values, n.interpolation)
}
const Ma = {
enabled: !1,
files: {},
add: function (n, e) {
this.enabled !== !1 && (this.files[n] = e)
},
get: function (n) {
if (this.enabled !== !1) return this.files[n]
},
remove: function (n) {
delete this.files[n]
},
clear: function () {
this.files = {}
},
}
class CL {
constructor(e, t, i) {
const r = this
let s = !1,
o = 0,
a = 0,
l
const c = []
;((this.onStart = void 0),
(this.onLoad = e),
(this.onProgress = t),
(this.onError = i),
(this.itemStart = function (u) {
;(a++, s === !1 && r.onStart !== void 0 && r.onStart(u, o, a), (s = !0))
}),
(this.itemEnd = function (u) {
;(o++,
r.onProgress !== void 0 && r.onProgress(u, o, a),
o === a && ((s = !1), r.onLoad !== void 0 && r.onLoad()))
}),
(this.itemError = function (u) {
r.onError !== void 0 && r.onError(u)
}),
(this.resolveURL = function (u) {
return l ? l(u) : u
}),
(this.setURLModifier = function (u) {
return ((l = u), this)
}),
(this.addHandler = function (u, d) {
return (c.push(u, d), this)
}),
(this.removeHandler = function (u) {
const d = c.indexOf(u)
return (d !== -1 && c.splice(d, 2), this)
}),
(this.getHandler = function (u) {
for (let d = 0, h = c.length; d < h; d += 2) {
const f = c[d],
p = c[d + 1]
if ((f.global && (f.lastIndex = 0), f.test(u))) return p
}
return null
}))
}
}
const EL = new CL()
class Ou {
constructor(e) {
;((this.manager = e !== void 0 ? e : EL),
(this.crossOrigin = 'anonymous'),
(this.withCredentials = !1),
(this.path = ''),
(this.resourcePath = ''),
(this.requestHeader = {}))
}
load() {}
loadAsync(e, t) {
const i = this
return new Promise(function (r, s) {
i.load(e, r, t, s)
})
}
parse() {}
setCrossOrigin(e) {
return ((this.crossOrigin = e), this)
}
setWithCredentials(e) {
return ((this.withCredentials = e), this)
}
setPath(e) {
return ((this.path = e), this)
}
setResourcePath(e) {
return ((this.resourcePath = e), this)
}
setRequestHeader(e) {
return ((this.requestHeader = e), this)
}
}
Ou.DEFAULT_MATERIAL_NAME = '__DEFAULT'
const _o = {}
class ML extends Error {
constructor(e, t) {
;(super(e), (this.response = t))
}
}
class W5 extends Ou {
constructor(e) {
super(e)
}
load(e, t, i, r) {
;(e === void 0 && (e = ''),
this.path !== void 0 && (e = this.path + e),
(e = this.manager.resolveURL(e)))
const s = Ma.get(e)
if (s !== void 0)
return (
this.manager.itemStart(e),
setTimeout(() => {
;(t && t(s), this.manager.itemEnd(e))
}, 0),
s
)
if (_o[e] !== void 0) {
_o[e].push({ onLoad: t, onProgress: i, onError: r })
return
}
;((_o[e] = []), _o[e].push({ onLoad: t, onProgress: i, onError: r }))
const o = new Request(e, {
headers: new Headers(this.requestHeader),
credentials: this.withCredentials ? 'include' : 'same-origin',
}),
a = this.mimeType,
l = this.responseType
;(fetch(o)
.then((c) => {
if (c.status === 200 || c.status === 0) {
if (
(c.status === 0 && console.warn('THREE.FileLoader: HTTP Status 0 received.'),
typeof ReadableStream > 'u' || c.body === void 0 || c.body.getReader === void 0)
)
return c
const u = _o[e],
d = c.body.getReader(),
h = c.headers.get('X-File-Size') || c.headers.get('Content-Length'),
f = h ? parseInt(h) : 0,
p = f !== 0
let g = 0
const y = new ReadableStream({
start(m) {
v()
function v() {
d.read().then(
({ done: x, value: _ }) => {
if (x) m.close()
else {
g += _.byteLength
const S = new ProgressEvent('progress', {
lengthComputable: p,
loaded: g,
total: f,
})
for (let C = 0, A = u.length; C < A; C++) {
const R = u[C]
R.onProgress && R.onProgress(S)
}
;(m.enqueue(_), v())
}
},
(x) => {
m.error(x)
}
)
}
},
})
return new Response(y)
} else
throw new ML(
'fetch for "'
.concat(c.url, '" responded with ')
.concat(c.status, ': ')
.concat(c.statusText),
c
)
})
.then((c) => {
switch (l) {
case 'arraybuffer':
return c.arrayBuffer()
case 'blob':
return c.blob()
case 'document':
return c.text().then((u) => new DOMParser().parseFromString(u, a))
case 'json':
return c.json()
default:
if (a === void 0) return c.text()
{
const d = /charset="?([^;"\s]*)"?/i.exec(a),
h = d && d[1] ? d[1].toLowerCase() : void 0,
f = new TextDecoder(h)
return c.arrayBuffer().then((p) => f.decode(p))
}
}
})
.then((c) => {
Ma.add(e, c)
const u = _o[e]
delete _o[e]
for (let d = 0, h = u.length; d < h; d++) {
const f = u[d]
f.onLoad && f.onLoad(c)
}
})
.catch((c) => {
const u = _o[e]
if (u === void 0) throw (this.manager.itemError(e), c)
delete _o[e]
for (let d = 0, h = u.length; d < h; d++) {
const f = u[d]
f.onError && f.onError(c)
}
this.manager.itemError(e)
})
.finally(() => {
this.manager.itemEnd(e)
}),
this.manager.itemStart(e))
}
setResponseType(e) {
return ((this.responseType = e), this)
}
setMimeType(e) {
return ((this.mimeType = e), this)
}
}
class RL extends Ou {
constructor(e) {
super(e)
}
load(e, t, i, r) {
;(this.path !== void 0 && (e = this.path + e), (e = this.manager.resolveURL(e)))
const s = this,
o = Ma.get(e)
if (o !== void 0)
return (
s.manager.itemStart(e),
setTimeout(function () {
;(t && t(o), s.manager.itemEnd(e))
}, 0),
o
)
const a = dh('img')
function l() {
;(u(), Ma.add(e, this), t && t(this), s.manager.itemEnd(e))
}
function c(d) {
;(u(), r && r(d), s.manager.itemError(e), s.manager.itemEnd(e))
}
function u() {
;(a.removeEventListener('load', l, !1), a.removeEventListener('error', c, !1))
}
return (
a.addEventListener('load', l, !1),
a.addEventListener('error', c, !1),
e.slice(0, 5) !== 'data:' &&
this.crossOrigin !== void 0 &&
(a.crossOrigin = this.crossOrigin),
s.manager.itemStart(e),
(a.src = e),
a
)
}
}
class IL extends Ou {
constructor(e) {
super(e)
}
load(e, t, i, r) {
const s = new Wn(),
o = new RL(this.manager)
return (
o.setCrossOrigin(this.crossOrigin),
o.setPath(this.path),
o.load(
e,
function (a) {
;((s.image = a), (s.needsUpdate = !0), t !== void 0 && t(s))
},
i,
r
),
s
)
}
}
class R_ extends rn {
constructor(e, t = 1) {
;(super(),
(this.isLight = !0),
(this.type = 'Light'),
(this.color = new gt(e)),
(this.intensity = t))
}
dispose() {}
copy(e, t) {
return (super.copy(e, t), this.color.copy(e.color), (this.intensity = e.intensity), this)
}
toJSON(e) {
const t = super.toJSON(e)
return (
(t.object.color = this.color.getHex()),
(t.object.intensity = this.intensity),
this.groundColor !== void 0 && (t.object.groundColor = this.groundColor.getHex()),
this.distance !== void 0 && (t.object.distance = this.distance),
this.angle !== void 0 && (t.object.angle = this.angle),
this.decay !== void 0 && (t.object.decay = this.decay),
this.penumbra !== void 0 && (t.object.penumbra = this.penumbra),
this.shadow !== void 0 && (t.object.shadow = this.shadow.toJSON()),
this.target !== void 0 && (t.object.target = this.target.uuid),
t
)
}
}
const Fg = new Xe(),
rA = new Y(),
sA = new Y()
class I_ {
constructor(e) {
;((this.camera = e),
(this.intensity = 1),
(this.bias = 0),
(this.normalBias = 0),
(this.radius = 1),
(this.blurSamples = 8),
(this.mapSize = new qe(512, 512)),
(this.map = null),
(this.mapPass = null),
(this.matrix = new Xe()),
(this.autoUpdate = !0),
(this.needsUpdate = !1),
(this._frustum = new w_()),
(this._frameExtents = new qe(1, 1)),
(this._viewportCount = 1),
(this._viewports = [new Mt(0, 0, 1, 1)]))
}
getViewportCount() {
return this._viewportCount
}
getFrustum() {
return this._frustum
}
updateMatrices(e) {
const t = this.camera,
i = this.matrix
;(rA.setFromMatrixPosition(e.matrixWorld),
t.position.copy(rA),
sA.setFromMatrixPosition(e.target.matrixWorld),
t.lookAt(sA),
t.updateMatrixWorld(),
Fg.multiplyMatrices(t.projectionMatrix, t.matrixWorldInverse),
this._frustum.setFromProjectionMatrix(Fg),
i.set(0.5, 0, 0, 0.5, 0, 0.5, 0, 0.5, 0, 0, 0.5, 0.5, 0, 0, 0, 1),
i.multiply(Fg))
}
getViewport(e) {
return this._viewports[e]
}
getFrameExtents() {
return this._frameExtents
}
dispose() {
;(this.map && this.map.dispose(), this.mapPass && this.mapPass.dispose())
}
copy(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
)
}
clone() {
return new this.constructor().copy(this)
}
toJSON() {
const e = {}
return (
this.intensity !== 1 && (e.intensity = this.intensity),
this.bias !== 0 && (e.bias = this.bias),
this.normalBias !== 0 && (e.normalBias = this.normalBias),
this.radius !== 1 && (e.radius = this.radius),
(this.mapSize.x !== 512 || this.mapSize.y !== 512) && (e.mapSize = this.mapSize.toArray()),
(e.camera = this.camera.toJSON(!1).object),
delete e.camera.matrix,
e
)
}
}
class NL extends I_ {
constructor() {
;(super(new Ki(50, 1, 0.5, 500)), (this.isSpotLightShadow = !0), (this.focus = 1))
}
updateMatrices(e) {
const t = this.camera,
i = fu * 2 * e.angle * this.focus,
r = this.mapSize.width / this.mapSize.height,
s = e.distance || t.far
;((i !== t.fov || r !== t.aspect || s !== t.far) &&
((t.fov = i), (t.aspect = r), (t.far = s), t.updateProjectionMatrix()),
super.updateMatrices(e))
}
copy(e) {
return (super.copy(e), (this.focus = e.focus), this)
}
}
class PL extends R_ {
constructor(e, t, i = 0, r = Math.PI / 3, s = 0, o = 2) {
;(super(e, t),
(this.isSpotLight = !0),
(this.type = 'SpotLight'),
this.position.copy(rn.DEFAULT_UP),
this.updateMatrix(),
(this.target = new rn()),
(this.distance = i),
(this.angle = r),
(this.penumbra = s),
(this.decay = o),
(this.map = null),
(this.shadow = new NL()))
}
get power() {
return this.intensity * Math.PI
}
set power(e) {
this.intensity = e / Math.PI
}
dispose() {
this.shadow.dispose()
}
copy(e, t) {
return (
super.copy(e, t),
(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
)
}
}
const oA = new Xe(),
cd = new Y(),
Og = new Y()
class LL extends I_ {
constructor() {
;(super(new Ki(90, 1, 0.5, 500)),
(this.isPointLightShadow = !0),
(this._frameExtents = new qe(4, 2)),
(this._viewportCount = 6),
(this._viewports = [
new Mt(2, 1, 1, 1),
new Mt(0, 1, 1, 1),
new Mt(3, 1, 1, 1),
new Mt(1, 1, 1, 1),
new Mt(3, 0, 1, 1),
new Mt(1, 0, 1, 1),
]),
(this._cubeDirections = [
new Y(1, 0, 0),
new Y(-1, 0, 0),
new Y(0, 0, 1),
new Y(0, 0, -1),
new Y(0, 1, 0),
new Y(0, -1, 0),
]),
(this._cubeUps = [
new Y(0, 1, 0),
new Y(0, 1, 0),
new Y(0, 1, 0),
new Y(0, 1, 0),
new Y(0, 0, 1),
new Y(0, 0, -1),
]))
}
updateMatrices(e, t = 0) {
const i = this.camera,
r = this.matrix,
s = e.distance || i.far
;(s !== i.far && ((i.far = s), i.updateProjectionMatrix()),
cd.setFromMatrixPosition(e.matrixWorld),
i.position.copy(cd),
Og.copy(i.position),
Og.add(this._cubeDirections[t]),
i.up.copy(this._cubeUps[t]),
i.lookAt(Og),
i.updateMatrixWorld(),
r.makeTranslation(-cd.x, -cd.y, -cd.z),
oA.multiplyMatrices(i.projectionMatrix, i.matrixWorldInverse),
this._frustum.setFromProjectionMatrix(oA))
}
}
class DL extends R_ {
constructor(e, t, i = 0, r = 2) {
;(super(e, t),
(this.isPointLight = !0),
(this.type = 'PointLight'),
(this.distance = i),
(this.decay = r),
(this.shadow = new LL()))
}
get power() {
return this.intensity * 4 * Math.PI
}
set power(e) {
this.intensity = e / (4 * Math.PI)
}
dispose() {
this.shadow.dispose()
}
copy(e, t) {
return (
super.copy(e, t),
(this.distance = e.distance),
(this.decay = e.decay),
(this.shadow = e.shadow.clone()),
this
)
}
}
class Bu extends B5 {
constructor(e = -1, t = 1, i = 1, r = -1, s = 0.1, o = 2e3) {
;(super(),
(this.isOrthographicCamera = !0),
(this.type = 'OrthographicCamera'),
(this.zoom = 1),
(this.view = null),
(this.left = e),
(this.right = t),
(this.top = i),
(this.bottom = r),
(this.near = s),
(this.far = o),
this.updateProjectionMatrix())
}
copy(e, t) {
return (
super.copy(e, t),
(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 = e.view === null ? null : Object.assign({}, e.view)),
this
)
}
setViewOffset(e, t, i, r, s, o) {
;(this.view === null &&
(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 = i),
(this.view.offsetY = r),
(this.view.width = s),
(this.view.height = o),
this.updateProjectionMatrix())
}
clearViewOffset() {
;(this.view !== null && (this.view.enabled = !1), this.updateProjectionMatrix())
}
updateProjectionMatrix() {
const e = (this.right - this.left) / (2 * this.zoom),
t = (this.top - this.bottom) / (2 * this.zoom),
i = (this.right + this.left) / 2,
r = (this.top + this.bottom) / 2
let s = i - e,
o = i + e,
a = r + t,
l = r - t
if (this.view !== null && this.view.enabled) {
const c = (this.right - this.left) / this.view.fullWidth / this.zoom,
u = (this.top - this.bottom) / this.view.fullHeight / this.zoom
;((s += c * this.view.offsetX),
(o = s + c * this.view.width),
(a -= u * this.view.offsetY),
(l = a - u * this.view.height))
}
;(this.projectionMatrix.makeOrthographic(
s,
o,
a,
l,
this.near,
this.far,
this.coordinateSystem
),
this.projectionMatrixInverse.copy(this.projectionMatrix).invert())
}
toJSON(e) {
const t = super.toJSON(e)
return (
(t.object.zoom = this.zoom),
(t.object.left = this.left),
(t.object.right = this.right),
(t.object.top = this.top),
(t.object.bottom = this.bottom),
(t.object.near = this.near),
(t.object.far = this.far),
this.view !== null && (t.object.view = Object.assign({}, this.view)),
t
)
}
}
class FL extends I_ {
constructor() {
;(super(new Bu(-5, 5, 5, -5, 0.5, 500)), (this.isDirectionalLightShadow = !0))
}
}
class OL extends R_ {
constructor(e, t) {
;(super(e, t),
(this.isDirectionalLight = !0),
(this.type = 'DirectionalLight'),
this.position.copy(rn.DEFAULT_UP),
this.updateMatrix(),
(this.target = new rn()),
(this.shadow = new FL()))
}
dispose() {
this.shadow.dispose()
}
copy(e) {
return (super.copy(e), (this.target = e.target.clone()), (this.shadow = e.shadow.clone()), this)
}
}
class kd {
static decodeText(e) {
if (
(console.warn(
'THREE.LoaderUtils: decodeText() has been deprecated with r165 and will be removed with r175. Use TextDecoder instead.'
),
typeof TextDecoder < 'u')
)
return new TextDecoder().decode(e)
let t = ''
for (let i = 0, r = e.length; i < r; i++) t += String.fromCharCode(e[i])
try {
return decodeURIComponent(escape(t))
} catch (i) {
return t
}
}
static extractUrlBase(e) {
const t = e.lastIndexOf('/')
return t === -1 ? './' : e.slice(0, t + 1)
}
static resolveURL(e, t) {
return typeof e != 'string' || 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)
}
}
class BL extends Ui {
constructor() {
;(super(),
(this.isInstancedBufferGeometry = !0),
(this.type = 'InstancedBufferGeometry'),
(this.instanceCount = 1 / 0))
}
copy(e) {
return (super.copy(e), (this.instanceCount = e.instanceCount), this)
}
toJSON() {
const e = super.toJSON()
return ((e.instanceCount = this.instanceCount), (e.isInstancedBufferGeometry = !0), e)
}
}
class UL extends Ou {
constructor(e) {
;(super(e),
(this.isImageBitmapLoader = !0),
typeof createImageBitmap > 'u' &&
console.warn('THREE.ImageBitmapLoader: createImageBitmap() not supported.'),
typeof fetch > 'u' && console.warn('THREE.ImageBitmapLoader: fetch() not supported.'),
(this.options = { premultiplyAlpha: 'none' }))
}
setOptions(e) {
return ((this.options = e), this)
}
load(e, t, i, r) {
;(e === void 0 && (e = ''),
this.path !== void 0 && (e = this.path + e),
(e = this.manager.resolveURL(e)))
const s = this,
o = Ma.get(e)
if (o !== void 0) {
if ((s.manager.itemStart(e), o.then)) {
o.then((c) => {
;(t && t(c), s.manager.itemEnd(e))
}).catch((c) => {
r && r(c)
})
return
}
return (
setTimeout(function () {
;(t && t(o), s.manager.itemEnd(e))
}, 0),
o
)
}
const a = {}
;((a.credentials = this.crossOrigin === 'anonymous' ? 'same-origin' : 'include'),
(a.headers = this.requestHeader))
const l = fetch(e, a)
.then(function (c) {
return c.blob()
})
.then(function (c) {
return createImageBitmap(c, Object.assign(s.options, { colorSpaceConversion: 'none' }))
})
.then(function (c) {
return (Ma.add(e, c), t && t(c), s.manager.itemEnd(e), c)
})
.catch(function (c) {
;(r && r(c), Ma.remove(e), s.manager.itemError(e), s.manager.itemEnd(e))
})
;(Ma.add(e, l), s.manager.itemStart(e))
}
}
class kL extends Ki {
constructor(e = []) {
;(super(), (this.isArrayCamera = !0), (this.cameras = e), (this.index = 0))
}
}
class zL {
constructor(e = !0) {
;((this.autoStart = e),
(this.startTime = 0),
(this.oldTime = 0),
(this.elapsedTime = 0),
(this.running = !1))
}
start() {
;((this.startTime = aA()),
(this.oldTime = this.startTime),
(this.elapsedTime = 0),
(this.running = !0))
}
stop() {
;(this.getElapsedTime(), (this.running = !1), (this.autoStart = !1))
}
getElapsedTime() {
return (this.getDelta(), this.elapsedTime)
}
getDelta() {
let e = 0
if (this.autoStart && !this.running) return (this.start(), 0)
if (this.running) {
const t = aA()
;((e = (t - this.oldTime) / 1e3), (this.oldTime = t), (this.elapsedTime += e))
}
return e
}
}
function aA() {
return performance.now()
}
class VL {
constructor(e, t, i) {
;((this.binding = e), (this.valueSize = i))
let r, s, o
switch (t) {
case 'quaternion':
;((r = this._slerp),
(s = this._slerpAdditive),
(o = this._setAdditiveIdentityQuaternion),
(this.buffer = new Float64Array(i * 6)),
(this._workIndex = 5))
break
case 'string':
case 'bool':
;((r = this._select),
(s = this._select),
(o = this._setAdditiveIdentityOther),
(this.buffer = new Array(i * 5)))
break
default:
;((r = this._lerp),
(s = this._lerpAdditive),
(o = this._setAdditiveIdentityNumeric),
(this.buffer = new Float64Array(i * 5)))
}
;((this._mixBufferRegion = r),
(this._mixBufferRegionAdditive = s),
(this._setIdentity = o),
(this._origIndex = 3),
(this._addIndex = 4),
(this.cumulativeWeight = 0),
(this.cumulativeWeightAdditive = 0),
(this.useCount = 0),
(this.referenceCount = 0))
}
accumulate(e, t) {
const i = this.buffer,
r = this.valueSize,
s = e * r + r
let o = this.cumulativeWeight
if (o === 0) {
for (let a = 0; a !== r; ++a) i[s + a] = i[a]
o = t
} else {
o += t
const a = t / o
this._mixBufferRegion(i, s, 0, a, r)
}
this.cumulativeWeight = o
}
accumulateAdditive(e) {
const t = this.buffer,
i = this.valueSize,
r = i * this._addIndex
;(this.cumulativeWeightAdditive === 0 && this._setIdentity(),
this._mixBufferRegionAdditive(t, r, 0, e, i),
(this.cumulativeWeightAdditive += e))
}
apply(e) {
const t = this.valueSize,
i = this.buffer,
r = e * t + t,
s = this.cumulativeWeight,
o = this.cumulativeWeightAdditive,
a = this.binding
if (((this.cumulativeWeight = 0), (this.cumulativeWeightAdditive = 0), s < 1)) {
const l = t * this._origIndex
this._mixBufferRegion(i, r, l, 1 - s, t)
}
o > 0 && this._mixBufferRegionAdditive(i, r, this._addIndex * t, 1, t)
for (let l = t, c = t + t; l !== c; ++l)
if (i[l] !== i[l + t]) {
a.setValue(i, r)
break
}
}
saveOriginalState() {
const e = this.binding,
t = this.buffer,
i = this.valueSize,
r = i * this._origIndex
e.getValue(t, r)
for (let s = i, o = r; s !== o; ++s) t[s] = t[r + (s % i)]
;(this._setIdentity(), (this.cumulativeWeight = 0), (this.cumulativeWeightAdditive = 0))
}
restoreOriginalState() {
const e = this.valueSize * 3
this.binding.setValue(this.buffer, e)
}
_setAdditiveIdentityNumeric() {
const e = this._addIndex * this.valueSize,
t = e + this.valueSize
for (let i = e; i < t; i++) this.buffer[i] = 0
}
_setAdditiveIdentityQuaternion() {
;(this._setAdditiveIdentityNumeric(), (this.buffer[this._addIndex * this.valueSize + 3] = 1))
}
_setAdditiveIdentityOther() {
const e = this._origIndex * this.valueSize,
t = this._addIndex * this.valueSize
for (let i = 0; i < this.valueSize; i++) this.buffer[t + i] = this.buffer[e + i]
}
_select(e, t, i, r, s) {
if (r >= 0.5) for (let o = 0; o !== s; ++o) e[t + o] = e[i + o]
}
_slerp(e, t, i, r) {
Qt.slerpFlat(e, t, e, t, e, i, r)
}
_slerpAdditive(e, t, i, r, s) {
const o = this._workIndex * s
;(Qt.multiplyQuaternionsFlat(e, o, e, t, e, i), Qt.slerpFlat(e, t, e, t, e, o, r))
}
_lerp(e, t, i, r, s) {
const o = 1 - r
for (let a = 0; a !== s; ++a) {
const l = t + a
e[l] = e[l] * o + e[i + a] * r
}
}
_lerpAdditive(e, t, i, r, s) {
for (let o = 0; o !== s; ++o) {
const a = t + o
e[a] = e[a] + e[i + o] * r
}
}
}
const N_ = '\\[\\]\\.:\\/',
HL = new RegExp('[' + N_ + ']', 'g'),
P_ = '[^' + N_ + ']',
$L = '[^' + N_.replace('\\.', '') + ']',
GL = /((?:WC+[\/:])*)/.source.replace('WC', P_),
WL = /(WCOD+)?/.source.replace('WCOD', $L),
QL = /(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace('WC', P_),
jL = /\.(WC+)(?:\[(.+)\])?/.source.replace('WC', P_),
qL = new RegExp('^' + GL + WL + QL + jL + '$'),
XL = ['material', 'materials', 'bones', 'map']
class KL {
constructor(e, t, i) {
const r = i || tn.parseTrackName(t)
;((this._targetGroup = e), (this._bindings = e.subscribe_(t, r)))
}
getValue(e, t) {
this.bind()
const i = this._targetGroup.nCachedObjects_,
r = this._bindings[i]
r !== void 0 && r.getValue(e, t)
}
setValue(e, t) {
const i = this._bindings
for (let r = this._targetGroup.nCachedObjects_, s = i.length; r !== s; ++r) i[r].setValue(e, t)
}
bind() {
const e = this._bindings
for (let t = this._targetGroup.nCachedObjects_, i = e.length; t !== i; ++t) e[t].bind()
}
unbind() {
const e = this._bindings
for (let t = this._targetGroup.nCachedObjects_, i = e.length; t !== i; ++t) e[t].unbind()
}
}
class tn {
constructor(e, t, i) {
;((this.path = t),
(this.parsedPath = i || tn.parseTrackName(t)),
(this.node = tn.findNode(e, this.parsedPath.nodeName)),
(this.rootNode = e),
(this.getValue = this._getValue_unbound),
(this.setValue = this._setValue_unbound))
}
static create(e, t, i) {
return e && e.isAnimationObjectGroup ? new tn.Composite(e, t, i) : new tn(e, t, i)
}
static sanitizeNodeName(e) {
return e.replace(/\s/g, '_').replace(HL, '')
}
static parseTrackName(e) {
const t = qL.exec(e)
if (t === null) throw new Error('PropertyBinding: Cannot parse trackName: ' + e)
const i = {
nodeName: t[2],
objectName: t[3],
objectIndex: t[4],
propertyName: t[5],
propertyIndex: t[6],
},
r = i.nodeName && i.nodeName.lastIndexOf('.')
if (r !== void 0 && r !== -1) {
const s = i.nodeName.substring(r + 1)
XL.indexOf(s) !== -1 && ((i.nodeName = i.nodeName.substring(0, r)), (i.objectName = s))
}
if (i.propertyName === null || i.propertyName.length === 0)
throw new Error('PropertyBinding: can not parse propertyName from trackName: ' + e)
return i
}
static findNode(e, t) {
if (t === void 0 || t === '' || t === '.' || t === -1 || t === e.name || t === e.uuid) return e
if (e.skeleton) {
const i = e.skeleton.getBoneByName(t)
if (i !== void 0) return i
}
if (e.children) {
const i = function (s) {
for (let o = 0; o < s.length; o++) {
const a = s[o]
if (a.name === t || a.uuid === t) return a
const l = i(a.children)
if (l) return l
}
return null
},
r = i(e.children)
if (r) return r
}
return null
}
_getValue_unavailable() {}
_setValue_unavailable() {}
_getValue_direct(e, t) {
e[t] = this.targetObject[this.propertyName]
}
_getValue_array(e, t) {
const i = this.resolvedProperty
for (let r = 0, s = i.length; r !== s; ++r) e[t++] = i[r]
}
_getValue_arrayElement(e, t) {
e[t] = this.resolvedProperty[this.propertyIndex]
}
_getValue_toArray(e, t) {
this.resolvedProperty.toArray(e, t)
}
_setValue_direct(e, t) {
this.targetObject[this.propertyName] = e[t]
}
_setValue_direct_setNeedsUpdate(e, t) {
;((this.targetObject[this.propertyName] = e[t]), (this.targetObject.needsUpdate = !0))
}
_setValue_direct_setMatrixWorldNeedsUpdate(e, t) {
;((this.targetObject[this.propertyName] = e[t]),
(this.targetObject.matrixWorldNeedsUpdate = !0))
}
_setValue_array(e, t) {
const i = this.resolvedProperty
for (let r = 0, s = i.length; r !== s; ++r) i[r] = e[t++]
}
_setValue_array_setNeedsUpdate(e, t) {
const i = this.resolvedProperty
for (let r = 0, s = i.length; r !== s; ++r) i[r] = e[t++]
this.targetObject.needsUpdate = !0
}
_setValue_array_setMatrixWorldNeedsUpdate(e, t) {
const i = this.resolvedProperty
for (let r = 0, s = i.length; r !== s; ++r) i[r] = e[t++]
this.targetObject.matrixWorldNeedsUpdate = !0
}
_setValue_arrayElement(e, t) {
this.resolvedProperty[this.propertyIndex] = e[t]
}
_setValue_arrayElement_setNeedsUpdate(e, t) {
;((this.resolvedProperty[this.propertyIndex] = e[t]), (this.targetObject.needsUpdate = !0))
}
_setValue_arrayElement_setMatrixWorldNeedsUpdate(e, t) {
;((this.resolvedProperty[this.propertyIndex] = e[t]),
(this.targetObject.matrixWorldNeedsUpdate = !0))
}
_setValue_fromArray(e, t) {
this.resolvedProperty.fromArray(e, t)
}
_setValue_fromArray_setNeedsUpdate(e, t) {
;(this.resolvedProperty.fromArray(e, t), (this.targetObject.needsUpdate = !0))
}
_setValue_fromArray_setMatrixWorldNeedsUpdate(e, t) {
;(this.resolvedProperty.fromArray(e, t), (this.targetObject.matrixWorldNeedsUpdate = !0))
}
_getValue_unbound(e, t) {
;(this.bind(), this.getValue(e, t))
}
_setValue_unbound(e, t) {
;(this.bind(), this.setValue(e, t))
}
bind() {
let e = this.node
const t = this.parsedPath,
i = t.objectName,
r = t.propertyName
let s = t.propertyIndex
if (
(e || ((e = tn.findNode(this.rootNode, t.nodeName)), (this.node = e)),
(this.getValue = this._getValue_unavailable),
(this.setValue = this._setValue_unavailable),
!e)
) {
console.warn('THREE.PropertyBinding: No target node found for track: ' + this.path + '.')
return
}
if (i) {
let c = t.objectIndex
switch (i) {
case 'materials':
if (!e.material) {
console.error(
'THREE.PropertyBinding: Can not bind to material as node does not have a material.',
this
)
return
}
if (!e.material.materials) {
console.error(
'THREE.PropertyBinding: Can not bind to material.materials as node.material does not have a materials array.',
this
)
return
}
e = e.material.materials
break
case 'bones':
if (!e.skeleton) {
console.error(
'THREE.PropertyBinding: Can not bind to bones as node does not have a skeleton.',
this
)
return
}
e = e.skeleton.bones
for (let u = 0; u < e.length; u++)
if (e[u].name === c) {
c = u
break
}
break
case 'map':
if ('map' in e) {
e = e.map
break
}
if (!e.material) {
console.error(
'THREE.PropertyBinding: Can not bind to material as node does not have a material.',
this
)
return
}
if (!e.material.map) {
console.error(
'THREE.PropertyBinding: Can not bind to material.map as node.material does not have a map.',
this
)
return
}
e = e.material.map
break
default:
if (e[i] === void 0) {
console.error(
'THREE.PropertyBinding: Can not bind to objectName of node undefined.',
this
)
return
}
e = e[i]
}
if (c !== void 0) {
if (e[c] === void 0) {
console.error(
'THREE.PropertyBinding: Trying to bind to objectIndex of objectName, but is undefined.',
this,
e
)
return
}
e = e[c]
}
}
const o = e[r]
if (o === void 0) {
const c = t.nodeName
console.error(
'THREE.PropertyBinding: Trying to update property for track: ' +
c +
'.' +
r +
" but it wasn't found.",
e
)
return
}
let a = this.Versioning.None
;((this.targetObject = e),
e.isMaterial === !0
? (a = this.Versioning.NeedsUpdate)
: e.isObject3D === !0 && (a = this.Versioning.MatrixWorldNeedsUpdate))
let l = this.BindingType.Direct
if (s !== void 0) {
if (r === 'morphTargetInfluences') {
if (!e.geometry) {
console.error(
'THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.',
this
)
return
}
if (!e.geometry.morphAttributes) {
console.error(
'THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.morphAttributes.',
this
)
return
}
e.morphTargetDictionary[s] !== void 0 && (s = e.morphTargetDictionary[s])
}
;((l = this.BindingType.ArrayElement), (this.resolvedProperty = o), (this.propertyIndex = s))
} else
o.fromArray !== void 0 && o.toArray !== void 0
? ((l = this.BindingType.HasFromToArray), (this.resolvedProperty = o))
: Array.isArray(o)
? ((l = this.BindingType.EntireArray), (this.resolvedProperty = o))
: (this.propertyName = r)
;((this.getValue = this.GetterByBindingType[l]),
(this.setValue = this.SetterByBindingTypeAndVersioning[l][a]))
}
unbind() {
;((this.node = null),
(this.getValue = this._getValue_unbound),
(this.setValue = this._setValue_unbound))
}
}
tn.Composite = KL
tn.prototype.BindingType = { Direct: 0, EntireArray: 1, ArrayElement: 2, HasFromToArray: 3 }
tn.prototype.Versioning = { None: 0, NeedsUpdate: 1, MatrixWorldNeedsUpdate: 2 }
tn.prototype.GetterByBindingType = [
tn.prototype._getValue_direct,
tn.prototype._getValue_array,
tn.prototype._getValue_arrayElement,
tn.prototype._getValue_toArray,
]
tn.prototype.SetterByBindingTypeAndVersioning = [
[
tn.prototype._setValue_direct,
tn.prototype._setValue_direct_setNeedsUpdate,
tn.prototype._setValue_direct_setMatrixWorldNeedsUpdate,
],
[
tn.prototype._setValue_array,
tn.prototype._setValue_array_setNeedsUpdate,
tn.prototype._setValue_array_setMatrixWorldNeedsUpdate,
],
[
tn.prototype._setValue_arrayElement,
tn.prototype._setValue_arrayElement_setNeedsUpdate,
tn.prototype._setValue_arrayElement_setMatrixWorldNeedsUpdate,
],
[
tn.prototype._setValue_fromArray,
tn.prototype._setValue_fromArray_setNeedsUpdate,
tn.prototype._setValue_fromArray_setMatrixWorldNeedsUpdate,
],
]
class YL {
constructor(e, t, i = null, r = t.blendMode) {
;((this._mixer = e), (this._clip = t), (this._localRoot = i), (this.blendMode = r))
const s = t.tracks,
o = s.length,
a = new Array(o),
l = { endingStart: Lc, endingEnd: Lc }
for (let c = 0; c !== o; ++c) {
const u = s[c].createInterpolant(null)
;((a[c] = u), (u.settings = l))
}
;((this._interpolantSettings = l),
(this._interpolants = a),
(this._propertyBindings = new Array(o)),
(this._cacheIndex = null),
(this._byClipCacheIndex = null),
(this._timeScaleInterpolant = null),
(this._weightInterpolant = null),
(this.loop = zl),
(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))
}
play() {
return (this._mixer._activateAction(this), this)
}
stop() {
return (this._mixer._deactivateAction(this), this.reset())
}
reset() {
return (
(this.paused = !1),
(this.enabled = !0),
(this.time = 0),
(this._loopCount = -1),
(this._startTime = null),
this.stopFading().stopWarping()
)
}
isRunning() {
return (
this.enabled &&
!this.paused &&
this.timeScale !== 0 &&
this._startTime === null &&
this._mixer._isActiveAction(this)
)
}
isScheduled() {
return this._mixer._isActiveAction(this)
}
startAt(e) {
return ((this._startTime = e), this)
}
setLoop(e, t) {
return ((this.loop = e), (this.repetitions = t), this)
}
setEffectiveWeight(e) {
return ((this.weight = e), (this._effectiveWeight = this.enabled ? e : 0), this.stopFading())
}
getEffectiveWeight() {
return this._effectiveWeight
}
fadeIn(e) {
return this._scheduleFading(e, 0, 1)
}
fadeOut(e) {
return this._scheduleFading(e, 1, 0)
}
crossFadeFrom(e, t, i) {
if ((e.fadeOut(t), this.fadeIn(t), i)) {
const r = this._clip.duration,
s = e._clip.duration,
o = s / r,
a = r / s
;(e.warp(1, o, t), this.warp(a, 1, t))
}
return this
}
crossFadeTo(e, t, i) {
return e.crossFadeFrom(this, t, i)
}
stopFading() {
const e = this._weightInterpolant
return (
e !== null && ((this._weightInterpolant = null), this._mixer._takeBackControlInterpolant(e)),
this
)
}
setEffectiveTimeScale(e) {
return (
(this.timeScale = e),
(this._effectiveTimeScale = this.paused ? 0 : e),
this.stopWarping()
)
}
getEffectiveTimeScale() {
return this._effectiveTimeScale
}
setDuration(e) {
return ((this.timeScale = this._clip.duration / e), this.stopWarping())
}
syncWith(e) {
return ((this.time = e.time), (this.timeScale = e.timeScale), this.stopWarping())
}
halt(e) {
return this.warp(this._effectiveTimeScale, 0, e)
}
warp(e, t, i) {
const r = this._mixer,
s = r.time,
o = this.timeScale
let a = this._timeScaleInterpolant
a === null && ((a = r._lendControlInterpolant()), (this._timeScaleInterpolant = a))
const l = a.parameterPositions,
c = a.sampleValues
return ((l[0] = s), (l[1] = s + i), (c[0] = e / o), (c[1] = t / o), this)
}
stopWarping() {
const e = this._timeScaleInterpolant
return (
e !== null &&
((this._timeScaleInterpolant = null), this._mixer._takeBackControlInterpolant(e)),
this
)
}
getMixer() {
return this._mixer
}
getClip() {
return this._clip
}
getRoot() {
return this._localRoot || this._mixer._root
}
_update(e, t, i, r) {
if (!this.enabled) {
this._updateWeight(e)
return
}
const s = this._startTime
if (s !== null) {
const l = (e - s) * i
l < 0 || i === 0 ? (t = 0) : ((this._startTime = null), (t = i * l))
}
t *= this._updateTimeScale(e)
const o = this._updateTime(t),
a = this._updateWeight(e)
if (a > 0) {
const l = this._interpolants,
c = this._propertyBindings
switch (this.blendMode) {
case rP:
for (let u = 0, d = l.length; u !== d; ++u) (l[u].evaluate(o), c[u].accumulateAdditive(a))
break
case S_:
default:
for (let u = 0, d = l.length; u !== d; ++u) (l[u].evaluate(o), c[u].accumulate(r, a))
}
}
}
_updateWeight(e) {
let t = 0
if (this.enabled) {
t = this.weight
const i = this._weightInterpolant
if (i !== null) {
const r = i.evaluate(e)[0]
;((t *= r),
e > i.parameterPositions[1] && (this.stopFading(), r === 0 && (this.enabled = !1)))
}
}
return ((this._effectiveWeight = t), t)
}
_updateTimeScale(e) {
let t = 0
if (!this.paused) {
t = this.timeScale
const i = this._timeScaleInterpolant
if (i !== null) {
const r = i.evaluate(e)[0]
;((t *= r),
e > i.parameterPositions[1] &&
(this.stopWarping(), t === 0 ? (this.paused = !0) : (this.timeScale = t)))
}
}
return ((this._effectiveTimeScale = t), t)
}
_updateTime(e) {
const t = this._clip.duration,
i = this.loop
let r = this.time + e,
s = this._loopCount
const o = i === iP
if (e === 0) return s === -1 ? r : o && (s & 1) === 1 ? t - r : r
if (i === Jr) {
s === -1 && ((this._loopCount = 0), this._setEndings(!0, !0, !1))
e: {
if (r >= t) r = t
else if (r < 0) r = 0
else {
this.time = r
break e
}
;(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 (
(s === -1 &&
(e >= 0
? ((s = 0), this._setEndings(!0, this.repetitions === 0, o))
: this._setEndings(this.repetitions === 0, !0, o)),
r >= t || r < 0)
) {
const a = Math.floor(r / t)
;((r -= t * a), (s += Math.abs(a)))
const l = this.repetitions - s
if (l <= 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 (l === 1) {
const c = e < 0
this._setEndings(c, !c, o)
} else this._setEndings(!1, !1, o)
;((this._loopCount = s),
(this.time = r),
this._mixer.dispatchEvent({ type: 'loop', action: this, loopDelta: a }))
}
} else this.time = r
if (o && (s & 1) === 1) return t - r
}
return r
}
_setEndings(e, t, i) {
const r = this._interpolantSettings
i
? ((r.endingStart = Dc), (r.endingEnd = Dc))
: (e ? (r.endingStart = this.zeroSlopeAtStart ? Dc : Lc) : (r.endingStart = dm),
t ? (r.endingEnd = this.zeroSlopeAtEnd ? Dc : Lc) : (r.endingEnd = dm))
}
_scheduleFading(e, t, i) {
const r = this._mixer,
s = r.time
let o = this._weightInterpolant
o === null && ((o = r._lendControlInterpolant()), (this._weightInterpolant = o))
const a = o.parameterPositions,
l = o.sampleValues
return ((a[0] = s), (l[0] = t), (a[1] = s + e), (l[1] = i), this)
}
}
const ZL = new Float32Array(1)
class JL extends so {
constructor(e) {
;(super(),
(this._root = e),
this._initMemoryManager(),
(this._accuIndex = 0),
(this.time = 0),
(this.timeScale = 1))
}
_bindAction(e, t) {
const i = e._localRoot || this._root,
r = e._clip.tracks,
s = r.length,
o = e._propertyBindings,
a = e._interpolants,
l = i.uuid,
c = this._bindingsByRootAndName
let u = c[l]
u === void 0 && ((u = {}), (c[l] = u))
for (let d = 0; d !== s; ++d) {
const h = r[d],
f = h.name
let p = u[f]
if (p !== void 0) (++p.referenceCount, (o[d] = p))
else {
if (((p = o[d]), p !== void 0)) {
p._cacheIndex === null && (++p.referenceCount, this._addInactiveBinding(p, l, f))
continue
}
const g = t && t._propertyBindings[d].binding.parsedPath
;((p = new VL(tn.create(i, f, g), h.ValueTypeName, h.getValueSize())),
++p.referenceCount,
this._addInactiveBinding(p, l, f),
(o[d] = p))
}
a[d].resultBuffer = p.buffer
}
}
_activateAction(e) {
if (!this._isActiveAction(e)) {
if (e._cacheIndex === null) {
const i = (e._localRoot || this._root).uuid,
r = e._clip.uuid,
s = this._actionsByClip[r]
;(this._bindAction(e, s && s.knownActions[0]), this._addInactiveAction(e, r, i))
}
const t = e._propertyBindings
for (let i = 0, r = t.length; i !== r; ++i) {
const s = t[i]
s.useCount++ === 0 && (this._lendBinding(s), s.saveOriginalState())
}
this._lendAction(e)
}
}
_deactivateAction(e) {
if (this._isActiveAction(e)) {
const t = e._propertyBindings
for (let i = 0, r = t.length; i !== r; ++i) {
const s = t[i]
--s.useCount === 0 && (s.restoreOriginalState(), this._takeBackBinding(s))
}
this._takeBackAction(e)
}
}
_initMemoryManager() {
;((this._actions = []),
(this._nActiveActions = 0),
(this._actionsByClip = {}),
(this._bindings = []),
(this._nActiveBindings = 0),
(this._bindingsByRootAndName = {}),
(this._controlInterpolants = []),
(this._nActiveControlInterpolants = 0))
const 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
},
},
}
}
_isActiveAction(e) {
const t = e._cacheIndex
return t !== null && t < this._nActiveActions
}
_addInactiveAction(e, t, i) {
const r = this._actions,
s = this._actionsByClip
let o = s[t]
if (o === void 0)
((o = { knownActions: [e], actionByRoot: {} }), (e._byClipCacheIndex = 0), (s[t] = o))
else {
const a = o.knownActions
;((e._byClipCacheIndex = a.length), a.push(e))
}
;((e._cacheIndex = r.length), r.push(e), (o.actionByRoot[i] = e))
}
_removeInactiveAction(e) {
const t = this._actions,
i = t[t.length - 1],
r = e._cacheIndex
;((i._cacheIndex = r), (t[r] = i), t.pop(), (e._cacheIndex = null))
const s = e._clip.uuid,
o = this._actionsByClip,
a = o[s],
l = a.knownActions,
c = l[l.length - 1],
u = e._byClipCacheIndex
;((c._byClipCacheIndex = u), (l[u] = c), l.pop(), (e._byClipCacheIndex = null))
const d = a.actionByRoot,
h = (e._localRoot || this._root).uuid
;(delete d[h], l.length === 0 && delete o[s], this._removeInactiveBindingsForAction(e))
}
_removeInactiveBindingsForAction(e) {
const t = e._propertyBindings
for (let i = 0, r = t.length; i !== r; ++i) {
const s = t[i]
--s.referenceCount === 0 && this._removeInactiveBinding(s)
}
}
_lendAction(e) {
const t = this._actions,
i = e._cacheIndex,
r = this._nActiveActions++,
s = t[r]
;((e._cacheIndex = r), (t[r] = e), (s._cacheIndex = i), (t[i] = s))
}
_takeBackAction(e) {
const t = this._actions,
i = e._cacheIndex,
r = --this._nActiveActions,
s = t[r]
;((e._cacheIndex = r), (t[r] = e), (s._cacheIndex = i), (t[i] = s))
}
_addInactiveBinding(e, t, i) {
const r = this._bindingsByRootAndName,
s = this._bindings
let o = r[t]
;(o === void 0 && ((o = {}), (r[t] = o)), (o[i] = e), (e._cacheIndex = s.length), s.push(e))
}
_removeInactiveBinding(e) {
const t = this._bindings,
i = e.binding,
r = i.rootNode.uuid,
s = i.path,
o = this._bindingsByRootAndName,
a = o[r],
l = t[t.length - 1],
c = e._cacheIndex
;((l._cacheIndex = c),
(t[c] = l),
t.pop(),
delete a[s],
Object.keys(a).length === 0 && delete o[r])
}
_lendBinding(e) {
const t = this._bindings,
i = e._cacheIndex,
r = this._nActiveBindings++,
s = t[r]
;((e._cacheIndex = r), (t[r] = e), (s._cacheIndex = i), (t[i] = s))
}
_takeBackBinding(e) {
const t = this._bindings,
i = e._cacheIndex,
r = --this._nActiveBindings,
s = t[r]
;((e._cacheIndex = r), (t[r] = e), (s._cacheIndex = i), (t[i] = s))
}
_lendControlInterpolant() {
const e = this._controlInterpolants,
t = this._nActiveControlInterpolants++
let i = e[t]
return (
i === void 0 &&
((i = new $5(new Float32Array(2), new Float32Array(2), 1, ZL)),
(i.__cacheIndex = t),
(e[t] = i)),
i
)
}
_takeBackControlInterpolant(e) {
const t = this._controlInterpolants,
i = e.__cacheIndex,
r = --this._nActiveControlInterpolants,
s = t[r]
;((e.__cacheIndex = r), (t[r] = e), (s.__cacheIndex = i), (t[i] = s))
}
clipAction(e, t, i) {
const r = t || this._root,
s = r.uuid
let o = typeof e == 'string' ? ky.findByName(r, e) : e
const a = o !== null ? o.uuid : e,
l = this._actionsByClip[a]
let c = null
if ((i === void 0 && (o !== null ? (i = o.blendMode) : (i = S_)), l !== void 0)) {
const d = l.actionByRoot[s]
if (d !== void 0 && d.blendMode === i) return d
;((c = l.knownActions[0]), o === null && (o = c._clip))
}
if (o === null) return null
const u = new YL(this, o, t, i)
return (this._bindAction(u, c), this._addInactiveAction(u, a, s), u)
}
existingAction(e, t) {
const i = t || this._root,
r = i.uuid,
s = typeof e == 'string' ? ky.findByName(i, e) : e,
o = s ? s.uuid : e,
a = this._actionsByClip[o]
return (a !== void 0 && a.actionByRoot[r]) || null
}
stopAllAction() {
const e = this._actions,
t = this._nActiveActions
for (let i = t - 1; i >= 0; --i) e[i].stop()
return this
}
update(e) {
e *= this.timeScale
const t = this._actions,
i = this._nActiveActions,
r = (this.time += e),
s = Math.sign(e),
o = (this._accuIndex ^= 1)
for (let c = 0; c !== i; ++c) t[c]._update(r, e, s, o)
const a = this._bindings,
l = this._nActiveBindings
for (let c = 0; c !== l; ++c) a[c].apply(o)
return this
}
setTime(e) {
this.time = 0
for (let t = 0; t < this._actions.length; t++) this._actions[t].time = 0
return this.update(e)
}
getRoot() {
return this._root
}
uncacheClip(e) {
const t = this._actions,
i = e.uuid,
r = this._actionsByClip,
s = r[i]
if (s !== void 0) {
const o = s.knownActions
for (let a = 0, l = o.length; a !== l; ++a) {
const c = o[a]
this._deactivateAction(c)
const u = c._cacheIndex,
d = t[t.length - 1]
;((c._cacheIndex = null),
(c._byClipCacheIndex = null),
(d._cacheIndex = u),
(t[u] = d),
t.pop(),
this._removeInactiveBindingsForAction(c))
}
delete r[i]
}
}
uncacheRoot(e) {
const t = e.uuid,
i = this._actionsByClip
for (const o in i) {
const a = i[o].actionByRoot,
l = a[t]
l !== void 0 && (this._deactivateAction(l), this._removeInactiveAction(l))
}
const r = this._bindingsByRootAndName,
s = r[t]
if (s !== void 0)
for (const o in s) {
const a = s[o]
;(a.restoreOriginalState(), this._removeInactiveBinding(a))
}
}
uncacheAction(e, t) {
const i = this.existingAction(e, t)
i !== null && (this._deactivateAction(i), this._removeInactiveAction(i))
}
}
class eD extends T_ {
constructor(e, t, i = 1) {
;(super(e, t), (this.isInstancedInterleavedBuffer = !0), (this.meshPerAttribute = i))
}
copy(e) {
return (super.copy(e), (this.meshPerAttribute = e.meshPerAttribute), this)
}
clone(e) {
const t = super.clone(e)
return ((t.meshPerAttribute = this.meshPerAttribute), t)
}
toJSON(e) {
const t = super.toJSON(e)
return ((t.isInstancedInterleavedBuffer = !0), (t.meshPerAttribute = this.meshPerAttribute), t)
}
}
class lA {
constructor(e = 1, t = 0, i = 0) {
return ((this.radius = e), (this.phi = t), (this.theta = i), this)
}
set(e, t, i) {
return ((this.radius = e), (this.phi = t), (this.theta = i), this)
}
copy(e) {
return ((this.radius = e.radius), (this.phi = e.phi), (this.theta = e.theta), this)
}
makeSafe() {
return ((this.phi = Nt(this.phi, 1e-6, Math.PI - 1e-6)), this)
}
setFromVector3(e) {
return this.setFromCartesianCoords(e.x, e.y, e.z)
}
setFromCartesianCoords(e, t, i) {
return (
(this.radius = Math.sqrt(e * e + t * t + i * i)),
this.radius === 0
? ((this.theta = 0), (this.phi = 0))
: ((this.theta = Math.atan2(e, i)), (this.phi = Math.acos(Nt(t / this.radius, -1, 1)))),
this
)
}
clone() {
return new this.constructor().copy(this)
}
}
class L_ {
constructor(e, t, i, r) {
;((L_.prototype.isMatrix2 = !0),
(this.elements = [1, 0, 0, 1]),
e !== void 0 && this.set(e, t, i, r))
}
identity() {
return (this.set(1, 0, 0, 1), this)
}
fromArray(e, t = 0) {
for (let i = 0; i < 4; i++) this.elements[i] = e[i + t]
return this
}
set(e, t, i, r) {
const s = this.elements
return ((s[0] = e), (s[2] = t), (s[1] = i), (s[3] = r), this)
}
}
function cA(n, e, t, i) {
const r = tD(i)
switch (t) {
case S5:
return n * e
case b5:
return n * e
case T5:
return n * e * 2
case __:
return ((n * e) / r.components) * r.byteLength
case s0:
return ((n * e) / r.components) * r.byteLength
case lh:
return ((n * e * 2) / r.components) * r.byteLength
case x_:
return ((n * e * 2) / r.components) * r.byteLength
case A5:
return ((n * e * 3) / r.components) * r.byteLength
case Di:
return ((n * e * 4) / r.components) * r.byteLength
case Co:
return ((n * e * 4) / r.components) * r.byteLength
case Mp:
case Rp:
return Math.floor((n + 3) / 4) * Math.floor((e + 3) / 4) * 8
case Ip:
case Np:
return Math.floor((n + 3) / 4) * Math.floor((e + 3) / 4) * 16
case hy:
case py:
return (Math.max(n, 16) * Math.max(e, 8)) / 4
case dy:
case fy:
return (Math.max(n, 8) * Math.max(e, 8)) / 2
case my:
case gy:
return Math.floor((n + 3) / 4) * Math.floor((e + 3) / 4) * 8
case yy:
return Math.floor((n + 3) / 4) * Math.floor((e + 3) / 4) * 16
case vy:
return Math.floor((n + 3) / 4) * Math.floor((e + 3) / 4) * 16
case _y:
return Math.floor((n + 4) / 5) * Math.floor((e + 3) / 4) * 16
case xy:
return Math.floor((n + 4) / 5) * Math.floor((e + 4) / 5) * 16
case Sy:
return Math.floor((n + 5) / 6) * Math.floor((e + 4) / 5) * 16
case Ay:
return Math.floor((n + 5) / 6) * Math.floor((e + 5) / 6) * 16
case by:
return Math.floor((n + 7) / 8) * Math.floor((e + 4) / 5) * 16
case Ty:
return Math.floor((n + 7) / 8) * Math.floor((e + 5) / 6) * 16
case wy:
return Math.floor((n + 7) / 8) * Math.floor((e + 7) / 8) * 16
case Cy:
return Math.floor((n + 9) / 10) * Math.floor((e + 4) / 5) * 16
case Ey:
return Math.floor((n + 9) / 10) * Math.floor((e + 5) / 6) * 16
case My:
return Math.floor((n + 9) / 10) * Math.floor((e + 7) / 8) * 16
case Ry:
return Math.floor((n + 9) / 10) * Math.floor((e + 9) / 10) * 16
case Iy:
return Math.floor((n + 11) / 12) * Math.floor((e + 9) / 10) * 16
case Ny:
return Math.floor((n + 11) / 12) * Math.floor((e + 11) / 12) * 16
case Pp:
case Py:
case Ly:
return Math.ceil(n / 4) * Math.ceil(e / 4) * 16
case w5:
case Dy:
return Math.ceil(n / 4) * Math.ceil(e / 4) * 8
case Fy:
case Oy:
return Math.ceil(n / 4) * Math.ceil(e / 4) * 16
}
throw new Error('Unable to determine texture byte length for '.concat(t, ' format.'))
}
function tD(n) {
switch (n) {
case eo:
case v5:
return { byteLength: 1, components: 1 }
case ah:
case _5:
case Ts:
return { byteLength: 2, components: 1 }
case y_:
case v_:
return { byteLength: 2, components: 4 }
case Ni:
case r0:
case ir:
return { byteLength: 4, components: 1 }
case x5:
return { byteLength: 4, components: 3 }
}
throw new Error('Unknown texture type '.concat(n, '.'))
}
typeof __THREE_DEVTOOLS__ < 'u' &&
__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent('register', { detail: { revision: m_ } }))
typeof window < 'u' &&
(window.__THREE__
? console.warn('WARNING: Multiple instances of Three.js being imported.')
: (window.__THREE__ = m_))
/**
* @license
* Copyright 2010-2025 Three.js Authors
* SPDX-License-Identifier: MIT
*/ function Q5() {
let n = null,
e = !1,
t = null,
i = null
function r(s, o) {
;(t(s, o), (i = n.requestAnimationFrame(r)))
}
return {
start: function () {
e !== !0 && t !== null && ((i = n.requestAnimationFrame(r)), (e = !0))
},
stop: function () {
;(n.cancelAnimationFrame(i), (e = !1))
},
setAnimationLoop: function (s) {
t = s
},
setContext: function (s) {
n = s
},
}
}
function nD(n) {
const e = new WeakMap()
function t(a, l) {
const c = a.array,
u = a.usage,
d = c.byteLength,
h = n.createBuffer()
;(n.bindBuffer(l, h), n.bufferData(l, c, u), a.onUploadCallback())
let f
if (c instanceof Float32Array) f = n.FLOAT
else if (c instanceof Uint16Array)
a.isFloat16BufferAttribute ? (f = n.HALF_FLOAT) : (f = n.UNSIGNED_SHORT)
else if (c instanceof Int16Array) f = n.SHORT
else if (c instanceof Uint32Array) f = n.UNSIGNED_INT
else if (c instanceof Int32Array) f = n.INT
else if (c instanceof Int8Array) f = n.BYTE
else if (c instanceof Uint8Array) f = n.UNSIGNED_BYTE
else if (c instanceof Uint8ClampedArray) f = n.UNSIGNED_BYTE
else throw new Error('THREE.WebGLAttributes: Unsupported buffer data format: ' + c)
return { buffer: h, type: f, bytesPerElement: c.BYTES_PER_ELEMENT, version: a.version, size: d }
}
function i(a, l, c) {
const u = l.array,
d = l.updateRanges
if ((n.bindBuffer(c, a), d.length === 0)) n.bufferSubData(c, 0, u)
else {
d.sort((f, p) => f.start - p.start)
let h = 0
for (let f = 1; f < d.length; f++) {
const p = d[h],
g = d[f]
g.start <= p.start + p.count + 1
? (p.count = Math.max(p.count, g.start + g.count - p.start))
: (++h, (d[h] = g))
}
d.length = h + 1
for (let f = 0, p = d.length; f < p; f++) {
const g = d[f]
n.bufferSubData(c, g.start * u.BYTES_PER_ELEMENT, u, g.start, g.count)
}
l.clearUpdateRanges()
}
l.onUploadCallback()
}
function r(a) {
return (a.isInterleavedBufferAttribute && (a = a.data), e.get(a))
}
function s(a) {
a.isInterleavedBufferAttribute && (a = a.data)
const l = e.get(a)
l && (n.deleteBuffer(l.buffer), e.delete(a))
}
function o(a, l) {
if ((a.isInterleavedBufferAttribute && (a = a.data), a.isGLBufferAttribute)) {
const u = e.get(a)
;(!u || u.version < a.version) &&
e.set(a, {
buffer: a.buffer,
type: a.type,
bytesPerElement: a.elementSize,
version: a.version,
})
return
}
const c = e.get(a)
if (c === void 0) e.set(a, t(a, l))
else if (c.version < a.version) {
if (c.size !== a.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."
)
;(i(c.buffer, a, l), (c.version = a.version))
}
}
return { get: r, remove: s, update: o }
}
var iD =
'#ifdef USE_ALPHAHASH\n if ( diffuseColor.a < getAlphaHashThreshold( vPosition ) ) discard;\n#endif',
rD =
'#ifdef USE_ALPHAHASH\n const float ALPHA_HASH_SCALE = 0.05;\n float hash2D( vec2 value ) {\n return fract( 1.0e4 * sin( 17.0 * value.x + 0.1 * value.y ) * ( 0.1 + abs( sin( 13.0 * value.y + value.x ) ) ) );\n }\n float hash3D( vec3 value ) {\n return hash2D( vec2( hash2D( value.xy ), value.z ) );\n }\n float getAlphaHashThreshold( vec3 position ) {\n float maxDeriv = max(\n length( dFdx( position.xyz ) ),\n length( dFdy( position.xyz ) )\n );\n float pixScale = 1.0 / ( ALPHA_HASH_SCALE * maxDeriv );\n vec2 pixScales = vec2(\n exp2( floor( log2( pixScale ) ) ),\n exp2( ceil( log2( pixScale ) ) )\n );\n vec2 alpha = vec2(\n hash3D( floor( pixScales.x * position.xyz ) ),\n hash3D( floor( pixScales.y * position.xyz ) )\n );\n float lerpFactor = fract( log2( pixScale ) );\n float x = ( 1.0 - lerpFactor ) * alpha.x + lerpFactor * alpha.y;\n float a = min( lerpFactor, 1.0 - lerpFactor );\n vec3 cases = vec3(\n x * x / ( 2.0 * a * ( 1.0 - a ) ),\n ( x - 0.5 * a ) / ( 1.0 - a ),\n 1.0 - ( ( 1.0 - x ) * ( 1.0 - x ) / ( 2.0 * a * ( 1.0 - a ) ) )\n );\n float threshold = ( x < ( 1.0 - a ) )\n ? ( ( x < a ) ? cases.x : cases.y )\n : cases.z;\n return clamp( threshold , 1.0e-6, 1.0 );\n }\n#endif',
sD = '#ifdef USE_ALPHAMAP\n diffuseColor.a *= texture2D( alphaMap, vAlphaMapUv ).g;\n#endif',
oD = '#ifdef USE_ALPHAMAP\n uniform sampler2D alphaMap;\n#endif',
aD =
'#ifdef USE_ALPHATEST\n #ifdef ALPHA_TO_COVERAGE\n diffuseColor.a = smoothstep( alphaTest, alphaTest + fwidth( diffuseColor.a ), diffuseColor.a );\n if ( diffuseColor.a == 0.0 ) discard;\n #else\n if ( diffuseColor.a < alphaTest ) discard;\n #endif\n#endif',
lD = '#ifdef USE_ALPHATEST\n uniform float alphaTest;\n#endif',
cD =
'#ifdef USE_AOMAP\n float ambientOcclusion = ( texture2D( aoMap, vAoMapUv ).r - 1.0 ) * aoMapIntensity + 1.0;\n reflectedLight.indirectDiffuse *= ambientOcclusion;\n #if defined( USE_CLEARCOAT ) \n clearcoatSpecularIndirect *= ambientOcclusion;\n #endif\n #if defined( USE_SHEEN ) \n sheenSpecularIndirect *= ambientOcclusion;\n #endif\n #if defined( USE_ENVMAP ) && defined( STANDARD )\n float dotNV = saturate( dot( geometryNormal, geometryViewDir ) );\n reflectedLight.indirectSpecular *= computeSpecularOcclusion( dotNV, ambientOcclusion, material.roughness );\n #endif\n#endif',
uD = '#ifdef USE_AOMAP\n uniform sampler2D aoMap;\n uniform float aoMapIntensity;\n#endif',
dD =
'#ifdef USE_BATCHING\n #if ! defined( GL_ANGLE_multi_draw )\n #define gl_DrawID _gl_DrawID\n uniform int _gl_DrawID;\n #endif\n uniform highp sampler2D batchingTexture;\n uniform highp usampler2D batchingIdTexture;\n mat4 getBatchingMatrix( const in float i ) {\n int size = textureSize( batchingTexture, 0 ).x;\n int j = int( i ) * 4;\n int x = j % size;\n int y = j / size;\n vec4 v1 = texelFetch( batchingTexture, ivec2( x, y ), 0 );\n vec4 v2 = texelFetch( batchingTexture, ivec2( x + 1, y ), 0 );\n vec4 v3 = texelFetch( batchingTexture, ivec2( x + 2, y ), 0 );\n vec4 v4 = texelFetch( batchingTexture, ivec2( x + 3, y ), 0 );\n return mat4( v1, v2, v3, v4 );\n }\n float getIndirectIndex( const in int i ) {\n int size = textureSize( batchingIdTexture, 0 ).x;\n int x = i % size;\n int y = i / size;\n return float( texelFetch( batchingIdTexture, ivec2( x, y ), 0 ).r );\n }\n#endif\n#ifdef USE_BATCHING_COLOR\n uniform sampler2D batchingColorTexture;\n vec3 getBatchingColor( const in float i ) {\n int size = textureSize( batchingColorTexture, 0 ).x;\n int j = int( i );\n int x = j % size;\n int y = j / size;\n return texelFetch( batchingColorTexture, ivec2( x, y ), 0 ).rgb;\n }\n#endif',
hD =
'#ifdef USE_BATCHING\n mat4 batchingMatrix = getBatchingMatrix( getIndirectIndex( gl_DrawID ) );\n#endif',
fD =
'vec3 transformed = vec3( position );\n#ifdef USE_ALPHAHASH\n vPosition = vec3( position );\n#endif',
pD =
'vec3 objectNormal = vec3( normal );\n#ifdef USE_TANGENT\n vec3 objectTangent = vec3( tangent.xyz );\n#endif',
mD =
'float G_BlinnPhong_Implicit( ) {\n return 0.25;\n}\nfloat D_BlinnPhong( const in float shininess, const in float dotNH ) {\n return 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 vec3 halfDir = normalize( lightDir + viewDir );\n float dotNH = saturate( dot( normal, halfDir ) );\n float dotVH = saturate( dot( viewDir, halfDir ) );\n vec3 F = F_Schlick( specularColor, 1.0, dotVH );\n float G = G_BlinnPhong_Implicit( );\n float D = D_BlinnPhong( shininess, dotNH );\n return F * ( G * D );\n} // validated',
gD =
'#ifdef USE_IRIDESCENCE\n const mat3 XYZ_TO_REC709 = mat3(\n 3.2404542, -0.9692660, 0.0556434,\n -1.5371385, 1.8760108, -0.2040259,\n -0.4985314, 0.0415560, 1.0572252\n );\n vec3 Fresnel0ToIor( vec3 fresnel0 ) {\n vec3 sqrtF0 = sqrt( fresnel0 );\n return ( vec3( 1.0 ) + sqrtF0 ) / ( vec3( 1.0 ) - sqrtF0 );\n }\n vec3 IorToFresnel0( vec3 transmittedIor, float incidentIor ) {\n return pow2( ( transmittedIor - vec3( incidentIor ) ) / ( transmittedIor + vec3( incidentIor ) ) );\n }\n float IorToFresnel0( float transmittedIor, float incidentIor ) {\n return pow2( ( transmittedIor - incidentIor ) / ( transmittedIor + incidentIor ));\n }\n vec3 evalSensitivity( float OPD, vec3 shift ) {\n float phase = 2.0 * PI * OPD * 1.0e-9;\n vec3 val = vec3( 5.4856e-13, 4.4201e-13, 5.2481e-13 );\n vec3 pos = vec3( 1.6810e+06, 1.7953e+06, 2.2084e+06 );\n vec3 var = vec3( 4.3278e+09, 9.3046e+09, 6.6121e+09 );\n vec3 xyz = val * sqrt( 2.0 * PI * var ) * cos( pos * phase + shift ) * exp( - pow2( phase ) * var );\n xyz.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 xyz /= 1.0685e-7;\n vec3 rgb = XYZ_TO_REC709 * xyz;\n return rgb;\n }\n vec3 evalIridescence( float outsideIOR, float eta2, float cosTheta1, float thinFilmThickness, vec3 baseF0 ) {\n vec3 I;\n float iridescenceIOR = mix( outsideIOR, eta2, smoothstep( 0.0, 0.03, thinFilmThickness ) );\n float sinTheta2Sq = pow2( outsideIOR / iridescenceIOR ) * ( 1.0 - pow2( cosTheta1 ) );\n float cosTheta2Sq = 1.0 - sinTheta2Sq;\n if ( cosTheta2Sq < 0.0 ) {\n return vec3( 1.0 );\n }\n float cosTheta2 = sqrt( cosTheta2Sq );\n float R0 = IorToFresnel0( iridescenceIOR, outsideIOR );\n float R12 = F_Schlick( R0, 1.0, cosTheta1 );\n float T121 = 1.0 - R12;\n float phi12 = 0.0;\n if ( iridescenceIOR < outsideIOR ) phi12 = PI;\n float phi21 = PI - phi12;\n vec3 baseIOR = Fresnel0ToIor( clamp( baseF0, 0.0, 0.9999 ) ); vec3 R1 = IorToFresnel0( baseIOR, iridescenceIOR );\n vec3 R23 = F_Schlick( R1, 1.0, cosTheta2 );\n vec3 phi23 = vec3( 0.0 );\n if ( baseIOR[ 0 ] < iridescenceIOR ) phi23[ 0 ] = PI;\n if ( baseIOR[ 1 ] < iridescenceIOR ) phi23[ 1 ] = PI;\n if ( baseIOR[ 2 ] < iridescenceIOR ) phi23[ 2 ] = PI;\n float OPD = 2.0 * iridescenceIOR * thinFilmThickness * cosTheta2;\n vec3 phi = vec3( phi21 ) + phi23;\n vec3 R123 = clamp( R12 * R23, 1e-5, 0.9999 );\n vec3 r123 = sqrt( R123 );\n vec3 Rs = pow2( T121 ) * R23 / ( vec3( 1.0 ) - R123 );\n vec3 C0 = R12 + Rs;\n I = C0;\n vec3 Cm = Rs - T121;\n for ( int m = 1; m <= 2; ++ m ) {\n Cm *= r123;\n vec3 Sm = 2.0 * evalSensitivity( float( m ) * OPD, float( m ) * phi );\n I += Cm * Sm;\n }\n return max( I, vec3( 0.0 ) );\n }\n#endif',
yD =
'#ifdef USE_BUMPMAP\n uniform sampler2D bumpMap;\n uniform float bumpScale;\n vec2 dHdxy_fwd() {\n vec2 dSTdx = dFdx( vBumpMapUv );\n vec2 dSTdy = dFdy( vBumpMapUv );\n float Hll = bumpScale * texture2D( bumpMap, vBumpMapUv ).x;\n float dBx = bumpScale * texture2D( bumpMap, vBumpMapUv + dSTdx ).x - Hll;\n float dBy = bumpScale * texture2D( bumpMap, vBumpMapUv + dSTdy ).x - Hll;\n return vec2( dBx, dBy );\n }\n vec3 perturbNormalArb( vec3 surf_pos, vec3 surf_norm, vec2 dHdxy, float faceDirection ) {\n vec3 vSigmaX = normalize( dFdx( surf_pos.xyz ) );\n vec3 vSigmaY = normalize( dFdy( surf_pos.xyz ) );\n vec3 vN = surf_norm;\n vec3 R1 = cross( vSigmaY, vN );\n vec3 R2 = cross( vN, vSigmaX );\n float fDet = dot( vSigmaX, R1 ) * faceDirection;\n vec3 vGrad = sign( fDet ) * ( dHdxy.x * R1 + dHdxy.y * R2 );\n return normalize( abs( fDet ) * surf_norm - vGrad );\n }\n#endif',
vD =
'#if NUM_CLIPPING_PLANES > 0\n vec4 plane;\n #ifdef ALPHA_TO_COVERAGE\n float distanceToPlane, distanceGradient;\n float clipOpacity = 1.0;\n #pragma unroll_loop_start\n for ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) {\n plane = clippingPlanes[ i ];\n distanceToPlane = - dot( vClipPosition, plane.xyz ) + plane.w;\n distanceGradient = fwidth( distanceToPlane ) / 2.0;\n clipOpacity *= smoothstep( - distanceGradient, distanceGradient, distanceToPlane );\n if ( clipOpacity == 0.0 ) discard;\n }\n #pragma unroll_loop_end\n #if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES\n float unionClipOpacity = 1.0;\n #pragma unroll_loop_start\n for ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) {\n plane = clippingPlanes[ i ];\n distanceToPlane = - dot( vClipPosition, plane.xyz ) + plane.w;\n distanceGradient = fwidth( distanceToPlane ) / 2.0;\n unionClipOpacity *= 1.0 - smoothstep( - distanceGradient, distanceGradient, distanceToPlane );\n }\n #pragma unroll_loop_end\n clipOpacity *= 1.0 - unionClipOpacity;\n #endif\n diffuseColor.a *= clipOpacity;\n if ( diffuseColor.a == 0.0 ) discard;\n #else\n #pragma unroll_loop_start\n for ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) {\n plane = clippingPlanes[ i ];\n if ( dot( vClipPosition, plane.xyz ) > plane.w ) discard;\n }\n #pragma unroll_loop_end\n #if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES\n bool clipped = true;\n #pragma unroll_loop_start\n for ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) {\n plane = clippingPlanes[ i ];\n clipped = ( dot( vClipPosition, plane.xyz ) > plane.w ) && clipped;\n }\n #pragma unroll_loop_end\n if ( clipped ) discard;\n #endif\n #endif\n#endif',
_D =
'#if NUM_CLIPPING_PLANES > 0\n varying vec3 vClipPosition;\n uniform vec4 clippingPlanes[ NUM_CLIPPING_PLANES ];\n#endif',
xD = '#if NUM_CLIPPING_PLANES > 0\n varying vec3 vClipPosition;\n#endif',
SD = '#if NUM_CLIPPING_PLANES > 0\n vClipPosition = - mvPosition.xyz;\n#endif',
AD =
'#if defined( USE_COLOR_ALPHA )\n diffuseColor *= vColor;\n#elif defined( USE_COLOR )\n diffuseColor.rgb *= vColor;\n#endif',
bD =
'#if defined( USE_COLOR_ALPHA )\n varying vec4 vColor;\n#elif defined( USE_COLOR )\n varying vec3 vColor;\n#endif',
TD =
'#if defined( USE_COLOR_ALPHA )\n varying vec4 vColor;\n#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR ) || defined( USE_BATCHING_COLOR )\n varying vec3 vColor;\n#endif',
wD =
'#if defined( USE_COLOR_ALPHA )\n vColor = vec4( 1.0 );\n#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR ) || defined( USE_BATCHING_COLOR )\n vColor = vec3( 1.0 );\n#endif\n#ifdef USE_COLOR\n vColor *= color;\n#endif\n#ifdef USE_INSTANCING_COLOR\n vColor.xyz *= instanceColor.xyz;\n#endif\n#ifdef USE_BATCHING_COLOR\n vec3 batchingColor = getBatchingColor( getIndirectIndex( gl_DrawID ) );\n vColor.xyz *= batchingColor.xyz;\n#endif',
CD =
'#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 const highp float a = 12.9898, b = 78.233, c = 43758.5453;\n highp float dt = dot( uv.xy, vec2( a,b ) ), sn = mod( dt, PI );\n return fract( sin( sn ) * c );\n}\n#ifdef HIGH_PRECISION\n float precisionSafeLength( vec3 v ) { return length( v ); }\n#else\n float precisionSafeLength( vec3 v ) {\n float maxComponent = max3( abs( v ) );\n return length( v / maxComponent ) * maxComponent;\n }\n#endif\nstruct IncidentLight {\n vec3 color;\n vec3 direction;\n bool visible;\n};\nstruct ReflectedLight {\n vec3 directDiffuse;\n vec3 directSpecular;\n vec3 indirectDiffuse;\n vec3 indirectSpecular;\n};\n#ifdef USE_ALPHAHASH\n varying vec3 vPosition;\n#endif\nvec3 transformDirection( in vec3 dir, in mat4 matrix ) {\n return normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );\n}\nvec3 inverseTransformDirection( in vec3 dir, in mat4 matrix ) {\n return normalize( ( vec4( dir, 0.0 ) * matrix ).xyz );\n}\nmat3 transposeMat3( const in mat3 m ) {\n mat3 tmp;\n tmp[ 0 ] = vec3( m[ 0 ].x, m[ 1 ].x, m[ 2 ].x );\n tmp[ 1 ] = vec3( m[ 0 ].y, m[ 1 ].y, m[ 2 ].y );\n tmp[ 2 ] = vec3( m[ 0 ].z, m[ 1 ].z, m[ 2 ].z );\n return tmp;\n}\nbool isPerspectiveMatrix( mat4 m ) {\n return m[ 2 ][ 3 ] == - 1.0;\n}\nvec2 equirectUv( in vec3 dir ) {\n float u = atan( dir.z, dir.x ) * RECIPROCAL_PI2 + 0.5;\n float v = asin( clamp( dir.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5;\n return vec2( u, v );\n}\nvec3 BRDF_Lambert( const in vec3 diffuseColor ) {\n return RECIPROCAL_PI * diffuseColor;\n}\nvec3 F_Schlick( const in vec3 f0, const in float f90, const in float dotVH ) {\n float fresnel = exp2( ( - 5.55473 * dotVH - 6.98316 ) * dotVH );\n return f0 * ( 1.0 - fresnel ) + ( f90 * fresnel );\n}\nfloat F_Schlick( const in float f0, const in float f90, const in float dotVH ) {\n float fresnel = exp2( ( - 5.55473 * dotVH - 6.98316 ) * dotVH );\n return f0 * ( 1.0 - fresnel ) + ( f90 * fresnel );\n} // validated',
ED =
'#ifdef ENVMAP_TYPE_CUBE_UV\n #define cubeUV_minMipLevel 4.0\n #define cubeUV_minTileSize 16.0\n float getFace( vec3 direction ) {\n vec3 absDirection = abs( direction );\n float face = - 1.0;\n if ( absDirection.x > absDirection.z ) {\n if ( absDirection.x > absDirection.y )\n face = direction.x > 0.0 ? 0.0 : 3.0;\n else\n face = direction.y > 0.0 ? 1.0 : 4.0;\n } else {\n if ( absDirection.z > absDirection.y )\n face = direction.z > 0.0 ? 2.0 : 5.0;\n else\n face = direction.y > 0.0 ? 1.0 : 4.0;\n }\n return face;\n }\n vec2 getUV( vec3 direction, float face ) {\n vec2 uv;\n if ( face == 0.0 ) {\n uv = vec2( direction.z, direction.y ) / abs( direction.x );\n } else if ( face == 1.0 ) {\n uv = vec2( - direction.x, - direction.z ) / abs( direction.y );\n } else if ( face == 2.0 ) {\n uv = vec2( - direction.x, direction.y ) / abs( direction.z );\n } else if ( face == 3.0 ) {\n uv = vec2( - direction.z, direction.y ) / abs( direction.x );\n } else if ( face == 4.0 ) {\n uv = vec2( - direction.x, direction.z ) / abs( direction.y );\n } else {\n uv = vec2( direction.x, direction.y ) / abs( direction.z );\n }\n return 0.5 * ( uv + 1.0 );\n }\n vec3 bilinearCubeUV( sampler2D envMap, vec3 direction, float mipInt ) {\n float face = getFace( direction );\n float filterInt = max( cubeUV_minMipLevel - mipInt, 0.0 );\n mipInt = max( mipInt, cubeUV_minMipLevel );\n float faceSize = exp2( mipInt );\n highp vec2 uv = getUV( direction, face ) * ( faceSize - 2.0 ) + 1.0;\n if ( face > 2.0 ) {\n uv.y += faceSize;\n face -= 3.0;\n }\n uv.x += face * faceSize;\n uv.x += filterInt * 3.0 * cubeUV_minTileSize;\n uv.y += 4.0 * ( exp2( CUBEUV_MAX_MIP ) - faceSize );\n uv.x *= CUBEUV_TEXEL_WIDTH;\n uv.y *= CUBEUV_TEXEL_HEIGHT;\n #ifdef texture2DGradEXT\n return texture2DGradEXT( envMap, uv, vec2( 0.0 ), vec2( 0.0 ) ).rgb;\n #else\n return texture2D( envMap, uv ).rgb;\n #endif\n }\n #define cubeUV_r0 1.0\n #define cubeUV_m0 - 2.0\n #define cubeUV_r1 0.8\n #define cubeUV_m1 - 1.0\n #define cubeUV_r4 0.4\n #define cubeUV_m4 2.0\n #define cubeUV_r5 0.305\n #define cubeUV_m5 3.0\n #define cubeUV_r6 0.21\n #define cubeUV_m6 4.0\n float roughnessToMip( float roughness ) {\n float mip = 0.0;\n if ( roughness >= cubeUV_r1 ) {\n mip = ( cubeUV_r0 - roughness ) * ( cubeUV_m1 - cubeUV_m0 ) / ( cubeUV_r0 - cubeUV_r1 ) + cubeUV_m0;\n } else if ( roughness >= cubeUV_r4 ) {\n mip = ( cubeUV_r1 - roughness ) * ( cubeUV_m4 - cubeUV_m1 ) / ( cubeUV_r1 - cubeUV_r4 ) + cubeUV_m1;\n } else if ( roughness >= cubeUV_r5 ) {\n mip = ( cubeUV_r4 - roughness ) * ( cubeUV_m5 - cubeUV_m4 ) / ( cubeUV_r4 - cubeUV_r5 ) + cubeUV_m4;\n } else if ( roughness >= cubeUV_r6 ) {\n mip = ( cubeUV_r5 - roughness ) * ( cubeUV_m6 - cubeUV_m5 ) / ( cubeUV_r5 - cubeUV_r6 ) + cubeUV_m5;\n } else {\n mip = - 2.0 * log2( 1.16 * roughness ); }\n return mip;\n }\n vec4 textureCubeUV( sampler2D envMap, vec3 sampleDir, float roughness ) {\n float mip = clamp( roughnessToMip( roughness ), cubeUV_m0, CUBEUV_MAX_MIP );\n float mipF = fract( mip );\n float mipInt = floor( mip );\n vec3 color0 = bilinearCubeUV( envMap, sampleDir, mipInt );\n if ( mipF == 0.0 ) {\n return vec4( color0, 1.0 );\n } else {\n vec3 color1 = bilinearCubeUV( envMap, sampleDir, mipInt + 1.0 );\n return vec4( mix( color0, color1, mipF ), 1.0 );\n }\n }\n#endif',
MD =
'vec3 transformedNormal = objectNormal;\n#ifdef USE_TANGENT\n vec3 transformedTangent = objectTangent;\n#endif\n#ifdef USE_BATCHING\n mat3 bm = mat3( batchingMatrix );\n transformedNormal /= vec3( dot( bm[ 0 ], bm[ 0 ] ), dot( bm[ 1 ], bm[ 1 ] ), dot( bm[ 2 ], bm[ 2 ] ) );\n transformedNormal = bm * transformedNormal;\n #ifdef USE_TANGENT\n transformedTangent = bm * transformedTangent;\n #endif\n#endif\n#ifdef USE_INSTANCING\n mat3 im = mat3( instanceMatrix );\n transformedNormal /= vec3( dot( im[ 0 ], im[ 0 ] ), dot( im[ 1 ], im[ 1 ] ), dot( im[ 2 ], im[ 2 ] ) );\n transformedNormal = im * transformedNormal;\n #ifdef USE_TANGENT\n transformedTangent = im * transformedTangent;\n #endif\n#endif\ntransformedNormal = normalMatrix * transformedNormal;\n#ifdef FLIP_SIDED\n transformedNormal = - transformedNormal;\n#endif\n#ifdef USE_TANGENT\n transformedTangent = ( modelViewMatrix * vec4( transformedTangent, 0.0 ) ).xyz;\n #ifdef FLIP_SIDED\n transformedTangent = - transformedTangent;\n #endif\n#endif',
RD =
'#ifdef USE_DISPLACEMENTMAP\n uniform sampler2D displacementMap;\n uniform float displacementScale;\n uniform float displacementBias;\n#endif',
ID =
'#ifdef USE_DISPLACEMENTMAP\n transformed += normalize( objectNormal ) * ( texture2D( displacementMap, vDisplacementMapUv ).x * displacementScale + displacementBias );\n#endif',
ND =
'#ifdef USE_EMISSIVEMAP\n vec4 emissiveColor = texture2D( emissiveMap, vEmissiveMapUv );\n #ifdef DECODE_VIDEO_TEXTURE_EMISSIVE\n emissiveColor = sRGBTransferEOTF( emissiveColor );\n #endif\n totalEmissiveRadiance *= emissiveColor.rgb;\n#endif',
PD = '#ifdef USE_EMISSIVEMAP\n uniform sampler2D emissiveMap;\n#endif',
LD = 'gl_FragColor = linearToOutputTexel( gl_FragColor );',
DD =
'vec4 LinearTransferOETF( in vec4 value ) {\n return value;\n}\nvec4 sRGBTransferEOTF( in vec4 value ) {\n return 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 return 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}',
FD =
'#ifdef USE_ENVMAP\n #ifdef ENV_WORLDPOS\n vec3 cameraToFrag;\n if ( isOrthographic ) {\n cameraToFrag = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) );\n } else {\n cameraToFrag = normalize( vWorldPosition - cameraPosition );\n }\n vec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\n #ifdef ENVMAP_MODE_REFLECTION\n vec3 reflectVec = reflect( cameraToFrag, worldNormal );\n #else\n vec3 reflectVec = refract( cameraToFrag, worldNormal, refractionRatio );\n #endif\n #else\n vec3 reflectVec = vReflect;\n #endif\n #ifdef ENVMAP_TYPE_CUBE\n vec4 envColor = textureCube( envMap, envMapRotation * vec3( flipEnvMap * reflectVec.x, reflectVec.yz ) );\n #else\n vec4 envColor = vec4( 0.0 );\n #endif\n #ifdef ENVMAP_BLENDING_MULTIPLY\n outgoingLight = mix( outgoingLight, outgoingLight * envColor.xyz, specularStrength * reflectivity );\n #elif defined( ENVMAP_BLENDING_MIX )\n outgoingLight = mix( outgoingLight, envColor.xyz, specularStrength * reflectivity );\n #elif defined( ENVMAP_BLENDING_ADD )\n outgoingLight += envColor.xyz * specularStrength * reflectivity;\n #endif\n#endif',
OD =
'#ifdef USE_ENVMAP\n uniform float envMapIntensity;\n uniform float flipEnvMap;\n uniform mat3 envMapRotation;\n #ifdef ENVMAP_TYPE_CUBE\n uniform samplerCube envMap;\n #else\n uniform sampler2D envMap;\n #endif\n \n#endif',
BD =
'#ifdef USE_ENVMAP\n uniform float reflectivity;\n #if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( LAMBERT )\n #define ENV_WORLDPOS\n #endif\n #ifdef ENV_WORLDPOS\n varying vec3 vWorldPosition;\n uniform float refractionRatio;\n #else\n varying vec3 vReflect;\n #endif\n#endif',
UD =
'#ifdef USE_ENVMAP\n #if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( LAMBERT )\n #define ENV_WORLDPOS\n #endif\n #ifdef ENV_WORLDPOS\n \n varying vec3 vWorldPosition;\n #else\n varying vec3 vReflect;\n uniform float refractionRatio;\n #endif\n#endif',
kD =
'#ifdef USE_ENVMAP\n #ifdef ENV_WORLDPOS\n vWorldPosition = worldPosition.xyz;\n #else\n vec3 cameraToVertex;\n if ( isOrthographic ) {\n cameraToVertex = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) );\n } else {\n cameraToVertex = normalize( worldPosition.xyz - cameraPosition );\n }\n vec3 worldNormal = inverseTransformDirection( transformedNormal, viewMatrix );\n #ifdef ENVMAP_MODE_REFLECTION\n vReflect = reflect( cameraToVertex, worldNormal );\n #else\n vReflect = refract( cameraToVertex, worldNormal, refractionRatio );\n #endif\n #endif\n#endif',
zD = '#ifdef USE_FOG\n vFogDepth = - mvPosition.z;\n#endif',
VD = '#ifdef USE_FOG\n varying float vFogDepth;\n#endif',
HD =
'#ifdef USE_FOG\n #ifdef FOG_EXP2\n float fogFactor = 1.0 - exp( - fogDensity * fogDensity * vFogDepth * vFogDepth );\n #else\n float fogFactor = smoothstep( fogNear, fogFar, vFogDepth );\n #endif\n gl_FragColor.rgb = mix( gl_FragColor.rgb, fogColor, fogFactor );\n#endif',
$D =
'#ifdef USE_FOG\n uniform vec3 fogColor;\n varying float vFogDepth;\n #ifdef FOG_EXP2\n uniform float fogDensity;\n #else\n uniform float fogNear;\n uniform float fogFar;\n #endif\n#endif',
GD =
'#ifdef USE_GRADIENTMAP\n uniform sampler2D gradientMap;\n#endif\nvec3 getGradientIrradiance( vec3 normal, vec3 lightDirection ) {\n float dotNL = dot( normal, lightDirection );\n vec2 coord = vec2( dotNL * 0.5 + 0.5, 0.0 );\n #ifdef USE_GRADIENTMAP\n return vec3( texture2D( gradientMap, coord ).r );\n #else\n vec2 fw = fwidth( coord ) * 0.5;\n return mix( vec3( 0.7 ), vec3( 1.0 ), smoothstep( 0.7 - fw.x, 0.7 + fw.x, coord.x ) );\n #endif\n}',
WD = '#ifdef USE_LIGHTMAP\n uniform sampler2D lightMap;\n uniform float lightMapIntensity;\n#endif',
QD =
'LambertMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;\nmaterial.specularStrength = specularStrength;',
jD =
'varying vec3 vViewPosition;\nstruct LambertMaterial {\n vec3 diffuseColor;\n float 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 float dotNL = saturate( dot( geometryNormal, directLight.direction ) );\n vec3 irradiance = dotNL * directLight.color;\n reflectedLight.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 reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\n#define RE_Direct RE_Direct_Lambert\n#define RE_IndirectDiffuse RE_IndirectDiffuse_Lambert',
qD =
'uniform bool receiveShadow;\nuniform vec3 ambientLightColor;\n#if defined( USE_LIGHT_PROBES )\n uniform vec3 lightProbe[ 9 ];\n#endif\nvec3 shGetIrradianceAt( in vec3 normal, in vec3 shCoefficients[ 9 ] ) {\n float x = normal.x, y = normal.y, z = normal.z;\n vec3 result = shCoefficients[ 0 ] * 0.886227;\n result += shCoefficients[ 1 ] * 2.0 * 0.511664 * y;\n result += shCoefficients[ 2 ] * 2.0 * 0.511664 * z;\n result += shCoefficients[ 3 ] * 2.0 * 0.511664 * x;\n result += shCoefficients[ 4 ] * 2.0 * 0.429043 * x * y;\n result += shCoefficients[ 5 ] * 2.0 * 0.429043 * y * z;\n result += shCoefficients[ 6 ] * ( 0.743125 * z * z - 0.247708 );\n result += shCoefficients[ 7 ] * 2.0 * 0.429043 * x * z;\n result += shCoefficients[ 8 ] * 0.429043 * ( x * x - y * y );\n return result;\n}\nvec3 getLightProbeIrradiance( const in vec3 lightProbe[ 9 ], const in vec3 normal ) {\n vec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\n vec3 irradiance = shGetIrradianceAt( worldNormal, lightProbe );\n return irradiance;\n}\nvec3 getAmbientLightIrradiance( const in vec3 ambientLightColor ) {\n vec3 irradiance = ambientLightColor;\n return irradiance;\n}\nfloat getDistanceAttenuation( const in float lightDistance, const in float cutoffDistance, const in float decayExponent ) {\n float distanceFalloff = 1.0 / max( pow( lightDistance, decayExponent ), 0.01 );\n if ( cutoffDistance > 0.0 ) {\n distanceFalloff *= pow2( saturate( 1.0 - pow4( lightDistance / cutoffDistance ) ) );\n }\n return distanceFalloff;\n}\nfloat getSpotAttenuation( const in float coneCosine, const in float penumbraCosine, const in float angleCosine ) {\n return smoothstep( coneCosine, penumbraCosine, angleCosine );\n}\n#if NUM_DIR_LIGHTS > 0\n struct DirectionalLight {\n vec3 direction;\n vec3 color;\n };\n uniform DirectionalLight directionalLights[ NUM_DIR_LIGHTS ];\n void getDirectionalLightInfo( const in DirectionalLight directionalLight, out IncidentLight light ) {\n light.color = directionalLight.color;\n light.direction = directionalLight.direction;\n light.visible = true;\n }\n#endif\n#if NUM_POINT_LIGHTS > 0\n struct PointLight {\n vec3 position;\n vec3 color;\n float distance;\n float decay;\n };\n uniform PointLight pointLights[ NUM_POINT_LIGHTS ];\n void getPointLightInfo( const in PointLight pointLight, const in vec3 geometryPosition, out IncidentLight light ) {\n vec3 lVector = pointLight.position - geometryPosition;\n light.direction = normalize( lVector );\n float lightDistance = length( lVector );\n light.color = pointLight.color;\n light.color *= getDistanceAttenuation( lightDistance, pointLight.distance, pointLight.decay );\n light.visible = ( light.color != vec3( 0.0 ) );\n }\n#endif\n#if NUM_SPOT_LIGHTS > 0\n struct SpotLight {\n vec3 position;\n vec3 direction;\n vec3 color;\n float distance;\n float decay;\n float coneCos;\n float penumbraCos;\n };\n uniform SpotLight spotLights[ NUM_SPOT_LIGHTS ];\n void getSpotLightInfo( const in SpotLight spotLight, const in vec3 geometryPosition, out IncidentLight light ) {\n vec3 lVector = spotLight.position - geometryPosition;\n light.direction = normalize( lVector );\n float angleCos = dot( light.direction, spotLight.direction );\n float spotAttenuation = getSpotAttenuation( spotLight.coneCos, spotLight.penumbraCos, angleCos );\n if ( spotAttenuation > 0.0 ) {\n float lightDistance = length( lVector );\n light.color = spotLight.color * spotAttenuation;\n light.color *= getDistanceAttenuation( lightDistance, spotLight.distance, spotLight.decay );\n light.visible = ( light.color != vec3( 0.0 ) );\n } else {\n light.color = vec3( 0.0 );\n light.visible = false;\n }\n }\n#endif\n#if NUM_RECT_AREA_LIGHTS > 0\n struct RectAreaLight {\n vec3 color;\n vec3 position;\n vec3 halfWidth;\n vec3 halfHeight;\n };\n uniform sampler2D ltc_1; uniform sampler2D ltc_2;\n uniform RectAreaLight rectAreaLights[ NUM_RECT_AREA_LIGHTS ];\n#endif\n#if NUM_HEMI_LIGHTS > 0\n struct HemisphereLight {\n vec3 direction;\n vec3 skyColor;\n vec3 groundColor;\n };\n uniform HemisphereLight hemisphereLights[ NUM_HEMI_LIGHTS ];\n vec3 getHemisphereLightIrradiance( const in HemisphereLight hemiLight, const in vec3 normal ) {\n float dotNL = dot( normal, hemiLight.direction );\n float hemiDiffuseWeight = 0.5 * dotNL + 0.5;\n vec3 irradiance = mix( hemiLight.groundColor, hemiLight.skyColor, hemiDiffuseWeight );\n return irradiance;\n }\n#endif',
XD =
'#ifdef USE_ENVMAP\n vec3 getIBLIrradiance( const in vec3 normal ) {\n #ifdef ENVMAP_TYPE_CUBE_UV\n vec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\n vec4 envMapColor = textureCubeUV( envMap, envMapRotation * worldNormal, 1.0 );\n return PI * envMapColor.rgb * envMapIntensity;\n #else\n return vec3( 0.0 );\n #endif\n }\n vec3 getIBLRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness ) {\n #ifdef ENVMAP_TYPE_CUBE_UV\n vec3 reflectVec = reflect( - viewDir, normal );\n reflectVec = normalize( mix( reflectVec, normal, roughness * roughness) );\n reflectVec = inverseTransformDirection( reflectVec, viewMatrix );\n vec4 envMapColor = textureCubeUV( envMap, envMapRotation * reflectVec, roughness );\n return envMapColor.rgb * envMapIntensity;\n #else\n return vec3( 0.0 );\n #endif\n }\n #ifdef USE_ANISOTROPY\n vec3 getIBLAnisotropyRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness, const in vec3 bitangent, const in float anisotropy ) {\n #ifdef ENVMAP_TYPE_CUBE_UV\n vec3 bentNormal = cross( bitangent, viewDir );\n bentNormal = normalize( cross( bentNormal, bitangent ) );\n bentNormal = normalize( mix( bentNormal, normal, pow2( pow2( 1.0 - anisotropy * ( 1.0 - roughness ) ) ) ) );\n return getIBLRadiance( viewDir, bentNormal, roughness );\n #else\n return vec3( 0.0 );\n #endif\n }\n #endif\n#endif',
KD = 'ToonMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;',
YD =
'varying vec3 vViewPosition;\nstruct ToonMaterial {\n vec3 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 vec3 irradiance = getGradientIrradiance( geometryNormal, directLight.direction ) * directLight.color;\n reflectedLight.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 reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\n#define RE_Direct RE_Direct_Toon\n#define RE_IndirectDiffuse RE_IndirectDiffuse_Toon',
ZD =
'BlinnPhongMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;\nmaterial.specularColor = specular;\nmaterial.specularShininess = shininess;\nmaterial.specularStrength = specularStrength;',
JD =
'varying vec3 vViewPosition;\nstruct BlinnPhongMaterial {\n vec3 diffuseColor;\n vec3 specularColor;\n float specularShininess;\n float 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 float dotNL = saturate( dot( geometryNormal, directLight.direction ) );\n vec3 irradiance = dotNL * directLight.color;\n reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n reflectedLight.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 reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\n#define RE_Direct RE_Direct_BlinnPhong\n#define RE_IndirectDiffuse RE_IndirectDiffuse_BlinnPhong',
eF =
'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 material.ior = ior;\n #ifdef USE_SPECULAR\n float specularIntensityFactor = specularIntensity;\n vec3 specularColorFactor = specularColor;\n #ifdef USE_SPECULAR_COLORMAP\n specularColorFactor *= texture2D( specularColorMap, vSpecularColorMapUv ).rgb;\n #endif\n #ifdef USE_SPECULAR_INTENSITYMAP\n specularIntensityFactor *= texture2D( specularIntensityMap, vSpecularIntensityMapUv ).a;\n #endif\n material.specularF90 = mix( specularIntensityFactor, 1.0, metalnessFactor );\n #else\n float specularIntensityFactor = 1.0;\n vec3 specularColorFactor = vec3( 1.0 );\n material.specularF90 = 1.0;\n #endif\n material.specularColor = mix( min( pow2( ( material.ior - 1.0 ) / ( material.ior + 1.0 ) ) * specularColorFactor, vec3( 1.0 ) ) * specularIntensityFactor, diffuseColor.rgb, metalnessFactor );\n#else\n material.specularColor = mix( vec3( 0.04 ), diffuseColor.rgb, metalnessFactor );\n material.specularF90 = 1.0;\n#endif\n#ifdef USE_CLEARCOAT\n material.clearcoat = clearcoat;\n material.clearcoatRoughness = clearcoatRoughness;\n material.clearcoatF0 = vec3( 0.04 );\n material.clearcoatF90 = 1.0;\n #ifdef USE_CLEARCOATMAP\n material.clearcoat *= texture2D( clearcoatMap, vClearcoatMapUv ).x;\n #endif\n #ifdef USE_CLEARCOAT_ROUGHNESSMAP\n material.clearcoatRoughness *= texture2D( clearcoatRoughnessMap, vClearcoatRoughnessMapUv ).y;\n #endif\n material.clearcoat = saturate( material.clearcoat ); material.clearcoatRoughness = max( material.clearcoatRoughness, 0.0525 );\n material.clearcoatRoughness += geometryRoughness;\n material.clearcoatRoughness = min( material.clearcoatRoughness, 1.0 );\n#endif\n#ifdef USE_DISPERSION\n material.dispersion = dispersion;\n#endif\n#ifdef USE_IRIDESCENCE\n material.iridescence = iridescence;\n material.iridescenceIOR = iridescenceIOR;\n #ifdef USE_IRIDESCENCEMAP\n material.iridescence *= texture2D( iridescenceMap, vIridescenceMapUv ).r;\n #endif\n #ifdef USE_IRIDESCENCE_THICKNESSMAP\n material.iridescenceThickness = (iridescenceThicknessMaximum - iridescenceThicknessMinimum) * texture2D( iridescenceThicknessMap, vIridescenceThicknessMapUv ).g + iridescenceThicknessMinimum;\n #else\n material.iridescenceThickness = iridescenceThicknessMaximum;\n #endif\n#endif\n#ifdef USE_SHEEN\n material.sheenColor = sheenColor;\n #ifdef USE_SHEEN_COLORMAP\n material.sheenColor *= texture2D( sheenColorMap, vSheenColorMapUv ).rgb;\n #endif\n material.sheenRoughness = clamp( sheenRoughness, 0.07, 1.0 );\n #ifdef USE_SHEEN_ROUGHNESSMAP\n material.sheenRoughness *= texture2D( sheenRoughnessMap, vSheenRoughnessMapUv ).a;\n #endif\n#endif\n#ifdef USE_ANISOTROPY\n #ifdef USE_ANISOTROPYMAP\n mat2 anisotropyMat = mat2( anisotropyVector.x, anisotropyVector.y, - anisotropyVector.y, anisotropyVector.x );\n vec3 anisotropyPolar = texture2D( anisotropyMap, vAnisotropyMapUv ).rgb;\n vec2 anisotropyV = anisotropyMat * normalize( 2.0 * anisotropyPolar.rg - vec2( 1.0 ) ) * anisotropyPolar.b;\n #else\n vec2 anisotropyV = anisotropyVector;\n #endif\n material.anisotropy = length( anisotropyV );\n if( material.anisotropy == 0.0 ) {\n anisotropyV = vec2( 1.0, 0.0 );\n } else {\n anisotropyV /= material.anisotropy;\n material.anisotropy = saturate( material.anisotropy );\n }\n material.alphaT = mix( pow2( material.roughness ), 1.0, pow2( material.anisotropy ) );\n material.anisotropyT = tbn[ 0 ] * anisotropyV.x + tbn[ 1 ] * anisotropyV.y;\n material.anisotropyB = tbn[ 1 ] * anisotropyV.x - tbn[ 0 ] * anisotropyV.y;\n#endif',
tF =
'struct PhysicalMaterial {\n vec3 diffuseColor;\n float roughness;\n vec3 specularColor;\n float specularF90;\n float dispersion;\n #ifdef USE_CLEARCOAT\n float clearcoat;\n float clearcoatRoughness;\n vec3 clearcoatF0;\n float clearcoatF90;\n #endif\n #ifdef USE_IRIDESCENCE\n float iridescence;\n float iridescenceIOR;\n float iridescenceThickness;\n vec3 iridescenceFresnel;\n vec3 iridescenceF0;\n #endif\n #ifdef USE_SHEEN\n vec3 sheenColor;\n float sheenRoughness;\n #endif\n #ifdef IOR\n float ior;\n #endif\n #ifdef USE_TRANSMISSION\n float transmission;\n float transmissionAlpha;\n float thickness;\n float attenuationDistance;\n vec3 attenuationColor;\n #endif\n #ifdef USE_ANISOTROPY\n float anisotropy;\n float alphaT;\n vec3 anisotropyT;\n vec3 anisotropyB;\n #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 float a2 = pow2( alpha );\n float gv = dotNL * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) );\n float gl = dotNV * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) );\n return 0.5 / max( gv + gl, EPSILON );\n}\nfloat D_GGX( const in float alpha, const in float dotNH ) {\n float a2 = pow2( alpha );\n float denom = pow2( dotNH ) * ( a2 - 1.0 ) + 1.0;\n return RECIPROCAL_PI * a2 / pow2( denom );\n}\n#ifdef USE_ANISOTROPY\n float 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 float gv = dotNL * length( vec3( alphaT * dotTV, alphaB * dotBV, dotNV ) );\n float gl = dotNV * length( vec3( alphaT * dotTL, alphaB * dotBL, dotNL ) );\n float v = 0.5 / ( gv + gl );\n return saturate(v);\n }\n float D_GGX_Anisotropic( const in float alphaT, const in float alphaB, const in float dotNH, const in float dotTH, const in float dotBH ) {\n float a2 = alphaT * alphaB;\n highp vec3 v = vec3( alphaB * dotTH, alphaT * dotBH, a2 * dotNH );\n highp float v2 = dot( v, v );\n float w2 = a2 / v2;\n return RECIPROCAL_PI * a2 * pow2 ( w2 );\n }\n#endif\n#ifdef USE_CLEARCOAT\n vec3 BRDF_GGX_Clearcoat( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in PhysicalMaterial material) {\n vec3 f0 = material.clearcoatF0;\n float f90 = material.clearcoatF90;\n float roughness = material.clearcoatRoughness;\n float alpha = pow2( roughness );\n vec3 halfDir = normalize( lightDir + viewDir );\n float dotNL = saturate( dot( normal, lightDir ) );\n float dotNV = saturate( dot( normal, viewDir ) );\n float dotNH = saturate( dot( normal, halfDir ) );\n float dotVH = saturate( dot( viewDir, halfDir ) );\n vec3 F = F_Schlick( f0, f90, dotVH );\n float V = V_GGX_SmithCorrelated( alpha, dotNL, dotNV );\n float D = D_GGX( alpha, dotNH );\n return F * ( V * D );\n }\n#endif\nvec3 BRDF_GGX( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in PhysicalMaterial material ) {\n vec3 f0 = material.specularColor;\n float f90 = material.specularF90;\n float roughness = material.roughness;\n float alpha = pow2( roughness );\n vec3 halfDir = normalize( lightDir + viewDir );\n float dotNL = saturate( dot( normal, lightDir ) );\n float dotNV = saturate( dot( normal, viewDir ) );\n float dotNH = saturate( dot( normal, halfDir ) );\n float dotVH = saturate( dot( viewDir, halfDir ) );\n vec3 F = F_Schlick( f0, f90, dotVH );\n #ifdef USE_IRIDESCENCE\n F = mix( F, material.iridescenceFresnel, material.iridescence );\n #endif\n #ifdef USE_ANISOTROPY\n float dotTL = dot( material.anisotropyT, lightDir );\n float dotTV = dot( material.anisotropyT, viewDir );\n float dotTH = dot( material.anisotropyT, halfDir );\n float dotBL = dot( material.anisotropyB, lightDir );\n float dotBV = dot( material.anisotropyB, viewDir );\n float dotBH = dot( material.anisotropyB, halfDir );\n float V = V_GGX_SmithCorrelated_Anisotropic( material.alphaT, alpha, dotTV, dotBV, dotTL, dotBL, dotNV, dotNL );\n float D = D_GGX_Anisotropic( material.alphaT, alpha, dotNH, dotTH, dotBH );\n #else\n float V = V_GGX_SmithCorrelated( alpha, dotNL, dotNV );\n float D = D_GGX( alpha, dotNH );\n #endif\n return F * ( V * D );\n}\nvec2 LTC_Uv( const in vec3 N, const in vec3 V, const in float roughness ) {\n const float LUT_SIZE = 64.0;\n const float LUT_SCALE = ( LUT_SIZE - 1.0 ) / LUT_SIZE;\n const float LUT_BIAS = 0.5 / LUT_SIZE;\n float dotNV = saturate( dot( N, V ) );\n vec2 uv = vec2( roughness, sqrt( 1.0 - dotNV ) );\n uv = uv * LUT_SCALE + LUT_BIAS;\n return uv;\n}\nfloat LTC_ClippedSphereFormFactor( const in vec3 f ) {\n float l = length( f );\n return max( ( l * l + f.z ) / ( l + 1.0 ), 0.0 );\n}\nvec3 LTC_EdgeVectorFormFactor( const in vec3 v1, const in vec3 v2 ) {\n float x = dot( v1, v2 );\n float y = abs( x );\n float a = 0.8543985 + ( 0.4965155 + 0.0145206 * y ) * y;\n float b = 3.4175940 + ( 4.1616724 + y ) * y;\n float v = a / b;\n float theta_sintheta = ( x > 0.0 ) ? v : 0.5 * inversesqrt( max( 1.0 - x * x, 1e-7 ) ) - v;\n return 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 vec3 v1 = rectCoords[ 1 ] - rectCoords[ 0 ];\n vec3 v2 = rectCoords[ 3 ] - rectCoords[ 0 ];\n vec3 lightNormal = cross( v1, v2 );\n if( dot( lightNormal, P - rectCoords[ 0 ] ) < 0.0 ) return vec3( 0.0 );\n vec3 T1, T2;\n T1 = normalize( V - N * dot( V, N ) );\n T2 = - cross( N, T1 );\n mat3 mat = mInv * transposeMat3( mat3( T1, T2, N ) );\n vec3 coords[ 4 ];\n coords[ 0 ] = mat * ( rectCoords[ 0 ] - P );\n coords[ 1 ] = mat * ( rectCoords[ 1 ] - P );\n coords[ 2 ] = mat * ( rectCoords[ 2 ] - P );\n coords[ 3 ] = mat * ( rectCoords[ 3 ] - P );\n coords[ 0 ] = normalize( coords[ 0 ] );\n coords[ 1 ] = normalize( coords[ 1 ] );\n coords[ 2 ] = normalize( coords[ 2 ] );\n coords[ 3 ] = normalize( coords[ 3 ] );\n vec3 vectorFormFactor = vec3( 0.0 );\n vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 0 ], coords[ 1 ] );\n vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 1 ], coords[ 2 ] );\n vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 2 ], coords[ 3 ] );\n vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 3 ], coords[ 0 ] );\n float result = LTC_ClippedSphereFormFactor( vectorFormFactor );\n return vec3( result );\n}\n#if defined( USE_SHEEN )\nfloat D_Charlie( float roughness, float dotNH ) {\n float alpha = pow2( roughness );\n float invAlpha = 1.0 / alpha;\n float cos2h = dotNH * dotNH;\n float sin2h = max( 1.0 - cos2h, 0.0078125 );\n return ( 2.0 + invAlpha ) * pow( sin2h, invAlpha * 0.5 ) / ( 2.0 * PI );\n}\nfloat V_Neubelt( float dotNV, float dotNL ) {\n return 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 vec3 halfDir = normalize( lightDir + viewDir );\n float dotNL = saturate( dot( normal, lightDir ) );\n float dotNV = saturate( dot( normal, viewDir ) );\n float dotNH = saturate( dot( normal, halfDir ) );\n float D = D_Charlie( sheenRoughness, dotNH );\n float V = V_Neubelt( dotNV, dotNL );\n return sheenColor * ( D * V );\n}\n#endif\nfloat IBLSheenBRDF( const in vec3 normal, const in vec3 viewDir, const in float roughness ) {\n float dotNV = saturate( dot( normal, viewDir ) );\n float r2 = roughness * roughness;\n float a = roughness < 0.25 ? -339.2 * r2 + 161.4 * roughness - 25.9 : -8.48 * r2 + 14.3 * roughness - 9.95;\n float b = roughness < 0.25 ? 44.0 * r2 - 23.7 * roughness + 3.26 : 1.97 * r2 - 3.27 * roughness + 0.72;\n float DG = exp( a * dotNV + b ) + ( roughness < 0.25 ? 0.0 : 0.1 * ( roughness - 0.25 ) );\n return saturate( DG * RECIPROCAL_PI );\n}\nvec2 DFGApprox( const in vec3 normal, const in vec3 viewDir, const in float roughness ) {\n float dotNV = saturate( dot( normal, viewDir ) );\n const vec4 c0 = vec4( - 1, - 0.0275, - 0.572, 0.022 );\n const vec4 c1 = vec4( 1, 0.0425, 1.04, - 0.04 );\n vec4 r = roughness * c0 + c1;\n float a004 = min( r.x * r.x, exp2( - 9.28 * dotNV ) ) * r.x + r.y;\n vec2 fab = vec2( - 1.04, 1.04 ) * a004 + r.zw;\n return 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 vec2 fab = DFGApprox( normal, viewDir, roughness );\n return 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 vec2 fab = DFGApprox( normal, viewDir, roughness );\n #ifdef USE_IRIDESCENCE\n vec3 Fr = mix( specularColor, iridescenceF0, iridescence );\n #else\n vec3 Fr = specularColor;\n #endif\n vec3 FssEss = Fr * fab.x + specularF90 * fab.y;\n float Ess = fab.x + fab.y;\n float Ems = 1.0 - Ess;\n vec3 Favg = Fr + ( 1.0 - Fr ) * 0.047619; vec3 Fms = FssEss * Favg / ( 1.0 - Ems * Favg );\n singleScatter += FssEss;\n multiScatter += Fms * Ems;\n}\n#if NUM_RECT_AREA_LIGHTS > 0\n void 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 vec3 normal = geometryNormal;\n vec3 viewDir = geometryViewDir;\n vec3 position = geometryPosition;\n vec3 lightPos = rectAreaLight.position;\n vec3 halfWidth = rectAreaLight.halfWidth;\n vec3 halfHeight = rectAreaLight.halfHeight;\n vec3 lightColor = rectAreaLight.color;\n float roughness = material.roughness;\n vec3 rectCoords[ 4 ];\n rectCoords[ 0 ] = lightPos + halfWidth - halfHeight; rectCoords[ 1 ] = lightPos - halfWidth - halfHeight;\n rectCoords[ 2 ] = lightPos - halfWidth + halfHeight;\n rectCoords[ 3 ] = lightPos + halfWidth + halfHeight;\n vec2 uv = LTC_Uv( normal, viewDir, roughness );\n vec4 t1 = texture2D( ltc_1, uv );\n vec4 t2 = texture2D( ltc_2, uv );\n mat3 mInv = mat3(\n vec3( t1.x, 0, t1.y ),\n vec3( 0, 1, 0 ),\n vec3( t1.z, 0, t1.w )\n );\n vec3 fresnel = ( material.specularColor * t2.x + ( vec3( 1.0 ) - material.specularColor ) * t2.y );\n reflectedLight.directSpecular += lightColor * fresnel * LTC_Evaluate( normal, viewDir, position, mInv, rectCoords );\n reflectedLight.directDiffuse += lightColor * material.diffuseColor * LTC_Evaluate( normal, viewDir, position, mat3( 1.0 ), rectCoords );\n }\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 float dotNL = saturate( dot( geometryNormal, directLight.direction ) );\n vec3 irradiance = dotNL * directLight.color;\n #ifdef USE_CLEARCOAT\n float dotNLcc = saturate( dot( geometryClearcoatNormal, directLight.direction ) );\n vec3 ccIrradiance = dotNLcc * directLight.color;\n clearcoatSpecularDirect += ccIrradiance * BRDF_GGX_Clearcoat( directLight.direction, geometryViewDir, geometryClearcoatNormal, material );\n #endif\n #ifdef USE_SHEEN\n sheenSpecularDirect += irradiance * BRDF_Sheen( directLight.direction, geometryViewDir, geometryNormal, material.sheenColor, material.sheenRoughness );\n #endif\n reflectedLight.directSpecular += irradiance * BRDF_GGX( directLight.direction, geometryViewDir, geometryNormal, material );\n reflectedLight.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 reflectedLight.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 #ifdef USE_CLEARCOAT\n clearcoatSpecularIndirect += clearcoatRadiance * EnvironmentBRDF( geometryClearcoatNormal, geometryViewDir, material.clearcoatF0, material.clearcoatF90, material.clearcoatRoughness );\n #endif\n #ifdef USE_SHEEN\n sheenSpecularIndirect += irradiance * material.sheenColor * IBLSheenBRDF( geometryNormal, geometryViewDir, material.sheenRoughness );\n #endif\n vec3 singleScattering = vec3( 0.0 );\n vec3 multiScattering = vec3( 0.0 );\n vec3 cosineWeightedIrradiance = irradiance * RECIPROCAL_PI;\n #ifdef USE_IRIDESCENCE\n computeMultiscatteringIridescence( geometryNormal, geometryViewDir, material.specularColor, material.specularF90, material.iridescence, material.iridescenceFresnel, material.roughness, singleScattering, multiScattering );\n #else\n computeMultiscattering( geometryNormal, geometryViewDir, material.specularColor, material.specularF90, material.roughness, singleScattering, multiScattering );\n #endif\n vec3 totalScattering = singleScattering + multiScattering;\n vec3 diffuse = material.diffuseColor * ( 1.0 - max( max( totalScattering.r, totalScattering.g ), totalScattering.b ) );\n reflectedLight.indirectSpecular += radiance * singleScattering;\n reflectedLight.indirectSpecular += multiScattering * cosineWeightedIrradiance;\n reflectedLight.indirectDiffuse += diffuse * cosineWeightedIrradiance;\n}\n#define RE_Direct RE_Direct_Physical\n#define RE_Direct_RectArea RE_Direct_RectArea_Physical\n#define RE_IndirectDiffuse RE_IndirectDiffuse_Physical\n#define RE_IndirectSpecular RE_IndirectSpecular_Physical\nfloat computeSpecularOcclusion( const in float dotNV, const in float ambientOcclusion, const in float roughness ) {\n return saturate( pow( dotNV + ambientOcclusion, exp2( - 16.0 * roughness - 1.0 ) ) - 1.0 + ambientOcclusion );\n}',
nF =
'\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 geometryClearcoatNormal = clearcoatNormal;\n#endif\n#ifdef USE_IRIDESCENCE\n float dotNVi = saturate( dot( normal, geometryViewDir ) );\n if ( material.iridescenceThickness == 0.0 ) {\n material.iridescence = 0.0;\n } else {\n material.iridescence = saturate( material.iridescence );\n }\n if ( material.iridescence > 0.0 ) {\n material.iridescenceFresnel = evalIridescence( 1.0, material.iridescenceIOR, dotNVi, material.iridescenceThickness, material.specularColor );\n material.iridescenceF0 = Schlick_to_F0( material.iridescenceFresnel, 1.0, dotNVi );\n }\n#endif\nIncidentLight directLight;\n#if ( NUM_POINT_LIGHTS > 0 ) && defined( RE_Direct )\n PointLight pointLight;\n #if defined( USE_SHADOWMAP ) && NUM_POINT_LIGHT_SHADOWS > 0\n PointLightShadow pointLightShadow;\n #endif\n #pragma unroll_loop_start\n for ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n pointLight = pointLights[ i ];\n getPointLightInfo( pointLight, geometryPosition, directLight );\n #if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_POINT_LIGHT_SHADOWS )\n pointLightShadow = pointLightShadows[ i ];\n directLight.color *= ( directLight.visible && receiveShadow ) ? getPointShadow( pointShadowMap[ i ], pointLightShadow.shadowMapSize, pointLightShadow.shadowIntensity, pointLightShadow.shadowBias, pointLightShadow.shadowRadius, vPointShadowCoord[ i ], pointLightShadow.shadowCameraNear, pointLightShadow.shadowCameraFar ) : 1.0;\n #endif\n RE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );\n }\n #pragma unroll_loop_end\n#endif\n#if ( NUM_SPOT_LIGHTS > 0 ) && defined( RE_Direct )\n SpotLight spotLight;\n vec4 spotColor;\n vec3 spotLightCoord;\n bool inSpotLightMap;\n #if defined( USE_SHADOWMAP ) && NUM_SPOT_LIGHT_SHADOWS > 0\n SpotLightShadow spotLightShadow;\n #endif\n #pragma unroll_loop_start\n for ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n spotLight = spotLights[ i ];\n getSpotLightInfo( spotLight, geometryPosition, directLight );\n #if ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS )\n #define SPOT_LIGHT_MAP_INDEX UNROLLED_LOOP_INDEX\n #elif ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )\n #define SPOT_LIGHT_MAP_INDEX NUM_SPOT_LIGHT_MAPS\n #else\n #define SPOT_LIGHT_MAP_INDEX ( UNROLLED_LOOP_INDEX - NUM_SPOT_LIGHT_SHADOWS + NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS )\n #endif\n #if ( SPOT_LIGHT_MAP_INDEX < NUM_SPOT_LIGHT_MAPS )\n spotLightCoord = vSpotLightCoord[ i ].xyz / vSpotLightCoord[ i ].w;\n inSpotLightMap = all( lessThan( abs( spotLightCoord * 2. - 1. ), vec3( 1.0 ) ) );\n spotColor = texture2D( spotLightMap[ SPOT_LIGHT_MAP_INDEX ], spotLightCoord.xy );\n directLight.color = inSpotLightMap ? directLight.color * spotColor.rgb : directLight.color;\n #endif\n #undef SPOT_LIGHT_MAP_INDEX\n #if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )\n spotLightShadow = spotLightShadows[ i ];\n directLight.color *= ( directLight.visible && receiveShadow ) ? getShadow( spotShadowMap[ i ], spotLightShadow.shadowMapSize, spotLightShadow.shadowIntensity, spotLightShadow.shadowBias, spotLightShadow.shadowRadius, vSpotLightCoord[ i ] ) : 1.0;\n #endif\n RE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );\n }\n #pragma unroll_loop_end\n#endif\n#if ( NUM_DIR_LIGHTS > 0 ) && defined( RE_Direct )\n DirectionalLight directionalLight;\n #if defined( USE_SHADOWMAP ) && NUM_DIR_LIGHT_SHADOWS > 0\n DirectionalLightShadow directionalLightShadow;\n #endif\n #pragma unroll_loop_start\n for ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n directionalLight = directionalLights[ i ];\n getDirectionalLightInfo( directionalLight, directLight );\n #if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_DIR_LIGHT_SHADOWS )\n directionalLightShadow = directionalLightShadows[ i ];\n directLight.color *= ( directLight.visible && receiveShadow ) ? getShadow( directionalShadowMap[ i ], directionalLightShadow.shadowMapSize, directionalLightShadow.shadowIntensity, directionalLightShadow.shadowBias, directionalLightShadow.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n #endif\n RE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );\n }\n #pragma unroll_loop_end\n#endif\n#if ( NUM_RECT_AREA_LIGHTS > 0 ) && defined( RE_Direct_RectArea )\n RectAreaLight rectAreaLight;\n #pragma unroll_loop_start\n for ( int i = 0; i < NUM_RECT_AREA_LIGHTS; i ++ ) {\n rectAreaLight = rectAreaLights[ i ];\n RE_Direct_RectArea( rectAreaLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );\n }\n #pragma unroll_loop_end\n#endif\n#if defined( RE_IndirectDiffuse )\n vec3 iblIrradiance = vec3( 0.0 );\n vec3 irradiance = getAmbientLightIrradiance( ambientLightColor );\n #if defined( USE_LIGHT_PROBES )\n irradiance += getLightProbeIrradiance( lightProbe, geometryNormal );\n #endif\n #if ( NUM_HEMI_LIGHTS > 0 )\n #pragma unroll_loop_start\n for ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {\n irradiance += getHemisphereLightIrradiance( hemisphereLights[ i ], geometryNormal );\n }\n #pragma unroll_loop_end\n #endif\n#endif\n#if defined( RE_IndirectSpecular )\n vec3 radiance = vec3( 0.0 );\n vec3 clearcoatRadiance = vec3( 0.0 );\n#endif',
iF =
'#if defined( RE_IndirectDiffuse )\n #ifdef USE_LIGHTMAP\n vec4 lightMapTexel = texture2D( lightMap, vLightMapUv );\n vec3 lightMapIrradiance = lightMapTexel.rgb * lightMapIntensity;\n irradiance += lightMapIrradiance;\n #endif\n #if defined( USE_ENVMAP ) && defined( STANDARD ) && defined( ENVMAP_TYPE_CUBE_UV )\n iblIrradiance += getIBLIrradiance( geometryNormal );\n #endif\n#endif\n#if defined( USE_ENVMAP ) && defined( RE_IndirectSpecular )\n #ifdef USE_ANISOTROPY\n radiance += getIBLAnisotropyRadiance( geometryViewDir, geometryNormal, material.roughness, material.anisotropyB, material.anisotropy );\n #else\n radiance += getIBLRadiance( geometryViewDir, geometryNormal, material.roughness );\n #endif\n #ifdef USE_CLEARCOAT\n clearcoatRadiance += getIBLRadiance( geometryViewDir, geometryClearcoatNormal, material.clearcoatRoughness );\n #endif\n#endif',
rF =
'#if defined( RE_IndirectDiffuse )\n RE_IndirectDiffuse( irradiance, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );\n#endif\n#if defined( RE_IndirectSpecular )\n RE_IndirectSpecular( radiance, iblIrradiance, clearcoatRadiance, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );\n#endif',
sF =
'#if defined( USE_LOGDEPTHBUF )\n gl_FragDepth = vIsPerspective == 0.0 ? gl_FragCoord.z : log2( vFragDepth ) * logDepthBufFC * 0.5;\n#endif',
oF =
'#if defined( USE_LOGDEPTHBUF )\n uniform float logDepthBufFC;\n varying float vFragDepth;\n varying float vIsPerspective;\n#endif',
aF = '#ifdef USE_LOGDEPTHBUF\n varying float vFragDepth;\n varying float vIsPerspective;\n#endif',
lF =
'#ifdef USE_LOGDEPTHBUF\n vFragDepth = 1.0 + gl_Position.w;\n vIsPerspective = float( isPerspectiveMatrix( projectionMatrix ) );\n#endif',
cF =
'#ifdef USE_MAP\n vec4 sampledDiffuseColor = texture2D( map, vMapUv );\n #ifdef DECODE_VIDEO_TEXTURE\n sampledDiffuseColor = sRGBTransferEOTF( sampledDiffuseColor );\n #endif\n diffuseColor *= sampledDiffuseColor;\n#endif',
uF = '#ifdef USE_MAP\n uniform sampler2D map;\n#endif',
dF =
'#if defined( USE_MAP ) || defined( USE_ALPHAMAP )\n #if defined( USE_POINTS_UV )\n vec2 uv = vUv;\n #else\n vec2 uv = ( uvTransform * vec3( gl_PointCoord.x, 1.0 - gl_PointCoord.y, 1 ) ).xy;\n #endif\n#endif\n#ifdef USE_MAP\n diffuseColor *= texture2D( map, uv );\n#endif\n#ifdef USE_ALPHAMAP\n diffuseColor.a *= texture2D( alphaMap, uv ).g;\n#endif',
hF =
'#if defined( USE_POINTS_UV )\n varying vec2 vUv;\n#else\n #if defined( USE_MAP ) || defined( USE_ALPHAMAP )\n uniform mat3 uvTransform;\n #endif\n#endif\n#ifdef USE_MAP\n uniform sampler2D map;\n#endif\n#ifdef USE_ALPHAMAP\n uniform sampler2D alphaMap;\n#endif',
fF =
'float metalnessFactor = metalness;\n#ifdef USE_METALNESSMAP\n vec4 texelMetalness = texture2D( metalnessMap, vMetalnessMapUv );\n metalnessFactor *= texelMetalness.b;\n#endif',
pF = '#ifdef USE_METALNESSMAP\n uniform sampler2D metalnessMap;\n#endif',
mF =
'#ifdef USE_INSTANCING_MORPH\n float morphTargetInfluences[ MORPHTARGETS_COUNT ];\n float morphTargetBaseInfluence = texelFetch( morphTexture, ivec2( 0, gl_InstanceID ), 0 ).r;\n for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {\n morphTargetInfluences[i] = texelFetch( morphTexture, ivec2( i + 1, gl_InstanceID ), 0 ).r;\n }\n#endif',
gF =
'#if defined( USE_MORPHCOLORS )\n vColor *= morphTargetBaseInfluence;\n for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {\n #if defined( USE_COLOR_ALPHA )\n if ( morphTargetInfluences[ i ] != 0.0 ) vColor += getMorph( gl_VertexID, i, 2 ) * morphTargetInfluences[ i ];\n #elif defined( USE_COLOR )\n if ( morphTargetInfluences[ i ] != 0.0 ) vColor += getMorph( gl_VertexID, i, 2 ).rgb * morphTargetInfluences[ i ];\n #endif\n }\n#endif',
yF =
'#ifdef USE_MORPHNORMALS\n objectNormal *= morphTargetBaseInfluence;\n for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {\n if ( morphTargetInfluences[ i ] != 0.0 ) objectNormal += getMorph( gl_VertexID, i, 1 ).xyz * morphTargetInfluences[ i ];\n }\n#endif',
vF =
'#ifdef USE_MORPHTARGETS\n #ifndef USE_INSTANCING_MORPH\n uniform float morphTargetBaseInfluence;\n uniform float morphTargetInfluences[ MORPHTARGETS_COUNT ];\n #endif\n uniform sampler2DArray morphTargetsTexture;\n uniform ivec2 morphTargetsTextureSize;\n vec4 getMorph( const in int vertexIndex, const in int morphTargetIndex, const in int offset ) {\n int texelIndex = vertexIndex * MORPHTARGETS_TEXTURE_STRIDE + offset;\n int y = texelIndex / morphTargetsTextureSize.x;\n int x = texelIndex - y * morphTargetsTextureSize.x;\n ivec3 morphUV = ivec3( x, y, morphTargetIndex );\n return texelFetch( morphTargetsTexture, morphUV, 0 );\n }\n#endif',
_F =
'#ifdef USE_MORPHTARGETS\n transformed *= morphTargetBaseInfluence;\n for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {\n if ( morphTargetInfluences[ i ] != 0.0 ) transformed += getMorph( gl_VertexID, i, 0 ).xyz * morphTargetInfluences[ i ];\n }\n#endif',
xF =
'float faceDirection = gl_FrontFacing ? 1.0 : - 1.0;\n#ifdef FLAT_SHADED\n vec3 fdx = dFdx( vViewPosition );\n vec3 fdy = dFdy( vViewPosition );\n vec3 normal = normalize( cross( fdx, fdy ) );\n#else\n vec3 normal = normalize( vNormal );\n #ifdef DOUBLE_SIDED\n normal *= faceDirection;\n #endif\n#endif\n#if defined( USE_NORMALMAP_TANGENTSPACE ) || defined( USE_CLEARCOAT_NORMALMAP ) || defined( USE_ANISOTROPY )\n #ifdef USE_TANGENT\n mat3 tbn = mat3( normalize( vTangent ), normalize( vBitangent ), normal );\n #else\n mat3 tbn = getTangentFrame( - vViewPosition, normal,\n #if defined( USE_NORMALMAP )\n vNormalMapUv\n #elif defined( USE_CLEARCOAT_NORMALMAP )\n vClearcoatNormalMapUv\n #else\n vUv\n #endif\n );\n #endif\n #if defined( DOUBLE_SIDED ) && ! defined( FLAT_SHADED )\n tbn[0] *= faceDirection;\n tbn[1] *= faceDirection;\n #endif\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n #ifdef USE_TANGENT\n mat3 tbn2 = mat3( normalize( vTangent ), normalize( vBitangent ), normal );\n #else\n mat3 tbn2 = getTangentFrame( - vViewPosition, normal, vClearcoatNormalMapUv );\n #endif\n #if defined( DOUBLE_SIDED ) && ! defined( FLAT_SHADED )\n tbn2[0] *= faceDirection;\n tbn2[1] *= faceDirection;\n #endif\n#endif\nvec3 nonPerturbedNormal = normal;',
SF =
'#ifdef USE_NORMALMAP_OBJECTSPACE\n normal = texture2D( normalMap, vNormalMapUv ).xyz * 2.0 - 1.0;\n #ifdef FLIP_SIDED\n normal = - normal;\n #endif\n #ifdef DOUBLE_SIDED\n normal = normal * faceDirection;\n #endif\n normal = normalize( normalMatrix * normal );\n#elif defined( USE_NORMALMAP_TANGENTSPACE )\n vec3 mapN = texture2D( normalMap, vNormalMapUv ).xyz * 2.0 - 1.0;\n mapN.xy *= normalScale;\n normal = normalize( tbn * mapN );\n#elif defined( USE_BUMPMAP )\n normal = perturbNormalArb( - vViewPosition, normal, dHdxy_fwd(), faceDirection );\n#endif',
AF =
'#ifndef FLAT_SHADED\n varying vec3 vNormal;\n #ifdef USE_TANGENT\n varying vec3 vTangent;\n varying vec3 vBitangent;\n #endif\n#endif',
bF =
'#ifndef FLAT_SHADED\n varying vec3 vNormal;\n #ifdef USE_TANGENT\n varying vec3 vTangent;\n varying vec3 vBitangent;\n #endif\n#endif',
TF =
'#ifndef FLAT_SHADED\n vNormal = normalize( transformedNormal );\n #ifdef USE_TANGENT\n vTangent = normalize( transformedTangent );\n vBitangent = normalize( cross( vNormal, vTangent ) * tangent.w );\n #endif\n#endif',
wF =
'#ifdef USE_NORMALMAP\n uniform sampler2D normalMap;\n uniform vec2 normalScale;\n#endif\n#ifdef USE_NORMALMAP_OBJECTSPACE\n uniform mat3 normalMatrix;\n#endif\n#if ! defined ( USE_TANGENT ) && ( defined ( USE_NORMALMAP_TANGENTSPACE ) || defined ( USE_CLEARCOAT_NORMALMAP ) || defined( USE_ANISOTROPY ) )\n mat3 getTangentFrame( vec3 eye_pos, vec3 surf_norm, vec2 uv ) {\n vec3 q0 = dFdx( eye_pos.xyz );\n vec3 q1 = dFdy( eye_pos.xyz );\n vec2 st0 = dFdx( uv.st );\n vec2 st1 = dFdy( uv.st );\n vec3 N = surf_norm;\n vec3 q1perp = cross( q1, N );\n vec3 q0perp = cross( N, q0 );\n vec3 T = q1perp * st0.x + q0perp * st1.x;\n vec3 B = q1perp * st0.y + q0perp * st1.y;\n float det = max( dot( T, T ), dot( B, B ) );\n float scale = ( det == 0.0 ) ? 0.0 : inversesqrt( det );\n return mat3( T * scale, B * scale, N );\n }\n#endif',
CF = '#ifdef USE_CLEARCOAT\n vec3 clearcoatNormal = nonPerturbedNormal;\n#endif',
EF =
'#ifdef USE_CLEARCOAT_NORMALMAP\n vec3 clearcoatMapN = texture2D( clearcoatNormalMap, vClearcoatNormalMapUv ).xyz * 2.0 - 1.0;\n clearcoatMapN.xy *= clearcoatNormalScale;\n clearcoatNormal = normalize( tbn2 * clearcoatMapN );\n#endif',
MF =
'#ifdef USE_CLEARCOATMAP\n uniform sampler2D clearcoatMap;\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n uniform sampler2D clearcoatNormalMap;\n uniform vec2 clearcoatNormalScale;\n#endif\n#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n uniform sampler2D clearcoatRoughnessMap;\n#endif',
RF =
'#ifdef USE_IRIDESCENCEMAP\n uniform sampler2D iridescenceMap;\n#endif\n#ifdef USE_IRIDESCENCE_THICKNESSMAP\n uniform sampler2D iridescenceThicknessMap;\n#endif',
IF =
'#ifdef OPAQUE\ndiffuseColor.a = 1.0;\n#endif\n#ifdef USE_TRANSMISSION\ndiffuseColor.a *= material.transmissionAlpha;\n#endif\ngl_FragColor = vec4( outgoingLight, diffuseColor.a );',
NF =
'vec3 packNormalToRGB( const in vec3 normal ) {\n return normalize( normal ) * 0.5 + 0.5;\n}\nvec3 unpackRGBToNormal( const in vec3 rgb ) {\n return 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 if( v <= 0.0 )\n return vec4( 0., 0., 0., 0. );\n if( v >= 1.0 )\n return vec4( 1., 1., 1., 1. );\n float vuf;\n float af = modf( v * PackFactors.a, vuf );\n float bf = modf( vuf * ShiftRight8, vuf );\n float gf = modf( vuf * ShiftRight8, vuf );\n return vec4( vuf * Inv255, gf * PackUpscale, bf * PackUpscale, af );\n}\nvec3 packDepthToRGB( const in float v ) {\n if( v <= 0.0 )\n return vec3( 0., 0., 0. );\n if( v >= 1.0 )\n return vec3( 1., 1., 1. );\n float vuf;\n float bf = modf( v * PackFactors.b, vuf );\n float gf = modf( vuf * ShiftRight8, vuf );\n return vec3( vuf * Inv255, gf * PackUpscale, bf );\n}\nvec2 packDepthToRG( const in float v ) {\n if( v <= 0.0 )\n return vec2( 0., 0. );\n if( v >= 1.0 )\n return vec2( 1., 1. );\n float vuf;\n float gf = modf( v * 256., vuf );\n return vec2( vuf * Inv255, gf );\n}\nfloat unpackRGBAToDepth( const in vec4 v ) {\n return dot( v, UnpackFactors4 );\n}\nfloat unpackRGBToDepth( const in vec3 v ) {\n return dot( v, UnpackFactors3 );\n}\nfloat unpackRGToDepth( const in vec2 v ) {\n return v.r * UnpackFactors2.r + v.g * UnpackFactors2.g;\n}\nvec4 pack2HalfToRGBA( const in vec2 v ) {\n vec4 r = vec4( v.x, fract( v.x * 255.0 ), v.y, fract( v.y * 255.0 ) );\n return 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 return 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 return ( viewZ + near ) / ( near - far );\n}\nfloat orthographicDepthToViewZ( const in float depth, const in float near, const in float far ) {\n return depth * ( near - far ) - near;\n}\nfloat viewZToPerspectiveDepth( const in float viewZ, const in float near, const in float far ) {\n return ( ( near + viewZ ) * far ) / ( ( far - near ) * viewZ );\n}\nfloat perspectiveDepthToViewZ( const in float depth, const in float near, const in float far ) {\n return ( near * far ) / ( ( far - near ) * depth - far );\n}',
PF = '#ifdef PREMULTIPLIED_ALPHA\n gl_FragColor.rgb *= gl_FragColor.a;\n#endif',
LF =
'vec4 mvPosition = vec4( transformed, 1.0 );\n#ifdef USE_BATCHING\n mvPosition = batchingMatrix * mvPosition;\n#endif\n#ifdef USE_INSTANCING\n mvPosition = instanceMatrix * mvPosition;\n#endif\nmvPosition = modelViewMatrix * mvPosition;\ngl_Position = projectionMatrix * mvPosition;',
DF = '#ifdef DITHERING\n gl_FragColor.rgb = dithering( gl_FragColor.rgb );\n#endif',
FF =
'#ifdef DITHERING\n vec3 dithering( vec3 color ) {\n float grid_position = rand( gl_FragCoord.xy );\n vec3 dither_shift_RGB = vec3( 0.25 / 255.0, -0.25 / 255.0, 0.25 / 255.0 );\n dither_shift_RGB = mix( 2.0 * dither_shift_RGB, -2.0 * dither_shift_RGB, grid_position );\n return color + dither_shift_RGB;\n }\n#endif',
OF =
'float roughnessFactor = roughness;\n#ifdef USE_ROUGHNESSMAP\n vec4 texelRoughness = texture2D( roughnessMap, vRoughnessMapUv );\n roughnessFactor *= texelRoughness.g;\n#endif',
BF = '#ifdef USE_ROUGHNESSMAP\n uniform sampler2D roughnessMap;\n#endif',
UF =
'#if NUM_SPOT_LIGHT_COORDS > 0\n varying vec4 vSpotLightCoord[ NUM_SPOT_LIGHT_COORDS ];\n#endif\n#if NUM_SPOT_LIGHT_MAPS > 0\n uniform sampler2D spotLightMap[ NUM_SPOT_LIGHT_MAPS ];\n#endif\n#ifdef USE_SHADOWMAP\n #if NUM_DIR_LIGHT_SHADOWS > 0\n uniform sampler2D directionalShadowMap[ NUM_DIR_LIGHT_SHADOWS ];\n varying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ];\n struct DirectionalLightShadow {\n float shadowIntensity;\n float shadowBias;\n float shadowNormalBias;\n float shadowRadius;\n vec2 shadowMapSize;\n };\n uniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ];\n #endif\n #if NUM_SPOT_LIGHT_SHADOWS > 0\n uniform sampler2D spotShadowMap[ NUM_SPOT_LIGHT_SHADOWS ];\n struct SpotLightShadow {\n float shadowIntensity;\n float shadowBias;\n float shadowNormalBias;\n float shadowRadius;\n vec2 shadowMapSize;\n };\n uniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ];\n #endif\n #if NUM_POINT_LIGHT_SHADOWS > 0\n uniform sampler2D pointShadowMap[ NUM_POINT_LIGHT_SHADOWS ];\n varying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ];\n struct PointLightShadow {\n float shadowIntensity;\n float shadowBias;\n float shadowNormalBias;\n float shadowRadius;\n vec2 shadowMapSize;\n float shadowCameraNear;\n float shadowCameraFar;\n };\n uniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ];\n #endif\n float texture2DCompare( sampler2D depths, vec2 uv, float compare ) {\n return step( compare, unpackRGBAToDepth( texture2D( depths, uv ) ) );\n }\n vec2 texture2DDistribution( sampler2D shadow, vec2 uv ) {\n return unpackRGBATo2Half( texture2D( shadow, uv ) );\n }\n float VSMShadow (sampler2D shadow, vec2 uv, float compare ){\n float occlusion = 1.0;\n vec2 distribution = texture2DDistribution( shadow, uv );\n float hard_shadow = step( compare , distribution.x );\n if (hard_shadow != 1.0 ) {\n float distance = compare - distribution.x ;\n float variance = max( 0.00000, distribution.y * distribution.y );\n float softness_probability = variance / (variance + distance * distance ); softness_probability = clamp( ( softness_probability - 0.3 ) / ( 0.95 - 0.3 ), 0.0, 1.0 ); occlusion = clamp( max( hard_shadow, softness_probability ), 0.0, 1.0 );\n }\n return occlusion;\n }\n float getShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowIntensity, float shadowBias, float shadowRadius, vec4 shadowCoord ) {\n float shadow = 1.0;\n shadowCoord.xyz /= shadowCoord.w;\n shadowCoord.z += shadowBias;\n bool inFrustum = shadowCoord.x >= 0.0 && shadowCoord.x <= 1.0 && shadowCoord.y >= 0.0 && shadowCoord.y <= 1.0;\n bool frustumTest = inFrustum && shadowCoord.z <= 1.0;\n if ( frustumTest ) {\n #if defined( SHADOWMAP_TYPE_PCF )\n vec2 texelSize = vec2( 1.0 ) / shadowMapSize;\n float dx0 = - texelSize.x * shadowRadius;\n float dy0 = - texelSize.y * shadowRadius;\n float dx1 = + texelSize.x * shadowRadius;\n float dy1 = + texelSize.y * shadowRadius;\n float dx2 = dx0 / 2.0;\n float dy2 = dy0 / 2.0;\n float dx3 = dx1 / 2.0;\n float dy3 = dy1 / 2.0;\n shadow = (\n texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy0 ), shadowCoord.z ) +\n texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy0 ), shadowCoord.z ) +\n texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy0 ), shadowCoord.z ) +\n texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy2 ), shadowCoord.z ) +\n texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy2 ), shadowCoord.z ) +\n texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy2 ), shadowCoord.z ) +\n texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, 0.0 ), shadowCoord.z ) +\n texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, 0.0 ), shadowCoord.z ) +\n texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z ) +\n texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, 0.0 ), shadowCoord.z ) +\n texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, 0.0 ), shadowCoord.z ) +\n texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy3 ), shadowCoord.z ) +\n texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy3 ), shadowCoord.z ) +\n texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy3 ), shadowCoord.z ) +\n texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy1 ), shadowCoord.z ) +\n texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy1 ), shadowCoord.z ) +\n texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy1 ), shadowCoord.z )\n ) * ( 1.0 / 17.0 );\n #elif defined( SHADOWMAP_TYPE_PCF_SOFT )\n vec2 texelSize = vec2( 1.0 ) / shadowMapSize;\n float dx = texelSize.x;\n float dy = texelSize.y;\n vec2 uv = shadowCoord.xy;\n vec2 f = fract( uv * shadowMapSize + 0.5 );\n uv -= f * texelSize;\n shadow = (\n texture2DCompare( shadowMap, uv, shadowCoord.z ) +\n texture2DCompare( shadowMap, uv + vec2( dx, 0.0 ), shadowCoord.z ) +\n texture2DCompare( shadowMap, uv + vec2( 0.0, dy ), shadowCoord.z ) +\n texture2DCompare( shadowMap, uv + texelSize, shadowCoord.z ) +\n mix( texture2DCompare( shadowMap, uv + vec2( -dx, 0.0 ), shadowCoord.z ),\n texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 0.0 ), shadowCoord.z ),\n f.x ) +\n mix( texture2DCompare( shadowMap, uv + vec2( -dx, dy ), shadowCoord.z ),\n texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, dy ), shadowCoord.z ),\n f.x ) +\n mix( texture2DCompare( shadowMap, uv + vec2( 0.0, -dy ), shadowCoord.z ),\n texture2DCompare( shadowMap, uv + vec2( 0.0, 2.0 * dy ), shadowCoord.z ),\n f.y ) +\n mix( texture2DCompare( shadowMap, uv + vec2( dx, -dy ), shadowCoord.z ),\n texture2DCompare( shadowMap, uv + vec2( dx, 2.0 * dy ), shadowCoord.z ),\n f.y ) +\n mix( mix( texture2DCompare( shadowMap, uv + vec2( -dx, -dy ), shadowCoord.z ),\n texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, -dy ), shadowCoord.z ),\n f.x ),\n mix( texture2DCompare( shadowMap, uv + vec2( -dx, 2.0 * dy ), shadowCoord.z ),\n texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 2.0 * dy ), shadowCoord.z ),\n f.x ),\n f.y )\n ) * ( 1.0 / 9.0 );\n #elif defined( SHADOWMAP_TYPE_VSM )\n shadow = VSMShadow( shadowMap, shadowCoord.xy, shadowCoord.z );\n #else\n shadow = texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z );\n #endif\n }\n return mix( 1.0, shadow, shadowIntensity );\n }\n vec2 cubeToUV( vec3 v, float texelSizeY ) {\n vec3 absV = abs( v );\n float scaleToCube = 1.0 / max( absV.x, max( absV.y, absV.z ) );\n absV *= scaleToCube;\n v *= scaleToCube * ( 1.0 - 2.0 * texelSizeY );\n vec2 planar = v.xy;\n float almostATexel = 1.5 * texelSizeY;\n float almostOne = 1.0 - almostATexel;\n if ( absV.z >= almostOne ) {\n if ( v.z > 0.0 )\n planar.x = 4.0 - v.x;\n } else if ( absV.x >= almostOne ) {\n float signX = sign( v.x );\n planar.x = v.z * signX + 2.0 * signX;\n } else if ( absV.y >= almostOne ) {\n float signY = sign( v.y );\n planar.x = v.x + 2.0 * signY + 2.0;\n planar.y = v.z * signY - 2.0;\n }\n return vec2( 0.125, 0.25 ) * planar + vec2( 0.375, 0.75 );\n }\n float getPointShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowIntensity, float shadowBias, float shadowRadius, vec4 shadowCoord, float shadowCameraNear, float shadowCameraFar ) {\n float shadow = 1.0;\n vec3 lightToPosition = shadowCoord.xyz;\n \n float lightToPositionLength = length( lightToPosition );\n if ( lightToPositionLength - shadowCameraFar <= 0.0 && lightToPositionLength - shadowCameraNear >= 0.0 ) {\n float dp = ( lightToPositionLength - shadowCameraNear ) / ( shadowCameraFar - shadowCameraNear ); dp += shadowBias;\n vec3 bd3D = normalize( lightToPosition );\n vec2 texelSize = vec2( 1.0 ) / ( shadowMapSize * vec2( 4.0, 2.0 ) );\n #if defined( SHADOWMAP_TYPE_PCF ) || defined( SHADOWMAP_TYPE_PCF_SOFT ) || defined( SHADOWMAP_TYPE_VSM )\n vec2 offset = vec2( - 1, 1 ) * shadowRadius * texelSize.y;\n shadow = (\n texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyy, texelSize.y ), dp ) +\n texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyy, texelSize.y ), dp ) +\n texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyx, texelSize.y ), dp ) +\n texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyx, texelSize.y ), dp ) +\n texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp ) +\n texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxy, texelSize.y ), dp ) +\n texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxy, texelSize.y ), dp ) +\n texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxx, texelSize.y ), dp ) +\n texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxx, texelSize.y ), dp )\n ) * ( 1.0 / 9.0 );\n #else\n shadow = texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp );\n #endif\n }\n return mix( 1.0, shadow, shadowIntensity );\n }\n#endif',
kF =
'#if NUM_SPOT_LIGHT_COORDS > 0\n uniform mat4 spotLightMatrix[ NUM_SPOT_LIGHT_COORDS ];\n varying vec4 vSpotLightCoord[ NUM_SPOT_LIGHT_COORDS ];\n#endif\n#ifdef USE_SHADOWMAP\n #if NUM_DIR_LIGHT_SHADOWS > 0\n uniform mat4 directionalShadowMatrix[ NUM_DIR_LIGHT_SHADOWS ];\n varying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ];\n struct DirectionalLightShadow {\n float shadowIntensity;\n float shadowBias;\n float shadowNormalBias;\n float shadowRadius;\n vec2 shadowMapSize;\n };\n uniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ];\n #endif\n #if NUM_SPOT_LIGHT_SHADOWS > 0\n struct SpotLightShadow {\n float shadowIntensity;\n float shadowBias;\n float shadowNormalBias;\n float shadowRadius;\n vec2 shadowMapSize;\n };\n uniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ];\n #endif\n #if NUM_POINT_LIGHT_SHADOWS > 0\n uniform mat4 pointShadowMatrix[ NUM_POINT_LIGHT_SHADOWS ];\n varying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ];\n struct PointLightShadow {\n float shadowIntensity;\n float shadowBias;\n float shadowNormalBias;\n float shadowRadius;\n vec2 shadowMapSize;\n float shadowCameraNear;\n float shadowCameraFar;\n };\n uniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ];\n #endif\n#endif',
zF =
'#if ( defined( USE_SHADOWMAP ) && ( NUM_DIR_LIGHT_SHADOWS > 0 || NUM_POINT_LIGHT_SHADOWS > 0 ) ) || ( NUM_SPOT_LIGHT_COORDS > 0 )\n vec3 shadowWorldNormal = inverseTransformDirection( transformedNormal, viewMatrix );\n vec4 shadowWorldPosition;\n#endif\n#if defined( USE_SHADOWMAP )\n #if NUM_DIR_LIGHT_SHADOWS > 0\n #pragma unroll_loop_start\n for ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) {\n shadowWorldPosition = worldPosition + vec4( shadowWorldNormal * directionalLightShadows[ i ].shadowNormalBias, 0 );\n vDirectionalShadowCoord[ i ] = directionalShadowMatrix[ i ] * shadowWorldPosition;\n }\n #pragma unroll_loop_end\n #endif\n #if NUM_POINT_LIGHT_SHADOWS > 0\n #pragma unroll_loop_start\n for ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) {\n shadowWorldPosition = worldPosition + vec4( shadowWorldNormal * pointLightShadows[ i ].shadowNormalBias, 0 );\n vPointShadowCoord[ i ] = pointShadowMatrix[ i ] * shadowWorldPosition;\n }\n #pragma unroll_loop_end\n #endif\n#endif\n#if NUM_SPOT_LIGHT_COORDS > 0\n #pragma unroll_loop_start\n for ( int i = 0; i < NUM_SPOT_LIGHT_COORDS; i ++ ) {\n shadowWorldPosition = worldPosition;\n #if ( defined( USE_SHADOWMAP ) && UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )\n shadowWorldPosition.xyz += shadowWorldNormal * spotLightShadows[ i ].shadowNormalBias;\n #endif\n vSpotLightCoord[ i ] = spotLightMatrix[ i ] * shadowWorldPosition;\n }\n #pragma unroll_loop_end\n#endif',
VF =
'float getShadowMask() {\n float shadow = 1.0;\n #ifdef USE_SHADOWMAP\n #if NUM_DIR_LIGHT_SHADOWS > 0\n DirectionalLightShadow directionalLight;\n #pragma unroll_loop_start\n for ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) {\n directionalLight = directionalLightShadows[ i ];\n shadow *= receiveShadow ? getShadow( directionalShadowMap[ i ], directionalLight.shadowMapSize, directionalLight.shadowIntensity, directionalLight.shadowBias, directionalLight.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n }\n #pragma unroll_loop_end\n #endif\n #if NUM_SPOT_LIGHT_SHADOWS > 0\n SpotLightShadow spotLight;\n #pragma unroll_loop_start\n for ( int i = 0; i < NUM_SPOT_LIGHT_SHADOWS; i ++ ) {\n spotLight = spotLightShadows[ i ];\n shadow *= receiveShadow ? getShadow( spotShadowMap[ i ], spotLight.shadowMapSize, spotLight.shadowIntensity, spotLight.shadowBias, spotLight.shadowRadius, vSpotLightCoord[ i ] ) : 1.0;\n }\n #pragma unroll_loop_end\n #endif\n #if NUM_POINT_LIGHT_SHADOWS > 0\n PointLightShadow pointLight;\n #pragma unroll_loop_start\n for ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) {\n pointLight = pointLightShadows[ i ];\n shadow *= receiveShadow ? getPointShadow( pointShadowMap[ i ], pointLight.shadowMapSize, pointLight.shadowIntensity, pointLight.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ], pointLight.shadowCameraNear, pointLight.shadowCameraFar ) : 1.0;\n }\n #pragma unroll_loop_end\n #endif\n #endif\n return shadow;\n}',
HF =
'#ifdef USE_SKINNING\n mat4 boneMatX = getBoneMatrix( skinIndex.x );\n mat4 boneMatY = getBoneMatrix( skinIndex.y );\n mat4 boneMatZ = getBoneMatrix( skinIndex.z );\n mat4 boneMatW = getBoneMatrix( skinIndex.w );\n#endif',
$F =
'#ifdef USE_SKINNING\n uniform mat4 bindMatrix;\n uniform mat4 bindMatrixInverse;\n uniform highp sampler2D boneTexture;\n mat4 getBoneMatrix( const in float i ) {\n int size = textureSize( boneTexture, 0 ).x;\n int j = int( i ) * 4;\n int x = j % size;\n int y = j / size;\n vec4 v1 = texelFetch( boneTexture, ivec2( x, y ), 0 );\n vec4 v2 = texelFetch( boneTexture, ivec2( x + 1, y ), 0 );\n vec4 v3 = texelFetch( boneTexture, ivec2( x + 2, y ), 0 );\n vec4 v4 = texelFetch( boneTexture, ivec2( x + 3, y ), 0 );\n return mat4( v1, v2, v3, v4 );\n }\n#endif',
GF =
'#ifdef USE_SKINNING\n vec4 skinVertex = bindMatrix * vec4( transformed, 1.0 );\n vec4 skinned = vec4( 0.0 );\n skinned += boneMatX * skinVertex * skinWeight.x;\n skinned += boneMatY * skinVertex * skinWeight.y;\n skinned += boneMatZ * skinVertex * skinWeight.z;\n skinned += boneMatW * skinVertex * skinWeight.w;\n transformed = ( bindMatrixInverse * skinned ).xyz;\n#endif',
WF =
'#ifdef USE_SKINNING\n mat4 skinMatrix = mat4( 0.0 );\n skinMatrix += skinWeight.x * boneMatX;\n skinMatrix += skinWeight.y * boneMatY;\n skinMatrix += skinWeight.z * boneMatZ;\n skinMatrix += skinWeight.w * boneMatW;\n skinMatrix = bindMatrixInverse * skinMatrix * bindMatrix;\n objectNormal = vec4( skinMatrix * vec4( objectNormal, 0.0 ) ).xyz;\n #ifdef USE_TANGENT\n objectTangent = vec4( skinMatrix * vec4( objectTangent, 0.0 ) ).xyz;\n #endif\n#endif',
QF =
'float specularStrength;\n#ifdef USE_SPECULARMAP\n vec4 texelSpecular = texture2D( specularMap, vSpecularMapUv );\n specularStrength = texelSpecular.r;\n#else\n specularStrength = 1.0;\n#endif',
jF = '#ifdef USE_SPECULARMAP\n uniform sampler2D specularMap;\n#endif',
qF = '#if defined( TONE_MAPPING )\n gl_FragColor.rgb = toneMapping( gl_FragColor.rgb );\n#endif',
XF =
'#ifndef saturate\n#define saturate( a ) clamp( a, 0.0, 1.0 )\n#endif\nuniform float toneMappingExposure;\nvec3 LinearToneMapping( vec3 color ) {\n return saturate( toneMappingExposure * color );\n}\nvec3 ReinhardToneMapping( vec3 color ) {\n color *= toneMappingExposure;\n return saturate( color / ( vec3( 1.0 ) + color ) );\n}\nvec3 CineonToneMapping( vec3 color ) {\n color *= toneMappingExposure;\n color = max( vec3( 0.0 ), color - 0.004 );\n return pow( ( color * ( 6.2 * color + 0.5 ) ) / ( color * ( 6.2 * color + 1.7 ) + 0.06 ), vec3( 2.2 ) );\n}\nvec3 RRTAndODTFit( vec3 v ) {\n vec3 a = v * ( v + 0.0245786 ) - 0.000090537;\n vec3 b = v * ( 0.983729 * v + 0.4329510 ) + 0.238081;\n return a / b;\n}\nvec3 ACESFilmicToneMapping( vec3 color ) {\n const mat3 ACESInputMat = mat3(\n vec3( 0.59719, 0.07600, 0.02840 ), vec3( 0.35458, 0.90834, 0.13383 ),\n vec3( 0.04823, 0.01566, 0.83777 )\n );\n const mat3 ACESOutputMat = mat3(\n vec3( 1.60475, -0.10208, -0.00327 ), vec3( -0.53108, 1.10813, -0.07276 ),\n vec3( -0.07367, -0.00605, 1.07602 )\n );\n color *= toneMappingExposure / 0.6;\n color = ACESInputMat * color;\n color = RRTAndODTFit( color );\n color = ACESOutputMat * color;\n return saturate( color );\n}\nconst mat3 LINEAR_REC2020_TO_LINEAR_SRGB = mat3(\n vec3( 1.6605, - 0.1246, - 0.0182 ),\n vec3( - 0.5876, 1.1329, - 0.1006 ),\n vec3( - 0.0728, - 0.0083, 1.1187 )\n);\nconst mat3 LINEAR_SRGB_TO_LINEAR_REC2020 = mat3(\n vec3( 0.6274, 0.0691, 0.0164 ),\n vec3( 0.3293, 0.9195, 0.0880 ),\n vec3( 0.0433, 0.0113, 0.8956 )\n);\nvec3 agxDefaultContrastApprox( vec3 x ) {\n vec3 x2 = x * x;\n vec3 x4 = x2 * x2;\n return + 15.5 * x4 * x2\n - 40.14 * x4 * x\n + 31.96 * x4\n - 6.868 * x2 * x\n + 0.4298 * x2\n + 0.1191 * x\n - 0.00232;\n}\nvec3 AgXToneMapping( vec3 color ) {\n const mat3 AgXInsetMatrix = mat3(\n vec3( 0.856627153315983, 0.137318972929847, 0.11189821299995 ),\n vec3( 0.0951212405381588, 0.761241990602591, 0.0767994186031903 ),\n vec3( 0.0482516061458583, 0.101439036467562, 0.811302368396859 )\n );\n const mat3 AgXOutsetMatrix = mat3(\n vec3( 1.1271005818144368, - 0.1413297634984383, - 0.14132976349843826 ),\n vec3( - 0.11060664309660323, 1.157823702216272, - 0.11060664309660294 ),\n vec3( - 0.016493938717834573, - 0.016493938717834257, 1.2519364065950405 )\n );\n const float AgxMinEv = - 12.47393; const float AgxMaxEv = 4.026069;\n color *= toneMappingExposure;\n color = LINEAR_SRGB_TO_LINEAR_REC2020 * color;\n color = AgXInsetMatrix * color;\n color = max( color, 1e-10 ); color = log2( color );\n color = ( color - AgxMinEv ) / ( AgxMaxEv - AgxMinEv );\n color = clamp( color, 0.0, 1.0 );\n color = agxDefaultContrastApprox( color );\n color = AgXOutsetMatrix * color;\n color = pow( max( vec3( 0.0 ), color ), vec3( 2.2 ) );\n color = LINEAR_REC2020_TO_LINEAR_SRGB * color;\n color = clamp( color, 0.0, 1.0 );\n return color;\n}\nvec3 NeutralToneMapping( vec3 color ) {\n const float StartCompression = 0.8 - 0.04;\n const float Desaturation = 0.15;\n color *= toneMappingExposure;\n float x = min( color.r, min( color.g, color.b ) );\n float offset = x < 0.08 ? x - 6.25 * x * x : 0.04;\n color -= offset;\n float peak = max( color.r, max( color.g, color.b ) );\n if ( peak < StartCompression ) return color;\n float d = 1. - StartCompression;\n float newPeak = 1. - d * d / ( peak + d - StartCompression );\n color *= newPeak / peak;\n float g = 1. - 1. / ( Desaturation * ( peak - newPeak ) + 1. );\n return mix( color, vec3( newPeak ), g );\n}\nvec3 CustomToneMapping( vec3 color ) { return color; }',
KF =
'#ifdef USE_TRANSMISSION\n material.transmission = transmission;\n material.transmissionAlpha = 1.0;\n material.thickness = thickness;\n material.attenuationDistance = attenuationDistance;\n material.attenuationColor = attenuationColor;\n #ifdef USE_TRANSMISSIONMAP\n material.transmission *= texture2D( transmissionMap, vTransmissionMapUv ).r;\n #endif\n #ifdef USE_THICKNESSMAP\n material.thickness *= texture2D( thicknessMap, vThicknessMapUv ).g;\n #endif\n vec3 pos = vWorldPosition;\n vec3 v = normalize( cameraPosition - pos );\n vec3 n = inverseTransformDirection( normal, viewMatrix );\n vec4 transmitted = getIBLVolumeRefraction(\n n, v, material.roughness, material.diffuseColor, material.specularColor, material.specularF90,\n pos, modelMatrix, viewMatrix, projectionMatrix, material.dispersion, material.ior, material.thickness,\n material.attenuationColor, material.attenuationDistance );\n material.transmissionAlpha = mix( material.transmissionAlpha, transmitted.a, material.transmission );\n totalDiffuse = mix( totalDiffuse, transmitted.rgb, material.transmission );\n#endif',
YF =
'#ifdef USE_TRANSMISSION\n uniform float transmission;\n uniform float thickness;\n uniform float attenuationDistance;\n uniform vec3 attenuationColor;\n #ifdef USE_TRANSMISSIONMAP\n uniform sampler2D transmissionMap;\n #endif\n #ifdef USE_THICKNESSMAP\n uniform sampler2D thicknessMap;\n #endif\n uniform vec2 transmissionSamplerSize;\n uniform sampler2D transmissionSamplerMap;\n uniform mat4 modelMatrix;\n uniform mat4 projectionMatrix;\n varying vec3 vWorldPosition;\n float w0( float a ) {\n return ( 1.0 / 6.0 ) * ( a * ( a * ( - a + 3.0 ) - 3.0 ) + 1.0 );\n }\n float w1( float a ) {\n return ( 1.0 / 6.0 ) * ( a * a * ( 3.0 * a - 6.0 ) + 4.0 );\n }\n float w2( float a ){\n return ( 1.0 / 6.0 ) * ( a * ( a * ( - 3.0 * a + 3.0 ) + 3.0 ) + 1.0 );\n }\n float w3( float a ) {\n return ( 1.0 / 6.0 ) * ( a * a * a );\n }\n float g0( float a ) {\n return w0( a ) + w1( a );\n }\n float g1( float a ) {\n return w2( a ) + w3( a );\n }\n float h0( float a ) {\n return - 1.0 + w1( a ) / ( w0( a ) + w1( a ) );\n }\n float h1( float a ) {\n return 1.0 + w3( a ) / ( w2( a ) + w3( a ) );\n }\n vec4 bicubic( sampler2D tex, vec2 uv, vec4 texelSize, float lod ) {\n uv = uv * texelSize.zw + 0.5;\n vec2 iuv = floor( uv );\n vec2 fuv = fract( uv );\n float g0x = g0( fuv.x );\n float g1x = g1( fuv.x );\n float h0x = h0( fuv.x );\n float h1x = h1( fuv.x );\n float h0y = h0( fuv.y );\n float h1y = h1( fuv.y );\n vec2 p0 = ( vec2( iuv.x + h0x, iuv.y + h0y ) - 0.5 ) * texelSize.xy;\n vec2 p1 = ( vec2( iuv.x + h1x, iuv.y + h0y ) - 0.5 ) * texelSize.xy;\n vec2 p2 = ( vec2( iuv.x + h0x, iuv.y + h1y ) - 0.5 ) * texelSize.xy;\n vec2 p3 = ( vec2( iuv.x + h1x, iuv.y + h1y ) - 0.5 ) * texelSize.xy;\n return g0( fuv.y ) * ( g0x * textureLod( tex, p0, lod ) + g1x * textureLod( tex, p1, lod ) ) +\n g1( fuv.y ) * ( g0x * textureLod( tex, p2, lod ) + g1x * textureLod( tex, p3, lod ) );\n }\n vec4 textureBicubic( sampler2D sampler, vec2 uv, float lod ) {\n vec2 fLodSize = vec2( textureSize( sampler, int( lod ) ) );\n vec2 cLodSize = vec2( textureSize( sampler, int( lod + 1.0 ) ) );\n vec2 fLodSizeInv = 1.0 / fLodSize;\n vec2 cLodSizeInv = 1.0 / cLodSize;\n vec4 fSample = bicubic( sampler, uv, vec4( fLodSizeInv, fLodSize ), floor( lod ) );\n vec4 cSample = bicubic( sampler, uv, vec4( cLodSizeInv, cLodSize ), ceil( lod ) );\n return mix( fSample, cSample, fract( lod ) );\n }\n vec3 getVolumeTransmissionRay( const in vec3 n, const in vec3 v, const in float thickness, const in float ior, const in mat4 modelMatrix ) {\n vec3 refractionVector = refract( - v, normalize( n ), 1.0 / ior );\n vec3 modelScale;\n modelScale.x = length( vec3( modelMatrix[ 0 ].xyz ) );\n modelScale.y = length( vec3( modelMatrix[ 1 ].xyz ) );\n modelScale.z = length( vec3( modelMatrix[ 2 ].xyz ) );\n return normalize( refractionVector ) * thickness * modelScale;\n }\n float applyIorToRoughness( const in float roughness, const in float ior ) {\n return roughness * clamp( ior * 2.0 - 2.0, 0.0, 1.0 );\n }\n vec4 getTransmissionSample( const in vec2 fragCoord, const in float roughness, const in float ior ) {\n float lod = log2( transmissionSamplerSize.x ) * applyIorToRoughness( roughness, ior );\n return textureBicubic( transmissionSamplerMap, fragCoord.xy, lod );\n }\n vec3 volumeAttenuation( const in float transmissionDistance, const in vec3 attenuationColor, const in float attenuationDistance ) {\n if ( isinf( attenuationDistance ) ) {\n return vec3( 1.0 );\n } else {\n vec3 attenuationCoefficient = -log( attenuationColor ) / attenuationDistance;\n vec3 transmittance = exp( - attenuationCoefficient * transmissionDistance ); return transmittance;\n }\n }\n vec4 getIBLVolumeRefraction( const in vec3 n, const in vec3 v, const in float roughness, const in vec3 diffuseColor,\n const in vec3 specularColor, const in float specularF90, const in vec3 position, const in mat4 modelMatrix,\n const in mat4 viewMatrix, const in mat4 projMatrix, const in float dispersion, const in float ior, const in float thickness,\n const in vec3 attenuationColor, const in float attenuationDistance ) {\n vec4 transmittedLight;\n vec3 transmittance;\n #ifdef USE_DISPERSION\n float halfSpread = ( ior - 1.0 ) * 0.025 * dispersion;\n vec3 iors = vec3( ior - halfSpread, ior, ior + halfSpread );\n for ( int i = 0; i < 3; i ++ ) {\n vec3 transmissionRay = getVolumeTransmissionRay( n, v, thickness, iors[ i ], modelMatrix );\n vec3 refractedRayExit = position + transmissionRay;\n vec4 ndcPos = projMatrix * viewMatrix * vec4( refractedRayExit, 1.0 );\n vec2 refractionCoords = ndcPos.xy / ndcPos.w;\n refractionCoords += 1.0;\n refractionCoords /= 2.0;\n vec4 transmissionSample = getTransmissionSample( refractionCoords, roughness, iors[ i ] );\n transmittedLight[ i ] = transmissionSample[ i ];\n transmittedLight.a += transmissionSample.a;\n transmittance[ i ] = diffuseColor[ i ] * volumeAttenuation( length( transmissionRay ), attenuationColor, attenuationDistance )[ i ];\n }\n transmittedLight.a /= 3.0;\n #else\n vec3 transmissionRay = getVolumeTransmissionRay( n, v, thickness, ior, modelMatrix );\n vec3 refractedRayExit = position + transmissionRay;\n vec4 ndcPos = projMatrix * viewMatrix * vec4( refractedRayExit, 1.0 );\n vec2 refractionCoords = ndcPos.xy / ndcPos.w;\n refractionCoords += 1.0;\n refractionCoords /= 2.0;\n transmittedLight = getTransmissionSample( refractionCoords, roughness, ior );\n transmittance = diffuseColor * volumeAttenuation( length( transmissionRay ), attenuationColor, attenuationDistance );\n #endif\n vec3 attenuatedColor = transmittance * transmittedLight.rgb;\n vec3 F = EnvironmentBRDF( n, v, specularColor, specularF90, roughness );\n float transmittanceFactor = ( transmittance.r + transmittance.g + transmittance.b ) / 3.0;\n return vec4( ( 1.0 - F ) * attenuatedColor, 1.0 - ( 1.0 - transmittedLight.a ) * transmittanceFactor );\n }\n#endif',
ZF =
'#if defined( USE_UV ) || defined( USE_ANISOTROPY )\n varying vec2 vUv;\n#endif\n#ifdef USE_MAP\n varying vec2 vMapUv;\n#endif\n#ifdef USE_ALPHAMAP\n varying vec2 vAlphaMapUv;\n#endif\n#ifdef USE_LIGHTMAP\n varying vec2 vLightMapUv;\n#endif\n#ifdef USE_AOMAP\n varying vec2 vAoMapUv;\n#endif\n#ifdef USE_BUMPMAP\n varying vec2 vBumpMapUv;\n#endif\n#ifdef USE_NORMALMAP\n varying vec2 vNormalMapUv;\n#endif\n#ifdef USE_EMISSIVEMAP\n varying vec2 vEmissiveMapUv;\n#endif\n#ifdef USE_METALNESSMAP\n varying vec2 vMetalnessMapUv;\n#endif\n#ifdef USE_ROUGHNESSMAP\n varying vec2 vRoughnessMapUv;\n#endif\n#ifdef USE_ANISOTROPYMAP\n varying vec2 vAnisotropyMapUv;\n#endif\n#ifdef USE_CLEARCOATMAP\n varying vec2 vClearcoatMapUv;\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n varying vec2 vClearcoatNormalMapUv;\n#endif\n#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n varying vec2 vClearcoatRoughnessMapUv;\n#endif\n#ifdef USE_IRIDESCENCEMAP\n varying vec2 vIridescenceMapUv;\n#endif\n#ifdef USE_IRIDESCENCE_THICKNESSMAP\n varying vec2 vIridescenceThicknessMapUv;\n#endif\n#ifdef USE_SHEEN_COLORMAP\n varying vec2 vSheenColorMapUv;\n#endif\n#ifdef USE_SHEEN_ROUGHNESSMAP\n varying vec2 vSheenRoughnessMapUv;\n#endif\n#ifdef USE_SPECULARMAP\n varying vec2 vSpecularMapUv;\n#endif\n#ifdef USE_SPECULAR_COLORMAP\n varying vec2 vSpecularColorMapUv;\n#endif\n#ifdef USE_SPECULAR_INTENSITYMAP\n varying vec2 vSpecularIntensityMapUv;\n#endif\n#ifdef USE_TRANSMISSIONMAP\n uniform mat3 transmissionMapTransform;\n varying vec2 vTransmissionMapUv;\n#endif\n#ifdef USE_THICKNESSMAP\n uniform mat3 thicknessMapTransform;\n varying vec2 vThicknessMapUv;\n#endif',
JF =
'#if defined( USE_UV ) || defined( USE_ANISOTROPY )\n varying vec2 vUv;\n#endif\n#ifdef USE_MAP\n uniform mat3 mapTransform;\n varying vec2 vMapUv;\n#endif\n#ifdef USE_ALPHAMAP\n uniform mat3 alphaMapTransform;\n varying vec2 vAlphaMapUv;\n#endif\n#ifdef USE_LIGHTMAP\n uniform mat3 lightMapTransform;\n varying vec2 vLightMapUv;\n#endif\n#ifdef USE_AOMAP\n uniform mat3 aoMapTransform;\n varying vec2 vAoMapUv;\n#endif\n#ifdef USE_BUMPMAP\n uniform mat3 bumpMapTransform;\n varying vec2 vBumpMapUv;\n#endif\n#ifdef USE_NORMALMAP\n uniform mat3 normalMapTransform;\n varying vec2 vNormalMapUv;\n#endif\n#ifdef USE_DISPLACEMENTMAP\n uniform mat3 displacementMapTransform;\n varying vec2 vDisplacementMapUv;\n#endif\n#ifdef USE_EMISSIVEMAP\n uniform mat3 emissiveMapTransform;\n varying vec2 vEmissiveMapUv;\n#endif\n#ifdef USE_METALNESSMAP\n uniform mat3 metalnessMapTransform;\n varying vec2 vMetalnessMapUv;\n#endif\n#ifdef USE_ROUGHNESSMAP\n uniform mat3 roughnessMapTransform;\n varying vec2 vRoughnessMapUv;\n#endif\n#ifdef USE_ANISOTROPYMAP\n uniform mat3 anisotropyMapTransform;\n varying vec2 vAnisotropyMapUv;\n#endif\n#ifdef USE_CLEARCOATMAP\n uniform mat3 clearcoatMapTransform;\n varying vec2 vClearcoatMapUv;\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n uniform mat3 clearcoatNormalMapTransform;\n varying vec2 vClearcoatNormalMapUv;\n#endif\n#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n uniform mat3 clearcoatRoughnessMapTransform;\n varying vec2 vClearcoatRoughnessMapUv;\n#endif\n#ifdef USE_SHEEN_COLORMAP\n uniform mat3 sheenColorMapTransform;\n varying vec2 vSheenColorMapUv;\n#endif\n#ifdef USE_SHEEN_ROUGHNESSMAP\n uniform mat3 sheenRoughnessMapTransform;\n varying vec2 vSheenRoughnessMapUv;\n#endif\n#ifdef USE_IRIDESCENCEMAP\n uniform mat3 iridescenceMapTransform;\n varying vec2 vIridescenceMapUv;\n#endif\n#ifdef USE_IRIDESCENCE_THICKNESSMAP\n uniform mat3 iridescenceThicknessMapTransform;\n varying vec2 vIridescenceThicknessMapUv;\n#endif\n#ifdef USE_SPECULARMAP\n uniform mat3 specularMapTransform;\n varying vec2 vSpecularMapUv;\n#endif\n#ifdef USE_SPECULAR_COLORMAP\n uniform mat3 specularColorMapTransform;\n varying vec2 vSpecularColorMapUv;\n#endif\n#ifdef USE_SPECULAR_INTENSITYMAP\n uniform mat3 specularIntensityMapTransform;\n varying vec2 vSpecularIntensityMapUv;\n#endif\n#ifdef USE_TRANSMISSIONMAP\n uniform mat3 transmissionMapTransform;\n varying vec2 vTransmissionMapUv;\n#endif\n#ifdef USE_THICKNESSMAP\n uniform mat3 thicknessMapTransform;\n varying vec2 vThicknessMapUv;\n#endif',
e7 =
'#if defined( USE_UV ) || defined( USE_ANISOTROPY )\n vUv = vec3( uv, 1 ).xy;\n#endif\n#ifdef USE_MAP\n vMapUv = ( mapTransform * vec3( MAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_ALPHAMAP\n vAlphaMapUv = ( alphaMapTransform * vec3( ALPHAMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_LIGHTMAP\n vLightMapUv = ( lightMapTransform * vec3( LIGHTMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_AOMAP\n vAoMapUv = ( aoMapTransform * vec3( AOMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_BUMPMAP\n vBumpMapUv = ( bumpMapTransform * vec3( BUMPMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_NORMALMAP\n vNormalMapUv = ( normalMapTransform * vec3( NORMALMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_DISPLACEMENTMAP\n vDisplacementMapUv = ( displacementMapTransform * vec3( DISPLACEMENTMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_EMISSIVEMAP\n vEmissiveMapUv = ( emissiveMapTransform * vec3( EMISSIVEMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_METALNESSMAP\n vMetalnessMapUv = ( metalnessMapTransform * vec3( METALNESSMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_ROUGHNESSMAP\n vRoughnessMapUv = ( roughnessMapTransform * vec3( ROUGHNESSMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_ANISOTROPYMAP\n vAnisotropyMapUv = ( anisotropyMapTransform * vec3( ANISOTROPYMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_CLEARCOATMAP\n vClearcoatMapUv = ( clearcoatMapTransform * vec3( CLEARCOATMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n vClearcoatNormalMapUv = ( clearcoatNormalMapTransform * vec3( CLEARCOAT_NORMALMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n vClearcoatRoughnessMapUv = ( clearcoatRoughnessMapTransform * vec3( CLEARCOAT_ROUGHNESSMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_IRIDESCENCEMAP\n vIridescenceMapUv = ( iridescenceMapTransform * vec3( IRIDESCENCEMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_IRIDESCENCE_THICKNESSMAP\n vIridescenceThicknessMapUv = ( iridescenceThicknessMapTransform * vec3( IRIDESCENCE_THICKNESSMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_SHEEN_COLORMAP\n vSheenColorMapUv = ( sheenColorMapTransform * vec3( SHEEN_COLORMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_SHEEN_ROUGHNESSMAP\n vSheenRoughnessMapUv = ( sheenRoughnessMapTransform * vec3( SHEEN_ROUGHNESSMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_SPECULARMAP\n vSpecularMapUv = ( specularMapTransform * vec3( SPECULARMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_SPECULAR_COLORMAP\n vSpecularColorMapUv = ( specularColorMapTransform * vec3( SPECULAR_COLORMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_SPECULAR_INTENSITYMAP\n vSpecularIntensityMapUv = ( specularIntensityMapTransform * vec3( SPECULAR_INTENSITYMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_TRANSMISSIONMAP\n vTransmissionMapUv = ( transmissionMapTransform * vec3( TRANSMISSIONMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_THICKNESSMAP\n vThicknessMapUv = ( thicknessMapTransform * vec3( THICKNESSMAP_UV, 1 ) ).xy;\n#endif',
t7 =
'#if defined( USE_ENVMAP ) || defined( DISTANCE ) || defined ( USE_SHADOWMAP ) || defined ( USE_TRANSMISSION ) || NUM_SPOT_LIGHT_COORDS > 0\n vec4 worldPosition = vec4( transformed, 1.0 );\n #ifdef USE_BATCHING\n worldPosition = batchingMatrix * worldPosition;\n #endif\n #ifdef USE_INSTANCING\n worldPosition = instanceMatrix * worldPosition;\n #endif\n worldPosition = modelMatrix * worldPosition;\n#endif'
const n7 =
'varying vec2 vUv;\nuniform mat3 uvTransform;\nvoid main() {\n vUv = ( uvTransform * vec3( uv, 1 ) ).xy;\n gl_Position = vec4( position.xy, 1.0, 1.0 );\n}',
i7 =
'uniform sampler2D t2D;\nuniform float backgroundIntensity;\nvarying vec2 vUv;\nvoid main() {\n vec4 texColor = texture2D( t2D, vUv );\n #ifdef DECODE_VIDEO_TEXTURE\n texColor = 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 #endif\n texColor.rgb *= backgroundIntensity;\n gl_FragColor = texColor;\n #include \n #include \n}',
r7 =
'varying vec3 vWorldDirection;\n#include \nvoid main() {\n vWorldDirection = transformDirection( position, modelMatrix );\n #include \n #include \n gl_Position.z = gl_Position.w;\n}',
s7 =
'#ifdef ENVMAP_TYPE_CUBE\n uniform samplerCube envMap;\n#elif defined( ENVMAP_TYPE_CUBE_UV )\n uniform sampler2D envMap;\n#endif\nuniform float flipEnvMap;\nuniform float backgroundBlurriness;\nuniform float backgroundIntensity;\nuniform mat3 backgroundRotation;\nvarying vec3 vWorldDirection;\n#include \nvoid main() {\n #ifdef ENVMAP_TYPE_CUBE\n vec4 texColor = textureCube( envMap, backgroundRotation * vec3( flipEnvMap * vWorldDirection.x, vWorldDirection.yz ) );\n #elif defined( ENVMAP_TYPE_CUBE_UV )\n vec4 texColor = textureCubeUV( envMap, backgroundRotation * vWorldDirection, backgroundBlurriness );\n #else\n vec4 texColor = vec4( 0.0, 0.0, 0.0, 1.0 );\n #endif\n texColor.rgb *= backgroundIntensity;\n gl_FragColor = texColor;\n #include \n #include \n}',
o7 =
'varying vec3 vWorldDirection;\n#include \nvoid main() {\n vWorldDirection = transformDirection( position, modelMatrix );\n #include \n #include \n gl_Position.z = gl_Position.w;\n}',
a7 =
'uniform samplerCube tCube;\nuniform float tFlip;\nuniform float opacity;\nvarying vec3 vWorldDirection;\nvoid main() {\n vec4 texColor = textureCube( tCube, vec3( tFlip * vWorldDirection.x, vWorldDirection.yz ) );\n gl_FragColor = texColor;\n gl_FragColor.a *= opacity;\n #include \n #include \n}',
l7 =
'#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvarying vec2 vHighPrecisionZW;\nvoid main() {\n #include \n #include \n #include \n #include \n #ifdef USE_DISPLACEMENTMAP\n #include \n #include \n #include \n #endif\n #include \n #include \n #include \n #include \n #include \n #include \n #include \n vHighPrecisionZW = gl_Position.zw;\n}',
c7 =
'#if DEPTH_PACKING == 3200\n uniform 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 vec4 diffuseColor = vec4( 1.0 );\n #include \n #if DEPTH_PACKING == 3200\n diffuseColor.a = opacity;\n #endif\n #include \n #include \n #include \n #include \n #include \n float fragCoordZ = 0.5 * vHighPrecisionZW[0] / vHighPrecisionZW[1] + 0.5;\n #if DEPTH_PACKING == 3200\n gl_FragColor = vec4( vec3( 1.0 - fragCoordZ ), opacity );\n #elif DEPTH_PACKING == 3201\n gl_FragColor = packDepthToRGBA( fragCoordZ );\n #elif DEPTH_PACKING == 3202\n gl_FragColor = vec4( packDepthToRGB( fragCoordZ ), 1.0 );\n #elif DEPTH_PACKING == 3203\n gl_FragColor = vec4( packDepthToRG( fragCoordZ ), 0.0, 1.0 );\n #endif\n}',
u7 =
'#define DISTANCE\nvarying vec3 vWorldPosition;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n #include \n #include \n #include \n #include \n #ifdef USE_DISPLACEMENTMAP\n #include \n #include \n #include \n #endif\n #include \n #include \n #include \n #include \n #include \n #include \n #include \n vWorldPosition = worldPosition.xyz;\n}',
d7 =
'#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 vec4 diffuseColor = vec4( 1.0 );\n #include \n #include \n #include \n #include \n #include \n float dist = length( vWorldPosition - referencePosition );\n dist = ( dist - nearDistance ) / ( farDistance - nearDistance );\n dist = saturate( dist );\n gl_FragColor = packDepthToRGBA( dist );\n}',
h7 =
'varying vec3 vWorldDirection;\n#include \nvoid main() {\n vWorldDirection = transformDirection( position, modelMatrix );\n #include \n #include \n}',
f7 =
'uniform sampler2D tEquirect;\nvarying vec3 vWorldDirection;\n#include \nvoid main() {\n vec3 direction = normalize( vWorldDirection );\n vec2 sampleUV = equirectUv( direction );\n gl_FragColor = texture2D( tEquirect, sampleUV );\n #include \n #include \n}',
p7 =
'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 vLineDistance = scale * lineDistance;\n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n}',
m7 =
'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 vec4 diffuseColor = vec4( diffuse, opacity );\n #include \n if ( mod( vLineDistance, totalSize ) > dashSize ) {\n discard;\n }\n vec3 outgoingLight = vec3( 0.0 );\n #include \n #include \n #include \n outgoingLight = diffuseColor.rgb;\n #include \n #include \n #include \n #include \n #include \n}',
g7 =
'#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n #include \n #include \n #include \n #include \n #include \n #if defined ( USE_ENVMAP ) || defined ( USE_SKINNING )\n #include \n #include \n #include \n #include \n #include \n #endif\n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n}',
y7 =
'uniform vec3 diffuse;\nuniform float opacity;\n#ifndef FLAT_SHADED\n varying 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 vec4 diffuseColor = vec4( diffuse, opacity );\n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n #ifdef USE_LIGHTMAP\n vec4 lightMapTexel = texture2D( lightMap, vLightMapUv );\n reflectedLight.indirectDiffuse += lightMapTexel.rgb * lightMapIntensity * RECIPROCAL_PI;\n #else\n reflectedLight.indirectDiffuse += vec3( 1.0 );\n #endif\n #include \n reflectedLight.indirectDiffuse *= diffuseColor.rgb;\n vec3 outgoingLight = reflectedLight.indirectDiffuse;\n #include \n #include \n #include \n #include \n #include \n #include \n #include \n}',
v7 =
'#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 #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 vViewPosition = - mvPosition.xyz;\n #include \n #include \n #include \n #include \n}',
_7 =
'#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 vec4 diffuseColor = vec4( diffuse, opacity );\n #include \n ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n vec3 totalEmissiveRadiance = emissive;\n #include \n #include \n #include