import { d as K1, b as Q1, w as ew, h as tw, c as iw, m as rw, _ as nw, p as ow, E as Wu } from "./index-Dm_oomn1.js"; import { C as aw } from "./ContentMixin-Klv1uUY6.js"; import { ref as Ae, defineComponent as Ie, computed as ce, openBlock as ge, createElementBlock as Le, mergeProps as Or, unref as G, renderSlot as qe, useAttrs as sw, useSlots as au, shallowRef as Ci, watch as Ke, nextTick as wt, onMounted as ei, toRef as Di, createCommentVNode as Ve, Fragment as Vt, normalizeClass as Re, createElementVNode as ke, createBlock as Ue, withCtx as me, resolveDynamicComponent as Ni, withModifiers as ai, createVNode as le, toDisplayString as xt, normalizeStyle as Ot, provide as ci, reactive as Xi, onActivated as lw, onUpdated as rp, inject as ct, onBeforeUnmount as or, withDirectives as It, cloneVNode as cw, Text as o0, Comment as uw, Transition as hl, vShow as fi, readonly as a0, onDeactivated as hw, toHandlers as dw, withKeys as mr, createTextVNode as vt, createSlots as pw, toRefs as ln, getCurrentInstance as ri, h as ba, renderList as tr, onUnmounted as s0, markRaw as Mi, watchEffect as l0, warn as fw, onBeforeMount as mw, toRaw as np, getCurrentScope as c0, onScopeDispose as u0, isRef as Ro, isVNode as Qh, Teleport as gw, resolveComponent as Ei, resolveDirective as vw, toHandlerKey as yw, vModelText as bw, createApp as xw, hasInjectionContext as ww, effectScope as _w, isReactive as op, pushScopeId as Mw, popScopeId as Sw } from "vue"; const Jr = (i, e, { checkForDefaultPrevented: t = !0 } = {}) => (r) => { const n = i == null ? void 0 : i(r); if (t === !1 || !n) return e == null ? void 0 : e(r); }; var Tw = Object.defineProperty, Ew = Object.defineProperties, Aw = Object.getOwnPropertyDescriptors, Uf = Object.getOwnPropertySymbols, Cw = Object.prototype.hasOwnProperty, Lw = Object.prototype.propertyIsEnumerable, Gf = (i, e, t) => e in i ? Tw(i, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : i[e] = t, Rw = (i, e) => { for (var t in e || (e = {})) Cw.call(e, t) && Gf(i, t, e[t]); if (Uf) for (var t of Uf(e)) Lw.call(e, t) && Gf(i, t, e[t]); return i; }, Ow = (i, e) => Ew(i, Aw(e)); function Hf(i, e) { var t; const r = Ci(); return l0(() => { r.value = i(); }, Ow(Rw({}, e), { flush: (t = void 0) != null ? t : "sync" })), a0(r); } var jf; const Kt = typeof window < "u", Pw = (i) => typeof i == "string", h0 = () => { }, ed = Kt && ((jf = window == null ? void 0 : window.navigator) == null ? void 0 : jf.userAgent) && /iP(ad|hone|od)/.test(window.navigator.userAgent); function d0(i) { return typeof i == "function" ? i() : G(i); } function Iw(i) { return i; } function su(i) { return c0() ? (u0(i), !0) : !1; } function Dw(i, e = !0) { ri() ? ei(i) : e ? i() : wt(i); } function tn(i) { var e; const t = d0(i); return (e = t == null ? void 0 : t.$el) != null ? e : t; } const dl = Kt ? window : void 0, Nw = Kt ? window.document : void 0; function si(...i) { let e, t, r, n; if (Pw(i[0]) || Array.isArray(i[0]) ? ([t, r, n] = i, e = dl) : [e, t, r, n] = i, !e) return h0; Array.isArray(t) || (t = [t]), Array.isArray(r) || (r = [r]); const o = [], a = () => { o.forEach((h) => h()), o.length = 0; }, s = (h, u, p, g) => (h.addEventListener(u, p, g), () => h.removeEventListener(u, p, g)), c = Ke(() => [tn(e), d0(n)], ([h, u]) => { a(), h && o.push(...t.flatMap((p) => r.map((g) => s(h, p, g, u)))); }, { immediate: !0, flush: "post" }), l = () => { c(), a(); }; return su(l), l; } let Wf = !1; function Bw(i, e, t = {}) { const { window: r = dl, ignore: n = [], capture: o = !0, detectIframe: a = !1 } = t; if (!r) return; ed && !Wf && (Wf = !0, Array.from(r.document.body.children).forEach((h) => h.addEventListener("click", h0))); let s = !0; const c = (h) => n.some((u) => { if (typeof u == "string") return Array.from(r.document.querySelectorAll(u)).some((p) => p === h.target || h.composedPath().includes(p)); { const p = tn(u); return p && (h.target === p || h.composedPath().includes(p)); } }), l = [ si(r, "click", (h) => { const u = tn(i); if (!(!u || u === h.target || h.composedPath().includes(u))) { if (h.detail === 0 && (s = !c(h)), !s) { s = !0; return; } e(h); } }, { passive: !0, capture: o }), si(r, "pointerdown", (h) => { const u = tn(i); u && (s = !h.composedPath().includes(u) && !c(h)); }, { passive: !0 }), a && si(r, "blur", (h) => { var u; const p = tn(i); ((u = r.document.activeElement) == null ? void 0 : u.tagName) === "IFRAME" && !(p != null && p.contains(r.document.activeElement)) && e(h); }) ].filter(Boolean); return () => l.forEach((h) => h()); } function p0(i, e = !1) { const t = Ae(), r = () => t.value = !!i(); return r(), Dw(r, e), t; } const $f = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {}, qf = "__vueuse_ssr_handlers__"; $f[qf] = $f[qf] || {}; function kw({ document: i = Nw } = {}) { if (!i) return Ae("visible"); const e = Ae(i.visibilityState); return si(i, "visibilitychange", () => { e.value = i.visibilityState; }), e; } var Xf = Object.getOwnPropertySymbols, zw = Object.prototype.hasOwnProperty, Fw = Object.prototype.propertyIsEnumerable, Vw = (i, e) => { var t = {}; for (var r in i) zw.call(i, r) && e.indexOf(r) < 0 && (t[r] = i[r]); if (i != null && Xf) for (var r of Xf(i)) e.indexOf(r) < 0 && Fw.call(i, r) && (t[r] = i[r]); return t; }; function er(i, e, t = {}) { const r = t, { window: n = dl } = r, o = Vw(r, ["window"]); let a; const s = p0(() => n && "ResizeObserver" in n), c = () => { a && (a.disconnect(), a = void 0); }, l = Ke(() => tn(i), (u) => { c(), s.value && n && u && (a = new ResizeObserver(e), a.observe(u, o)); }, { immediate: !0, flush: "post" }), h = () => { c(), l(); }; return su(h), { isSupported: s, stop: h }; } var Zf = Object.getOwnPropertySymbols, Uw = Object.prototype.hasOwnProperty, Gw = Object.prototype.propertyIsEnumerable, Hw = (i, e) => { var t = {}; for (var r in i) Uw.call(i, r) && e.indexOf(r) < 0 && (t[r] = i[r]); if (i != null && Zf) for (var r of Zf(i)) e.indexOf(r) < 0 && Gw.call(i, r) && (t[r] = i[r]); return t; }; function jw(i, e, t = {}) { const r = t, { window: n = dl } = r, o = Hw(r, ["window"]); let a; const s = p0(() => n && "MutationObserver" in n), c = () => { a && (a.disconnect(), a = void 0); }, l = Ke(() => tn(i), (u) => { c(), s.value && n && u && (a = new MutationObserver(e), a.observe(u, o)); }, { immediate: !0 }), h = () => { c(), l(); }; return su(h), { isSupported: s, stop: h }; } var Yf; (function(i) { i.UP = "UP", i.RIGHT = "RIGHT", i.DOWN = "DOWN", i.LEFT = "LEFT", i.NONE = "NONE"; })(Yf || (Yf = {})); var Ww = Object.defineProperty, Jf = Object.getOwnPropertySymbols, $w = Object.prototype.hasOwnProperty, qw = Object.prototype.propertyIsEnumerable, Kf = (i, e, t) => e in i ? Ww(i, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : i[e] = t, Xw = (i, e) => { for (var t in e || (e = {})) $w.call(e, t) && Kf(i, t, e[t]); if (Jf) for (var t of Jf(e)) qw.call(e, t) && Kf(i, t, e[t]); return i; }; const Zw = { easeInSine: [0.12, 0, 0.39, 0], easeOutSine: [0.61, 1, 0.88, 1], easeInOutSine: [0.37, 0, 0.63, 1], easeInQuad: [0.11, 0, 0.5, 0], easeOutQuad: [0.5, 1, 0.89, 1], easeInOutQuad: [0.45, 0, 0.55, 1], easeInCubic: [0.32, 0, 0.67, 0], easeOutCubic: [0.33, 1, 0.68, 1], easeInOutCubic: [0.65, 0, 0.35, 1], easeInQuart: [0.5, 0, 0.75, 0], easeOutQuart: [0.25, 1, 0.5, 1], easeInOutQuart: [0.76, 0, 0.24, 1], easeInQuint: [0.64, 0, 0.78, 0], easeOutQuint: [0.22, 1, 0.36, 1], easeInOutQuint: [0.83, 0, 0.17, 1], easeInExpo: [0.7, 0, 0.84, 0], easeOutExpo: [0.16, 1, 0.3, 1], easeInOutExpo: [0.87, 0, 0.13, 1], easeInCirc: [0.55, 0, 1, 0.45], easeOutCirc: [0, 0.55, 0.45, 1], easeInOutCirc: [0.85, 0, 0.15, 1], easeInBack: [0.36, 0, 0.66, -0.56], easeOutBack: [0.34, 1.56, 0.64, 1], easeInOutBack: [0.68, -0.6, 0.32, 1.6] }; Xw({ linear: Iw }, Zw); function Yw({ window: i = dl } = {}) { if (!i) return Ae(!1); const e = Ae(i.document.hasFocus()); return si(i, "blur", () => { e.value = !1; }), si(i, "focus", () => { e.value = !0; }), e; } const Jw = () => Kt && /firefox/i.test(window.navigator.userAgent); /** * @vue/shared v3.5.11 * (c) 2018-present Yuxi (Evan) You and Vue contributors * @license MIT **/ process.env.NODE_ENV !== "production" && Object.freeze({}); process.env.NODE_ENV !== "production" && Object.freeze([]); const $s = () => { }, Kw = Object.prototype.hasOwnProperty, Qf = (i, e) => Kw.call(i, e), Bi = Array.isArray, Si = (i) => typeof i == "function", Li = (i) => typeof i == "string", Ai = (i) => i !== null && typeof i == "object", Qw = Object.prototype.toString, e_ = (i) => Qw.call(i), $u = (i) => e_(i).slice(8, -1), ap = (i) => { const e = /* @__PURE__ */ Object.create(null); return (t) => e[t] || (e[t] = i(t)); }, t_ = /-(\w)/g, i_ = ap( (i) => i.replace(t_, (e, t) => t ? t.toUpperCase() : "") ), r_ = /\B([A-Z])/g, n_ = ap( (i) => i.replace(r_, "-$1").toLowerCase() ), o_ = ap((i) => i.charAt(0).toUpperCase() + i.slice(1)); var f0 = typeof global == "object" && global && global.Object === Object && global, a_ = typeof self == "object" && self && self.Object === Object && self, Vr = f0 || a_ || Function("return this")(), Nr = Vr.Symbol, m0 = Object.prototype, s_ = m0.hasOwnProperty, l_ = m0.toString, gs = Nr ? Nr.toStringTag : void 0; function c_(i) { var e = s_.call(i, gs), t = i[gs]; try { i[gs] = void 0; var r = !0; } catch { } var n = l_.call(i); return r && (e ? i[gs] = t : delete i[gs]), n; } var u_ = Object.prototype, h_ = u_.toString; function d_(i) { return h_.call(i); } var p_ = "[object Null]", f_ = "[object Undefined]", em = Nr ? Nr.toStringTag : void 0; function ts(i) { return i == null ? i === void 0 ? f_ : p_ : em && em in Object(i) ? c_(i) : d_(i); } function Ca(i) { return i != null && typeof i == "object"; } var m_ = "[object Symbol]"; function lu(i) { return typeof i == "symbol" || Ca(i) && ts(i) == m_; } function g_(i, e) { for (var t = -1, r = i == null ? 0 : i.length, n = Array(r); ++t < r; ) n[t] = e(i[t], t, i); return n; } var yr = Array.isArray, v_ = 1 / 0, tm = Nr ? Nr.prototype : void 0, im = tm ? tm.toString : void 0; function g0(i) { if (typeof i == "string") return i; if (yr(i)) return g_(i, g0) + ""; if (lu(i)) return im ? im.call(i) : ""; var e = i + ""; return e == "0" && 1 / i == -v_ ? "-0" : e; } var y_ = /\s/; function b_(i) { for (var e = i.length; e-- && y_.test(i.charAt(e)); ) ; return e; } var x_ = /^\s+/; function w_(i) { return i && i.slice(0, b_(i) + 1).replace(x_, ""); } function Hn(i) { var e = typeof i; return i != null && (e == "object" || e == "function"); } var rm = NaN, __ = /^[-+]0x[0-9a-f]+$/i, M_ = /^0b[01]+$/i, S_ = /^0o[0-7]+$/i, T_ = parseInt; function nm(i) { if (typeof i == "number") return i; if (lu(i)) return rm; if (Hn(i)) { var e = typeof i.valueOf == "function" ? i.valueOf() : i; i = Hn(e) ? e + "" : e; } if (typeof i != "string") return i === 0 ? i : +i; i = w_(i); var t = M_.test(i); return t || S_.test(i) ? T_(i.slice(2), t ? 2 : 8) : __.test(i) ? rm : +i; } function v0(i) { return i; } var E_ = "[object AsyncFunction]", A_ = "[object Function]", C_ = "[object GeneratorFunction]", L_ = "[object Proxy]"; function y0(i) { if (!Hn(i)) return !1; var e = ts(i); return e == A_ || e == C_ || e == E_ || e == L_; } var qu = Vr["__core-js_shared__"], om = function() { var i = /[^.]+$/.exec(qu && qu.keys && qu.keys.IE_PROTO || ""); return i ? "Symbol(src)_1." + i : ""; }(); function R_(i) { return !!om && om in i; } var O_ = Function.prototype, P_ = O_.toString; function Uo(i) { if (i != null) { try { return P_.call(i); } catch { } try { return i + ""; } catch { } } return ""; } var I_ = /[\\^$.*+?()[\]{}|]/g, D_ = /^\[object .+?Constructor\]$/, N_ = Function.prototype, B_ = Object.prototype, k_ = N_.toString, z_ = B_.hasOwnProperty, F_ = RegExp( "^" + k_.call(z_).replace(I_, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$" ); function V_(i) { if (!Hn(i) || R_(i)) return !1; var e = y0(i) ? F_ : D_; return e.test(Uo(i)); } function U_(i, e) { return i == null ? void 0 : i[e]; } function Go(i, e) { var t = U_(i, e); return V_(t) ? t : void 0; } var td = Go(Vr, "WeakMap"); function G_(i, e, t) { switch (t.length) { case 0: return i.call(e); case 1: return i.call(e, t[0]); case 2: return i.call(e, t[0], t[1]); case 3: return i.call(e, t[0], t[1], t[2]); } return i.apply(e, t); } var H_ = 800, j_ = 16, W_ = Date.now; function $_(i) { var e = 0, t = 0; return function() { var r = W_(), n = j_ - (r - t); if (t = r, n > 0) { if (++e >= H_) return arguments[0]; } else e = 0; return i.apply(void 0, arguments); }; } function q_(i) { return function() { return i; }; } var Hc = function() { try { var i = Go(Object, "defineProperty"); return i({}, "", {}), i; } catch { } }(), X_ = Hc ? function(i, e) { return Hc(i, "toString", { configurable: !0, enumerable: !1, value: q_(e), writable: !0 }); } : v0, Z_ = $_(X_); function Y_(i, e, t, r) { i.length; for (var n = t + 1; n--; ) if (e(i[n], n, i)) return n; return -1; } var J_ = 9007199254740991, K_ = /^(?:0|[1-9]\d*)$/; function sp(i, e) { var t = typeof i; return e = e ?? J_, !!e && (t == "number" || t != "symbol" && K_.test(i)) && i > -1 && i % 1 == 0 && i < e; } function Q_(i, e, t) { e == "__proto__" && Hc ? Hc(i, e, { configurable: !0, enumerable: !0, value: t, writable: !0 }) : i[e] = t; } function lp(i, e) { return i === e || i !== i && e !== e; } var eM = Object.prototype, tM = eM.hasOwnProperty; function iM(i, e, t) { var r = i[e]; (!(tM.call(i, e) && lp(r, t)) || t === void 0 && !(e in i)) && Q_(i, e, t); } var am = Math.max; function rM(i, e, t) { return e = am(e === void 0 ? i.length - 1 : e, 0), function() { for (var r = arguments, n = -1, o = am(r.length - e, 0), a = Array(o); ++n < o; ) a[n] = r[e + n]; n = -1; for (var s = Array(e + 1); ++n < e; ) s[n] = r[n]; return s[e] = t(a), G_(i, this, s); }; } var nM = 9007199254740991; function cp(i) { return typeof i == "number" && i > -1 && i % 1 == 0 && i <= nM; } function oM(i) { return i != null && cp(i.length) && !y0(i); } var aM = Object.prototype; function sM(i) { var e = i && i.constructor, t = typeof e == "function" && e.prototype || aM; return i === t; } function lM(i, e) { for (var t = -1, r = Array(i); ++t < i; ) r[t] = e(t); return r; } var cM = "[object Arguments]"; function sm(i) { return Ca(i) && ts(i) == cM; } var b0 = Object.prototype, uM = b0.hasOwnProperty, hM = b0.propertyIsEnumerable, up = sm(/* @__PURE__ */ function() { return arguments; }()) ? sm : function(i) { return Ca(i) && uM.call(i, "callee") && !hM.call(i, "callee"); }; function dM() { return !1; } var x0 = typeof exports == "object" && exports && !exports.nodeType && exports, lm = x0 && typeof module == "object" && module && !module.nodeType && module, pM = lm && lm.exports === x0, cm = pM ? Vr.Buffer : void 0, fM = cm ? cm.isBuffer : void 0, id = fM || dM, mM = "[object Arguments]", gM = "[object Array]", vM = "[object Boolean]", yM = "[object Date]", bM = "[object Error]", xM = "[object Function]", wM = "[object Map]", _M = "[object Number]", MM = "[object Object]", SM = "[object RegExp]", TM = "[object Set]", EM = "[object String]", AM = "[object WeakMap]", CM = "[object ArrayBuffer]", LM = "[object DataView]", RM = "[object Float32Array]", OM = "[object Float64Array]", PM = "[object Int8Array]", IM = "[object Int16Array]", DM = "[object Int32Array]", NM = "[object Uint8Array]", BM = "[object Uint8ClampedArray]", kM = "[object Uint16Array]", zM = "[object Uint32Array]", Ct = {}; Ct[RM] = Ct[OM] = Ct[PM] = Ct[IM] = Ct[DM] = Ct[NM] = Ct[BM] = Ct[kM] = Ct[zM] = !0; Ct[mM] = Ct[gM] = Ct[CM] = Ct[vM] = Ct[LM] = Ct[yM] = Ct[bM] = Ct[xM] = Ct[wM] = Ct[_M] = Ct[MM] = Ct[SM] = Ct[TM] = Ct[EM] = Ct[AM] = !1; function FM(i) { return Ca(i) && cp(i.length) && !!Ct[ts(i)]; } function VM(i) { return function(e) { return i(e); }; } var w0 = typeof exports == "object" && exports && !exports.nodeType && exports, ks = w0 && typeof module == "object" && module && !module.nodeType && module, UM = ks && ks.exports === w0, Xu = UM && f0.process, um = function() { try { var i = ks && ks.require && ks.require("util").types; return i || Xu && Xu.binding && Xu.binding("util"); } catch { } }(), hm = um && um.isTypedArray, _0 = hm ? VM(hm) : FM, GM = Object.prototype, HM = GM.hasOwnProperty; function jM(i, e) { var t = yr(i), r = !t && up(i), n = !t && !r && id(i), o = !t && !r && !n && _0(i), a = t || r || n || o, s = a ? lM(i.length, String) : [], c = s.length; for (var l in i) HM.call(i, l) && !(a && // Safari 9 has enumerable `arguments.length` in strict mode. (l == "length" || // Node.js 0.10 has enumerable non-index properties on buffers. n && (l == "offset" || l == "parent") || // PhantomJS 2 has enumerable non-index properties on typed arrays. o && (l == "buffer" || l == "byteLength" || l == "byteOffset") || // Skip index properties. sp(l, c))) && s.push(l); return s; } function WM(i, e) { return function(t) { return i(e(t)); }; } var $M = WM(Object.keys, Object), qM = Object.prototype, XM = qM.hasOwnProperty; function ZM(i) { if (!sM(i)) return $M(i); var e = []; for (var t in Object(i)) XM.call(i, t) && t != "constructor" && e.push(t); return e; } function M0(i) { return oM(i) ? jM(i) : ZM(i); } var YM = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/, JM = /^\w*$/; function hp(i, e) { if (yr(i)) return !1; var t = typeof i; return t == "number" || t == "symbol" || t == "boolean" || i == null || lu(i) ? !0 : JM.test(i) || !YM.test(i) || e != null && i in Object(e); } var qs = Go(Object, "create"); function KM() { this.__data__ = qs ? qs(null) : {}, this.size = 0; } function QM(i) { var e = this.has(i) && delete this.__data__[i]; return this.size -= e ? 1 : 0, e; } var eS = "__lodash_hash_undefined__", tS = Object.prototype, iS = tS.hasOwnProperty; function rS(i) { var e = this.__data__; if (qs) { var t = e[i]; return t === eS ? void 0 : t; } return iS.call(e, i) ? e[i] : void 0; } var nS = Object.prototype, oS = nS.hasOwnProperty; function aS(i) { var e = this.__data__; return qs ? e[i] !== void 0 : oS.call(e, i); } var sS = "__lodash_hash_undefined__"; function lS(i, e) { var t = this.__data__; return this.size += this.has(i) ? 0 : 1, t[i] = qs && e === void 0 ? sS : e, this; } function Oo(i) { var e = -1, t = i == null ? 0 : i.length; for (this.clear(); ++e < t; ) { var r = i[e]; this.set(r[0], r[1]); } } Oo.prototype.clear = KM; Oo.prototype.delete = QM; Oo.prototype.get = rS; Oo.prototype.has = aS; Oo.prototype.set = lS; function cS() { this.__data__ = [], this.size = 0; } function cu(i, e) { for (var t = i.length; t--; ) if (lp(i[t][0], e)) return t; return -1; } var uS = Array.prototype, hS = uS.splice; function dS(i) { var e = this.__data__, t = cu(e, i); if (t < 0) return !1; var r = e.length - 1; return t == r ? e.pop() : hS.call(e, t, 1), --this.size, !0; } function pS(i) { var e = this.__data__, t = cu(e, i); return t < 0 ? void 0 : e[t][1]; } function fS(i) { return cu(this.__data__, i) > -1; } function mS(i, e) { var t = this.__data__, r = cu(t, i); return r < 0 ? (++this.size, t.push([i, e])) : t[r][1] = e, this; } function pn(i) { var e = -1, t = i == null ? 0 : i.length; for (this.clear(); ++e < t; ) { var r = i[e]; this.set(r[0], r[1]); } } pn.prototype.clear = cS; pn.prototype.delete = dS; pn.prototype.get = pS; pn.prototype.has = fS; pn.prototype.set = mS; var Xs = Go(Vr, "Map"); function gS() { this.size = 0, this.__data__ = { hash: new Oo(), map: new (Xs || pn)(), string: new Oo() }; } function vS(i) { var e = typeof i; return e == "string" || e == "number" || e == "symbol" || e == "boolean" ? i !== "__proto__" : i === null; } function uu(i, e) { var t = i.__data__; return vS(e) ? t[typeof e == "string" ? "string" : "hash"] : t.map; } function yS(i) { var e = uu(this, i).delete(i); return this.size -= e ? 1 : 0, e; } function bS(i) { return uu(this, i).get(i); } function xS(i) { return uu(this, i).has(i); } function wS(i, e) { var t = uu(this, i), r = t.size; return t.set(i, e), this.size += t.size == r ? 0 : 1, this; } function fn(i) { var e = -1, t = i == null ? 0 : i.length; for (this.clear(); ++e < t; ) { var r = i[e]; this.set(r[0], r[1]); } } fn.prototype.clear = gS; fn.prototype.delete = yS; fn.prototype.get = bS; fn.prototype.has = xS; fn.prototype.set = wS; var _S = "Expected a function"; function dp(i, e) { if (typeof i != "function" || e != null && typeof e != "function") throw new TypeError(_S); var t = function() { var r = arguments, n = e ? e.apply(this, r) : r[0], o = t.cache; if (o.has(n)) return o.get(n); var a = i.apply(this, r); return t.cache = o.set(n, a) || o, a; }; return t.cache = new (dp.Cache || fn)(), t; } dp.Cache = fn; var MS = 500; function SS(i) { var e = dp(i, function(r) { return t.size === MS && t.clear(), r; }), t = e.cache; return e; } var TS = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g, ES = /\\(\\)?/g, AS = SS(function(i) { var e = []; return i.charCodeAt(0) === 46 && e.push(""), i.replace(TS, function(t, r, n, o) { e.push(n ? o.replace(ES, "$1") : r || t); }), e; }); function CS(i) { return i == null ? "" : g0(i); } function hu(i, e) { return yr(i) ? i : hp(i, e) ? [i] : AS(CS(i)); } var LS = 1 / 0; function pl(i) { if (typeof i == "string" || lu(i)) return i; var e = i + ""; return e == "0" && 1 / i == -LS ? "-0" : e; } function pp(i, e) { e = hu(e, i); for (var t = 0, r = e.length; i != null && t < r; ) i = i[pl(e[t++])]; return t && t == r ? i : void 0; } function Kr(i, e, t) { var r = i == null ? void 0 : pp(i, e); return r === void 0 ? t : r; } function S0(i, e) { for (var t = -1, r = e.length, n = i.length; ++t < r; ) i[n + t] = e[t]; return i; } var dm = Nr ? Nr.isConcatSpreadable : void 0; function RS(i) { return yr(i) || up(i) || !!(dm && i && i[dm]); } function OS(i, e, t, r, n) { var o = -1, a = i.length; for (t || (t = RS), n || (n = []); ++o < a; ) { var s = i[o]; t(s) ? S0(n, s) : n[n.length] = s; } return n; } function PS(i) { var e = i == null ? 0 : i.length; return e ? OS(i) : []; } function IS(i) { return Z_(rM(i, void 0, PS), i + ""); } function Cr() { if (!arguments.length) return []; var i = arguments[0]; return yr(i) ? i : [i]; } function DS() { this.__data__ = new pn(), this.size = 0; } function NS(i) { var e = this.__data__, t = e.delete(i); return this.size = e.size, t; } function BS(i) { return this.__data__.get(i); } function kS(i) { return this.__data__.has(i); } var zS = 200; function FS(i, e) { var t = this.__data__; if (t instanceof pn) { var r = t.__data__; if (!Xs || r.length < zS - 1) return r.push([i, e]), this.size = ++t.size, this; t = this.__data__ = new fn(r); } return t.set(i, e), this.size = t.size, this; } function rn(i) { var e = this.__data__ = new pn(i); this.size = e.size; } rn.prototype.clear = DS; rn.prototype.delete = NS; rn.prototype.get = BS; rn.prototype.has = kS; rn.prototype.set = FS; function VS(i, e) { for (var t = -1, r = i == null ? 0 : i.length, n = 0, o = []; ++t < r; ) { var a = i[t]; e(a, t, i) && (o[n++] = a); } return o; } function US() { return []; } var GS = Object.prototype, HS = GS.propertyIsEnumerable, pm = Object.getOwnPropertySymbols, jS = pm ? function(i) { return i == null ? [] : (i = Object(i), VS(pm(i), function(e) { return HS.call(i, e); })); } : US; function WS(i, e, t) { var r = e(i); return yr(i) ? r : S0(r, t(i)); } function fm(i) { return WS(i, M0, jS); } var rd = Go(Vr, "DataView"), nd = Go(Vr, "Promise"), od = Go(Vr, "Set"), mm = "[object Map]", $S = "[object Object]", gm = "[object Promise]", vm = "[object Set]", ym = "[object WeakMap]", bm = "[object DataView]", qS = Uo(rd), XS = Uo(Xs), ZS = Uo(nd), YS = Uo(od), JS = Uo(td), Dn = ts; (rd && Dn(new rd(new ArrayBuffer(1))) != bm || Xs && Dn(new Xs()) != mm || nd && Dn(nd.resolve()) != gm || od && Dn(new od()) != vm || td && Dn(new td()) != ym) && (Dn = function(i) { var e = ts(i), t = e == $S ? i.constructor : void 0, r = t ? Uo(t) : ""; if (r) switch (r) { case qS: return bm; case XS: return mm; case ZS: return gm; case YS: return vm; case JS: return ym; } return e; }); var xm = Vr.Uint8Array, KS = "__lodash_hash_undefined__"; function QS(i) { return this.__data__.set(i, KS), this; } function eT(i) { return this.__data__.has(i); } function jc(i) { var e = -1, t = i == null ? 0 : i.length; for (this.__data__ = new fn(); ++e < t; ) this.add(i[e]); } jc.prototype.add = jc.prototype.push = QS; jc.prototype.has = eT; function tT(i, e) { for (var t = -1, r = i == null ? 0 : i.length; ++t < r; ) if (e(i[t], t, i)) return !0; return !1; } function iT(i, e) { return i.has(e); } var rT = 1, nT = 2; function T0(i, e, t, r, n, o) { var a = t & rT, s = i.length, c = e.length; if (s != c && !(a && c > s)) return !1; var l = o.get(i), h = o.get(e); if (l && h) return l == e && h == i; var u = -1, p = !0, g = t & nT ? new jc() : void 0; for (o.set(i, e), o.set(e, i); ++u < s; ) { var m = i[u], d = e[u]; if (r) var y = a ? r(d, m, u, e, i, o) : r(m, d, u, i, e, o); if (y !== void 0) { if (y) continue; p = !1; break; } if (g) { if (!tT(e, function(f, v) { if (!iT(g, v) && (m === f || n(m, f, t, r, o))) return g.push(v); })) { p = !1; break; } } else if (!(m === d || n(m, d, t, r, o))) { p = !1; break; } } return o.delete(i), o.delete(e), p; } function oT(i) { var e = -1, t = Array(i.size); return i.forEach(function(r, n) { t[++e] = [n, r]; }), t; } function aT(i) { var e = -1, t = Array(i.size); return i.forEach(function(r) { t[++e] = r; }), t; } var sT = 1, lT = 2, cT = "[object Boolean]", uT = "[object Date]", hT = "[object Error]", dT = "[object Map]", pT = "[object Number]", fT = "[object RegExp]", mT = "[object Set]", gT = "[object String]", vT = "[object Symbol]", yT = "[object ArrayBuffer]", bT = "[object DataView]", wm = Nr ? Nr.prototype : void 0, Zu = wm ? wm.valueOf : void 0; function xT(i, e, t, r, n, o, a) { switch (t) { case bT: if (i.byteLength != e.byteLength || i.byteOffset != e.byteOffset) return !1; i = i.buffer, e = e.buffer; case yT: return !(i.byteLength != e.byteLength || !o(new xm(i), new xm(e))); case cT: case uT: case pT: return lp(+i, +e); case hT: return i.name == e.name && i.message == e.message; case fT: case gT: return i == e + ""; case dT: var s = oT; case mT: var c = r & sT; if (s || (s = aT), i.size != e.size && !c) return !1; var l = a.get(i); if (l) return l == e; r |= lT, a.set(i, e); var h = T0(s(i), s(e), r, n, o, a); return a.delete(i), h; case vT: if (Zu) return Zu.call(i) == Zu.call(e); } return !1; } var wT = 1, _T = Object.prototype, MT = _T.hasOwnProperty; function ST(i, e, t, r, n, o) { var a = t & wT, s = fm(i), c = s.length, l = fm(e), h = l.length; if (c != h && !a) return !1; for (var u = c; u--; ) { var p = s[u]; if (!(a ? p in e : MT.call(e, p))) return !1; } var g = o.get(i), m = o.get(e); if (g && m) return g == e && m == i; var d = !0; o.set(i, e), o.set(e, i); for (var y = a; ++u < c; ) { p = s[u]; var f = i[p], v = e[p]; if (r) var M = a ? r(v, f, p, e, i, o) : r(f, v, p, i, e, o); if (!(M === void 0 ? f === v || n(f, v, t, r, o) : M)) { d = !1; break; } y || (y = p == "constructor"); } if (d && !y) { var S = i.constructor, T = e.constructor; S != T && "constructor" in i && "constructor" in e && !(typeof S == "function" && S instanceof S && typeof T == "function" && T instanceof T) && (d = !1); } return o.delete(i), o.delete(e), d; } var TT = 1, _m = "[object Arguments]", Mm = "[object Array]", Nl = "[object Object]", ET = Object.prototype, Sm = ET.hasOwnProperty; function AT(i, e, t, r, n, o) { var a = yr(i), s = yr(e), c = a ? Mm : Dn(i), l = s ? Mm : Dn(e); c = c == _m ? Nl : c, l = l == _m ? Nl : l; var h = c == Nl, u = l == Nl, p = c == l; if (p && id(i)) { if (!id(e)) return !1; a = !0, h = !1; } if (p && !h) return o || (o = new rn()), a || _0(i) ? T0(i, e, t, r, n, o) : xT(i, e, c, t, r, n, o); if (!(t & TT)) { var g = h && Sm.call(i, "__wrapped__"), m = u && Sm.call(e, "__wrapped__"); if (g || m) { var d = g ? i.value() : i, y = m ? e.value() : e; return o || (o = new rn()), n(d, y, t, r, o); } } return p ? (o || (o = new rn()), ST(i, e, t, r, n, o)) : !1; } function du(i, e, t, r, n) { return i === e ? !0 : i == null || e == null || !Ca(i) && !Ca(e) ? i !== i && e !== e : AT(i, e, t, r, du, n); } var CT = 1, LT = 2; function RT(i, e, t, r) { var n = t.length, o = n; if (i == null) return !o; for (i = Object(i); n--; ) { var a = t[n]; if (a[2] ? a[1] !== i[a[0]] : !(a[0] in i)) return !1; } for (; ++n < o; ) { a = t[n]; var s = a[0], c = i[s], l = a[1]; if (a[2]) { if (c === void 0 && !(s in i)) return !1; } else { var h = new rn(), u; if (!(u === void 0 ? du(l, c, CT | LT, r, h) : u)) return !1; } } return !0; } function E0(i) { return i === i && !Hn(i); } function OT(i) { for (var e = M0(i), t = e.length; t--; ) { var r = e[t], n = i[r]; e[t] = [r, n, E0(n)]; } return e; } function A0(i, e) { return function(t) { return t == null ? !1 : t[i] === e && (e !== void 0 || i in Object(t)); }; } function PT(i) { var e = OT(i); return e.length == 1 && e[0][2] ? A0(e[0][0], e[0][1]) : function(t) { return t === i || RT(t, i, e); }; } function IT(i, e) { return i != null && e in Object(i); } function DT(i, e, t) { e = hu(e, i); for (var r = -1, n = e.length, o = !1; ++r < n; ) { var a = pl(e[r]); if (!(o = i != null && t(i, a))) break; i = i[a]; } return o || ++r != n ? o : (n = i == null ? 0 : i.length, !!n && cp(n) && sp(a, n) && (yr(i) || up(i))); } function C0(i, e) { return i != null && DT(i, e, IT); } var NT = 1, BT = 2; function kT(i, e) { return hp(i) && E0(e) ? A0(pl(i), e) : function(t) { var r = Kr(t, i); return r === void 0 && r === e ? C0(t, i) : du(e, r, NT | BT); }; } function zT(i) { return function(e) { return e == null ? void 0 : e[i]; }; } function FT(i) { return function(e) { return pp(e, i); }; } function VT(i) { return hp(i) ? zT(pl(i)) : FT(i); } function UT(i) { return typeof i == "function" ? i : i == null ? v0 : typeof i == "object" ? yr(i) ? kT(i[0], i[1]) : PT(i) : VT(i); } var Yu = function() { return Vr.Date.now(); }, GT = "Expected a function", HT = Math.max, jT = Math.min; function ad(i, e, t) { var r, n, o, a, s, c, l = 0, h = !1, u = !1, p = !0; if (typeof i != "function") throw new TypeError(GT); e = nm(e) || 0, Hn(t) && (h = !!t.leading, u = "maxWait" in t, o = u ? HT(nm(t.maxWait) || 0, e) : o, p = "trailing" in t ? !!t.trailing : p); function g(x) { var w = r, A = n; return r = n = void 0, l = x, a = i.apply(A, w), a; } function m(x) { return l = x, s = setTimeout(f, e), h ? g(x) : a; } function d(x) { var w = x - c, A = x - l, _ = e - w; return u ? jT(_, o - A) : _; } function y(x) { var w = x - c, A = x - l; return c === void 0 || w >= e || w < 0 || u && A >= o; } function f() { var x = Yu(); if (y(x)) return v(x); s = setTimeout(f, d(x)); } function v(x) { return s = void 0, p && r ? g(x) : (r = n = void 0, a); } function M() { s !== void 0 && clearTimeout(s), l = 0, r = c = n = s = void 0; } function S() { return s === void 0 ? a : v(Yu()); } function T() { var x = Yu(), w = y(x); if (r = arguments, n = this, c = x, w) { if (s === void 0) return m(c); if (u) return clearTimeout(s), s = setTimeout(f, e), g(c); } return s === void 0 && (s = setTimeout(f, e)), a; } return T.cancel = M, T.flush = S, T; } function WT(i, e, t) { var r = i == null ? 0 : i.length; if (!r) return -1; var n = r - 1; return Y_(i, UT(e), n); } function Wc(i) { for (var e = -1, t = i == null ? 0 : i.length, r = {}; ++e < t; ) { var n = i[e]; r[n[0]] = n[1]; } return r; } function sd(i, e) { return du(i, e); } function nn(i) { return i == null; } function $T(i) { return i === void 0; } function qT(i, e, t, r) { if (!Hn(i)) return i; e = hu(e, i); for (var n = -1, o = e.length, a = o - 1, s = i; s != null && ++n < o; ) { var c = pl(e[n]), l = t; if (c === "__proto__" || c === "constructor" || c === "prototype") return i; if (n != a) { var h = s[c]; l = void 0, l === void 0 && (l = Hn(h) ? h : sp(e[n + 1]) ? [] : {}); } iM(s, c, l), s = s[c]; } return i; } function XT(i, e, t) { for (var r = -1, n = e.length, o = {}; ++r < n; ) { var a = e[r], s = pp(i, a); t(s, a) && qT(o, hu(a, i), s); } return o; } function ZT(i, e) { return XT(i, e, function(t, r) { return C0(i, r); }); } var YT = IS(function(i, e) { return i == null ? {} : ZT(i, e); }); const gr = (i) => i === void 0, fp = (i) => typeof i == "boolean", _t = (i) => typeof i == "number", Mo = (i) => typeof Element > "u" ? !1 : i instanceof Element, JT = (i) => Li(i) ? !Number.isNaN(Number(i)) : !1, KT = (i = "") => i.replace(/[|\\{}()[\]^$+*?.]/g, "\\$&").replace(/-/g, "\\x2d"), Bn = (i) => o_(i), Tm = (i) => Object.keys(i); class L0 extends Error { constructor(e) { super(e), this.name = "ElementPlusError"; } } function is(i, e) { throw new L0(`[${i}] ${e}`); } function Zt(i, e) { if (process.env.NODE_ENV !== "production") { const t = Li(i) ? new L0(`[${i}] ${e}`) : i; console.warn(t); } } const QT = "utils/dom/style", R0 = (i = "") => i.split(" ").filter((e) => !!e.trim()), Em = (i, e) => { !i || !e.trim() || i.classList.add(...R0(e)); }, $c = (i, e) => { !i || !e.trim() || i.classList.remove(...R0(e)); }, vs = (i, e) => { var t; if (!Kt || !i || !e) return ""; let r = i_(e); r === "float" && (r = "cssFloat"); try { const n = i.style[r]; if (n) return n; const o = (t = document.defaultView) == null ? void 0 : t.getComputedStyle(i, ""); return o ? o[r] : ""; } catch { return i.style[r]; } }; function qc(i, e = "px") { if (!i) return ""; if (_t(i) || JT(i)) return `${i}${e}`; if (Li(i)) return i; Zt(QT, "binding value must be a string or number"); } function eE(i, e) { if (!Kt) return; if (!e) { i.scrollTop = 0; return; } const t = []; let r = e.offsetParent; for (; r !== null && i !== r && i.contains(r); ) t.push(r), r = r.offsetParent; const n = e.offsetTop + t.reduce((c, l) => c + l.offsetTop, 0), o = n + e.offsetHeight, a = i.scrollTop, s = a + i.clientHeight; n < a ? i.scrollTop = n : o > s && (i.scrollTop = o - i.clientHeight); } /*! Element Plus Icons Vue v2.3.1 */ var tE = /* @__PURE__ */ Ie({ name: "ArrowDown", __name: "arrow-down", setup(i) { return (e, t) => (ge(), Le("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ ke("path", { fill: "currentColor", d: "M831.872 340.864 512 652.672 192.128 340.864a30.592 30.592 0 0 0-42.752 0 29.12 29.12 0 0 0 0 41.6L489.664 714.24a32 32 0 0 0 44.672 0l340.288-331.712a29.12 29.12 0 0 0 0-41.728 30.592 30.592 0 0 0-42.752 0z" }) ])); } }), mp = tE, iE = /* @__PURE__ */ Ie({ name: "ArrowLeft", __name: "arrow-left", setup(i) { return (e, t) => (ge(), Le("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ ke("path", { fill: "currentColor", d: "M609.408 149.376 277.76 489.6a32 32 0 0 0 0 44.672l331.648 340.352a29.12 29.12 0 0 0 41.728 0 30.592 30.592 0 0 0 0-42.752L339.264 511.936l311.872-319.872a30.592 30.592 0 0 0 0-42.688 29.12 29.12 0 0 0-41.728 0z" }) ])); } }), jn = iE, rE = /* @__PURE__ */ Ie({ name: "ArrowRight", __name: "arrow-right", setup(i) { return (e, t) => (ge(), Le("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ ke("path", { fill: "currentColor", d: "M340.864 149.312a30.592 30.592 0 0 0 0 42.752L652.736 512 340.864 831.872a30.592 30.592 0 0 0 0 42.752 29.12 29.12 0 0 0 41.728 0L714.24 534.336a32 32 0 0 0 0-44.672L382.592 149.376a29.12 29.12 0 0 0-41.728 0z" }) ])); } }), Wn = rE, nE = /* @__PURE__ */ Ie({ name: "ArrowUp", __name: "arrow-up", setup(i) { return (e, t) => (ge(), Le("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ ke("path", { fill: "currentColor", d: "m488.832 344.32-339.84 356.672a32 32 0 0 0 0 44.16l.384.384a29.44 29.44 0 0 0 42.688 0l320-335.872 319.872 335.872a29.44 29.44 0 0 0 42.688 0l.384-.384a32 32 0 0 0 0-44.16L535.168 344.32a32 32 0 0 0-46.336 0" }) ])); } }), oE = nE, aE = /* @__PURE__ */ Ie({ name: "CircleCheck", __name: "circle-check", setup(i) { return (e, t) => (ge(), Le("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ ke("path", { fill: "currentColor", d: "M512 896a384 384 0 1 0 0-768 384 384 0 0 0 0 768m0 64a448 448 0 1 1 0-896 448 448 0 0 1 0 896" }), ke("path", { fill: "currentColor", d: "M745.344 361.344a32 32 0 0 1 45.312 45.312l-288 288a32 32 0 0 1-45.312 0l-160-160a32 32 0 1 1 45.312-45.312L480 626.752l265.344-265.408z" }) ])); } }), sE = aE, lE = /* @__PURE__ */ Ie({ name: "CircleClose", __name: "circle-close", setup(i) { return (e, t) => (ge(), Le("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ ke("path", { fill: "currentColor", d: "m466.752 512-90.496-90.496a32 32 0 0 1 45.248-45.248L512 466.752l90.496-90.496a32 32 0 1 1 45.248 45.248L557.248 512l90.496 90.496a32 32 0 1 1-45.248 45.248L512 557.248l-90.496 90.496a32 32 0 0 1-45.248-45.248z" }), ke("path", { fill: "currentColor", d: "M512 896a384 384 0 1 0 0-768 384 384 0 0 0 0 768m0 64a448 448 0 1 1 0-896 448 448 0 0 1 0 896" }) ])); } }), gp = lE, cE = /* @__PURE__ */ Ie({ name: "Close", __name: "close", setup(i) { return (e, t) => (ge(), Le("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ ke("path", { fill: "currentColor", d: "M764.288 214.592 512 466.88 259.712 214.592a31.936 31.936 0 0 0-45.12 45.12L466.752 512 214.528 764.224a31.936 31.936 0 1 0 45.12 45.184L512 557.184l252.288 252.288a31.936 31.936 0 0 0 45.12-45.12L557.12 512.064l252.288-252.352a31.936 31.936 0 1 0-45.12-45.184z" }) ])); } }), ld = cE, uE = /* @__PURE__ */ Ie({ name: "Delete", __name: "delete", setup(i) { return (e, t) => (ge(), Le("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ ke("path", { fill: "currentColor", d: "M160 256H96a32 32 0 0 1 0-64h256V95.936a32 32 0 0 1 32-32h256a32 32 0 0 1 32 32V192h256a32 32 0 1 1 0 64h-64v672a32 32 0 0 1-32 32H192a32 32 0 0 1-32-32zm448-64v-64H416v64zM224 896h576V256H224zm192-128a32 32 0 0 1-32-32V416a32 32 0 0 1 64 0v320a32 32 0 0 1-32 32m192 0a32 32 0 0 1-32-32V416a32 32 0 0 1 64 0v320a32 32 0 0 1-32 32" }) ])); } }), Xc = uE, hE = /* @__PURE__ */ Ie({ name: "Hide", __name: "hide", setup(i) { return (e, t) => (ge(), Le("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ ke("path", { fill: "currentColor", d: "M876.8 156.8c0-9.6-3.2-16-9.6-22.4-6.4-6.4-12.8-9.6-22.4-9.6-9.6 0-16 3.2-22.4 9.6L736 220.8c-64-32-137.6-51.2-224-60.8-160 16-288 73.6-377.6 176C44.8 438.4 0 496 0 512s48 73.6 134.4 176c22.4 25.6 44.8 48 73.6 67.2l-86.4 89.6c-6.4 6.4-9.6 12.8-9.6 22.4 0 9.6 3.2 16 9.6 22.4 6.4 6.4 12.8 9.6 22.4 9.6 9.6 0 16-3.2 22.4-9.6l704-710.4c3.2-6.4 6.4-12.8 6.4-22.4Zm-646.4 528c-76.8-70.4-128-128-153.6-172.8 28.8-48 80-105.6 153.6-172.8C304 272 400 230.4 512 224c64 3.2 124.8 19.2 176 44.8l-54.4 54.4C598.4 300.8 560 288 512 288c-64 0-115.2 22.4-160 64s-64 96-64 160c0 48 12.8 89.6 35.2 124.8L256 707.2c-9.6-6.4-19.2-16-25.6-22.4Zm140.8-96c-12.8-22.4-19.2-48-19.2-76.8 0-44.8 16-83.2 48-112 32-28.8 67.2-48 112-48 28.8 0 54.4 6.4 73.6 19.2zM889.599 336c-12.8-16-28.8-28.8-41.6-41.6l-48 48c73.6 67.2 124.8 124.8 150.4 169.6-28.8 48-80 105.6-153.6 172.8-73.6 67.2-172.8 108.8-284.8 115.2-51.2-3.2-99.2-12.8-140.8-28.8l-48 48c57.6 22.4 118.4 38.4 188.8 44.8 160-16 288-73.6 377.6-176C979.199 585.6 1024 528 1024 512s-48.001-73.6-134.401-176Z" }), ke("path", { fill: "currentColor", d: "M511.998 672c-12.8 0-25.6-3.2-38.4-6.4l-51.2 51.2c28.8 12.8 57.6 19.2 89.6 19.2 64 0 115.2-22.4 160-64 41.6-41.6 64-96 64-160 0-32-6.4-64-19.2-89.6l-51.2 51.2c3.2 12.8 6.4 25.6 6.4 38.4 0 44.8-16 83.2-48 112-32 28.8-67.2 48-112 48Z" }) ])); } }), dE = hE, pE = /* @__PURE__ */ Ie({ name: "Loading", __name: "loading", setup(i) { return (e, t) => (ge(), Le("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ ke("path", { fill: "currentColor", d: "M512 64a32 32 0 0 1 32 32v192a32 32 0 0 1-64 0V96a32 32 0 0 1 32-32m0 640a32 32 0 0 1 32 32v192a32 32 0 1 1-64 0V736a32 32 0 0 1 32-32m448-192a32 32 0 0 1-32 32H736a32 32 0 1 1 0-64h192a32 32 0 0 1 32 32m-640 0a32 32 0 0 1-32 32H96a32 32 0 0 1 0-64h192a32 32 0 0 1 32 32M195.2 195.2a32 32 0 0 1 45.248 0L376.32 331.008a32 32 0 0 1-45.248 45.248L195.2 240.448a32 32 0 0 1 0-45.248zm452.544 452.544a32 32 0 0 1 45.248 0L828.8 783.552a32 32 0 0 1-45.248 45.248L647.744 692.992a32 32 0 0 1 0-45.248zM828.8 195.264a32 32 0 0 1 0 45.184L692.992 376.32a32 32 0 0 1-45.248-45.248l135.808-135.808a32 32 0 0 1 45.248 0m-452.544 452.48a32 32 0 0 1 0 45.248L240.448 828.8a32 32 0 0 1-45.248-45.248l135.808-135.808a32 32 0 0 1 45.248 0z" }) ])); } }), O0 = pE, fE = /* @__PURE__ */ Ie({ name: "Minus", __name: "minus", setup(i) { return (e, t) => (ge(), Le("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ ke("path", { fill: "currentColor", d: "M128 544h768a32 32 0 1 0 0-64H128a32 32 0 0 0 0 64" }) ])); } }), mE = fE, gE = /* @__PURE__ */ Ie({ name: "Plus", __name: "plus", setup(i) { return (e, t) => (ge(), Le("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ ke("path", { fill: "currentColor", d: "M480 480V128a32 32 0 0 1 64 0v352h352a32 32 0 1 1 0 64H544v352a32 32 0 1 1-64 0V544H128a32 32 0 0 1 0-64z" }) ])); } }), pu = gE, vE = /* @__PURE__ */ Ie({ name: "View", __name: "view", setup(i) { return (e, t) => (ge(), Le("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ ke("path", { fill: "currentColor", d: "M512 160c320 0 512 352 512 352S832 864 512 864 0 512 0 512s192-352 512-352m0 64c-225.28 0-384.128 208.064-436.8 288 52.608 79.872 211.456 288 436.8 288 225.28 0 384.128-208.064 436.8-288-52.608-79.872-211.456-288-436.8-288zm0 64a224 224 0 1 1 0 448 224 224 0 0 1 0-448m0 64a160.192 160.192 0 0 0-160 160c0 88.192 71.744 160 160 160s160-71.808 160-160-71.744-160-160-160" }) ])); } }), yE = vE, bE = /* @__PURE__ */ Ie({ name: "WarningFilled", __name: "warning-filled", setup(i) { return (e, t) => (ge(), Le("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ ke("path", { fill: "currentColor", d: "M512 64a448 448 0 1 1 0 896 448 448 0 0 1 0-896m0 192a58.432 58.432 0 0 0-58.24 63.744l23.36 256.384a35.072 35.072 0 0 0 69.76 0l23.296-256.384A58.432 58.432 0 0 0 512 256m0 512a51.2 51.2 0 1 0 0-102.4 51.2 51.2 0 0 0 0 102.4" }) ])); } }), P0 = bE; const I0 = "__epPropKey", Ze = (i) => i, xE = (i) => Ai(i) && !!i[I0], fu = (i, e) => { if (!Ai(i) || xE(i)) return i; const { values: t, required: r, default: n, type: o, validator: a } = i, s = { type: o, required: !!r, validator: t || a ? (c) => { let l = !1, h = []; if (t && (h = Array.from(t), Qf(i, "default") && h.push(n), l || (l = h.includes(c))), a && (l || (l = a(c))), !l && h.length > 0) { const u = [...new Set(h)].map((p) => JSON.stringify(p)).join(", "); fw(`Invalid prop: validation failed${e ? ` for prop "${e}"` : ""}. Expected one of [${u}], got value ${JSON.stringify(c)}.`); } return l; } : void 0, [I0]: !0 }; return Qf(i, "default") && (s.default = n), s; }, ht = (i) => Wc(Object.entries(i).map(([e, t]) => [ e, fu(t, e) ])), $n = Ze([ String, Object, Function ]), D0 = { validating: O0, success: sE, error: gp }, ui = (i, e) => { if (i.install = (t) => { for (const r of [i, ...Object.values(e ?? {})]) t.component(r.name, r); }, e) for (const [t, r] of Object.entries(e)) i[t] = r; return i; }, wE = (i, e) => (i.install = (t) => { t.directive(e, i); }, i), mn = (i) => (i.install = $s, i), Pr = { tab: "Tab", enter: "Enter", space: "Space", left: "ArrowLeft", up: "ArrowUp", right: "ArrowRight", down: "ArrowDown", esc: "Escape", delete: "Delete", backspace: "Backspace", numpadEnter: "NumpadEnter", pageUp: "PageUp", pageDown: "PageDown", home: "Home", end: "End" }, Pt = "update:modelValue", Kn = "change", So = "input", N0 = ["", "default", "small", "large"], Bc = (i) => { const e = Bi(i) ? i : [i], t = []; return e.forEach((r) => { var n; Bi(r) ? t.push(...Bc(r)) : Qh(r) && Bi(r.children) ? t.push(...Bc(r.children)) : (t.push(r), Qh(r) && (n = r.component) != null && n.subTree && t.push(...Bc(r.component.subTree))); }), t; }, _E = (i) => /([\uAC00-\uD7AF\u3130-\u318F])+/gi.test(i), Qr = (i) => i, ME = ["class", "style"], SE = /^on[A-Z]/, TE = (i = {}) => { const { excludeListeners: e = !1, excludeKeys: t } = i, r = ce(() => ((t == null ? void 0 : t.value) || []).concat(ME)), n = ri(); return n ? ce(() => { var o; return Wc(Object.entries((o = n.proxy) == null ? void 0 : o.$attrs).filter(([a]) => !r.value.includes(a) && !(e && SE.test(a)))); }) : (Zt("use-attrs", "getCurrentInstance() returned null. useAttrs() must be called at the top of a setup function"), ce(() => ({}))); }, EE = ({ from: i, replacement: e, scope: t, version: r, ref: n, type: o = "API" }, a) => { Ke(() => G(a), (s) => { s && Zt(t, `[${o}] ${i} is about to be deprecated in version ${r}, please use ${e} instead. For more detail, please visit: ${n} `); }, { immediate: !0 }); }; var AE = { name: "en", el: { breadcrumb: { label: "Breadcrumb" }, colorpicker: { confirm: "OK", clear: "Clear", defaultLabel: "color picker", description: "current color is {color}. press enter to select a new color.", alphaLabel: "pick alpha value" }, datepicker: { now: "Now", today: "Today", cancel: "Cancel", clear: "Clear", confirm: "OK", dateTablePrompt: "Use the arrow keys and enter to select the day of the month", monthTablePrompt: "Use the arrow keys and enter to select the month", yearTablePrompt: "Use the arrow keys and enter to select the year", selectedDate: "Selected date", selectDate: "Select date", selectTime: "Select time", startDate: "Start Date", startTime: "Start Time", endDate: "End Date", endTime: "End Time", prevYear: "Previous Year", nextYear: "Next Year", prevMonth: "Previous Month", nextMonth: "Next Month", year: "", month1: "January", month2: "February", month3: "March", month4: "April", month5: "May", month6: "June", month7: "July", month8: "August", month9: "September", month10: "October", month11: "November", month12: "December", week: "week", weeks: { sun: "Sun", mon: "Mon", tue: "Tue", wed: "Wed", thu: "Thu", fri: "Fri", sat: "Sat" }, weeksFull: { sun: "Sunday", mon: "Monday", tue: "Tuesday", wed: "Wednesday", thu: "Thursday", fri: "Friday", sat: "Saturday" }, months: { jan: "Jan", feb: "Feb", mar: "Mar", apr: "Apr", may: "May", jun: "Jun", jul: "Jul", aug: "Aug", sep: "Sep", oct: "Oct", nov: "Nov", dec: "Dec" } }, inputNumber: { decrease: "decrease number", increase: "increase number" }, select: { loading: "Loading", noMatch: "No matching data", noData: "No data", placeholder: "Select" }, mention: { loading: "Loading" }, dropdown: { toggleDropdown: "Toggle Dropdown" }, cascader: { noMatch: "No matching data", loading: "Loading", placeholder: "Select", noData: "No data" }, pagination: { goto: "Go to", pagesize: "/page", total: "Total {total}", pageClassifier: "", page: "Page", prev: "Go to previous page", next: "Go to next page", currentPage: "page {pager}", prevPages: "Previous {pager} pages", nextPages: "Next {pager} pages", deprecationWarning: "Deprecated usages detected, please refer to the el-pagination documentation for more details" }, dialog: { close: "Close this dialog" }, drawer: { close: "Close this dialog" }, messagebox: { title: "Message", confirm: "OK", cancel: "Cancel", error: "Illegal input", close: "Close this dialog" }, upload: { deleteTip: "press delete to remove", delete: "Delete", preview: "Preview", continue: "Continue" }, slider: { defaultLabel: "slider between {min} and {max}", defaultRangeStartLabel: "pick start value", defaultRangeEndLabel: "pick end value" }, table: { emptyText: "No Data", confirmFilter: "Confirm", resetFilter: "Reset", clearFilter: "All", sumText: "Sum" }, tour: { next: "Next", previous: "Previous", finish: "Finish" }, tree: { emptyText: "No Data" }, transfer: { noMatch: "No matching data", noData: "No data", titles: ["List 1", "List 2"], filterPlaceholder: "Enter keyword", noCheckedFormat: "{total} items", hasCheckedFormat: "{checked}/{total} checked" }, image: { error: "FAILED" }, pageHeader: { title: "Back" }, popconfirm: { confirmButtonText: "Yes", cancelButtonText: "No" }, carousel: { leftArrow: "Carousel arrow left", rightArrow: "Carousel arrow right", indicator: "Carousel switch to index {index}" } } }; const CE = (i) => (e, t) => LE(e, t, G(i)), LE = (i, e, t) => Kr(t, i, i).replace(/\{(\w+)\}/g, (r, n) => { var o; return `${(o = e == null ? void 0 : e[n]) != null ? o : `{${n}}`}`; }), RE = (i) => { const e = ce(() => G(i).name), t = Ro(i) ? i : Ae(i); return { lang: e, locale: t, t: CE(i) }; }, B0 = Symbol("localeContextKey"), mu = (i) => { const e = i || ct(B0, Ae()); return RE(ce(() => e.value || AE)); }, kc = "el", OE = "is-", lo = (i, e, t, r, n) => { let o = `${i}-${e}`; return t && (o += `-${t}`), r && (o += `__${r}`), n && (o += `--${n}`), o; }, k0 = Symbol("namespaceContextKey"), vp = (i) => { const e = i || (ri() ? ct(k0, Ae(kc)) : Ae(kc)); return ce(() => G(e) || kc); }, it = (i, e) => { const t = vp(e); return { namespace: t, b: (r = "") => lo(t.value, i, r, "", ""), e: (r) => r ? lo(t.value, i, "", r, "") : "", m: (r) => r ? lo(t.value, i, "", "", r) : "", be: (r, n) => r && n ? lo(t.value, i, r, n, "") : "", em: (r, n) => r && n ? lo(t.value, i, "", r, n) : "", bm: (r, n) => r && n ? lo(t.value, i, r, "", n) : "", bem: (r, n, o) => r && n && o ? lo(t.value, i, r, n, o) : "", is: (r, ...n) => { const o = n.length >= 1 ? n[0] : !0; return r && o ? `${OE}${r}` : ""; }, cssVar: (r) => { const n = {}; for (const o in r) r[o] && (n[`--${t.value}-${o}`] = r[o]); return n; }, cssVarName: (r) => `--${t.value}-${r}`, cssVarBlock: (r) => { const n = {}; for (const o in r) r[o] && (n[`--${t.value}-${i}-${o}`] = r[o]); return n; }, cssVarBlockName: (r) => `--${t.value}-${i}-${r}` }; }, PE = fu({ type: Ze(Boolean), default: null }), IE = fu({ type: Ze(Function) }), DE = (i) => { const e = `update:${i}`, t = `onUpdate:${i}`, r = [e], n = { [i]: PE, [t]: IE }; return { useModelToggle: ({ indicator: o, toggleReason: a, shouldHideWhenRouteChanges: s, shouldProceed: c, onShow: l, onHide: h }) => { const u = ri(), { emit: p } = u, g = u.props, m = ce(() => Si(g[t])), d = ce(() => g[i] === null), y = (x) => { o.value !== !0 && (o.value = !0, a && (a.value = x), Si(l) && l(x)); }, f = (x) => { o.value !== !1 && (o.value = !1, a && (a.value = x), Si(h) && h(x)); }, v = (x) => { if (g.disabled === !0 || Si(c) && !c()) return; const w = m.value && Kt; w && p(e, !0), (d.value || !w) && y(x); }, M = (x) => { if (g.disabled === !0 || !Kt) return; const w = m.value && Kt; w && p(e, !1), (d.value || !w) && f(x); }, S = (x) => { fp(x) && (g.disabled && x ? m.value && p(e, !1) : o.value !== x && (x ? y() : f())); }, T = () => { o.value ? M() : v(); }; return Ke(() => g[i], S), s && u.appContext.config.globalProperties.$route !== void 0 && Ke(() => ({ ...u.proxy.$route }), () => { s.value && o.value && M(); }), ei(() => { S(g[i]); }), { hide: M, show: v, toggle: T, hasUpdateHandler: m }; }, useModelToggleProps: n, useModelToggleEmits: r }; }, z0 = (i) => { const e = ri(); return ce(() => { var t, r; return (r = (t = e == null ? void 0 : e.proxy) == null ? void 0 : t.$props) == null ? void 0 : r[i]; }); }; var zi = "top", rr = "bottom", nr = "right", Fi = "left", yp = "auto", fl = [zi, rr, nr, Fi], La = "start", Zs = "end", NE = "clippingParents", F0 = "viewport", ys = "popper", BE = "reference", Am = fl.reduce(function(i, e) { return i.concat([e + "-" + La, e + "-" + Zs]); }, []), rs = [].concat(fl, [yp]).reduce(function(i, e) { return i.concat([e, e + "-" + La, e + "-" + Zs]); }, []), kE = "beforeRead", zE = "read", FE = "afterRead", VE = "beforeMain", UE = "main", GE = "afterMain", HE = "beforeWrite", jE = "write", WE = "afterWrite", $E = [kE, zE, FE, VE, UE, GE, HE, jE, WE]; function Br(i) { return i ? (i.nodeName || "").toLowerCase() : null; } function wr(i) { if (i == null) return window; if (i.toString() !== "[object Window]") { var e = i.ownerDocument; return e && e.defaultView || window; } return i; } function Ra(i) { var e = wr(i).Element; return i instanceof e || i instanceof Element; } function ir(i) { var e = wr(i).HTMLElement; return i instanceof e || i instanceof HTMLElement; } function bp(i) { if (typeof ShadowRoot > "u") return !1; var e = wr(i).ShadowRoot; return i instanceof e || i instanceof ShadowRoot; } function qE(i) { var e = i.state; Object.keys(e.elements).forEach(function(t) { var r = e.styles[t] || {}, n = e.attributes[t] || {}, o = e.elements[t]; !ir(o) || !Br(o) || (Object.assign(o.style, r), Object.keys(n).forEach(function(a) { var s = n[a]; s === !1 ? o.removeAttribute(a) : o.setAttribute(a, s === !0 ? "" : s); })); }); } function XE(i) { var e = i.state, t = { popper: { position: e.options.strategy, left: "0", top: "0", margin: "0" }, arrow: { position: "absolute" }, reference: {} }; return Object.assign(e.elements.popper.style, t.popper), e.styles = t, e.elements.arrow && Object.assign(e.elements.arrow.style, t.arrow), function() { Object.keys(e.elements).forEach(function(r) { var n = e.elements[r], o = e.attributes[r] || {}, a = Object.keys(e.styles.hasOwnProperty(r) ? e.styles[r] : t[r]), s = a.reduce(function(c, l) { return c[l] = "", c; }, {}); !ir(n) || !Br(n) || (Object.assign(n.style, s), Object.keys(o).forEach(function(c) { n.removeAttribute(c); })); }); }; } var V0 = { name: "applyStyles", enabled: !0, phase: "write", fn: qE, effect: XE, requires: ["computeStyles"] }; function Ir(i) { return i.split("-")[0]; } var To = Math.max, Zc = Math.min, Oa = Math.round; function Pa(i, e) { e === void 0 && (e = !1); var t = i.getBoundingClientRect(), r = 1, n = 1; if (ir(i) && e) { var o = i.offsetHeight, a = i.offsetWidth; a > 0 && (r = Oa(t.width) / a || 1), o > 0 && (n = Oa(t.height) / o || 1); } return { width: t.width / r, height: t.height / n, top: t.top / n, right: t.right / r, bottom: t.bottom / n, left: t.left / r, x: t.left / r, y: t.top / n }; } function xp(i) { var e = Pa(i), t = i.offsetWidth, r = i.offsetHeight; return Math.abs(e.width - t) <= 1 && (t = e.width), Math.abs(e.height - r) <= 1 && (r = e.height), { x: i.offsetLeft, y: i.offsetTop, width: t, height: r }; } function U0(i, e) { var t = e.getRootNode && e.getRootNode(); if (i.contains(e)) return !0; if (t && bp(t)) { var r = e; do { if (r && i.isSameNode(r)) return !0; r = r.parentNode || r.host; } while (r); } return !1; } function cn(i) { return wr(i).getComputedStyle(i); } function ZE(i) { return ["table", "td", "th"].indexOf(Br(i)) >= 0; } function Qn(i) { return ((Ra(i) ? i.ownerDocument : i.document) || window.document).documentElement; } function gu(i) { return Br(i) === "html" ? i : i.assignedSlot || i.parentNode || (bp(i) ? i.host : null) || Qn(i); } function Cm(i) { return !ir(i) || cn(i).position === "fixed" ? null : i.offsetParent; } function YE(i) { var e = navigator.userAgent.toLowerCase().indexOf("firefox") !== -1, t = navigator.userAgent.indexOf("Trident") !== -1; if (t && ir(i)) { var r = cn(i); if (r.position === "fixed") return null; } var n = gu(i); for (bp(n) && (n = n.host); ir(n) && ["html", "body"].indexOf(Br(n)) < 0; ) { var o = cn(n); if (o.transform !== "none" || o.perspective !== "none" || o.contain === "paint" || ["transform", "perspective"].indexOf(o.willChange) !== -1 || e && o.willChange === "filter" || e && o.filter && o.filter !== "none") return n; n = n.parentNode; } return null; } function ml(i) { for (var e = wr(i), t = Cm(i); t && ZE(t) && cn(t).position === "static"; ) t = Cm(t); return t && (Br(t) === "html" || Br(t) === "body" && cn(t).position === "static") ? e : t || YE(i) || e; } function wp(i) { return ["top", "bottom"].indexOf(i) >= 0 ? "x" : "y"; } function zs(i, e, t) { return To(i, Zc(e, t)); } function JE(i, e, t) { var r = zs(i, e, t); return r > t ? t : r; } function G0() { return { top: 0, right: 0, bottom: 0, left: 0 }; } function H0(i) { return Object.assign({}, G0(), i); } function j0(i, e) { return e.reduce(function(t, r) { return t[r] = i, t; }, {}); } var KE = function(i, e) { return i = typeof i == "function" ? i(Object.assign({}, e.rects, { placement: e.placement })) : i, H0(typeof i != "number" ? i : j0(i, fl)); }; function QE(i) { var e, t = i.state, r = i.name, n = i.options, o = t.elements.arrow, a = t.modifiersData.popperOffsets, s = Ir(t.placement), c = wp(s), l = [Fi, nr].indexOf(s) >= 0, h = l ? "height" : "width"; if (!(!o || !a)) { var u = KE(n.padding, t), p = xp(o), g = c === "y" ? zi : Fi, m = c === "y" ? rr : nr, d = t.rects.reference[h] + t.rects.reference[c] - a[c] - t.rects.popper[h], y = a[c] - t.rects.reference[c], f = ml(o), v = f ? c === "y" ? f.clientHeight || 0 : f.clientWidth || 0 : 0, M = d / 2 - y / 2, S = u[g], T = v - p[h] - u[m], x = v / 2 - p[h] / 2 + M, w = zs(S, x, T), A = c; t.modifiersData[r] = (e = {}, e[A] = w, e.centerOffset = w - x, e); } } function eA(i) { var e = i.state, t = i.options, r = t.element, n = r === void 0 ? "[data-popper-arrow]" : r; n != null && (typeof n == "string" && (n = e.elements.popper.querySelector(n), !n) || !U0(e.elements.popper, n) || (e.elements.arrow = n)); } var tA = { name: "arrow", enabled: !0, phase: "main", fn: QE, effect: eA, requires: ["popperOffsets"], requiresIfExists: ["preventOverflow"] }; function Ia(i) { return i.split("-")[1]; } var iA = { top: "auto", right: "auto", bottom: "auto", left: "auto" }; function rA(i) { var e = i.x, t = i.y, r = window, n = r.devicePixelRatio || 1; return { x: Oa(e * n) / n || 0, y: Oa(t * n) / n || 0 }; } function Lm(i) { var e, t = i.popper, r = i.popperRect, n = i.placement, o = i.variation, a = i.offsets, s = i.position, c = i.gpuAcceleration, l = i.adaptive, h = i.roundOffsets, u = i.isFixed, p = a.x, g = p === void 0 ? 0 : p, m = a.y, d = m === void 0 ? 0 : m, y = typeof h == "function" ? h({ x: g, y: d }) : { x: g, y: d }; g = y.x, d = y.y; var f = a.hasOwnProperty("x"), v = a.hasOwnProperty("y"), M = Fi, S = zi, T = window; if (l) { var x = ml(t), w = "clientHeight", A = "clientWidth"; if (x === wr(t) && (x = Qn(t), cn(x).position !== "static" && s === "absolute" && (w = "scrollHeight", A = "scrollWidth")), x = x, n === zi || (n === Fi || n === nr) && o === Zs) { S = rr; var _ = u && x === T && T.visualViewport ? T.visualViewport.height : x[w]; d -= _ - r.height, d *= c ? 1 : -1; } if (n === Fi || (n === zi || n === rr) && o === Zs) { M = nr; var E = u && x === T && T.visualViewport ? T.visualViewport.width : x[A]; g -= E - r.width, g *= c ? 1 : -1; } } var O = Object.assign({ position: s }, l && iA), L = h === !0 ? rA({ x: g, y: d }) : { x: g, y: d }; if (g = L.x, d = L.y, c) { var C; return Object.assign({}, O, (C = {}, C[S] = v ? "0" : "", C[M] = f ? "0" : "", C.transform = (T.devicePixelRatio || 1) <= 1 ? "translate(" + g + "px, " + d + "px)" : "translate3d(" + g + "px, " + d + "px, 0)", C)); } return Object.assign({}, O, (e = {}, e[S] = v ? d + "px" : "", e[M] = f ? g + "px" : "", e.transform = "", e)); } function nA(i) { var e = i.state, t = i.options, r = t.gpuAcceleration, n = r === void 0 ? !0 : r, o = t.adaptive, a = o === void 0 ? !0 : o, s = t.roundOffsets, c = s === void 0 ? !0 : s, l = { placement: Ir(e.placement), variation: Ia(e.placement), popper: e.elements.popper, popperRect: e.rects.popper, gpuAcceleration: n, isFixed: e.options.strategy === "fixed" }; e.modifiersData.popperOffsets != null && (e.styles.popper = Object.assign({}, e.styles.popper, Lm(Object.assign({}, l, { offsets: e.modifiersData.popperOffsets, position: e.options.strategy, adaptive: a, roundOffsets: c })))), e.modifiersData.arrow != null && (e.styles.arrow = Object.assign({}, e.styles.arrow, Lm(Object.assign({}, l, { offsets: e.modifiersData.arrow, position: "absolute", adaptive: !1, roundOffsets: c })))), e.attributes.popper = Object.assign({}, e.attributes.popper, { "data-popper-placement": e.placement }); } var W0 = { name: "computeStyles", enabled: !0, phase: "beforeWrite", fn: nA, data: {} }, Bl = { passive: !0 }; function oA(i) { var e = i.state, t = i.instance, r = i.options, n = r.scroll, o = n === void 0 ? !0 : n, a = r.resize, s = a === void 0 ? !0 : a, c = wr(e.elements.popper), l = [].concat(e.scrollParents.reference, e.scrollParents.popper); return o && l.forEach(function(h) { h.addEventListener("scroll", t.update, Bl); }), s && c.addEventListener("resize", t.update, Bl), function() { o && l.forEach(function(h) { h.removeEventListener("scroll", t.update, Bl); }), s && c.removeEventListener("resize", t.update, Bl); }; } var $0 = { name: "eventListeners", enabled: !0, phase: "write", fn: function() { }, effect: oA, data: {} }, aA = { left: "right", right: "left", bottom: "top", top: "bottom" }; function zc(i) { return i.replace(/left|right|bottom|top/g, function(e) { return aA[e]; }); } var sA = { start: "end", end: "start" }; function Rm(i) { return i.replace(/start|end/g, function(e) { return sA[e]; }); } function _p(i) { var e = wr(i), t = e.pageXOffset, r = e.pageYOffset; return { scrollLeft: t, scrollTop: r }; } function Mp(i) { return Pa(Qn(i)).left + _p(i).scrollLeft; } function lA(i) { var e = wr(i), t = Qn(i), r = e.visualViewport, n = t.clientWidth, o = t.clientHeight, a = 0, s = 0; return r && (n = r.width, o = r.height, /^((?!chrome|android).)*safari/i.test(navigator.userAgent) || (a = r.offsetLeft, s = r.offsetTop)), { width: n, height: o, x: a + Mp(i), y: s }; } function cA(i) { var e, t = Qn(i), r = _p(i), n = (e = i.ownerDocument) == null ? void 0 : e.body, o = To(t.scrollWidth, t.clientWidth, n ? n.scrollWidth : 0, n ? n.clientWidth : 0), a = To(t.scrollHeight, t.clientHeight, n ? n.scrollHeight : 0, n ? n.clientHeight : 0), s = -r.scrollLeft + Mp(i), c = -r.scrollTop; return cn(n || t).direction === "rtl" && (s += To(t.clientWidth, n ? n.clientWidth : 0) - o), { width: o, height: a, x: s, y: c }; } function Sp(i) { var e = cn(i), t = e.overflow, r = e.overflowX, n = e.overflowY; return /auto|scroll|overlay|hidden/.test(t + n + r); } function q0(i) { return ["html", "body", "#document"].indexOf(Br(i)) >= 0 ? i.ownerDocument.body : ir(i) && Sp(i) ? i : q0(gu(i)); } function Fs(i, e) { var t; e === void 0 && (e = []); var r = q0(i), n = r === ((t = i.ownerDocument) == null ? void 0 : t.body), o = wr(r), a = n ? [o].concat(o.visualViewport || [], Sp(r) ? r : []) : r, s = e.concat(a); return n ? s : s.concat(Fs(gu(a))); } function cd(i) { return Object.assign({}, i, { left: i.x, top: i.y, right: i.x + i.width, bottom: i.y + i.height }); } function uA(i) { var e = Pa(i); return e.top = e.top + i.clientTop, e.left = e.left + i.clientLeft, e.bottom = e.top + i.clientHeight, e.right = e.left + i.clientWidth, e.width = i.clientWidth, e.height = i.clientHeight, e.x = e.left, e.y = e.top, e; } function Om(i, e) { return e === F0 ? cd(lA(i)) : Ra(e) ? uA(e) : cd(cA(Qn(i))); } function hA(i) { var e = Fs(gu(i)), t = ["absolute", "fixed"].indexOf(cn(i).position) >= 0, r = t && ir(i) ? ml(i) : i; return Ra(r) ? e.filter(function(n) { return Ra(n) && U0(n, r) && Br(n) !== "body"; }) : []; } function dA(i, e, t) { var r = e === "clippingParents" ? hA(i) : [].concat(e), n = [].concat(r, [t]), o = n[0], a = n.reduce(function(s, c) { var l = Om(i, c); return s.top = To(l.top, s.top), s.right = Zc(l.right, s.right), s.bottom = Zc(l.bottom, s.bottom), s.left = To(l.left, s.left), s; }, Om(i, o)); return a.width = a.right - a.left, a.height = a.bottom - a.top, a.x = a.left, a.y = a.top, a; } function X0(i) { var e = i.reference, t = i.element, r = i.placement, n = r ? Ir(r) : null, o = r ? Ia(r) : null, a = e.x + e.width / 2 - t.width / 2, s = e.y + e.height / 2 - t.height / 2, c; switch (n) { case zi: c = { x: a, y: e.y - t.height }; break; case rr: c = { x: a, y: e.y + e.height }; break; case nr: c = { x: e.x + e.width, y: s }; break; case Fi: c = { x: e.x - t.width, y: s }; break; default: c = { x: e.x, y: e.y }; } var l = n ? wp(n) : null; if (l != null) { var h = l === "y" ? "height" : "width"; switch (o) { case La: c[l] = c[l] - (e[h] / 2 - t[h] / 2); break; case Zs: c[l] = c[l] + (e[h] / 2 - t[h] / 2); break; } } return c; } function Ys(i, e) { e === void 0 && (e = {}); var t = e, r = t.placement, n = r === void 0 ? i.placement : r, o = t.boundary, a = o === void 0 ? NE : o, s = t.rootBoundary, c = s === void 0 ? F0 : s, l = t.elementContext, h = l === void 0 ? ys : l, u = t.altBoundary, p = u === void 0 ? !1 : u, g = t.padding, m = g === void 0 ? 0 : g, d = H0(typeof m != "number" ? m : j0(m, fl)), y = h === ys ? BE : ys, f = i.rects.popper, v = i.elements[p ? y : h], M = dA(Ra(v) ? v : v.contextElement || Qn(i.elements.popper), a, c), S = Pa(i.elements.reference), T = X0({ reference: S, element: f, strategy: "absolute", placement: n }), x = cd(Object.assign({}, f, T)), w = h === ys ? x : S, A = { top: M.top - w.top + d.top, bottom: w.bottom - M.bottom + d.bottom, left: M.left - w.left + d.left, right: w.right - M.right + d.right }, _ = i.modifiersData.offset; if (h === ys && _) { var E = _[n]; Object.keys(A).forEach(function(O) { var L = [nr, rr].indexOf(O) >= 0 ? 1 : -1, C = [zi, rr].indexOf(O) >= 0 ? "y" : "x"; A[O] += E[C] * L; }); } return A; } function pA(i, e) { e === void 0 && (e = {}); var t = e, r = t.placement, n = t.boundary, o = t.rootBoundary, a = t.padding, s = t.flipVariations, c = t.allowedAutoPlacements, l = c === void 0 ? rs : c, h = Ia(r), u = h ? s ? Am : Am.filter(function(m) { return Ia(m) === h; }) : fl, p = u.filter(function(m) { return l.indexOf(m) >= 0; }); p.length === 0 && (p = u); var g = p.reduce(function(m, d) { return m[d] = Ys(i, { placement: d, boundary: n, rootBoundary: o, padding: a })[Ir(d)], m; }, {}); return Object.keys(g).sort(function(m, d) { return g[m] - g[d]; }); } function fA(i) { if (Ir(i) === yp) return []; var e = zc(i); return [Rm(i), e, Rm(e)]; } function mA(i) { var e = i.state, t = i.options, r = i.name; if (!e.modifiersData[r]._skip) { for (var n = t.mainAxis, o = n === void 0 ? !0 : n, a = t.altAxis, s = a === void 0 ? !0 : a, c = t.fallbackPlacements, l = t.padding, h = t.boundary, u = t.rootBoundary, p = t.altBoundary, g = t.flipVariations, m = g === void 0 ? !0 : g, d = t.allowedAutoPlacements, y = e.options.placement, f = Ir(y), v = f === y, M = c || (v || !m ? [zc(y)] : fA(y)), S = [y].concat(M).reduce(function(ne, X) { return ne.concat(Ir(X) === yp ? pA(e, { placement: X, boundary: h, rootBoundary: u, padding: l, flipVariations: m, allowedAutoPlacements: d }) : X); }, []), T = e.rects.reference, x = e.rects.popper, w = /* @__PURE__ */ new Map(), A = !0, _ = S[0], E = 0; E < S.length; E++) { var O = S[E], L = Ir(O), C = Ia(O) === La, I = [zi, rr].indexOf(L) >= 0, R = I ? "width" : "height", b = Ys(e, { placement: O, boundary: h, rootBoundary: u, altBoundary: p, padding: l }), P = I ? C ? nr : Fi : C ? rr : zi; T[R] > x[R] && (P = zc(P)); var N = zc(P), D = []; if (o && D.push(b[L] <= 0), s && D.push(b[P] <= 0, b[N] <= 0), D.every(function(ne) { return ne; })) { _ = O, A = !1; break; } w.set(O, D); } if (A) for (var k = m ? 3 : 1, V = function(ne) { var X = S.find(function(z) { var H = w.get(z); if (H) return H.slice(0, ne).every(function(ee) { return ee; }); }); if (X) return _ = X, "break"; }, q = k; q > 0; q--) { var Y = V(q); if (Y === "break") break; } e.placement !== _ && (e.modifiersData[r]._skip = !0, e.placement = _, e.reset = !0); } } var gA = { name: "flip", enabled: !0, phase: "main", fn: mA, requiresIfExists: ["offset"], data: { _skip: !1 } }; function Pm(i, e, t) { return t === void 0 && (t = { x: 0, y: 0 }), { top: i.top - e.height - t.y, right: i.right - e.width + t.x, bottom: i.bottom - e.height + t.y, left: i.left - e.width - t.x }; } function Im(i) { return [zi, nr, rr, Fi].some(function(e) { return i[e] >= 0; }); } function vA(i) { var e = i.state, t = i.name, r = e.rects.reference, n = e.rects.popper, o = e.modifiersData.preventOverflow, a = Ys(e, { elementContext: "reference" }), s = Ys(e, { altBoundary: !0 }), c = Pm(a, r), l = Pm(s, n, o), h = Im(c), u = Im(l); e.modifiersData[t] = { referenceClippingOffsets: c, popperEscapeOffsets: l, isReferenceHidden: h, hasPopperEscaped: u }, e.attributes.popper = Object.assign({}, e.attributes.popper, { "data-popper-reference-hidden": h, "data-popper-escaped": u }); } var yA = { name: "hide", enabled: !0, phase: "main", requiresIfExists: ["preventOverflow"], fn: vA }; function bA(i, e, t) { var r = Ir(i), n = [Fi, zi].indexOf(r) >= 0 ? -1 : 1, o = typeof t == "function" ? t(Object.assign({}, e, { placement: i })) : t, a = o[0], s = o[1]; return a = a || 0, s = (s || 0) * n, [Fi, nr].indexOf(r) >= 0 ? { x: s, y: a } : { x: a, y: s }; } function xA(i) { var e = i.state, t = i.options, r = i.name, n = t.offset, o = n === void 0 ? [0, 0] : n, a = rs.reduce(function(h, u) { return h[u] = bA(u, e.rects, o), h; }, {}), s = a[e.placement], c = s.x, l = s.y; e.modifiersData.popperOffsets != null && (e.modifiersData.popperOffsets.x += c, e.modifiersData.popperOffsets.y += l), e.modifiersData[r] = a; } var wA = { name: "offset", enabled: !0, phase: "main", requires: ["popperOffsets"], fn: xA }; function _A(i) { var e = i.state, t = i.name; e.modifiersData[t] = X0({ reference: e.rects.reference, element: e.rects.popper, strategy: "absolute", placement: e.placement }); } var Z0 = { name: "popperOffsets", enabled: !0, phase: "read", fn: _A, data: {} }; function MA(i) { return i === "x" ? "y" : "x"; } function SA(i) { var e = i.state, t = i.options, r = i.name, n = t.mainAxis, o = n === void 0 ? !0 : n, a = t.altAxis, s = a === void 0 ? !1 : a, c = t.boundary, l = t.rootBoundary, h = t.altBoundary, u = t.padding, p = t.tether, g = p === void 0 ? !0 : p, m = t.tetherOffset, d = m === void 0 ? 0 : m, y = Ys(e, { boundary: c, rootBoundary: l, padding: u, altBoundary: h }), f = Ir(e.placement), v = Ia(e.placement), M = !v, S = wp(f), T = MA(S), x = e.modifiersData.popperOffsets, w = e.rects.reference, A = e.rects.popper, _ = typeof d == "function" ? d(Object.assign({}, e.rects, { placement: e.placement })) : d, E = typeof _ == "number" ? { mainAxis: _, altAxis: _ } : Object.assign({ mainAxis: 0, altAxis: 0 }, _), O = e.modifiersData.offset ? e.modifiersData.offset[e.placement] : null, L = { x: 0, y: 0 }; if (x) { if (o) { var C, I = S === "y" ? zi : Fi, R = S === "y" ? rr : nr, b = S === "y" ? "height" : "width", P = x[S], N = P + y[I], D = P - y[R], k = g ? -A[b] / 2 : 0, V = v === La ? w[b] : A[b], q = v === La ? -A[b] : -w[b], Y = e.elements.arrow, ne = g && Y ? xp(Y) : { width: 0, height: 0 }, X = e.modifiersData["arrow#persistent"] ? e.modifiersData["arrow#persistent"].padding : G0(), z = X[I], H = X[R], ee = zs(0, w[b], ne[b]), Q = M ? w[b] / 2 - k - ee - z - E.mainAxis : V - ee - z - E.mainAxis, J = M ? -w[b] / 2 + k + ee + H + E.mainAxis : q + ee + H + E.mainAxis, W = e.elements.arrow && ml(e.elements.arrow), K = W ? S === "y" ? W.clientTop || 0 : W.clientLeft || 0 : 0, ie = (C = O == null ? void 0 : O[S]) != null ? C : 0, B = P + Q - ie - K, j = P + J - ie, re = zs(g ? Zc(N, B) : N, P, g ? To(D, j) : D); x[S] = re, L[S] = re - P; } if (s) { var F, U = S === "x" ? zi : Fi, se = S === "x" ? rr : nr, ue = x[T], fe = T === "y" ? "height" : "width", ve = ue + y[U], _e = ue - y[se], ae = [zi, Fi].indexOf(f) !== -1, Te = (F = O == null ? void 0 : O[T]) != null ? F : 0, Ee = ae ? ve : ue - w[fe] - A[fe] - Te + E.altAxis, oe = ae ? ue + w[fe] + A[fe] - Te - E.altAxis : _e, Me = g && ae ? JE(Ee, ue, oe) : zs(g ? Ee : ve, ue, g ? oe : _e); x[T] = Me, L[T] = Me - ue; } e.modifiersData[r] = L; } } var TA = { name: "preventOverflow", enabled: !0, phase: "main", fn: SA, requiresIfExists: ["offset"] }; function EA(i) { return { scrollLeft: i.scrollLeft, scrollTop: i.scrollTop }; } function AA(i) { return i === wr(i) || !ir(i) ? _p(i) : EA(i); } function CA(i) { var e = i.getBoundingClientRect(), t = Oa(e.width) / i.offsetWidth || 1, r = Oa(e.height) / i.offsetHeight || 1; return t !== 1 || r !== 1; } function LA(i, e, t) { t === void 0 && (t = !1); var r = ir(e), n = ir(e) && CA(e), o = Qn(e), a = Pa(i, n), s = { scrollLeft: 0, scrollTop: 0 }, c = { x: 0, y: 0 }; return (r || !r && !t) && ((Br(e) !== "body" || Sp(o)) && (s = AA(e)), ir(e) ? (c = Pa(e, !0), c.x += e.clientLeft, c.y += e.clientTop) : o && (c.x = Mp(o))), { x: a.left + s.scrollLeft - c.x, y: a.top + s.scrollTop - c.y, width: a.width, height: a.height }; } function RA(i) { var e = /* @__PURE__ */ new Map(), t = /* @__PURE__ */ new Set(), r = []; i.forEach(function(o) { e.set(o.name, o); }); function n(o) { t.add(o.name); var a = [].concat(o.requires || [], o.requiresIfExists || []); a.forEach(function(s) { if (!t.has(s)) { var c = e.get(s); c && n(c); } }), r.push(o); } return i.forEach(function(o) { t.has(o.name) || n(o); }), r; } function OA(i) { var e = RA(i); return $E.reduce(function(t, r) { return t.concat(e.filter(function(n) { return n.phase === r; })); }, []); } function PA(i) { var e; return function() { return e || (e = new Promise(function(t) { Promise.resolve().then(function() { e = void 0, t(i()); }); })), e; }; } function IA(i) { var e = i.reduce(function(t, r) { var n = t[r.name]; return t[r.name] = n ? Object.assign({}, n, r, { options: Object.assign({}, n.options, r.options), data: Object.assign({}, n.data, r.data) }) : r, t; }, {}); return Object.keys(e).map(function(t) { return e[t]; }); } var Dm = { placement: "bottom", modifiers: [], strategy: "absolute" }; function Nm() { for (var i = arguments.length, e = new Array(i), t = 0; t < i; t++) e[t] = arguments[t]; return !e.some(function(r) { return !(r && typeof r.getBoundingClientRect == "function"); }); } function Tp(i) { i === void 0 && (i = {}); var e = i, t = e.defaultModifiers, r = t === void 0 ? [] : t, n = e.defaultOptions, o = n === void 0 ? Dm : n; return function(a, s, c) { c === void 0 && (c = o); var l = { placement: "bottom", orderedModifiers: [], options: Object.assign({}, Dm, o), modifiersData: {}, elements: { reference: a, popper: s }, attributes: {}, styles: {} }, h = [], u = !1, p = { state: l, setOptions: function(d) { var y = typeof d == "function" ? d(l.options) : d; m(), l.options = Object.assign({}, o, l.options, y), l.scrollParents = { reference: Ra(a) ? Fs(a) : a.contextElement ? Fs(a.contextElement) : [], popper: Fs(s) }; var f = OA(IA([].concat(r, l.options.modifiers))); return l.orderedModifiers = f.filter(function(v) { return v.enabled; }), g(), p.update(); }, forceUpdate: function() { if (!u) { var d = l.elements, y = d.reference, f = d.popper; if (Nm(y, f)) { l.rects = { reference: LA(y, ml(f), l.options.strategy === "fixed"), popper: xp(f) }, l.reset = !1, l.placement = l.options.placement, l.orderedModifiers.forEach(function(A) { return l.modifiersData[A.name] = Object.assign({}, A.data); }); for (var v = 0; v < l.orderedModifiers.length; v++) { if (l.reset === !0) { l.reset = !1, v = -1; continue; } var M = l.orderedModifiers[v], S = M.fn, T = M.options, x = T === void 0 ? {} : T, w = M.name; typeof S == "function" && (l = S({ state: l, options: x, name: w, instance: p }) || l); } } } }, update: PA(function() { return new Promise(function(d) { p.forceUpdate(), d(l); }); }), destroy: function() { m(), u = !0; } }; if (!Nm(a, s)) return p; p.setOptions(c).then(function(d) { !u && c.onFirstUpdate && c.onFirstUpdate(d); }); function g() { l.orderedModifiers.forEach(function(d) { var y = d.name, f = d.options, v = f === void 0 ? {} : f, M = d.effect; if (typeof M == "function") { var S = M({ state: l, name: y, instance: p, options: v }), T = function() { }; h.push(S || T); } }); } function m() { h.forEach(function(d) { return d(); }), h = []; } return p; }; } Tp(); var DA = [$0, Z0, W0, V0]; Tp({ defaultModifiers: DA }); var NA = [$0, Z0, W0, V0, wA, gA, TA, tA, yA], BA = Tp({ defaultModifiers: NA }); const kA = (i, e, t = {}) => { const r = { name: "updateState", enabled: !0, phase: "write", fn: ({ state: c }) => { const l = zA(c); Object.assign(a.value, l); }, requires: ["computeStyles"] }, n = ce(() => { const { onFirstUpdate: c, placement: l, strategy: h, modifiers: u } = G(t); return { onFirstUpdate: c, placement: l || "bottom", strategy: h || "absolute", modifiers: [ ...u || [], r, { name: "applyStyles", enabled: !1 } ] }; }), o = Ci(), a = Ae({ styles: { popper: { position: G(n).strategy, left: "0", top: "0" }, arrow: { position: "absolute" } }, attributes: {} }), s = () => { o.value && (o.value.destroy(), o.value = void 0); }; return Ke(n, (c) => { const l = G(o); l && l.setOptions(c); }, { deep: !0 }), Ke([i, e], ([c, l]) => { s(), !(!c || !l) && (o.value = BA(c, l, G(n))); }), or(() => { s(); }), { state: ce(() => { var c; return { ...((c = G(o)) == null ? void 0 : c.state) || {} }; }), styles: ce(() => G(a).styles), attributes: ce(() => G(a).attributes), update: () => { var c; return (c = G(o)) == null ? void 0 : c.update(); }, forceUpdate: () => { var c; return (c = G(o)) == null ? void 0 : c.forceUpdate(); }, instanceRef: ce(() => G(o)) }; }; function zA(i) { const e = Object.keys(i.elements), t = Wc(e.map((n) => [n, i.styles[n] || {}])), r = Wc(e.map((n) => [n, i.attributes[n]])); return { styles: t, attributes: r }; } function Bm() { let i; const e = (r, n) => { t(), i = window.setTimeout(r, n); }, t = () => window.clearTimeout(i); return su(() => t()), { registerTimeout: e, cancelTimeout: t }; } const ud = { prefix: Math.floor(Math.random() * 1e4), current: 0 }, FA = Symbol("elIdInjection"), Ep = () => ri() ? ct(FA, ud) : ud, vu = (i) => { const e = Ep(); !Kt && e === ud && Zt("IdInjection", `Looks like you are using server rendering, you must provide a id provider to ensure the hydration process to be succeed usage: app.provide(ID_INJECTION_KEY, { prefix: number, current: number, })`); const t = vp(); return ce(() => G(i) || `${t.value}-id-${e.prefix}-${e.current++}`); }; let xa = []; const km = (i) => { const e = i; e.key === Pr.esc && xa.forEach((t) => t(e)); }, VA = (i) => { ei(() => { xa.length === 0 && document.addEventListener("keydown", km), Kt && xa.push(i); }), or(() => { xa = xa.filter((e) => e !== i), xa.length === 0 && Kt && document.removeEventListener("keydown", km); }); }; let zm; const Y0 = () => { const i = vp(), e = Ep(), t = ce(() => `${i.value}-popper-container-${e.prefix}`), r = ce(() => `#${t.value}`); return { id: t, selector: r }; }, UA = (i) => { const e = document.createElement("div"); return e.id = i, document.body.appendChild(e), e; }, GA = () => { const { id: i, selector: e } = Y0(); return mw(() => { Kt && (process.env.NODE_ENV === "test" || !zm || !document.body.querySelector(e.value)) && (zm = UA(i.value)); }), { id: i, selector: e }; }, HA = ht({ showAfter: { type: Number, default: 0 }, hideAfter: { type: Number, default: 200 }, autoClose: { type: Number, default: 0 } }), jA = ({ showAfter: i, hideAfter: e, autoClose: t, open: r, close: n }) => { const { registerTimeout: o } = Bm(), { registerTimeout: a, cancelTimeout: s } = Bm(); return { onOpen: (c) => { o(() => { r(c); const l = G(t); _t(l) && l > 0 && a(() => { n(c); }, l); }, G(i)); }, onClose: (c) => { s(), o(() => { n(c); }, G(e)); } }; }, J0 = Symbol("elForwardRef"), WA = (i) => { ci(J0, { setForwardRef: (e) => { i.value = e; } }); }, $A = (i) => ({ mounted(e) { i(e); }, updated(e) { i(e); }, unmounted() { i(null); } }), Fm = { current: 0 }, Vm = Ae(0), K0 = 2e3, Um = Symbol("elZIndexContextKey"), Q0 = Symbol("zIndexContextKey"), ey = (i) => { const e = ri() ? ct(Um, Fm) : Fm, t = i || (ri() ? ct(Q0, void 0) : void 0), r = ce(() => { const a = G(t); return _t(a) ? a : K0; }), n = ce(() => r.value + Vm.value), o = () => (e.current++, Vm.value = e.current, n.value); return !Kt && !ct(Um) && Zt("ZIndexInjection", `Looks like you are using server rendering, you must provide a z-index provider to ensure the hydration process to be succeed usage: app.provide(ZINDEX_INJECTION_KEY, { current: 0 })`), { initialZIndex: r, currentZIndex: n, nextZIndex: o }; }; function qA(i) { let e; function t() { if (i.value == null) return; const { selectionStart: n, selectionEnd: o, value: a } = i.value; if (n == null || o == null) return; const s = a.slice(0, Math.max(0, n)), c = a.slice(Math.max(0, o)); e = { selectionStart: n, selectionEnd: o, value: a, beforeTxt: s, afterTxt: c }; } function r() { if (i.value == null || e == null) return; const { value: n } = i.value, { beforeTxt: o, afterTxt: a, selectionStart: s } = e; if (o == null || a == null || s == null) return; let c = n.length; if (n.endsWith(a)) c = n.length - a.length; else if (n.startsWith(o)) c = o.length; else { const l = o[s - 1], h = n.indexOf(l, s - 1); h !== -1 && (c = h + 1); } i.value.setSelectionRange(c, c); } return [t, r]; } const XA = (i, e, t) => Bc(i.subTree).filter((r) => { var n; return Qh(r) && ((n = r.type) == null ? void 0 : n.name) === e && !!r.component; }).map((r) => r.component.uid).map((r) => t[r]).filter((r) => !!r), ZA = (i, e) => { const t = {}, r = Ci([]); return { children: r, addChild: (n) => { t[n.uid] = n, r.value = XA(i, e, t); }, removeChild: (n) => { delete t[n], r.value = r.value.filter((o) => o.uid !== n); } }; }, Da = fu({ type: String, values: N0, required: !1 }), ty = Symbol("size"), YA = () => { const i = ct(ty, {}); return ce(() => G(i.size) || ""); }; function iy(i, { beforeFocus: e, afterFocus: t, beforeBlur: r, afterBlur: n } = {}) { const o = ri(), { emit: a } = o, s = Ci(), c = Ae(!1), l = (p) => { Si(e) && e(p) || c.value || (c.value = !0, a("focus", p), t == null || t()); }, h = (p) => { var g; Si(r) && r(p) || p.relatedTarget && (g = s.value) != null && g.contains(p.relatedTarget) || (c.value = !1, a("blur", p), n == null || n()); }, u = () => { var p, g; (p = s.value) != null && p.contains(document.activeElement) && s.value !== document.activeElement || (g = i.value) == null || g.focus(); }; return Ke(s, (p) => { p && p.setAttribute("tabindex", "-1"); }), si(s, "focus", l, !0), si(s, "blur", h, !0), si(s, "click", u, !0), process.env.NODE_ENV === "test" && ei(() => { const p = Mo(i.value) ? i.value : document.querySelector("input,textarea"); p && (si(p, "focus", l, !0), si(p, "blur", h, !0)); }), { isFocused: c, wrapperRef: s, handleFocus: l, handleBlur: h }; } function ry({ afterComposition: i, emit: e }) { const t = Ae(!1), r = (a) => { e == null || e("compositionstart", a), t.value = !0; }, n = (a) => { var s; e == null || e("compositionupdate", a); const c = (s = a.target) == null ? void 0 : s.value, l = c[c.length - 1] || ""; t.value = !_E(l); }, o = (a) => { e == null || e("compositionend", a), t.value && (t.value = !1, wt(() => i(a))); }; return { isComposing: t, handleComposition: (a) => { a.type === "compositionend" ? o(a) : n(a); }, handleCompositionStart: r, handleCompositionUpdate: n, handleCompositionEnd: o }; } const ny = Symbol("emptyValuesContextKey"), JA = "use-empty-values", KA = ["", void 0, null], QA = void 0, e2 = ht({ emptyValues: Array, valueOnClear: { type: [String, Number, Boolean, Function], default: void 0, validator: (i) => Si(i) ? !i() : !i } }), t2 = (i, e) => { const t = ri() ? ct(ny, Ae({})) : Ae({}), r = ce(() => i.emptyValues || t.value.emptyValues || KA), n = ce(() => Si(i.valueOnClear) ? i.valueOnClear() : i.valueOnClear !== void 0 ? i.valueOnClear : Si(t.value.valueOnClear) ? t.value.valueOnClear() : t.value.valueOnClear !== void 0 ? t.value.valueOnClear : QA), o = (a) => r.value.includes(a); return r.value.includes(n.value) || Zt(JA, "value-on-clear should be a value of empty-values"), { emptyValues: r, valueOnClear: n, isEmptyValue: o }; }, i2 = ht({ ariaLabel: String, ariaOrientation: { type: String, values: ["horizontal", "vertical", "undefined"] }, ariaControls: String }), Ho = (i) => YT(i2, i), oy = Symbol(), Yc = Ae(); function Ap(i, e = void 0) { const t = ri() ? ct(oy, Yc) : Yc; return i ? ce(() => { var r, n; return (n = (r = t.value) == null ? void 0 : r[i]) != null ? n : e; }) : t; } function r2(i, e) { const t = Ap(), r = it(i, ce(() => { var s; return ((s = t.value) == null ? void 0 : s.namespace) || kc; })), n = mu(ce(() => { var s; return (s = t.value) == null ? void 0 : s.locale; })), o = ey(ce(() => { var s; return ((s = t.value) == null ? void 0 : s.zIndex) || K0; })), a = ce(() => { var s; return G(e) || ((s = t.value) == null ? void 0 : s.size) || ""; }); return n2(ce(() => G(t) || {})), { ns: r, locale: n, zIndex: o, size: a }; } const n2 = (i, e, t = !1) => { var r; const n = !!ri(), o = n ? Ap() : void 0, a = (r = void 0) != null ? r : n ? ci : void 0; if (!a) { Zt("provideGlobalConfig", "provideGlobalConfig() can only be used inside setup()."); return; } const s = ce(() => { const c = G(i); return o != null && o.value ? o2(o.value, c) : c; }); return a(oy, s), a(B0, ce(() => s.value.locale)), a(k0, ce(() => s.value.namespace)), a(Q0, ce(() => s.value.zIndex)), a(ty, { size: ce(() => s.value.size || "") }), a(ny, ce(() => ({ emptyValues: s.value.emptyValues, valueOnClear: s.value.valueOnClear }))), (t || !Yc.value) && (Yc.value = s.value), s; }, o2 = (i, e) => { const t = [.../* @__PURE__ */ new Set([...Tm(i), ...Tm(e)])], r = {}; for (const n of t) r[n] = e[n] !== void 0 ? e[n] : i[n]; return r; }; var ot = (i, e) => { const t = i.__vccOpts || i; for (const [r, n] of e) t[r] = n; return t; }; const a2 = ht({ size: { type: Ze([Number, String]) }, color: { type: String } }), s2 = Ie({ name: "ElIcon", inheritAttrs: !1 }), l2 = /* @__PURE__ */ Ie({ ...s2, props: a2, setup(i) { const e = i, t = it("icon"), r = ce(() => { const { size: n, color: o } = e; return !n && !o ? {} : { fontSize: gr(n) ? void 0 : qc(n), "--color": o }; }); return (n, o) => (ge(), Le("i", Or({ class: G(t).b(), style: G(r) }, n.$attrs), [ qe(n.$slots, "default") ], 16)); } }); var c2 = /* @__PURE__ */ ot(l2, [["__file", "icon.vue"]]); const Dt = ui(c2), Cp = Symbol("formContextKey"), Jc = Symbol("formItemContextKey"), ns = (i, e = {}) => { const t = Ae(void 0), r = e.prop ? t : z0("size"), n = e.global ? t : YA(), o = e.form ? { size: void 0 } : ct(Cp, void 0), a = e.formItem ? { size: void 0 } : ct(Jc, void 0); return ce(() => r.value || G(i) || (a == null ? void 0 : a.size) || (o == null ? void 0 : o.size) || n.value || ""); }, yu = (i) => { const e = z0("disabled"), t = ct(Cp, void 0); return ce(() => e.value || G(i) || (t == null ? void 0 : t.disabled) || !1); }, gl = () => { const i = ct(Cp, void 0), e = ct(Jc, void 0); return { form: i, formItem: e }; }, Lp = (i, { formItemContext: e, disableIdGeneration: t, disableIdManagement: r }) => { t || (t = Ae(!1)), r || (r = Ae(!1)); const n = Ae(); let o; const a = ce(() => { var s; return !!(!(i.label || i.ariaLabel) && e && e.inputIds && ((s = e.inputIds) == null ? void 0 : s.length) <= 1); }); return ei(() => { o = Ke([Di(i, "id"), t], ([s, c]) => { const l = s ?? (c ? void 0 : vu().value); l !== n.value && (e != null && e.removeInputId && (n.value && e.removeInputId(n.value), !(r != null && r.value) && !c && l && e.addInputId(l)), n.value = l); }, { immediate: !0 }); }), s0(() => { o && o(), e != null && e.removeInputId && n.value && e.removeInputId(n.value); }), { isLabeledByFormItem: a, inputId: n }; }; let lr; const u2 = ` height:0 !important; visibility:hidden !important; ${Jw() ? "" : "overflow:hidden !important;"} position:absolute !important; z-index:-1000 !important; top:0 !important; right:0 !important; `, h2 = [ "letter-spacing", "line-height", "padding-top", "padding-bottom", "font-family", "font-weight", "font-size", "text-rendering", "text-transform", "width", "text-indent", "padding-left", "padding-right", "border-width", "box-sizing" ]; function d2(i) { const e = window.getComputedStyle(i), t = e.getPropertyValue("box-sizing"), r = Number.parseFloat(e.getPropertyValue("padding-bottom")) + Number.parseFloat(e.getPropertyValue("padding-top")), n = Number.parseFloat(e.getPropertyValue("border-bottom-width")) + Number.parseFloat(e.getPropertyValue("border-top-width")); return { contextStyle: h2.map((o) => `${o}:${e.getPropertyValue(o)}`).join(";"), paddingSize: r, borderSize: n, boxSizing: t }; } function Gm(i, e = 1, t) { var r; lr || (lr = document.createElement("textarea"), document.body.appendChild(lr)); const { paddingSize: n, borderSize: o, boxSizing: a, contextStyle: s } = d2(i); lr.setAttribute("style", `${s};${u2}`), lr.value = i.value || i.placeholder || ""; let c = lr.scrollHeight; const l = {}; a === "border-box" ? c = c + o : a === "content-box" && (c = c - n), lr.value = ""; const h = lr.scrollHeight - n; if (_t(e)) { let u = h * e; a === "border-box" && (u = u + n + o), c = Math.max(u, c), l.minHeight = `${u}px`; } if (_t(t)) { let u = h * t; a === "border-box" && (u = u + n + o), c = Math.min(u, c); } return l.height = `${c}px`, (r = lr.parentNode) == null || r.removeChild(lr), lr = void 0, l; } const p2 = ht({ id: { type: String, default: void 0 }, size: Da, disabled: Boolean, modelValue: { type: Ze([ String, Number, Object ]), default: "" }, maxlength: { type: [String, Number] }, minlength: { type: [String, Number] }, type: { type: String, default: "text" }, resize: { type: String, values: ["none", "both", "horizontal", "vertical"] }, autosize: { type: Ze([Boolean, Object]), default: !1 }, autocomplete: { type: String, default: "off" }, formatter: { type: Function }, parser: { type: Function }, placeholder: { type: String }, form: { type: String }, readonly: Boolean, clearable: Boolean, showPassword: Boolean, showWordLimit: Boolean, suffixIcon: { type: $n }, prefixIcon: { type: $n }, containerRole: { type: String, default: void 0 }, tabindex: { type: [String, Number], default: 0 }, validateEvent: { type: Boolean, default: !0 }, inputStyle: { type: Ze([Object, Array, String]), default: () => Qr({}) }, autofocus: Boolean, rows: { type: Number, default: 2 }, ...Ho(["ariaLabel"]) }), f2 = { [Pt]: (i) => Li(i), input: (i) => Li(i), change: (i) => Li(i), focus: (i) => i instanceof FocusEvent, blur: (i) => i instanceof FocusEvent, clear: () => !0, mouseleave: (i) => i instanceof MouseEvent, mouseenter: (i) => i instanceof MouseEvent, keydown: (i) => i instanceof Event, compositionstart: (i) => i instanceof CompositionEvent, compositionupdate: (i) => i instanceof CompositionEvent, compositionend: (i) => i instanceof CompositionEvent }, m2 = Ie({ name: "ElInput", inheritAttrs: !1 }), g2 = /* @__PURE__ */ Ie({ ...m2, props: p2, emits: f2, setup(i, { expose: e, emit: t }) { const r = i, n = sw(), o = au(), a = ce(() => { const ae = {}; return r.containerRole === "combobox" && (ae["aria-haspopup"] = n["aria-haspopup"], ae["aria-owns"] = n["aria-owns"], ae["aria-expanded"] = n["aria-expanded"]), ae; }), s = ce(() => [ r.type === "textarea" ? y.b() : d.b(), d.m(g.value), d.is("disabled", m.value), d.is("exceed", Y.value), { [d.b("group")]: o.prepend || o.append, [d.m("prefix")]: o.prefix || r.prefixIcon, [d.m("suffix")]: o.suffix || r.suffixIcon || r.clearable || r.showPassword, [d.bm("suffix", "password-clear")]: D.value && k.value, [d.b("hidden")]: r.type === "hidden" }, n.class ]), c = ce(() => [ d.e("wrapper"), d.is("focus", _.value) ]), l = TE({ excludeKeys: ce(() => Object.keys(a.value)) }), { form: h, formItem: u } = gl(), { inputId: p } = Lp(r, { formItemContext: u }), g = ns(), m = yu(), d = it("input"), y = it("textarea"), f = Ci(), v = Ci(), M = Ae(!1), S = Ae(!1), T = Ae(), x = Ci(r.inputStyle), w = ce(() => f.value || v.value), { wrapperRef: A, isFocused: _, handleFocus: E, handleBlur: O } = iy(w, { beforeFocus() { return m.value; }, afterBlur() { var ae; r.validateEvent && ((ae = u == null ? void 0 : u.validate) == null || ae.call(u, "blur").catch((Te) => Zt(Te))); } }), L = ce(() => { var ae; return (ae = h == null ? void 0 : h.statusIcon) != null ? ae : !1; }), C = ce(() => (u == null ? void 0 : u.validateState) || ""), I = ce(() => C.value && D0[C.value]), R = ce(() => S.value ? yE : dE), b = ce(() => [ n.style ]), P = ce(() => [ r.inputStyle, x.value, { resize: r.resize } ]), N = ce(() => nn(r.modelValue) ? "" : String(r.modelValue)), D = ce(() => r.clearable && !m.value && !r.readonly && !!N.value && (_.value || M.value)), k = ce(() => r.showPassword && !m.value && !r.readonly && !!N.value && (!!N.value || _.value)), V = ce(() => r.showWordLimit && !!r.maxlength && (r.type === "text" || r.type === "textarea") && !m.value && !r.readonly && !r.showPassword), q = ce(() => N.value.length), Y = ce(() => !!V.value && q.value > Number(r.maxlength)), ne = ce(() => !!o.suffix || !!r.suffixIcon || D.value || r.showPassword || V.value || !!C.value && L.value), [X, z] = qA(f); er(v, (ae) => { if (ee(), !V.value || r.resize !== "both") return; const Te = ae[0], { width: Ee } = Te.contentRect; T.value = { right: `calc(100% - ${Ee + 15 + 6}px)` }; }); const H = () => { const { type: ae, autosize: Te } = r; if (!(!Kt || ae !== "textarea" || !v.value)) if (Te) { const Ee = Ai(Te) ? Te.minRows : void 0, oe = Ai(Te) ? Te.maxRows : void 0, Me = Gm(v.value, Ee, oe); x.value = { overflowY: "hidden", ...Me }, wt(() => { v.value.offsetHeight, x.value = Me; }); } else x.value = { minHeight: Gm(v.value).minHeight }; }, ee = /* @__PURE__ */ ((ae) => { let Te = !1; return () => { var Ee; Te || !r.autosize || ((Ee = v.value) == null ? void 0 : Ee.offsetParent) === null || (ae(), Te = !0); }; })(H), Q = () => { const ae = w.value, Te = r.formatter ? r.formatter(N.value) : N.value; !ae || ae.value === Te || (ae.value = Te); }, J = async (ae) => { X(); let { value: Te } = ae.target; if (r.formatter && (Te = r.parser ? r.parser(Te) : Te), !K.value) { if (Te === N.value) { Q(); return; } t(Pt, Te), t("input", Te), await wt(), Q(), z(); } }, W = (ae) => { t("change", ae.target.value); }, { isComposing: K, handleCompositionStart: ie, handleCompositionUpdate: B, handleCompositionEnd: j } = ry({ emit: t, afterComposition: J }), re = () => { S.value = !S.value, F(); }, F = async () => { var ae; await wt(), (ae = w.value) == null || ae.focus(); }, U = () => { var ae; return (ae = w.value) == null ? void 0 : ae.blur(); }, se = (ae) => { M.value = !1, t("mouseleave", ae); }, ue = (ae) => { M.value = !0, t("mouseenter", ae); }, fe = (ae) => { t("keydown", ae); }, ve = () => { var ae; (ae = w.value) == null || ae.select(); }, _e = () => { t(Pt, ""), t("change", ""), t("clear"), t("input", ""); }; return Ke(() => r.modelValue, () => { var ae; wt(() => H()), r.validateEvent && ((ae = u == null ? void 0 : u.validate) == null || ae.call(u, "change").catch((Te) => Zt(Te))); }), Ke(N, () => Q()), Ke(() => r.type, async () => { await wt(), Q(), H(); }), ei(() => { !r.formatter && r.parser && Zt("ElInput", "If you set the parser, you also need to set the formatter."), Q(), wt(H); }), e({ input: f, textarea: v, ref: w, textareaStyle: P, autosize: Di(r, "autosize"), isComposing: K, focus: F, blur: U, select: ve, clear: _e, resizeTextarea: H }), (ae, Te) => (ge(), Le("div", Or(G(a), { class: [ G(s), { [G(d).bm("group", "append")]: ae.$slots.append, [G(d).bm("group", "prepend")]: ae.$slots.prepend } ], style: G(b), role: ae.containerRole, onMouseenter: ue, onMouseleave: se }), [ Ve(" input "), ae.type !== "textarea" ? (ge(), Le(Vt, { key: 0 }, [ Ve(" prepend slot "), ae.$slots.prepend ? (ge(), Le("div", { key: 0, class: Re(G(d).be("group", "prepend")) }, [ qe(ae.$slots, "prepend") ], 2)) : Ve("v-if", !0), ke("div", { ref_key: "wrapperRef", ref: A, class: Re(G(c)) }, [ Ve(" prefix slot "), ae.$slots.prefix || ae.prefixIcon ? (ge(), Le("span", { key: 0, class: Re(G(d).e("prefix")) }, [ ke("span", { class: Re(G(d).e("prefix-inner")) }, [ qe(ae.$slots, "prefix"), ae.prefixIcon ? (ge(), Ue(G(Dt), { key: 0, class: Re(G(d).e("icon")) }, { default: me(() => [ (ge(), Ue(Ni(ae.prefixIcon))) ]), _: 1 }, 8, ["class"])) : Ve("v-if", !0) ], 2) ], 2)) : Ve("v-if", !0), ke("input", Or({ id: G(p), ref_key: "input", ref: f, class: G(d).e("inner") }, G(l), { minlength: ae.minlength, maxlength: ae.maxlength, type: ae.showPassword ? S.value ? "text" : "password" : ae.type, disabled: G(m), readonly: ae.readonly, autocomplete: ae.autocomplete, tabindex: ae.tabindex, "aria-label": ae.ariaLabel, placeholder: ae.placeholder, style: ae.inputStyle, form: ae.form, autofocus: ae.autofocus, onCompositionstart: G(ie), onCompositionupdate: G(B), onCompositionend: G(j), onInput: J, onChange: W, onKeydown: fe }), null, 16, ["id", "minlength", "maxlength", "type", "disabled", "readonly", "autocomplete", "tabindex", "aria-label", "placeholder", "form", "autofocus", "onCompositionstart", "onCompositionupdate", "onCompositionend"]), Ve(" suffix slot "), G(ne) ? (ge(), Le("span", { key: 1, class: Re(G(d).e("suffix")) }, [ ke("span", { class: Re(G(d).e("suffix-inner")) }, [ !G(D) || !G(k) || !G(V) ? (ge(), Le(Vt, { key: 0 }, [ qe(ae.$slots, "suffix"), ae.suffixIcon ? (ge(), Ue(G(Dt), { key: 0, class: Re(G(d).e("icon")) }, { default: me(() => [ (ge(), Ue(Ni(ae.suffixIcon))) ]), _: 1 }, 8, ["class"])) : Ve("v-if", !0) ], 64)) : Ve("v-if", !0), G(D) ? (ge(), Ue(G(Dt), { key: 1, class: Re([G(d).e("icon"), G(d).e("clear")]), onMousedown: ai(G($s), ["prevent"]), onClick: _e }, { default: me(() => [ le(G(gp)) ]), _: 1 }, 8, ["class", "onMousedown"])) : Ve("v-if", !0), G(k) ? (ge(), Ue(G(Dt), { key: 2, class: Re([G(d).e("icon"), G(d).e("password")]), onClick: re }, { default: me(() => [ (ge(), Ue(Ni(G(R)))) ]), _: 1 }, 8, ["class"])) : Ve("v-if", !0), G(V) ? (ge(), Le("span", { key: 3, class: Re(G(d).e("count")) }, [ ke("span", { class: Re(G(d).e("count-inner")) }, xt(G(q)) + " / " + xt(ae.maxlength), 3) ], 2)) : Ve("v-if", !0), G(C) && G(I) && G(L) ? (ge(), Ue(G(Dt), { key: 4, class: Re([ G(d).e("icon"), G(d).e("validateIcon"), G(d).is("loading", G(C) === "validating") ]) }, { default: me(() => [ (ge(), Ue(Ni(G(I)))) ]), _: 1 }, 8, ["class"])) : Ve("v-if", !0) ], 2) ], 2)) : Ve("v-if", !0) ], 2), Ve(" append slot "), ae.$slots.append ? (ge(), Le("div", { key: 1, class: Re(G(d).be("group", "append")) }, [ qe(ae.$slots, "append") ], 2)) : Ve("v-if", !0) ], 64)) : (ge(), Le(Vt, { key: 1 }, [ Ve(" textarea "), ke("textarea", Or({ id: G(p), ref_key: "textarea", ref: v, class: [G(y).e("inner"), G(d).is("focus", G(_))] }, G(l), { minlength: ae.minlength, maxlength: ae.maxlength, tabindex: ae.tabindex, disabled: G(m), readonly: ae.readonly, autocomplete: ae.autocomplete, style: G(P), "aria-label": ae.ariaLabel, placeholder: ae.placeholder, form: ae.form, autofocus: ae.autofocus, rows: ae.rows, onCompositionstart: G(ie), onCompositionupdate: G(B), onCompositionend: G(j), onInput: J, onFocus: G(E), onBlur: G(O), onChange: W, onKeydown: fe }), null, 16, ["id", "minlength", "maxlength", "tabindex", "disabled", "readonly", "autocomplete", "aria-label", "placeholder", "form", "autofocus", "rows", "onCompositionstart", "onCompositionupdate", "onCompositionend", "onFocus", "onBlur"]), G(V) ? (ge(), Le("span", { key: 0, style: Ot(T.value), class: Re(G(d).e("count")) }, xt(G(q)) + " / " + xt(ae.maxlength), 7)) : Ve("v-if", !0) ], 64)) ], 16, ["role"])); } }); var v2 = /* @__PURE__ */ ot(g2, [["__file", "input.vue"]]); const y2 = ui(v2), Yo = 4, b2 = { vertical: { offset: "offsetHeight", scroll: "scrollTop", scrollSize: "scrollHeight", size: "height", key: "vertical", axis: "Y", client: "clientY", direction: "top" }, horizontal: { offset: "offsetWidth", scroll: "scrollLeft", scrollSize: "scrollWidth", size: "width", key: "horizontal", axis: "X", client: "clientX", direction: "left" } }, x2 = ({ move: i, size: e, bar: t }) => ({ [t.size]: e, transform: `translate${t.axis}(${i}%)` }), Rp = Symbol("scrollbarContextKey"), w2 = ht({ vertical: Boolean, size: String, move: Number, ratio: { type: Number, required: !0 }, always: Boolean }), _2 = "Thumb", M2 = /* @__PURE__ */ Ie({ __name: "thumb", props: w2, setup(i) { const e = i, t = ct(Rp), r = it("scrollbar"); t || is(_2, "can not inject scrollbar context"); const n = Ae(), o = Ae(), a = Ae({}), s = Ae(!1); let c = !1, l = !1, h = Kt ? document.onselectstart : null; const u = ce(() => b2[e.vertical ? "vertical" : "horizontal"]), p = ce(() => x2({ size: e.size, move: e.move, bar: u.value })), g = ce(() => n.value[u.value.offset] ** 2 / t.wrapElement[u.value.scrollSize] / e.ratio / o.value[u.value.offset]), m = (x) => { var w; if (x.stopPropagation(), x.ctrlKey || [1, 2].includes(x.button)) return; (w = window.getSelection()) == null || w.removeAllRanges(), y(x); const A = x.currentTarget; A && (a.value[u.value.axis] = A[u.value.offset] - (x[u.value.client] - A.getBoundingClientRect()[u.value.direction])); }, d = (x) => { if (!o.value || !n.value || !t.wrapElement) return; const w = Math.abs(x.target.getBoundingClientRect()[u.value.direction] - x[u.value.client]), A = o.value[u.value.offset] / 2, _ = (w - A) * 100 * g.value / n.value[u.value.offset]; t.wrapElement[u.value.scroll] = _ * t.wrapElement[u.value.scrollSize] / 100; }, y = (x) => { x.stopImmediatePropagation(), c = !0, document.addEventListener("mousemove", f), document.addEventListener("mouseup", v), h = document.onselectstart, document.onselectstart = () => !1; }, f = (x) => { if (!n.value || !o.value || c === !1) return; const w = a.value[u.value.axis]; if (!w) return; const A = (n.value.getBoundingClientRect()[u.value.direction] - x[u.value.client]) * -1, _ = o.value[u.value.offset] - w, E = (A - _) * 100 * g.value / n.value[u.value.offset]; t.wrapElement[u.value.scroll] = E * t.wrapElement[u.value.scrollSize] / 100; }, v = () => { c = !1, a.value[u.value.axis] = 0, document.removeEventListener("mousemove", f), document.removeEventListener("mouseup", v), T(), l && (s.value = !1); }, M = () => { l = !1, s.value = !!e.size; }, S = () => { l = !0, s.value = c; }; or(() => { T(), document.removeEventListener("mouseup", v); }); const T = () => { document.onselectstart !== h && (document.onselectstart = h); }; return si(Di(t, "scrollbarElement"), "mousemove", M), si(Di(t, "scrollbarElement"), "mouseleave", S), (x, w) => (ge(), Ue(hl, { name: G(r).b("fade"), persisted: "" }, { default: me(() => [ It(ke("div", { ref_key: "instance", ref: n, class: Re([G(r).e("bar"), G(r).is(G(u).key)]), onMousedown: d }, [ ke("div", { ref_key: "thumb", ref: o, class: Re(G(r).e("thumb")), style: Ot(G(p)), onMousedown: m }, null, 38) ], 34), [ [fi, x.always || s.value] ]) ]), _: 1 }, 8, ["name"])); } }); var Hm = /* @__PURE__ */ ot(M2, [["__file", "thumb.vue"]]); const S2 = ht({ always: { type: Boolean, default: !0 }, minSize: { type: Number, required: !0 } }), T2 = /* @__PURE__ */ Ie({ __name: "bar", props: S2, setup(i, { expose: e }) { const t = i, r = ct(Rp), n = Ae(0), o = Ae(0), a = Ae(""), s = Ae(""), c = Ae(1), l = Ae(1); return e({ handleScroll: (h) => { if (h) { const u = h.offsetHeight - Yo, p = h.offsetWidth - Yo; o.value = h.scrollTop * 100 / u * c.value, n.value = h.scrollLeft * 100 / p * l.value; } }, update: () => { const h = r == null ? void 0 : r.wrapElement; if (!h) return; const u = h.offsetHeight - Yo, p = h.offsetWidth - Yo, g = u ** 2 / h.scrollHeight, m = p ** 2 / h.scrollWidth, d = Math.max(g, t.minSize), y = Math.max(m, t.minSize); c.value = g / (u - g) / (d / (u - d)), l.value = m / (p - m) / (y / (p - y)), s.value = d + Yo < u ? `${d}px` : "", a.value = y + Yo < p ? `${y}px` : ""; } }), (h, u) => (ge(), Le(Vt, null, [ le(Hm, { move: n.value, ratio: l.value, size: a.value, always: h.always }, null, 8, ["move", "ratio", "size", "always"]), le(Hm, { move: o.value, ratio: c.value, size: s.value, vertical: "", always: h.always }, null, 8, ["move", "ratio", "size", "always"]) ], 64)); } }); var E2 = /* @__PURE__ */ ot(T2, [["__file", "bar.vue"]]); const A2 = ht({ height: { type: [String, Number], default: "" }, maxHeight: { type: [String, Number], default: "" }, native: { type: Boolean, default: !1 }, wrapStyle: { type: Ze([String, Object, Array]), default: "" }, wrapClass: { type: [String, Array], default: "" }, viewClass: { type: [String, Array], default: "" }, viewStyle: { type: [String, Array, Object], default: "" }, noresize: Boolean, tag: { type: String, default: "div" }, always: Boolean, minSize: { type: Number, default: 20 }, tabindex: { type: [String, Number], default: void 0 }, id: String, role: String, ...Ho(["ariaLabel", "ariaOrientation"]) }), C2 = { scroll: ({ scrollTop: i, scrollLeft: e }) => [i, e].every(_t) }, hd = "ElScrollbar", L2 = Ie({ name: hd }), R2 = /* @__PURE__ */ Ie({ ...L2, props: A2, emits: C2, setup(i, { expose: e, emit: t }) { const r = i, n = it("scrollbar"); let o, a, s = 0, c = 0; const l = Ae(), h = Ae(), u = Ae(), p = Ae(), g = ce(() => { const T = {}; return r.height && (T.height = qc(r.height)), r.maxHeight && (T.maxHeight = qc(r.maxHeight)), [r.wrapStyle, T]; }), m = ce(() => [ r.wrapClass, n.e("wrap"), { [n.em("wrap", "hidden-default")]: !r.native } ]), d = ce(() => [n.e("view"), r.viewClass]), y = () => { var T; h.value && ((T = p.value) == null || T.handleScroll(h.value), s = h.value.scrollTop, c = h.value.scrollLeft, t("scroll", { scrollTop: h.value.scrollTop, scrollLeft: h.value.scrollLeft })); }; function f(T, x) { Ai(T) ? h.value.scrollTo(T) : _t(T) && _t(x) && h.value.scrollTo(T, x); } const v = (T) => { if (!_t(T)) { Zt(hd, "value must be a number"); return; } h.value.scrollTop = T; }, M = (T) => { if (!_t(T)) { Zt(hd, "value must be a number"); return; } h.value.scrollLeft = T; }, S = () => { var T; (T = p.value) == null || T.update(); }; return Ke(() => r.noresize, (T) => { T ? (o == null || o(), a == null || a()) : ({ stop: o } = er(u, S), a = si("resize", S)); }, { immediate: !0 }), Ke(() => [r.maxHeight, r.height], () => { r.native || wt(() => { var T; S(), h.value && ((T = p.value) == null || T.handleScroll(h.value)); }); }), ci(Rp, Xi({ scrollbarElement: l, wrapElement: h })), lw(() => { h.value && (h.value.scrollTop = s, h.value.scrollLeft = c); }), ei(() => { r.native || wt(() => { S(); }); }), rp(() => S()), e({ wrapRef: h, update: S, scrollTo: f, setScrollTop: v, setScrollLeft: M, handleScroll: y }), (T, x) => (ge(), Le("div", { ref_key: "scrollbarRef", ref: l, class: Re(G(n).b()) }, [ ke("div", { ref_key: "wrapRef", ref: h, class: Re(G(m)), style: Ot(G(g)), tabindex: T.tabindex, onScroll: y }, [ (ge(), Ue(Ni(T.tag), { id: T.id, ref_key: "resizeRef", ref: u, class: Re(G(d)), style: Ot(T.viewStyle), role: T.role, "aria-label": T.ariaLabel, "aria-orientation": T.ariaOrientation }, { default: me(() => [ qe(T.$slots, "default") ]), _: 3 }, 8, ["id", "class", "style", "role", "aria-label", "aria-orientation"])) ], 46, ["tabindex"]), T.native ? Ve("v-if", !0) : (ge(), Ue(E2, { key: 0, ref_key: "barRef", ref: p, always: T.always, "min-size": T.minSize }, null, 8, ["always", "min-size"])) ], 2)); } }); var O2 = /* @__PURE__ */ ot(R2, [["__file", "scrollbar.vue"]]); const P2 = ui(O2), Op = Symbol("popper"), ay = Symbol("popperContent"), I2 = [ "dialog", "grid", "group", "listbox", "menu", "navigation", "tooltip", "tree" ], sy = ht({ role: { type: String, values: I2, default: "tooltip" } }), D2 = Ie({ name: "ElPopper", inheritAttrs: !1 }), N2 = /* @__PURE__ */ Ie({ ...D2, props: sy, setup(i, { expose: e }) { const t = i, r = Ae(), n = Ae(), o = Ae(), a = Ae(), s = ce(() => t.role), c = { triggerRef: r, popperInstanceRef: n, contentRef: o, referenceRef: a, role: s }; return e(c), ci(Op, c), (l, h) => qe(l.$slots, "default"); } }); var B2 = /* @__PURE__ */ ot(N2, [["__file", "popper.vue"]]); const ly = ht({ arrowOffset: { type: Number, default: 5 } }), k2 = Ie({ name: "ElPopperArrow", inheritAttrs: !1 }), z2 = /* @__PURE__ */ Ie({ ...k2, props: ly, setup(i, { expose: e }) { const t = i, r = it("popper"), { arrowOffset: n, arrowRef: o, arrowStyle: a } = ct(ay, void 0); return Ke(() => t.arrowOffset, (s) => { n.value = s; }), or(() => { o.value = void 0; }), e({ arrowRef: o }), (s, c) => (ge(), Le("span", { ref_key: "arrowRef", ref: o, class: Re(G(r).e("arrow")), style: Ot(G(a)), "data-popper-arrow": "" }, null, 6)); } }); var F2 = /* @__PURE__ */ ot(z2, [["__file", "arrow.vue"]]); const Ju = "ElOnlyChild", V2 = Ie({ name: Ju, setup(i, { slots: e, attrs: t }) { var r; const n = ct(J0), o = $A((r = n == null ? void 0 : n.setForwardRef) != null ? r : $s); return () => { var a; const s = (a = e.default) == null ? void 0 : a.call(e, t); if (!s) return null; if (s.length > 1) return Zt(Ju, "requires exact only one valid child."), null; const c = cy(s); return c ? It(cw(c, t), [[o]]) : (Zt(Ju, "no valid child node found"), null); }; } }); function cy(i) { if (!i) return null; const e = i; for (const t of e) { if (Ai(t)) switch (t.type) { case uw: continue; case o0: case "svg": return jm(t); case Vt: return cy(t.children); default: return t; } return jm(t); } return null; } function jm(i) { const e = it("only-child"); return le("span", { class: e.e("content") }, [i]); } const uy = ht({ virtualRef: { type: Ze(Object) }, virtualTriggering: Boolean, onMouseenter: { type: Ze(Function) }, onMouseleave: { type: Ze(Function) }, onClick: { type: Ze(Function) }, onKeydown: { type: Ze(Function) }, onFocus: { type: Ze(Function) }, onBlur: { type: Ze(Function) }, onContextmenu: { type: Ze(Function) }, id: String, open: Boolean }), U2 = Ie({ name: "ElPopperTrigger", inheritAttrs: !1 }), G2 = /* @__PURE__ */ Ie({ ...U2, props: uy, setup(i, { expose: e }) { const t = i, { role: r, triggerRef: n } = ct(Op, void 0); WA(n); const o = ce(() => s.value ? t.id : void 0), a = ce(() => { if (r && r.value === "tooltip") return t.open && t.id ? t.id : void 0; }), s = ce(() => { if (r && r.value !== "tooltip") return r.value; }), c = ce(() => s.value ? `${t.open}` : void 0); let l; const h = [ "onMouseenter", "onMouseleave", "onClick", "onKeydown", "onFocus", "onBlur", "onContextmenu" ]; return ei(() => { Ke(() => t.virtualRef, (u) => { u && (n.value = tn(u)); }, { immediate: !0 }), Ke(n, (u, p) => { l == null || l(), l = void 0, Mo(u) && (h.forEach((g) => { var m; const d = t[g]; d && (u.addEventListener(g.slice(2).toLowerCase(), d), (m = p == null ? void 0 : p.removeEventListener) == null || m.call(p, g.slice(2).toLowerCase(), d)); }), l = Ke([o, a, s, c], (g) => { [ "aria-controls", "aria-describedby", "aria-haspopup", "aria-expanded" ].forEach((m, d) => { nn(g[d]) ? u.removeAttribute(m) : u.setAttribute(m, g[d]); }); }, { immediate: !0 })), Mo(p) && [ "aria-controls", "aria-describedby", "aria-haspopup", "aria-expanded" ].forEach((g) => p.removeAttribute(g)); }, { immediate: !0 }); }), or(() => { if (l == null || l(), l = void 0, n.value && Mo(n.value)) { const u = n.value; h.forEach((p) => { const g = t[p]; g && u.removeEventListener(p.slice(2).toLowerCase(), g); }), n.value = void 0; } }), e({ triggerRef: n }), (u, p) => u.virtualTriggering ? Ve("v-if", !0) : (ge(), Ue(G(V2), Or({ key: 0 }, u.$attrs, { "aria-controls": G(o), "aria-describedby": G(a), "aria-expanded": G(c), "aria-haspopup": G(s) }), { default: me(() => [ qe(u.$slots, "default") ]), _: 3 }, 16, ["aria-controls", "aria-describedby", "aria-expanded", "aria-haspopup"])); } }); var H2 = /* @__PURE__ */ ot(G2, [["__file", "trigger.vue"]]); const Ku = "focus-trap.focus-after-trapped", Qu = "focus-trap.focus-after-released", j2 = "focus-trap.focusout-prevented", Wm = { cancelable: !0, bubbles: !1 }, W2 = { cancelable: !0, bubbles: !1 }, $m = "focusAfterTrapped", qm = "focusAfterReleased", $2 = Symbol("elFocusTrap"), Pp = Ae(), bu = Ae(0), Ip = Ae(0); let kl = 0; const hy = (i) => { const e = [], t = document.createTreeWalker(i, NodeFilter.SHOW_ELEMENT, { acceptNode: (r) => { const n = r.tagName === "INPUT" && r.type === "hidden"; return r.disabled || r.hidden || n ? NodeFilter.FILTER_SKIP : r.tabIndex >= 0 || r === document.activeElement ? NodeFilter.FILTER_ACCEPT : NodeFilter.FILTER_SKIP; } }); for (; t.nextNode(); ) e.push(t.currentNode); return e; }, Xm = (i, e) => { for (const t of i) if (!q2(t, e)) return t; }, q2 = (i, e) => { if (process.env.NODE_ENV === "test") return !1; if (getComputedStyle(i).visibility === "hidden") return !0; for (; i; ) { if (e && i === e) return !1; if (getComputedStyle(i).display === "none") return !0; i = i.parentElement; } return !1; }, X2 = (i) => { const e = hy(i), t = Xm(e, i), r = Xm(e.reverse(), i); return [t, r]; }, Z2 = (i) => i instanceof HTMLInputElement && "select" in i, On = (i, e) => { if (i && i.focus) { const t = document.activeElement; i.focus({ preventScroll: !0 }), Ip.value = window.performance.now(), i !== t && Z2(i) && e && i.select(); } }; function Zm(i, e) { const t = [...i], r = i.indexOf(e); return r !== -1 && t.splice(r, 1), t; } const Y2 = () => { let i = []; return { push: (e) => { const t = i[0]; t && e !== t && t.pause(), i = Zm(i, e), i.unshift(e); }, remove: (e) => { var t, r; i = Zm(i, e), (r = (t = i[0]) == null ? void 0 : t.resume) == null || r.call(t); } }; }, J2 = (i, e = !1) => { const t = document.activeElement; for (const r of i) if (On(r, e), document.activeElement !== t) return; }, Ym = Y2(), K2 = () => bu.value > Ip.value, zl = () => { Pp.value = "pointer", bu.value = window.performance.now(); }, Jm = () => { Pp.value = "keyboard", bu.value = window.performance.now(); }, Q2 = () => (ei(() => { kl === 0 && (document.addEventListener("mousedown", zl), document.addEventListener("touchstart", zl), document.addEventListener("keydown", Jm)), kl++; }), or(() => { kl--, kl <= 0 && (document.removeEventListener("mousedown", zl), document.removeEventListener("touchstart", zl), document.removeEventListener("keydown", Jm)); }), { focusReason: Pp, lastUserFocusTimestamp: bu, lastAutomatedFocusTimestamp: Ip }), Fl = (i) => new CustomEvent(j2, { ...W2, detail: i }), eC = Ie({ name: "ElFocusTrap", inheritAttrs: !1, props: { loop: Boolean, trapped: Boolean, focusTrapEl: Object, focusStartEl: { type: [Object, String], default: "first" } }, emits: [ $m, qm, "focusin", "focusout", "focusout-prevented", "release-requested" ], setup(i, { emit: e }) { const t = Ae(); let r, n; const { focusReason: o } = Q2(); VA((m) => { i.trapped && !a.paused && e("release-requested", m); }); const a = { paused: !1, pause() { this.paused = !0; }, resume() { this.paused = !1; } }, s = (m) => { if (!i.loop && !i.trapped || a.paused) return; const { key: d, altKey: y, ctrlKey: f, metaKey: v, currentTarget: M, shiftKey: S } = m, { loop: T } = i, x = d === Pr.tab && !y && !f && !v, w = document.activeElement; if (x && w) { const A = M, [_, E] = X2(A); if (_ && E) { if (!S && w === E) { const O = Fl({ focusReason: o.value }); e("focusout-prevented", O), O.defaultPrevented || (m.preventDefault(), T && On(_, !0)); } else if (S && [_, A].includes(w)) { const O = Fl({ focusReason: o.value }); e("focusout-prevented", O), O.defaultPrevented || (m.preventDefault(), T && On(E, !0)); } } else if (w === A) { const O = Fl({ focusReason: o.value }); e("focusout-prevented", O), O.defaultPrevented || m.preventDefault(); } } }; ci($2, { focusTrapRef: t, onKeydown: s }), Ke(() => i.focusTrapEl, (m) => { m && (t.value = m); }, { immediate: !0 }), Ke([t], ([m], [d]) => { m && (m.addEventListener("keydown", s), m.addEventListener("focusin", h), m.addEventListener("focusout", u)), d && (d.removeEventListener("keydown", s), d.removeEventListener("focusin", h), d.removeEventListener("focusout", u)); }); const c = (m) => { e($m, m); }, l = (m) => e(qm, m), h = (m) => { const d = G(t); if (!d) return; const y = m.target, f = m.relatedTarget, v = y && d.contains(y); i.trapped || f && d.contains(f) || (r = f), v && e("focusin", m), !a.paused && i.trapped && (v ? n = y : On(n, !0)); }, u = (m) => { const d = G(t); if (!(a.paused || !d)) if (i.trapped) { const y = m.relatedTarget; !nn(y) && !d.contains(y) && setTimeout(() => { if (!a.paused && i.trapped) { const f = Fl({ focusReason: o.value }); e("focusout-prevented", f), f.defaultPrevented || On(n, !0); } }, 0); } else { const y = m.target; y && d.contains(y) || e("focusout", m); } }; async function p() { await wt(); const m = G(t); if (m) { Ym.push(a); const d = m.contains(document.activeElement) ? r : document.activeElement; if (r = d, !m.contains(d)) { const y = new Event(Ku, Wm); m.addEventListener(Ku, c), m.dispatchEvent(y), y.defaultPrevented || wt(() => { let f = i.focusStartEl; Li(f) || (On(f), document.activeElement !== f && (f = "first")), f === "first" && J2(hy(m), !0), (document.activeElement === d || f === "container") && On(m); }); } } } function g() { const m = G(t); if (m) { m.removeEventListener(Ku, c); const d = new CustomEvent(Qu, { ...Wm, detail: { focusReason: o.value } }); m.addEventListener(Qu, l), m.dispatchEvent(d), !d.defaultPrevented && (o.value == "keyboard" || !K2() || m.contains(document.activeElement)) && On(r ?? document.body), m.removeEventListener(Qu, l), Ym.remove(a); } } return ei(() => { i.trapped && p(), Ke(() => i.trapped, (m) => { m ? p() : g(); }); }), or(() => { i.trapped && g(), t.value && (t.value.removeEventListener("keydown", s), t.value.removeEventListener("focusin", h), t.value.removeEventListener("focusout", u), t.value = void 0); }), { onKeydown: s }; } }); function tC(i, e, t, r, n, o) { return qe(i.$slots, "default", { handleKeydown: i.onKeydown }); } var iC = /* @__PURE__ */ ot(eC, [["render", tC], ["__file", "focus-trap.vue"]]); const rC = ["fixed", "absolute"], nC = ht({ boundariesPadding: { type: Number, default: 0 }, fallbackPlacements: { type: Ze(Array), default: void 0 }, gpuAcceleration: { type: Boolean, default: !0 }, offset: { type: Number, default: 12 }, placement: { type: String, values: rs, default: "bottom" }, popperOptions: { type: Ze(Object), default: () => ({}) }, strategy: { type: String, values: rC, default: "absolute" } }), dy = ht({ ...nC, id: String, style: { type: Ze([String, Array, Object]) }, className: { type: Ze([String, Array, Object]) }, effect: { type: Ze(String), default: "dark" }, visible: Boolean, enterable: { type: Boolean, default: !0 }, pure: Boolean, focusOnShow: { type: Boolean, default: !1 }, trapping: { type: Boolean, default: !1 }, popperClass: { type: Ze([String, Array, Object]) }, popperStyle: { type: Ze([String, Array, Object]) }, referenceEl: { type: Ze(Object) }, triggerTargetEl: { type: Ze(Object) }, stopPopperMouseEvent: { type: Boolean, default: !0 }, virtualTriggering: Boolean, zIndex: Number, ...Ho(["ariaLabel"]) }), oC = { mouseenter: (i) => i instanceof MouseEvent, mouseleave: (i) => i instanceof MouseEvent, focus: () => !0, blur: () => !0, close: () => !0 }, aC = (i, e = []) => { const { placement: t, strategy: r, popperOptions: n } = i, o = { placement: t, strategy: r, ...n, modifiers: [...lC(i), ...e] }; return cC(o, n == null ? void 0 : n.modifiers), o; }, sC = (i) => { if (Kt) return tn(i); }; function lC(i) { const { offset: e, gpuAcceleration: t, fallbackPlacements: r } = i; return [ { name: "offset", options: { offset: [0, e ?? 12] } }, { name: "preventOverflow", options: { padding: { top: 2, bottom: 2, left: 5, right: 5 } } }, { name: "flip", options: { padding: 5, fallbackPlacements: r } }, { name: "computeStyles", options: { gpuAcceleration: t } } ]; } function cC(i, e) { e && (i.modifiers = [...i.modifiers, ...e ?? []]); } const uC = 0, hC = (i) => { const { popperInstanceRef: e, contentRef: t, triggerRef: r, role: n } = ct(Op, void 0), o = Ae(), a = Ae(), s = ce(() => ({ name: "eventListeners", enabled: !!i.visible })), c = ce(() => { var f; const v = G(o), M = (f = G(a)) != null ? f : uC; return { name: "arrow", enabled: !$T(v), options: { element: v, padding: M } }; }), l = ce(() => ({ onFirstUpdate: () => { m(); }, ...aC(i, [ G(c), G(s) ]) })), h = ce(() => sC(i.referenceEl) || G(r)), { attributes: u, state: p, styles: g, update: m, forceUpdate: d, instanceRef: y } = kA(h, t, l); return Ke(y, (f) => e.value = f), ei(() => { Ke(() => { var f; return (f = G(h)) == null ? void 0 : f.getBoundingClientRect(); }, () => { m(); }); }), { attributes: u, arrowRef: o, contentRef: t, instanceRef: y, state: p, styles: g, role: n, forceUpdate: d, update: m }; }, dC = (i, { attributes: e, styles: t, role: r }) => { const { nextZIndex: n } = ey(), o = it("popper"), a = ce(() => G(e).popper), s = Ae(_t(i.zIndex) ? i.zIndex : n()), c = ce(() => [ o.b(), o.is("pure", i.pure), o.is(i.effect), i.popperClass ]), l = ce(() => [ { zIndex: G(s) }, G(t).popper, i.popperStyle || {} ]), h = ce(() => r.value === "dialog" ? "false" : void 0), u = ce(() => G(t).arrow || {}); return { ariaModal: h, arrowStyle: u, contentAttrs: a, contentClass: c, contentStyle: l, contentZIndex: s, updateZIndex: () => { s.value = _t(i.zIndex) ? i.zIndex : n(); } }; }, pC = (i, e) => { const t = Ae(!1), r = Ae(); return { focusStartRef: r, trapped: t, onFocusAfterReleased: (n) => { var o; ((o = n.detail) == null ? void 0 : o.focusReason) !== "pointer" && (r.value = "first", e("blur")); }, onFocusAfterTrapped: () => { e("focus"); }, onFocusInTrap: (n) => { i.visible && !t.value && (n.target && (r.value = n.target), t.value = !0); }, onFocusoutPrevented: (n) => { i.trapping || (n.detail.focusReason === "pointer" && n.preventDefault(), t.value = !1); }, onReleaseRequested: () => { t.value = !1, e("close"); } }; }, fC = Ie({ name: "ElPopperContent" }), mC = /* @__PURE__ */ Ie({ ...fC, props: dy, emits: oC, setup(i, { expose: e, emit: t }) { const r = i, { focusStartRef: n, trapped: o, onFocusAfterReleased: a, onFocusAfterTrapped: s, onFocusInTrap: c, onFocusoutPrevented: l, onReleaseRequested: h } = pC(r, t), { attributes: u, arrowRef: p, contentRef: g, styles: m, instanceRef: d, role: y, update: f } = hC(r), { ariaModal: v, arrowStyle: M, contentAttrs: S, contentClass: T, contentStyle: x, updateZIndex: w } = dC(r, { styles: m, attributes: u, role: y }), A = ct(Jc, void 0), _ = Ae(); ci(ay, { arrowStyle: M, arrowRef: p, arrowOffset: _ }), A && ci(Jc, { ...A, addInputId: $s, removeInputId: $s }); let E; const O = (C = !0) => { f(), C && w(); }, L = () => { O(!1), r.visible && r.focusOnShow ? o.value = !0 : r.visible === !1 && (o.value = !1); }; return ei(() => { Ke(() => r.triggerTargetEl, (C, I) => { E == null || E(), E = void 0; const R = G(C || g.value), b = G(I || g.value); Mo(R) && (E = Ke([y, () => r.ariaLabel, v, () => r.id], (P) => { ["role", "aria-label", "aria-modal", "id"].forEach((N, D) => { nn(P[D]) ? R.removeAttribute(N) : R.setAttribute(N, P[D]); }); }, { immediate: !0 })), b !== R && Mo(b) && ["role", "aria-label", "aria-modal", "id"].forEach((P) => { b.removeAttribute(P); }); }, { immediate: !0 }), Ke(() => r.visible, L, { immediate: !0 }); }), or(() => { E == null || E(), E = void 0; }), e({ popperContentRef: g, popperInstanceRef: d, updatePopper: O, contentStyle: x }), (C, I) => (ge(), Le("div", Or({ ref_key: "contentRef", ref: g }, G(S), { style: G(x), class: G(T), tabindex: "-1", onMouseenter: (R) => C.$emit("mouseenter", R), onMouseleave: (R) => C.$emit("mouseleave", R) }), [ le(G(iC), { trapped: G(o), "trap-on-focus-in": !0, "focus-trap-el": G(g), "focus-start-el": G(n), onFocusAfterTrapped: G(s), onFocusAfterReleased: G(a), onFocusin: G(c), onFocusoutPrevented: G(l), onReleaseRequested: G(h) }, { default: me(() => [ qe(C.$slots, "default") ]), _: 3 }, 8, ["trapped", "focus-trap-el", "focus-start-el", "onFocusAfterTrapped", "onFocusAfterReleased", "onFocusin", "onFocusoutPrevented", "onReleaseRequested"]) ], 16, ["onMouseenter", "onMouseleave"])); } }); var gC = /* @__PURE__ */ ot(mC, [["__file", "content.vue"]]); const vC = ui(B2), Dp = Symbol("elTooltip"), Wi = ht({ ...HA, ...dy, appendTo: { type: Ze([String, Object]) }, content: { type: String, default: "" }, rawContent: Boolean, persistent: Boolean, visible: { type: Ze(Boolean), default: null }, transition: String, teleported: { type: Boolean, default: !0 }, disabled: Boolean, ...Ho(["ariaLabel"]) }), Js = ht({ ...uy, disabled: Boolean, trigger: { type: Ze([String, Array]), default: "hover" }, triggerKeys: { type: Ze(Array), default: () => [Pr.enter, Pr.space] } }), { useModelToggleProps: yC, useModelToggleEmits: bC, useModelToggle: xC } = DE("visible"), wC = ht({ ...sy, ...yC, ...Wi, ...Js, ...ly, showArrow: { type: Boolean, default: !0 } }), _C = [ ...bC, "before-show", "before-hide", "show", "hide", "open", "close" ], MC = (i, e) => Bi(i) ? i.includes(e) : i === e, Jo = (i, e, t) => (r) => { MC(G(i), e) && t(r); }, SC = Ie({ name: "ElTooltipTrigger" }), TC = /* @__PURE__ */ Ie({ ...SC, props: Js, setup(i, { expose: e }) { const t = i, r = it("tooltip"), { controlled: n, id: o, open: a, onOpen: s, onClose: c, onToggle: l } = ct(Dp, void 0), h = Ae(null), u = () => { if (G(n) || t.disabled) return !0; }, p = Di(t, "trigger"), g = Jr(u, Jo(p, "hover", s)), m = Jr(u, Jo(p, "hover", c)), d = Jr(u, Jo(p, "click", (S) => { S.button === 0 && l(S); })), y = Jr(u, Jo(p, "focus", s)), f = Jr(u, Jo(p, "focus", c)), v = Jr(u, Jo(p, "contextmenu", (S) => { S.preventDefault(), l(S); })), M = Jr(u, (S) => { const { code: T } = S; t.triggerKeys.includes(T) && (S.preventDefault(), l(S)); }); return e({ triggerRef: h }), (S, T) => (ge(), Ue(G(H2), { id: G(o), "virtual-ref": S.virtualRef, open: G(a), "virtual-triggering": S.virtualTriggering, class: Re(G(r).e("trigger")), onBlur: G(f), onClick: G(d), onContextmenu: G(v), onFocus: G(y), onMouseenter: G(g), onMouseleave: G(m), onKeydown: G(M) }, { default: me(() => [ qe(S.$slots, "default") ]), _: 3 }, 8, ["id", "virtual-ref", "open", "virtual-triggering", "class", "onBlur", "onClick", "onContextmenu", "onFocus", "onMouseenter", "onMouseleave", "onKeydown"])); } }); var EC = /* @__PURE__ */ ot(TC, [["__file", "trigger.vue"]]); const AC = ht({ to: { type: Ze([String, Object]), required: !0 }, disabled: Boolean }), CC = /* @__PURE__ */ Ie({ __name: "teleport", props: AC, setup(i) { return (e, t) => e.disabled ? qe(e.$slots, "default", { key: 0 }) : (ge(), Ue(gw, { key: 1, to: e.to }, [ qe(e.$slots, "default") ], 8, ["to"])); } }); var LC = /* @__PURE__ */ ot(CC, [["__file", "teleport.vue"]]); const RC = ui(LC), OC = Ie({ name: "ElTooltipContent", inheritAttrs: !1 }), PC = /* @__PURE__ */ Ie({ ...OC, props: Wi, setup(i, { expose: e }) { const t = i, { selector: r } = Y0(), n = it("tooltip"), o = Ae(null); let a; const { controlled: s, id: c, open: l, trigger: h, onClose: u, onOpen: p, onShow: g, onHide: m, onBeforeShow: d, onBeforeHide: y } = ct(Dp, void 0), f = ce(() => t.transition || `${n.namespace.value}-fade-in-linear`), v = ce(() => process.env.NODE_ENV === "test" ? !0 : t.persistent); or(() => { a == null || a(); }); const M = ce(() => G(v) ? !0 : G(l)), S = ce(() => t.disabled ? !1 : G(l)), T = ce(() => t.appendTo || r.value), x = ce(() => { var b; return (b = t.style) != null ? b : {}; }), w = Ae(!0), A = () => { m(), w.value = !0; }, _ = () => { if (G(s)) return !0; }, E = Jr(_, () => { t.enterable && G(h) === "hover" && p(); }), O = Jr(_, () => { G(h) === "hover" && u(); }), L = () => { var b, P; (P = (b = o.value) == null ? void 0 : b.updatePopper) == null || P.call(b), d == null || d(); }, C = () => { y == null || y(); }, I = () => { g(), a = Bw(ce(() => { var b; return (b = o.value) == null ? void 0 : b.popperContentRef; }), () => { G(s) || G(h) !== "hover" && u(); }); }, R = () => { t.virtualTriggering || u(); }; return Ke(() => G(l), (b) => { b ? w.value = !1 : a == null || a(); }, { flush: "post" }), Ke(() => t.content, () => { var b, P; (P = (b = o.value) == null ? void 0 : b.updatePopper) == null || P.call(b); }), e({ contentRef: o }), (b, P) => (ge(), Ue(G(RC), { disabled: !b.teleported, to: G(T) }, { default: me(() => [ le(hl, { name: G(f), onAfterLeave: A, onBeforeEnter: L, onAfterEnter: I, onBeforeLeave: C }, { default: me(() => [ G(M) ? It((ge(), Ue(G(gC), Or({ key: 0, id: G(c), ref_key: "contentRef", ref: o }, b.$attrs, { "aria-label": b.ariaLabel, "aria-hidden": w.value, "boundaries-padding": b.boundariesPadding, "fallback-placements": b.fallbackPlacements, "gpu-acceleration": b.gpuAcceleration, offset: b.offset, placement: b.placement, "popper-options": b.popperOptions, strategy: b.strategy, effect: b.effect, enterable: b.enterable, pure: b.pure, "popper-class": b.popperClass, "popper-style": [b.popperStyle, G(x)], "reference-el": b.referenceEl, "trigger-target-el": b.triggerTargetEl, visible: G(S), "z-index": b.zIndex, onMouseenter: G(E), onMouseleave: G(O), onBlur: R, onClose: G(u) }), { default: me(() => [ qe(b.$slots, "default") ]), _: 3 }, 16, ["id", "aria-label", "aria-hidden", "boundaries-padding", "fallback-placements", "gpu-acceleration", "offset", "placement", "popper-options", "strategy", "effect", "enterable", "pure", "popper-class", "popper-style", "reference-el", "trigger-target-el", "visible", "z-index", "onMouseenter", "onMouseleave", "onClose"])), [ [fi, G(S)] ]) : Ve("v-if", !0) ]), _: 3 }, 8, ["name"]) ]), _: 3 }, 8, ["disabled", "to"])); } }); var IC = /* @__PURE__ */ ot(PC, [["__file", "content.vue"]]); const DC = Ie({ name: "ElTooltip" }), NC = /* @__PURE__ */ Ie({ ...DC, props: wC, emits: _C, setup(i, { expose: e, emit: t }) { const r = i; GA(); const n = vu(), o = Ae(), a = Ae(), s = () => { var f; const v = G(o); v && ((f = v.popperInstanceRef) == null || f.update()); }, c = Ae(!1), l = Ae(), { show: h, hide: u, hasUpdateHandler: p } = xC({ indicator: c, toggleReason: l }), { onOpen: g, onClose: m } = jA({ showAfter: Di(r, "showAfter"), hideAfter: Di(r, "hideAfter"), autoClose: Di(r, "autoClose"), open: h, close: u }), d = ce(() => fp(r.visible) && !p.value); ci(Dp, { controlled: d, id: n, open: a0(c), trigger: Di(r, "trigger"), onOpen: (f) => { g(f); }, onClose: (f) => { m(f); }, onToggle: (f) => { G(c) ? m(f) : g(f); }, onShow: () => { t("show", l.value); }, onHide: () => { t("hide", l.value); }, onBeforeShow: () => { t("before-show", l.value); }, onBeforeHide: () => { t("before-hide", l.value); }, updatePopper: s }), Ke(() => r.disabled, (f) => { f && c.value && (c.value = !1); }); const y = (f) => { var v, M; const S = (M = (v = a.value) == null ? void 0 : v.contentRef) == null ? void 0 : M.popperContentRef, T = (f == null ? void 0 : f.relatedTarget) || document.activeElement; return S && S.contains(T); }; return hw(() => c.value && u()), e({ popperRef: o, contentRef: a, isFocusInsideContent: y, updatePopper: s, onOpen: g, onClose: m, hide: u }), (f, v) => (ge(), Ue(G(vC), { ref_key: "popperRef", ref: o, role: f.role }, { default: me(() => [ le(EC, { disabled: f.disabled, trigger: f.trigger, "trigger-keys": f.triggerKeys, "virtual-ref": f.virtualRef, "virtual-triggering": f.virtualTriggering }, { default: me(() => [ f.$slots.default ? qe(f.$slots, "default", { key: 0 }) : Ve("v-if", !0) ]), _: 3 }, 8, ["disabled", "trigger", "trigger-keys", "virtual-ref", "virtual-triggering"]), le(IC, { ref_key: "contentRef", ref: a, "aria-label": f.ariaLabel, "boundaries-padding": f.boundariesPadding, content: f.content, disabled: f.disabled, effect: f.effect, enterable: f.enterable, "fallback-placements": f.fallbackPlacements, "hide-after": f.hideAfter, "gpu-acceleration": f.gpuAcceleration, offset: f.offset, persistent: f.persistent, "popper-class": f.popperClass, "popper-style": f.popperStyle, placement: f.placement, "popper-options": f.popperOptions, pure: f.pure, "raw-content": f.rawContent, "reference-el": f.referenceEl, "trigger-target-el": f.triggerTargetEl, "show-after": f.showAfter, strategy: f.strategy, teleported: f.teleported, transition: f.transition, "virtual-triggering": f.virtualTriggering, "z-index": f.zIndex, "append-to": f.appendTo }, { default: me(() => [ qe(f.$slots, "content", {}, () => [ f.rawContent ? (ge(), Le("span", { key: 0, innerHTML: f.content }, null, 8, ["innerHTML"])) : (ge(), Le("span", { key: 1 }, xt(f.content), 1)) ]), f.showArrow ? (ge(), Ue(G(F2), { key: 0, "arrow-offset": f.arrowOffset }, null, 8, ["arrow-offset"])) : Ve("v-if", !0) ]), _: 3 }, 8, ["aria-label", "boundaries-padding", "content", "disabled", "effect", "enterable", "fallback-placements", "hide-after", "gpu-acceleration", "offset", "persistent", "popper-class", "popper-style", "placement", "popper-options", "pure", "raw-content", "reference-el", "trigger-target-el", "show-after", "strategy", "teleported", "transition", "virtual-triggering", "z-index", "append-to"]) ]), _: 3 }, 8, ["role"])); } }); var BC = /* @__PURE__ */ ot(NC, [["__file", "tooltip.vue"]]); const Np = ui(BC), py = Symbol("buttonGroupContextKey"), kC = (i, e) => { EE({ from: "type.text", replacement: "link", version: "3.0.0", scope: "props", ref: "https://element-plus.org/en-US/component/button.html#button-attributes" }, ce(() => i.type === "text")); const t = ct(py, void 0), r = Ap("button"), { form: n } = gl(), o = ns(ce(() => t == null ? void 0 : t.size)), a = yu(), s = Ae(), c = au(), l = ce(() => i.type || (t == null ? void 0 : t.type) || ""), h = ce(() => { var g, m, d; return (d = (m = i.autoInsertSpace) != null ? m : (g = r.value) == null ? void 0 : g.autoInsertSpace) != null ? d : !1; }), u = ce(() => i.tag === "button" ? { ariaDisabled: a.value || i.loading, disabled: a.value || i.loading, autofocus: i.autofocus, type: i.nativeType } : {}), p = ce(() => { var g; const m = (g = c.default) == null ? void 0 : g.call(c); if (h.value && (m == null ? void 0 : m.length) === 1) { const d = m[0]; if ((d == null ? void 0 : d.type) === o0) { const y = d.children; return new RegExp("^\\p{Unified_Ideograph}{2}$", "u").test(y.trim()); } } return !1; }); return { _disabled: a, _size: o, _type: l, _ref: s, _props: u, shouldAddSpace: p, handleClick: (g) => { if (a.value || i.loading) { g.stopPropagation(); return; } i.nativeType === "reset" && (n == null || n.resetFields()), e("click", g); } }; }, zC = [ "default", "primary", "success", "warning", "info", "danger", "text", "" ], FC = ["button", "submit", "reset"], dd = ht({ size: Da, disabled: Boolean, type: { type: String, values: zC, default: "" }, icon: { type: $n }, nativeType: { type: String, values: FC, default: "button" }, loading: Boolean, loadingIcon: { type: $n, default: () => O0 }, plain: Boolean, text: Boolean, link: Boolean, bg: Boolean, autofocus: Boolean, round: Boolean, circle: Boolean, color: String, dark: Boolean, autoInsertSpace: { type: Boolean, default: void 0 }, tag: { type: Ze([String, Object]), default: "button" } }), VC = { click: (i) => i instanceof MouseEvent }; function gi(i, e) { UC(i) && (i = "100%"); var t = GC(i); return i = e === 360 ? i : Math.min(e, Math.max(0, parseFloat(i))), t && (i = parseInt(String(i * e), 10) / 100), Math.abs(i - e) < 1e-6 ? 1 : (e === 360 ? i = (i < 0 ? i % e + e : i % e) / parseFloat(String(e)) : i = i % e / parseFloat(String(e)), i); } function Vl(i) { return Math.min(1, Math.max(0, i)); } function UC(i) { return typeof i == "string" && i.indexOf(".") !== -1 && parseFloat(i) === 1; } function GC(i) { return typeof i == "string" && i.indexOf("%") !== -1; } function fy(i) { return i = parseFloat(i), (isNaN(i) || i < 0 || i > 1) && (i = 1), i; } function Ul(i) { return i <= 1 ? "".concat(Number(i) * 100, "%") : i; } function xo(i) { return i.length === 1 ? "0" + i : String(i); } function HC(i, e, t) { return { r: gi(i, 255) * 255, g: gi(e, 255) * 255, b: gi(t, 255) * 255 }; } function Km(i, e, t) { i = gi(i, 255), e = gi(e, 255), t = gi(t, 255); var r = Math.max(i, e, t), n = Math.min(i, e, t), o = 0, a = 0, s = (r + n) / 2; if (r === n) a = 0, o = 0; else { var c = r - n; switch (a = s > 0.5 ? c / (2 - r - n) : c / (r + n), r) { case i: o = (e - t) / c + (e < t ? 6 : 0); break; case e: o = (t - i) / c + 2; break; case t: o = (i - e) / c + 4; break; } o /= 6; } return { h: o, s: a, l: s }; } function eh(i, e, t) { return t < 0 && (t += 1), t > 1 && (t -= 1), t < 1 / 6 ? i + (e - i) * (6 * t) : t < 1 / 2 ? e : t < 2 / 3 ? i + (e - i) * (2 / 3 - t) * 6 : i; } function jC(i, e, t) { var r, n, o; if (i = gi(i, 360), e = gi(e, 100), t = gi(t, 100), e === 0) n = t, o = t, r = t; else { var a = t < 0.5 ? t * (1 + e) : t + e - t * e, s = 2 * t - a; r = eh(s, a, i + 1 / 3), n = eh(s, a, i), o = eh(s, a, i - 1 / 3); } return { r: r * 255, g: n * 255, b: o * 255 }; } function Qm(i, e, t) { i = gi(i, 255), e = gi(e, 255), t = gi(t, 255); var r = Math.max(i, e, t), n = Math.min(i, e, t), o = 0, a = r, s = r - n, c = r === 0 ? 0 : s / r; if (r === n) o = 0; else { switch (r) { case i: o = (e - t) / s + (e < t ? 6 : 0); break; case e: o = (t - i) / s + 2; break; case t: o = (i - e) / s + 4; break; } o /= 6; } return { h: o, s: c, v: a }; } function WC(i, e, t) { i = gi(i, 360) * 6, e = gi(e, 100), t = gi(t, 100); var r = Math.floor(i), n = i - r, o = t * (1 - e), a = t * (1 - n * e), s = t * (1 - (1 - n) * e), c = r % 6, l = [t, a, o, o, s, t][c], h = [s, t, t, a, o, o][c], u = [o, o, s, t, t, a][c]; return { r: l * 255, g: h * 255, b: u * 255 }; } function eg(i, e, t, r) { var n = [ xo(Math.round(i).toString(16)), xo(Math.round(e).toString(16)), xo(Math.round(t).toString(16)) ]; return r && n[0].startsWith(n[0].charAt(1)) && n[1].startsWith(n[1].charAt(1)) && n[2].startsWith(n[2].charAt(1)) ? n[0].charAt(0) + n[1].charAt(0) + n[2].charAt(0) : n.join(""); } function $C(i, e, t, r, n) { var o = [ xo(Math.round(i).toString(16)), xo(Math.round(e).toString(16)), xo(Math.round(t).toString(16)), xo(qC(r)) ]; return n && o[0].startsWith(o[0].charAt(1)) && o[1].startsWith(o[1].charAt(1)) && o[2].startsWith(o[2].charAt(1)) && o[3].startsWith(o[3].charAt(1)) ? o[0].charAt(0) + o[1].charAt(0) + o[2].charAt(0) + o[3].charAt(0) : o.join(""); } function qC(i) { return Math.round(parseFloat(i) * 255).toString(16); } function tg(i) { return ji(i) / 255; } function ji(i) { return parseInt(i, 16); } function XC(i) { return { r: i >> 16, g: (i & 65280) >> 8, b: i & 255 }; } var pd = { aliceblue: "#f0f8ff", antiquewhite: "#faebd7", aqua: "#00ffff", aquamarine: "#7fffd4", azure: "#f0ffff", beige: "#f5f5dc", bisque: "#ffe4c4", black: "#000000", blanchedalmond: "#ffebcd", blue: "#0000ff", blueviolet: "#8a2be2", brown: "#a52a2a", burlywood: "#deb887", cadetblue: "#5f9ea0", chartreuse: "#7fff00", chocolate: "#d2691e", coral: "#ff7f50", cornflowerblue: "#6495ed", cornsilk: "#fff8dc", crimson: "#dc143c", cyan: "#00ffff", darkblue: "#00008b", darkcyan: "#008b8b", darkgoldenrod: "#b8860b", darkgray: "#a9a9a9", darkgreen: "#006400", darkgrey: "#a9a9a9", darkkhaki: "#bdb76b", darkmagenta: "#8b008b", darkolivegreen: "#556b2f", darkorange: "#ff8c00", darkorchid: "#9932cc", darkred: "#8b0000", darksalmon: "#e9967a", darkseagreen: "#8fbc8f", darkslateblue: "#483d8b", darkslategray: "#2f4f4f", darkslategrey: "#2f4f4f", darkturquoise: "#00ced1", darkviolet: "#9400d3", deeppink: "#ff1493", deepskyblue: "#00bfff", dimgray: "#696969", dimgrey: "#696969", dodgerblue: "#1e90ff", firebrick: "#b22222", floralwhite: "#fffaf0", forestgreen: "#228b22", fuchsia: "#ff00ff", gainsboro: "#dcdcdc", ghostwhite: "#f8f8ff", goldenrod: "#daa520", gold: "#ffd700", gray: "#808080", green: "#008000", greenyellow: "#adff2f", grey: "#808080", honeydew: "#f0fff0", hotpink: "#ff69b4", indianred: "#cd5c5c", indigo: "#4b0082", ivory: "#fffff0", khaki: "#f0e68c", lavenderblush: "#fff0f5", lavender: "#e6e6fa", lawngreen: "#7cfc00", lemonchiffon: "#fffacd", lightblue: "#add8e6", lightcoral: "#f08080", lightcyan: "#e0ffff", lightgoldenrodyellow: "#fafad2", lightgray: "#d3d3d3", lightgreen: "#90ee90", lightgrey: "#d3d3d3", lightpink: "#ffb6c1", lightsalmon: "#ffa07a", lightseagreen: "#20b2aa", lightskyblue: "#87cefa", lightslategray: "#778899", lightslategrey: "#778899", lightsteelblue: "#b0c4de", lightyellow: "#ffffe0", lime: "#00ff00", limegreen: "#32cd32", linen: "#faf0e6", magenta: "#ff00ff", maroon: "#800000", mediumaquamarine: "#66cdaa", mediumblue: "#0000cd", mediumorchid: "#ba55d3", mediumpurple: "#9370db", mediumseagreen: "#3cb371", mediumslateblue: "#7b68ee", mediumspringgreen: "#00fa9a", mediumturquoise: "#48d1cc", mediumvioletred: "#c71585", midnightblue: "#191970", mintcream: "#f5fffa", mistyrose: "#ffe4e1", moccasin: "#ffe4b5", navajowhite: "#ffdead", navy: "#000080", oldlace: "#fdf5e6", olive: "#808000", olivedrab: "#6b8e23", orange: "#ffa500", orangered: "#ff4500", orchid: "#da70d6", palegoldenrod: "#eee8aa", palegreen: "#98fb98", paleturquoise: "#afeeee", palevioletred: "#db7093", papayawhip: "#ffefd5", peachpuff: "#ffdab9", peru: "#cd853f", pink: "#ffc0cb", plum: "#dda0dd", powderblue: "#b0e0e6", purple: "#800080", rebeccapurple: "#663399", red: "#ff0000", rosybrown: "#bc8f8f", royalblue: "#4169e1", saddlebrown: "#8b4513", salmon: "#fa8072", sandybrown: "#f4a460", seagreen: "#2e8b57", seashell: "#fff5ee", sienna: "#a0522d", silver: "#c0c0c0", skyblue: "#87ceeb", slateblue: "#6a5acd", slategray: "#708090", slategrey: "#708090", snow: "#fffafa", springgreen: "#00ff7f", steelblue: "#4682b4", tan: "#d2b48c", teal: "#008080", thistle: "#d8bfd8", tomato: "#ff6347", turquoise: "#40e0d0", violet: "#ee82ee", wheat: "#f5deb3", white: "#ffffff", whitesmoke: "#f5f5f5", yellow: "#ffff00", yellowgreen: "#9acd32" }; function ZC(i) { var e = { r: 0, g: 0, b: 0 }, t = 1, r = null, n = null, o = null, a = !1, s = !1; return typeof i == "string" && (i = KC(i)), typeof i == "object" && (Hr(i.r) && Hr(i.g) && Hr(i.b) ? (e = HC(i.r, i.g, i.b), a = !0, s = String(i.r).substr(-1) === "%" ? "prgb" : "rgb") : Hr(i.h) && Hr(i.s) && Hr(i.v) ? (r = Ul(i.s), n = Ul(i.v), e = WC(i.h, r, n), a = !0, s = "hsv") : Hr(i.h) && Hr(i.s) && Hr(i.l) && (r = Ul(i.s), o = Ul(i.l), e = jC(i.h, r, o), a = !0, s = "hsl"), Object.prototype.hasOwnProperty.call(i, "a") && (t = i.a)), t = fy(t), { ok: a, format: i.format || s, r: Math.min(255, Math.max(e.r, 0)), g: Math.min(255, Math.max(e.g, 0)), b: Math.min(255, Math.max(e.b, 0)), a: t }; } var YC = "[-\\+]?\\d+%?", JC = "[-\\+]?\\d*\\.\\d+%?", kn = "(?:".concat(JC, ")|(?:").concat(YC, ")"), th = "[\\s|\\(]+(".concat(kn, ")[,|\\s]+(").concat(kn, ")[,|\\s]+(").concat(kn, ")\\s*\\)?"), ih = "[\\s|\\(]+(".concat(kn, ")[,|\\s]+(").concat(kn, ")[,|\\s]+(").concat(kn, ")[,|\\s]+(").concat(kn, ")\\s*\\)?"), pr = { CSS_UNIT: new RegExp(kn), rgb: new RegExp("rgb" + th), rgba: new RegExp("rgba" + ih), hsl: new RegExp("hsl" + th), hsla: new RegExp("hsla" + ih), hsv: new RegExp("hsv" + th), hsva: new RegExp("hsva" + ih), hex3: /^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/, hex6: /^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/, hex4: /^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/, hex8: /^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/ }; function KC(i) { if (i = i.trim().toLowerCase(), i.length === 0) return !1; var e = !1; if (pd[i]) i = pd[i], e = !0; else if (i === "transparent") return { r: 0, g: 0, b: 0, a: 0, format: "name" }; var t = pr.rgb.exec(i); return t ? { r: t[1], g: t[2], b: t[3] } : (t = pr.rgba.exec(i), t ? { r: t[1], g: t[2], b: t[3], a: t[4] } : (t = pr.hsl.exec(i), t ? { h: t[1], s: t[2], l: t[3] } : (t = pr.hsla.exec(i), t ? { h: t[1], s: t[2], l: t[3], a: t[4] } : (t = pr.hsv.exec(i), t ? { h: t[1], s: t[2], v: t[3] } : (t = pr.hsva.exec(i), t ? { h: t[1], s: t[2], v: t[3], a: t[4] } : (t = pr.hex8.exec(i), t ? { r: ji(t[1]), g: ji(t[2]), b: ji(t[3]), a: tg(t[4]), format: e ? "name" : "hex8" } : (t = pr.hex6.exec(i), t ? { r: ji(t[1]), g: ji(t[2]), b: ji(t[3]), format: e ? "name" : "hex" } : (t = pr.hex4.exec(i), t ? { r: ji(t[1] + t[1]), g: ji(t[2] + t[2]), b: ji(t[3] + t[3]), a: tg(t[4] + t[4]), format: e ? "name" : "hex8" } : (t = pr.hex3.exec(i), t ? { r: ji(t[1] + t[1]), g: ji(t[2] + t[2]), b: ji(t[3] + t[3]), format: e ? "name" : "hex" } : !1))))))))); } function Hr(i) { return !!pr.CSS_UNIT.exec(String(i)); } var QC = ( /** @class */ function() { function i(e, t) { e === void 0 && (e = ""), t === void 0 && (t = {}); var r; if (e instanceof i) return e; typeof e == "number" && (e = XC(e)), this.originalInput = e; var n = ZC(e); this.originalInput = e, this.r = n.r, this.g = n.g, this.b = n.b, this.a = n.a, this.roundA = Math.round(100 * this.a) / 100, this.format = (r = t.format) !== null && r !== void 0 ? r : n.format, this.gradientType = t.gradientType, this.r < 1 && (this.r = Math.round(this.r)), this.g < 1 && (this.g = Math.round(this.g)), this.b < 1 && (this.b = Math.round(this.b)), this.isValid = n.ok; } return i.prototype.isDark = function() { return this.getBrightness() < 128; }, i.prototype.isLight = function() { return !this.isDark(); }, i.prototype.getBrightness = function() { var e = this.toRgb(); return (e.r * 299 + e.g * 587 + e.b * 114) / 1e3; }, i.prototype.getLuminance = function() { var e = this.toRgb(), t, r, n, o = e.r / 255, a = e.g / 255, s = e.b / 255; return o <= 0.03928 ? t = o / 12.92 : t = Math.pow((o + 0.055) / 1.055, 2.4), a <= 0.03928 ? r = a / 12.92 : r = Math.pow((a + 0.055) / 1.055, 2.4), s <= 0.03928 ? n = s / 12.92 : n = Math.pow((s + 0.055) / 1.055, 2.4), 0.2126 * t + 0.7152 * r + 0.0722 * n; }, i.prototype.getAlpha = function() { return this.a; }, i.prototype.setAlpha = function(e) { return this.a = fy(e), this.roundA = Math.round(100 * this.a) / 100, this; }, i.prototype.isMonochrome = function() { var e = this.toHsl().s; return e === 0; }, i.prototype.toHsv = function() { var e = Qm(this.r, this.g, this.b); return { h: e.h * 360, s: e.s, v: e.v, a: this.a }; }, i.prototype.toHsvString = function() { var e = Qm(this.r, this.g, this.b), t = Math.round(e.h * 360), r = Math.round(e.s * 100), n = Math.round(e.v * 100); return this.a === 1 ? "hsv(".concat(t, ", ").concat(r, "%, ").concat(n, "%)") : "hsva(".concat(t, ", ").concat(r, "%, ").concat(n, "%, ").concat(this.roundA, ")"); }, i.prototype.toHsl = function() { var e = Km(this.r, this.g, this.b); return { h: e.h * 360, s: e.s, l: e.l, a: this.a }; }, i.prototype.toHslString = function() { var e = Km(this.r, this.g, this.b), t = Math.round(e.h * 360), r = Math.round(e.s * 100), n = Math.round(e.l * 100); return this.a === 1 ? "hsl(".concat(t, ", ").concat(r, "%, ").concat(n, "%)") : "hsla(".concat(t, ", ").concat(r, "%, ").concat(n, "%, ").concat(this.roundA, ")"); }, i.prototype.toHex = function(e) { return e === void 0 && (e = !1), eg(this.r, this.g, this.b, e); }, i.prototype.toHexString = function(e) { return e === void 0 && (e = !1), "#" + this.toHex(e); }, i.prototype.toHex8 = function(e) { return e === void 0 && (e = !1), $C(this.r, this.g, this.b, this.a, e); }, i.prototype.toHex8String = function(e) { return e === void 0 && (e = !1), "#" + this.toHex8(e); }, i.prototype.toHexShortString = function(e) { return e === void 0 && (e = !1), this.a === 1 ? this.toHexString(e) : this.toHex8String(e); }, i.prototype.toRgb = function() { return { r: Math.round(this.r), g: Math.round(this.g), b: Math.round(this.b), a: this.a }; }, i.prototype.toRgbString = function() { var e = Math.round(this.r), t = Math.round(this.g), r = Math.round(this.b); return this.a === 1 ? "rgb(".concat(e, ", ").concat(t, ", ").concat(r, ")") : "rgba(".concat(e, ", ").concat(t, ", ").concat(r, ", ").concat(this.roundA, ")"); }, i.prototype.toPercentageRgb = function() { var e = function(t) { return "".concat(Math.round(gi(t, 255) * 100), "%"); }; return { r: e(this.r), g: e(this.g), b: e(this.b), a: this.a }; }, i.prototype.toPercentageRgbString = function() { var e = function(t) { return Math.round(gi(t, 255) * 100); }; return this.a === 1 ? "rgb(".concat(e(this.r), "%, ").concat(e(this.g), "%, ").concat(e(this.b), "%)") : "rgba(".concat(e(this.r), "%, ").concat(e(this.g), "%, ").concat(e(this.b), "%, ").concat(this.roundA, ")"); }, i.prototype.toName = function() { if (this.a === 0) return "transparent"; if (this.a < 1) return !1; for (var e = "#" + eg(this.r, this.g, this.b, !1), t = 0, r = Object.entries(pd); t < r.length; t++) { var n = r[t], o = n[0], a = n[1]; if (e === a) return o; } return !1; }, i.prototype.toString = function(e) { var t = !!e; e = e ?? this.format; var r = !1, n = this.a < 1 && this.a >= 0, o = !t && n && (e.startsWith("hex") || e === "name"); return o ? e === "name" && this.a === 0 ? this.toName() : this.toRgbString() : (e === "rgb" && (r = this.toRgbString()), e === "prgb" && (r = this.toPercentageRgbString()), (e === "hex" || e === "hex6") && (r = this.toHexString()), e === "hex3" && (r = this.toHexString(!0)), e === "hex4" && (r = this.toHex8String(!0)), e === "hex8" && (r = this.toHex8String()), e === "name" && (r = this.toName()), e === "hsl" && (r = this.toHslString()), e === "hsv" && (r = this.toHsvString()), r || this.toHexString()); }, i.prototype.toNumber = function() { return (Math.round(this.r) << 16) + (Math.round(this.g) << 8) + Math.round(this.b); }, i.prototype.clone = function() { return new i(this.toString()); }, i.prototype.lighten = function(e) { e === void 0 && (e = 10); var t = this.toHsl(); return t.l += e / 100, t.l = Vl(t.l), new i(t); }, i.prototype.brighten = function(e) { e === void 0 && (e = 10); var t = this.toRgb(); return t.r = Math.max(0, Math.min(255, t.r - Math.round(255 * -(e / 100)))), t.g = Math.max(0, Math.min(255, t.g - Math.round(255 * -(e / 100)))), t.b = Math.max(0, Math.min(255, t.b - Math.round(255 * -(e / 100)))), new i(t); }, i.prototype.darken = function(e) { e === void 0 && (e = 10); var t = this.toHsl(); return t.l -= e / 100, t.l = Vl(t.l), new i(t); }, i.prototype.tint = function(e) { return e === void 0 && (e = 10), this.mix("white", e); }, i.prototype.shade = function(e) { return e === void 0 && (e = 10), this.mix("black", e); }, i.prototype.desaturate = function(e) { e === void 0 && (e = 10); var t = this.toHsl(); return t.s -= e / 100, t.s = Vl(t.s), new i(t); }, i.prototype.saturate = function(e) { e === void 0 && (e = 10); var t = this.toHsl(); return t.s += e / 100, t.s = Vl(t.s), new i(t); }, i.prototype.greyscale = function() { return this.desaturate(100); }, i.prototype.spin = function(e) { var t = this.toHsl(), r = (t.h + e) % 360; return t.h = r < 0 ? 360 + r : r, new i(t); }, i.prototype.mix = function(e, t) { t === void 0 && (t = 50); var r = this.toRgb(), n = new i(e).toRgb(), o = t / 100, a = { r: (n.r - r.r) * o + r.r, g: (n.g - r.g) * o + r.g, b: (n.b - r.b) * o + r.b, a: (n.a - r.a) * o + r.a }; return new i(a); }, i.prototype.analogous = function(e, t) { e === void 0 && (e = 6), t === void 0 && (t = 30); var r = this.toHsl(), n = 360 / t, o = [this]; for (r.h = (r.h - (n * e >> 1) + 720) % 360; --e; ) r.h = (r.h + n) % 360, o.push(new i(r)); return o; }, i.prototype.complement = function() { var e = this.toHsl(); return e.h = (e.h + 180) % 360, new i(e); }, i.prototype.monochromatic = function(e) { e === void 0 && (e = 6); for (var t = this.toHsv(), r = t.h, n = t.s, o = t.v, a = [], s = 1 / e; e--; ) a.push(new i({ h: r, s: n, v: o })), o = (o + s) % 1; return a; }, i.prototype.splitcomplement = function() { var e = this.toHsl(), t = e.h; return [ this, new i({ h: (t + 72) % 360, s: e.s, l: e.l }), new i({ h: (t + 216) % 360, s: e.s, l: e.l }) ]; }, i.prototype.onBackground = function(e) { var t = this.toRgb(), r = new i(e).toRgb(), n = t.a + r.a * (1 - t.a); return new i({ r: (t.r * t.a + r.r * r.a * (1 - t.a)) / n, g: (t.g * t.a + r.g * r.a * (1 - t.a)) / n, b: (t.b * t.a + r.b * r.a * (1 - t.a)) / n, a: n }); }, i.prototype.triad = function() { return this.polyad(3); }, i.prototype.tetrad = function() { return this.polyad(4); }, i.prototype.polyad = function(e) { for (var t = this.toHsl(), r = t.h, n = [this], o = 360 / e, a = 1; a < e; a++) n.push(new i({ h: (r + a * o) % 360, s: t.s, l: t.l })); return n; }, i.prototype.equals = function(e) { return this.toRgbString() === new i(e).toRgbString(); }, i; }() ); function wn(i, e = 20) { return i.mix("#141414", e).toString(); } function eL(i) { const e = yu(), t = it("button"); return ce(() => { let r = {}, n = i.color; if (n) { const o = n.match(/var\((.*?)\)/); o && (n = window.getComputedStyle(window.document.documentElement).getPropertyValue(o[1])); const a = new QC(n), s = i.dark ? a.tint(20).toString() : wn(a, 20); if (i.plain) r = t.cssVarBlock({ "bg-color": i.dark ? wn(a, 90) : a.tint(90).toString(), "text-color": n, "border-color": i.dark ? wn(a, 50) : a.tint(50).toString(), "hover-text-color": `var(${t.cssVarName("color-white")})`, "hover-bg-color": n, "hover-border-color": n, "active-bg-color": s, "active-text-color": `var(${t.cssVarName("color-white")})`, "active-border-color": s }), e.value && (r[t.cssVarBlockName("disabled-bg-color")] = i.dark ? wn(a, 90) : a.tint(90).toString(), r[t.cssVarBlockName("disabled-text-color")] = i.dark ? wn(a, 50) : a.tint(50).toString(), r[t.cssVarBlockName("disabled-border-color")] = i.dark ? wn(a, 80) : a.tint(80).toString()); else { const c = i.dark ? wn(a, 30) : a.tint(30).toString(), l = a.isDark() ? `var(${t.cssVarName("color-white")})` : `var(${t.cssVarName("color-black")})`; if (r = t.cssVarBlock({ "bg-color": n, "text-color": l, "border-color": n, "hover-bg-color": c, "hover-text-color": l, "hover-border-color": c, "active-bg-color": s, "active-border-color": s }), e.value) { const h = i.dark ? wn(a, 50) : a.tint(50).toString(); r[t.cssVarBlockName("disabled-bg-color")] = h, r[t.cssVarBlockName("disabled-text-color")] = i.dark ? "rgba(255, 255, 255, 0.5)" : `var(${t.cssVarName("color-white")})`, r[t.cssVarBlockName("disabled-border-color")] = h; } } } return r; }); } const tL = Ie({ name: "ElButton" }), iL = /* @__PURE__ */ Ie({ ...tL, props: dd, emits: VC, setup(i, { expose: e, emit: t }) { const r = i, n = eL(r), o = it("button"), { _ref: a, _size: s, _type: c, _disabled: l, _props: h, shouldAddSpace: u, handleClick: p } = kC(r, t), g = ce(() => [ o.b(), o.m(c.value), o.m(s.value), o.is("disabled", l.value), o.is("loading", r.loading), o.is("plain", r.plain), o.is("round", r.round), o.is("circle", r.circle), o.is("text", r.text), o.is("link", r.link), o.is("has-bg", r.bg) ]); return e({ ref: a, size: s, type: c, disabled: l, shouldAddSpace: u }), (m, d) => (ge(), Ue(Ni(m.tag), Or({ ref_key: "_ref", ref: a }, G(h), { class: G(g), style: G(n), onClick: G(p) }), { default: me(() => [ m.loading ? (ge(), Le(Vt, { key: 0 }, [ m.$slots.loading ? qe(m.$slots, "loading", { key: 0 }) : (ge(), Ue(G(Dt), { key: 1, class: Re(G(o).is("loading")) }, { default: me(() => [ (ge(), Ue(Ni(m.loadingIcon))) ]), _: 1 }, 8, ["class"])) ], 64)) : m.icon || m.$slots.icon ? (ge(), Ue(G(Dt), { key: 1 }, { default: me(() => [ m.icon ? (ge(), Ue(Ni(m.icon), { key: 0 })) : qe(m.$slots, "icon", { key: 1 }) ]), _: 3 })) : Ve("v-if", !0), m.$slots.default ? (ge(), Le("span", { key: 2, class: Re({ [G(o).em("text", "expand")]: G(u) }) }, [ qe(m.$slots, "default") ], 2)) : Ve("v-if", !0) ]), _: 3 }, 16, ["class", "style", "onClick"])); } }); var rL = /* @__PURE__ */ ot(iL, [["__file", "button.vue"]]); const nL = { size: dd.size, type: dd.type }, oL = Ie({ name: "ElButtonGroup" }), aL = /* @__PURE__ */ Ie({ ...oL, props: nL, setup(i) { const e = i; ci(py, Xi({ size: Di(e, "size"), type: Di(e, "type") })); const t = it("button"); return (r, n) => (ge(), Le("div", { class: Re(G(t).b("group")) }, [ qe(r.$slots, "default") ], 2)); } }); var my = /* @__PURE__ */ ot(aL, [["__file", "button-group.vue"]]); const os = ui(rL, { ButtonGroup: my }); mn(my); var Nn = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {}; function sL(i) { return i && i.__esModule && Object.prototype.hasOwnProperty.call(i, "default") ? i.default : i; } function xu(i) { if (i.__esModule) return i; var e = i.default; if (typeof e == "function") { var t = function r() { return this instanceof r ? Reflect.construct(e, arguments, this.constructor) : e.apply(this, arguments); }; t.prototype = e.prototype; } else t = {}; return Object.defineProperty(t, "__esModule", { value: !0 }), Object.keys(i).forEach(function(r) { var n = Object.getOwnPropertyDescriptor(i, r); Object.defineProperty(t, r, n.get ? n : { enumerable: !0, get: function() { return i[r]; } }); }), t; } const Pn = /* @__PURE__ */ new Map(); if (Kt) { let i; document.addEventListener("mousedown", (e) => i = e), document.addEventListener("mouseup", (e) => { if (i) { for (const t of Pn.values()) for (const { documentHandler: r } of t) r(e, i); i = void 0; } }); } function ig(i, e) { let t = []; return Array.isArray(e.arg) ? t = e.arg : Mo(e.arg) && t.push(e.arg), function(r, n) { const o = e.instance.popperRef, a = r.target, s = n == null ? void 0 : n.target, c = !e || !e.instance, l = !a || !s, h = i.contains(a) || i.contains(s), u = i === a, p = t.length && t.some((m) => m == null ? void 0 : m.contains(a)) || t.length && t.includes(s), g = o && (o.contains(a) || o.contains(s)); c || l || h || u || p || g || e.value(r, n); }; } const lL = { beforeMount(i, e) { Pn.has(i) || Pn.set(i, []), Pn.get(i).push({ documentHandler: ig(i, e), bindingFn: e.value }); }, updated(i, e) { Pn.has(i) || Pn.set(i, []); const t = Pn.get(i), r = t.findIndex((o) => o.bindingFn === e.oldValue), n = { documentHandler: ig(i, e), bindingFn: e.value }; r >= 0 ? t.splice(r, 1, n) : t.push(n); }, unmounted(i) { Pn.delete(i); } }, cL = 100, uL = 600, rg = { beforeMount(i, e) { const t = e.value, { interval: r = cL, delay: n = uL } = Si(t) ? {} : t; let o, a; const s = () => Si(t) ? t() : t.handler(), c = () => { a && (clearTimeout(a), a = void 0), o && (clearInterval(o), o = void 0); }; i.addEventListener("mousedown", (l) => { l.button === 0 && (c(), s(), document.addEventListener("mouseup", () => c(), { once: !0 }), a = setTimeout(() => { o = setInterval(() => { s(); }, r); }, n)); }); } }, fd = ht({ type: { type: String, values: ["primary", "success", "info", "warning", "danger"], default: "primary" }, closable: Boolean, disableTransitions: Boolean, hit: Boolean, color: String, size: { type: String, values: N0 }, effect: { type: String, values: ["dark", "light", "plain"], default: "light" }, round: Boolean }), hL = { close: (i) => i instanceof MouseEvent, click: (i) => i instanceof MouseEvent }, dL = Ie({ name: "ElTag" }), pL = /* @__PURE__ */ Ie({ ...dL, props: fd, emits: hL, setup(i, { emit: e }) { const t = i, r = ns(), n = it("tag"), o = ce(() => { const { type: l, hit: h, effect: u, closable: p, round: g } = t; return [ n.b(), n.is("closable", p), n.m(l || "primary"), n.m(r.value), n.m(u), n.is("hit", h), n.is("round", g) ]; }), a = (l) => { e("close", l); }, s = (l) => { e("click", l); }, c = (l) => { l.component.subTree.component.bum = null; }; return (l, h) => l.disableTransitions ? (ge(), Le("span", { key: 0, class: Re(G(o)), style: Ot({ backgroundColor: l.color }), onClick: s }, [ ke("span", { class: Re(G(n).e("content")) }, [ qe(l.$slots, "default") ], 2), l.closable ? (ge(), Ue(G(Dt), { key: 0, class: Re(G(n).e("close")), onClick: ai(a, ["stop"]) }, { default: me(() => [ le(G(ld)) ]), _: 1 }, 8, ["class", "onClick"])) : Ve("v-if", !0) ], 6)) : (ge(), Ue(hl, { key: 1, name: `${G(n).namespace.value}-zoom-in-center`, appear: "", onVnodeMounted: c }, { default: me(() => [ ke("span", { class: Re(G(o)), style: Ot({ backgroundColor: l.color }), onClick: s }, [ ke("span", { class: Re(G(n).e("content")) }, [ qe(l.$slots, "default") ], 2), l.closable ? (ge(), Ue(G(Dt), { key: 0, class: Re(G(n).e("close")), onClick: ai(a, ["stop"]) }, { default: me(() => [ le(G(ld)) ]), _: 1 }, 8, ["class", "onClick"])) : Ve("v-if", !0) ], 6) ]), _: 3 }, 8, ["name"])); } }); var fL = /* @__PURE__ */ ot(pL, [["__file", "tag.vue"]]); const mL = ui(fL), gy = Symbol("rowContextKey"), gL = [ "start", "center", "end", "space-around", "space-between", "space-evenly" ], vL = ["top", "middle", "bottom"], yL = ht({ tag: { type: String, default: "div" }, gutter: { type: Number, default: 0 }, justify: { type: String, values: gL, default: "start" }, align: { type: String, values: vL } }), bL = Ie({ name: "ElRow" }), xL = /* @__PURE__ */ Ie({ ...bL, props: yL, setup(i) { const e = i, t = it("row"), r = ce(() => e.gutter); ci(gy, { gutter: r }); const n = ce(() => { const a = {}; return e.gutter && (a.marginRight = a.marginLeft = `-${e.gutter / 2}px`), a; }), o = ce(() => [ t.b(), t.is(`justify-${e.justify}`, e.justify !== "start"), t.is(`align-${e.align}`, !!e.align) ]); return (a, s) => (ge(), Ue(Ni(a.tag), { class: Re(G(o)), style: Ot(G(n)) }, { default: me(() => [ qe(a.$slots, "default") ]), _: 3 }, 8, ["class", "style"])); } }); var wL = /* @__PURE__ */ ot(xL, [["__file", "row.vue"]]); const Ur = ui(wL), _L = ht({ tag: { type: String, default: "div" }, span: { type: Number, default: 24 }, offset: { type: Number, default: 0 }, pull: { type: Number, default: 0 }, push: { type: Number, default: 0 }, xs: { type: Ze([Number, Object]), default: () => Qr({}) }, sm: { type: Ze([Number, Object]), default: () => Qr({}) }, md: { type: Ze([Number, Object]), default: () => Qr({}) }, lg: { type: Ze([Number, Object]), default: () => Qr({}) }, xl: { type: Ze([Number, Object]), default: () => Qr({}) } }), ML = Ie({ name: "ElCol" }), SL = /* @__PURE__ */ Ie({ ...ML, props: _L, setup(i) { const e = i, { gutter: t } = ct(gy, { gutter: ce(() => 0) }), r = it("col"), n = ce(() => { const a = {}; return t.value && (a.paddingLeft = a.paddingRight = `${t.value / 2}px`), a; }), o = ce(() => { const a = []; return ["span", "offset", "pull", "push"].forEach((s) => { const c = e[s]; _t(c) && (s === "span" ? a.push(r.b(`${e[s]}`)) : c > 0 && a.push(r.b(`${s}-${e[s]}`))); }), ["xs", "sm", "md", "lg", "xl"].forEach((s) => { _t(e[s]) ? a.push(r.b(`${s}-${e[s]}`)) : Ai(e[s]) && Object.entries(e[s]).forEach(([c, l]) => { a.push(c !== "span" ? r.b(`${s}-${c}-${l}`) : r.b(`${s}-${l}`)); }); }), t.value && a.push(r.is("guttered")), [r.b(), a]; }); return (a, s) => (ge(), Ue(Ni(a.tag), { class: Re(G(o)), style: Ot(G(n)) }, { default: me(() => [ qe(a.$slots, "default") ]), _: 3 }, 8, ["class", "style"])); } }); var TL = /* @__PURE__ */ ot(SL, [["__file", "col.vue"]]); const _r = ui(TL), ng = (i) => _t(i) || Li(i) || Bi(i), EL = ht({ accordion: Boolean, modelValue: { type: Ze([Array, String, Number]), default: () => Qr([]) } }), AL = { [Pt]: ng, [Kn]: ng }, vy = Symbol("collapseContextKey"), CL = (i, e) => { const t = Ae(Cr(i.modelValue)), r = (o) => { t.value = o; const a = i.accordion ? t.value[0] : t.value; e(Pt, a), e(Kn, a); }, n = (o) => { if (i.accordion) r([t.value[0] === o ? "" : o]); else { const a = [...t.value], s = a.indexOf(o); s > -1 ? a.splice(s, 1) : a.push(o), r(a); } }; return Ke(() => i.modelValue, () => t.value = Cr(i.modelValue), { deep: !0 }), ci(vy, { activeNames: t, handleItemClick: n }), { activeNames: t, setActiveNames: r }; }, LL = () => { const i = it("collapse"); return { rootKls: ce(() => i.b()) }; }, RL = Ie({ name: "ElCollapse" }), OL = /* @__PURE__ */ Ie({ ...RL, props: EL, emits: AL, setup(i, { expose: e, emit: t }) { const r = i, { activeNames: n, setActiveNames: o } = CL(r, t), { rootKls: a } = LL(); return e({ activeNames: n, setActiveNames: o }), (s, c) => (ge(), Le("div", { class: Re(G(a)) }, [ qe(s.$slots, "default") ], 2)); } }); var PL = /* @__PURE__ */ ot(OL, [["__file", "collapse.vue"]]); const IL = Ie({ name: "ElCollapseTransition" }), DL = /* @__PURE__ */ Ie({ ...IL, setup(i) { const e = it("collapse-transition"), t = (n) => { n.style.maxHeight = "", n.style.overflow = n.dataset.oldOverflow, n.style.paddingTop = n.dataset.oldPaddingTop, n.style.paddingBottom = n.dataset.oldPaddingBottom; }, r = { beforeEnter(n) { n.dataset || (n.dataset = {}), n.dataset.oldPaddingTop = n.style.paddingTop, n.dataset.oldPaddingBottom = n.style.paddingBottom, n.style.height && (n.dataset.elExistsHeight = n.style.height), n.style.maxHeight = 0, n.style.paddingTop = 0, n.style.paddingBottom = 0; }, enter(n) { requestAnimationFrame(() => { n.dataset.oldOverflow = n.style.overflow, n.dataset.elExistsHeight ? n.style.maxHeight = n.dataset.elExistsHeight : n.scrollHeight !== 0 ? n.style.maxHeight = `${n.scrollHeight}px` : n.style.maxHeight = 0, n.style.paddingTop = n.dataset.oldPaddingTop, n.style.paddingBottom = n.dataset.oldPaddingBottom, n.style.overflow = "hidden"; }); }, afterEnter(n) { n.style.maxHeight = "", n.style.overflow = n.dataset.oldOverflow; }, enterCancelled(n) { t(n); }, beforeLeave(n) { n.dataset || (n.dataset = {}), n.dataset.oldPaddingTop = n.style.paddingTop, n.dataset.oldPaddingBottom = n.style.paddingBottom, n.dataset.oldOverflow = n.style.overflow, n.style.maxHeight = `${n.scrollHeight}px`, n.style.overflow = "hidden"; }, leave(n) { n.scrollHeight !== 0 && (n.style.maxHeight = 0, n.style.paddingTop = 0, n.style.paddingBottom = 0); }, afterLeave(n) { t(n); }, leaveCancelled(n) { t(n); } }; return (n, o) => (ge(), Ue(hl, Or({ name: G(e).b() }, dw(r)), { default: me(() => [ qe(n.$slots, "default") ]), _: 3 }, 16, ["name"])); } }); var NL = /* @__PURE__ */ ot(DL, [["__file", "collapse-transition.vue"]]); const BL = ui(NL), kL = ht({ title: { type: String, default: "" }, name: { type: Ze([String, Number]), default: void 0 }, icon: { type: $n, default: Wn }, disabled: Boolean }), zL = (i) => { const e = ct(vy), { namespace: t } = it("collapse"), r = Ae(!1), n = Ae(!1), o = Ep(), a = ce(() => o.current++), s = ce(() => { var l; return (l = i.name) != null ? l : `${t.value}-id-${o.prefix}-${G(a)}`; }), c = ce(() => e == null ? void 0 : e.activeNames.value.includes(G(s))); return { focusing: r, id: a, isActive: c, handleFocus: () => { setTimeout(() => { n.value ? n.value = !1 : r.value = !0; }, 50); }, handleHeaderClick: () => { i.disabled || (e == null || e.handleItemClick(G(s)), r.value = !1, n.value = !0); }, handleEnterClick: () => { e == null || e.handleItemClick(G(s)); } }; }, FL = (i, { focusing: e, isActive: t, id: r }) => { const n = it("collapse"), o = ce(() => [ n.b("item"), n.is("active", G(t)), n.is("disabled", i.disabled) ]), a = ce(() => [ n.be("item", "header"), n.is("active", G(t)), { focusing: G(e) && !i.disabled } ]), s = ce(() => [ n.be("item", "arrow"), n.is("active", G(t)) ]), c = ce(() => n.be("item", "wrap")), l = ce(() => n.be("item", "content")), h = ce(() => n.b(`content-${G(r)}`)), u = ce(() => n.b(`head-${G(r)}`)); return { arrowKls: s, headKls: a, rootKls: o, itemWrapperKls: c, itemContentKls: l, scopedContentId: h, scopedHeadId: u }; }, VL = Ie({ name: "ElCollapseItem" }), UL = /* @__PURE__ */ Ie({ ...VL, props: kL, setup(i, { expose: e }) { const t = i, { focusing: r, id: n, isActive: o, handleFocus: a, handleHeaderClick: s, handleEnterClick: c } = zL(t), { arrowKls: l, headKls: h, rootKls: u, itemWrapperKls: p, itemContentKls: g, scopedContentId: m, scopedHeadId: d } = FL(t, { focusing: r, isActive: o, id: n }); return e({ isActive: o }), (y, f) => (ge(), Le("div", { class: Re(G(u)) }, [ ke("button", { id: G(d), class: Re(G(h)), "aria-expanded": G(o), "aria-controls": G(m), "aria-describedby": G(m), tabindex: y.disabled ? -1 : 0, type: "button", onClick: G(s), onKeydown: mr(ai(G(c), ["stop", "prevent"]), ["space", "enter"]), onFocus: G(a), onBlur: (v) => r.value = !1 }, [ qe(y.$slots, "title", {}, () => [ vt(xt(y.title), 1) ]), qe(y.$slots, "icon", { isActive: G(o) }, () => [ le(G(Dt), { class: Re(G(l)) }, { default: me(() => [ (ge(), Ue(Ni(y.icon))) ]), _: 1 }, 8, ["class"]) ]) ], 42, ["id", "aria-expanded", "aria-controls", "aria-describedby", "tabindex", "onClick", "onKeydown", "onFocus", "onBlur"]), le(G(BL), null, { default: me(() => [ It(ke("div", { id: G(m), role: "region", class: Re(G(p)), "aria-hidden": !G(o), "aria-labelledby": G(d) }, [ ke("div", { class: Re(G(g)) }, [ qe(y.$slots, "default") ], 2) ], 10, ["id", "aria-hidden", "aria-labelledby"]), [ [fi, G(o)] ]) ]), _: 3 }) ], 2)); } }); var yy = /* @__PURE__ */ ot(UL, [["__file", "collapse-item.vue"]]); const by = ui(PL, { CollapseItem: yy }), xy = mn(yy), GL = Ie({ name: "ElContainer" }), HL = /* @__PURE__ */ Ie({ ...GL, props: { direction: { type: String } }, setup(i) { const e = i, t = au(), r = it("container"), n = ce(() => e.direction === "vertical" ? !0 : e.direction === "horizontal" ? !1 : t && t.default ? t.default().some((o) => { const a = o.type.name; return a === "ElHeader" || a === "ElFooter"; }) : !1); return (o, a) => (ge(), Le("section", { class: Re([G(r).b(), G(r).is("vertical", G(n))]) }, [ qe(o.$slots, "default") ], 2)); } }); var jL = /* @__PURE__ */ ot(HL, [["__file", "container.vue"]]); const WL = Ie({ name: "ElAside" }), $L = /* @__PURE__ */ Ie({ ...WL, props: { width: { type: String, default: null } }, setup(i) { const e = i, t = it("aside"), r = ce(() => e.width ? t.cssVarBlock({ width: e.width }) : {}); return (n, o) => (ge(), Le("aside", { class: Re(G(t).b()), style: Ot(G(r)) }, [ qe(n.$slots, "default") ], 6)); } }); var wy = /* @__PURE__ */ ot($L, [["__file", "aside.vue"]]); const qL = Ie({ name: "ElFooter" }), XL = /* @__PURE__ */ Ie({ ...qL, props: { height: { type: String, default: null } }, setup(i) { const e = i, t = it("footer"), r = ce(() => e.height ? t.cssVarBlock({ height: e.height }) : {}); return (n, o) => (ge(), Le("footer", { class: Re(G(t).b()), style: Ot(G(r)) }, [ qe(n.$slots, "default") ], 6)); } }); var _y = /* @__PURE__ */ ot(XL, [["__file", "footer.vue"]]); const ZL = Ie({ name: "ElHeader" }), YL = /* @__PURE__ */ Ie({ ...ZL, props: { height: { type: String, default: null } }, setup(i) { const e = i, t = it("header"), r = ce(() => e.height ? t.cssVarBlock({ height: e.height }) : {}); return (n, o) => (ge(), Le("header", { class: Re(G(t).b()), style: Ot(G(r)) }, [ qe(n.$slots, "default") ], 6)); } }); var My = /* @__PURE__ */ ot(YL, [["__file", "header.vue"]]); const JL = Ie({ name: "ElMain" }), KL = /* @__PURE__ */ Ie({ ...JL, setup(i) { const e = it("main"); return (t, r) => (ge(), Le("main", { class: Re(G(e).b()) }, [ qe(t.$slots, "default") ], 2)); } }); var Sy = /* @__PURE__ */ ot(KL, [["__file", "main.vue"]]); const Gr = ui(jL, { Aside: wy, Footer: _y, Header: My, Main: Sy }); mn(wy); const Ty = mn(_y), QL = mn(My), gn = mn(Sy), eR = /* @__PURE__ */ Ie({ inheritAttrs: !1 }); function tR(i, e, t, r, n, o) { return qe(i.$slots, "default"); } var iR = /* @__PURE__ */ ot(eR, [["render", tR], ["__file", "collection.vue"]]); const rR = /* @__PURE__ */ Ie({ name: "ElCollectionItem", inheritAttrs: !1 }); function nR(i, e, t, r, n, o) { return qe(i.$slots, "default"); } var oR = /* @__PURE__ */ ot(rR, [["render", nR], ["__file", "collection-item.vue"]]); const aR = "data-el-collection-item", sR = (i) => { const e = `El${i}Collection`, t = `${e}Item`, r = Symbol(e), n = Symbol(t), o = { ...iR, name: e, setup() { const s = Ae(null), c = /* @__PURE__ */ new Map(); ci(r, { itemMap: c, getItems: () => { const l = G(s); if (!l) return []; const h = Array.from(l.querySelectorAll(`[${aR}]`)); return [...c.values()].sort((u, p) => h.indexOf(u.ref) - h.indexOf(p.ref)); }, collectionRef: s }); } }, a = { ...oR, name: t, setup(s, { attrs: c }) { const l = Ae(null), h = ct(r, void 0); ci(n, { collectionItemRef: l }), ei(() => { const u = G(l); u && h.itemMap.set(u, { ref: u, ...c }); }), or(() => { const u = G(l); h.itemMap.delete(u); }); } }; return { COLLECTION_INJECTION_KEY: r, COLLECTION_ITEM_INJECTION_KEY: n, ElCollection: o, ElCollectionItem: a }; }, rh = ht({ trigger: Js.trigger, effect: { ...Wi.effect, default: "light" }, type: { type: Ze(String) }, placement: { type: Ze(String), default: "bottom" }, popperOptions: { type: Ze(Object), default: () => ({}) }, id: String, size: { type: String, default: "" }, splitButton: Boolean, hideOnClick: { type: Boolean, default: !0 }, loop: { type: Boolean, default: !0 }, showTimeout: { type: Number, default: 150 }, hideTimeout: { type: Number, default: 150 }, tabindex: { type: Ze([Number, String]), default: 0 }, maxHeight: { type: Ze([Number, String]), default: "" }, popperClass: { type: String, default: "" }, disabled: Boolean, role: { type: String, default: "menu" }, buttonProps: { type: Ze(Object) }, teleported: Wi.teleported }); ht({ command: { type: [Object, String, Number], default: () => ({}) }, disabled: Boolean, divided: Boolean, textValue: String, icon: { type: $n } }); ht({ onKeydown: { type: Ze(Function) } }); sR("Dropdown"); const lR = ht({ id: { type: String, default: void 0 }, step: { type: Number, default: 1 }, stepStrictly: Boolean, max: { type: Number, default: Number.POSITIVE_INFINITY }, min: { type: Number, default: Number.NEGATIVE_INFINITY }, modelValue: Number, readonly: Boolean, disabled: Boolean, size: Da, controls: { type: Boolean, default: !0 }, controlsPosition: { type: String, default: "", values: ["", "right"] }, valueOnClear: { type: [String, Number, null], validator: (i) => i === null || _t(i) || ["min", "max"].includes(i), default: null }, name: String, placeholder: String, precision: { type: Number, validator: (i) => i >= 0 && i === Number.parseInt(`${i}`, 10) }, validateEvent: { type: Boolean, default: !0 }, ...Ho(["ariaLabel"]) }), cR = { [Kn]: (i, e) => e !== i, blur: (i) => i instanceof FocusEvent, focus: (i) => i instanceof FocusEvent, [So]: (i) => _t(i) || nn(i), [Pt]: (i) => _t(i) || nn(i) }, uR = Ie({ name: "ElInputNumber" }), hR = /* @__PURE__ */ Ie({ ...uR, props: lR, emits: cR, setup(i, { expose: e, emit: t }) { const r = i, { t: n } = mu(), o = it("input-number"), a = Ae(), s = Xi({ currentValue: r.modelValue, userInput: null }), { formItem: c } = gl(), l = ce(() => _t(r.modelValue) && r.modelValue <= r.min), h = ce(() => _t(r.modelValue) && r.modelValue >= r.max), u = ce(() => { const R = f(r.step); return gr(r.precision) ? Math.max(f(r.modelValue), R) : (R > r.precision && Zt("InputNumber", "precision should not be less than the decimal places of step"), r.precision); }), p = ce(() => r.controls && r.controlsPosition === "right"), g = ns(), m = yu(), d = ce(() => { if (s.userInput !== null) return s.userInput; let R = s.currentValue; if (nn(R)) return ""; if (_t(R)) { if (Number.isNaN(R)) return ""; gr(r.precision) || (R = R.toFixed(r.precision)); } return R; }), y = (R, b) => { if (gr(b) && (b = u.value), b === 0) return Math.round(R); let P = String(R); const N = P.indexOf("."); if (N === -1 || !P.replace(".", "").split("")[N + b]) return R; const D = P.length; return P.charAt(D - 1) === "5" && (P = `${P.slice(0, Math.max(0, D - 1))}6`), Number.parseFloat(Number(P).toFixed(b)); }, f = (R) => { if (nn(R)) return 0; const b = R.toString(), P = b.indexOf("."); let N = 0; return P !== -1 && (N = b.length - P - 1), N; }, v = (R, b = 1) => _t(R) ? y(R + r.step * b) : s.currentValue, M = () => { if (r.readonly || m.value || h.value) return; const R = Number(d.value) || 0, b = v(R); x(b), t(So, s.currentValue), C(); }, S = () => { if (r.readonly || m.value || l.value) return; const R = Number(d.value) || 0, b = v(R, -1); x(b), t(So, s.currentValue), C(); }, T = (R, b) => { const { max: P, min: N, step: D, precision: k, stepStrictly: V, valueOnClear: q } = r; P < N && is("InputNumber", "min should not be greater than max."); let Y = Number(R); if (nn(R) || Number.isNaN(Y)) return null; if (R === "") { if (q === null) return null; Y = Li(q) ? { min: N, max: P }[q] : q; } return V && (Y = y(Math.round(Y / D) * D, k), Y !== R && b && t(Pt, Y)), gr(k) || (Y = y(Y, k)), (Y > P || Y < N) && (Y = Y > P ? P : N, b && t(Pt, Y)), Y; }, x = (R, b = !0) => { var P; const N = s.currentValue, D = T(R); if (!b) { t(Pt, D); return; } N === D && R || (s.userInput = null, t(Pt, D), N !== D && t(Kn, D, N), r.validateEvent && ((P = c == null ? void 0 : c.validate) == null || P.call(c, "change").catch((k) => Zt(k))), s.currentValue = D); }, w = (R) => { s.userInput = R; const b = R === "" ? null : Number(R); t(So, b), x(b, !1); }, A = (R) => { const b = R !== "" ? Number(R) : ""; (_t(b) && !Number.isNaN(b) || R === "") && x(b), C(), s.userInput = null; }, _ = () => { var R, b; (b = (R = a.value) == null ? void 0 : R.focus) == null || b.call(R); }, E = () => { var R, b; (b = (R = a.value) == null ? void 0 : R.blur) == null || b.call(R); }, O = (R) => { t("focus", R); }, L = (R) => { var b; s.userInput = null, t("blur", R), r.validateEvent && ((b = c == null ? void 0 : c.validate) == null || b.call(c, "blur").catch((P) => Zt(P))); }, C = () => { s.currentValue !== r.modelValue && (s.currentValue = r.modelValue); }, I = (R) => { document.activeElement === R.target && R.preventDefault(); }; return Ke(() => r.modelValue, (R, b) => { const P = T(R, !0); s.userInput === null && P !== b && (s.currentValue = P); }, { immediate: !0 }), ei(() => { var R; const { min: b, max: P, modelValue: N } = r, D = (R = a.value) == null ? void 0 : R.input; if (D.setAttribute("role", "spinbutton"), Number.isFinite(P) ? D.setAttribute("aria-valuemax", String(P)) : D.removeAttribute("aria-valuemax"), Number.isFinite(b) ? D.setAttribute("aria-valuemin", String(b)) : D.removeAttribute("aria-valuemin"), D.setAttribute("aria-valuenow", s.currentValue || s.currentValue === 0 ? String(s.currentValue) : ""), D.setAttribute("aria-disabled", String(m.value)), !_t(N) && N != null) { let k = Number(N); Number.isNaN(k) && (k = null), t(Pt, k); } D.addEventListener("wheel", I, { passive: !1 }); }), rp(() => { var R, b; const P = (R = a.value) == null ? void 0 : R.input; P == null || P.setAttribute("aria-valuenow", `${(b = s.currentValue) != null ? b : ""}`); }), e({ focus: _, blur: E }), (R, b) => (ge(), Le("div", { class: Re([ G(o).b(), G(o).m(G(g)), G(o).is("disabled", G(m)), G(o).is("without-controls", !R.controls), G(o).is("controls-right", G(p)) ]), onDragstart: ai(() => { }, ["prevent"]) }, [ R.controls ? It((ge(), Le("span", { key: 0, role: "button", "aria-label": G(n)("el.inputNumber.decrease"), class: Re([G(o).e("decrease"), G(o).is("disabled", G(l))]), onKeydown: mr(S, ["enter"]) }, [ qe(R.$slots, "decrease-icon", {}, () => [ le(G(Dt), null, { default: me(() => [ G(p) ? (ge(), Ue(G(mp), { key: 0 })) : (ge(), Ue(G(mE), { key: 1 })) ]), _: 1 }) ]) ], 42, ["aria-label", "onKeydown"])), [ [G(rg), S] ]) : Ve("v-if", !0), R.controls ? It((ge(), Le("span", { key: 1, role: "button", "aria-label": G(n)("el.inputNumber.increase"), class: Re([G(o).e("increase"), G(o).is("disabled", G(h))]), onKeydown: mr(M, ["enter"]) }, [ qe(R.$slots, "increase-icon", {}, () => [ le(G(Dt), null, { default: me(() => [ G(p) ? (ge(), Ue(G(oE), { key: 0 })) : (ge(), Ue(G(pu), { key: 1 })) ]), _: 1 }) ]) ], 42, ["aria-label", "onKeydown"])), [ [G(rg), M] ]) : Ve("v-if", !0), le(G(y2), { id: R.id, ref_key: "input", ref: a, type: "number", step: R.step, "model-value": G(d), placeholder: R.placeholder, readonly: R.readonly, disabled: G(m), size: G(g), max: R.max, min: R.min, name: R.name, "aria-label": R.ariaLabel, "validate-event": !1, onKeydown: [ mr(ai(M, ["prevent"]), ["up"]), mr(ai(S, ["prevent"]), ["down"]) ], onBlur: L, onFocus: O, onInput: w, onChange: A }, pw({ _: 2 }, [ R.$slots.prefix ? { name: "prefix", fn: me(() => [ qe(R.$slots, "prefix") ]) } : void 0, R.$slots.suffix ? { name: "suffix", fn: me(() => [ qe(R.$slots, "suffix") ]) } : void 0 ]), 1032, ["id", "step", "model-value", "placeholder", "readonly", "disabled", "size", "max", "min", "name", "aria-label", "onKeydown"]) ], 42, ["onDragstart"])); } }); var dR = /* @__PURE__ */ ot(hR, [["__file", "input-number.vue"]]); const vn = ui(dR), Ey = Symbol("ElSelectGroup"), wu = Symbol("ElSelect"); function pR(i, e) { const t = ct(wu), r = ct(Ey, { disabled: !1 }), n = ce(() => h(Cr(t.props.modelValue), i.value)), o = ce(() => { var g; if (t.props.multiple) { const m = Cr((g = t.props.modelValue) != null ? g : []); return !n.value && m.length >= t.props.multipleLimit && t.props.multipleLimit > 0; } else return !1; }), a = ce(() => i.label || (Ai(i.value) ? "" : i.value)), s = ce(() => i.value || i.label || ""), c = ce(() => i.disabled || e.groupDisabled || o.value), l = ri(), h = (g = [], m) => { if (Ai(i.value)) { const d = t.props.valueKey; return g && g.some((y) => np(Kr(y, d)) === Kr(m, d)); } else return g && g.includes(m); }, u = () => { !i.disabled && !r.disabled && (t.states.hoveringIndex = t.optionsArray.indexOf(l.proxy)); }, p = (g) => { const m = new RegExp(KT(g), "i"); e.visible = m.test(a.value) || i.created; }; return Ke(() => a.value, () => { !i.created && !t.props.remote && t.setSelected(); }), Ke(() => i.value, (g, m) => { const { remote: d, valueKey: y } = t.props; if (g !== m && (t.onOptionDestroy(m, l.proxy), t.onOptionCreate(l.proxy)), !i.created && !d) { if (y && Ai(g) && Ai(m) && g[y] === m[y]) return; t.setSelected(); } }), Ke(() => r.disabled, () => { e.groupDisabled = r.disabled; }, { immediate: !0 }), { select: t, currentLabel: a, currentValue: s, itemSelected: n, isDisabled: c, hoverItem: u, updateOption: p }; } const fR = Ie({ name: "ElOption", componentName: "ElOption", props: { value: { required: !0, type: [String, Number, Boolean, Object] }, label: [String, Number], created: Boolean, disabled: Boolean }, setup(i) { const e = it("select"), t = vu(), r = ce(() => [ e.be("dropdown", "item"), e.is("disabled", G(s)), e.is("selected", G(a)), e.is("hovering", G(p)) ]), n = Xi({ index: -1, groupDisabled: !1, visible: !0, hover: !1 }), { currentLabel: o, itemSelected: a, isDisabled: s, select: c, hoverItem: l, updateOption: h } = pR(i, n), { visible: u, hover: p } = ln(n), g = ri().proxy; c.onOptionCreate(g), or(() => { const d = g.value, { selected: y } = c.states, f = (c.props.multiple ? y : [y]).some((v) => v.value === g.value); wt(() => { c.states.cachedOptions.get(d) === g && !f && c.states.cachedOptions.delete(d); }), c.onOptionDestroy(d, g); }); function m() { s.value || c.handleOptionSelect(g); } return { ns: e, id: t, containerKls: r, currentLabel: o, itemSelected: a, isDisabled: s, select: c, hoverItem: l, updateOption: h, visible: u, hover: p, selectOptionClick: m, states: n }; } }); function mR(i, e, t, r, n, o) { return It((ge(), Le("li", { id: i.id, class: Re(i.containerKls), role: "option", "aria-disabled": i.isDisabled || void 0, "aria-selected": i.itemSelected, onMouseenter: i.hoverItem, onClick: ai(i.selectOptionClick, ["stop"]) }, [ qe(i.$slots, "default", {}, () => [ ke("span", null, xt(i.currentLabel), 1) ]) ], 42, ["id", "aria-disabled", "aria-selected", "onMouseenter", "onClick"])), [ [fi, i.visible] ]); } var Bp = /* @__PURE__ */ ot(fR, [["render", mR], ["__file", "option.vue"]]); const gR = Ie({ name: "ElSelectDropdown", componentName: "ElSelectDropdown", setup() { const i = ct(wu), e = it("select"), t = ce(() => i.props.popperClass), r = ce(() => i.props.multiple), n = ce(() => i.props.fitInputWidth), o = Ae(""); function a() { var s; o.value = `${(s = i.selectRef) == null ? void 0 : s.offsetWidth}px`; } return ei(() => { a(), er(i.selectRef, a); }), { ns: e, minWidth: o, popperClass: t, isMultiple: r, isFitInputWidth: n }; } }); function vR(i, e, t, r, n, o) { return ge(), Le("div", { class: Re([i.ns.b("dropdown"), i.ns.is("multiple", i.isMultiple), i.popperClass]), style: Ot({ [i.isFitInputWidth ? "width" : "minWidth"]: i.minWidth }) }, [ i.$slots.header ? (ge(), Le("div", { key: 0, class: Re(i.ns.be("dropdown", "header")) }, [ qe(i.$slots, "header") ], 2)) : Ve("v-if", !0), qe(i.$slots, "default"), i.$slots.footer ? (ge(), Le("div", { key: 1, class: Re(i.ns.be("dropdown", "footer")) }, [ qe(i.$slots, "footer") ], 2)) : Ve("v-if", !0) ], 6); } var yR = /* @__PURE__ */ ot(gR, [["render", vR], ["__file", "select-dropdown.vue"]]); const bR = 11, xR = (i, e) => { const { t } = mu(), r = vu(), n = it("select"), o = it("input"), a = Xi({ inputValue: "", options: /* @__PURE__ */ new Map(), cachedOptions: /* @__PURE__ */ new Map(), disabledOptions: /* @__PURE__ */ new Map(), optionValues: [], selected: [], selectionWidth: 0, calculatorWidth: 0, collapseItemWidth: 0, selectedLabel: "", hoveringIndex: -1, previousQuery: null, inputHovering: !1, menuVisibleOnFocus: !1, isBeforeHide: !1 }), s = Ae(null), c = Ae(null), l = Ae(null), h = Ae(null), u = Ae(null), p = Ae(null), g = Ae(null), m = Ae(null), d = Ae(null), y = Ae(null), f = Ae(null), v = Ae(null), { isComposing: M, handleCompositionStart: S, handleCompositionUpdate: T, handleCompositionEnd: x } = ry({ afterComposition: (he) => oe(he) }), { wrapperRef: w, isFocused: A } = iy(u, { beforeFocus() { return b.value; }, afterFocus() { i.automaticDropdown && !_.value && (_.value = !0, a.menuVisibleOnFocus = !0); }, beforeBlur(he) { var xe, Ne; return ((xe = l.value) == null ? void 0 : xe.isFocusInsideContent(he)) || ((Ne = h.value) == null ? void 0 : Ne.isFocusInsideContent(he)); }, afterBlur() { _.value = !1, a.menuVisibleOnFocus = !1; } }), _ = Ae(!1), E = Ae(), { form: O, formItem: L } = gl(), { inputId: C } = Lp(i, { formItemContext: L }), { valueOnClear: I, isEmptyValue: R } = t2(i), b = ce(() => i.disabled || (O == null ? void 0 : O.disabled)), P = ce(() => Bi(i.modelValue) ? i.modelValue.length > 0 : !R(i.modelValue)), N = ce(() => i.clearable && !b.value && a.inputHovering && P.value), D = ce(() => i.remote && i.filterable && !i.remoteShowSuffix ? "" : i.suffixIcon), k = ce(() => n.is("reverse", D.value && _.value)), V = ce(() => (L == null ? void 0 : L.validateState) || ""), q = ce(() => D0[V.value]), Y = ce(() => i.remote ? 300 : 0), ne = ce(() => i.loading ? i.loadingText || t("el.select.loading") : i.remote && !a.inputValue && a.options.size === 0 ? !1 : i.filterable && a.inputValue && a.options.size > 0 && X.value === 0 ? i.noMatchText || t("el.select.noMatch") : a.options.size === 0 ? i.noDataText || t("el.select.noData") : null), X = ce(() => z.value.filter((he) => he.visible).length), z = ce(() => { const he = Array.from(a.options.values()), xe = []; return a.optionValues.forEach((Ne) => { const He = he.findIndex((Xe) => Xe.value === Ne); He > -1 && xe.push(he[He]); }), xe.length >= he.length ? xe : he; }), H = ce(() => Array.from(a.cachedOptions.values())), ee = ce(() => { const he = z.value.filter((xe) => !xe.created).some((xe) => xe.currentLabel === a.inputValue); return i.filterable && i.allowCreate && a.inputValue !== "" && !he; }), Q = () => { i.filterable && Si(i.filterMethod) || i.filterable && i.remote && Si(i.remoteMethod) || z.value.forEach((he) => { var xe; (xe = he.updateOption) == null || xe.call(he, a.inputValue); }); }, J = ns(), W = ce(() => ["small"].includes(J.value) ? "small" : "default"), K = ce({ get() { return _.value && ne.value !== !1; }, set(he) { _.value = he; } }), ie = ce(() => { if (i.multiple && !gr(i.modelValue)) return Cr(i.modelValue).length === 0 && !a.inputValue; const he = Bi(i.modelValue) ? i.modelValue[0] : i.modelValue; return i.filterable || gr(he) ? !a.inputValue : !0; }), B = ce(() => { var he; const xe = (he = i.placeholder) != null ? he : t("el.select.placeholder"); return i.multiple || !P.value ? xe : a.selectedLabel; }), j = ce(() => ed ? null : "mouseenter"); Ke(() => i.modelValue, (he, xe) => { i.multiple && i.filterable && !i.reserveKeyword && (a.inputValue = "", re("")), U(), !sd(he, xe) && i.validateEvent && (L == null || L.validate("change").catch((Ne) => Zt(Ne))); }, { flush: "post", deep: !0 }), Ke(() => _.value, (he) => { he ? re(a.inputValue) : (a.inputValue = "", a.previousQuery = null, a.isBeforeHide = !0), e("visible-change", he); }), Ke(() => a.options.entries(), () => { var he; if (!Kt) return; const xe = ((he = s.value) == null ? void 0 : he.querySelectorAll("input")) || []; (!i.filterable && !i.defaultFirstOption && !gr(i.modelValue) || !Array.from(xe).includes(document.activeElement)) && U(), i.defaultFirstOption && (i.filterable || i.remote) && X.value && F(); }, { flush: "post" }), Ke(() => a.hoveringIndex, (he) => { _t(he) && he > -1 ? E.value = z.value[he] || {} : E.value = {}, z.value.forEach((xe) => { xe.hover = E.value === xe; }); }), l0(() => { a.isBeforeHide || Q(); }); const re = (he) => { a.previousQuery === he || M.value || (a.previousQuery = he, i.filterable && Si(i.filterMethod) ? i.filterMethod(he) : i.filterable && i.remote && Si(i.remoteMethod) && i.remoteMethod(he), i.defaultFirstOption && (i.filterable || i.remote) && X.value ? wt(F) : wt(ue)); }, F = () => { const he = z.value.filter((He) => He.visible && !He.disabled && !He.states.groupDisabled), xe = he.find((He) => He.created), Ne = he[0]; a.hoveringIndex = bt(z.value, xe || Ne); }, U = () => { if (i.multiple) a.selectedLabel = ""; else { const xe = Bi(i.modelValue) ? i.modelValue[0] : i.modelValue, Ne = se(xe); a.selectedLabel = Ne.currentLabel, a.selected = [Ne]; return; } const he = []; gr(i.modelValue) || Cr(i.modelValue).forEach((xe) => { he.push(se(xe)); }), a.selected = he; }, se = (he) => { let xe; const Ne = $u(he).toLowerCase() === "object", He = $u(he).toLowerCase() === "null", Xe = $u(he).toLowerCase() === "undefined"; for (let Ye = a.cachedOptions.size - 1; Ye >= 0; Ye--) { const pt = H.value[Ye]; if (Ne ? Kr(pt.value, i.valueKey) === Kr(he, i.valueKey) : pt.value === he) { xe = { value: he, currentLabel: pt.currentLabel, get isDisabled() { return pt.isDisabled; } }; break; } } if (xe) return xe; const Qe = Ne ? he.label : !He && !Xe ? he : ""; return { value: he, currentLabel: Qe }; }, ue = () => { a.hoveringIndex = z.value.findIndex((he) => a.selected.some((xe) => Se(xe) === Se(he))); }, fe = () => { a.selectionWidth = c.value.getBoundingClientRect().width; }, ve = () => { a.calculatorWidth = p.value.getBoundingClientRect().width; }, _e = () => { a.collapseItemWidth = f.value.getBoundingClientRect().width; }, ae = () => { var he, xe; (xe = (he = l.value) == null ? void 0 : he.updatePopper) == null || xe.call(he); }, Te = () => { var he, xe; (xe = (he = h.value) == null ? void 0 : he.updatePopper) == null || xe.call(he); }, Ee = () => { a.inputValue.length > 0 && !_.value && (_.value = !0), re(a.inputValue); }, oe = (he) => { if (a.inputValue = he.target.value, i.remote) Me(); else return Ee(); }, Me = ad(() => { Ee(); }, Y.value), ye = (he) => { sd(i.modelValue, he) || e(Kn, he); }, we = (he) => WT(he, (xe) => !a.disabledOptions.has(xe)), Pe = (he) => { if (i.multiple && he.code !== Pr.delete && he.target.value.length <= 0) { const xe = Cr(i.modelValue).slice(), Ne = we(xe); if (Ne < 0) return; const He = xe[Ne]; xe.splice(Ne, 1), e(Pt, xe), ye(xe), e("remove-tag", He); } }, ut = (he, xe) => { const Ne = a.selected.indexOf(xe); if (Ne > -1 && !b.value) { const He = Cr(i.modelValue).slice(); He.splice(Ne, 1), e(Pt, He), ye(He), e("remove-tag", xe.value); } he.stopPropagation(), kt(); }, mt = (he) => { he.stopPropagation(); const xe = i.multiple ? [] : I.value; if (i.multiple) for (const Ne of a.selected) Ne.isDisabled && xe.push(Ne.value); e(Pt, xe), ye(xe), a.hoveringIndex = -1, _.value = !1, e("clear"), kt(); }, Ge = (he) => { var xe; if (i.multiple) { const Ne = Cr((xe = i.modelValue) != null ? xe : []).slice(), He = bt(Ne, he.value); He > -1 ? Ne.splice(He, 1) : (i.multipleLimit <= 0 || Ne.length < i.multipleLimit) && Ne.push(he.value), e(Pt, Ne), ye(Ne), he.created && re(""), i.filterable && !i.reserveKeyword && (a.inputValue = ""); } else e(Pt, he.value), ye(he.value), _.value = !1; kt(), !_.value && wt(() => { ze(he); }); }, bt = (he = [], xe) => { if (!Ai(xe)) return he.indexOf(xe); const Ne = i.valueKey; let He = -1; return he.some((Xe, Qe) => np(Kr(Xe, Ne)) === Kr(xe, Ne) ? (He = Qe, !0) : !1), He; }, ze = (he) => { var xe, Ne, He, Xe, Qe; const Ye = Bi(he) ? he[0] : he; let pt = null; if (Ye != null && Ye.value) { const bi = z.value.filter((hi) => hi.value === Ye.value); bi.length > 0 && (pt = bi[0].$el); } if (l.value && pt) { const bi = (Xe = (He = (Ne = (xe = l.value) == null ? void 0 : xe.popperRef) == null ? void 0 : Ne.contentRef) == null ? void 0 : He.querySelector) == null ? void 0 : Xe.call(He, `.${n.be("dropdown", "wrap")}`); bi && eE(bi, pt); } (Qe = v.value) == null || Qe.handleScroll(); }, at = (he) => { a.options.set(he.value, he), a.cachedOptions.set(he.value, he), he.disabled && a.disabledOptions.set(he.value, he); }, et = (he, xe) => { a.options.get(he) === xe && a.options.delete(he); }, yt = ce(() => { var he, xe; return (xe = (he = l.value) == null ? void 0 : he.popperRef) == null ? void 0 : xe.contentRef; }), dt = () => { a.isBeforeHide = !1, wt(() => ze(a.selected)); }, kt = () => { var he; (he = u.value) == null || he.focus(); }, Rt = () => { var he; (he = u.value) == null || he.blur(); }, Ii = (he) => { mt(he); }, Ui = () => { _.value = !1, A.value && Rt(); }, sr = () => { a.inputValue.length > 0 ? a.inputValue = "" : _.value = !1; }, oo = () => { b.value || (ed && (a.inputHovering = !0), a.menuVisibleOnFocus ? a.menuVisibleOnFocus = !1 : _.value = !_.value); }, te = () => { _.value ? z.value[a.hoveringIndex] && Ge(z.value[a.hoveringIndex]) : oo(); }, Se = (he) => Ai(he.value) ? Kr(he.value, i.valueKey) : he.value, De = ce(() => z.value.filter((he) => he.visible).every((he) => he.disabled)), We = ce(() => i.multiple ? i.collapseTags ? a.selected.slice(0, i.maxCollapseTags) : a.selected : []), st = ce(() => i.multiple ? i.collapseTags ? a.selected.slice(i.maxCollapseTags) : [] : []), $ = (he) => { if (!_.value) { _.value = !0; return; } if (!(a.options.size === 0 || a.filteredOptionsCount === 0 || M.value) && !De.value) { he === "next" ? (a.hoveringIndex++, a.hoveringIndex === a.options.size && (a.hoveringIndex = 0)) : he === "prev" && (a.hoveringIndex--, a.hoveringIndex < 0 && (a.hoveringIndex = a.options.size - 1)); const xe = z.value[a.hoveringIndex]; (xe.disabled === !0 || xe.states.groupDisabled === !0 || !xe.visible) && $(he), wt(() => ze(E.value)); } }, pe = () => { if (!c.value) return 0; const he = window.getComputedStyle(c.value); return Number.parseFloat(he.gap || "6px"); }, de = ce(() => { const he = pe(); return { maxWidth: `${f.value && i.maxCollapseTags === 1 ? a.selectionWidth - a.collapseItemWidth - he : a.selectionWidth}px` }; }), be = ce(() => ({ maxWidth: `${a.selectionWidth}px` })), Ce = ce(() => ({ width: `${Math.max(a.calculatorWidth, bR)}px` })); return er(c, fe), er(p, ve), er(d, ae), er(w, ae), er(y, Te), er(f, _e), ei(() => { U(); }), { inputId: C, contentId: r, nsSelect: n, nsInput: o, states: a, isFocused: A, expanded: _, optionsArray: z, hoverOption: E, selectSize: J, filteredOptionsCount: X, resetCalculatorWidth: ve, updateTooltip: ae, updateTagTooltip: Te, debouncedOnInputChange: Me, onInput: oe, deletePrevTag: Pe, deleteTag: ut, deleteSelected: mt, handleOptionSelect: Ge, scrollToOption: ze, hasModelValue: P, shouldShowPlaceholder: ie, currentPlaceholder: B, mouseEnterEventName: j, showClose: N, iconComponent: D, iconReverse: k, validateState: V, validateIcon: q, showNewOption: ee, updateOptions: Q, collapseTagSize: W, setSelected: U, selectDisabled: b, emptyText: ne, handleCompositionStart: S, handleCompositionUpdate: T, handleCompositionEnd: x, onOptionCreate: at, onOptionDestroy: et, handleMenuEnter: dt, focus: kt, blur: Rt, handleClearClick: Ii, handleClickOutside: Ui, handleEsc: sr, toggleMenu: oo, selectOption: te, getValueKey: Se, navigateOptions: $, dropdownMenuVisible: K, showTagList: We, collapseTagList: st, tagStyle: de, collapseTagStyle: be, inputStyle: Ce, popperRef: yt, inputRef: u, tooltipRef: l, tagTooltipRef: h, calculatorRef: p, prefixRef: g, suffixRef: m, selectRef: s, wrapperRef: w, selectionRef: c, scrollbarRef: v, menuRef: d, tagMenuRef: y, collapseItemRef: f }; }; var wR = Ie({ name: "ElOptions", setup(i, { slots: e }) { const t = ct(wu); let r = []; return () => { var n, o; const a = (n = e.default) == null ? void 0 : n.call(e), s = []; function c(l) { Bi(l) && l.forEach((h) => { var u, p, g, m; const d = (u = (h == null ? void 0 : h.type) || {}) == null ? void 0 : u.name; d === "ElOptionGroup" ? c(!Li(h.children) && !Bi(h.children) && Si((p = h.children) == null ? void 0 : p.default) ? (g = h.children) == null ? void 0 : g.default() : h.children) : d === "ElOption" ? s.push((m = h.props) == null ? void 0 : m.value) : Bi(h.children) && c(h.children); }); } return a.length && c((o = a[0]) == null ? void 0 : o.children), sd(s, r) || (r = s, t && (t.states.optionValues = s)), a; }; } }); const _R = ht({ name: String, id: String, modelValue: { type: [Array, String, Number, Boolean, Object], default: void 0 }, autocomplete: { type: String, default: "off" }, automaticDropdown: Boolean, size: Da, effect: { type: Ze(String), default: "light" }, disabled: Boolean, clearable: Boolean, filterable: Boolean, allowCreate: Boolean, loading: Boolean, popperClass: { type: String, default: "" }, popperOptions: { type: Ze(Object), default: () => ({}) }, remote: Boolean, loadingText: String, noMatchText: String, noDataText: String, remoteMethod: Function, filterMethod: Function, multiple: Boolean, multipleLimit: { type: Number, default: 0 }, placeholder: { type: String }, defaultFirstOption: Boolean, reserveKeyword: { type: Boolean, default: !0 }, valueKey: { type: String, default: "value" }, collapseTags: Boolean, collapseTagsTooltip: Boolean, maxCollapseTags: { type: Number, default: 1 }, teleported: Wi.teleported, persistent: { type: Boolean, default: !0 }, clearIcon: { type: $n, default: gp }, fitInputWidth: Boolean, suffixIcon: { type: $n, default: mp }, tagType: { ...fd.type, default: "info" }, tagEffect: { ...fd.effect, default: "light" }, validateEvent: { type: Boolean, default: !0 }, remoteShowSuffix: Boolean, placement: { type: Ze(String), values: rs, default: "bottom-start" }, fallbackPlacements: { type: Ze(Array), default: ["bottom-start", "top-start", "right", "left"] }, appendTo: String, ...e2, ...Ho(["ariaLabel"]) }), og = "ElSelect", MR = Ie({ name: og, componentName: og, components: { ElSelectMenu: yR, ElOption: Bp, ElOptions: wR, ElTag: mL, ElScrollbar: P2, ElTooltip: Np, ElIcon: Dt }, directives: { ClickOutside: lL }, props: _R, emits: [ Pt, Kn, "remove-tag", "clear", "visible-change", "focus", "blur" ], setup(i, { emit: e }) { const t = ce(() => { const { modelValue: o, multiple: a } = i, s = a ? [] : void 0; return Bi(o) ? a ? o : s : a ? s : o; }), r = Xi({ ...ln(i), modelValue: t }), n = xR(r, e); return ci(wu, Xi({ props: r, states: n.states, optionsArray: n.optionsArray, handleOptionSelect: n.handleOptionSelect, onOptionCreate: n.onOptionCreate, onOptionDestroy: n.onOptionDestroy, selectRef: n.selectRef, setSelected: n.setSelected })), { ...n, modelValue: t }; } }); function SR(i, e, t, r, n, o) { const a = Ei("el-tag"), s = Ei("el-tooltip"), c = Ei("el-icon"), l = Ei("el-option"), h = Ei("el-options"), u = Ei("el-scrollbar"), p = Ei("el-select-menu"), g = vw("click-outside"); return It((ge(), Le("div", { ref: "selectRef", class: Re([i.nsSelect.b(), i.nsSelect.m(i.selectSize)]), [yw(i.mouseEnterEventName)]: (m) => i.states.inputHovering = !0, onMouseleave: (m) => i.states.inputHovering = !1 }, [ le(s, { ref: "tooltipRef", visible: i.dropdownMenuVisible, placement: i.placement, teleported: i.teleported, "popper-class": [i.nsSelect.e("popper"), i.popperClass], "popper-options": i.popperOptions, "fallback-placements": i.fallbackPlacements, effect: i.effect, pure: "", trigger: "click", transition: `${i.nsSelect.namespace.value}-zoom-in-top`, "stop-popper-mouse-event": !1, "gpu-acceleration": !1, persistent: i.persistent, "append-to": i.appendTo, onBeforeShow: i.handleMenuEnter, onHide: (m) => i.states.isBeforeHide = !1 }, { default: me(() => { var m; return [ ke("div", { ref: "wrapperRef", class: Re([ i.nsSelect.e("wrapper"), i.nsSelect.is("focused", i.isFocused), i.nsSelect.is("hovering", i.states.inputHovering), i.nsSelect.is("filterable", i.filterable), i.nsSelect.is("disabled", i.selectDisabled) ]), onClick: ai(i.toggleMenu, ["prevent"]) }, [ i.$slots.prefix ? (ge(), Le("div", { key: 0, ref: "prefixRef", class: Re(i.nsSelect.e("prefix")) }, [ qe(i.$slots, "prefix") ], 2)) : Ve("v-if", !0), ke("div", { ref: "selectionRef", class: Re([ i.nsSelect.e("selection"), i.nsSelect.is("near", i.multiple && !i.$slots.prefix && !!i.states.selected.length) ]) }, [ i.multiple ? qe(i.$slots, "tag", { key: 0 }, () => [ (ge(!0), Le(Vt, null, tr(i.showTagList, (d) => (ge(), Le("div", { key: i.getValueKey(d), class: Re(i.nsSelect.e("selected-item")) }, [ le(a, { closable: !i.selectDisabled && !d.isDisabled, size: i.collapseTagSize, type: i.tagType, effect: i.tagEffect, "disable-transitions": "", style: Ot(i.tagStyle), onClose: (y) => i.deleteTag(y, d) }, { default: me(() => [ ke("span", { class: Re(i.nsSelect.e("tags-text")) }, [ qe(i.$slots, "label", { label: d.currentLabel, value: d.value }, () => [ vt(xt(d.currentLabel), 1) ]) ], 2) ]), _: 2 }, 1032, ["closable", "size", "type", "effect", "style", "onClose"]) ], 2))), 128)), i.collapseTags && i.states.selected.length > i.maxCollapseTags ? (ge(), Ue(s, { key: 0, ref: "tagTooltipRef", disabled: i.dropdownMenuVisible || !i.collapseTagsTooltip, "fallback-placements": ["bottom", "top", "right", "left"], effect: i.effect, placement: "bottom", teleported: i.teleported }, { default: me(() => [ ke("div", { ref: "collapseItemRef", class: Re(i.nsSelect.e("selected-item")) }, [ le(a, { closable: !1, size: i.collapseTagSize, type: i.tagType, effect: i.tagEffect, "disable-transitions": "", style: Ot(i.collapseTagStyle) }, { default: me(() => [ ke("span", { class: Re(i.nsSelect.e("tags-text")) }, " + " + xt(i.states.selected.length - i.maxCollapseTags), 3) ]), _: 1 }, 8, ["size", "type", "effect", "style"]) ], 2) ]), content: me(() => [ ke("div", { ref: "tagMenuRef", class: Re(i.nsSelect.e("selection")) }, [ (ge(!0), Le(Vt, null, tr(i.collapseTagList, (d) => (ge(), Le("div", { key: i.getValueKey(d), class: Re(i.nsSelect.e("selected-item")) }, [ le(a, { class: "in-tooltip", closable: !i.selectDisabled && !d.isDisabled, size: i.collapseTagSize, type: i.tagType, effect: i.tagEffect, "disable-transitions": "", onClose: (y) => i.deleteTag(y, d) }, { default: me(() => [ ke("span", { class: Re(i.nsSelect.e("tags-text")) }, [ qe(i.$slots, "label", { label: d.currentLabel, value: d.value }, () => [ vt(xt(d.currentLabel), 1) ]) ], 2) ]), _: 2 }, 1032, ["closable", "size", "type", "effect", "onClose"]) ], 2))), 128)) ], 2) ]), _: 3 }, 8, ["disabled", "effect", "teleported"])) : Ve("v-if", !0) ]) : Ve("v-if", !0), i.selectDisabled ? Ve("v-if", !0) : (ge(), Le("div", { key: 1, class: Re([ i.nsSelect.e("selected-item"), i.nsSelect.e("input-wrapper"), i.nsSelect.is("hidden", !i.filterable) ]) }, [ It(ke("input", { id: i.inputId, ref: "inputRef", "onUpdate:modelValue": (d) => i.states.inputValue = d, type: "text", name: i.name, class: Re([i.nsSelect.e("input"), i.nsSelect.is(i.selectSize)]), disabled: i.selectDisabled, autocomplete: i.autocomplete, style: Ot(i.inputStyle), role: "combobox", readonly: !i.filterable, spellcheck: "false", "aria-activedescendant": ((m = i.hoverOption) == null ? void 0 : m.id) || "", "aria-controls": i.contentId, "aria-expanded": i.dropdownMenuVisible, "aria-label": i.ariaLabel, "aria-autocomplete": "none", "aria-haspopup": "listbox", onKeydown: [ mr(ai((d) => i.navigateOptions("next"), ["stop", "prevent"]), ["down"]), mr(ai((d) => i.navigateOptions("prev"), ["stop", "prevent"]), ["up"]), mr(ai(i.handleEsc, ["stop", "prevent"]), ["esc"]), mr(ai(i.selectOption, ["stop", "prevent"]), ["enter"]), mr(ai(i.deletePrevTag, ["stop"]), ["delete"]) ], onCompositionstart: i.handleCompositionStart, onCompositionupdate: i.handleCompositionUpdate, onCompositionend: i.handleCompositionEnd, onInput: i.onInput, onClick: ai(i.toggleMenu, ["stop"]) }, null, 46, ["id", "onUpdate:modelValue", "name", "disabled", "autocomplete", "readonly", "aria-activedescendant", "aria-controls", "aria-expanded", "aria-label", "onKeydown", "onCompositionstart", "onCompositionupdate", "onCompositionend", "onInput", "onClick"]), [ [bw, i.states.inputValue] ]), i.filterable ? (ge(), Le("span", { key: 0, ref: "calculatorRef", "aria-hidden": "true", class: Re(i.nsSelect.e("input-calculator")), textContent: xt(i.states.inputValue) }, null, 10, ["textContent"])) : Ve("v-if", !0) ], 2)), i.shouldShowPlaceholder ? (ge(), Le("div", { key: 2, class: Re([ i.nsSelect.e("selected-item"), i.nsSelect.e("placeholder"), i.nsSelect.is("transparent", !i.hasModelValue || i.expanded && !i.states.inputValue) ]) }, [ i.hasModelValue ? qe(i.$slots, "label", { key: 0, label: i.currentPlaceholder, value: i.modelValue }, () => [ ke("span", null, xt(i.currentPlaceholder), 1) ]) : (ge(), Le("span", { key: 1 }, xt(i.currentPlaceholder), 1)) ], 2)) : Ve("v-if", !0) ], 2), ke("div", { ref: "suffixRef", class: Re(i.nsSelect.e("suffix")) }, [ i.iconComponent && !i.showClose ? (ge(), Ue(c, { key: 0, class: Re([i.nsSelect.e("caret"), i.nsSelect.e("icon"), i.iconReverse]) }, { default: me(() => [ (ge(), Ue(Ni(i.iconComponent))) ]), _: 1 }, 8, ["class"])) : Ve("v-if", !0), i.showClose && i.clearIcon ? (ge(), Ue(c, { key: 1, class: Re([ i.nsSelect.e("caret"), i.nsSelect.e("icon"), i.nsSelect.e("clear") ]), onClick: i.handleClearClick }, { default: me(() => [ (ge(), Ue(Ni(i.clearIcon))) ]), _: 1 }, 8, ["class", "onClick"])) : Ve("v-if", !0), i.validateState && i.validateIcon ? (ge(), Ue(c, { key: 2, class: Re([i.nsInput.e("icon"), i.nsInput.e("validateIcon")]) }, { default: me(() => [ (ge(), Ue(Ni(i.validateIcon))) ]), _: 1 }, 8, ["class"])) : Ve("v-if", !0) ], 2) ], 10, ["onClick"]) ]; }), content: me(() => [ le(p, { ref: "menuRef" }, { default: me(() => [ i.$slots.header ? (ge(), Le("div", { key: 0, class: Re(i.nsSelect.be("dropdown", "header")), onClick: ai(() => { }, ["stop"]) }, [ qe(i.$slots, "header") ], 10, ["onClick"])) : Ve("v-if", !0), It(le(u, { id: i.contentId, ref: "scrollbarRef", tag: "ul", "wrap-class": i.nsSelect.be("dropdown", "wrap"), "view-class": i.nsSelect.be("dropdown", "list"), class: Re([i.nsSelect.is("empty", i.filteredOptionsCount === 0)]), role: "listbox", "aria-label": i.ariaLabel, "aria-orientation": "vertical" }, { default: me(() => [ i.showNewOption ? (ge(), Ue(l, { key: 0, value: i.states.inputValue, created: !0 }, null, 8, ["value"])) : Ve("v-if", !0), le(h, null, { default: me(() => [ qe(i.$slots, "default") ]), _: 3 }) ]), _: 3 }, 8, ["id", "wrap-class", "view-class", "class", "aria-label"]), [ [fi, i.states.options.size > 0 && !i.loading] ]), i.$slots.loading && i.loading ? (ge(), Le("div", { key: 1, class: Re(i.nsSelect.be("dropdown", "loading")) }, [ qe(i.$slots, "loading") ], 2)) : i.loading || i.filteredOptionsCount === 0 ? (ge(), Le("div", { key: 2, class: Re(i.nsSelect.be("dropdown", "empty")) }, [ qe(i.$slots, "empty", {}, () => [ ke("span", null, xt(i.emptyText), 1) ]) ], 2)) : Ve("v-if", !0), i.$slots.footer ? (ge(), Le("div", { key: 3, class: Re(i.nsSelect.be("dropdown", "footer")), onClick: ai(() => { }, ["stop"]) }, [ qe(i.$slots, "footer") ], 10, ["onClick"])) : Ve("v-if", !0) ]), _: 3 }, 512) ]), _: 3 }, 8, ["visible", "placement", "teleported", "popper-class", "popper-options", "fallback-placements", "effect", "transition", "persistent", "append-to", "onBeforeShow", "onHide"]) ], 16, ["onMouseleave"])), [ [g, i.handleClickOutside, i.popperRef] ]); } var TR = /* @__PURE__ */ ot(MR, [["render", SR], ["__file", "select.vue"]]); const ER = Ie({ name: "ElOptionGroup", componentName: "ElOptionGroup", props: { label: String, disabled: Boolean }, setup(i) { const e = it("select"), t = Ae(null), r = ri(), n = Ae([]); ci(Ey, Xi({ ...ln(i) })); const o = ce(() => n.value.some((l) => l.visible === !0)), a = (l) => { var h, u; return ((h = l.type) == null ? void 0 : h.name) === "ElOption" && !!((u = l.component) != null && u.proxy); }, s = (l) => { const h = Cr(l), u = []; return h.forEach((p) => { var g, m; a(p) ? u.push(p.component.proxy) : (g = p.children) != null && g.length ? u.push(...s(p.children)) : (m = p.component) != null && m.subTree && u.push(...s(p.component.subTree)); }), u; }, c = () => { n.value = s(r.subTree); }; return ei(() => { c(); }), jw(t, c, { attributes: !0, subtree: !0, childList: !0 }), { groupRef: t, visible: o, ns: e }; } }); function AR(i, e, t, r, n, o) { return It((ge(), Le("ul", { ref: "groupRef", class: Re(i.ns.be("group", "wrap")) }, [ ke("li", { class: Re(i.ns.be("group", "title")) }, xt(i.label), 3), ke("li", null, [ ke("ul", { class: Re(i.ns.b("group")) }, [ qe(i.$slots, "default") ], 2) ]) ], 2)), [ [fi, i.visible] ]); } var Ay = /* @__PURE__ */ ot(ER, [["render", AR], ["__file", "option-group.vue"]]); const as = ui(TR, { Option: Bp, OptionGroup: Ay }), ss = mn(Bp); mn(Ay); const CR = ht({ trigger: Js.trigger, placement: rh.placement, disabled: Js.disabled, visible: Wi.visible, transition: Wi.transition, popperOptions: rh.popperOptions, tabindex: rh.tabindex, content: Wi.content, popperStyle: Wi.popperStyle, popperClass: Wi.popperClass, enterable: { ...Wi.enterable, default: !0 }, effect: { ...Wi.effect, default: "light" }, teleported: Wi.teleported, title: String, width: { type: [String, Number], default: 150 }, offset: { type: Number, default: void 0 }, showAfter: { type: Number, default: 0 }, hideAfter: { type: Number, default: 200 }, autoClose: { type: Number, default: 0 }, showArrow: { type: Boolean, default: !0 }, persistent: { type: Boolean, default: !0 }, "onUpdate:visible": { type: Function } }), LR = { "update:visible": (i) => fp(i), "before-enter": () => !0, "before-leave": () => !0, "after-enter": () => !0, "after-leave": () => !0 }, RR = "onUpdate:visible", OR = Ie({ name: "ElPopover" }), PR = /* @__PURE__ */ Ie({ ...OR, props: CR, emits: LR, setup(i, { expose: e, emit: t }) { const r = i, n = ce(() => r[RR]), o = it("popover"), a = Ae(), s = ce(() => { var y; return (y = G(a)) == null ? void 0 : y.popperRef; }), c = ce(() => [ { width: qc(r.width) }, r.popperStyle ]), l = ce(() => [o.b(), r.popperClass, { [o.m("plain")]: !!r.content }]), h = ce(() => r.transition === `${o.namespace.value}-fade-in-linear`), u = () => { var y; (y = a.value) == null || y.hide(); }, p = () => { t("before-enter"); }, g = () => { t("before-leave"); }, m = () => { t("after-enter"); }, d = () => { t("update:visible", !1), t("after-leave"); }; return e({ popperRef: s, hide: u }), (y, f) => (ge(), Ue(G(Np), Or({ ref_key: "tooltipRef", ref: a }, y.$attrs, { trigger: y.trigger, placement: y.placement, disabled: y.disabled, visible: y.visible, transition: y.transition, "popper-options": y.popperOptions, tabindex: y.tabindex, content: y.content, offset: y.offset, "show-after": y.showAfter, "hide-after": y.hideAfter, "auto-close": y.autoClose, "show-arrow": y.showArrow, "aria-label": y.title, effect: y.effect, enterable: y.enterable, "popper-class": G(l), "popper-style": G(c), teleported: y.teleported, persistent: y.persistent, "gpu-acceleration": G(h), "onUpdate:visible": G(n), onBeforeShow: p, onBeforeHide: g, onShow: m, onHide: d }), { content: me(() => [ y.title ? (ge(), Le("div", { key: 0, class: Re(G(o).e("title")), role: "title" }, xt(y.title), 3)) : Ve("v-if", !0), qe(y.$slots, "default", {}, () => [ vt(xt(y.content), 1) ]) ]), default: me(() => [ y.$slots.reference ? qe(y.$slots, "reference", { key: 0 }) : Ve("v-if", !0) ]), _: 3 }, 16, ["trigger", "placement", "disabled", "visible", "transition", "popper-options", "tabindex", "content", "offset", "show-after", "hide-after", "auto-close", "show-arrow", "aria-label", "effect", "enterable", "popper-class", "popper-style", "teleported", "persistent", "gpu-acceleration", "onUpdate:visible"])); } }); var IR = /* @__PURE__ */ ot(PR, [["__file", "popover.vue"]]); const ag = (i, e) => { const t = e.arg || e.value, r = t == null ? void 0 : t.popperRef; r && (r.triggerRef = i); }; var DR = { mounted(i, e) { ag(i, e); }, updated(i, e) { ag(i, e); } }; const NR = "popover", BR = wE(DR, NR), _u = ui(IR, { directive: BR }), Cy = Symbol("sliderContextKey"), kR = ht({ modelValue: { type: Ze([Number, Array]), default: 0 }, id: { type: String, default: void 0 }, min: { type: Number, default: 0 }, max: { type: Number, default: 100 }, step: { type: Number, default: 1 }, showInput: Boolean, showInputControls: { type: Boolean, default: !0 }, size: Da, inputSize: Da, showStops: Boolean, showTooltip: { type: Boolean, default: !0 }, formatTooltip: { type: Ze(Function), default: void 0 }, disabled: Boolean, range: Boolean, vertical: Boolean, height: String, debounce: { type: Number, default: 300 }, rangeStartLabel: { type: String, default: void 0 }, rangeEndLabel: { type: String, default: void 0 }, formatValueText: { type: Ze(Function), default: void 0 }, tooltipClass: { type: String, default: void 0 }, placement: { type: String, values: rs, default: "top" }, marks: { type: Ze(Object) }, validateEvent: { type: Boolean, default: !0 }, ...Ho(["ariaLabel"]) }), nh = (i) => _t(i) || Bi(i) && i.every(_t), zR = { [Pt]: nh, [So]: nh, [Kn]: nh }, FR = (i, e, t) => { const r = Ae(); return ei(async () => { i.range ? (Array.isArray(i.modelValue) ? (e.firstValue = Math.max(i.min, i.modelValue[0]), e.secondValue = Math.min(i.max, i.modelValue[1])) : (e.firstValue = i.min, e.secondValue = i.max), e.oldValue = [e.firstValue, e.secondValue]) : (typeof i.modelValue != "number" || Number.isNaN(i.modelValue) ? e.firstValue = i.min : e.firstValue = Math.min(i.max, Math.max(i.min, i.modelValue)), e.oldValue = e.firstValue), si(window, "resize", t), await wt(), t(); }), { sliderWrapper: r }; }, VR = (i) => ce(() => i.marks ? Object.keys(i.marks).map(Number.parseFloat).sort((e, t) => e - t).filter((e) => e <= i.max && e >= i.min).map((e) => ({ point: e, position: (e - i.min) * 100 / (i.max - i.min), mark: i.marks[e] })) : []), UR = (i, e, t) => { const { form: r, formItem: n } = gl(), o = Ci(), a = Ae(), s = Ae(), c = { firstButton: a, secondButton: s }, l = ce(() => i.disabled || (r == null ? void 0 : r.disabled) || !1), h = ce(() => Math.min(e.firstValue, e.secondValue)), u = ce(() => Math.max(e.firstValue, e.secondValue)), p = ce(() => i.range ? `${100 * (u.value - h.value) / (i.max - i.min)}%` : `${100 * (e.firstValue - i.min) / (i.max - i.min)}%`), g = ce(() => i.range ? `${100 * (h.value - i.min) / (i.max - i.min)}%` : "0%"), m = ce(() => i.vertical ? { height: i.height } : {}), d = ce(() => i.vertical ? { height: p.value, bottom: g.value } : { width: p.value, left: g.value }), y = () => { o.value && (e.sliderSize = o.value[`client${i.vertical ? "Height" : "Width"}`]); }, f = (A) => { const _ = i.min + A * (i.max - i.min) / 100; if (!i.range) return a; let E; return Math.abs(h.value - _) < Math.abs(u.value - _) ? E = e.firstValue < e.secondValue ? "firstButton" : "secondButton" : E = e.firstValue > e.secondValue ? "firstButton" : "secondButton", c[E]; }, v = (A) => { const _ = f(A); return _.value.setPosition(A), _; }, M = (A) => { e.firstValue = A ?? i.min, T(i.range ? [h.value, u.value] : A ?? i.min); }, S = (A) => { e.secondValue = A, i.range && T([h.value, u.value]); }, T = (A) => { t(Pt, A), t(So, A); }, x = async () => { await wt(), t(Kn, i.range ? [h.value, u.value] : i.modelValue); }, w = (A) => { var _, E, O, L, C, I; if (l.value || e.dragging) return; y(); let R = 0; if (i.vertical) { const b = (O = (E = (_ = A.touches) == null ? void 0 : _.item(0)) == null ? void 0 : E.clientY) != null ? O : A.clientY; R = (o.value.getBoundingClientRect().bottom - b) / e.sliderSize * 100; } else { const b = (I = (C = (L = A.touches) == null ? void 0 : L.item(0)) == null ? void 0 : C.clientX) != null ? I : A.clientX, P = o.value.getBoundingClientRect().left; R = (b - P) / e.sliderSize * 100; } if (!(R < 0 || R > 100)) return v(R); }; return { elFormItem: n, slider: o, firstButton: a, secondButton: s, sliderDisabled: l, minValue: h, maxValue: u, runwayStyle: m, barStyle: d, resetSize: y, setPosition: v, emitChange: x, onSliderWrapperPrevent: (A) => { var _, E; ((_ = c.firstButton.value) != null && _.dragging || (E = c.secondButton.value) != null && E.dragging) && A.preventDefault(); }, onSliderClick: (A) => { w(A) && x(); }, onSliderDown: async (A) => { const _ = w(A); _ && (await wt(), _.value.onButtonDown(A)); }, onSliderMarkerDown: (A) => { l.value || e.dragging || v(A); }, setFirstValue: M, setSecondValue: S }; }, { left: GR, down: HR, right: jR, up: WR, home: $R, end: qR, pageUp: XR, pageDown: ZR } = Pr, YR = (i, e, t) => { const r = Ae(), n = Ae(!1), o = ce(() => e.value instanceof Function), a = ce(() => o.value && e.value(i.modelValue) || i.modelValue), s = ad(() => { t.value && (n.value = !0); }, 50), c = ad(() => { t.value && (n.value = !1); }, 50); return { tooltip: r, tooltipVisible: n, formatValue: a, displayTooltip: s, hideTooltip: c }; }, JR = (i, e, t) => { const { disabled: r, min: n, max: o, step: a, showTooltip: s, precision: c, sliderSize: l, formatTooltip: h, emitChange: u, resetSize: p, updateDragging: g } = ct(Cy), { tooltip: m, tooltipVisible: d, formatValue: y, displayTooltip: f, hideTooltip: v } = YR(i, h, s), M = Ae(), S = ce(() => `${(i.modelValue - n.value) / (o.value - n.value) * 100}%`), T = ce(() => i.vertical ? { bottom: S.value } : { left: S.value }), x = () => { e.hovering = !0, f(); }, w = () => { e.hovering = !1, e.dragging || v(); }, A = (q) => { r.value || (q.preventDefault(), N(q), window.addEventListener("mousemove", D), window.addEventListener("touchmove", D), window.addEventListener("mouseup", k), window.addEventListener("touchend", k), window.addEventListener("contextmenu", k), M.value.focus()); }, _ = (q) => { r.value || (e.newPosition = Number.parseFloat(S.value) + q / (o.value - n.value) * 100, V(e.newPosition), u()); }, E = () => { _(-a.value); }, O = () => { _(a.value); }, L = () => { _(-a.value * 4); }, C = () => { _(a.value * 4); }, I = () => { r.value || (V(0), u()); }, R = () => { r.value || (V(100), u()); }, b = (q) => { let Y = !0; [GR, HR].includes(q.key) ? E() : [jR, WR].includes(q.key) ? O() : q.key === $R ? I() : q.key === qR ? R() : q.key === ZR ? L() : q.key === XR ? C() : Y = !1, Y && q.preventDefault(); }, P = (q) => { let Y, ne; return q.type.startsWith("touch") ? (ne = q.touches[0].clientY, Y = q.touches[0].clientX) : (ne = q.clientY, Y = q.clientX), { clientX: Y, clientY: ne }; }, N = (q) => { e.dragging = !0, e.isClick = !0; const { clientX: Y, clientY: ne } = P(q); i.vertical ? e.startY = ne : e.startX = Y, e.startPosition = Number.parseFloat(S.value), e.newPosition = e.startPosition; }, D = (q) => { if (e.dragging) { e.isClick = !1, f(), p(); let Y; const { clientX: ne, clientY: X } = P(q); i.vertical ? (e.currentY = X, Y = (e.startY - e.currentY) / l.value * 100) : (e.currentX = ne, Y = (e.currentX - e.startX) / l.value * 100), e.newPosition = e.startPosition + Y, V(e.newPosition); } }, k = () => { e.dragging && (setTimeout(() => { e.dragging = !1, e.hovering || v(), e.isClick || V(e.newPosition), u(); }, 0), window.removeEventListener("mousemove", D), window.removeEventListener("touchmove", D), window.removeEventListener("mouseup", k), window.removeEventListener("touchend", k), window.removeEventListener("contextmenu", k)); }, V = async (q) => { if (q === null || Number.isNaN(+q)) return; q < 0 ? q = 0 : q > 100 && (q = 100); const Y = 100 / ((o.value - n.value) / a.value); let ne = Math.round(q / Y) * Y * (o.value - n.value) * 0.01 + n.value; ne = Number.parseFloat(ne.toFixed(c.value)), ne !== i.modelValue && t(Pt, ne), !e.dragging && i.modelValue !== e.oldValue && (e.oldValue = i.modelValue), await wt(), e.dragging && f(), m.value.updatePopper(); }; return Ke(() => e.dragging, (q) => { g(q); }), si(M, "touchstart", A, { passive: !1 }), { disabled: r, button: M, tooltip: m, tooltipVisible: d, showTooltip: s, wrapperStyle: T, formatValue: y, handleMouseEnter: x, handleMouseLeave: w, onButtonDown: A, onKeyDown: b, setPosition: V }; }, KR = (i, e, t, r) => ({ stops: ce(() => { if (!i.showStops || i.min > i.max) return []; if (i.step === 0) return Zt("ElSlider", "step should not be 0."), []; const n = (i.max - i.min) / i.step, o = 100 * i.step / (i.max - i.min), a = Array.from({ length: n - 1 }).map((s, c) => (c + 1) * o); return i.range ? a.filter((s) => s < 100 * (t.value - i.min) / (i.max - i.min) || s > 100 * (r.value - i.min) / (i.max - i.min)) : a.filter((s) => s > 100 * (e.firstValue - i.min) / (i.max - i.min)); }), getStopStyle: (n) => i.vertical ? { bottom: `${n}%` } : { left: `${n}%` } }), QR = (i, e, t, r, n, o) => { const a = (l) => { n(Pt, l), n(So, l); }, s = () => i.range ? ![t.value, r.value].every((l, h) => l === e.oldValue[h]) : i.modelValue !== e.oldValue, c = () => { var l, h; i.min > i.max && is("Slider", "min should not be greater than max."); const u = i.modelValue; i.range && Array.isArray(u) ? u[1] < i.min ? a([i.min, i.min]) : u[0] > i.max ? a([i.max, i.max]) : u[0] < i.min ? a([i.min, u[1]]) : u[1] > i.max ? a([u[0], i.max]) : (e.firstValue = u[0], e.secondValue = u[1], s() && (i.validateEvent && ((l = o == null ? void 0 : o.validate) == null || l.call(o, "change").catch((p) => Zt(p))), e.oldValue = u.slice())) : !i.range && typeof u == "number" && !Number.isNaN(u) && (u < i.min ? a(i.min) : u > i.max ? a(i.max) : (e.firstValue = u, s() && (i.validateEvent && ((h = o == null ? void 0 : o.validate) == null || h.call(o, "change").catch((p) => Zt(p))), e.oldValue = u))); }; c(), Ke(() => e.dragging, (l) => { l || c(); }), Ke(() => i.modelValue, (l, h) => { e.dragging || Array.isArray(l) && Array.isArray(h) && l.every((u, p) => u === h[p]) && e.firstValue === l[0] && e.secondValue === l[1] || c(); }, { deep: !0 }), Ke(() => [i.min, i.max], () => { c(); }); }, e3 = ht({ modelValue: { type: Number, default: 0 }, vertical: Boolean, tooltipClass: String, placement: { type: String, values: rs, default: "top" } }), t3 = { [Pt]: (i) => _t(i) }, i3 = Ie({ name: "ElSliderButton" }), r3 = /* @__PURE__ */ Ie({ ...i3, props: e3, emits: t3, setup(i, { expose: e, emit: t }) { const r = i, n = it("slider"), o = Xi({ hovering: !1, dragging: !1, isClick: !1, startX: 0, currentX: 0, startY: 0, currentY: 0, startPosition: 0, newPosition: 0, oldValue: r.modelValue }), { disabled: a, button: s, tooltip: c, showTooltip: l, tooltipVisible: h, wrapperStyle: u, formatValue: p, handleMouseEnter: g, handleMouseLeave: m, onButtonDown: d, onKeyDown: y, setPosition: f } = JR(r, o, t), { hovering: v, dragging: M } = ln(o); return e({ onButtonDown: d, onKeyDown: y, setPosition: f, hovering: v, dragging: M }), (S, T) => (ge(), Le("div", { ref_key: "button", ref: s, class: Re([G(n).e("button-wrapper"), { hover: G(v), dragging: G(M) }]), style: Ot(G(u)), tabindex: G(a) ? -1 : 0, onMouseenter: G(g), onMouseleave: G(m), onMousedown: G(d), onFocus: G(g), onBlur: G(m), onKeydown: G(y) }, [ le(G(Np), { ref_key: "tooltip", ref: c, visible: G(h), placement: S.placement, "fallback-placements": ["top", "bottom", "right", "left"], "stop-popper-mouse-event": !1, "popper-class": S.tooltipClass, disabled: !G(l), persistent: "" }, { content: me(() => [ ke("span", null, xt(G(p)), 1) ]), default: me(() => [ ke("div", { class: Re([G(n).e("button"), { hover: G(v), dragging: G(M) }]) }, null, 2) ]), _: 1 }, 8, ["visible", "placement", "popper-class", "disabled"]) ], 46, ["tabindex", "onMouseenter", "onMouseleave", "onMousedown", "onFocus", "onBlur", "onKeydown"])); } }); var sg = /* @__PURE__ */ ot(r3, [["__file", "button.vue"]]); const n3 = ht({ mark: { type: Ze([String, Object]), default: void 0 } }); var o3 = Ie({ name: "ElSliderMarker", props: n3, setup(i) { const e = it("slider"), t = ce(() => Li(i.mark) ? i.mark : i.mark.label), r = ce(() => Li(i.mark) ? void 0 : i.mark.style); return () => ba("div", { class: e.e("marks-text"), style: r.value }, t.value); } }); const a3 = Ie({ name: "ElSlider" }), s3 = /* @__PURE__ */ Ie({ ...a3, props: kR, emits: zR, setup(i, { expose: e, emit: t }) { const r = i, n = it("slider"), { t: o } = mu(), a = Xi({ firstValue: 0, secondValue: 0, oldValue: 0, dragging: !1, sliderSize: 1 }), { elFormItem: s, slider: c, firstButton: l, secondButton: h, sliderDisabled: u, minValue: p, maxValue: g, runwayStyle: m, barStyle: d, resetSize: y, emitChange: f, onSliderWrapperPrevent: v, onSliderClick: M, onSliderDown: S, onSliderMarkerDown: T, setFirstValue: x, setSecondValue: w } = UR(r, a, t), { stops: A, getStopStyle: _ } = KR(r, a, p, g), { inputId: E, isLabeledByFormItem: O } = Lp(r, { formItemContext: s }), L = ns(), C = ce(() => r.inputSize || L.value), I = ce(() => r.ariaLabel || o("el.slider.defaultLabel", { min: r.min, max: r.max })), R = ce(() => r.range ? r.rangeStartLabel || o("el.slider.defaultRangeStartLabel") : I.value), b = ce(() => r.formatValueText ? r.formatValueText(Y.value) : `${Y.value}`), P = ce(() => r.rangeEndLabel || o("el.slider.defaultRangeEndLabel")), N = ce(() => r.formatValueText ? r.formatValueText(ne.value) : `${ne.value}`), D = ce(() => [ n.b(), n.m(L.value), n.is("vertical", r.vertical), { [n.m("with-input")]: r.showInput } ]), k = VR(r); QR(r, a, p, g, t, s); const V = ce(() => { const H = [r.min, r.max, r.step].map((ee) => { const Q = `${ee}`.split(".")[1]; return Q ? Q.length : 0; }); return Math.max.apply(null, H); }), { sliderWrapper: q } = FR(r, a, y), { firstValue: Y, secondValue: ne, sliderSize: X } = ln(a), z = (H) => { a.dragging = H; }; return si(q, "touchstart", v, { passive: !1 }), si(q, "touchmove", v, { passive: !1 }), ci(Cy, { ...ln(r), sliderSize: X, disabled: u, precision: V, emitChange: f, resetSize: y, updateDragging: z }), e({ onSliderClick: M }), (H, ee) => { var Q, J; return ge(), Le("div", { id: H.range ? G(E) : void 0, ref_key: "sliderWrapper", ref: q, class: Re(G(D)), role: H.range ? "group" : void 0, "aria-label": H.range && !G(O) ? G(I) : void 0, "aria-labelledby": H.range && G(O) ? (Q = G(s)) == null ? void 0 : Q.labelId : void 0 }, [ ke("div", { ref_key: "slider", ref: c, class: Re([ G(n).e("runway"), { "show-input": H.showInput && !H.range }, G(n).is("disabled", G(u)) ]), style: Ot(G(m)), onMousedown: G(S), onTouchstartPassive: G(S) }, [ ke("div", { class: Re(G(n).e("bar")), style: Ot(G(d)) }, null, 6), le(sg, { id: H.range ? void 0 : G(E), ref_key: "firstButton", ref: l, "model-value": G(Y), vertical: H.vertical, "tooltip-class": H.tooltipClass, placement: H.placement, role: "slider", "aria-label": H.range || !G(O) ? G(R) : void 0, "aria-labelledby": !H.range && G(O) ? (J = G(s)) == null ? void 0 : J.labelId : void 0, "aria-valuemin": H.min, "aria-valuemax": H.range ? G(ne) : H.max, "aria-valuenow": G(Y), "aria-valuetext": G(b), "aria-orientation": H.vertical ? "vertical" : "horizontal", "aria-disabled": G(u), "onUpdate:modelValue": G(x) }, null, 8, ["id", "model-value", "vertical", "tooltip-class", "placement", "aria-label", "aria-labelledby", "aria-valuemin", "aria-valuemax", "aria-valuenow", "aria-valuetext", "aria-orientation", "aria-disabled", "onUpdate:modelValue"]), H.range ? (ge(), Ue(sg, { key: 0, ref_key: "secondButton", ref: h, "model-value": G(ne), vertical: H.vertical, "tooltip-class": H.tooltipClass, placement: H.placement, role: "slider", "aria-label": G(P), "aria-valuemin": G(Y), "aria-valuemax": H.max, "aria-valuenow": G(ne), "aria-valuetext": G(N), "aria-orientation": H.vertical ? "vertical" : "horizontal", "aria-disabled": G(u), "onUpdate:modelValue": G(w) }, null, 8, ["model-value", "vertical", "tooltip-class", "placement", "aria-label", "aria-valuemin", "aria-valuemax", "aria-valuenow", "aria-valuetext", "aria-orientation", "aria-disabled", "onUpdate:modelValue"])) : Ve("v-if", !0), H.showStops ? (ge(), Le("div", { key: 1 }, [ (ge(!0), Le(Vt, null, tr(G(A), (W, K) => (ge(), Le("div", { key: K, class: Re(G(n).e("stop")), style: Ot(G(_)(W)) }, null, 6))), 128)) ])) : Ve("v-if", !0), G(k).length > 0 ? (ge(), Le(Vt, { key: 2 }, [ ke("div", null, [ (ge(!0), Le(Vt, null, tr(G(k), (W, K) => (ge(), Le("div", { key: K, style: Ot(G(_)(W.position)), class: Re([G(n).e("stop"), G(n).e("marks-stop")]) }, null, 6))), 128)) ]), ke("div", { class: Re(G(n).e("marks")) }, [ (ge(!0), Le(Vt, null, tr(G(k), (W, K) => (ge(), Ue(G(o3), { key: K, mark: W.mark, style: Ot(G(_)(W.position)), onMousedown: ai((ie) => G(T)(W.position), ["stop"]) }, null, 8, ["mark", "style", "onMousedown"]))), 128)) ], 2) ], 64)) : Ve("v-if", !0) ], 46, ["onMousedown", "onTouchstartPassive"]), H.showInput && !H.range ? (ge(), Ue(G(vn), { key: 0, ref: "input", "model-value": G(Y), class: Re(G(n).e("input")), step: H.step, disabled: G(u), controls: H.showInputControls, min: H.min, max: H.max, precision: G(V), debounce: H.debounce, size: G(C), "onUpdate:modelValue": G(x), onChange: G(f) }, null, 8, ["model-value", "class", "step", "disabled", "controls", "min", "max", "precision", "debounce", "size", "onUpdate:modelValue", "onChange"])) : Ve("v-if", !0) ], 10, ["id", "role", "aria-label", "aria-labelledby"]); }; } }); var l3 = /* @__PURE__ */ ot(s3, [["__file", "slider.vue"]]); const ar = ui(l3), Mu = Symbol("tabsRootContextKey"), c3 = ht({ tabs: { type: Ze(Array), default: () => Qr([]) } }), Ly = "ElTabBar", u3 = Ie({ name: Ly }), h3 = /* @__PURE__ */ Ie({ ...u3, props: c3, setup(i, { expose: e }) { const t = i, r = ri(), n = ct(Mu); n || is(Ly, ""); const o = it("tabs"), a = Ae(), s = Ae(), c = () => { let g = 0, m = 0; const d = ["top", "bottom"].includes(n.props.tabPosition) ? "width" : "height", y = d === "width" ? "x" : "y", f = y === "x" ? "left" : "top"; return t.tabs.every((v) => { var M, S; const T = (S = (M = r.parent) == null ? void 0 : M.refs) == null ? void 0 : S[`tab-${v.uid}`]; if (!T) return !1; if (!v.active) return !0; g = T[`offset${Bn(f)}`], m = T[`client${Bn(d)}`]; const x = window.getComputedStyle(T); return d === "width" && (m -= Number.parseFloat(x.paddingLeft) + Number.parseFloat(x.paddingRight), g += Number.parseFloat(x.paddingLeft)), !1; }), { [d]: `${m}px`, transform: `translate${Bn(y)}(${g}px)` }; }, l = () => s.value = c(), h = [], u = () => { var g; h.forEach((d) => d.stop()), h.length = 0; const m = (g = r.parent) == null ? void 0 : g.refs; if (m) { for (const d in m) if (d.startsWith("tab-")) { const y = m[d]; y && h.push(er(y, l)); } } }; Ke(() => t.tabs, async () => { await wt(), l(), u(); }, { immediate: !0 }); const p = er(a, () => l()); return or(() => { h.forEach((g) => g.stop()), h.length = 0, p.stop(); }), e({ ref: a, update: l }), (g, m) => (ge(), Le("div", { ref_key: "barRef", ref: a, class: Re([G(o).e("active-bar"), G(o).is(G(n).props.tabPosition)]), style: Ot(s.value) }, null, 6)); } }); var d3 = /* @__PURE__ */ ot(h3, [["__file", "tab-bar.vue"]]); const p3 = ht({ panes: { type: Ze(Array), default: () => Qr([]) }, currentName: { type: [String, Number], default: "" }, editable: Boolean, type: { type: String, values: ["card", "border-card", ""], default: "" }, stretch: Boolean }), f3 = { tabClick: (i, e, t) => t instanceof Event, tabRemove: (i, e) => e instanceof Event }, lg = "ElTabNav", m3 = Ie({ name: lg, props: p3, emits: f3, setup(i, { expose: e, emit: t }) { const r = ct(Mu); r || is(lg, ""); const n = it("tabs"), o = kw(), a = Yw(), s = Ae(), c = Ae(), l = Ae(), h = Ae(), u = Ae(!1), p = Ae(0), g = Ae(!1), m = Ae(!0), d = ce(() => ["top", "bottom"].includes(r.props.tabPosition) ? "width" : "height"), y = ce(() => ({ transform: `translate${d.value === "width" ? "X" : "Y"}(-${p.value}px)` })), f = () => { if (!s.value) return; const A = s.value[`offset${Bn(d.value)}`], _ = p.value; if (!_) return; const E = _ > A ? _ - A : 0; p.value = E; }, v = () => { if (!s.value || !c.value) return; const A = c.value[`offset${Bn(d.value)}`], _ = s.value[`offset${Bn(d.value)}`], E = p.value; if (A - E <= _) return; const O = A - E > _ * 2 ? E + _ : A - _; p.value = O; }, M = async () => { const A = c.value; if (!u.value || !l.value || !s.value || !A) return; await wt(); const _ = l.value.querySelector(".is-active"); if (!_) return; const E = s.value, O = ["top", "bottom"].includes(r.props.tabPosition), L = _.getBoundingClientRect(), C = E.getBoundingClientRect(), I = O ? A.offsetWidth - C.width : A.offsetHeight - C.height, R = p.value; let b = R; O ? (L.left < C.left && (b = R - (C.left - L.left)), L.right > C.right && (b = R + L.right - C.right)) : (L.top < C.top && (b = R - (C.top - L.top)), L.bottom > C.bottom && (b = R + (L.bottom - C.bottom))), b = Math.max(b, 0), p.value = Math.min(b, I); }, S = () => { var A; if (!c.value || !s.value) return; i.stretch && ((A = h.value) == null || A.update()); const _ = c.value[`offset${Bn(d.value)}`], E = s.value[`offset${Bn(d.value)}`], O = p.value; E < _ ? (u.value = u.value || {}, u.value.prev = O, u.value.next = O + E < _, _ - O < E && (p.value = _ - E)) : (u.value = !1, O > 0 && (p.value = 0)); }, T = (A) => { const _ = A.code, { up: E, down: O, left: L, right: C } = Pr; if (![E, O, L, C].includes(_)) return; const I = Array.from(A.currentTarget.querySelectorAll("[role=tab]:not(.is-disabled)")), R = I.indexOf(A.target); let b; _ === L || _ === E ? R === 0 ? b = I.length - 1 : b = R - 1 : R < I.length - 1 ? b = R + 1 : b = 0, I[b].focus({ preventScroll: !0 }), I[b].click(), x(); }, x = () => { m.value && (g.value = !0); }, w = () => g.value = !1; return Ke(o, (A) => { A === "hidden" ? m.value = !1 : A === "visible" && setTimeout(() => m.value = !0, 50); }), Ke(a, (A) => { A ? setTimeout(() => m.value = !0, 50) : m.value = !1; }), er(l, S), ei(() => setTimeout(() => M(), 0)), rp(() => S()), e({ scrollToActiveTab: M, removeFocus: w }), () => { const A = u.value ? [le("span", { class: [n.e("nav-prev"), n.is("disabled", !u.value.prev)], onClick: f }, [le(Dt, null, { default: () => [le(jn, null, null)] })]), le("span", { class: [n.e("nav-next"), n.is("disabled", !u.value.next)], onClick: v }, [le(Dt, null, { default: () => [le(Wn, null, null)] })])] : null, _ = i.panes.map((E, O) => { var L, C, I, R; const b = E.uid, P = E.props.disabled, N = (C = (L = E.props.name) != null ? L : E.index) != null ? C : `${O}`, D = !P && (E.isClosable || i.editable); E.index = `${O}`; const k = D ? le(Dt, { class: "is-icon-close", onClick: (Y) => t("tabRemove", E, Y) }, { default: () => [le(ld, null, null)] }) : null, V = ((R = (I = E.slots).label) == null ? void 0 : R.call(I)) || E.props.label, q = !P && E.active ? 0 : -1; return le("div", { ref: `tab-${b}`, class: [n.e("item"), n.is(r.props.tabPosition), n.is("active", E.active), n.is("disabled", P), n.is("closable", D), n.is("focus", g.value)], id: `tab-${N}`, key: `tab-${b}`, "aria-controls": `pane-${N}`, role: "tab", "aria-selected": E.active, tabindex: q, onFocus: () => x(), onBlur: () => w(), onClick: (Y) => { w(), t("tabClick", E, N, Y); }, onKeydown: (Y) => { D && (Y.code === Pr.delete || Y.code === Pr.backspace) && t("tabRemove", E, Y); } }, [V, k]); }); return le("div", { ref: l, class: [n.e("nav-wrap"), n.is("scrollable", !!u.value), n.is(r.props.tabPosition)] }, [A, le("div", { class: n.e("nav-scroll"), ref: s }, [le("div", { class: [n.e("nav"), n.is(r.props.tabPosition), n.is("stretch", i.stretch && ["top", "bottom"].includes(r.props.tabPosition))], ref: c, style: y.value, role: "tablist", onKeydown: T }, [i.type ? null : le(d3, { ref: h, tabs: [...i.panes] }, null), _])])]); }; } }), g3 = ht({ type: { type: String, values: ["card", "border-card", ""], default: "" }, closable: Boolean, addable: Boolean, modelValue: { type: [String, Number] }, editable: Boolean, tabPosition: { type: String, values: ["top", "right", "bottom", "left"], default: "top" }, beforeLeave: { type: Ze(Function), default: () => !0 }, stretch: Boolean }), oh = (i) => Li(i) || _t(i), v3 = { [Pt]: (i) => oh(i), tabClick: (i, e) => e instanceof Event, tabChange: (i) => oh(i), edit: (i, e) => ["remove", "add"].includes(e), tabRemove: (i) => oh(i), tabAdd: () => !0 }, y3 = Ie({ name: "ElTabs", props: g3, emits: v3, setup(i, { emit: e, slots: t, expose: r }) { var n; const o = it("tabs"), a = ce(() => ["left", "right"].includes(i.tabPosition)), { children: s, addChild: c, removeChild: l } = ZA(ri(), "ElTabPane"), h = Ae(), u = Ae((n = i.modelValue) != null ? n : "0"), p = async (f, v = !1) => { var M, S, T; if (!(u.value === f || gr(f))) try { await ((M = i.beforeLeave) == null ? void 0 : M.call(i, f, u.value)) !== !1 && (u.value = f, v && (e(Pt, f), e("tabChange", f)), (T = (S = h.value) == null ? void 0 : S.removeFocus) == null || T.call(S)); } catch { } }, g = (f, v, M) => { f.props.disabled || (p(v, !0), e("tabClick", f, M)); }, m = (f, v) => { f.props.disabled || gr(f.props.name) || (v.stopPropagation(), e("edit", f.props.name, "remove"), e("tabRemove", f.props.name)); }, d = () => { e("edit", void 0, "add"), e("tabAdd"); }; Ke(() => i.modelValue, (f) => p(f)), Ke(u, async () => { var f; await wt(), (f = h.value) == null || f.scrollToActiveTab(); }), ci(Mu, { props: i, currentName: u, registerPane: (f) => { s.value.push(f); }, sortPane: c, unregisterPane: l }), r({ currentName: u }); const y = ({ render: f }) => f(); return () => { const f = t["add-icon"], v = i.editable || i.addable ? le("div", { class: [o.e("new-tab"), a.value && o.e("new-tab-vertical")], tabindex: "0", onClick: d, onKeydown: (T) => { T.code === Pr.enter && d(); } }, [f ? qe(t, "add-icon") : le(Dt, { class: o.is("icon-plus") }, { default: () => [le(pu, null, null)] })]) : null, M = le("div", { class: [o.e("header"), a.value && o.e("header-vertical"), o.is(i.tabPosition)] }, [le(y, { render: () => { const T = s.value.some((x) => x.slots.label); return le(m3, { ref: h, currentName: u.value, editable: i.editable, type: i.type, panes: s.value, stretch: i.stretch, onTabClick: g, onTabRemove: m }, { $stable: !T }); } }, null), v]), S = le("div", { class: o.e("content") }, [qe(t, "default")]); return le("div", { class: [o.b(), o.m(i.tabPosition), { [o.m("card")]: i.type === "card", [o.m("border-card")]: i.type === "border-card" }] }, [S, M]); }; } }), b3 = ht({ label: { type: String, default: "" }, name: { type: [String, Number] }, closable: Boolean, disabled: Boolean, lazy: Boolean }), Ry = "ElTabPane", x3 = Ie({ name: Ry }), w3 = /* @__PURE__ */ Ie({ ...x3, props: b3, setup(i) { const e = i, t = ri(), r = au(), n = ct(Mu); n || is(Ry, "usage: "); const o = it("tab-pane"), a = Ae(), s = ce(() => e.closable || n.props.closable), c = Hf(() => { var g; return n.currentName.value === ((g = e.name) != null ? g : a.value); }), l = Ae(c.value), h = ce(() => { var g; return (g = e.name) != null ? g : a.value; }), u = Hf(() => !e.lazy || l.value || c.value); Ke(c, (g) => { g && (l.value = !0); }); const p = Xi({ uid: t.uid, slots: r, props: e, paneName: h, active: c, index: a, isClosable: s }); return n.registerPane(p), ei(() => { n.sortPane(p); }), s0(() => { n.unregisterPane(p.uid); }), (g, m) => G(u) ? It((ge(), Le("div", { key: 0, id: `pane-${G(h)}`, class: Re(G(o).b()), role: "tabpanel", "aria-hidden": !G(c), "aria-labelledby": `tab-${G(h)}` }, [ qe(g.$slots, "default") ], 10, ["id", "aria-hidden", "aria-labelledby"])), [ [fi, G(c)] ]) : Ve("v-if", !0); } }); var Oy = /* @__PURE__ */ ot(w3, [["__file", "tab-pane.vue"]]); const Py = ui(y3, { TabPane: Oy }), Iy = mn(Oy); function _3(i) { let e; const t = Ae(!1), r = Xi({ ...i, originalPosition: "", originalOverflow: "", visible: !1 }); function n(p) { r.text = p; } function o() { const p = r.parent, g = u.ns; if (!p.vLoadingAddClassList) { let m = p.getAttribute("loading-number"); m = Number.parseInt(m) - 1, m ? p.setAttribute("loading-number", m.toString()) : ($c(p, g.bm("parent", "relative")), p.removeAttribute("loading-number")), $c(p, g.bm("parent", "hidden")); } a(), h.unmount(); } function a() { var p, g; (g = (p = u.$el) == null ? void 0 : p.parentNode) == null || g.removeChild(u.$el); } function s() { var p; i.beforeClose && !i.beforeClose() || (t.value = !0, clearTimeout(e), e = setTimeout(c, 400), r.visible = !1, (p = i.closed) == null || p.call(i)); } function c() { if (!t.value) return; const p = r.parent; t.value = !1, p.vLoadingAddClassList = void 0, o(); } const l = Ie({ name: "ElLoading", setup(p, { expose: g }) { const { ns: m, zIndex: d } = r2("loading"); return g({ ns: m, zIndex: d }), () => { const y = r.spinner || r.svg, f = ba("svg", { class: "circular", viewBox: r.svgViewBox ? r.svgViewBox : "0 0 50 50", ...y ? { innerHTML: y } : {} }, [ ba("circle", { class: "path", cx: "25", cy: "25", r: "20", fill: "none" }) ]), v = r.text ? ba("p", { class: m.b("text") }, [r.text]) : void 0; return ba(hl, { name: m.b("fade"), onAfterLeave: c }, { default: me(() => [ It(le("div", { style: { backgroundColor: r.background || "" }, class: [ m.b("mask"), r.customClass, r.fullscreen ? "is-fullscreen" : "" ] }, [ ba("div", { class: m.b("spinner") }, [f, v]) ]), [[fi, r.visible]]) ]) }); }; } }), h = xw(l), u = h.mount(document.createElement("div")); return { ...ln(r), setText: n, removeElLoadingChild: a, close: s, handleAfterLeave: c, vm: u, get $el() { return u.$el; } }; } let Gl; const md = function(i = {}) { if (!Kt) return; const e = M3(i); if (e.fullscreen && Gl) return Gl; const t = _3({ ...e, closed: () => { var n; (n = e.closed) == null || n.call(e), e.fullscreen && (Gl = void 0); } }); S3(e, e.parent, t), cg(e, e.parent, t), e.parent.vLoadingAddClassList = () => cg(e, e.parent, t); let r = e.parent.getAttribute("loading-number"); return r ? r = `${Number.parseInt(r) + 1}` : r = "1", e.parent.setAttribute("loading-number", r), e.parent.appendChild(t.$el), wt(() => t.visible.value = e.visible), e.fullscreen && (Gl = t), t; }, M3 = (i) => { var e, t, r, n; let o; return Li(i.target) ? o = (e = document.querySelector(i.target)) != null ? e : document.body : o = i.target || document.body, { parent: o === document.body || i.body ? document.body : o, background: i.background || "", svg: i.svg || "", svgViewBox: i.svgViewBox || "", spinner: i.spinner || !1, text: i.text || "", fullscreen: o === document.body && ((t = i.fullscreen) != null ? t : !0), lock: (r = i.lock) != null ? r : !1, customClass: i.customClass || "", visible: (n = i.visible) != null ? n : !0, beforeClose: i.beforeClose, closed: i.closed, target: o }; }, S3 = async (i, e, t) => { const { nextZIndex: r } = t.vm.zIndex || t.vm._.exposed.zIndex, n = {}; if (i.fullscreen) t.originalPosition.value = vs(document.body, "position"), t.originalOverflow.value = vs(document.body, "overflow"), n.zIndex = r(); else if (i.parent === document.body) { t.originalPosition.value = vs(document.body, "position"), await wt(); for (const o of ["top", "left"]) { const a = o === "top" ? "scrollTop" : "scrollLeft"; n[o] = `${i.target.getBoundingClientRect()[o] + document.body[a] + document.documentElement[a] - Number.parseInt(vs(document.body, `margin-${o}`), 10)}px`; } for (const o of ["height", "width"]) n[o] = `${i.target.getBoundingClientRect()[o]}px`; } else t.originalPosition.value = vs(e, "position"); for (const [o, a] of Object.entries(n)) t.$el.style[o] = a; }, cg = (i, e, t) => { const r = t.vm.ns || t.vm._.exposed.ns; ["absolute", "fixed", "sticky"].includes(t.originalPosition.value) ? $c(e, r.bm("parent", "relative")) : Em(e, r.bm("parent", "relative")), i.fullscreen && i.lock ? Em(e, r.bm("parent", "hidden")) : $c(e, r.bm("parent", "hidden")); }, Fc = Symbol("ElLoading"), ug = (i, e) => { var t, r, n, o; const a = e.instance, s = (p) => Ai(e.value) ? e.value[p] : void 0, c = (p) => { const g = Li(p) && (a == null ? void 0 : a[p]) || p; return g && Ae(g); }, l = (p) => c(s(p) || i.getAttribute(`element-loading-${n_(p)}`)), h = (t = s("fullscreen")) != null ? t : e.modifiers.fullscreen, u = { text: l("text"), svg: l("svg"), svgViewBox: l("svgViewBox"), spinner: l("spinner"), background: l("background"), customClass: l("customClass"), fullscreen: h, target: (r = s("target")) != null ? r : h ? void 0 : i, body: (n = s("body")) != null ? n : e.modifiers.body, lock: (o = s("lock")) != null ? o : e.modifiers.lock }; i[Fc] = { options: u, instance: md(u) }; }, T3 = (i, e) => { for (const t of Object.keys(e)) Ro(e[t]) && (e[t].value = i[t]); }, gd = { mounted(i, e) { e.value && ug(i, e); }, updated(i, e) { const t = i[Fc]; e.oldValue !== e.value && (e.value && !e.oldValue ? ug(i, e) : e.value && e.oldValue ? Ai(e.value) && T3(e.value, t.options) : t == null || t.instance.close()); }, unmounted(i) { var e; (e = i[Fc]) == null || e.instance.close(), i[Fc] = null; } }, E3 = { install(i) { i.directive("loading", gd), i.config.globalProperties.$loading = md; }, directive: gd, service: md }; var Dy = { exports: {} }, A3 = {}, hg; function C3() { return hg || (hg = 1, function(i) { var e = function() { try { return !!Symbol.iterator; } catch { return !1; } }, t = e(), r = function(l) { var h = { next: function() { var u = l.shift(); return { done: u === void 0, value: u }; } }; return t && (h[Symbol.iterator] = function() { return h; }), h; }, n = function(l) { return encodeURIComponent(l).replace(/%20/g, "+"); }, o = function(l) { return decodeURIComponent(String(l).replace(/\+/g, " ")); }, a = function() { var l = function(u) { Object.defineProperty(this, "_entries", { writable: !0, value: {} }); var p = typeof u; if (p !== "undefined") if (p === "string") u !== "" && this._fromString(u); else if (u instanceof l) { var g = this; u.forEach(function(f, v) { g.append(v, f); }); } else if (u !== null && p === "object") if (Object.prototype.toString.call(u) === "[object Array]") for (var m = 0; m < u.length; m++) { var d = u[m]; if (Object.prototype.toString.call(d) === "[object Array]" || d.length !== 2) this.append(d[0], d[1]); else throw new TypeError("Expected [string, any] as entry at index " + m + " of URLSearchParams's input"); } else for (var y in u) u.hasOwnProperty(y) && this.append(y, u[y]); else throw new TypeError("Unsupported input's type for URLSearchParams"); }, h = l.prototype; h.append = function(u, p) { u in this._entries ? this._entries[u].push(String(p)) : this._entries[u] = [String(p)]; }, h.delete = function(u) { delete this._entries[u]; }, h.get = function(u) { return u in this._entries ? this._entries[u][0] : null; }, h.getAll = function(u) { return u in this._entries ? this._entries[u].slice(0) : []; }, h.has = function(u) { return u in this._entries; }, h.set = function(u, p) { this._entries[u] = [String(p)]; }, h.forEach = function(u, p) { var g; for (var m in this._entries) if (this._entries.hasOwnProperty(m)) { g = this._entries[m]; for (var d = 0; d < g.length; d++) u.call(p, g[d], m, this); } }, h.keys = function() { var u = []; return this.forEach(function(p, g) { u.push(g); }), r(u); }, h.values = function() { var u = []; return this.forEach(function(p) { u.push(p); }), r(u); }, h.entries = function() { var u = []; return this.forEach(function(p, g) { u.push([g, p]); }), r(u); }, t && (h[Symbol.iterator] = h.entries), h.toString = function() { var u = []; return this.forEach(function(p, g) { u.push(n(g) + "=" + n(p)); }), u.join("&"); }, i.URLSearchParams = l; }, s = function() { try { var l = i.URLSearchParams; return new l("?a=1").toString() === "a=1" && typeof l.prototype.set == "function" && typeof l.prototype.entries == "function"; } catch { return !1; } }; s() || a(); var c = i.URLSearchParams.prototype; typeof c.sort != "function" && (c.sort = function() { var l = this, h = []; this.forEach(function(p, g) { h.push([g, p]), l._entries || l.delete(g); }), h.sort(function(p, g) { return p[0] < g[0] ? -1 : p[0] > g[0] ? 1 : 0; }), l._entries && (l._entries = {}); for (var u = 0; u < h.length; u++) this.append(h[u][0], h[u][1]); }), typeof c._fromString != "function" && Object.defineProperty(c, "_fromString", { enumerable: !1, configurable: !1, writable: !1, value: function(l) { if (this._entries) this._entries = {}; else { var h = []; this.forEach(function(m, d) { h.push(d); }); for (var u = 0; u < h.length; u++) this.delete(h[u]); } l = l.replace(/^\?/, ""); for (var p = l.split("&"), g, u = 0; u < p.length; u++) g = p[u].split("="), this.append( o(g[0]), g.length > 1 ? o(g[1]) : "" ); } }); }( typeof Nn < "u" ? Nn : typeof window < "u" ? window : typeof self < "u" ? self : Nn ), function(i) { var e = function() { try { var n = new i.URL("b", "http://a"); return n.pathname = "c d", n.href === "http://a/c%20d" && n.searchParams; } catch { return !1; } }, t = function() { var n = i.URL, o = function(c, l) { typeof c != "string" && (c = String(c)), l && typeof l != "string" && (l = String(l)); var h = document, u; if (l && (i.location === void 0 || l !== i.location.href)) { l = l.toLowerCase(), h = document.implementation.createHTMLDocument(""), u = h.createElement("base"), u.href = l, h.head.appendChild(u); try { if (u.href.indexOf(l) !== 0) throw new Error(u.href); } catch (M) { throw new Error("URL unable to set base " + l + " due to " + M); } } var p = h.createElement("a"); p.href = c, u && (h.body.appendChild(p), p.href = p.href); var g = h.createElement("input"); if (g.type = "url", g.value = c, p.protocol === ":" || !/:/.test(p.href) || !g.checkValidity() && !l) throw new TypeError("Invalid URL"); Object.defineProperty(this, "_anchorElement", { value: p }); var m = new i.URLSearchParams(this.search), d = !0, y = !0, f = this; ["append", "delete", "set"].forEach(function(M) { var S = m[M]; m[M] = function() { S.apply(m, arguments), d && (y = !1, f.search = m.toString(), y = !0); }; }), Object.defineProperty(this, "searchParams", { value: m, enumerable: !0 }); var v = void 0; Object.defineProperty(this, "_updateSearchParams", { enumerable: !1, configurable: !1, writable: !1, value: function() { this.search !== v && (v = this.search, y && (d = !1, this.searchParams._fromString(this.search), d = !0)); } }); }, a = o.prototype, s = function(c) { Object.defineProperty(a, c, { get: function() { return this._anchorElement[c]; }, set: function(l) { this._anchorElement[c] = l; }, enumerable: !0 }); }; ["hash", "host", "hostname", "port", "protocol"].forEach(function(c) { s(c); }), Object.defineProperty(a, "search", { get: function() { return this._anchorElement.search; }, set: function(c) { this._anchorElement.search = c, this._updateSearchParams(); }, enumerable: !0 }), Object.defineProperties(a, { toString: { get: function() { var c = this; return function() { return c.href; }; } }, href: { get: function() { return this._anchorElement.href.replace(/\?$/, ""); }, set: function(c) { this._anchorElement.href = c, this._updateSearchParams(); }, enumerable: !0 }, pathname: { get: function() { return this._anchorElement.pathname.replace(/(^\/?)/, "/"); }, set: function(c) { this._anchorElement.pathname = c; }, enumerable: !0 }, origin: { get: function() { var c = { "http:": 80, "https:": 443, "ftp:": 21 }[this._anchorElement.protocol], l = this._anchorElement.port != c && this._anchorElement.port !== ""; return this._anchorElement.protocol + "//" + this._anchorElement.hostname + (l ? ":" + this._anchorElement.port : ""); }, enumerable: !0 }, password: { // TODO get: function() { return ""; }, set: function(c) { }, enumerable: !0 }, username: { // TODO get: function() { return ""; }, set: function(c) { }, enumerable: !0 } }), o.createObjectURL = function(c) { return n.createObjectURL.apply(n, arguments); }, o.revokeObjectURL = function(c) { return n.revokeObjectURL.apply(n, arguments); }, i.URL = o; }; if (e() || t(), i.location !== void 0 && !("origin" in i.location)) { var r = function() { return i.location.protocol + "//" + i.location.hostname + (i.location.port ? ":" + i.location.port : ""); }; try { Object.defineProperty(i.location, "origin", { get: r, enumerable: !0 }); } catch { setInterval(function() { i.location.origin = r(); }, 100); } } }( typeof Nn < "u" ? Nn : typeof window < "u" ? window : typeof self < "u" ? self : Nn )), A3; } /** * @license * Copyright 2010-2021 Three.js Authors * SPDX-License-Identifier: MIT */ const kp = "130", L3 = { LEFT: 0, MIDDLE: 1, RIGHT: 2, ROTATE: 0, DOLLY: 1, PAN: 2 }, R3 = { ROTATE: 0, PAN: 1, DOLLY_PAN: 2, DOLLY_ROTATE: 3 }, Ny = 0, vd = 1, By = 2, O3 = 3, P3 = 0, zp = 1, ky = 2, wa = 3, qn = 0, $t = 1, Xn = 2, Fp = 1, I3 = 2, on = 0, Sa = 1, yd = 2, bd = 3, xd = 4, zy = 5, bo = 100, Fy = 101, Vy = 102, wd = 103, _d = 104, Uy = 200, Gy = 201, Hy = 202, jy = 203, Vp = 204, Up = 205, Wy = 206, $y = 207, qy = 208, Xy = 209, Zy = 210, Yy = 0, Jy = 1, Ky = 2, Kc = 3, Qy = 4, eb = 5, tb = 6, ib = 7, vl = 0, rb = 1, nb = 2, Fn = 0, ob = 1, ab = 2, sb = 3, lb = 4, cb = 5, Su = 300, yl = 301, bl = 302, Qc = 303, eu = 304, ls = 306, xl = 307, Zn = 1e3, li = 1001, Na = 1002, qt = 1003, Ks = 1004, D3 = 1004, Qs = 1005, N3 = 1005, Ut = 1006, Tu = 1007, B3 = 1007, yn = 1008, k3 = 1008, Po = 1009, ub = 1010, hb = 1011, el = 1012, db = 1013, Vs = 1014, en = 1015, Eo = 1016, pb = 1017, fb = 1018, mb = 1019, Ta = 1020, gb = 1021, an = 1022, $i = 1023, vb = 1024, yb = 1025, bb = $i, Ao = 1026, Ba = 1027, xb = 1028, wb = 1029, _b = 1030, Mb = 1031, Sb = 1032, Tb = 1033, Md = 33776, Sd = 33777, Td = 33778, Ed = 33779, Ad = 35840, Cd = 35841, Ld = 35842, Rd = 35843, Eb = 36196, Od = 37492, Pd = 37496, Ab = 37808, Cb = 37809, Lb = 37810, Rb = 37811, Ob = 37812, Pb = 37813, Ib = 37814, Db = 37815, Nb = 37816, Bb = 37817, kb = 37818, zb = 37819, Fb = 37820, Vb = 37821, Ub = 36492, Gb = 37840, Hb = 37841, jb = 37842, Wb = 37843, $b = 37844, qb = 37845, Xb = 37846, Zb = 37847, Yb = 37848, Jb = 37849, Kb = 37850, Qb = 37851, ex = 37852, tx = 37853, ix = 2200, rx = 2201, nx = 2202, ka = 2300, Io = 2301, Vc = 2302, wo = 2400, _o = 2401, tl = 2402, Eu = 2500, Gp = 2501, ox = 0, ax = 1, Hp = 2, Ri = 3e3, Do = 3001, Au = 3007, Cu = 3002, sx = 3003, jp = 3004, Wp = 3005, $p = 3006, lx = 3200, cx = 3201, eo = 0, ux = 1, z3 = 0, Uc = 7680, F3 = 7681, V3 = 7682, U3 = 7683, G3 = 34055, H3 = 34056, j3 = 5386, W3 = 512, $3 = 513, q3 = 514, X3 = 515, Z3 = 516, Y3 = 517, J3 = 518, hx = 519, za = 35044, Fa = 35048, K3 = 35040, Q3 = 35045, eO = 35049, tO = 35041, iO = 35046, rO = 35050, nO = 35042, oO = "100", Id = "300 es"; class to { addEventListener(e, t) { this._listeners === void 0 && (this._listeners = {}); const r = this._listeners; r[e] === void 0 && (r[e] = []), r[e].indexOf(t) === -1 && r[e].push(t); } hasEventListener(e, t) { if (this._listeners === void 0) return !1; const r = this._listeners; return r[e] !== void 0 && r[e].indexOf(t) !== -1; } removeEventListener(e, t) { if (this._listeners === void 0) return; const r = this._listeners[e]; if (r !== void 0) { const n = r.indexOf(t); n !== -1 && r.splice(n, 1); } } dispatchEvent(e) { if (this._listeners === void 0) return; const t = this._listeners[e.type]; if (t !== void 0) { e.target = this; const r = t.slice(0); for (let n = 0, o = r.length; n < o; n++) r[n].call(this, e); e.target = null; } } } const di = []; for (let i = 0; i < 256; i++) di[i] = (i < 16 ? "0" : "") + i.toString(16); let Hl = 1234567; const Co = Math.PI / 180, il = 180 / Math.PI; function qi() { const i = Math.random() * 4294967295 | 0, e = Math.random() * 4294967295 | 0, t = Math.random() * 4294967295 | 0, r = Math.random() * 4294967295 | 0; return (di[i & 255] + di[i >> 8 & 255] + di[i >> 16 & 255] + di[i >> 24 & 255] + "-" + di[e & 255] + di[e >> 8 & 255] + "-" + di[e >> 16 & 15 | 64] + di[e >> 24 & 255] + "-" + di[t & 63 | 128] + di[t >> 8 & 255] + "-" + di[t >> 16 & 255] + di[t >> 24 & 255] + di[r & 255] + di[r >> 8 & 255] + di[r >> 16 & 255] + di[r >> 24 & 255]).toUpperCase(); } function mi(i, e, t) { return Math.max(e, Math.min(t, i)); } function qp(i, e) { return (i % e + e) % e; } function aO(i, e, t, r, n) { return r + (i - e) * (n - r) / (t - e); } function sO(i, e, t) { return i !== e ? (t - i) / (e - i) : 0; } function Us(i, e, t) { return (1 - t) * i + t * e; } function lO(i, e, t, r) { return Us(i, e, 1 - Math.exp(-t * r)); } function cO(i, e = 1) { return e - Math.abs(qp(i, e * 2) - e); } function uO(i, e, t) { return i <= e ? 0 : i >= t ? 1 : (i = (i - e) / (t - e), i * i * (3 - 2 * i)); } function hO(i, e, t) { return i <= e ? 0 : i >= t ? 1 : (i = (i - e) / (t - e), i * i * i * (i * (i * 6 - 15) + 10)); } function dO(i, e) { return i + Math.floor(Math.random() * (e - i + 1)); } function pO(i, e) { return i + Math.random() * (e - i); } function fO(i) { return i * (0.5 - Math.random()); } function mO(i) { return i !== void 0 && (Hl = i % 2147483647), Hl = Hl * 16807 % 2147483647, (Hl - 1) / 2147483646; } function gO(i) { return i * Co; } function vO(i) { return i * il; } function Dd(i) { return (i & i - 1) === 0 && i !== 0; } function dx(i) { return Math.pow(2, Math.ceil(Math.log(i) / Math.LN2)); } function px(i) { return Math.pow(2, Math.floor(Math.log(i) / Math.LN2)); } function yO(i, e, t, r, n) { const o = Math.cos, a = Math.sin, s = o(t / 2), c = a(t / 2), l = o((e + r) / 2), h = a((e + r) / 2), u = o((e - r) / 2), p = a((e - r) / 2), g = o((r - e) / 2), m = a((r - e) / 2); switch (n) { case "XYX": i.set(s * h, c * u, c * p, s * l); break; case "YZY": i.set(c * p, s * h, c * u, s * l); break; case "ZXZ": i.set(c * u, c * p, s * h, s * l); break; case "XZX": i.set(s * h, c * m, c * g, s * l); break; case "YXY": i.set(c * g, s * h, c * m, s * l); break; case "ZYZ": i.set(c * m, c * g, s * h, s * l); break; default: console.warn("THREE.MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: " + n); } } var Nd = /* @__PURE__ */ Object.freeze({ __proto__: null, DEG2RAD: Co, RAD2DEG: il, generateUUID: qi, clamp: mi, euclideanModulo: qp, mapLinear: aO, inverseLerp: sO, lerp: Us, damp: lO, pingpong: cO, smoothstep: uO, smootherstep: hO, randInt: dO, randFloat: pO, randFloatSpread: fO, seededRandom: mO, degToRad: gO, radToDeg: vO, isPowerOfTwo: Dd, ceilPowerOfTwo: dx, floorPowerOfTwo: px, setQuaternionFromProperEuler: yO }); class Oe { constructor(e = 0, t = 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, t) { return t !== void 0 ? (console.warn("THREE.Vector2: .add() now only accepts one argument. Use .addVectors( a, b ) instead."), this.addVectors(e, t)) : (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, t) { return t !== void 0 ? (console.warn("THREE.Vector2: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."), this.subVectors(e, t)) : (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, r = this.y, n = e.elements; return this.x = n[0] * t + n[3] * r + n[6], this.y = n[1] * t + n[4] * r + n[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 = Math.max(e.x, Math.min(t.x, this.x)), this.y = Math.max(e.y, Math.min(t.y, this.y)), this; } clampScalar(e, t) { return this.x = Math.max(e, Math.min(t, this.x)), this.y = Math.max(e, Math.min(t, this.y)), this; } clampLength(e, t) { const r = this.length(); return this.divideScalar(r || 1).multiplyScalar(Math.max(e, Math.min(t, r))); } 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 = this.x < 0 ? Math.ceil(this.x) : Math.floor(this.x), this.y = this.y < 0 ? Math.ceil(this.y) : Math.floor(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; } distanceTo(e) { return Math.sqrt(this.distanceToSquared(e)); } distanceToSquared(e) { const t = this.x - e.x, r = this.y - e.y; return t * t + r * r; } 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, r) { return this.x = e.x + (t.x - e.x) * r, this.y = e.y + (t.y - e.y) * r, 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, r) { return r !== void 0 && console.warn("THREE.Vector2: offset has been removed from .fromBufferAttribute()."), this.x = e.getX(t), this.y = e.getY(t), this; } rotateAround(e, t) { const r = Math.cos(t), n = Math.sin(t), o = this.x - e.x, a = this.y - e.y; return this.x = o * r - a * n + e.x, this.y = o * n + a * r + e.y, this; } random() { return this.x = Math.random(), this.y = Math.random(), this; } } Oe.prototype.isVector2 = !0; class ii { constructor() { this.elements = [ 1, 0, 0, 0, 1, 0, 0, 0, 1 ], arguments.length > 0 && console.error("THREE.Matrix3: the constructor no longer reads arguments. use .set() instead."); } set(e, t, r, n, o, a, s, c, l) { const h = this.elements; return h[0] = e, h[1] = n, h[2] = s, h[3] = t, h[4] = o, h[5] = c, h[6] = r, h[7] = a, h[8] = l, this; } identity() { return this.set( 1, 0, 0, 0, 1, 0, 0, 0, 1 ), this; } copy(e) { const t = this.elements, r = e.elements; return t[0] = r[0], t[1] = r[1], t[2] = r[2], t[3] = r[3], t[4] = r[4], t[5] = r[5], t[6] = r[6], t[7] = r[7], t[8] = r[8], this; } extractBasis(e, t, r) { return e.setFromMatrix3Column(this, 0), t.setFromMatrix3Column(this, 1), r.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 r = e.elements, n = t.elements, o = this.elements, a = r[0], s = r[3], c = r[6], l = r[1], h = r[4], u = r[7], p = r[2], g = r[5], m = r[8], d = n[0], y = n[3], f = n[6], v = n[1], M = n[4], S = n[7], T = n[2], x = n[5], w = n[8]; return o[0] = a * d + s * v + c * T, o[3] = a * y + s * M + c * x, o[6] = a * f + s * S + c * w, o[1] = l * d + h * v + u * T, o[4] = l * y + h * M + u * x, o[7] = l * f + h * S + u * w, o[2] = p * d + g * v + m * T, o[5] = p * y + g * M + m * x, o[8] = p * f + g * S + m * w, 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], r = e[1], n = e[2], o = e[3], a = e[4], s = e[5], c = e[6], l = e[7], h = e[8]; return t * a * h - t * s * l - r * o * h + r * s * c + n * o * l - n * a * c; } invert() { const e = this.elements, t = e[0], r = e[1], n = e[2], o = e[3], a = e[4], s = e[5], c = e[6], l = e[7], h = e[8], u = h * a - s * l, p = s * c - h * o, g = l * o - a * c, m = t * u + r * p + n * g; if (m === 0) return this.set(0, 0, 0, 0, 0, 0, 0, 0, 0); const d = 1 / m; return e[0] = u * d, e[1] = (n * l - h * r) * d, e[2] = (s * r - n * a) * d, e[3] = p * d, e[4] = (h * t - n * c) * d, e[5] = (n * o - s * t) * d, e[6] = g * d, e[7] = (r * c - l * t) * d, e[8] = (a * t - r * o) * d, 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, r, n, o, a, s) { const c = Math.cos(o), l = Math.sin(o); return this.set( r * c, r * l, -r * (c * a + l * s) + a + e, -n * l, n * c, -n * (-l * a + c * s) + s + t, 0, 0, 1 ), this; } scale(e, t) { const r = this.elements; return r[0] *= e, r[3] *= e, r[6] *= e, r[1] *= t, r[4] *= t, r[7] *= t, this; } rotate(e) { const t = Math.cos(e), r = Math.sin(e), n = this.elements, o = n[0], a = n[3], s = n[6], c = n[1], l = n[4], h = n[7]; return n[0] = t * o + r * c, n[3] = t * a + r * l, n[6] = t * s + r * h, n[1] = -r * o + t * c, n[4] = -r * a + t * l, n[7] = -r * s + t * h, this; } translate(e, t) { const r = this.elements; return r[0] += e * r[2], r[3] += e * r[5], r[6] += e * r[8], r[1] += t * r[2], r[4] += t * r[5], r[7] += t * r[8], this; } equals(e) { const t = this.elements, r = e.elements; for (let n = 0; n < 9; n++) if (t[n] !== r[n]) return !1; return !0; } fromArray(e, t = 0) { for (let r = 0; r < 9; r++) this.elements[r] = e[r + t]; return this; } toArray(e = [], t = 0) { const r = this.elements; return e[t] = r[0], e[t + 1] = r[1], e[t + 2] = r[2], e[t + 3] = r[3], e[t + 4] = r[4], e[t + 5] = r[5], e[t + 6] = r[6], e[t + 7] = r[7], e[t + 8] = r[8], e; } clone() { return new this.constructor().fromArray(this.elements); } } ii.prototype.isMatrix3 = !0; let Ko; class jo { static getDataURL(e) { if (/^data:/i.test(e.src) || typeof HTMLCanvasElement > "u") return e.src; let t; if (e instanceof HTMLCanvasElement) t = e; else { Ko === void 0 && (Ko = document.createElementNS("http://www.w3.org/1999/xhtml", "canvas")), Ko.width = e.width, Ko.height = e.height; const r = Ko.getContext("2d"); e instanceof ImageData ? r.putImageData(e, 0, 0) : r.drawImage(e, 0, 0, e.width, e.height), t = Ko; } return t.width > 2048 || t.height > 2048 ? (console.warn("THREE.ImageUtils.getDataURL: Image converted to jpg for performance reasons", e), t.toDataURL("image/jpeg", 0.6)) : t.toDataURL("image/png"); } } let bO = 0; class Jt extends to { constructor(e = Jt.DEFAULT_IMAGE, t = Jt.DEFAULT_MAPPING, r = li, n = li, o = Ut, a = yn, s = $i, c = Po, l = 1, h = Ri) { super(), Object.defineProperty(this, "id", { value: bO++ }), this.uuid = qi(), this.name = "", this.image = e, this.mipmaps = [], this.mapping = t, this.wrapS = r, this.wrapT = n, this.magFilter = o, this.minFilter = a, this.anisotropy = l, this.format = s, this.internalFormat = null, this.type = c, this.offset = new Oe(0, 0), this.repeat = new Oe(1, 1), this.center = new Oe(0, 0), this.rotation = 0, this.matrixAutoUpdate = !0, this.matrix = new ii(), this.generateMipmaps = !0, this.premultiplyAlpha = !1, this.flipY = !0, this.unpackAlignment = 4, this.encoding = h, this.version = 0, this.onUpdate = null; } 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.image = e.image, this.mipmaps = e.mipmaps.slice(0), this.mapping = e.mapping, 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.encoding = e.encoding, 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 r = { metadata: { version: 4.5, type: "Texture", generator: "Texture.toJSON" }, uuid: this.uuid, name: this.name, mapping: this.mapping, 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, type: this.type, encoding: this.encoding, minFilter: this.minFilter, magFilter: this.magFilter, anisotropy: this.anisotropy, flipY: this.flipY, premultiplyAlpha: this.premultiplyAlpha, unpackAlignment: this.unpackAlignment }; if (this.image !== void 0) { const n = this.image; if (n.uuid === void 0 && (n.uuid = qi()), !t && e.images[n.uuid] === void 0) { let o; if (Array.isArray(n)) { o = []; for (let a = 0, s = n.length; a < s; a++) n[a].isDataTexture ? o.push(ah(n[a].image)) : o.push(ah(n[a])); } else o = ah(n); e.images[n.uuid] = { uuid: n.uuid, url: o }; } r.image = n.uuid; } return t || (e.textures[this.uuid] = r), r; } dispose() { this.dispatchEvent({ type: "dispose" }); } transformUv(e) { if (this.mapping !== Su) return e; if (e.applyMatrix3(this.matrix), e.x < 0 || e.x > 1) switch (this.wrapS) { case Zn: e.x = e.x - Math.floor(e.x); break; case li: e.x = e.x < 0 ? 0 : 1; break; case Na: 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 Zn: e.y = e.y - Math.floor(e.y); break; case li: e.y = e.y < 0 ? 0 : 1; break; case Na: 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++; } } Jt.DEFAULT_IMAGE = void 0; Jt.DEFAULT_MAPPING = Su; Jt.prototype.isTexture = !0; function ah(i) { return typeof HTMLImageElement < "u" && i instanceof HTMLImageElement || typeof HTMLCanvasElement < "u" && i instanceof HTMLCanvasElement || typeof ImageBitmap < "u" && i instanceof ImageBitmap ? jo.getDataURL(i) : i.data ? { data: Array.prototype.slice.call(i.data), width: i.width, height: i.height, type: i.data.constructor.name } : (console.warn("THREE.Texture: Unable to serialize Texture."), {}); } class Mt { constructor(e = 0, t = 0, r = 0, n = 1) { this.x = e, this.y = t, this.z = r, this.w = n; } 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, r, n) { return this.x = e, this.y = t, this.z = r, this.w = n, 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, t) { return t !== void 0 ? (console.warn("THREE.Vector4: .add() now only accepts one argument. Use .addVectors( a, b ) instead."), this.addVectors(e, t)) : (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, t) { return t !== void 0 ? (console.warn("THREE.Vector4: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."), this.subVectors(e, t)) : (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, r = this.y, n = this.z, o = this.w, a = e.elements; return this.x = a[0] * t + a[4] * r + a[8] * n + a[12] * o, this.y = a[1] * t + a[5] * r + a[9] * n + a[13] * o, this.z = a[2] * t + a[6] * r + a[10] * n + a[14] * o, this.w = a[3] * t + a[7] * r + a[11] * n + a[15] * o, 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, r, n, o; const a = e.elements, s = a[0], c = a[4], l = a[8], h = a[1], u = a[5], p = a[9], g = a[2], m = a[6], d = a[10]; if (Math.abs(c - h) < 0.01 && Math.abs(l - g) < 0.01 && Math.abs(p - m) < 0.01) { if (Math.abs(c + h) < 0.1 && Math.abs(l + g) < 0.1 && Math.abs(p + m) < 0.1 && Math.abs(s + u + d - 3) < 0.1) return this.set(1, 0, 0, 0), this; t = Math.PI; const f = (s + 1) / 2, v = (u + 1) / 2, M = (d + 1) / 2, S = (c + h) / 4, T = (l + g) / 4, x = (p + m) / 4; return f > v && f > M ? f < 0.01 ? (r = 0, n = 0.707106781, o = 0.707106781) : (r = Math.sqrt(f), n = S / r, o = T / r) : v > M ? v < 0.01 ? (r = 0.707106781, n = 0, o = 0.707106781) : (n = Math.sqrt(v), r = S / n, o = x / n) : M < 0.01 ? (r = 0.707106781, n = 0.707106781, o = 0) : (o = Math.sqrt(M), r = T / o, n = x / o), this.set(r, n, o, t), this; } let y = Math.sqrt((m - p) * (m - p) + (l - g) * (l - g) + (h - c) * (h - c)); return Math.abs(y) < 1e-3 && (y = 1), this.x = (m - p) / y, this.y = (l - g) / y, this.z = (h - c) / y, this.w = Math.acos((s + u + d - 1) / 2), this; } min(e) { return this.x = Math.min(this.x, e.x), this.y = Math.min(this.y, e.y), this.z = Math.min(this.z, e.z), this.w = Math.min(this.w, e.w), this; } 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 = Math.max(e.x, Math.min(t.x, this.x)), this.y = Math.max(e.y, Math.min(t.y, this.y)), this.z = Math.max(e.z, Math.min(t.z, this.z)), this.w = Math.max(e.w, Math.min(t.w, this.w)), this; } clampScalar(e, t) { return this.x = Math.max(e, Math.min(t, this.x)), this.y = Math.max(e, Math.min(t, this.y)), this.z = Math.max(e, Math.min(t, this.z)), this.w = Math.max(e, Math.min(t, this.w)), this; } clampLength(e, t) { const r = this.length(); return this.divideScalar(r || 1).multiplyScalar(Math.max(e, Math.min(t, r))); } 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 = this.x < 0 ? Math.ceil(this.x) : Math.floor(this.x), this.y = this.y < 0 ? Math.ceil(this.y) : Math.floor(this.y), this.z = this.z < 0 ? Math.ceil(this.z) : Math.floor(this.z), this.w = this.w < 0 ? Math.ceil(this.w) : Math.floor(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, r) { return this.x = e.x + (t.x - e.x) * r, this.y = e.y + (t.y - e.y) * r, this.z = e.z + (t.z - e.z) * r, this.w = e.w + (t.w - e.w) * r, 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, r) { return r !== void 0 && console.warn("THREE.Vector4: offset has been removed from .fromBufferAttribute()."), 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; } } Mt.prototype.isVector4 = !0; class vr extends to { constructor(e, t, r = {}) { super(), 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), this.texture = new Jt(void 0, r.mapping, r.wrapS, r.wrapT, r.magFilter, r.minFilter, r.format, r.type, r.anisotropy, r.encoding), this.texture.image = { width: e, height: t, depth: 1 }, this.texture.generateMipmaps = r.generateMipmaps !== void 0 ? r.generateMipmaps : !1, this.texture.minFilter = r.minFilter !== void 0 ? r.minFilter : Ut, this.depthBuffer = r.depthBuffer !== void 0 ? r.depthBuffer : !0, this.stencilBuffer = r.stencilBuffer !== void 0 ? r.stencilBuffer : !1, this.depthTexture = r.depthTexture !== void 0 ? r.depthTexture : null; } setTexture(e) { e.image = { width: this.width, height: this.height, depth: this.depth }, this.texture = e; } setSize(e, t, r = 1) { (this.width !== e || this.height !== t || this.depth !== r) && (this.width = e, this.height = t, this.depth = r, this.texture.image.width = e, this.texture.image.height = t, this.texture.image.depth = r, 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) { return this.width = e.width, this.height = e.height, this.depth = e.depth, this.viewport.copy(e.viewport), this.texture = e.texture.clone(), this.texture.image = { ...this.texture.image }, this.depthBuffer = e.depthBuffer, this.stencilBuffer = e.stencilBuffer, this.depthTexture = e.depthTexture, this; } dispose() { this.dispatchEvent({ type: "dispose" }); } } vr.prototype.isWebGLRenderTarget = !0; class fx extends vr { constructor(e, t, r) { super(e, t); const n = this.texture; this.texture = []; for (let o = 0; o < r; o++) this.texture[o] = n.clone(); } setSize(e, t, r = 1) { if (this.width !== e || this.height !== t || this.depth !== r) { this.width = e, this.height = t, this.depth = r; for (let n = 0, o = this.texture.length; n < o; n++) this.texture[n].image.width = e, this.texture[n].image.height = t, this.texture[n].image.depth = r; this.dispose(); } return this.viewport.set(0, 0, e, t), this.scissor.set(0, 0, e, t), this; } copy(e) { this.dispose(), this.width = e.width, this.height = e.height, this.depth = e.depth, this.viewport.set(0, 0, this.width, this.height), this.scissor.set(0, 0, this.width, this.height), this.depthBuffer = e.depthBuffer, this.stencilBuffer = e.stencilBuffer, this.depthTexture = e.depthTexture, this.texture.length = 0; for (let t = 0, r = e.texture.length; t < r; t++) this.texture[t] = e.texture[t].clone(); return this; } } fx.prototype.isWebGLMultipleRenderTargets = !0; class Xp extends vr { constructor(e, t, r) { super(e, t, r), this.samples = 4; } copy(e) { return super.copy.call(this, e), this.samples = e.samples, this; } } Xp.prototype.isWebGLMultisampleRenderTarget = !0; class vi { constructor(e = 0, t = 0, r = 0, n = 1) { this._x = e, this._y = t, this._z = r, this._w = n; } static slerp(e, t, r, n) { return console.warn("THREE.Quaternion: Static .slerp() has been deprecated. Use qm.slerpQuaternions( qa, qb, t ) instead."), r.slerpQuaternions(e, t, n); } static slerpFlat(e, t, r, n, o, a, s) { let c = r[n + 0], l = r[n + 1], h = r[n + 2], u = r[n + 3]; const p = o[a + 0], g = o[a + 1], m = o[a + 2], d = o[a + 3]; if (s === 0) { e[t + 0] = c, e[t + 1] = l, e[t + 2] = h, e[t + 3] = u; return; } if (s === 1) { e[t + 0] = p, e[t + 1] = g, e[t + 2] = m, e[t + 3] = d; return; } if (u !== d || c !== p || l !== g || h !== m) { let y = 1 - s; const f = c * p + l * g + h * m + u * d, v = f >= 0 ? 1 : -1, M = 1 - f * f; if (M > Number.EPSILON) { const T = Math.sqrt(M), x = Math.atan2(T, f * v); y = Math.sin(y * x) / T, s = Math.sin(s * x) / T; } const S = s * v; if (c = c * y + p * S, l = l * y + g * S, h = h * y + m * S, u = u * y + d * S, y === 1 - s) { const T = 1 / Math.sqrt(c * c + l * l + h * h + u * u); c *= T, l *= T, h *= T, u *= T; } } e[t] = c, e[t + 1] = l, e[t + 2] = h, e[t + 3] = u; } static multiplyQuaternionsFlat(e, t, r, n, o, a) { const s = r[n], c = r[n + 1], l = r[n + 2], h = r[n + 3], u = o[a], p = o[a + 1], g = o[a + 2], m = o[a + 3]; return e[t] = s * m + h * u + c * g - l * p, e[t + 1] = c * m + h * p + l * u - s * g, e[t + 2] = l * m + h * g + s * p - c * u, e[t + 3] = h * m - s * u - c * p - l * g, 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, r, n) { return this._x = e, this._y = t, this._z = r, this._w = n, 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) { if (!(e && e.isEuler)) throw new Error("THREE.Quaternion: .setFromEuler() now expects an Euler rotation rather than a Vector3 and order."); const r = e._x, n = e._y, o = e._z, a = e._order, s = Math.cos, c = Math.sin, l = s(r / 2), h = s(n / 2), u = s(o / 2), p = c(r / 2), g = c(n / 2), m = c(o / 2); switch (a) { case "XYZ": this._x = p * h * u + l * g * m, this._y = l * g * u - p * h * m, this._z = l * h * m + p * g * u, this._w = l * h * u - p * g * m; break; case "YXZ": this._x = p * h * u + l * g * m, this._y = l * g * u - p * h * m, this._z = l * h * m - p * g * u, this._w = l * h * u + p * g * m; break; case "ZXY": this._x = p * h * u - l * g * m, this._y = l * g * u + p * h * m, this._z = l * h * m + p * g * u, this._w = l * h * u - p * g * m; break; case "ZYX": this._x = p * h * u - l * g * m, this._y = l * g * u + p * h * m, this._z = l * h * m - p * g * u, this._w = l * h * u + p * g * m; break; case "YZX": this._x = p * h * u + l * g * m, this._y = l * g * u + p * h * m, this._z = l * h * m - p * g * u, this._w = l * h * u - p * g * m; break; case "XZY": this._x = p * h * u - l * g * m, this._y = l * g * u - p * h * m, this._z = l * h * m + p * g * u, this._w = l * h * u + p * g * m; break; default: console.warn("THREE.Quaternion: .setFromEuler() encountered an unknown order: " + a); } return t !== !1 && this._onChangeCallback(), this; } setFromAxisAngle(e, t) { const r = t / 2, n = Math.sin(r); return this._x = e.x * n, this._y = e.y * n, this._z = e.z * n, this._w = Math.cos(r), this._onChangeCallback(), this; } setFromRotationMatrix(e) { const t = e.elements, r = t[0], n = t[4], o = t[8], a = t[1], s = t[5], c = t[9], l = t[2], h = t[6], u = t[10], p = r + s + u; if (p > 0) { const g = 0.5 / Math.sqrt(p + 1); this._w = 0.25 / g, this._x = (h - c) * g, this._y = (o - l) * g, this._z = (a - n) * g; } else if (r > s && r > u) { const g = 2 * Math.sqrt(1 + r - s - u); this._w = (h - c) / g, this._x = 0.25 * g, this._y = (n + a) / g, this._z = (o + l) / g; } else if (s > u) { const g = 2 * Math.sqrt(1 + s - r - u); this._w = (o - l) / g, this._x = (n + a) / g, this._y = 0.25 * g, this._z = (c + h) / g; } else { const g = 2 * Math.sqrt(1 + u - r - s); this._w = (a - n) / g, this._x = (o + l) / g, this._y = (c + h) / g, this._z = 0.25 * g; } return this._onChangeCallback(), this; } setFromUnitVectors(e, t) { let r = e.dot(t) + 1; return r < Number.EPSILON ? (r = 0, Math.abs(e.x) > Math.abs(e.z) ? (this._x = -e.y, this._y = e.x, this._z = 0, this._w = r) : (this._x = 0, this._y = -e.z, this._z = e.y, this._w = r)) : (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 = r), this.normalize(); } angleTo(e) { return 2 * Math.acos(Math.abs(mi(this.dot(e), -1, 1))); } rotateTowards(e, t) { const r = this.angleTo(e); if (r === 0) return this; const n = Math.min(1, t / r); return this.slerp(e, n), 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, t) { return t !== void 0 ? (console.warn("THREE.Quaternion: .multiply() now only accepts one argument. Use .multiplyQuaternions( a, b ) instead."), this.multiplyQuaternions(e, t)) : this.multiplyQuaternions(this, e); } premultiply(e) { return this.multiplyQuaternions(e, this); } multiplyQuaternions(e, t) { const r = e._x, n = e._y, o = e._z, a = e._w, s = t._x, c = t._y, l = t._z, h = t._w; return this._x = r * h + a * s + n * l - o * c, this._y = n * h + a * c + o * s - r * l, this._z = o * h + a * l + r * c - n * s, this._w = a * h - r * s - n * c - o * l, this._onChangeCallback(), this; } slerp(e, t) { if (t === 0) return this; if (t === 1) return this.copy(e); const r = this._x, n = this._y, o = this._z, a = this._w; let s = a * e._w + r * e._x + n * e._y + o * e._z; if (s < 0 ? (this._w = -e._w, this._x = -e._x, this._y = -e._y, this._z = -e._z, s = -s) : this.copy(e), s >= 1) return this._w = a, this._x = r, this._y = n, this._z = o, this; const c = 1 - s * s; if (c <= Number.EPSILON) { const g = 1 - t; return this._w = g * a + t * this._w, this._x = g * r + t * this._x, this._y = g * n + t * this._y, this._z = g * o + t * this._z, this.normalize(), this._onChangeCallback(), this; } const l = Math.sqrt(c), h = Math.atan2(l, s), u = Math.sin((1 - t) * h) / l, p = Math.sin(t * h) / l; return this._w = a * u + this._w * p, this._x = r * u + this._x * p, this._y = n * u + this._y * p, this._z = o * u + this._z * p, this._onChangeCallback(), this; } slerpQuaternions(e, t, r) { this.copy(e).slerp(t, r); } 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; } _onChange(e) { return this._onChangeCallback = e, this; } _onChangeCallback() { } } vi.prototype.isQuaternion = !0; class Z { constructor(e = 0, t = 0, r = 0) { this.x = e, this.y = t, this.z = r; } set(e, t, r) { return r === void 0 && (r = this.z), this.x = e, this.y = t, this.z = r, 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, t) { return t !== void 0 ? (console.warn("THREE.Vector3: .add() now only accepts one argument. Use .addVectors( a, b ) instead."), this.addVectors(e, t)) : (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, t) { return t !== void 0 ? (console.warn("THREE.Vector3: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."), this.subVectors(e, t)) : (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, t) { return t !== void 0 ? (console.warn("THREE.Vector3: .multiply() now only accepts one argument. Use .multiplyVectors( a, b ) instead."), this.multiplyVectors(e, t)) : (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 e && e.isEuler || console.error("THREE.Vector3: .applyEuler() now expects an Euler rotation rather than a Vector3 and order."), this.applyQuaternion(dg.setFromEuler(e)); } applyAxisAngle(e, t) { return this.applyQuaternion(dg.setFromAxisAngle(e, t)); } applyMatrix3(e) { const t = this.x, r = this.y, n = this.z, o = e.elements; return this.x = o[0] * t + o[3] * r + o[6] * n, this.y = o[1] * t + o[4] * r + o[7] * n, this.z = o[2] * t + o[5] * r + o[8] * n, this; } applyNormalMatrix(e) { return this.applyMatrix3(e).normalize(); } applyMatrix4(e) { const t = this.x, r = this.y, n = this.z, o = e.elements, a = 1 / (o[3] * t + o[7] * r + o[11] * n + o[15]); return this.x = (o[0] * t + o[4] * r + o[8] * n + o[12]) * a, this.y = (o[1] * t + o[5] * r + o[9] * n + o[13]) * a, this.z = (o[2] * t + o[6] * r + o[10] * n + o[14]) * a, this; } applyQuaternion(e) { const t = this.x, r = this.y, n = this.z, o = e.x, a = e.y, s = e.z, c = e.w, l = c * t + a * n - s * r, h = c * r + s * t - o * n, u = c * n + o * r - a * t, p = -o * t - a * r - s * n; return this.x = l * c + p * -o + h * -s - u * -a, this.y = h * c + p * -a + u * -o - l * -s, this.z = u * c + p * -s + l * -a - h * -o, 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, r = this.y, n = this.z, o = e.elements; return this.x = o[0] * t + o[4] * r + o[8] * n, this.y = o[1] * t + o[5] * r + o[9] * n, this.z = o[2] * t + o[6] * r + o[10] * n, 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 = Math.max(e.x, Math.min(t.x, this.x)), this.y = Math.max(e.y, Math.min(t.y, this.y)), this.z = Math.max(e.z, Math.min(t.z, this.z)), this; } clampScalar(e, t) { return this.x = Math.max(e, Math.min(t, this.x)), this.y = Math.max(e, Math.min(t, this.y)), this.z = Math.max(e, Math.min(t, this.z)), this; } clampLength(e, t) { const r = this.length(); return this.divideScalar(r || 1).multiplyScalar(Math.max(e, Math.min(t, r))); } 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 = this.x < 0 ? Math.ceil(this.x) : Math.floor(this.x), this.y = this.y < 0 ? Math.ceil(this.y) : Math.floor(this.y), this.z = this.z < 0 ? Math.ceil(this.z) : Math.floor(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; } // TODO lengthSquared? 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, r) { return this.x = e.x + (t.x - e.x) * r, this.y = e.y + (t.y - e.y) * r, this.z = e.z + (t.z - e.z) * r, this; } cross(e, t) { return t !== void 0 ? (console.warn("THREE.Vector3: .cross() now only accepts one argument. Use .crossVectors( a, b ) instead."), this.crossVectors(e, t)) : this.crossVectors(this, e); } crossVectors(e, t) { const r = e.x, n = e.y, o = e.z, a = t.x, s = t.y, c = t.z; return this.x = n * c - o * s, this.y = o * a - r * c, this.z = r * s - n * a, this; } projectOnVector(e) { const t = e.lengthSq(); if (t === 0) return this.set(0, 0, 0); const r = e.dot(this) / t; return this.copy(e).multiplyScalar(r); } projectOnPlane(e) { return sh.copy(this).projectOnVector(e), this.sub(sh); } reflect(e) { return this.sub(sh.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 r = this.dot(e) / t; return Math.acos(mi(r, -1, 1)); } distanceTo(e) { return Math.sqrt(this.distanceToSquared(e)); } distanceToSquared(e) { const t = this.x - e.x, r = this.y - e.y, n = this.z - e.z; return t * t + r * r + n * n; } 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, r) { const n = Math.sin(t) * e; return this.x = n * Math.sin(r), this.y = Math.cos(t) * e, this.z = n * Math.cos(r), this; } setFromCylindrical(e) { return this.setFromCylindricalCoords(e.radius, e.theta, e.y); } setFromCylindricalCoords(e, t, r) { return this.x = e * Math.sin(t), this.y = r, 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(), r = this.setFromMatrixColumn(e, 1).length(), n = this.setFromMatrixColumn(e, 2).length(); return this.x = t, this.y = r, this.z = n, this; } setFromMatrixColumn(e, t) { return this.fromArray(e.elements, t * 4); } setFromMatrix3Column(e, t) { return this.fromArray(e.elements, t * 3); } 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, r) { return r !== void 0 && console.warn("THREE.Vector3: offset has been removed from .fromBufferAttribute()."), 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; } } Z.prototype.isVector3 = !0; const sh = /* @__PURE__ */ new Z(), dg = /* @__PURE__ */ new vi(); class Vi { constructor(e = new Z(1 / 0, 1 / 0, 1 / 0), t = new Z(-1 / 0, -1 / 0, -1 / 0)) { this.min = e, this.max = t; } set(e, t) { return this.min.copy(e), this.max.copy(t), this; } setFromArray(e) { let t = 1 / 0, r = 1 / 0, n = 1 / 0, o = -1 / 0, a = -1 / 0, s = -1 / 0; for (let c = 0, l = e.length; c < l; c += 3) { const h = e[c], u = e[c + 1], p = e[c + 2]; h < t && (t = h), u < r && (r = u), p < n && (n = p), h > o && (o = h), u > a && (a = u), p > s && (s = p); } return this.min.set(t, r, n), this.max.set(o, a, s), this; } setFromBufferAttribute(e) { let t = 1 / 0, r = 1 / 0, n = 1 / 0, o = -1 / 0, a = -1 / 0, s = -1 / 0; for (let c = 0, l = e.count; c < l; c++) { const h = e.getX(c), u = e.getY(c), p = e.getZ(c); h < t && (t = h), u < r && (r = u), p < n && (n = p), h > o && (o = h), u > a && (a = u), p > s && (s = p); } return this.min.set(t, r, n), this.max.set(o, a, s), this; } setFromPoints(e) { this.makeEmpty(); for (let t = 0, r = e.length; t < r; t++) this.expandByPoint(e[t]); return this; } setFromCenterAndSize(e, t) { const r = bs.copy(t).multiplyScalar(0.5); return this.min.copy(e).sub(r), this.max.copy(e).add(r), this; } setFromObject(e) { return this.makeEmpty(), this.expandByObject(e); } 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) { e.updateWorldMatrix(!1, !1); const t = e.geometry; t !== void 0 && (t.boundingBox === null && t.computeBoundingBox(), lh.copy(t.boundingBox), lh.applyMatrix4(e.matrixWorld), this.union(lh)); const r = e.children; for (let n = 0, o = r.length; n < o; n++) this.expandByObject(r[n]); 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, bs), bs.distanceToSquared(e.center) <= e.radius * e.radius; } intersectsPlane(e) { let t, r; return e.normal.x > 0 ? (t = e.normal.x * this.min.x, r = e.normal.x * this.max.x) : (t = e.normal.x * this.max.x, r = e.normal.x * this.min.x), e.normal.y > 0 ? (t += e.normal.y * this.min.y, r += e.normal.y * this.max.y) : (t += e.normal.y * this.max.y, r += e.normal.y * this.min.y), e.normal.z > 0 ? (t += e.normal.z * this.min.z, r += e.normal.z * this.max.z) : (t += e.normal.z * this.max.z, r += e.normal.z * this.min.z), t <= -e.constant && r >= -e.constant; } intersectsTriangle(e) { if (this.isEmpty()) return !1; this.getCenter(xs), jl.subVectors(this.max, xs), Qo.subVectors(e.a, xs), ea.subVectors(e.b, xs), ta.subVectors(e.c, xs), _n.subVectors(ea, Qo), Mn.subVectors(ta, ea), co.subVectors(Qo, ta); let t = [ 0, -_n.z, _n.y, 0, -Mn.z, Mn.y, 0, -co.z, co.y, _n.z, 0, -_n.x, Mn.z, 0, -Mn.x, co.z, 0, -co.x, -_n.y, _n.x, 0, -Mn.y, Mn.x, 0, -co.y, co.x, 0 ]; return !ch(t, Qo, ea, ta, jl) || (t = [1, 0, 0, 0, 1, 0, 0, 0, 1], !ch(t, Qo, ea, ta, jl)) ? !1 : (Wl.crossVectors(_n, Mn), t = [Wl.x, Wl.y, Wl.z], ch(t, Qo, ea, ta, jl)); } clampPoint(e, t) { return t.copy(e).clamp(this.min, this.max); } distanceToPoint(e) { return bs.copy(e).clamp(this.min, this.max).sub(e).length(); } getBoundingSphere(e) { return this.getCenter(e.center), e.radius = this.getSize(bs).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 : (jr[0].set(this.min.x, this.min.y, this.min.z).applyMatrix4(e), jr[1].set(this.min.x, this.min.y, this.max.z).applyMatrix4(e), jr[2].set(this.min.x, this.max.y, this.min.z).applyMatrix4(e), jr[3].set(this.min.x, this.max.y, this.max.z).applyMatrix4(e), jr[4].set(this.max.x, this.min.y, this.min.z).applyMatrix4(e), jr[5].set(this.max.x, this.min.y, this.max.z).applyMatrix4(e), jr[6].set(this.max.x, this.max.y, this.min.z).applyMatrix4(e), jr[7].set(this.max.x, this.max.y, this.max.z).applyMatrix4(e), this.setFromPoints(jr), 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); } } Vi.prototype.isBox3 = !0; const jr = [ /* @__PURE__ */ new Z(), /* @__PURE__ */ new Z(), /* @__PURE__ */ new Z(), /* @__PURE__ */ new Z(), /* @__PURE__ */ new Z(), /* @__PURE__ */ new Z(), /* @__PURE__ */ new Z(), /* @__PURE__ */ new Z() ], bs = /* @__PURE__ */ new Z(), lh = /* @__PURE__ */ new Vi(), Qo = /* @__PURE__ */ new Z(), ea = /* @__PURE__ */ new Z(), ta = /* @__PURE__ */ new Z(), _n = /* @__PURE__ */ new Z(), Mn = /* @__PURE__ */ new Z(), co = /* @__PURE__ */ new Z(), xs = /* @__PURE__ */ new Z(), jl = /* @__PURE__ */ new Z(), Wl = /* @__PURE__ */ new Z(), uo = /* @__PURE__ */ new Z(); function ch(i, e, t, r, n) { for (let o = 0, a = i.length - 3; o <= a; o += 3) { uo.fromArray(i, o); const s = n.x * Math.abs(uo.x) + n.y * Math.abs(uo.y) + n.z * Math.abs(uo.z), c = e.dot(uo), l = t.dot(uo), h = r.dot(uo); if (Math.max(-Math.max(c, l, h), Math.min(c, l, h)) > s) return !1; } return !0; } const xO = /* @__PURE__ */ new Vi(), pg = /* @__PURE__ */ new Z(), uh = /* @__PURE__ */ new Z(), hh = /* @__PURE__ */ new Z(); class bn { constructor(e = new Z(), t = -1) { this.center = e, this.radius = t; } set(e, t) { return this.center.copy(e), this.radius = t, this; } setFromPoints(e, t) { const r = this.center; t !== void 0 ? r.copy(t) : xO.setFromPoints(e).getCenter(r); let n = 0; for (let o = 0, a = e.length; o < a; o++) n = Math.max(n, r.distanceToSquared(e[o])); return this.radius = Math.sqrt(n), 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 r = this.center.distanceToSquared(e); return t.copy(e), r > 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) { hh.subVectors(e, this.center); const t = hh.lengthSq(); if (t > this.radius * this.radius) { const r = Math.sqrt(t), n = (r - this.radius) * 0.5; this.center.add(hh.multiplyScalar(n / r)), this.radius += n; } return this; } union(e) { return uh.subVectors(e.center, this.center).normalize().multiplyScalar(e.radius), this.expandByPoint(pg.copy(e.center).add(uh)), this.expandByPoint(pg.copy(e.center).sub(uh)), this; } equals(e) { return e.center.equals(this.center) && e.radius === this.radius; } clone() { return new this.constructor().copy(this); } } const Wr = /* @__PURE__ */ new Z(), dh = /* @__PURE__ */ new Z(), $l = /* @__PURE__ */ new Z(), Sn = /* @__PURE__ */ new Z(), ph = /* @__PURE__ */ new Z(), ql = /* @__PURE__ */ new Z(), fh = /* @__PURE__ */ new Z(); class io { constructor(e = new Z(), t = new Z(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.direction).multiplyScalar(e).add(this.origin); } lookAt(e) { return this.direction.copy(e).sub(this.origin).normalize(), this; } recast(e) { return this.origin.copy(this.at(e, Wr)), this; } closestPointToPoint(e, t) { t.subVectors(e, this.origin); const r = t.dot(this.direction); return r < 0 ? t.copy(this.origin) : t.copy(this.direction).multiplyScalar(r).add(this.origin); } distanceToPoint(e) { return Math.sqrt(this.distanceSqToPoint(e)); } distanceSqToPoint(e) { const t = Wr.subVectors(e, this.origin).dot(this.direction); return t < 0 ? this.origin.distanceToSquared(e) : (Wr.copy(this.direction).multiplyScalar(t).add(this.origin), Wr.distanceToSquared(e)); } distanceSqToSegment(e, t, r, n) { dh.copy(e).add(t).multiplyScalar(0.5), $l.copy(t).sub(e).normalize(), Sn.copy(this.origin).sub(dh); const o = e.distanceTo(t) * 0.5, a = -this.direction.dot($l), s = Sn.dot(this.direction), c = -Sn.dot($l), l = Sn.lengthSq(), h = Math.abs(1 - a * a); let u, p, g, m; if (h > 0) if (u = a * c - s, p = a * s - c, m = o * h, u >= 0) if (p >= -m) if (p <= m) { const d = 1 / h; u *= d, p *= d, g = u * (u + a * p + 2 * s) + p * (a * u + p + 2 * c) + l; } else p = o, u = Math.max(0, -(a * p + s)), g = -u * u + p * (p + 2 * c) + l; else p = -o, u = Math.max(0, -(a * p + s)), g = -u * u + p * (p + 2 * c) + l; else p <= -m ? (u = Math.max(0, -(-a * o + s)), p = u > 0 ? -o : Math.min(Math.max(-o, -c), o), g = -u * u + p * (p + 2 * c) + l) : p <= m ? (u = 0, p = Math.min(Math.max(-o, -c), o), g = p * (p + 2 * c) + l) : (u = Math.max(0, -(a * o + s)), p = u > 0 ? o : Math.min(Math.max(-o, -c), o), g = -u * u + p * (p + 2 * c) + l); else p = a > 0 ? -o : o, u = Math.max(0, -(a * p + s)), g = -u * u + p * (p + 2 * c) + l; return r && r.copy(this.direction).multiplyScalar(u).add(this.origin), n && n.copy($l).multiplyScalar(p).add(dh), g; } intersectSphere(e, t) { Wr.subVectors(e.center, this.origin); const r = Wr.dot(this.direction), n = Wr.dot(Wr) - r * r, o = e.radius * e.radius; if (n > o) return null; const a = Math.sqrt(o - n), s = r - a, c = r + a; return s < 0 && c < 0 ? null : s < 0 ? this.at(c, t) : this.at(s, 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 r = -(this.origin.dot(e.normal) + e.constant) / t; return r >= 0 ? r : null; } intersectPlane(e, t) { const r = this.distanceToPlane(e); return r === null ? null : this.at(r, t); } intersectsPlane(e) { const t = e.distanceToPoint(this.origin); return t === 0 || e.normal.dot(this.direction) * t < 0; } intersectBox(e, t) { let r, n, o, a, s, c; const l = 1 / this.direction.x, h = 1 / this.direction.y, u = 1 / this.direction.z, p = this.origin; return l >= 0 ? (r = (e.min.x - p.x) * l, n = (e.max.x - p.x) * l) : (r = (e.max.x - p.x) * l, n = (e.min.x - p.x) * l), h >= 0 ? (o = (e.min.y - p.y) * h, a = (e.max.y - p.y) * h) : (o = (e.max.y - p.y) * h, a = (e.min.y - p.y) * h), r > a || o > n || ((o > r || r !== r) && (r = o), (a < n || n !== n) && (n = a), u >= 0 ? (s = (e.min.z - p.z) * u, c = (e.max.z - p.z) * u) : (s = (e.max.z - p.z) * u, c = (e.min.z - p.z) * u), r > c || s > n) || ((s > r || r !== r) && (r = s), (c < n || n !== n) && (n = c), n < 0) ? null : this.at(r >= 0 ? r : n, t); } intersectsBox(e) { return this.intersectBox(e, Wr) !== null; } intersectTriangle(e, t, r, n, o) { ph.subVectors(t, e), ql.subVectors(r, e), fh.crossVectors(ph, ql); let a = this.direction.dot(fh), s; if (a > 0) { if (n) return null; s = 1; } else if (a < 0) s = -1, a = -a; else return null; Sn.subVectors(this.origin, e); const c = s * this.direction.dot(ql.crossVectors(Sn, ql)); if (c < 0) return null; const l = s * this.direction.dot(ph.cross(Sn)); if (l < 0 || c + l > a) return null; const h = -s * Sn.dot(fh); return h < 0 ? null : this.at(h / a, o); } 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 $e { constructor() { this.elements = [ 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1 ], arguments.length > 0 && console.error("THREE.Matrix4: the constructor no longer reads arguments. use .set() instead."); } set(e, t, r, n, o, a, s, c, l, h, u, p, g, m, d, y) { const f = this.elements; return f[0] = e, f[4] = t, f[8] = r, f[12] = n, f[1] = o, f[5] = a, f[9] = s, f[13] = c, f[2] = l, f[6] = h, f[10] = u, f[14] = p, f[3] = g, f[7] = m, f[11] = d, f[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 $e().fromArray(this.elements); } copy(e) { const t = this.elements, r = e.elements; return t[0] = r[0], t[1] = r[1], t[2] = r[2], t[3] = r[3], t[4] = r[4], t[5] = r[5], t[6] = r[6], t[7] = r[7], t[8] = r[8], t[9] = r[9], t[10] = r[10], t[11] = r[11], t[12] = r[12], t[13] = r[13], t[14] = r[14], t[15] = r[15], this; } copyPosition(e) { const t = this.elements, r = e.elements; return t[12] = r[12], t[13] = r[13], t[14] = r[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, r) { return e.setFromMatrixColumn(this, 0), t.setFromMatrixColumn(this, 1), r.setFromMatrixColumn(this, 2), this; } makeBasis(e, t, r) { return this.set( e.x, t.x, r.x, 0, e.y, t.y, r.y, 0, e.z, t.z, r.z, 0, 0, 0, 0, 1 ), this; } extractRotation(e) { const t = this.elements, r = e.elements, n = 1 / ia.setFromMatrixColumn(e, 0).length(), o = 1 / ia.setFromMatrixColumn(e, 1).length(), a = 1 / ia.setFromMatrixColumn(e, 2).length(); return t[0] = r[0] * n, t[1] = r[1] * n, t[2] = r[2] * n, t[3] = 0, t[4] = r[4] * o, t[5] = r[5] * o, t[6] = r[6] * o, t[7] = 0, t[8] = r[8] * a, t[9] = r[9] * a, t[10] = r[10] * a, t[11] = 0, t[12] = 0, t[13] = 0, t[14] = 0, t[15] = 1, this; } makeRotationFromEuler(e) { e && e.isEuler || console.error("THREE.Matrix4: .makeRotationFromEuler() now expects a Euler rotation rather than a Vector3 and order."); const t = this.elements, r = e.x, n = e.y, o = e.z, a = Math.cos(r), s = Math.sin(r), c = Math.cos(n), l = Math.sin(n), h = Math.cos(o), u = Math.sin(o); if (e.order === "XYZ") { const p = a * h, g = a * u, m = s * h, d = s * u; t[0] = c * h, t[4] = -c * u, t[8] = l, t[1] = g + m * l, t[5] = p - d * l, t[9] = -s * c, t[2] = d - p * l, t[6] = m + g * l, t[10] = a * c; } else if (e.order === "YXZ") { const p = c * h, g = c * u, m = l * h, d = l * u; t[0] = p + d * s, t[4] = m * s - g, t[8] = a * l, t[1] = a * u, t[5] = a * h, t[9] = -s, t[2] = g * s - m, t[6] = d + p * s, t[10] = a * c; } else if (e.order === "ZXY") { const p = c * h, g = c * u, m = l * h, d = l * u; t[0] = p - d * s, t[4] = -a * u, t[8] = m + g * s, t[1] = g + m * s, t[5] = a * h, t[9] = d - p * s, t[2] = -a * l, t[6] = s, t[10] = a * c; } else if (e.order === "ZYX") { const p = a * h, g = a * u, m = s * h, d = s * u; t[0] = c * h, t[4] = m * l - g, t[8] = p * l + d, t[1] = c * u, t[5] = d * l + p, t[9] = g * l - m, t[2] = -l, t[6] = s * c, t[10] = a * c; } else if (e.order === "YZX") { const p = a * c, g = a * l, m = s * c, d = s * l; t[0] = c * h, t[4] = d - p * u, t[8] = m * u + g, t[1] = u, t[5] = a * h, t[9] = -s * h, t[2] = -l * h, t[6] = g * u + m, t[10] = p - d * u; } else if (e.order === "XZY") { const p = a * c, g = a * l, m = s * c, d = s * l; t[0] = c * h, t[4] = -u, t[8] = l * h, t[1] = p * u + d, t[5] = a * h, t[9] = g * u - m, t[2] = m * u - g, t[6] = s * h, t[10] = d * u + p; } 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(wO, e, _O); } lookAt(e, t, r) { const n = this.elements; return Gi.subVectors(e, t), Gi.lengthSq() === 0 && (Gi.z = 1), Gi.normalize(), Tn.crossVectors(r, Gi), Tn.lengthSq() === 0 && (Math.abs(r.z) === 1 ? Gi.x += 1e-4 : Gi.z += 1e-4, Gi.normalize(), Tn.crossVectors(r, Gi)), Tn.normalize(), Xl.crossVectors(Gi, Tn), n[0] = Tn.x, n[4] = Xl.x, n[8] = Gi.x, n[1] = Tn.y, n[5] = Xl.y, n[9] = Gi.y, n[2] = Tn.z, n[6] = Xl.z, n[10] = Gi.z, this; } multiply(e, t) { return t !== void 0 ? (console.warn("THREE.Matrix4: .multiply() now only accepts one argument. Use .multiplyMatrices( a, b ) instead."), this.multiplyMatrices(e, t)) : this.multiplyMatrices(this, e); } premultiply(e) { return this.multiplyMatrices(e, this); } multiplyMatrices(e, t) { const r = e.elements, n = t.elements, o = this.elements, a = r[0], s = r[4], c = r[8], l = r[12], h = r[1], u = r[5], p = r[9], g = r[13], m = r[2], d = r[6], y = r[10], f = r[14], v = r[3], M = r[7], S = r[11], T = r[15], x = n[0], w = n[4], A = n[8], _ = n[12], E = n[1], O = n[5], L = n[9], C = n[13], I = n[2], R = n[6], b = n[10], P = n[14], N = n[3], D = n[7], k = n[11], V = n[15]; return o[0] = a * x + s * E + c * I + l * N, o[4] = a * w + s * O + c * R + l * D, o[8] = a * A + s * L + c * b + l * k, o[12] = a * _ + s * C + c * P + l * V, o[1] = h * x + u * E + p * I + g * N, o[5] = h * w + u * O + p * R + g * D, o[9] = h * A + u * L + p * b + g * k, o[13] = h * _ + u * C + p * P + g * V, o[2] = m * x + d * E + y * I + f * N, o[6] = m * w + d * O + y * R + f * D, o[10] = m * A + d * L + y * b + f * k, o[14] = m * _ + d * C + y * P + f * V, o[3] = v * x + M * E + S * I + T * N, o[7] = v * w + M * O + S * R + T * D, o[11] = v * A + M * L + S * b + T * k, o[15] = v * _ + M * C + S * P + T * V, 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], r = e[4], n = e[8], o = e[12], a = e[1], s = e[5], c = e[9], l = e[13], h = e[2], u = e[6], p = e[10], g = e[14], m = e[3], d = e[7], y = e[11], f = e[15]; return m * (+o * c * u - n * l * u - o * s * p + r * l * p + n * s * g - r * c * g) + d * (+t * c * g - t * l * p + o * a * p - n * a * g + n * l * h - o * c * h) + y * (+t * l * u - t * s * g - o * a * u + r * a * g + o * s * h - r * l * h) + f * (-n * s * h - t * c * u + t * s * p + n * a * u - r * a * p + r * c * h); } 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, r) { const n = this.elements; return e.isVector3 ? (n[12] = e.x, n[13] = e.y, n[14] = e.z) : (n[12] = e, n[13] = t, n[14] = r), this; } invert() { const e = this.elements, t = e[0], r = e[1], n = e[2], o = e[3], a = e[4], s = e[5], c = e[6], l = e[7], h = e[8], u = e[9], p = e[10], g = e[11], m = e[12], d = e[13], y = e[14], f = e[15], v = u * y * l - d * p * l + d * c * g - s * y * g - u * c * f + s * p * f, M = m * p * l - h * y * l - m * c * g + a * y * g + h * c * f - a * p * f, S = h * d * l - m * u * l + m * s * g - a * d * g - h * s * f + a * u * f, T = m * u * c - h * d * c - m * s * p + a * d * p + h * s * y - a * u * y, x = t * v + r * M + n * S + o * T; if (x === 0) return this.set(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); const w = 1 / x; return e[0] = v * w, e[1] = (d * p * o - u * y * o - d * n * g + r * y * g + u * n * f - r * p * f) * w, e[2] = (s * y * o - d * c * o + d * n * l - r * y * l - s * n * f + r * c * f) * w, e[3] = (u * c * o - s * p * o - u * n * l + r * p * l + s * n * g - r * c * g) * w, e[4] = M * w, e[5] = (h * y * o - m * p * o + m * n * g - t * y * g - h * n * f + t * p * f) * w, e[6] = (m * c * o - a * y * o - m * n * l + t * y * l + a * n * f - t * c * f) * w, e[7] = (a * p * o - h * c * o + h * n * l - t * p * l - a * n * g + t * c * g) * w, e[8] = S * w, e[9] = (m * u * o - h * d * o - m * r * g + t * d * g + h * r * f - t * u * f) * w, e[10] = (a * d * o - m * s * o + m * r * l - t * d * l - a * r * f + t * s * f) * w, e[11] = (h * s * o - a * u * o - h * r * l + t * u * l + a * r * g - t * s * g) * w, e[12] = T * w, e[13] = (h * d * n - m * u * n + m * r * p - t * d * p - h * r * y + t * u * y) * w, e[14] = (m * s * n - a * d * n - m * r * c + t * d * c + a * r * y - t * s * y) * w, e[15] = (a * u * n - h * s * n + h * r * c - t * u * c - a * r * p + t * s * p) * w, this; } scale(e) { const t = this.elements, r = e.x, n = e.y, o = e.z; return t[0] *= r, t[4] *= n, t[8] *= o, t[1] *= r, t[5] *= n, t[9] *= o, t[2] *= r, t[6] *= n, t[10] *= o, t[3] *= r, t[7] *= n, t[11] *= o, this; } getMaxScaleOnAxis() { const e = this.elements, t = e[0] * e[0] + e[1] * e[1] + e[2] * e[2], r = e[4] * e[4] + e[5] * e[5] + e[6] * e[6], n = e[8] * e[8] + e[9] * e[9] + e[10] * e[10]; return Math.sqrt(Math.max(t, r, n)); } makeTranslation(e, t, r) { return this.set( 1, 0, 0, e, 0, 1, 0, t, 0, 0, 1, r, 0, 0, 0, 1 ), this; } makeRotationX(e) { const t = Math.cos(e), r = Math.sin(e); return this.set( 1, 0, 0, 0, 0, t, -r, 0, 0, r, t, 0, 0, 0, 0, 1 ), this; } makeRotationY(e) { const t = Math.cos(e), r = Math.sin(e); return this.set( t, 0, r, 0, 0, 1, 0, 0, -r, 0, t, 0, 0, 0, 0, 1 ), this; } makeRotationZ(e) { const t = Math.cos(e), r = Math.sin(e); return this.set( t, -r, 0, 0, r, t, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1 ), this; } makeRotationAxis(e, t) { const r = Math.cos(t), n = Math.sin(t), o = 1 - r, a = e.x, s = e.y, c = e.z, l = o * a, h = o * s; return this.set( l * a + r, l * s - n * c, l * c + n * s, 0, l * s + n * c, h * s + r, h * c - n * a, 0, l * c - n * s, h * c + n * a, o * c * c + r, 0, 0, 0, 0, 1 ), this; } makeScale(e, t, r) { return this.set( e, 0, 0, 0, 0, t, 0, 0, 0, 0, r, 0, 0, 0, 0, 1 ), this; } makeShear(e, t, r, n, o, a) { return this.set( 1, r, o, 0, e, 1, a, 0, t, n, 1, 0, 0, 0, 0, 1 ), this; } compose(e, t, r) { const n = this.elements, o = t._x, a = t._y, s = t._z, c = t._w, l = o + o, h = a + a, u = s + s, p = o * l, g = o * h, m = o * u, d = a * h, y = a * u, f = s * u, v = c * l, M = c * h, S = c * u, T = r.x, x = r.y, w = r.z; return n[0] = (1 - (d + f)) * T, n[1] = (g + S) * T, n[2] = (m - M) * T, n[3] = 0, n[4] = (g - S) * x, n[5] = (1 - (p + f)) * x, n[6] = (y + v) * x, n[7] = 0, n[8] = (m + M) * w, n[9] = (y - v) * w, n[10] = (1 - (p + d)) * w, n[11] = 0, n[12] = e.x, n[13] = e.y, n[14] = e.z, n[15] = 1, this; } decompose(e, t, r) { const n = this.elements; let o = ia.set(n[0], n[1], n[2]).length(); const a = ia.set(n[4], n[5], n[6]).length(), s = ia.set(n[8], n[9], n[10]).length(); this.determinant() < 0 && (o = -o), e.x = n[12], e.y = n[13], e.z = n[14], cr.copy(this); const c = 1 / o, l = 1 / a, h = 1 / s; return cr.elements[0] *= c, cr.elements[1] *= c, cr.elements[2] *= c, cr.elements[4] *= l, cr.elements[5] *= l, cr.elements[6] *= l, cr.elements[8] *= h, cr.elements[9] *= h, cr.elements[10] *= h, t.setFromRotationMatrix(cr), r.x = o, r.y = a, r.z = s, this; } makePerspective(e, t, r, n, o, a) { a === void 0 && console.warn("THREE.Matrix4: .makePerspective() has been redefined and has a new signature. Please check the docs."); const s = this.elements, c = 2 * o / (t - e), l = 2 * o / (r - n), h = (t + e) / (t - e), u = (r + n) / (r - n), p = -(a + o) / (a - o), g = -2 * a * o / (a - o); return s[0] = c, s[4] = 0, s[8] = h, s[12] = 0, s[1] = 0, s[5] = l, s[9] = u, s[13] = 0, s[2] = 0, s[6] = 0, s[10] = p, s[14] = g, s[3] = 0, s[7] = 0, s[11] = -1, s[15] = 0, this; } makeOrthographic(e, t, r, n, o, a) { const s = this.elements, c = 1 / (t - e), l = 1 / (r - n), h = 1 / (a - o), u = (t + e) * c, p = (r + n) * l, g = (a + o) * h; return s[0] = 2 * c, s[4] = 0, s[8] = 0, s[12] = -u, s[1] = 0, s[5] = 2 * l, s[9] = 0, s[13] = -p, s[2] = 0, s[6] = 0, s[10] = -2 * h, s[14] = -g, s[3] = 0, s[7] = 0, s[11] = 0, s[15] = 1, this; } equals(e) { const t = this.elements, r = e.elements; for (let n = 0; n < 16; n++) if (t[n] !== r[n]) return !1; return !0; } fromArray(e, t = 0) { for (let r = 0; r < 16; r++) this.elements[r] = e[r + t]; return this; } toArray(e = [], t = 0) { const r = this.elements; return e[t] = r[0], e[t + 1] = r[1], e[t + 2] = r[2], e[t + 3] = r[3], e[t + 4] = r[4], e[t + 5] = r[5], e[t + 6] = r[6], e[t + 7] = r[7], e[t + 8] = r[8], e[t + 9] = r[9], e[t + 10] = r[10], e[t + 11] = r[11], e[t + 12] = r[12], e[t + 13] = r[13], e[t + 14] = r[14], e[t + 15] = r[15], e; } } $e.prototype.isMatrix4 = !0; const ia = /* @__PURE__ */ new Z(), cr = /* @__PURE__ */ new $e(), wO = /* @__PURE__ */ new Z(0, 0, 0), _O = /* @__PURE__ */ new Z(1, 1, 1), Tn = /* @__PURE__ */ new Z(), Xl = /* @__PURE__ */ new Z(), Gi = /* @__PURE__ */ new Z(), fg = /* @__PURE__ */ new $e(), mg = /* @__PURE__ */ new vi(); class Wo { constructor(e = 0, t = 0, r = 0, n = Wo.DefaultOrder) { this._x = e, this._y = t, this._z = r, this._order = n; } 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, r, n = this._order) { return this._x = e, this._y = t, this._z = r, this._order = n, 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, r = !0) { const n = e.elements, o = n[0], a = n[4], s = n[8], c = n[1], l = n[5], h = n[9], u = n[2], p = n[6], g = n[10]; switch (t) { case "XYZ": this._y = Math.asin(mi(s, -1, 1)), Math.abs(s) < 0.9999999 ? (this._x = Math.atan2(-h, g), this._z = Math.atan2(-a, o)) : (this._x = Math.atan2(p, l), this._z = 0); break; case "YXZ": this._x = Math.asin(-mi(h, -1, 1)), Math.abs(h) < 0.9999999 ? (this._y = Math.atan2(s, g), this._z = Math.atan2(c, l)) : (this._y = Math.atan2(-u, o), this._z = 0); break; case "ZXY": this._x = Math.asin(mi(p, -1, 1)), Math.abs(p) < 0.9999999 ? (this._y = Math.atan2(-u, g), this._z = Math.atan2(-a, l)) : (this._y = 0, this._z = Math.atan2(c, o)); break; case "ZYX": this._y = Math.asin(-mi(u, -1, 1)), Math.abs(u) < 0.9999999 ? (this._x = Math.atan2(p, g), this._z = Math.atan2(c, o)) : (this._x = 0, this._z = Math.atan2(-a, l)); break; case "YZX": this._z = Math.asin(mi(c, -1, 1)), Math.abs(c) < 0.9999999 ? (this._x = Math.atan2(-h, l), this._y = Math.atan2(-u, o)) : (this._x = 0, this._y = Math.atan2(s, g)); break; case "XZY": this._z = Math.asin(-mi(a, -1, 1)), Math.abs(a) < 0.9999999 ? (this._x = Math.atan2(p, l), this._y = Math.atan2(s, o)) : (this._x = Math.atan2(-h, g), this._y = 0); break; default: console.warn("THREE.Euler: .setFromRotationMatrix() encountered an unknown order: " + t); } return this._order = t, r === !0 && this._onChangeCallback(), this; } setFromQuaternion(e, t, r) { return fg.makeRotationFromQuaternion(e), this.setFromRotationMatrix(fg, t, r); } setFromVector3(e, t = this._order) { return this.set(e.x, e.y, e.z, t); } reorder(e) { return mg.setFromEuler(this), this.setFromQuaternion(mg, 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; } toVector3(e) { return e ? e.set(this._x, this._y, this._z) : new Z(this._x, this._y, this._z); } _onChange(e) { return this._onChangeCallback = e, this; } _onChangeCallback() { } } Wo.prototype.isEuler = !0; Wo.DefaultOrder = "XYZ"; Wo.RotationOrders = ["XYZ", "YZX", "ZXY", "XZY", "YXZ", "ZYX"]; class Zp { constructor() { this.mask = 1; } set(e) { this.mask = 1 << e | 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; } } let MO = 0; const gg = /* @__PURE__ */ new Z(), ra = /* @__PURE__ */ new vi(), $r = /* @__PURE__ */ new $e(), Zl = /* @__PURE__ */ new Z(), ws = /* @__PURE__ */ new Z(), SO = /* @__PURE__ */ new Z(), TO = /* @__PURE__ */ new vi(), vg = /* @__PURE__ */ new Z(1, 0, 0), yg = /* @__PURE__ */ new Z(0, 1, 0), bg = /* @__PURE__ */ new Z(0, 0, 1), EO = { type: "added" }, xg = { type: "removed" }; class nt extends to { constructor() { super(), Object.defineProperty(this, "id", { value: MO++ }), this.uuid = qi(), this.name = "", this.type = "Object3D", this.parent = null, this.children = [], this.up = nt.DefaultUp.clone(); const e = new Z(), t = new Wo(), r = new vi(), n = new Z(1, 1, 1); function o() { r.setFromEuler(t, !1); } function a() { t.setFromQuaternion(r, void 0, !1); } t._onChange(o), r._onChange(a), Object.defineProperties(this, { position: { configurable: !0, enumerable: !0, value: e }, rotation: { configurable: !0, enumerable: !0, value: t }, quaternion: { configurable: !0, enumerable: !0, value: r }, scale: { configurable: !0, enumerable: !0, value: n }, modelViewMatrix: { value: new $e() }, normalMatrix: { value: new ii() } }), this.matrix = new $e(), this.matrixWorld = new $e(), this.matrixAutoUpdate = nt.DefaultMatrixAutoUpdate, this.matrixWorldNeedsUpdate = !1, this.layers = new Zp(), this.visible = !0, this.castShadow = !1, this.receiveShadow = !1, this.frustumCulled = !0, this.renderOrder = 0, this.animations = [], this.userData = {}; } 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 ra.setFromAxisAngle(e, t), this.quaternion.multiply(ra), this; } rotateOnWorldAxis(e, t) { return ra.setFromAxisAngle(e, t), this.quaternion.premultiply(ra), this; } rotateX(e) { return this.rotateOnAxis(vg, e); } rotateY(e) { return this.rotateOnAxis(yg, e); } rotateZ(e) { return this.rotateOnAxis(bg, e); } translateOnAxis(e, t) { return gg.copy(e).applyQuaternion(this.quaternion), this.position.add(gg.multiplyScalar(t)), this; } translateX(e) { return this.translateOnAxis(vg, e); } translateY(e) { return this.translateOnAxis(yg, e); } translateZ(e) { return this.translateOnAxis(bg, e); } localToWorld(e) { return e.applyMatrix4(this.matrixWorld); } worldToLocal(e) { return e.applyMatrix4($r.copy(this.matrixWorld).invert()); } lookAt(e, t, r) { e.isVector3 ? Zl.copy(e) : Zl.set(e, t, r); const n = this.parent; this.updateWorldMatrix(!0, !1), ws.setFromMatrixPosition(this.matrixWorld), this.isCamera || this.isLight ? $r.lookAt(ws, Zl, this.up) : $r.lookAt(Zl, ws, this.up), this.quaternion.setFromRotationMatrix($r), n && ($r.extractRotation(n.matrixWorld), ra.setFromRotationMatrix($r), this.quaternion.premultiply(ra.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.parent !== null && e.parent.remove(e), e.parent = this, this.children.push(e), e.dispatchEvent(EO)) : console.error("THREE.Object3D.add: object not an instance of THREE.Object3D.", e), this); } remove(e) { if (arguments.length > 1) { for (let r = 0; r < arguments.length; r++) this.remove(arguments[r]); return this; } const t = this.children.indexOf(e); return t !== -1 && (e.parent = null, this.children.splice(t, 1), e.dispatchEvent(xg)), this; } removeFromParent() { const e = this.parent; return e !== null && e.remove(this), this; } clear() { for (let e = 0; e < this.children.length; e++) { const t = this.children[e]; t.parent = null, t.dispatchEvent(xg); } return this.children.length = 0, this; } attach(e) { return this.updateWorldMatrix(!0, !1), $r.copy(this.matrixWorld).invert(), e.parent !== null && (e.parent.updateWorldMatrix(!0, !1), $r.multiply(e.parent.matrixWorld)), e.applyMatrix4($r), this.add(e), e.updateWorldMatrix(!1, !0), 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 r = 0, n = this.children.length; r < n; r++) { const o = this.children[r].getObjectByProperty(e, t); if (o !== void 0) return o; } } getWorldPosition(e) { return this.updateWorldMatrix(!0, !1), e.setFromMatrixPosition(this.matrixWorld); } getWorldQuaternion(e) { return this.updateWorldMatrix(!0, !1), this.matrixWorld.decompose(ws, e, SO), e; } getWorldScale(e) { return this.updateWorldMatrix(!0, !1), this.matrixWorld.decompose(ws, TO, 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 r = 0, n = t.length; r < n; r++) t[r].traverse(e); } traverseVisible(e) { if (this.visible === !1) return; e(this); const t = this.children; for (let r = 0, n = t.length; r < n; r++) t[r].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.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 r = 0, n = t.length; r < n; r++) t[r].updateMatrixWorld(e); } updateWorldMatrix(e, t) { const r = this.parent; if (e === !0 && r !== null && r.updateWorldMatrix(!0, !1), this.matrixAutoUpdate && this.updateMatrix(), this.parent === null ? this.matrixWorld.copy(this.matrix) : this.matrixWorld.multiplyMatrices(this.parent.matrixWorld, this.matrix), t === !0) { const n = this.children; for (let o = 0, a = n.length; o < a; o++) n[o].updateWorldMatrix(!1, !0); } } toJSON(e) { const t = e === void 0 || typeof e == "string", r = {}; t && (e = { geometries: {}, materials: {}, textures: {}, images: {}, shapes: {}, skeletons: {}, animations: {} }, r.metadata = { version: 4.5, type: "Object", generator: "Object3D.toJSON" }); const n = {}; n.uuid = this.uuid, n.type = this.type, this.name !== "" && (n.name = this.name), this.castShadow === !0 && (n.castShadow = !0), this.receiveShadow === !0 && (n.receiveShadow = !0), this.visible === !1 && (n.visible = !1), this.frustumCulled === !1 && (n.frustumCulled = !1), this.renderOrder !== 0 && (n.renderOrder = this.renderOrder), JSON.stringify(this.userData) !== "{}" && (n.userData = this.userData), n.layers = this.layers.mask, n.matrix = this.matrix.toArray(), this.matrixAutoUpdate === !1 && (n.matrixAutoUpdate = !1), this.isInstancedMesh && (n.type = "InstancedMesh", n.count = this.count, n.instanceMatrix = this.instanceMatrix.toJSON(), this.instanceColor !== null && (n.instanceColor = this.instanceColor.toJSON())); function o(s, c) { return s[c.uuid] === void 0 && (s[c.uuid] = c.toJSON(e)), c.uuid; } if (this.isScene) this.background && (this.background.isColor ? n.background = this.background.toJSON() : this.background.isTexture && (n.background = this.background.toJSON(e).uuid)), this.environment && this.environment.isTexture && (n.environment = this.environment.toJSON(e).uuid); else if (this.isMesh || this.isLine || this.isPoints) { n.geometry = o(e.geometries, this.geometry); const s = this.geometry.parameters; if (s !== void 0 && s.shapes !== void 0) { const c = s.shapes; if (Array.isArray(c)) for (let l = 0, h = c.length; l < h; l++) { const u = c[l]; o(e.shapes, u); } else o(e.shapes, c); } } if (this.isSkinnedMesh && (n.bindMode = this.bindMode, n.bindMatrix = this.bindMatrix.toArray(), this.skeleton !== void 0 && (o(e.skeletons, this.skeleton), n.skeleton = this.skeleton.uuid)), this.material !== void 0) if (Array.isArray(this.material)) { const s = []; for (let c = 0, l = this.material.length; c < l; c++) s.push(o(e.materials, this.material[c])); n.material = s; } else n.material = o(e.materials, this.material); if (this.children.length > 0) { n.children = []; for (let s = 0; s < this.children.length; s++) n.children.push(this.children[s].toJSON(e).object); } if (this.animations.length > 0) { n.animations = []; for (let s = 0; s < this.animations.length; s++) { const c = this.animations[s]; n.animations.push(o(e.animations, c)); } } if (t) { const s = a(e.geometries), c = a(e.materials), l = a(e.textures), h = a(e.images), u = a(e.shapes), p = a(e.skeletons), g = a(e.animations); s.length > 0 && (r.geometries = s), c.length > 0 && (r.materials = c), l.length > 0 && (r.textures = l), h.length > 0 && (r.images = h), u.length > 0 && (r.shapes = u), p.length > 0 && (r.skeletons = p), g.length > 0 && (r.animations = g); } return r.object = n, r; function a(s) { const c = []; for (const l in s) { const h = s[l]; delete h.metadata, c.push(h); } return c; } } 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.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.userData = JSON.parse(JSON.stringify(e.userData)), t === !0) for (let r = 0; r < e.children.length; r++) { const n = e.children[r]; this.add(n.clone()); } return this; } } nt.DefaultUp = new Z(0, 1, 0); nt.DefaultMatrixAutoUpdate = !0; nt.prototype.isObject3D = !0; const ur = /* @__PURE__ */ new Z(), qr = /* @__PURE__ */ new Z(), mh = /* @__PURE__ */ new Z(), Xr = /* @__PURE__ */ new Z(), na = /* @__PURE__ */ new Z(), oa = /* @__PURE__ */ new Z(), wg = /* @__PURE__ */ new Z(), gh = /* @__PURE__ */ new Z(), vh = /* @__PURE__ */ new Z(), yh = /* @__PURE__ */ new Z(); class Xt { constructor(e = new Z(), t = new Z(), r = new Z()) { this.a = e, this.b = t, this.c = r; } static getNormal(e, t, r, n) { n.subVectors(r, t), ur.subVectors(e, t), n.cross(ur); const o = n.lengthSq(); return o > 0 ? n.multiplyScalar(1 / Math.sqrt(o)) : n.set(0, 0, 0); } // static/instance method to calculate barycentric coordinates // based on: http://www.blackpawn.com/texts/pointinpoly/default.html static getBarycoord(e, t, r, n, o) { ur.subVectors(n, t), qr.subVectors(r, t), mh.subVectors(e, t); const a = ur.dot(ur), s = ur.dot(qr), c = ur.dot(mh), l = qr.dot(qr), h = qr.dot(mh), u = a * l - s * s; if (u === 0) return o.set(-2, -1, -1); const p = 1 / u, g = (l * c - s * h) * p, m = (a * h - s * c) * p; return o.set(1 - g - m, m, g); } static containsPoint(e, t, r, n) { return this.getBarycoord(e, t, r, n, Xr), Xr.x >= 0 && Xr.y >= 0 && Xr.x + Xr.y <= 1; } static getUV(e, t, r, n, o, a, s, c) { return this.getBarycoord(e, t, r, n, Xr), c.set(0, 0), c.addScaledVector(o, Xr.x), c.addScaledVector(a, Xr.y), c.addScaledVector(s, Xr.z), c; } static isFrontFacing(e, t, r, n) { return ur.subVectors(r, t), qr.subVectors(e, t), ur.cross(qr).dot(n) < 0; } set(e, t, r) { return this.a.copy(e), this.b.copy(t), this.c.copy(r), this; } setFromPointsAndIndices(e, t, r, n) { return this.a.copy(e[t]), this.b.copy(e[r]), this.c.copy(e[n]), 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 ur.subVectors(this.c, this.b), qr.subVectors(this.a, this.b), ur.cross(qr).length() * 0.5; } getMidpoint(e) { return e.addVectors(this.a, this.b).add(this.c).multiplyScalar(1 / 3); } getNormal(e) { return Xt.getNormal(this.a, this.b, this.c, e); } getPlane(e) { return e.setFromCoplanarPoints(this.a, this.b, this.c); } getBarycoord(e, t) { return Xt.getBarycoord(e, this.a, this.b, this.c, t); } getUV(e, t, r, n, o) { return Xt.getUV(e, this.a, this.b, this.c, t, r, n, o); } containsPoint(e) { return Xt.containsPoint(e, this.a, this.b, this.c); } isFrontFacing(e) { return Xt.isFrontFacing(this.a, this.b, this.c, e); } intersectsBox(e) { return e.intersectsTriangle(this); } closestPointToPoint(e, t) { const r = this.a, n = this.b, o = this.c; let a, s; na.subVectors(n, r), oa.subVectors(o, r), gh.subVectors(e, r); const c = na.dot(gh), l = oa.dot(gh); if (c <= 0 && l <= 0) return t.copy(r); vh.subVectors(e, n); const h = na.dot(vh), u = oa.dot(vh); if (h >= 0 && u <= h) return t.copy(n); const p = c * u - h * l; if (p <= 0 && c >= 0 && h <= 0) return a = c / (c - h), t.copy(r).addScaledVector(na, a); yh.subVectors(e, o); const g = na.dot(yh), m = oa.dot(yh); if (m >= 0 && g <= m) return t.copy(o); const d = g * l - c * m; if (d <= 0 && l >= 0 && m <= 0) return s = l / (l - m), t.copy(r).addScaledVector(oa, s); const y = h * m - g * u; if (y <= 0 && u - h >= 0 && g - m >= 0) return wg.subVectors(o, n), s = (u - h) / (u - h + (g - m)), t.copy(n).addScaledVector(wg, s); const f = 1 / (y + d + p); return a = d * f, s = p * f, t.copy(r).addScaledVector(na, a).addScaledVector(oa, s); } equals(e) { return e.a.equals(this.a) && e.b.equals(this.b) && e.c.equals(this.c); } } let AO = 0; class Qt extends to { constructor() { super(), Object.defineProperty(this, "id", { value: AO++ }), this.uuid = qi(), this.name = "", this.type = "Material", this.fog = !0, this.blending = Sa, this.side = qn, this.vertexColors = !1, this.opacity = 1, this.transparent = !1, this.blendSrc = Vp, this.blendDst = Up, this.blendEquation = bo, this.blendSrcAlpha = null, this.blendDstAlpha = null, this.blendEquationAlpha = null, this.depthFunc = Kc, this.depthTest = !0, this.depthWrite = !0, this.stencilWriteMask = 255, this.stencilFunc = hx, this.stencilRef = 0, this.stencilFuncMask = 255, this.stencilFail = Uc, this.stencilZFail = Uc, this.stencilZPass = Uc, 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.alphaTest = 0, this.alphaToCoverage = !1, this.premultipliedAlpha = !1, this.visible = !0, this.toneMapped = !0, this.userData = {}, this.version = 0; } onBuild() { } onBeforeCompile() { } customProgramCacheKey() { return this.onBeforeCompile.toString(); } setValues(e) { if (e !== void 0) for (const t in e) { const r = e[t]; if (r === void 0) { console.warn("THREE.Material: '" + t + "' parameter is undefined."); continue; } if (t === "shading") { console.warn("THREE." + this.type + ": .shading has been removed. Use the boolean .flatShading instead."), this.flatShading = r === Fp; continue; } const n = this[t]; if (n === void 0) { console.warn("THREE." + this.type + ": '" + t + "' is not a property of this material."); continue; } n && n.isColor ? n.set(r) : n && n.isVector3 && r && r.isVector3 ? n.copy(r) : this[t] = r; } } toJSON(e) { const t = e === void 0 || typeof e == "string"; t && (e = { textures: {}, images: {} }); const r = { metadata: { version: 4.5, type: "Material", generator: "Material.toJSON" } }; r.uuid = this.uuid, r.type = this.type, this.name !== "" && (r.name = this.name), this.color && this.color.isColor && (r.color = this.color.getHex()), this.roughness !== void 0 && (r.roughness = this.roughness), this.metalness !== void 0 && (r.metalness = this.metalness), this.sheen && this.sheen.isColor && (r.sheen = this.sheen.getHex()), this.emissive && this.emissive.isColor && (r.emissive = this.emissive.getHex()), this.emissiveIntensity && this.emissiveIntensity !== 1 && (r.emissiveIntensity = this.emissiveIntensity), this.specular && this.specular.isColor && (r.specular = this.specular.getHex()), this.shininess !== void 0 && (r.shininess = this.shininess), this.clearcoat !== void 0 && (r.clearcoat = this.clearcoat), this.clearcoatRoughness !== void 0 && (r.clearcoatRoughness = this.clearcoatRoughness), this.clearcoatMap && this.clearcoatMap.isTexture && (r.clearcoatMap = this.clearcoatMap.toJSON(e).uuid), this.clearcoatRoughnessMap && this.clearcoatRoughnessMap.isTexture && (r.clearcoatRoughnessMap = this.clearcoatRoughnessMap.toJSON(e).uuid), this.clearcoatNormalMap && this.clearcoatNormalMap.isTexture && (r.clearcoatNormalMap = this.clearcoatNormalMap.toJSON(e).uuid, r.clearcoatNormalScale = this.clearcoatNormalScale.toArray()), this.map && this.map.isTexture && (r.map = this.map.toJSON(e).uuid), this.matcap && this.matcap.isTexture && (r.matcap = this.matcap.toJSON(e).uuid), this.alphaMap && this.alphaMap.isTexture && (r.alphaMap = this.alphaMap.toJSON(e).uuid), this.lightMap && this.lightMap.isTexture && (r.lightMap = this.lightMap.toJSON(e).uuid, r.lightMapIntensity = this.lightMapIntensity), this.aoMap && this.aoMap.isTexture && (r.aoMap = this.aoMap.toJSON(e).uuid, r.aoMapIntensity = this.aoMapIntensity), this.bumpMap && this.bumpMap.isTexture && (r.bumpMap = this.bumpMap.toJSON(e).uuid, r.bumpScale = this.bumpScale), this.normalMap && this.normalMap.isTexture && (r.normalMap = this.normalMap.toJSON(e).uuid, r.normalMapType = this.normalMapType, r.normalScale = this.normalScale.toArray()), this.displacementMap && this.displacementMap.isTexture && (r.displacementMap = this.displacementMap.toJSON(e).uuid, r.displacementScale = this.displacementScale, r.displacementBias = this.displacementBias), this.roughnessMap && this.roughnessMap.isTexture && (r.roughnessMap = this.roughnessMap.toJSON(e).uuid), this.metalnessMap && this.metalnessMap.isTexture && (r.metalnessMap = this.metalnessMap.toJSON(e).uuid), this.emissiveMap && this.emissiveMap.isTexture && (r.emissiveMap = this.emissiveMap.toJSON(e).uuid), this.specularMap && this.specularMap.isTexture && (r.specularMap = this.specularMap.toJSON(e).uuid), this.envMap && this.envMap.isTexture && (r.envMap = this.envMap.toJSON(e).uuid, this.combine !== void 0 && (r.combine = this.combine)), this.envMapIntensity !== void 0 && (r.envMapIntensity = this.envMapIntensity), this.reflectivity !== void 0 && (r.reflectivity = this.reflectivity), this.refractionRatio !== void 0 && (r.refractionRatio = this.refractionRatio), this.gradientMap && this.gradientMap.isTexture && (r.gradientMap = this.gradientMap.toJSON(e).uuid), this.transmission !== void 0 && (r.transmission = this.transmission), this.transmissionMap && this.transmissionMap.isTexture && (r.transmissionMap = this.transmissionMap.toJSON(e).uuid), this.thickness !== void 0 && (r.thickness = this.thickness), this.thicknessMap && this.thicknessMap.isTexture && (r.thicknessMap = this.thicknessMap.toJSON(e).uuid), this.attenuationDistance !== void 0 && (r.attenuationDistance = this.attenuationDistance), this.attenuationColor !== void 0 && (r.attenuationColor = this.attenuationColor.getHex()), this.size !== void 0 && (r.size = this.size), this.shadowSide !== null && (r.shadowSide = this.shadowSide), this.sizeAttenuation !== void 0 && (r.sizeAttenuation = this.sizeAttenuation), this.blending !== Sa && (r.blending = this.blending), this.side !== qn && (r.side = this.side), this.vertexColors && (r.vertexColors = !0), this.opacity < 1 && (r.opacity = this.opacity), this.transparent === !0 && (r.transparent = this.transparent), r.depthFunc = this.depthFunc, r.depthTest = this.depthTest, r.depthWrite = this.depthWrite, r.colorWrite = this.colorWrite, r.stencilWrite = this.stencilWrite, r.stencilWriteMask = this.stencilWriteMask, r.stencilFunc = this.stencilFunc, r.stencilRef = this.stencilRef, r.stencilFuncMask = this.stencilFuncMask, r.stencilFail = this.stencilFail, r.stencilZFail = this.stencilZFail, r.stencilZPass = this.stencilZPass, this.rotation && this.rotation !== 0 && (r.rotation = this.rotation), this.polygonOffset === !0 && (r.polygonOffset = !0), this.polygonOffsetFactor !== 0 && (r.polygonOffsetFactor = this.polygonOffsetFactor), this.polygonOffsetUnits !== 0 && (r.polygonOffsetUnits = this.polygonOffsetUnits), this.linewidth && this.linewidth !== 1 && (r.linewidth = this.linewidth), this.dashSize !== void 0 && (r.dashSize = this.dashSize), this.gapSize !== void 0 && (r.gapSize = this.gapSize), this.scale !== void 0 && (r.scale = this.scale), this.dithering === !0 && (r.dithering = !0), this.alphaTest > 0 && (r.alphaTest = this.alphaTest), this.alphaToCoverage === !0 && (r.alphaToCoverage = this.alphaToCoverage), this.premultipliedAlpha === !0 && (r.premultipliedAlpha = this.premultipliedAlpha), this.wireframe === !0 && (r.wireframe = this.wireframe), this.wireframeLinewidth > 1 && (r.wireframeLinewidth = this.wireframeLinewidth), this.wireframeLinecap !== "round" && (r.wireframeLinecap = this.wireframeLinecap), this.wireframeLinejoin !== "round" && (r.wireframeLinejoin = this.wireframeLinejoin), this.morphTargets === !0 && (r.morphTargets = !0), this.morphNormals === !0 && (r.morphNormals = !0), this.flatShading === !0 && (r.flatShading = this.flatShading), this.visible === !1 && (r.visible = !1), this.toneMapped === !1 && (r.toneMapped = !1), JSON.stringify(this.userData) !== "{}" && (r.userData = this.userData); function n(o) { const a = []; for (const s in o) { const c = o[s]; delete c.metadata, a.push(c); } return a; } if (t) { const o = n(e.textures), a = n(e.images); o.length > 0 && (r.textures = o), a.length > 0 && (r.images = a); } return r; } clone() { return new this.constructor().copy(this); } copy(e) { this.name = e.name, this.fog = e.fog, 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.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 r = null; if (t !== null) { const n = t.length; r = new Array(n); for (let o = 0; o !== n; ++o) r[o] = t[o].clone(); } return this.clippingPlanes = r, 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.alphaToCoverage = e.alphaToCoverage, this.premultipliedAlpha = e.premultipliedAlpha, 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++; } } Qt.prototype.isMaterial = !0; const mx = { 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 }, hr = { h: 0, s: 0, l: 0 }, Yl = { h: 0, s: 0, l: 0 }; function bh(i, e, t) { return t < 0 && (t += 1), t > 1 && (t -= 1), t < 1 / 6 ? i + (e - i) * 6 * t : t < 1 / 2 ? e : t < 2 / 3 ? i + (e - i) * 6 * (2 / 3 - t) : i; } function xh(i) { return i < 0.04045 ? i * 0.0773993808 : Math.pow(i * 0.9478672986 + 0.0521327014, 2.4); } function wh(i) { return i < 31308e-7 ? i * 12.92 : 1.055 * Math.pow(i, 0.41666) - 0.055; } class Be { constructor(e, t, r) { return t === void 0 && r === void 0 ? this.set(e) : this.setRGB(e, t, r); } set(e) { return e && e.isColor ? this.copy(e) : typeof e == "number" ? this.setHex(e) : typeof e == "string" && this.setStyle(e), this; } setScalar(e) { return this.r = e, this.g = e, this.b = e, this; } setHex(e) { return e = Math.floor(e), this.r = (e >> 16 & 255) / 255, this.g = (e >> 8 & 255) / 255, this.b = (e & 255) / 255, this; } setRGB(e, t, r) { return this.r = e, this.g = t, this.b = r, this; } setHSL(e, t, r) { if (e = qp(e, 1), t = mi(t, 0, 1), r = mi(r, 0, 1), t === 0) this.r = this.g = this.b = r; else { const n = r <= 0.5 ? r * (1 + t) : r + t - r * t, o = 2 * r - n; this.r = bh(o, n, e + 1 / 3), this.g = bh(o, n, e), this.b = bh(o, n, e - 1 / 3); } return this; } setStyle(e) { function t(n) { n !== void 0 && parseFloat(n) < 1 && console.warn("THREE.Color: Alpha component of " + e + " will be ignored."); } let r; if (r = /^((?:rgb|hsl)a?)\(([^\)]*)\)/.exec(e)) { let n; const o = r[1], a = r[2]; switch (o) { case "rgb": case "rgba": if (n = /^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(a)) return this.r = Math.min(255, parseInt(n[1], 10)) / 255, this.g = Math.min(255, parseInt(n[2], 10)) / 255, this.b = Math.min(255, parseInt(n[3], 10)) / 255, t(n[4]), this; if (n = /^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(a)) return this.r = Math.min(100, parseInt(n[1], 10)) / 100, this.g = Math.min(100, parseInt(n[2], 10)) / 100, this.b = Math.min(100, parseInt(n[3], 10)) / 100, t(n[4]), this; break; case "hsl": case "hsla": if (n = /^\s*(\d*\.?\d+)\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(a)) { const s = parseFloat(n[1]) / 360, c = parseInt(n[2], 10) / 100, l = parseInt(n[3], 10) / 100; return t(n[4]), this.setHSL(s, c, l); } break; } } else if (r = /^\#([A-Fa-f\d]+)$/.exec(e)) { const n = r[1], o = n.length; if (o === 3) return this.r = parseInt(n.charAt(0) + n.charAt(0), 16) / 255, this.g = parseInt(n.charAt(1) + n.charAt(1), 16) / 255, this.b = parseInt(n.charAt(2) + n.charAt(2), 16) / 255, this; if (o === 6) return this.r = parseInt(n.charAt(0) + n.charAt(1), 16) / 255, this.g = parseInt(n.charAt(2) + n.charAt(3), 16) / 255, this.b = parseInt(n.charAt(4) + n.charAt(5), 16) / 255, this; } return e && e.length > 0 ? this.setColorName(e) : this; } setColorName(e) { const t = mx[e.toLowerCase()]; return t !== void 0 ? this.setHex(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; } copyGammaToLinear(e, t = 2) { return this.r = Math.pow(e.r, t), this.g = Math.pow(e.g, t), this.b = Math.pow(e.b, t), this; } copyLinearToGamma(e, t = 2) { const r = t > 0 ? 1 / t : 1; return this.r = Math.pow(e.r, r), this.g = Math.pow(e.g, r), this.b = Math.pow(e.b, r), this; } convertGammaToLinear(e) { return this.copyGammaToLinear(this, e), this; } convertLinearToGamma(e) { return this.copyLinearToGamma(this, e), this; } copySRGBToLinear(e) { return this.r = xh(e.r), this.g = xh(e.g), this.b = xh(e.b), this; } copyLinearToSRGB(e) { return this.r = wh(e.r), this.g = wh(e.g), this.b = wh(e.b), this; } convertSRGBToLinear() { return this.copySRGBToLinear(this), this; } convertLinearToSRGB() { return this.copyLinearToSRGB(this), this; } getHex() { return this.r * 255 << 16 ^ this.g * 255 << 8 ^ this.b * 255 << 0; } getHexString() { return ("000000" + this.getHex().toString(16)).slice(-6); } getHSL(e) { const t = this.r, r = this.g, n = this.b, o = Math.max(t, r, n), a = Math.min(t, r, n); let s, c; const l = (a + o) / 2; if (a === o) s = 0, c = 0; else { const h = o - a; switch (c = l <= 0.5 ? h / (o + a) : h / (2 - o - a), o) { case t: s = (r - n) / h + (r < n ? 6 : 0); break; case r: s = (n - t) / h + 2; break; case n: s = (t - r) / h + 4; break; } s /= 6; } return e.h = s, e.s = c, e.l = l, e; } getStyle() { return "rgb(" + (this.r * 255 | 0) + "," + (this.g * 255 | 0) + "," + (this.b * 255 | 0) + ")"; } offsetHSL(e, t, r) { return this.getHSL(hr), hr.h += e, hr.s += t, hr.l += r, this.setHSL(hr.h, hr.s, hr.l), this; } 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, r) { return this.r = e.r + (t.r - e.r) * r, this.g = e.g + (t.g - e.g) * r, this.b = e.b + (t.b - e.b) * r, this; } lerpHSL(e, t) { this.getHSL(hr), e.getHSL(Yl); const r = Us(hr.h, Yl.h, t), n = Us(hr.s, Yl.s, t), o = Us(hr.l, Yl.l, t); return this.setHSL(r, n, o), 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), e.normalized === !0 && (this.r /= 255, this.g /= 255, this.b /= 255), this; } toJSON() { return this.getHex(); } } Be.NAMES = mx; Be.prototype.isColor = !0; Be.prototype.r = 1; Be.prototype.g = 1; Be.prototype.b = 1; class ki extends Qt { constructor(e) { super(), this.type = "MeshBasicMaterial", this.color = new Be(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.combine = vl, this.reflectivity = 1, this.refractionRatio = 0.98, this.wireframe = !1, this.wireframeLinewidth = 1, this.wireframeLinecap = "round", this.wireframeLinejoin = "round", this.morphTargets = !1, 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.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.morphTargets = e.morphTargets, this; } } ki.prototype.isMeshBasicMaterial = !0; const Tt = /* @__PURE__ */ new Z(), Jl = /* @__PURE__ */ new Oe(); class tt { constructor(e, t, r) { if (Array.isArray(e)) throw new TypeError("THREE.BufferAttribute: array should be a Typed Array."); this.name = "", this.array = e, this.itemSize = t, this.count = e !== void 0 ? e.length / t : 0, this.normalized = r === !0, this.usage = za, this.updateRange = { offset: 0, count: -1 }, this.version = 0; } onUploadCallback() { } set needsUpdate(e) { e === !0 && this.version++; } setUsage(e) { return this.usage = e, this; } 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; } copyAt(e, t, r) { e *= this.itemSize, r *= t.itemSize; for (let n = 0, o = this.itemSize; n < o; n++) this.array[e + n] = t.array[r + n]; return this; } copyArray(e) { return this.array.set(e), this; } copyColorsArray(e) { const t = this.array; let r = 0; for (let n = 0, o = e.length; n < o; n++) { let a = e[n]; a === void 0 && (console.warn("THREE.BufferAttribute.copyColorsArray(): color is undefined", n), a = new Be()), t[r++] = a.r, t[r++] = a.g, t[r++] = a.b; } return this; } copyVector2sArray(e) { const t = this.array; let r = 0; for (let n = 0, o = e.length; n < o; n++) { let a = e[n]; a === void 0 && (console.warn("THREE.BufferAttribute.copyVector2sArray(): vector is undefined", n), a = new Oe()), t[r++] = a.x, t[r++] = a.y; } return this; } copyVector3sArray(e) { const t = this.array; let r = 0; for (let n = 0, o = e.length; n < o; n++) { let a = e[n]; a === void 0 && (console.warn("THREE.BufferAttribute.copyVector3sArray(): vector is undefined", n), a = new Z()), t[r++] = a.x, t[r++] = a.y, t[r++] = a.z; } return this; } copyVector4sArray(e) { const t = this.array; let r = 0; for (let n = 0, o = e.length; n < o; n++) { let a = e[n]; a === void 0 && (console.warn("THREE.BufferAttribute.copyVector4sArray(): vector is undefined", n), a = new Mt()), t[r++] = a.x, t[r++] = a.y, t[r++] = a.z, t[r++] = a.w; } return this; } applyMatrix3(e) { if (this.itemSize === 2) for (let t = 0, r = this.count; t < r; t++) Jl.fromBufferAttribute(this, t), Jl.applyMatrix3(e), this.setXY(t, Jl.x, Jl.y); else if (this.itemSize === 3) for (let t = 0, r = this.count; t < r; t++) Tt.fromBufferAttribute(this, t), Tt.applyMatrix3(e), this.setXYZ(t, Tt.x, Tt.y, Tt.z); return this; } applyMatrix4(e) { for (let t = 0, r = this.count; t < r; t++) Tt.x = this.getX(t), Tt.y = this.getY(t), Tt.z = this.getZ(t), Tt.applyMatrix4(e), this.setXYZ(t, Tt.x, Tt.y, Tt.z); return this; } applyNormalMatrix(e) { for (let t = 0, r = this.count; t < r; t++) Tt.x = this.getX(t), Tt.y = this.getY(t), Tt.z = this.getZ(t), Tt.applyNormalMatrix(e), this.setXYZ(t, Tt.x, Tt.y, Tt.z); return this; } transformDirection(e) { for (let t = 0, r = this.count; t < r; t++) Tt.x = this.getX(t), Tt.y = this.getY(t), Tt.z = this.getZ(t), Tt.transformDirection(e), this.setXYZ(t, Tt.x, Tt.y, Tt.z); return this; } set(e, t = 0) { return this.array.set(e, t), this; } getX(e) { return this.array[e * this.itemSize]; } setX(e, t) { return this.array[e * this.itemSize] = t, this; } getY(e) { return this.array[e * this.itemSize + 1]; } setY(e, t) { return this.array[e * this.itemSize + 1] = t, this; } getZ(e) { return this.array[e * this.itemSize + 2]; } setZ(e, t) { return this.array[e * this.itemSize + 2] = t, this; } getW(e) { return this.array[e * this.itemSize + 3]; } setW(e, t) { return this.array[e * this.itemSize + 3] = t, this; } setXY(e, t, r) { return e *= this.itemSize, this.array[e + 0] = t, this.array[e + 1] = r, this; } setXYZ(e, t, r, n) { return e *= this.itemSize, this.array[e + 0] = t, this.array[e + 1] = r, this.array[e + 2] = n, this; } setXYZW(e, t, r, n, o) { return e *= this.itemSize, this.array[e + 0] = t, this.array[e + 1] = r, this.array[e + 2] = n, this.array[e + 3] = o, 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.prototype.slice.call(this.array), normalized: this.normalized }; return this.name !== "" && (e.name = this.name), this.usage !== za && (e.usage = this.usage), (this.updateRange.offset !== 0 || this.updateRange.count !== -1) && (e.updateRange = this.updateRange), e; } } tt.prototype.isBufferAttribute = !0; class gx extends tt { constructor(e, t, r) { super(new Int8Array(e), t, r); } } class vx extends tt { constructor(e, t, r) { super(new Uint8Array(e), t, r); } } class yx extends tt { constructor(e, t, r) { super(new Uint8ClampedArray(e), t, r); } } class bx extends tt { constructor(e, t, r) { super(new Int16Array(e), t, r); } } class Lu extends tt { constructor(e, t, r) { super(new Uint16Array(e), t, r); } } class xx extends tt { constructor(e, t, r) { super(new Int32Array(e), t, r); } } class Ru extends tt { constructor(e, t, r) { super(new Uint32Array(e), t, r); } } class wx extends tt { constructor(e, t, r) { super(new Uint16Array(e), t, r); } } wx.prototype.isFloat16BufferAttribute = !0; class je extends tt { constructor(e, t, r) { super(new Float32Array(e), t, r); } } class _x extends tt { constructor(e, t, r) { super(new Float64Array(e), t, r); } } function Mx(i) { if (i.length === 0) return -1 / 0; let e = i[0]; for (let t = 1, r = i.length; t < r; ++t) i[t] > e && (e = i[t]); return e; } const CO = { Int8Array, Uint8Array, Uint8ClampedArray, Int16Array, Uint16Array, Int32Array, Uint32Array, Float32Array, Float64Array }; function _a(i, e) { return new CO[i](e); } let LO = 0; const Ki = /* @__PURE__ */ new $e(), _h = /* @__PURE__ */ new nt(), aa = /* @__PURE__ */ new Z(), Hi = /* @__PURE__ */ new Vi(), _s = /* @__PURE__ */ new Vi(), oi = /* @__PURE__ */ new Z(); class Je extends to { constructor() { super(), Object.defineProperty(this, "id", { value: LO++ }), this.uuid = qi(), this.name = "", this.type = "BufferGeometry", this.index = 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 (Mx(e) > 65535 ? Ru : Lu)(e, 1) : this.index = e, this; } 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, r = 0) { this.groups.push({ start: e, count: t, materialIndex: r }); } 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 r = this.attributes.normal; if (r !== void 0) { const o = new ii().getNormalMatrix(e); r.applyNormalMatrix(o), r.needsUpdate = !0; } const n = this.attributes.tangent; return n !== void 0 && (n.transformDirection(e), n.needsUpdate = !0), this.boundingBox !== null && this.computeBoundingBox(), this.boundingSphere !== null && this.computeBoundingSphere(), this; } applyQuaternion(e) { return Ki.makeRotationFromQuaternion(e), this.applyMatrix4(Ki), this; } rotateX(e) { return Ki.makeRotationX(e), this.applyMatrix4(Ki), this; } rotateY(e) { return Ki.makeRotationY(e), this.applyMatrix4(Ki), this; } rotateZ(e) { return Ki.makeRotationZ(e), this.applyMatrix4(Ki), this; } translate(e, t, r) { return Ki.makeTranslation(e, t, r), this.applyMatrix4(Ki), this; } scale(e, t, r) { return Ki.makeScale(e, t, r), this.applyMatrix4(Ki), this; } lookAt(e) { return _h.lookAt(e), _h.updateMatrix(), this.applyMatrix4(_h.matrix), this; } center() { return this.computeBoundingBox(), this.boundingBox.getCenter(aa).negate(), this.translate(aa.x, aa.y, aa.z), this; } setFromPoints(e) { const t = []; for (let r = 0, n = e.length; r < n; r++) { const o = e[r]; t.push(o.x, o.y, o.z || 0); } return this.setAttribute("position", new je(t, 3)), this; } computeBoundingBox() { this.boundingBox === null && (this.boundingBox = new Vi()); const e = this.attributes.position, t = this.morphAttributes.position; if (e && e.isGLBufferAttribute) { console.error('THREE.BufferGeometry.computeBoundingBox(): GLBufferAttribute requires a manual bounding box. Alternatively set "mesh.frustumCulled" to "false".', this), this.boundingBox.set( new Z(-1 / 0, -1 / 0, -1 / 0), new Z(1 / 0, 1 / 0, 1 / 0) ); return; } if (e !== void 0) { if (this.boundingBox.setFromBufferAttribute(e), t) for (let r = 0, n = t.length; r < n; r++) { const o = t[r]; Hi.setFromBufferAttribute(o), this.morphTargetsRelative ? (oi.addVectors(this.boundingBox.min, Hi.min), this.boundingBox.expandByPoint(oi), oi.addVectors(this.boundingBox.max, Hi.max), this.boundingBox.expandByPoint(oi)) : (this.boundingBox.expandByPoint(Hi.min), this.boundingBox.expandByPoint(Hi.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 bn()); const e = this.attributes.position, t = this.morphAttributes.position; if (e && e.isGLBufferAttribute) { console.error('THREE.BufferGeometry.computeBoundingSphere(): GLBufferAttribute requires a manual bounding sphere. Alternatively set "mesh.frustumCulled" to "false".', this), this.boundingSphere.set(new Z(), 1 / 0); return; } if (e) { const r = this.boundingSphere.center; if (Hi.setFromBufferAttribute(e), t) for (let o = 0, a = t.length; o < a; o++) { const s = t[o]; _s.setFromBufferAttribute(s), this.morphTargetsRelative ? (oi.addVectors(Hi.min, _s.min), Hi.expandByPoint(oi), oi.addVectors(Hi.max, _s.max), Hi.expandByPoint(oi)) : (Hi.expandByPoint(_s.min), Hi.expandByPoint(_s.max)); } Hi.getCenter(r); let n = 0; for (let o = 0, a = e.count; o < a; o++) oi.fromBufferAttribute(e, o), n = Math.max(n, r.distanceToSquared(oi)); if (t) for (let o = 0, a = t.length; o < a; o++) { const s = t[o], c = this.morphTargetsRelative; for (let l = 0, h = s.count; l < h; l++) oi.fromBufferAttribute(s, l), c && (aa.fromBufferAttribute(e, l), oi.add(aa)), n = Math.max(n, r.distanceToSquared(oi)); } this.boundingSphere.radius = Math.sqrt(n), isNaN(this.boundingSphere.radius) && console.error('THREE.BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The "position" attribute is likely to have NaN values.', this); } } computeFaceNormals() { } 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 r = e.array, n = t.position.array, o = t.normal.array, a = t.uv.array, s = n.length / 3; t.tangent === void 0 && this.setAttribute("tangent", new tt(new Float32Array(4 * s), 4)); const c = t.tangent.array, l = [], h = []; for (let E = 0; E < s; E++) l[E] = new Z(), h[E] = new Z(); const u = new Z(), p = new Z(), g = new Z(), m = new Oe(), d = new Oe(), y = new Oe(), f = new Z(), v = new Z(); function M(E, O, L) { u.fromArray(n, E * 3), p.fromArray(n, O * 3), g.fromArray(n, L * 3), m.fromArray(a, E * 2), d.fromArray(a, O * 2), y.fromArray(a, L * 2), p.sub(u), g.sub(u), d.sub(m), y.sub(m); const C = 1 / (d.x * y.y - y.x * d.y); isFinite(C) && (f.copy(p).multiplyScalar(y.y).addScaledVector(g, -d.y).multiplyScalar(C), v.copy(g).multiplyScalar(d.x).addScaledVector(p, -y.x).multiplyScalar(C), l[E].add(f), l[O].add(f), l[L].add(f), h[E].add(v), h[O].add(v), h[L].add(v)); } let S = this.groups; S.length === 0 && (S = [{ start: 0, count: r.length }]); for (let E = 0, O = S.length; E < O; ++E) { const L = S[E], C = L.start, I = L.count; for (let R = C, b = C + I; R < b; R += 3) M( r[R + 0], r[R + 1], r[R + 2] ); } const T = new Z(), x = new Z(), w = new Z(), A = new Z(); function _(E) { w.fromArray(o, E * 3), A.copy(w); const O = l[E]; T.copy(O), T.sub(w.multiplyScalar(w.dot(O))).normalize(), x.crossVectors(A, O); const L = x.dot(h[E]) < 0 ? -1 : 1; c[E * 4] = T.x, c[E * 4 + 1] = T.y, c[E * 4 + 2] = T.z, c[E * 4 + 3] = L; } for (let E = 0, O = S.length; E < O; ++E) { const L = S[E], C = L.start, I = L.count; for (let R = C, b = C + I; R < b; R += 3) _(r[R + 0]), _(r[R + 1]), _(r[R + 2]); } } computeVertexNormals() { const e = this.index, t = this.getAttribute("position"); if (t !== void 0) { let r = this.getAttribute("normal"); if (r === void 0) r = new tt(new Float32Array(t.count * 3), 3), this.setAttribute("normal", r); else for (let p = 0, g = r.count; p < g; p++) r.setXYZ(p, 0, 0, 0); const n = new Z(), o = new Z(), a = new Z(), s = new Z(), c = new Z(), l = new Z(), h = new Z(), u = new Z(); if (e) for (let p = 0, g = e.count; p < g; p += 3) { const m = e.getX(p + 0), d = e.getX(p + 1), y = e.getX(p + 2); n.fromBufferAttribute(t, m), o.fromBufferAttribute(t, d), a.fromBufferAttribute(t, y), h.subVectors(a, o), u.subVectors(n, o), h.cross(u), s.fromBufferAttribute(r, m), c.fromBufferAttribute(r, d), l.fromBufferAttribute(r, y), s.add(h), c.add(h), l.add(h), r.setXYZ(m, s.x, s.y, s.z), r.setXYZ(d, c.x, c.y, c.z), r.setXYZ(y, l.x, l.y, l.z); } else for (let p = 0, g = t.count; p < g; p += 3) n.fromBufferAttribute(t, p + 0), o.fromBufferAttribute(t, p + 1), a.fromBufferAttribute(t, p + 2), h.subVectors(a, o), u.subVectors(n, o), h.cross(u), r.setXYZ(p + 0, h.x, h.y, h.z), r.setXYZ(p + 1, h.x, h.y, h.z), r.setXYZ(p + 2, h.x, h.y, h.z); this.normalizeNormals(), r.needsUpdate = !0; } } merge(e, t) { if (!(e && e.isBufferGeometry)) { console.error("THREE.BufferGeometry.merge(): geometry not an instance of THREE.BufferGeometry.", e); return; } t === void 0 && (t = 0, console.warn( "THREE.BufferGeometry.merge(): Overwriting original geometry, starting at offset=0. Use BufferGeometryUtils.mergeBufferGeometries() for lossless merge." )); const r = this.attributes; for (const n in r) { if (e.attributes[n] === void 0) continue; const o = r[n].array, a = e.attributes[n], s = a.array, c = a.itemSize * t, l = Math.min(s.length, o.length - c); for (let h = 0, u = c; h < l; h++, u++) o[u] = s[h]; } return this; } normalizeNormals() { const e = this.attributes.normal; for (let t = 0, r = e.count; t < r; t++) oi.fromBufferAttribute(e, t), oi.normalize(), e.setXYZ(t, oi.x, oi.y, oi.z); } toNonIndexed() { function e(s, c) { const l = s.array, h = s.itemSize, u = s.normalized, p = new l.constructor(c.length * h); let g = 0, m = 0; for (let d = 0, y = c.length; d < y; d++) { s.isInterleavedBufferAttribute ? g = c[d] * s.data.stride + s.offset : g = c[d] * h; for (let f = 0; f < h; f++) p[m++] = l[g++]; } return new tt(p, h, u); } if (this.index === null) return console.warn("THREE.BufferGeometry.toNonIndexed(): BufferGeometry is already non-indexed."), this; const t = new Je(), r = this.index.array, n = this.attributes; for (const s in n) { const c = n[s], l = e(c, r); t.setAttribute(s, l); } const o = this.morphAttributes; for (const s in o) { const c = [], l = o[s]; for (let h = 0, u = l.length; h < u; h++) { const p = l[h], g = e(p, r); c.push(g); } t.morphAttributes[s] = c; } t.morphTargetsRelative = this.morphTargetsRelative; const a = this.groups; for (let s = 0, c = a.length; s < c; s++) { const l = a[s]; t.addGroup(l.start, l.count, l.materialIndex); } return t; } toJSON() { const e = { metadata: { version: 4.5, 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 c = this.parameters; for (const l in c) c[l] !== void 0 && (e[l] = c[l]); 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 r = this.attributes; for (const c in r) { const l = r[c]; e.data.attributes[c] = l.toJSON(e.data); } const n = {}; let o = !1; for (const c in this.morphAttributes) { const l = this.morphAttributes[c], h = []; for (let u = 0, p = l.length; u < p; u++) { const g = l[u]; h.push(g.toJSON(e.data)); } h.length > 0 && (n[c] = h, o = !0); } o && (e.data.morphAttributes = n, e.data.morphTargetsRelative = this.morphTargetsRelative); const a = this.groups; a.length > 0 && (e.data.groups = JSON.parse(JSON.stringify(a))); const s = this.boundingSphere; return s !== null && (e.data.boundingSphere = { center: s.center.toArray(), radius: s.radius }), e; } clone() { return new Je().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 r = e.index; r !== null && this.setIndex(r.clone(t)); const n = e.attributes; for (const l in n) { const h = n[l]; this.setAttribute(l, h.clone(t)); } const o = e.morphAttributes; for (const l in o) { const h = [], u = o[l]; for (let p = 0, g = u.length; p < g; p++) h.push(u[p].clone(t)); this.morphAttributes[l] = h; } this.morphTargetsRelative = e.morphTargetsRelative; const a = e.groups; for (let l = 0, h = a.length; l < h; l++) { const u = a[l]; this.addGroup(u.start, u.count, u.materialIndex); } const s = e.boundingBox; s !== null && (this.boundingBox = s.clone()); const c = e.boundingSphere; return c !== null && (this.boundingSphere = c.clone()), this.drawRange.start = e.drawRange.start, this.drawRange.count = e.drawRange.count, this.userData = e.userData, this; } dispose() { this.dispatchEvent({ type: "dispose" }); } } Je.prototype.isBufferGeometry = !0; const _g = /* @__PURE__ */ new $e(), sa = /* @__PURE__ */ new io(), Mh = /* @__PURE__ */ new bn(), En = /* @__PURE__ */ new Z(), An = /* @__PURE__ */ new Z(), Cn = /* @__PURE__ */ new Z(), Sh = /* @__PURE__ */ new Z(), Th = /* @__PURE__ */ new Z(), Eh = /* @__PURE__ */ new Z(), Kl = /* @__PURE__ */ new Z(), Ql = /* @__PURE__ */ new Z(), ec = /* @__PURE__ */ new Z(), tc = /* @__PURE__ */ new Oe(), ic = /* @__PURE__ */ new Oe(), rc = /* @__PURE__ */ new Oe(), Ah = /* @__PURE__ */ new Z(), nc = /* @__PURE__ */ new Z(); class Yt extends nt { constructor(e = new Je(), t = new ki()) { super(), this.type = "Mesh", this.geometry = e, this.material = t, this.updateMorphTargets(); } copy(e) { return super.copy(e), e.morphTargetInfluences !== void 0 && (this.morphTargetInfluences = e.morphTargetInfluences.slice()), e.morphTargetDictionary !== void 0 && (this.morphTargetDictionary = Object.assign({}, e.morphTargetDictionary)), this.material = e.material, this.geometry = e.geometry, this; } updateMorphTargets() { const e = this.geometry; if (e.isBufferGeometry) { const t = e.morphAttributes, r = Object.keys(t); if (r.length > 0) { const n = t[r[0]]; if (n !== void 0) { this.morphTargetInfluences = [], this.morphTargetDictionary = {}; for (let o = 0, a = n.length; o < a; o++) { const s = n[o].name || String(o); this.morphTargetInfluences.push(0), this.morphTargetDictionary[s] = o; } } } } else { const t = e.morphTargets; t !== void 0 && t.length > 0 && console.error("THREE.Mesh.updateMorphTargets() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead."); } } raycast(e, t) { const r = this.geometry, n = this.material, o = this.matrixWorld; if (n === void 0 || (r.boundingSphere === null && r.computeBoundingSphere(), Mh.copy(r.boundingSphere), Mh.applyMatrix4(o), e.ray.intersectsSphere(Mh) === !1) || (_g.copy(o).invert(), sa.copy(e.ray).applyMatrix4(_g), r.boundingBox !== null && sa.intersectsBox(r.boundingBox) === !1)) return; let a; if (r.isBufferGeometry) { const s = r.index, c = r.attributes.position, l = r.morphAttributes.position, h = r.morphTargetsRelative, u = r.attributes.uv, p = r.attributes.uv2, g = r.groups, m = r.drawRange; if (s !== null) if (Array.isArray(n)) for (let d = 0, y = g.length; d < y; d++) { const f = g[d], v = n[f.materialIndex], M = Math.max(f.start, m.start), S = Math.min(f.start + f.count, m.start + m.count); for (let T = M, x = S; T < x; T += 3) { const w = s.getX(T), A = s.getX(T + 1), _ = s.getX(T + 2); a = oc(this, v, e, sa, c, l, h, u, p, w, A, _), a && (a.faceIndex = Math.floor(T / 3), a.face.materialIndex = f.materialIndex, t.push(a)); } } else { const d = Math.max(0, m.start), y = Math.min(s.count, m.start + m.count); for (let f = d, v = y; f < v; f += 3) { const M = s.getX(f), S = s.getX(f + 1), T = s.getX(f + 2); a = oc(this, n, e, sa, c, l, h, u, p, M, S, T), a && (a.faceIndex = Math.floor(f / 3), t.push(a)); } } else if (c !== void 0) if (Array.isArray(n)) for (let d = 0, y = g.length; d < y; d++) { const f = g[d], v = n[f.materialIndex], M = Math.max(f.start, m.start), S = Math.min(f.start + f.count, m.start + m.count); for (let T = M, x = S; T < x; T += 3) { const w = T, A = T + 1, _ = T + 2; a = oc(this, v, e, sa, c, l, h, u, p, w, A, _), a && (a.faceIndex = Math.floor(T / 3), a.face.materialIndex = f.materialIndex, t.push(a)); } } else { const d = Math.max(0, m.start), y = Math.min(c.count, m.start + m.count); for (let f = d, v = y; f < v; f += 3) { const M = f, S = f + 1, T = f + 2; a = oc(this, n, e, sa, c, l, h, u, p, M, S, T), a && (a.faceIndex = Math.floor(f / 3), t.push(a)); } } } else r.isGeometry && console.error("THREE.Mesh.raycast() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead."); } } Yt.prototype.isMesh = !0; function RO(i, e, t, r, n, o, a, s) { let c; if (e.side === $t ? c = r.intersectTriangle(a, o, n, !0, s) : c = r.intersectTriangle(n, o, a, e.side !== Xn, s), c === null) return null; nc.copy(s), nc.applyMatrix4(i.matrixWorld); const l = t.ray.origin.distanceTo(nc); return l < t.near || l > t.far ? null : { distance: l, point: nc.clone(), object: i }; } function oc(i, e, t, r, n, o, a, s, c, l, h, u) { En.fromBufferAttribute(n, l), An.fromBufferAttribute(n, h), Cn.fromBufferAttribute(n, u); const p = i.morphTargetInfluences; if (e.morphTargets && o && p) { Kl.set(0, 0, 0), Ql.set(0, 0, 0), ec.set(0, 0, 0); for (let m = 0, d = o.length; m < d; m++) { const y = p[m], f = o[m]; y !== 0 && (Sh.fromBufferAttribute(f, l), Th.fromBufferAttribute(f, h), Eh.fromBufferAttribute(f, u), a ? (Kl.addScaledVector(Sh, y), Ql.addScaledVector(Th, y), ec.addScaledVector(Eh, y)) : (Kl.addScaledVector(Sh.sub(En), y), Ql.addScaledVector(Th.sub(An), y), ec.addScaledVector(Eh.sub(Cn), y))); } En.add(Kl), An.add(Ql), Cn.add(ec); } i.isSkinnedMesh && (i.boneTransform(l, En), i.boneTransform(h, An), i.boneTransform(u, Cn)); const g = RO(i, e, t, r, En, An, Cn, Ah); if (g) { s && (tc.fromBufferAttribute(s, l), ic.fromBufferAttribute(s, h), rc.fromBufferAttribute(s, u), g.uv = Xt.getUV(Ah, En, An, Cn, tc, ic, rc, new Oe())), c && (tc.fromBufferAttribute(c, l), ic.fromBufferAttribute(c, h), rc.fromBufferAttribute(c, u), g.uv2 = Xt.getUV(Ah, En, An, Cn, tc, ic, rc, new Oe())); const m = { a: l, b: h, c: u, normal: new Z(), materialIndex: 0 }; Xt.getNormal(En, An, Cn, m.normal), g.face = m; } return g; } class un extends Je { constructor(e = 1, t = 1, r = 1, n = 1, o = 1, a = 1) { super(), this.type = "BoxGeometry", this.parameters = { width: e, height: t, depth: r, widthSegments: n, heightSegments: o, depthSegments: a }; const s = this; n = Math.floor(n), o = Math.floor(o), a = Math.floor(a); const c = [], l = [], h = [], u = []; let p = 0, g = 0; m("z", "y", "x", -1, -1, r, t, e, a, o, 0), m("z", "y", "x", 1, -1, r, t, -e, a, o, 1), m("x", "z", "y", 1, 1, e, r, t, n, a, 2), m("x", "z", "y", 1, -1, e, r, -t, n, a, 3), m("x", "y", "z", 1, -1, e, t, r, n, o, 4), m("x", "y", "z", -1, -1, e, t, -r, n, o, 5), this.setIndex(c), this.setAttribute("position", new je(l, 3)), this.setAttribute("normal", new je(h, 3)), this.setAttribute("uv", new je(u, 2)); function m(d, y, f, v, M, S, T, x, w, A, _) { const E = S / w, O = T / A, L = S / 2, C = T / 2, I = x / 2, R = w + 1, b = A + 1; let P = 0, N = 0; const D = new Z(); for (let k = 0; k < b; k++) { const V = k * O - C; for (let q = 0; q < R; q++) { const Y = q * E - L; D[d] = Y * v, D[y] = V * M, D[f] = I, l.push(D.x, D.y, D.z), D[d] = 0, D[y] = 0, D[f] = x > 0 ? 1 : -1, h.push(D.x, D.y, D.z), u.push(q / w), u.push(1 - k / A), P += 1; } } for (let k = 0; k < A; k++) for (let V = 0; V < w; V++) { const q = p + V + R * k, Y = p + V + R * (k + 1), ne = p + (V + 1) + R * (k + 1), X = p + (V + 1) + R * k; c.push(q, Y, X), c.push(Y, ne, X), N += 6; } s.addGroup(g, N, _), g += N, p += P; } } static fromJSON(e) { return new un(e.width, e.height, e.depth, e.widthSegments, e.heightSegments, e.depthSegments); } } function Va(i) { const e = {}; for (const t in i) { e[t] = {}; for (const r in i[t]) { const n = i[t][r]; n && (n.isColor || n.isMatrix3 || n.isMatrix4 || n.isVector2 || n.isVector3 || n.isVector4 || n.isTexture || n.isQuaternion) ? e[t][r] = n.clone() : Array.isArray(n) ? e[t][r] = n.slice() : e[t][r] = n; } } return e; } function wi(i) { const e = {}; for (let t = 0; t < i.length; t++) { const r = Va(i[t]); for (const n in r) e[n] = r[n]; } return e; } const Sx = { clone: Va, merge: wi }; var OO = `void main() { gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 ); }`, PO = `void main() { gl_FragColor = vec4( 1.0, 0.0, 0.0, 1.0 ); }`; class hn extends Qt { constructor(e) { super(), this.type = "ShaderMaterial", this.defines = {}, this.uniforms = {}, this.vertexShader = OO, this.fragmentShader = PO, this.linewidth = 1, this.wireframe = !1, this.wireframeLinewidth = 1, this.fog = !1, this.lights = !1, this.clipping = !1, this.morphTargets = !1, this.morphNormals = !1, this.extensions = { derivatives: !1, // set to use derivatives fragDepth: !1, // set to use fragment depth values drawBuffers: !1, // set to use draw buffers shaderTextureLOD: !1 // set to use shader texture LOD }, this.defaultAttributeValues = { color: [1, 1, 1], uv: [0, 0], uv2: [0, 0] }, this.index0AttributeName = void 0, this.uniformsNeedUpdate = !1, this.glslVersion = null, e !== void 0 && (e.attributes !== void 0 && console.error("THREE.ShaderMaterial: attributes should now be defined in THREE.BufferGeometry instead."), this.setValues(e)); } copy(e) { return super.copy(e), this.fragmentShader = e.fragmentShader, this.vertexShader = e.vertexShader, this.uniforms = Va(e.uniforms), this.defines = Object.assign({}, e.defines), this.wireframe = e.wireframe, this.wireframeLinewidth = e.wireframeLinewidth, this.lights = e.lights, this.clipping = e.clipping, this.morphTargets = e.morphTargets, this.morphNormals = e.morphNormals, 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 n in this.uniforms) { const o = this.uniforms[n].value; o && o.isTexture ? t.uniforms[n] = { type: "t", value: o.toJSON(e).uuid } : o && o.isColor ? t.uniforms[n] = { type: "c", value: o.getHex() } : o && o.isVector2 ? t.uniforms[n] = { type: "v2", value: o.toArray() } : o && o.isVector3 ? t.uniforms[n] = { type: "v3", value: o.toArray() } : o && o.isVector4 ? t.uniforms[n] = { type: "v4", value: o.toArray() } : o && o.isMatrix3 ? t.uniforms[n] = { type: "m3", value: o.toArray() } : o && o.isMatrix4 ? t.uniforms[n] = { type: "m4", value: o.toArray() } : t.uniforms[n] = { value: o }; } Object.keys(this.defines).length > 0 && (t.defines = this.defines), t.vertexShader = this.vertexShader, t.fragmentShader = this.fragmentShader; const r = {}; for (const n in this.extensions) this.extensions[n] === !0 && (r[n] = !0); return Object.keys(r).length > 0 && (t.extensions = r), t; } } hn.prototype.isShaderMaterial = !0; class wl extends nt { constructor() { super(), this.type = "Camera", this.matrixWorldInverse = new $e(), this.projectionMatrix = new $e(), this.projectionMatrixInverse = new $e(); } copy(e, t) { return super.copy(e, t), this.matrixWorldInverse.copy(e.matrixWorldInverse), this.projectionMatrix.copy(e.projectionMatrix), this.projectionMatrixInverse.copy(e.projectionMatrixInverse), this; } getWorldDirection(e) { this.updateWorldMatrix(!0, !1); const t = this.matrixWorld.elements; return e.set(-t[8], -t[9], -t[10]).normalize(); } 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); } } wl.prototype.isCamera = !0; class ti extends wl { constructor(e = 50, t = 1, r = 0.1, n = 2e3) { super(), this.type = "PerspectiveCamera", this.fov = e, this.zoom = 1, this.near = r, this.far = n, 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; } /** * Sets the FOV by focal length in respect to the current .filmGauge. * * The default film gauge is 35, so that the focal length can be specified for * a 35mm (full frame) camera. * * Values for focal length and film gauge must have the same unit. */ setFocalLength(e) { const t = 0.5 * this.getFilmHeight() / e; this.fov = il * 2 * Math.atan(t), this.updateProjectionMatrix(); } /** * Calculates the focal length from the current .fov and .filmGauge. */ getFocalLength() { const e = Math.tan(Co * 0.5 * this.fov); return 0.5 * this.getFilmHeight() / e; } getEffectiveFOV() { return il * 2 * Math.atan( Math.tan(Co * 0.5 * this.fov) / this.zoom ); } getFilmWidth() { return this.filmGauge * Math.min(this.aspect, 1); } getFilmHeight() { return this.filmGauge / Math.max(this.aspect, 1); } /** * Sets an offset in a larger frustum. This is useful for multi-window or * multi-monitor/multi-machine setups. * * For example, if you have 3x2 monitors and each monitor is 1920x1080 and * the monitors are in grid like this * * +---+---+---+ * | A | B | C | * +---+---+---+ * | D | E | F | * +---+---+---+ * * then for each monitor you would call it like this * * const w = 1920; * const h = 1080; * const fullWidth = w * 3; * const fullHeight = h * 2; * * --A-- * camera.setViewOffset( fullWidth, fullHeight, w * 0, h * 0, w, h ); * --B-- * camera.setViewOffset( fullWidth, fullHeight, w * 1, h * 0, w, h ); * --C-- * camera.setViewOffset( fullWidth, fullHeight, w * 2, h * 0, w, h ); * --D-- * camera.setViewOffset( fullWidth, fullHeight, w * 0, h * 1, w, h ); * --E-- * camera.setViewOffset( fullWidth, fullHeight, w * 1, h * 1, w, h ); * --F-- * camera.setViewOffset( fullWidth, fullHeight, w * 2, h * 1, w, h ); * * Note there is no reason monitors have to be the same size or in a grid. */ setViewOffset(e, t, r, n, o, a) { 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 = r, this.view.offsetY = n, this.view.width = o, this.view.height = a, this.updateProjectionMatrix(); } clearViewOffset() { this.view !== null && (this.view.enabled = !1), this.updateProjectionMatrix(); } updateProjectionMatrix() { const e = this.near; let t = e * Math.tan(Co * 0.5 * this.fov) / this.zoom, r = 2 * t, n = this.aspect * r, o = -0.5 * n; const a = this.view; if (this.view !== null && this.view.enabled) { const c = a.fullWidth, l = a.fullHeight; o += a.offsetX * n / c, t -= a.offsetY * r / l, n *= a.width / c, r *= a.height / l; } const s = this.filmOffset; s !== 0 && (o += e * s / this.getFilmWidth()), this.projectionMatrix.makePerspective(o, o + n, t, t - r, e, this.far), 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; } } ti.prototype.isPerspectiveCamera = !0; const la = 90, ca = 1; class Ou extends nt { constructor(e, t, r) { if (super(), this.type = "CubeCamera", r.isWebGLCubeRenderTarget !== !0) { console.error("THREE.CubeCamera: The constructor now expects an instance of WebGLCubeRenderTarget as third parameter."); return; } this.renderTarget = r; const n = new ti(la, ca, e, t); n.layers = this.layers, n.up.set(0, -1, 0), n.lookAt(new Z(1, 0, 0)), this.add(n); const o = new ti(la, ca, e, t); o.layers = this.layers, o.up.set(0, -1, 0), o.lookAt(new Z(-1, 0, 0)), this.add(o); const a = new ti(la, ca, e, t); a.layers = this.layers, a.up.set(0, 0, 1), a.lookAt(new Z(0, 1, 0)), this.add(a); const s = new ti(la, ca, e, t); s.layers = this.layers, s.up.set(0, 0, -1), s.lookAt(new Z(0, -1, 0)), this.add(s); const c = new ti(la, ca, e, t); c.layers = this.layers, c.up.set(0, -1, 0), c.lookAt(new Z(0, 0, 1)), this.add(c); const l = new ti(la, ca, e, t); l.layers = this.layers, l.up.set(0, -1, 0), l.lookAt(new Z(0, 0, -1)), this.add(l); } update(e, t) { this.parent === null && this.updateMatrixWorld(); const r = this.renderTarget, [n, o, a, s, c, l] = this.children, h = e.xr.enabled, u = e.getRenderTarget(); e.xr.enabled = !1; const p = r.texture.generateMipmaps; r.texture.generateMipmaps = !1, e.setRenderTarget(r, 0), e.render(t, n), e.setRenderTarget(r, 1), e.render(t, o), e.setRenderTarget(r, 2), e.render(t, a), e.setRenderTarget(r, 3), e.render(t, s), e.setRenderTarget(r, 4), e.render(t, c), r.texture.generateMipmaps = p, e.setRenderTarget(r, 5), e.render(t, l), e.setRenderTarget(u), e.xr.enabled = h; } } class cs extends Jt { constructor(e, t, r, n, o, a, s, c, l, h) { e = e !== void 0 ? e : [], t = t !== void 0 ? t : yl, s = s !== void 0 ? s : an, super(e, t, r, n, o, a, s, c, l, h), this._needsFlipEnvMap = !0, this.flipY = !1; } get images() { return this.image; } set images(e) { this.image = e; } } cs.prototype.isCubeTexture = !0; class Pu extends vr { constructor(e, t, r) { Number.isInteger(t) && (console.warn("THREE.WebGLCubeRenderTarget: constructor signature is now WebGLCubeRenderTarget( size, options )"), t = r), super(e, e, t), t = t || {}, this.texture = new cs(void 0, t.mapping, t.wrapS, t.wrapT, t.magFilter, t.minFilter, t.format, t.type, t.anisotropy, t.encoding), this.texture.generateMipmaps = t.generateMipmaps !== void 0 ? t.generateMipmaps : !1, this.texture.minFilter = t.minFilter !== void 0 ? t.minFilter : Ut, this.texture._needsFlipEnvMap = !1; } fromEquirectangularTexture(e, t) { this.texture.type = t.type, this.texture.format = $i, this.texture.encoding = t.encoding, this.texture.generateMipmaps = t.generateMipmaps, this.texture.minFilter = t.minFilter, this.texture.magFilter = t.magFilter; const r = { uniforms: { tEquirect: { value: null } }, vertexShader: ( /* glsl */ ` varying vec3 vWorldDirection; vec3 transformDirection( in vec3 dir, in mat4 matrix ) { return normalize( ( matrix * vec4( dir, 0.0 ) ).xyz ); } void main() { vWorldDirection = transformDirection( position, modelMatrix ); #include #include } ` ), fragmentShader: ( /* glsl */ ` uniform sampler2D tEquirect; varying vec3 vWorldDirection; #include void main() { vec3 direction = normalize( vWorldDirection ); vec2 sampleUV = equirectUv( direction ); gl_FragColor = texture2D( tEquirect, sampleUV ); } ` ) }, n = new un(5, 5, 5), o = new hn({ name: "CubemapFromEquirect", uniforms: Va(r.uniforms), vertexShader: r.vertexShader, fragmentShader: r.fragmentShader, side: $t, blending: on }); o.uniforms.tEquirect.value = t; const a = new Yt(n, o), s = t.minFilter; return t.minFilter === yn && (t.minFilter = Ut), new Ou(1, 10, this).update(e, a), t.minFilter = s, a.geometry.dispose(), a.material.dispose(), this; } clear(e, t, r, n) { const o = e.getRenderTarget(); for (let a = 0; a < 6; a++) e.setRenderTarget(this, a), e.clear(t, r, n); e.setRenderTarget(o); } } Pu.prototype.isWebGLCubeRenderTarget = !0; const Ch = /* @__PURE__ */ new Z(), IO = /* @__PURE__ */ new Z(), DO = /* @__PURE__ */ new ii(); class Ar { constructor(e = new Z(1, 0, 0), t = 0) { this.normal = e, this.constant = t; } set(e, t) { return this.normal.copy(e), this.constant = t, this; } setComponents(e, t, r, n) { return this.normal.set(e, t, r), this.constant = n, this; } setFromNormalAndCoplanarPoint(e, t) { return this.normal.copy(e), this.constant = -t.dot(this.normal), this; } setFromCoplanarPoints(e, t, r) { const n = Ch.subVectors(r, t).cross(IO.subVectors(e, t)).normalize(); return this.setFromNormalAndCoplanarPoint(n, 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(this.normal).multiplyScalar(-this.distanceToPoint(e)).add(e); } intersectLine(e, t) { const r = e.delta(Ch), n = this.normal.dot(r); if (n === 0) return this.distanceToPoint(e.start) === 0 ? t.copy(e.start) : null; const o = -(e.start.dot(this.normal) + this.constant) / n; return o < 0 || o > 1 ? null : t.copy(r).multiplyScalar(o).add(e.start); } intersectsLine(e) { const t = this.distanceToPoint(e.start), r = this.distanceToPoint(e.end); return t < 0 && r > 0 || r < 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 r = t || DO.getNormalMatrix(e), n = this.coplanarPoint(Ch).applyMatrix4(e), o = this.normal.applyMatrix3(r).normalize(); return this.constant = -n.dot(o), 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); } } Ar.prototype.isPlane = !0; const ua = /* @__PURE__ */ new bn(), ac = /* @__PURE__ */ new Z(); class _l { constructor(e = new Ar(), t = new Ar(), r = new Ar(), n = new Ar(), o = new Ar(), a = new Ar()) { this.planes = [e, t, r, n, o, a]; } set(e, t, r, n, o, a) { const s = this.planes; return s[0].copy(e), s[1].copy(t), s[2].copy(r), s[3].copy(n), s[4].copy(o), s[5].copy(a), this; } copy(e) { const t = this.planes; for (let r = 0; r < 6; r++) t[r].copy(e.planes[r]); return this; } setFromProjectionMatrix(e) { const t = this.planes, r = e.elements, n = r[0], o = r[1], a = r[2], s = r[3], c = r[4], l = r[5], h = r[6], u = r[7], p = r[8], g = r[9], m = r[10], d = r[11], y = r[12], f = r[13], v = r[14], M = r[15]; return t[0].setComponents(s - n, u - c, d - p, M - y).normalize(), t[1].setComponents(s + n, u + c, d + p, M + y).normalize(), t[2].setComponents(s + o, u + l, d + g, M + f).normalize(), t[3].setComponents(s - o, u - l, d - g, M - f).normalize(), t[4].setComponents(s - a, u - h, d - m, M - v).normalize(), t[5].setComponents(s + a, u + h, d + m, M + v).normalize(), this; } intersectsObject(e) { const t = e.geometry; return t.boundingSphere === null && t.computeBoundingSphere(), ua.copy(t.boundingSphere).applyMatrix4(e.matrixWorld), this.intersectsSphere(ua); } intersectsSprite(e) { return ua.center.set(0, 0, 0), ua.radius = 0.7071067811865476, ua.applyMatrix4(e.matrixWorld), this.intersectsSphere(ua); } intersectsSphere(e) { const t = this.planes, r = e.center, n = -e.radius; for (let o = 0; o < 6; o++) if (t[o].distanceToPoint(r) < n) return !1; return !0; } intersectsBox(e) { const t = this.planes; for (let r = 0; r < 6; r++) { const n = t[r]; if (ac.x = n.normal.x > 0 ? e.max.x : e.min.x, ac.y = n.normal.y > 0 ? e.max.y : e.min.y, ac.z = n.normal.z > 0 ? e.max.z : e.min.z, n.distanceToPoint(ac) < 0) return !1; } return !0; } containsPoint(e) { const t = this.planes; for (let r = 0; r < 6; r++) if (t[r].distanceToPoint(e) < 0) return !1; return !0; } clone() { return new this.constructor().copy(this); } } function Tx() { let i = null, e = !1, t = null, r = null; function n(o, a) { t(o, a), r = i.requestAnimationFrame(n); } return { start: function() { e !== !0 && t !== null && (r = i.requestAnimationFrame(n), e = !0); }, stop: function() { i.cancelAnimationFrame(r), e = !1; }, setAnimationLoop: function(o) { t = o; }, setContext: function(o) { i = o; } }; } function NO(i, e) { const t = e.isWebGL2, r = /* @__PURE__ */ new WeakMap(); function n(l, h) { const u = l.array, p = l.usage, g = i.createBuffer(); i.bindBuffer(h, g), i.bufferData(h, u, p), l.onUploadCallback(); let m = 5126; return u instanceof Float32Array ? m = 5126 : u instanceof Float64Array ? console.warn("THREE.WebGLAttributes: Unsupported data buffer format: Float64Array.") : u instanceof Uint16Array ? l.isFloat16BufferAttribute ? t ? m = 5131 : console.warn("THREE.WebGLAttributes: Usage of Float16BufferAttribute requires WebGL2.") : m = 5123 : u instanceof Int16Array ? m = 5122 : u instanceof Uint32Array ? m = 5125 : u instanceof Int32Array ? m = 5124 : u instanceof Int8Array ? m = 5120 : (u instanceof Uint8Array || u instanceof Uint8ClampedArray) && (m = 5121), { buffer: g, type: m, bytesPerElement: u.BYTES_PER_ELEMENT, version: l.version }; } function o(l, h, u) { const p = h.array, g = h.updateRange; i.bindBuffer(u, l), g.count === -1 ? i.bufferSubData(u, 0, p) : (t ? i.bufferSubData( u, g.offset * p.BYTES_PER_ELEMENT, p, g.offset, g.count ) : i.bufferSubData( u, g.offset * p.BYTES_PER_ELEMENT, p.subarray(g.offset, g.offset + g.count) ), g.count = -1); } function a(l) { return l.isInterleavedBufferAttribute && (l = l.data), r.get(l); } function s(l) { l.isInterleavedBufferAttribute && (l = l.data); const h = r.get(l); h && (i.deleteBuffer(h.buffer), r.delete(l)); } function c(l, h) { if (l.isGLBufferAttribute) { const p = r.get(l); (!p || p.version < l.version) && r.set(l, { buffer: l.buffer, type: l.type, bytesPerElement: l.elementSize, version: l.version }); return; } l.isInterleavedBufferAttribute && (l = l.data); const u = r.get(l); u === void 0 ? r.set(l, n(l, h)) : u.version < l.version && (o(u.buffer, l, h), u.version = l.version); } return { get: a, remove: s, update: c }; } class No extends Je { constructor(e = 1, t = 1, r = 1, n = 1) { super(), this.type = "PlaneGeometry", this.parameters = { width: e, height: t, widthSegments: r, heightSegments: n }; const o = e / 2, a = t / 2, s = Math.floor(r), c = Math.floor(n), l = s + 1, h = c + 1, u = e / s, p = t / c, g = [], m = [], d = [], y = []; for (let f = 0; f < h; f++) { const v = f * p - a; for (let M = 0; M < l; M++) { const S = M * u - o; m.push(S, -v, 0), d.push(0, 0, 1), y.push(M / s), y.push(1 - f / c); } } for (let f = 0; f < c; f++) for (let v = 0; v < s; v++) { const M = v + l * f, S = v + l * (f + 1), T = v + 1 + l * (f + 1), x = v + 1 + l * f; g.push(M, S, x), g.push(S, T, x); } this.setIndex(g), this.setAttribute("position", new je(m, 3)), this.setAttribute("normal", new je(d, 3)), this.setAttribute("uv", new je(y, 2)); } static fromJSON(e) { return new No(e.width, e.height, e.widthSegments, e.heightSegments); } } var BO = `#ifdef USE_ALPHAMAP diffuseColor.a *= texture2D( alphaMap, vUv ).g; #endif`, kO = `#ifdef USE_ALPHAMAP uniform sampler2D alphaMap; #endif`, zO = `#ifdef ALPHATEST if ( diffuseColor.a < ALPHATEST ) discard; #endif`, FO = `#ifdef USE_AOMAP float ambientOcclusion = ( texture2D( aoMap, vUv2 ).r - 1.0 ) * aoMapIntensity + 1.0; reflectedLight.indirectDiffuse *= ambientOcclusion; #if defined( USE_ENVMAP ) && defined( STANDARD ) float dotNV = saturate( dot( geometry.normal, geometry.viewDir ) ); reflectedLight.indirectSpecular *= computeSpecularOcclusion( dotNV, ambientOcclusion, material.specularRoughness ); #endif #endif`, VO = `#ifdef USE_AOMAP uniform sampler2D aoMap; uniform float aoMapIntensity; #endif`, UO = "vec3 transformed = vec3( position );", GO = `vec3 objectNormal = vec3( normal ); #ifdef USE_TANGENT vec3 objectTangent = vec3( tangent.xyz ); #endif`, HO = `vec2 integrateSpecularBRDF( const in float dotNV, const in float roughness ) { const vec4 c0 = vec4( - 1, - 0.0275, - 0.572, 0.022 ); const vec4 c1 = vec4( 1, 0.0425, 1.04, - 0.04 ); vec4 r = roughness * c0 + c1; float a004 = min( r.x * r.x, exp2( - 9.28 * dotNV ) ) * r.x + r.y; return vec2( -1.04, 1.04 ) * a004 + r.zw; } float punctualLightIntensityToIrradianceFactor( const in float lightDistance, const in float cutoffDistance, const in float decayExponent ) { #if defined ( PHYSICALLY_CORRECT_LIGHTS ) float distanceFalloff = 1.0 / max( pow( lightDistance, decayExponent ), 0.01 ); if( cutoffDistance > 0.0 ) { distanceFalloff *= pow2( saturate( 1.0 - pow4( lightDistance / cutoffDistance ) ) ); } return distanceFalloff; #else if( cutoffDistance > 0.0 && decayExponent > 0.0 ) { return pow( saturate( -lightDistance / cutoffDistance + 1.0 ), decayExponent ); } return 1.0; #endif } vec3 BRDF_Diffuse_Lambert( const in vec3 diffuseColor ) { return RECIPROCAL_PI * diffuseColor; } vec3 F_Schlick( const in vec3 specularColor, const in float dotVH ) { float fresnel = exp2( ( -5.55473 * dotVH - 6.98316 ) * dotVH ); return ( 1.0 - specularColor ) * fresnel + specularColor; } vec3 F_Schlick_RoughnessDependent( const in vec3 F0, const in float dotNV, const in float roughness ) { float fresnel = exp2( ( -5.55473 * dotNV - 6.98316 ) * dotNV ); vec3 Fr = max( vec3( 1.0 - roughness ), F0 ) - F0; return Fr * fresnel + F0; } float G_GGX_Smith( const in float alpha, const in float dotNL, const in float dotNV ) { float a2 = pow2( alpha ); float gl = dotNL + sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) ); float gv = dotNV + sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) ); return 1.0 / ( gl * gv ); } float G_GGX_SmithCorrelated( const in float alpha, const in float dotNL, const in float dotNV ) { float a2 = pow2( alpha ); float gv = dotNL * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) ); float gl = dotNV * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) ); return 0.5 / max( gv + gl, EPSILON ); } float D_GGX( const in float alpha, const in float dotNH ) { float a2 = pow2( alpha ); float denom = pow2( dotNH ) * ( a2 - 1.0 ) + 1.0; return RECIPROCAL_PI * a2 / pow2( denom ); } vec3 BRDF_Specular_GGX( const in IncidentLight incidentLight, const in vec3 viewDir, const in vec3 normal, const in vec3 specularColor, const in float roughness ) { float alpha = pow2( roughness ); vec3 halfDir = normalize( incidentLight.direction + viewDir ); float dotNL = saturate( dot( normal, incidentLight.direction ) ); float dotNV = saturate( dot( normal, viewDir ) ); float dotNH = saturate( dot( normal, halfDir ) ); float dotLH = saturate( dot( incidentLight.direction, halfDir ) ); vec3 F = F_Schlick( specularColor, dotLH ); float G = G_GGX_SmithCorrelated( alpha, dotNL, dotNV ); float D = D_GGX( alpha, dotNH ); return F * ( G * D ); } vec2 LTC_Uv( const in vec3 N, const in vec3 V, const in float roughness ) { const float LUT_SIZE = 64.0; const float LUT_SCALE = ( LUT_SIZE - 1.0 ) / LUT_SIZE; const float LUT_BIAS = 0.5 / LUT_SIZE; float dotNV = saturate( dot( N, V ) ); vec2 uv = vec2( roughness, sqrt( 1.0 - dotNV ) ); uv = uv * LUT_SCALE + LUT_BIAS; return uv; } float LTC_ClippedSphereFormFactor( const in vec3 f ) { float l = length( f ); return max( ( l * l + f.z ) / ( l + 1.0 ), 0.0 ); } vec3 LTC_EdgeVectorFormFactor( const in vec3 v1, const in vec3 v2 ) { float x = dot( v1, v2 ); float y = abs( x ); float a = 0.8543985 + ( 0.4965155 + 0.0145206 * y ) * y; float b = 3.4175940 + ( 4.1616724 + y ) * y; float v = a / b; float theta_sintheta = ( x > 0.0 ) ? v : 0.5 * inversesqrt( max( 1.0 - x * x, 1e-7 ) ) - v; return cross( v1, v2 ) * theta_sintheta; } vec3 LTC_Evaluate( const in vec3 N, const in vec3 V, const in vec3 P, const in mat3 mInv, const in vec3 rectCoords[ 4 ] ) { vec3 v1 = rectCoords[ 1 ] - rectCoords[ 0 ]; vec3 v2 = rectCoords[ 3 ] - rectCoords[ 0 ]; vec3 lightNormal = cross( v1, v2 ); if( dot( lightNormal, P - rectCoords[ 0 ] ) < 0.0 ) return vec3( 0.0 ); vec3 T1, T2; T1 = normalize( V - N * dot( V, N ) ); T2 = - cross( N, T1 ); mat3 mat = mInv * transposeMat3( mat3( T1, T2, N ) ); vec3 coords[ 4 ]; coords[ 0 ] = mat * ( rectCoords[ 0 ] - P ); coords[ 1 ] = mat * ( rectCoords[ 1 ] - P ); coords[ 2 ] = mat * ( rectCoords[ 2 ] - P ); coords[ 3 ] = mat * ( rectCoords[ 3 ] - P ); coords[ 0 ] = normalize( coords[ 0 ] ); coords[ 1 ] = normalize( coords[ 1 ] ); coords[ 2 ] = normalize( coords[ 2 ] ); coords[ 3 ] = normalize( coords[ 3 ] ); vec3 vectorFormFactor = vec3( 0.0 ); vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 0 ], coords[ 1 ] ); vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 1 ], coords[ 2 ] ); vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 2 ], coords[ 3 ] ); vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 3 ], coords[ 0 ] ); float result = LTC_ClippedSphereFormFactor( vectorFormFactor ); return vec3( result ); } vec3 BRDF_Specular_GGX_Environment( const in vec3 viewDir, const in vec3 normal, const in vec3 specularColor, const in float roughness ) { float dotNV = saturate( dot( normal, viewDir ) ); vec2 brdf = integrateSpecularBRDF( dotNV, roughness ); return specularColor * brdf.x + brdf.y; } void BRDF_Specular_Multiscattering_Environment( const in GeometricContext geometry, const in vec3 specularColor, const in float roughness, inout vec3 singleScatter, inout vec3 multiScatter ) { float dotNV = saturate( dot( geometry.normal, geometry.viewDir ) ); vec3 F = F_Schlick_RoughnessDependent( specularColor, dotNV, roughness ); vec2 brdf = integrateSpecularBRDF( dotNV, roughness ); vec3 FssEss = F * brdf.x + brdf.y; float Ess = brdf.x + brdf.y; float Ems = 1.0 - Ess; vec3 Favg = specularColor + ( 1.0 - specularColor ) * 0.047619; vec3 Fms = FssEss * Favg / ( 1.0 - Ems * Favg ); singleScatter += FssEss; multiScatter += Fms * Ems; } float G_BlinnPhong_Implicit( ) { return 0.25; } float D_BlinnPhong( const in float shininess, const in float dotNH ) { return RECIPROCAL_PI * ( shininess * 0.5 + 1.0 ) * pow( dotNH, shininess ); } vec3 BRDF_Specular_BlinnPhong( const in IncidentLight incidentLight, const in GeometricContext geometry, const in vec3 specularColor, const in float shininess ) { vec3 halfDir = normalize( incidentLight.direction + geometry.viewDir ); float dotNH = saturate( dot( geometry.normal, halfDir ) ); float dotLH = saturate( dot( incidentLight.direction, halfDir ) ); vec3 F = F_Schlick( specularColor, dotLH ); float G = G_BlinnPhong_Implicit( ); float D = D_BlinnPhong( shininess, dotNH ); return F * ( G * D ); } float GGXRoughnessToBlinnExponent( const in float ggxRoughness ) { return ( 2.0 / pow2( ggxRoughness + 0.0001 ) - 2.0 ); } float BlinnExponentToGGXRoughness( const in float blinnExponent ) { return sqrt( 2.0 / ( blinnExponent + 2.0 ) ); } #if defined( USE_SHEEN ) float D_Charlie(float roughness, float NoH) { float invAlpha = 1.0 / roughness; float cos2h = NoH * NoH; float sin2h = max(1.0 - cos2h, 0.0078125); return (2.0 + invAlpha) * pow(sin2h, invAlpha * 0.5) / (2.0 * PI); } float V_Neubelt(float NoV, float NoL) { return saturate(1.0 / (4.0 * (NoL + NoV - NoL * NoV))); } vec3 BRDF_Specular_Sheen( const in float roughness, const in vec3 L, const in GeometricContext geometry, vec3 specularColor ) { vec3 N = geometry.normal; vec3 V = geometry.viewDir; vec3 H = normalize( V + L ); float dotNH = saturate( dot( N, H ) ); return specularColor * D_Charlie( roughness, dotNH ) * V_Neubelt( dot(N, V), dot(N, L) ); } #endif`, jO = `#ifdef USE_BUMPMAP uniform sampler2D bumpMap; uniform float bumpScale; vec2 dHdxy_fwd() { vec2 dSTdx = dFdx( vUv ); vec2 dSTdy = dFdy( vUv ); float Hll = bumpScale * texture2D( bumpMap, vUv ).x; float dBx = bumpScale * texture2D( bumpMap, vUv + dSTdx ).x - Hll; float dBy = bumpScale * texture2D( bumpMap, vUv + dSTdy ).x - Hll; return vec2( dBx, dBy ); } vec3 perturbNormalArb( vec3 surf_pos, vec3 surf_norm, vec2 dHdxy, float faceDirection ) { vec3 vSigmaX = vec3( dFdx( surf_pos.x ), dFdx( surf_pos.y ), dFdx( surf_pos.z ) ); vec3 vSigmaY = vec3( dFdy( surf_pos.x ), dFdy( surf_pos.y ), dFdy( surf_pos.z ) ); vec3 vN = surf_norm; vec3 R1 = cross( vSigmaY, vN ); vec3 R2 = cross( vN, vSigmaX ); float fDet = dot( vSigmaX, R1 ) * faceDirection; vec3 vGrad = sign( fDet ) * ( dHdxy.x * R1 + dHdxy.y * R2 ); return normalize( abs( fDet ) * surf_norm - vGrad ); } #endif`, WO = `#if NUM_CLIPPING_PLANES > 0 vec4 plane; #pragma unroll_loop_start for ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) { plane = clippingPlanes[ i ]; if ( dot( vClipPosition, plane.xyz ) > plane.w ) discard; } #pragma unroll_loop_end #if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES bool clipped = true; #pragma unroll_loop_start for ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) { plane = clippingPlanes[ i ]; clipped = ( dot( vClipPosition, plane.xyz ) > plane.w ) && clipped; } #pragma unroll_loop_end if ( clipped ) discard; #endif #endif`, $O = `#if NUM_CLIPPING_PLANES > 0 varying vec3 vClipPosition; uniform vec4 clippingPlanes[ NUM_CLIPPING_PLANES ]; #endif`, qO = `#if NUM_CLIPPING_PLANES > 0 varying vec3 vClipPosition; #endif`, XO = `#if NUM_CLIPPING_PLANES > 0 vClipPosition = - mvPosition.xyz; #endif`, ZO = `#if defined( USE_COLOR_ALPHA ) diffuseColor *= vColor; #elif defined( USE_COLOR ) diffuseColor.rgb *= vColor; #endif`, YO = `#if defined( USE_COLOR_ALPHA ) varying vec4 vColor; #elif defined( USE_COLOR ) varying vec3 vColor; #endif`, JO = `#if defined( USE_COLOR_ALPHA ) varying vec4 vColor; #elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR ) varying vec3 vColor; #endif`, KO = `#if defined( USE_COLOR_ALPHA ) vColor = vec4( 1.0 ); #elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR ) vColor = vec3( 1.0 ); #endif #ifdef USE_COLOR vColor *= color; #endif #ifdef USE_INSTANCING_COLOR vColor.xyz *= instanceColor.xyz; #endif`, QO = `#define PI 3.141592653589793 #define PI2 6.283185307179586 #define PI_HALF 1.5707963267948966 #define RECIPROCAL_PI 0.3183098861837907 #define RECIPROCAL_PI2 0.15915494309189535 #define EPSILON 1e-6 #ifndef saturate #define saturate(a) clamp( a, 0.0, 1.0 ) #endif #define whiteComplement(a) ( 1.0 - saturate( a ) ) float pow2( const in float x ) { return x*x; } float pow3( const in float x ) { return x*x*x; } float pow4( const in float x ) { float x2 = x*x; return x2*x2; } float average( const in vec3 color ) { return dot( color, vec3( 0.3333 ) ); } highp float rand( const in vec2 uv ) { const highp float a = 12.9898, b = 78.233, c = 43758.5453; highp float dt = dot( uv.xy, vec2( a,b ) ), sn = mod( dt, PI ); return fract(sin(sn) * c); } #ifdef HIGH_PRECISION float precisionSafeLength( vec3 v ) { return length( v ); } #else float max3( vec3 v ) { return max( max( v.x, v.y ), v.z ); } float precisionSafeLength( vec3 v ) { float maxComponent = max3( abs( v ) ); return length( v / maxComponent ) * maxComponent; } #endif struct IncidentLight { vec3 color; vec3 direction; bool visible; }; struct ReflectedLight { vec3 directDiffuse; vec3 directSpecular; vec3 indirectDiffuse; vec3 indirectSpecular; }; struct GeometricContext { vec3 position; vec3 normal; vec3 viewDir; #ifdef CLEARCOAT vec3 clearcoatNormal; #endif }; vec3 transformDirection( in vec3 dir, in mat4 matrix ) { return normalize( ( matrix * vec4( dir, 0.0 ) ).xyz ); } vec3 inverseTransformDirection( in vec3 dir, in mat4 matrix ) { return normalize( ( vec4( dir, 0.0 ) * matrix ).xyz ); } vec3 projectOnPlane(in vec3 point, in vec3 pointOnPlane, in vec3 planeNormal ) { float distance = dot( planeNormal, point - pointOnPlane ); return - distance * planeNormal + point; } float sideOfPlane( in vec3 point, in vec3 pointOnPlane, in vec3 planeNormal ) { return sign( dot( point - pointOnPlane, planeNormal ) ); } vec3 linePlaneIntersect( in vec3 pointOnLine, in vec3 lineDirection, in vec3 pointOnPlane, in vec3 planeNormal ) { return lineDirection * ( dot( planeNormal, pointOnPlane - pointOnLine ) / dot( planeNormal, lineDirection ) ) + pointOnLine; } mat3 transposeMat3( const in mat3 m ) { mat3 tmp; tmp[ 0 ] = vec3( m[ 0 ].x, m[ 1 ].x, m[ 2 ].x ); tmp[ 1 ] = vec3( m[ 0 ].y, m[ 1 ].y, m[ 2 ].y ); tmp[ 2 ] = vec3( m[ 0 ].z, m[ 1 ].z, m[ 2 ].z ); return tmp; } float linearToRelativeLuminance( const in vec3 color ) { vec3 weights = vec3( 0.2126, 0.7152, 0.0722 ); return dot( weights, color.rgb ); } bool isPerspectiveMatrix( mat4 m ) { return m[ 2 ][ 3 ] == - 1.0; } vec2 equirectUv( in vec3 dir ) { float u = atan( dir.z, dir.x ) * RECIPROCAL_PI2 + 0.5; float v = asin( clamp( dir.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5; return vec2( u, v ); }`, eP = `#ifdef ENVMAP_TYPE_CUBE_UV #define cubeUV_maxMipLevel 8.0 #define cubeUV_minMipLevel 4.0 #define cubeUV_maxTileSize 256.0 #define cubeUV_minTileSize 16.0 float getFace( vec3 direction ) { vec3 absDirection = abs( direction ); float face = - 1.0; if ( absDirection.x > absDirection.z ) { if ( absDirection.x > absDirection.y ) face = direction.x > 0.0 ? 0.0 : 3.0; else face = direction.y > 0.0 ? 1.0 : 4.0; } else { if ( absDirection.z > absDirection.y ) face = direction.z > 0.0 ? 2.0 : 5.0; else face = direction.y > 0.0 ? 1.0 : 4.0; } return face; } vec2 getUV( vec3 direction, float face ) { vec2 uv; if ( face == 0.0 ) { uv = vec2( direction.z, direction.y ) / abs( direction.x ); } else if ( face == 1.0 ) { uv = vec2( - direction.x, - direction.z ) / abs( direction.y ); } else if ( face == 2.0 ) { uv = vec2( - direction.x, direction.y ) / abs( direction.z ); } else if ( face == 3.0 ) { uv = vec2( - direction.z, direction.y ) / abs( direction.x ); } else if ( face == 4.0 ) { uv = vec2( - direction.x, direction.z ) / abs( direction.y ); } else { uv = vec2( direction.x, direction.y ) / abs( direction.z ); } return 0.5 * ( uv + 1.0 ); } vec3 bilinearCubeUV( sampler2D envMap, vec3 direction, float mipInt ) { float face = getFace( direction ); float filterInt = max( cubeUV_minMipLevel - mipInt, 0.0 ); mipInt = max( mipInt, cubeUV_minMipLevel ); float faceSize = exp2( mipInt ); float texelSize = 1.0 / ( 3.0 * cubeUV_maxTileSize ); vec2 uv = getUV( direction, face ) * ( faceSize - 1.0 ); vec2 f = fract( uv ); uv += 0.5 - f; if ( face > 2.0 ) { uv.y += faceSize; face -= 3.0; } uv.x += face * faceSize; if ( mipInt < cubeUV_maxMipLevel ) { uv.y += 2.0 * cubeUV_maxTileSize; } uv.y += filterInt * 2.0 * cubeUV_minTileSize; uv.x += 3.0 * max( 0.0, cubeUV_maxTileSize - 2.0 * faceSize ); uv *= texelSize; vec3 tl = envMapTexelToLinear( texture2D( envMap, uv ) ).rgb; uv.x += texelSize; vec3 tr = envMapTexelToLinear( texture2D( envMap, uv ) ).rgb; uv.y += texelSize; vec3 br = envMapTexelToLinear( texture2D( envMap, uv ) ).rgb; uv.x -= texelSize; vec3 bl = envMapTexelToLinear( texture2D( envMap, uv ) ).rgb; vec3 tm = mix( tl, tr, f.x ); vec3 bm = mix( bl, br, f.x ); return mix( tm, bm, f.y ); } #define r0 1.0 #define v0 0.339 #define m0 - 2.0 #define r1 0.8 #define v1 0.276 #define m1 - 1.0 #define r4 0.4 #define v4 0.046 #define m4 2.0 #define r5 0.305 #define v5 0.016 #define m5 3.0 #define r6 0.21 #define v6 0.0038 #define m6 4.0 float roughnessToMip( float roughness ) { float mip = 0.0; if ( roughness >= r1 ) { mip = ( r0 - roughness ) * ( m1 - m0 ) / ( r0 - r1 ) + m0; } else if ( roughness >= r4 ) { mip = ( r1 - roughness ) * ( m4 - m1 ) / ( r1 - r4 ) + m1; } else if ( roughness >= r5 ) { mip = ( r4 - roughness ) * ( m5 - m4 ) / ( r4 - r5 ) + m4; } else if ( roughness >= r6 ) { mip = ( r5 - roughness ) * ( m6 - m5 ) / ( r5 - r6 ) + m5; } else { mip = - 2.0 * log2( 1.16 * roughness ); } return mip; } vec4 textureCubeUV( sampler2D envMap, vec3 sampleDir, float roughness ) { float mip = clamp( roughnessToMip( roughness ), m0, cubeUV_maxMipLevel ); float mipF = fract( mip ); float mipInt = floor( mip ); vec3 color0 = bilinearCubeUV( envMap, sampleDir, mipInt ); if ( mipF == 0.0 ) { return vec4( color0, 1.0 ); } else { vec3 color1 = bilinearCubeUV( envMap, sampleDir, mipInt + 1.0 ); return vec4( mix( color0, color1, mipF ), 1.0 ); } } #endif`, tP = `vec3 transformedNormal = objectNormal; #ifdef USE_INSTANCING mat3 m = mat3( instanceMatrix ); transformedNormal /= vec3( dot( m[ 0 ], m[ 0 ] ), dot( m[ 1 ], m[ 1 ] ), dot( m[ 2 ], m[ 2 ] ) ); transformedNormal = m * transformedNormal; #endif transformedNormal = normalMatrix * transformedNormal; #ifdef FLIP_SIDED transformedNormal = - transformedNormal; #endif #ifdef USE_TANGENT vec3 transformedTangent = ( modelViewMatrix * vec4( objectTangent, 0.0 ) ).xyz; #ifdef FLIP_SIDED transformedTangent = - transformedTangent; #endif #endif`, iP = `#ifdef USE_DISPLACEMENTMAP uniform sampler2D displacementMap; uniform float displacementScale; uniform float displacementBias; #endif`, rP = `#ifdef USE_DISPLACEMENTMAP transformed += normalize( objectNormal ) * ( texture2D( displacementMap, vUv ).x * displacementScale + displacementBias ); #endif`, nP = `#ifdef USE_EMISSIVEMAP vec4 emissiveColor = texture2D( emissiveMap, vUv ); emissiveColor.rgb = emissiveMapTexelToLinear( emissiveColor ).rgb; totalEmissiveRadiance *= emissiveColor.rgb; #endif`, oP = `#ifdef USE_EMISSIVEMAP uniform sampler2D emissiveMap; #endif`, aP = "gl_FragColor = linearToOutputTexel( gl_FragColor );", sP = ` vec4 LinearToLinear( in vec4 value ) { return value; } vec4 GammaToLinear( in vec4 value, in float gammaFactor ) { return vec4( pow( value.rgb, vec3( gammaFactor ) ), value.a ); } vec4 LinearToGamma( in vec4 value, in float gammaFactor ) { return vec4( pow( value.rgb, vec3( 1.0 / gammaFactor ) ), value.a ); } vec4 sRGBToLinear( in vec4 value ) { 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 ); } vec4 LinearTosRGB( in vec4 value ) { 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 ); } vec4 RGBEToLinear( in vec4 value ) { return vec4( value.rgb * exp2( value.a * 255.0 - 128.0 ), 1.0 ); } vec4 LinearToRGBE( in vec4 value ) { float maxComponent = max( max( value.r, value.g ), value.b ); float fExp = clamp( ceil( log2( maxComponent ) ), -128.0, 127.0 ); return vec4( value.rgb / exp2( fExp ), ( fExp + 128.0 ) / 255.0 ); } vec4 RGBMToLinear( in vec4 value, in float maxRange ) { return vec4( value.rgb * value.a * maxRange, 1.0 ); } vec4 LinearToRGBM( in vec4 value, in float maxRange ) { float maxRGB = max( value.r, max( value.g, value.b ) ); float M = clamp( maxRGB / maxRange, 0.0, 1.0 ); M = ceil( M * 255.0 ) / 255.0; return vec4( value.rgb / ( M * maxRange ), M ); } vec4 RGBDToLinear( in vec4 value, in float maxRange ) { return vec4( value.rgb * ( ( maxRange / 255.0 ) / value.a ), 1.0 ); } vec4 LinearToRGBD( in vec4 value, in float maxRange ) { float maxRGB = max( value.r, max( value.g, value.b ) ); float D = max( maxRange / maxRGB, 1.0 ); D = clamp( floor( D ) / 255.0, 0.0, 1.0 ); return vec4( value.rgb * ( D * ( 255.0 / maxRange ) ), D ); } const mat3 cLogLuvM = mat3( 0.2209, 0.3390, 0.4184, 0.1138, 0.6780, 0.7319, 0.0102, 0.1130, 0.2969 ); vec4 LinearToLogLuv( in vec4 value ) { vec3 Xp_Y_XYZp = cLogLuvM * value.rgb; Xp_Y_XYZp = max( Xp_Y_XYZp, vec3( 1e-6, 1e-6, 1e-6 ) ); vec4 vResult; vResult.xy = Xp_Y_XYZp.xy / Xp_Y_XYZp.z; float Le = 2.0 * log2(Xp_Y_XYZp.y) + 127.0; vResult.w = fract( Le ); vResult.z = ( Le - ( floor( vResult.w * 255.0 ) ) / 255.0 ) / 255.0; return vResult; } const mat3 cLogLuvInverseM = mat3( 6.0014, -2.7008, -1.7996, -1.3320, 3.1029, -5.7721, 0.3008, -1.0882, 5.6268 ); vec4 LogLuvToLinear( in vec4 value ) { float Le = value.z * 255.0 + value.w; vec3 Xp_Y_XYZp; Xp_Y_XYZp.y = exp2( ( Le - 127.0 ) / 2.0 ); Xp_Y_XYZp.z = Xp_Y_XYZp.y / value.y; Xp_Y_XYZp.x = value.x * Xp_Y_XYZp.z; vec3 vRGB = cLogLuvInverseM * Xp_Y_XYZp.rgb; return vec4( max( vRGB, 0.0 ), 1.0 ); }`, lP = `#ifdef USE_ENVMAP #ifdef ENV_WORLDPOS vec3 cameraToFrag; if ( isOrthographic ) { cameraToFrag = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) ); } else { cameraToFrag = normalize( vWorldPosition - cameraPosition ); } vec3 worldNormal = inverseTransformDirection( normal, viewMatrix ); #ifdef ENVMAP_MODE_REFLECTION vec3 reflectVec = reflect( cameraToFrag, worldNormal ); #else vec3 reflectVec = refract( cameraToFrag, worldNormal, refractionRatio ); #endif #else vec3 reflectVec = vReflect; #endif #ifdef ENVMAP_TYPE_CUBE vec4 envColor = textureCube( envMap, vec3( flipEnvMap * reflectVec.x, reflectVec.yz ) ); #elif defined( ENVMAP_TYPE_CUBE_UV ) vec4 envColor = textureCubeUV( envMap, reflectVec, 0.0 ); #else vec4 envColor = vec4( 0.0 ); #endif #ifndef ENVMAP_TYPE_CUBE_UV envColor = envMapTexelToLinear( envColor ); #endif #ifdef ENVMAP_BLENDING_MULTIPLY outgoingLight = mix( outgoingLight, outgoingLight * envColor.xyz, specularStrength * reflectivity ); #elif defined( ENVMAP_BLENDING_MIX ) outgoingLight = mix( outgoingLight, envColor.xyz, specularStrength * reflectivity ); #elif defined( ENVMAP_BLENDING_ADD ) outgoingLight += envColor.xyz * specularStrength * reflectivity; #endif #endif`, cP = `#ifdef USE_ENVMAP uniform float envMapIntensity; uniform float flipEnvMap; uniform int maxMipLevel; #ifdef ENVMAP_TYPE_CUBE uniform samplerCube envMap; #else uniform sampler2D envMap; #endif #endif`, uP = `#ifdef USE_ENVMAP uniform float reflectivity; #if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) #define ENV_WORLDPOS #endif #ifdef ENV_WORLDPOS varying vec3 vWorldPosition; uniform float refractionRatio; #else varying vec3 vReflect; #endif #endif`, hP = `#ifdef USE_ENVMAP #if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) ||defined( PHONG ) #define ENV_WORLDPOS #endif #ifdef ENV_WORLDPOS varying vec3 vWorldPosition; #else varying vec3 vReflect; uniform float refractionRatio; #endif #endif`, dP = `#ifdef USE_ENVMAP #ifdef ENV_WORLDPOS vWorldPosition = worldPosition.xyz; #else vec3 cameraToVertex; if ( isOrthographic ) { cameraToVertex = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) ); } else { cameraToVertex = normalize( worldPosition.xyz - cameraPosition ); } vec3 worldNormal = inverseTransformDirection( transformedNormal, viewMatrix ); #ifdef ENVMAP_MODE_REFLECTION vReflect = reflect( cameraToVertex, worldNormal ); #else vReflect = refract( cameraToVertex, worldNormal, refractionRatio ); #endif #endif #endif`, pP = `#ifdef USE_FOG fogDepth = - mvPosition.z; #endif`, fP = `#ifdef USE_FOG varying float fogDepth; #endif`, mP = `#ifdef USE_FOG #ifdef FOG_EXP2 float fogFactor = 1.0 - exp( - fogDensity * fogDensity * fogDepth * fogDepth ); #else float fogFactor = smoothstep( fogNear, fogFar, fogDepth ); #endif gl_FragColor.rgb = mix( gl_FragColor.rgb, fogColor, fogFactor ); #endif`, gP = `#ifdef USE_FOG uniform vec3 fogColor; varying float fogDepth; #ifdef FOG_EXP2 uniform float fogDensity; #else uniform float fogNear; uniform float fogFar; #endif #endif`, vP = `#ifdef USE_GRADIENTMAP uniform sampler2D gradientMap; #endif vec3 getGradientIrradiance( vec3 normal, vec3 lightDirection ) { float dotNL = dot( normal, lightDirection ); vec2 coord = vec2( dotNL * 0.5 + 0.5, 0.0 ); #ifdef USE_GRADIENTMAP return texture2D( gradientMap, coord ).rgb; #else return ( coord.x < 0.7 ) ? vec3( 0.7 ) : vec3( 1.0 ); #endif }`, yP = `#ifdef USE_LIGHTMAP vec4 lightMapTexel= texture2D( lightMap, vUv2 ); reflectedLight.indirectDiffuse += PI * lightMapTexelToLinear( lightMapTexel ).rgb * lightMapIntensity; #endif`, bP = `#ifdef USE_LIGHTMAP uniform sampler2D lightMap; uniform float lightMapIntensity; #endif`, xP = `vec3 diffuse = vec3( 1.0 ); GeometricContext geometry; geometry.position = mvPosition.xyz; geometry.normal = normalize( transformedNormal ); geometry.viewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( -mvPosition.xyz ); GeometricContext backGeometry; backGeometry.position = geometry.position; backGeometry.normal = -geometry.normal; backGeometry.viewDir = geometry.viewDir; vLightFront = vec3( 0.0 ); vIndirectFront = vec3( 0.0 ); #ifdef DOUBLE_SIDED vLightBack = vec3( 0.0 ); vIndirectBack = vec3( 0.0 ); #endif IncidentLight directLight; float dotNL; vec3 directLightColor_Diffuse; vIndirectFront += getAmbientLightIrradiance( ambientLightColor ); vIndirectFront += getLightProbeIrradiance( lightProbe, geometry ); #ifdef DOUBLE_SIDED vIndirectBack += getAmbientLightIrradiance( ambientLightColor ); vIndirectBack += getLightProbeIrradiance( lightProbe, backGeometry ); #endif #if NUM_POINT_LIGHTS > 0 #pragma unroll_loop_start for ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) { getPointDirectLightIrradiance( pointLights[ i ], geometry, directLight ); dotNL = dot( geometry.normal, directLight.direction ); directLightColor_Diffuse = PI * directLight.color; vLightFront += saturate( dotNL ) * directLightColor_Diffuse; #ifdef DOUBLE_SIDED vLightBack += saturate( -dotNL ) * directLightColor_Diffuse; #endif } #pragma unroll_loop_end #endif #if NUM_SPOT_LIGHTS > 0 #pragma unroll_loop_start for ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) { getSpotDirectLightIrradiance( spotLights[ i ], geometry, directLight ); dotNL = dot( geometry.normal, directLight.direction ); directLightColor_Diffuse = PI * directLight.color; vLightFront += saturate( dotNL ) * directLightColor_Diffuse; #ifdef DOUBLE_SIDED vLightBack += saturate( -dotNL ) * directLightColor_Diffuse; #endif } #pragma unroll_loop_end #endif #if NUM_DIR_LIGHTS > 0 #pragma unroll_loop_start for ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) { getDirectionalDirectLightIrradiance( directionalLights[ i ], geometry, directLight ); dotNL = dot( geometry.normal, directLight.direction ); directLightColor_Diffuse = PI * directLight.color; vLightFront += saturate( dotNL ) * directLightColor_Diffuse; #ifdef DOUBLE_SIDED vLightBack += saturate( -dotNL ) * directLightColor_Diffuse; #endif } #pragma unroll_loop_end #endif #if NUM_HEMI_LIGHTS > 0 #pragma unroll_loop_start for ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) { vIndirectFront += getHemisphereLightIrradiance( hemisphereLights[ i ], geometry ); #ifdef DOUBLE_SIDED vIndirectBack += getHemisphereLightIrradiance( hemisphereLights[ i ], backGeometry ); #endif } #pragma unroll_loop_end #endif`, wP = `uniform bool receiveShadow; uniform vec3 ambientLightColor; uniform vec3 lightProbe[ 9 ]; vec3 shGetIrradianceAt( in vec3 normal, in vec3 shCoefficients[ 9 ] ) { float x = normal.x, y = normal.y, z = normal.z; vec3 result = shCoefficients[ 0 ] * 0.886227; result += shCoefficients[ 1 ] * 2.0 * 0.511664 * y; result += shCoefficients[ 2 ] * 2.0 * 0.511664 * z; result += shCoefficients[ 3 ] * 2.0 * 0.511664 * x; result += shCoefficients[ 4 ] * 2.0 * 0.429043 * x * y; result += shCoefficients[ 5 ] * 2.0 * 0.429043 * y * z; result += shCoefficients[ 6 ] * ( 0.743125 * z * z - 0.247708 ); result += shCoefficients[ 7 ] * 2.0 * 0.429043 * x * z; result += shCoefficients[ 8 ] * 0.429043 * ( x * x - y * y ); return result; } vec3 getLightProbeIrradiance( const in vec3 lightProbe[ 9 ], const in GeometricContext geometry ) { vec3 worldNormal = inverseTransformDirection( geometry.normal, viewMatrix ); vec3 irradiance = shGetIrradianceAt( worldNormal, lightProbe ); return irradiance; } vec3 getAmbientLightIrradiance( const in vec3 ambientLightColor ) { vec3 irradiance = ambientLightColor; #ifndef PHYSICALLY_CORRECT_LIGHTS irradiance *= PI; #endif return irradiance; } #if NUM_DIR_LIGHTS > 0 struct DirectionalLight { vec3 direction; vec3 color; }; uniform DirectionalLight directionalLights[ NUM_DIR_LIGHTS ]; void getDirectionalDirectLightIrradiance( const in DirectionalLight directionalLight, const in GeometricContext geometry, out IncidentLight directLight ) { directLight.color = directionalLight.color; directLight.direction = directionalLight.direction; directLight.visible = true; } #endif #if NUM_POINT_LIGHTS > 0 struct PointLight { vec3 position; vec3 color; float distance; float decay; }; uniform PointLight pointLights[ NUM_POINT_LIGHTS ]; void getPointDirectLightIrradiance( const in PointLight pointLight, const in GeometricContext geometry, out IncidentLight directLight ) { vec3 lVector = pointLight.position - geometry.position; directLight.direction = normalize( lVector ); float lightDistance = length( lVector ); directLight.color = pointLight.color; directLight.color *= punctualLightIntensityToIrradianceFactor( lightDistance, pointLight.distance, pointLight.decay ); directLight.visible = ( directLight.color != vec3( 0.0 ) ); } #endif #if NUM_SPOT_LIGHTS > 0 struct SpotLight { vec3 position; vec3 direction; vec3 color; float distance; float decay; float coneCos; float penumbraCos; }; uniform SpotLight spotLights[ NUM_SPOT_LIGHTS ]; void getSpotDirectLightIrradiance( const in SpotLight spotLight, const in GeometricContext geometry, out IncidentLight directLight ) { vec3 lVector = spotLight.position - geometry.position; directLight.direction = normalize( lVector ); float lightDistance = length( lVector ); float angleCos = dot( directLight.direction, spotLight.direction ); if ( angleCos > spotLight.coneCos ) { float spotEffect = smoothstep( spotLight.coneCos, spotLight.penumbraCos, angleCos ); directLight.color = spotLight.color; directLight.color *= spotEffect * punctualLightIntensityToIrradianceFactor( lightDistance, spotLight.distance, spotLight.decay ); directLight.visible = true; } else { directLight.color = vec3( 0.0 ); directLight.visible = false; } } #endif #if NUM_RECT_AREA_LIGHTS > 0 struct RectAreaLight { vec3 color; vec3 position; vec3 halfWidth; vec3 halfHeight; }; uniform sampler2D ltc_1; uniform sampler2D ltc_2; uniform RectAreaLight rectAreaLights[ NUM_RECT_AREA_LIGHTS ]; #endif #if NUM_HEMI_LIGHTS > 0 struct HemisphereLight { vec3 direction; vec3 skyColor; vec3 groundColor; }; uniform HemisphereLight hemisphereLights[ NUM_HEMI_LIGHTS ]; vec3 getHemisphereLightIrradiance( const in HemisphereLight hemiLight, const in GeometricContext geometry ) { float dotNL = dot( geometry.normal, hemiLight.direction ); float hemiDiffuseWeight = 0.5 * dotNL + 0.5; vec3 irradiance = mix( hemiLight.groundColor, hemiLight.skyColor, hemiDiffuseWeight ); #ifndef PHYSICALLY_CORRECT_LIGHTS irradiance *= PI; #endif return irradiance; } #endif`, _P = `#if defined( USE_ENVMAP ) #ifdef ENVMAP_MODE_REFRACTION uniform float refractionRatio; #endif vec3 getLightProbeIndirectIrradiance( const in GeometricContext geometry, const in int maxMIPLevel ) { vec3 worldNormal = inverseTransformDirection( geometry.normal, viewMatrix ); #ifdef ENVMAP_TYPE_CUBE vec3 queryVec = vec3( flipEnvMap * worldNormal.x, worldNormal.yz ); #ifdef TEXTURE_LOD_EXT vec4 envMapColor = textureCubeLodEXT( envMap, queryVec, float( maxMIPLevel ) ); #else vec4 envMapColor = textureCube( envMap, queryVec, float( maxMIPLevel ) ); #endif envMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb; #elif defined( ENVMAP_TYPE_CUBE_UV ) vec4 envMapColor = textureCubeUV( envMap, worldNormal, 1.0 ); #else vec4 envMapColor = vec4( 0.0 ); #endif return PI * envMapColor.rgb * envMapIntensity; } float getSpecularMIPLevel( const in float roughness, const in int maxMIPLevel ) { float maxMIPLevelScalar = float( maxMIPLevel ); float sigma = PI * roughness * roughness / ( 1.0 + roughness ); float desiredMIPLevel = maxMIPLevelScalar + log2( sigma ); return clamp( desiredMIPLevel, 0.0, maxMIPLevelScalar ); } vec3 getLightProbeIndirectRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness, const in int maxMIPLevel ) { #ifdef ENVMAP_MODE_REFLECTION vec3 reflectVec = reflect( -viewDir, normal ); reflectVec = normalize( mix( reflectVec, normal, roughness * roughness) ); #else vec3 reflectVec = refract( -viewDir, normal, refractionRatio ); #endif reflectVec = inverseTransformDirection( reflectVec, viewMatrix ); float specularMIPLevel = getSpecularMIPLevel( roughness, maxMIPLevel ); #ifdef ENVMAP_TYPE_CUBE vec3 queryReflectVec = vec3( flipEnvMap * reflectVec.x, reflectVec.yz ); #ifdef TEXTURE_LOD_EXT vec4 envMapColor = textureCubeLodEXT( envMap, queryReflectVec, specularMIPLevel ); #else vec4 envMapColor = textureCube( envMap, queryReflectVec, specularMIPLevel ); #endif envMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb; #elif defined( ENVMAP_TYPE_CUBE_UV ) vec4 envMapColor = textureCubeUV( envMap, reflectVec, roughness ); #endif return envMapColor.rgb * envMapIntensity; } #endif`, MP = `ToonMaterial material; material.diffuseColor = diffuseColor.rgb;`, SP = `varying vec3 vViewPosition; #ifndef FLAT_SHADED varying vec3 vNormal; #endif struct ToonMaterial { vec3 diffuseColor; }; void RE_Direct_Toon( const in IncidentLight directLight, const in GeometricContext geometry, const in ToonMaterial material, inout ReflectedLight reflectedLight ) { vec3 irradiance = getGradientIrradiance( geometry.normal, directLight.direction ) * directLight.color; #ifndef PHYSICALLY_CORRECT_LIGHTS irradiance *= PI; #endif reflectedLight.directDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor ); } void RE_IndirectDiffuse_Toon( const in vec3 irradiance, const in GeometricContext geometry, const in ToonMaterial material, inout ReflectedLight reflectedLight ) { reflectedLight.indirectDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor ); } #define RE_Direct RE_Direct_Toon #define RE_IndirectDiffuse RE_IndirectDiffuse_Toon #define Material_LightProbeLOD( material ) (0)`, TP = `BlinnPhongMaterial material; material.diffuseColor = diffuseColor.rgb; material.specularColor = specular; material.specularShininess = shininess; material.specularStrength = specularStrength;`, EP = `varying vec3 vViewPosition; #ifndef FLAT_SHADED varying vec3 vNormal; #endif struct BlinnPhongMaterial { vec3 diffuseColor; vec3 specularColor; float specularShininess; float specularStrength; }; void RE_Direct_BlinnPhong( const in IncidentLight directLight, const in GeometricContext geometry, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) { float dotNL = saturate( dot( geometry.normal, directLight.direction ) ); vec3 irradiance = dotNL * directLight.color; #ifndef PHYSICALLY_CORRECT_LIGHTS irradiance *= PI; #endif reflectedLight.directDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor ); reflectedLight.directSpecular += irradiance * BRDF_Specular_BlinnPhong( directLight, geometry, material.specularColor, material.specularShininess ) * material.specularStrength; } void RE_IndirectDiffuse_BlinnPhong( const in vec3 irradiance, const in GeometricContext geometry, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) { reflectedLight.indirectDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor ); } #define RE_Direct RE_Direct_BlinnPhong #define RE_IndirectDiffuse RE_IndirectDiffuse_BlinnPhong #define Material_LightProbeLOD( material ) (0)`, AP = `PhysicalMaterial material; material.diffuseColor = diffuseColor.rgb * ( 1.0 - metalnessFactor ); vec3 dxy = max( abs( dFdx( geometryNormal ) ), abs( dFdy( geometryNormal ) ) ); float geometryRoughness = max( max( dxy.x, dxy.y ), dxy.z ); material.specularRoughness = max( roughnessFactor, 0.0525 );material.specularRoughness += geometryRoughness; material.specularRoughness = min( material.specularRoughness, 1.0 ); #ifdef REFLECTIVITY material.specularColor = mix( vec3( MAXIMUM_SPECULAR_COEFFICIENT * pow2( reflectivity ) ), diffuseColor.rgb, metalnessFactor ); #else material.specularColor = mix( vec3( DEFAULT_SPECULAR_COEFFICIENT ), diffuseColor.rgb, metalnessFactor ); #endif #ifdef CLEARCOAT material.clearcoat = clearcoat; material.clearcoatRoughness = clearcoatRoughness; #ifdef USE_CLEARCOATMAP material.clearcoat *= texture2D( clearcoatMap, vUv ).x; #endif #ifdef USE_CLEARCOAT_ROUGHNESSMAP material.clearcoatRoughness *= texture2D( clearcoatRoughnessMap, vUv ).y; #endif material.clearcoat = saturate( material.clearcoat ); material.clearcoatRoughness = max( material.clearcoatRoughness, 0.0525 ); material.clearcoatRoughness += geometryRoughness; material.clearcoatRoughness = min( material.clearcoatRoughness, 1.0 ); #endif #ifdef USE_SHEEN material.sheenColor = sheen; #endif`, CP = `struct PhysicalMaterial { vec3 diffuseColor; float specularRoughness; vec3 specularColor; #ifdef CLEARCOAT float clearcoat; float clearcoatRoughness; #endif #ifdef USE_SHEEN vec3 sheenColor; #endif }; #define MAXIMUM_SPECULAR_COEFFICIENT 0.16 #define DEFAULT_SPECULAR_COEFFICIENT 0.04 float clearcoatDHRApprox( const in float roughness, const in float dotNL ) { return DEFAULT_SPECULAR_COEFFICIENT + ( 1.0 - DEFAULT_SPECULAR_COEFFICIENT ) * ( pow( 1.0 - dotNL, 5.0 ) * pow( 1.0 - roughness, 2.0 ) ); } #if NUM_RECT_AREA_LIGHTS > 0 void RE_Direct_RectArea_Physical( const in RectAreaLight rectAreaLight, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) { vec3 normal = geometry.normal; vec3 viewDir = geometry.viewDir; vec3 position = geometry.position; vec3 lightPos = rectAreaLight.position; vec3 halfWidth = rectAreaLight.halfWidth; vec3 halfHeight = rectAreaLight.halfHeight; vec3 lightColor = rectAreaLight.color; float roughness = material.specularRoughness; vec3 rectCoords[ 4 ]; rectCoords[ 0 ] = lightPos + halfWidth - halfHeight; rectCoords[ 1 ] = lightPos - halfWidth - halfHeight; rectCoords[ 2 ] = lightPos - halfWidth + halfHeight; rectCoords[ 3 ] = lightPos + halfWidth + halfHeight; vec2 uv = LTC_Uv( normal, viewDir, roughness ); vec4 t1 = texture2D( ltc_1, uv ); vec4 t2 = texture2D( ltc_2, uv ); mat3 mInv = mat3( vec3( t1.x, 0, t1.y ), vec3( 0, 1, 0 ), vec3( t1.z, 0, t1.w ) ); vec3 fresnel = ( material.specularColor * t2.x + ( vec3( 1.0 ) - material.specularColor ) * t2.y ); reflectedLight.directSpecular += lightColor * fresnel * LTC_Evaluate( normal, viewDir, position, mInv, rectCoords ); reflectedLight.directDiffuse += lightColor * material.diffuseColor * LTC_Evaluate( normal, viewDir, position, mat3( 1.0 ), rectCoords ); } #endif void RE_Direct_Physical( const in IncidentLight directLight, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) { float dotNL = saturate( dot( geometry.normal, directLight.direction ) ); vec3 irradiance = dotNL * directLight.color; #ifndef PHYSICALLY_CORRECT_LIGHTS irradiance *= PI; #endif #ifdef CLEARCOAT float ccDotNL = saturate( dot( geometry.clearcoatNormal, directLight.direction ) ); vec3 ccIrradiance = ccDotNL * directLight.color; #ifndef PHYSICALLY_CORRECT_LIGHTS ccIrradiance *= PI; #endif float clearcoatDHR = material.clearcoat * clearcoatDHRApprox( material.clearcoatRoughness, ccDotNL ); reflectedLight.directSpecular += ccIrradiance * material.clearcoat * BRDF_Specular_GGX( directLight, geometry.viewDir, geometry.clearcoatNormal, vec3( DEFAULT_SPECULAR_COEFFICIENT ), material.clearcoatRoughness ); #else float clearcoatDHR = 0.0; #endif #ifdef USE_SHEEN reflectedLight.directSpecular += ( 1.0 - clearcoatDHR ) * irradiance * BRDF_Specular_Sheen( material.specularRoughness, directLight.direction, geometry, material.sheenColor ); #else reflectedLight.directSpecular += ( 1.0 - clearcoatDHR ) * irradiance * BRDF_Specular_GGX( directLight, geometry.viewDir, geometry.normal, material.specularColor, material.specularRoughness); #endif reflectedLight.directDiffuse += ( 1.0 - clearcoatDHR ) * irradiance * BRDF_Diffuse_Lambert( material.diffuseColor ); } void RE_IndirectDiffuse_Physical( const in vec3 irradiance, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) { reflectedLight.indirectDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor ); } void RE_IndirectSpecular_Physical( const in vec3 radiance, const in vec3 irradiance, const in vec3 clearcoatRadiance, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight) { #ifdef CLEARCOAT float ccDotNV = saturate( dot( geometry.clearcoatNormal, geometry.viewDir ) ); reflectedLight.indirectSpecular += clearcoatRadiance * material.clearcoat * BRDF_Specular_GGX_Environment( geometry.viewDir, geometry.clearcoatNormal, vec3( DEFAULT_SPECULAR_COEFFICIENT ), material.clearcoatRoughness ); float ccDotNL = ccDotNV; float clearcoatDHR = material.clearcoat * clearcoatDHRApprox( material.clearcoatRoughness, ccDotNL ); #else float clearcoatDHR = 0.0; #endif float clearcoatInv = 1.0 - clearcoatDHR; vec3 singleScattering = vec3( 0.0 ); vec3 multiScattering = vec3( 0.0 ); vec3 cosineWeightedIrradiance = irradiance * RECIPROCAL_PI; BRDF_Specular_Multiscattering_Environment( geometry, material.specularColor, material.specularRoughness, singleScattering, multiScattering ); vec3 diffuse = material.diffuseColor * ( 1.0 - ( singleScattering + multiScattering ) ); reflectedLight.indirectSpecular += clearcoatInv * radiance * singleScattering; reflectedLight.indirectSpecular += multiScattering * cosineWeightedIrradiance; reflectedLight.indirectDiffuse += diffuse * cosineWeightedIrradiance; } #define RE_Direct RE_Direct_Physical #define RE_Direct_RectArea RE_Direct_RectArea_Physical #define RE_IndirectDiffuse RE_IndirectDiffuse_Physical #define RE_IndirectSpecular RE_IndirectSpecular_Physical float computeSpecularOcclusion( const in float dotNV, const in float ambientOcclusion, const in float roughness ) { return saturate( pow( dotNV + ambientOcclusion, exp2( - 16.0 * roughness - 1.0 ) ) - 1.0 + ambientOcclusion ); }`, LP = ` GeometricContext geometry; geometry.position = - vViewPosition; geometry.normal = normal; geometry.viewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( vViewPosition ); #ifdef CLEARCOAT geometry.clearcoatNormal = clearcoatNormal; #endif IncidentLight directLight; #if ( NUM_POINT_LIGHTS > 0 ) && defined( RE_Direct ) PointLight pointLight; #if defined( USE_SHADOWMAP ) && NUM_POINT_LIGHT_SHADOWS > 0 PointLightShadow pointLightShadow; #endif #pragma unroll_loop_start for ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) { pointLight = pointLights[ i ]; getPointDirectLightIrradiance( pointLight, geometry, directLight ); #if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_POINT_LIGHT_SHADOWS ) pointLightShadow = pointLightShadows[ i ]; directLight.color *= all( bvec2( directLight.visible, receiveShadow ) ) ? getPointShadow( pointShadowMap[ i ], pointLightShadow.shadowMapSize, pointLightShadow.shadowBias, pointLightShadow.shadowRadius, vPointShadowCoord[ i ], pointLightShadow.shadowCameraNear, pointLightShadow.shadowCameraFar ) : 1.0; #endif RE_Direct( directLight, geometry, material, reflectedLight ); } #pragma unroll_loop_end #endif #if ( NUM_SPOT_LIGHTS > 0 ) && defined( RE_Direct ) SpotLight spotLight; #if defined( USE_SHADOWMAP ) && NUM_SPOT_LIGHT_SHADOWS > 0 SpotLightShadow spotLightShadow; #endif #pragma unroll_loop_start for ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) { spotLight = spotLights[ i ]; getSpotDirectLightIrradiance( spotLight, geometry, directLight ); #if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS ) spotLightShadow = spotLightShadows[ i ]; directLight.color *= all( bvec2( directLight.visible, receiveShadow ) ) ? getShadow( spotShadowMap[ i ], spotLightShadow.shadowMapSize, spotLightShadow.shadowBias, spotLightShadow.shadowRadius, vSpotShadowCoord[ i ] ) : 1.0; #endif RE_Direct( directLight, geometry, material, reflectedLight ); } #pragma unroll_loop_end #endif #if ( NUM_DIR_LIGHTS > 0 ) && defined( RE_Direct ) DirectionalLight directionalLight; #if defined( USE_SHADOWMAP ) && NUM_DIR_LIGHT_SHADOWS > 0 DirectionalLightShadow directionalLightShadow; #endif #pragma unroll_loop_start for ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) { directionalLight = directionalLights[ i ]; getDirectionalDirectLightIrradiance( directionalLight, geometry, directLight ); #if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_DIR_LIGHT_SHADOWS ) directionalLightShadow = directionalLightShadows[ i ]; directLight.color *= all( bvec2( directLight.visible, receiveShadow ) ) ? getShadow( directionalShadowMap[ i ], directionalLightShadow.shadowMapSize, directionalLightShadow.shadowBias, directionalLightShadow.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0; #endif RE_Direct( directLight, geometry, material, reflectedLight ); } #pragma unroll_loop_end #endif #if ( NUM_RECT_AREA_LIGHTS > 0 ) && defined( RE_Direct_RectArea ) RectAreaLight rectAreaLight; #pragma unroll_loop_start for ( int i = 0; i < NUM_RECT_AREA_LIGHTS; i ++ ) { rectAreaLight = rectAreaLights[ i ]; RE_Direct_RectArea( rectAreaLight, geometry, material, reflectedLight ); } #pragma unroll_loop_end #endif #if defined( RE_IndirectDiffuse ) vec3 iblIrradiance = vec3( 0.0 ); vec3 irradiance = getAmbientLightIrradiance( ambientLightColor ); irradiance += getLightProbeIrradiance( lightProbe, geometry ); #if ( NUM_HEMI_LIGHTS > 0 ) #pragma unroll_loop_start for ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) { irradiance += getHemisphereLightIrradiance( hemisphereLights[ i ], geometry ); } #pragma unroll_loop_end #endif #endif #if defined( RE_IndirectSpecular ) vec3 radiance = vec3( 0.0 ); vec3 clearcoatRadiance = vec3( 0.0 ); #endif`, RP = `#if defined( RE_IndirectDiffuse ) #ifdef USE_LIGHTMAP vec4 lightMapTexel= texture2D( lightMap, vUv2 ); vec3 lightMapIrradiance = lightMapTexelToLinear( lightMapTexel ).rgb * lightMapIntensity; #ifndef PHYSICALLY_CORRECT_LIGHTS lightMapIrradiance *= PI; #endif irradiance += lightMapIrradiance; #endif #if defined( USE_ENVMAP ) && defined( STANDARD ) && defined( ENVMAP_TYPE_CUBE_UV ) iblIrradiance += getLightProbeIndirectIrradiance( geometry, maxMipLevel ); #endif #endif #if defined( USE_ENVMAP ) && defined( RE_IndirectSpecular ) radiance += getLightProbeIndirectRadiance( geometry.viewDir, geometry.normal, material.specularRoughness, maxMipLevel ); #ifdef CLEARCOAT clearcoatRadiance += getLightProbeIndirectRadiance( geometry.viewDir, geometry.clearcoatNormal, material.clearcoatRoughness, maxMipLevel ); #endif #endif`, OP = `#if defined( RE_IndirectDiffuse ) RE_IndirectDiffuse( irradiance, geometry, material, reflectedLight ); #endif #if defined( RE_IndirectSpecular ) RE_IndirectSpecular( radiance, iblIrradiance, clearcoatRadiance, geometry, material, reflectedLight ); #endif`, PP = `#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT ) gl_FragDepthEXT = vIsPerspective == 0.0 ? gl_FragCoord.z : log2( vFragDepth ) * logDepthBufFC * 0.5; #endif`, IP = `#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT ) uniform float logDepthBufFC; varying float vFragDepth; varying float vIsPerspective; #endif`, DP = `#ifdef USE_LOGDEPTHBUF #ifdef USE_LOGDEPTHBUF_EXT varying float vFragDepth; varying float vIsPerspective; #else uniform float logDepthBufFC; #endif #endif`, NP = `#ifdef USE_LOGDEPTHBUF #ifdef USE_LOGDEPTHBUF_EXT vFragDepth = 1.0 + gl_Position.w; vIsPerspective = float( isPerspectiveMatrix( projectionMatrix ) ); #else if ( isPerspectiveMatrix( projectionMatrix ) ) { gl_Position.z = log2( max( EPSILON, gl_Position.w + 1.0 ) ) * logDepthBufFC - 1.0; gl_Position.z *= gl_Position.w; } #endif #endif`, BP = `#ifdef USE_MAP vec4 texelColor = texture2D( map, vUv ); texelColor = mapTexelToLinear( texelColor ); diffuseColor *= texelColor; #endif`, kP = `#ifdef USE_MAP uniform sampler2D map; #endif`, zP = `#if defined( USE_MAP ) || defined( USE_ALPHAMAP ) vec2 uv = ( uvTransform * vec3( gl_PointCoord.x, 1.0 - gl_PointCoord.y, 1 ) ).xy; #endif #ifdef USE_MAP vec4 mapTexel = texture2D( map, uv ); diffuseColor *= mapTexelToLinear( mapTexel ); #endif #ifdef USE_ALPHAMAP diffuseColor.a *= texture2D( alphaMap, uv ).g; #endif`, FP = `#if defined( USE_MAP ) || defined( USE_ALPHAMAP ) uniform mat3 uvTransform; #endif #ifdef USE_MAP uniform sampler2D map; #endif #ifdef USE_ALPHAMAP uniform sampler2D alphaMap; #endif`, VP = `float metalnessFactor = metalness; #ifdef USE_METALNESSMAP vec4 texelMetalness = texture2D( metalnessMap, vUv ); metalnessFactor *= texelMetalness.b; #endif`, UP = `#ifdef USE_METALNESSMAP uniform sampler2D metalnessMap; #endif`, GP = `#ifdef USE_MORPHNORMALS objectNormal *= morphTargetBaseInfluence; objectNormal += morphNormal0 * morphTargetInfluences[ 0 ]; objectNormal += morphNormal1 * morphTargetInfluences[ 1 ]; objectNormal += morphNormal2 * morphTargetInfluences[ 2 ]; objectNormal += morphNormal3 * morphTargetInfluences[ 3 ]; #endif`, HP = `#ifdef USE_MORPHTARGETS uniform float morphTargetBaseInfluence; #ifndef USE_MORPHNORMALS uniform float morphTargetInfluences[ 8 ]; #else uniform float morphTargetInfluences[ 4 ]; #endif #endif`, jP = `#ifdef USE_MORPHTARGETS transformed *= morphTargetBaseInfluence; transformed += morphTarget0 * morphTargetInfluences[ 0 ]; transformed += morphTarget1 * morphTargetInfluences[ 1 ]; transformed += morphTarget2 * morphTargetInfluences[ 2 ]; transformed += morphTarget3 * morphTargetInfluences[ 3 ]; #ifndef USE_MORPHNORMALS transformed += morphTarget4 * morphTargetInfluences[ 4 ]; transformed += morphTarget5 * morphTargetInfluences[ 5 ]; transformed += morphTarget6 * morphTargetInfluences[ 6 ]; transformed += morphTarget7 * morphTargetInfluences[ 7 ]; #endif #endif`, WP = `float faceDirection = gl_FrontFacing ? 1.0 : - 1.0; #ifdef FLAT_SHADED vec3 fdx = vec3( dFdx( vViewPosition.x ), dFdx( vViewPosition.y ), dFdx( vViewPosition.z ) ); vec3 fdy = vec3( dFdy( vViewPosition.x ), dFdy( vViewPosition.y ), dFdy( vViewPosition.z ) ); vec3 normal = normalize( cross( fdx, fdy ) ); #else vec3 normal = normalize( vNormal ); #ifdef DOUBLE_SIDED normal = normal * faceDirection; #endif #ifdef USE_TANGENT vec3 tangent = normalize( vTangent ); vec3 bitangent = normalize( vBitangent ); #ifdef DOUBLE_SIDED tangent = tangent * faceDirection; bitangent = bitangent * faceDirection; #endif #if defined( TANGENTSPACE_NORMALMAP ) || defined( USE_CLEARCOAT_NORMALMAP ) mat3 vTBN = mat3( tangent, bitangent, normal ); #endif #endif #endif vec3 geometryNormal = normal;`, $P = `#ifdef OBJECTSPACE_NORMALMAP normal = texture2D( normalMap, vUv ).xyz * 2.0 - 1.0; #ifdef FLIP_SIDED normal = - normal; #endif #ifdef DOUBLE_SIDED normal = normal * faceDirection; #endif normal = normalize( normalMatrix * normal ); #elif defined( TANGENTSPACE_NORMALMAP ) vec3 mapN = texture2D( normalMap, vUv ).xyz * 2.0 - 1.0; mapN.xy *= normalScale; #ifdef USE_TANGENT normal = normalize( vTBN * mapN ); #else normal = perturbNormal2Arb( -vViewPosition, normal, mapN, faceDirection ); #endif #elif defined( USE_BUMPMAP ) normal = perturbNormalArb( -vViewPosition, normal, dHdxy_fwd(), faceDirection ); #endif`, qP = `#ifdef USE_NORMALMAP uniform sampler2D normalMap; uniform vec2 normalScale; #endif #ifdef OBJECTSPACE_NORMALMAP uniform mat3 normalMatrix; #endif #if ! defined ( USE_TANGENT ) && ( defined ( TANGENTSPACE_NORMALMAP ) || defined ( USE_CLEARCOAT_NORMALMAP ) ) vec3 perturbNormal2Arb( vec3 eye_pos, vec3 surf_norm, vec3 mapN, float faceDirection ) { vec3 q0 = vec3( dFdx( eye_pos.x ), dFdx( eye_pos.y ), dFdx( eye_pos.z ) ); vec3 q1 = vec3( dFdy( eye_pos.x ), dFdy( eye_pos.y ), dFdy( eye_pos.z ) ); vec2 st0 = dFdx( vUv.st ); vec2 st1 = dFdy( vUv.st ); vec3 N = surf_norm; vec3 q1perp = cross( q1, N ); vec3 q0perp = cross( N, q0 ); vec3 T = q1perp * st0.x + q0perp * st1.x; vec3 B = q1perp * st0.y + q0perp * st1.y; float det = max( dot( T, T ), dot( B, B ) ); float scale = ( det == 0.0 ) ? 0.0 : faceDirection * inversesqrt( det ); return normalize( T * ( mapN.x * scale ) + B * ( mapN.y * scale ) + N * mapN.z ); } #endif`, XP = `#ifdef CLEARCOAT vec3 clearcoatNormal = geometryNormal; #endif`, ZP = `#ifdef USE_CLEARCOAT_NORMALMAP vec3 clearcoatMapN = texture2D( clearcoatNormalMap, vUv ).xyz * 2.0 - 1.0; clearcoatMapN.xy *= clearcoatNormalScale; #ifdef USE_TANGENT clearcoatNormal = normalize( vTBN * clearcoatMapN ); #else clearcoatNormal = perturbNormal2Arb( - vViewPosition, clearcoatNormal, clearcoatMapN, faceDirection ); #endif #endif`, YP = `#ifdef USE_CLEARCOATMAP uniform sampler2D clearcoatMap; #endif #ifdef USE_CLEARCOAT_ROUGHNESSMAP uniform sampler2D clearcoatRoughnessMap; #endif #ifdef USE_CLEARCOAT_NORMALMAP uniform sampler2D clearcoatNormalMap; uniform vec2 clearcoatNormalScale; #endif`, JP = `vec3 packNormalToRGB( const in vec3 normal ) { return normalize( normal ) * 0.5 + 0.5; } vec3 unpackRGBToNormal( const in vec3 rgb ) { return 2.0 * rgb.xyz - 1.0; } const float PackUpscale = 256. / 255.;const float UnpackDownscale = 255. / 256.; const vec3 PackFactors = vec3( 256. * 256. * 256., 256. * 256., 256. ); const vec4 UnpackFactors = UnpackDownscale / vec4( PackFactors, 1. ); const float ShiftRight8 = 1. / 256.; vec4 packDepthToRGBA( const in float v ) { vec4 r = vec4( fract( v * PackFactors ), v ); r.yzw -= r.xyz * ShiftRight8; return r * PackUpscale; } float unpackRGBAToDepth( const in vec4 v ) { return dot( v, UnpackFactors ); } vec4 pack2HalfToRGBA( vec2 v ) { vec4 r = vec4( v.x, fract( v.x * 255.0 ), v.y, fract( v.y * 255.0 )); return vec4( r.x - r.y / 255.0, r.y, r.z - r.w / 255.0, r.w); } vec2 unpackRGBATo2Half( vec4 v ) { return vec2( v.x + ( v.y / 255.0 ), v.z + ( v.w / 255.0 ) ); } float viewZToOrthographicDepth( const in float viewZ, const in float near, const in float far ) { return ( viewZ + near ) / ( near - far ); } float orthographicDepthToViewZ( const in float linearClipZ, const in float near, const in float far ) { return linearClipZ * ( near - far ) - near; } float viewZToPerspectiveDepth( const in float viewZ, const in float near, const in float far ) { return (( near + viewZ ) * far ) / (( far - near ) * viewZ ); } float perspectiveDepthToViewZ( const in float invClipZ, const in float near, const in float far ) { return ( near * far ) / ( ( far - near ) * invClipZ - far ); }`, KP = `#ifdef PREMULTIPLIED_ALPHA gl_FragColor.rgb *= gl_FragColor.a; #endif`, QP = `vec4 mvPosition = vec4( transformed, 1.0 ); #ifdef USE_INSTANCING mvPosition = instanceMatrix * mvPosition; #endif mvPosition = modelViewMatrix * mvPosition; gl_Position = projectionMatrix * mvPosition;`, eI = `#ifdef DITHERING gl_FragColor.rgb = dithering( gl_FragColor.rgb ); #endif`, tI = `#ifdef DITHERING vec3 dithering( vec3 color ) { float grid_position = rand( gl_FragCoord.xy ); vec3 dither_shift_RGB = vec3( 0.25 / 255.0, -0.25 / 255.0, 0.25 / 255.0 ); dither_shift_RGB = mix( 2.0 * dither_shift_RGB, -2.0 * dither_shift_RGB, grid_position ); return color + dither_shift_RGB; } #endif`, iI = `float roughnessFactor = roughness; #ifdef USE_ROUGHNESSMAP vec4 texelRoughness = texture2D( roughnessMap, vUv ); roughnessFactor *= texelRoughness.g; #endif`, rI = `#ifdef USE_ROUGHNESSMAP uniform sampler2D roughnessMap; #endif`, nI = `#ifdef USE_SHADOWMAP #if NUM_DIR_LIGHT_SHADOWS > 0 uniform sampler2D directionalShadowMap[ NUM_DIR_LIGHT_SHADOWS ]; varying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ]; struct DirectionalLightShadow { float shadowBias; float shadowNormalBias; float shadowRadius; vec2 shadowMapSize; }; uniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ]; #endif #if NUM_SPOT_LIGHT_SHADOWS > 0 uniform sampler2D spotShadowMap[ NUM_SPOT_LIGHT_SHADOWS ]; varying vec4 vSpotShadowCoord[ NUM_SPOT_LIGHT_SHADOWS ]; struct SpotLightShadow { float shadowBias; float shadowNormalBias; float shadowRadius; vec2 shadowMapSize; }; uniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ]; #endif #if NUM_POINT_LIGHT_SHADOWS > 0 uniform sampler2D pointShadowMap[ NUM_POINT_LIGHT_SHADOWS ]; varying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ]; struct PointLightShadow { float shadowBias; float shadowNormalBias; float shadowRadius; vec2 shadowMapSize; float shadowCameraNear; float shadowCameraFar; }; uniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ]; #endif float texture2DCompare( sampler2D depths, vec2 uv, float compare ) { return step( compare, unpackRGBAToDepth( texture2D( depths, uv ) ) ); } vec2 texture2DDistribution( sampler2D shadow, vec2 uv ) { return unpackRGBATo2Half( texture2D( shadow, uv ) ); } float VSMShadow (sampler2D shadow, vec2 uv, float compare ){ float occlusion = 1.0; vec2 distribution = texture2DDistribution( shadow, uv ); float hard_shadow = step( compare , distribution.x ); if (hard_shadow != 1.0 ) { float distance = compare - distribution.x ; float variance = max( 0.00000, distribution.y * distribution.y ); 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 ); } return occlusion; } float getShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord ) { float shadow = 1.0; shadowCoord.xyz /= shadowCoord.w; shadowCoord.z += shadowBias; bvec4 inFrustumVec = bvec4 ( shadowCoord.x >= 0.0, shadowCoord.x <= 1.0, shadowCoord.y >= 0.0, shadowCoord.y <= 1.0 ); bool inFrustum = all( inFrustumVec ); bvec2 frustumTestVec = bvec2( inFrustum, shadowCoord.z <= 1.0 ); bool frustumTest = all( frustumTestVec ); if ( frustumTest ) { #if defined( SHADOWMAP_TYPE_PCF ) vec2 texelSize = vec2( 1.0 ) / shadowMapSize; float dx0 = - texelSize.x * shadowRadius; float dy0 = - texelSize.y * shadowRadius; float dx1 = + texelSize.x * shadowRadius; float dy1 = + texelSize.y * shadowRadius; float dx2 = dx0 / 2.0; float dy2 = dy0 / 2.0; float dx3 = dx1 / 2.0; float dy3 = dy1 / 2.0; shadow = ( texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy0 ), shadowCoord.z ) + texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy0 ), shadowCoord.z ) + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy0 ), shadowCoord.z ) + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy2 ), shadowCoord.z ) + texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy2 ), shadowCoord.z ) + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy2 ), shadowCoord.z ) + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, 0.0 ), shadowCoord.z ) + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, 0.0 ), shadowCoord.z ) + texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z ) + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, 0.0 ), shadowCoord.z ) + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, 0.0 ), shadowCoord.z ) + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy3 ), shadowCoord.z ) + texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy3 ), shadowCoord.z ) + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy3 ), shadowCoord.z ) + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy1 ), shadowCoord.z ) + texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy1 ), shadowCoord.z ) + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy1 ), shadowCoord.z ) ) * ( 1.0 / 17.0 ); #elif defined( SHADOWMAP_TYPE_PCF_SOFT ) vec2 texelSize = vec2( 1.0 ) / shadowMapSize; float dx = texelSize.x; float dy = texelSize.y; vec2 uv = shadowCoord.xy; vec2 f = fract( uv * shadowMapSize + 0.5 ); uv -= f * texelSize; shadow = ( texture2DCompare( shadowMap, uv, shadowCoord.z ) + texture2DCompare( shadowMap, uv + vec2( dx, 0.0 ), shadowCoord.z ) + texture2DCompare( shadowMap, uv + vec2( 0.0, dy ), shadowCoord.z ) + texture2DCompare( shadowMap, uv + texelSize, shadowCoord.z ) + mix( texture2DCompare( shadowMap, uv + vec2( -dx, 0.0 ), shadowCoord.z ), texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 0.0 ), shadowCoord.z ), f.x ) + mix( texture2DCompare( shadowMap, uv + vec2( -dx, dy ), shadowCoord.z ), texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, dy ), shadowCoord.z ), f.x ) + mix( texture2DCompare( shadowMap, uv + vec2( 0.0, -dy ), shadowCoord.z ), texture2DCompare( shadowMap, uv + vec2( 0.0, 2.0 * dy ), shadowCoord.z ), f.y ) + mix( texture2DCompare( shadowMap, uv + vec2( dx, -dy ), shadowCoord.z ), texture2DCompare( shadowMap, uv + vec2( dx, 2.0 * dy ), shadowCoord.z ), f.y ) + mix( mix( texture2DCompare( shadowMap, uv + vec2( -dx, -dy ), shadowCoord.z ), texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, -dy ), shadowCoord.z ), f.x ), mix( texture2DCompare( shadowMap, uv + vec2( -dx, 2.0 * dy ), shadowCoord.z ), texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 2.0 * dy ), shadowCoord.z ), f.x ), f.y ) ) * ( 1.0 / 9.0 ); #elif defined( SHADOWMAP_TYPE_VSM ) shadow = VSMShadow( shadowMap, shadowCoord.xy, shadowCoord.z ); #else shadow = texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z ); #endif } return shadow; } vec2 cubeToUV( vec3 v, float texelSizeY ) { vec3 absV = abs( v ); float scaleToCube = 1.0 / max( absV.x, max( absV.y, absV.z ) ); absV *= scaleToCube; v *= scaleToCube * ( 1.0 - 2.0 * texelSizeY ); vec2 planar = v.xy; float almostATexel = 1.5 * texelSizeY; float almostOne = 1.0 - almostATexel; if ( absV.z >= almostOne ) { if ( v.z > 0.0 ) planar.x = 4.0 - v.x; } else if ( absV.x >= almostOne ) { float signX = sign( v.x ); planar.x = v.z * signX + 2.0 * signX; } else if ( absV.y >= almostOne ) { float signY = sign( v.y ); planar.x = v.x + 2.0 * signY + 2.0; planar.y = v.z * signY - 2.0; } return vec2( 0.125, 0.25 ) * planar + vec2( 0.375, 0.75 ); } float getPointShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord, float shadowCameraNear, float shadowCameraFar ) { vec2 texelSize = vec2( 1.0 ) / ( shadowMapSize * vec2( 4.0, 2.0 ) ); vec3 lightToPosition = shadowCoord.xyz; float dp = ( length( lightToPosition ) - shadowCameraNear ) / ( shadowCameraFar - shadowCameraNear ); dp += shadowBias; vec3 bd3D = normalize( lightToPosition ); #if defined( SHADOWMAP_TYPE_PCF ) || defined( SHADOWMAP_TYPE_PCF_SOFT ) || defined( SHADOWMAP_TYPE_VSM ) vec2 offset = vec2( - 1, 1 ) * shadowRadius * texelSize.y; return ( texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyy, texelSize.y ), dp ) + texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyy, texelSize.y ), dp ) + texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyx, texelSize.y ), dp ) + texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyx, texelSize.y ), dp ) + texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp ) + texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxy, texelSize.y ), dp ) + texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxy, texelSize.y ), dp ) + texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxx, texelSize.y ), dp ) + texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxx, texelSize.y ), dp ) ) * ( 1.0 / 9.0 ); #else return texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp ); #endif } #endif`, oI = `#ifdef USE_SHADOWMAP #if NUM_DIR_LIGHT_SHADOWS > 0 uniform mat4 directionalShadowMatrix[ NUM_DIR_LIGHT_SHADOWS ]; varying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ]; struct DirectionalLightShadow { float shadowBias; float shadowNormalBias; float shadowRadius; vec2 shadowMapSize; }; uniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ]; #endif #if NUM_SPOT_LIGHT_SHADOWS > 0 uniform mat4 spotShadowMatrix[ NUM_SPOT_LIGHT_SHADOWS ]; varying vec4 vSpotShadowCoord[ NUM_SPOT_LIGHT_SHADOWS ]; struct SpotLightShadow { float shadowBias; float shadowNormalBias; float shadowRadius; vec2 shadowMapSize; }; uniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ]; #endif #if NUM_POINT_LIGHT_SHADOWS > 0 uniform mat4 pointShadowMatrix[ NUM_POINT_LIGHT_SHADOWS ]; varying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ]; struct PointLightShadow { float shadowBias; float shadowNormalBias; float shadowRadius; vec2 shadowMapSize; float shadowCameraNear; float shadowCameraFar; }; uniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ]; #endif #endif`, aI = `#ifdef USE_SHADOWMAP #if NUM_DIR_LIGHT_SHADOWS > 0 || NUM_SPOT_LIGHT_SHADOWS > 0 || NUM_POINT_LIGHT_SHADOWS > 0 vec3 shadowWorldNormal = inverseTransformDirection( transformedNormal, viewMatrix ); vec4 shadowWorldPosition; #endif #if NUM_DIR_LIGHT_SHADOWS > 0 #pragma unroll_loop_start for ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) { shadowWorldPosition = worldPosition + vec4( shadowWorldNormal * directionalLightShadows[ i ].shadowNormalBias, 0 ); vDirectionalShadowCoord[ i ] = directionalShadowMatrix[ i ] * shadowWorldPosition; } #pragma unroll_loop_end #endif #if NUM_SPOT_LIGHT_SHADOWS > 0 #pragma unroll_loop_start for ( int i = 0; i < NUM_SPOT_LIGHT_SHADOWS; i ++ ) { shadowWorldPosition = worldPosition + vec4( shadowWorldNormal * spotLightShadows[ i ].shadowNormalBias, 0 ); vSpotShadowCoord[ i ] = spotShadowMatrix[ i ] * shadowWorldPosition; } #pragma unroll_loop_end #endif #if NUM_POINT_LIGHT_SHADOWS > 0 #pragma unroll_loop_start for ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) { shadowWorldPosition = worldPosition + vec4( shadowWorldNormal * pointLightShadows[ i ].shadowNormalBias, 0 ); vPointShadowCoord[ i ] = pointShadowMatrix[ i ] * shadowWorldPosition; } #pragma unroll_loop_end #endif #endif`, sI = `float getShadowMask() { float shadow = 1.0; #ifdef USE_SHADOWMAP #if NUM_DIR_LIGHT_SHADOWS > 0 DirectionalLightShadow directionalLight; #pragma unroll_loop_start for ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) { directionalLight = directionalLightShadows[ i ]; shadow *= receiveShadow ? getShadow( directionalShadowMap[ i ], directionalLight.shadowMapSize, directionalLight.shadowBias, directionalLight.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0; } #pragma unroll_loop_end #endif #if NUM_SPOT_LIGHT_SHADOWS > 0 SpotLightShadow spotLight; #pragma unroll_loop_start for ( int i = 0; i < NUM_SPOT_LIGHT_SHADOWS; i ++ ) { spotLight = spotLightShadows[ i ]; shadow *= receiveShadow ? getShadow( spotShadowMap[ i ], spotLight.shadowMapSize, spotLight.shadowBias, spotLight.shadowRadius, vSpotShadowCoord[ i ] ) : 1.0; } #pragma unroll_loop_end #endif #if NUM_POINT_LIGHT_SHADOWS > 0 PointLightShadow pointLight; #pragma unroll_loop_start for ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) { pointLight = pointLightShadows[ i ]; shadow *= receiveShadow ? getPointShadow( pointShadowMap[ i ], pointLight.shadowMapSize, pointLight.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ], pointLight.shadowCameraNear, pointLight.shadowCameraFar ) : 1.0; } #pragma unroll_loop_end #endif #endif return shadow; }`, lI = `#ifdef USE_SKINNING mat4 boneMatX = getBoneMatrix( skinIndex.x ); mat4 boneMatY = getBoneMatrix( skinIndex.y ); mat4 boneMatZ = getBoneMatrix( skinIndex.z ); mat4 boneMatW = getBoneMatrix( skinIndex.w ); #endif`, cI = `#ifdef USE_SKINNING uniform mat4 bindMatrix; uniform mat4 bindMatrixInverse; #ifdef BONE_TEXTURE uniform highp sampler2D boneTexture; uniform int boneTextureSize; mat4 getBoneMatrix( const in float i ) { float j = i * 4.0; float x = mod( j, float( boneTextureSize ) ); float y = floor( j / float( boneTextureSize ) ); float dx = 1.0 / float( boneTextureSize ); float dy = 1.0 / float( boneTextureSize ); y = dy * ( y + 0.5 ); vec4 v1 = texture2D( boneTexture, vec2( dx * ( x + 0.5 ), y ) ); vec4 v2 = texture2D( boneTexture, vec2( dx * ( x + 1.5 ), y ) ); vec4 v3 = texture2D( boneTexture, vec2( dx * ( x + 2.5 ), y ) ); vec4 v4 = texture2D( boneTexture, vec2( dx * ( x + 3.5 ), y ) ); mat4 bone = mat4( v1, v2, v3, v4 ); return bone; } #else uniform mat4 boneMatrices[ MAX_BONES ]; mat4 getBoneMatrix( const in float i ) { mat4 bone = boneMatrices[ int(i) ]; return bone; } #endif #endif`, uI = `#ifdef USE_SKINNING vec4 skinVertex = bindMatrix * vec4( transformed, 1.0 ); vec4 skinned = vec4( 0.0 ); skinned += boneMatX * skinVertex * skinWeight.x; skinned += boneMatY * skinVertex * skinWeight.y; skinned += boneMatZ * skinVertex * skinWeight.z; skinned += boneMatW * skinVertex * skinWeight.w; transformed = ( bindMatrixInverse * skinned ).xyz; #endif`, hI = `#ifdef USE_SKINNING mat4 skinMatrix = mat4( 0.0 ); skinMatrix += skinWeight.x * boneMatX; skinMatrix += skinWeight.y * boneMatY; skinMatrix += skinWeight.z * boneMatZ; skinMatrix += skinWeight.w * boneMatW; skinMatrix = bindMatrixInverse * skinMatrix * bindMatrix; objectNormal = vec4( skinMatrix * vec4( objectNormal, 0.0 ) ).xyz; #ifdef USE_TANGENT objectTangent = vec4( skinMatrix * vec4( objectTangent, 0.0 ) ).xyz; #endif #endif`, dI = `float specularStrength; #ifdef USE_SPECULARMAP vec4 texelSpecular = texture2D( specularMap, vUv ); specularStrength = texelSpecular.r; #else specularStrength = 1.0; #endif`, pI = `#ifdef USE_SPECULARMAP uniform sampler2D specularMap; #endif`, fI = `#if defined( TONE_MAPPING ) gl_FragColor.rgb = toneMapping( gl_FragColor.rgb ); #endif`, mI = `#ifndef saturate #define saturate(a) clamp( a, 0.0, 1.0 ) #endif uniform float toneMappingExposure; vec3 LinearToneMapping( vec3 color ) { return toneMappingExposure * color; } vec3 ReinhardToneMapping( vec3 color ) { color *= toneMappingExposure; return saturate( color / ( vec3( 1.0 ) + color ) ); } vec3 OptimizedCineonToneMapping( vec3 color ) { color *= toneMappingExposure; color = max( vec3( 0.0 ), color - 0.004 ); return pow( ( color * ( 6.2 * color + 0.5 ) ) / ( color * ( 6.2 * color + 1.7 ) + 0.06 ), vec3( 2.2 ) ); } vec3 RRTAndODTFit( vec3 v ) { vec3 a = v * ( v + 0.0245786 ) - 0.000090537; vec3 b = v * ( 0.983729 * v + 0.4329510 ) + 0.238081; return a / b; } vec3 ACESFilmicToneMapping( vec3 color ) { const mat3 ACESInputMat = mat3( vec3( 0.59719, 0.07600, 0.02840 ), vec3( 0.35458, 0.90834, 0.13383 ), vec3( 0.04823, 0.01566, 0.83777 ) ); const mat3 ACESOutputMat = mat3( vec3( 1.60475, -0.10208, -0.00327 ), vec3( -0.53108, 1.10813, -0.07276 ), vec3( -0.07367, -0.00605, 1.07602 ) ); color *= toneMappingExposure / 0.6; color = ACESInputMat * color; color = RRTAndODTFit( color ); color = ACESOutputMat * color; return saturate( color ); } vec3 CustomToneMapping( vec3 color ) { return color; }`, gI = `#ifdef USE_TRANSMISSION float transmissionFactor = transmission; float thicknessFactor = thickness; #ifdef USE_TRANSMISSIONMAP transmissionFactor *= texture2D( transmissionMap, vUv ).r; #endif #ifdef USE_THICKNESSNMAP thicknessFactor *= texture2D( thicknessMap, vUv ).g; #endif vec3 pos = vWorldPosition.xyz / vWorldPosition.w; vec3 v = normalize( cameraPosition - pos ); float ior = ( 1.0 + 0.4 * reflectivity ) / ( 1.0 - 0.4 * reflectivity ); vec3 transmission = transmissionFactor * getIBLVolumeRefraction( normal, v, roughnessFactor, material.diffuseColor, totalSpecular, pos, modelMatrix, viewMatrix, projectionMatrix, ior, thicknessFactor, attenuationColor, attenuationDistance ); totalDiffuse = mix( totalDiffuse, transmission, transmissionFactor ); #endif`, vI = `#ifdef USE_TRANSMISSION #ifdef USE_TRANSMISSIONMAP uniform sampler2D transmissionMap; #endif #ifdef USE_THICKNESSMAP uniform sampler2D thicknessMap; #endif uniform vec2 transmissionSamplerSize; uniform sampler2D transmissionSamplerMap; uniform mat4 modelMatrix; uniform mat4 projectionMatrix; varying vec4 vWorldPosition; vec3 getVolumeTransmissionRay(vec3 n, vec3 v, float thickness, float ior, mat4 modelMatrix) { vec3 refractionVector = refract(-v, normalize(n), 1.0 / ior); vec3 modelScale; modelScale.x = length(vec3(modelMatrix[0].xyz)); modelScale.y = length(vec3(modelMatrix[1].xyz)); modelScale.z = length(vec3(modelMatrix[2].xyz)); return normalize(refractionVector) * thickness * modelScale; } float applyIorToRoughness(float roughness, float ior) { return roughness * clamp(ior * 2.0 - 2.0, 0.0, 1.0); } vec3 getTransmissionSample(vec2 fragCoord, float roughness, float ior) { float framebufferLod = log2(transmissionSamplerSize.x) * applyIorToRoughness(roughness, ior); return texture2DLodEXT(transmissionSamplerMap, fragCoord.xy, framebufferLod).rgb; } vec3 applyVolumeAttenuation(vec3 radiance, float transmissionDistance, vec3 attenuationColor, float attenuationDistance) { if (attenuationDistance == 0.0) { return radiance; } else { vec3 attenuationCoefficient = -log(attenuationColor) / attenuationDistance; vec3 transmittance = exp(-attenuationCoefficient * transmissionDistance); return transmittance * radiance; } } vec3 getIBLVolumeRefraction(vec3 n, vec3 v, float perceptualRoughness, vec3 baseColor, vec3 specularColor, vec3 position, mat4 modelMatrix, mat4 viewMatrix, mat4 projMatrix, float ior, float thickness, vec3 attenuationColor, float attenuationDistance) { vec3 transmissionRay = getVolumeTransmissionRay(n, v, thickness, ior, modelMatrix); vec3 refractedRayExit = position + transmissionRay; vec4 ndcPos = projMatrix * viewMatrix * vec4(refractedRayExit, 1.0); vec2 refractionCoords = ndcPos.xy / ndcPos.w; refractionCoords += 1.0; refractionCoords /= 2.0; vec3 transmittedLight = getTransmissionSample(refractionCoords, perceptualRoughness, ior); vec3 attenuatedColor = applyVolumeAttenuation(transmittedLight, length(transmissionRay), attenuationColor, attenuationDistance); return (1.0 - specularColor) * attenuatedColor * baseColor; } #endif`, yI = `#if ( defined( USE_UV ) && ! defined( UVS_VERTEX_ONLY ) ) varying vec2 vUv; #endif`, bI = `#ifdef USE_UV #ifdef UVS_VERTEX_ONLY vec2 vUv; #else varying vec2 vUv; #endif uniform mat3 uvTransform; #endif`, xI = `#ifdef USE_UV vUv = ( uvTransform * vec3( uv, 1 ) ).xy; #endif`, wI = `#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP ) varying vec2 vUv2; #endif`, _I = `#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP ) attribute vec2 uv2; varying vec2 vUv2; uniform mat3 uv2Transform; #endif`, MI = `#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP ) vUv2 = ( uv2Transform * vec3( uv2, 1 ) ).xy; #endif`, SI = `#if defined( USE_ENVMAP ) || defined( DISTANCE ) || defined ( USE_SHADOWMAP ) || defined ( USE_TRANSMISSION ) vec4 worldPosition = vec4( transformed, 1.0 ); #ifdef USE_INSTANCING worldPosition = instanceMatrix * worldPosition; #endif worldPosition = modelMatrix * worldPosition; #endif`, TI = `uniform sampler2D t2D; varying vec2 vUv; void main() { vec4 texColor = texture2D( t2D, vUv ); gl_FragColor = mapTexelToLinear( texColor ); #include #include }`, EI = `varying vec2 vUv; uniform mat3 uvTransform; void main() { vUv = ( uvTransform * vec3( uv, 1 ) ).xy; gl_Position = vec4( position.xy, 1.0, 1.0 ); }`, AI = `#include uniform float opacity; varying vec3 vWorldDirection; #include void main() { vec3 vReflect = vWorldDirection; #include gl_FragColor = envColor; gl_FragColor.a *= opacity; #include #include }`, CI = `varying vec3 vWorldDirection; #include void main() { vWorldDirection = transformDirection( position, modelMatrix ); #include #include gl_Position.z = gl_Position.w; }`, LI = `#if DEPTH_PACKING == 3200 uniform float opacity; #endif #include #include #include #include #include #include #include varying vec2 vHighPrecisionZW; void main() { #include vec4 diffuseColor = vec4( 1.0 ); #if DEPTH_PACKING == 3200 diffuseColor.a = opacity; #endif #include #include #include #include float fragCoordZ = 0.5 * vHighPrecisionZW[0] / vHighPrecisionZW[1] + 0.5; #if DEPTH_PACKING == 3200 gl_FragColor = vec4( vec3( 1.0 - fragCoordZ ), opacity ); #elif DEPTH_PACKING == 3201 gl_FragColor = packDepthToRGBA( fragCoordZ ); #endif }`, RI = `#include #include #include #include #include #include #include varying vec2 vHighPrecisionZW; void main() { #include #include #ifdef USE_DISPLACEMENTMAP #include #include #include #endif #include #include #include #include #include #include #include vHighPrecisionZW = gl_Position.zw; }`, OI = `#define DISTANCE uniform vec3 referencePosition; uniform float nearDistance; uniform float farDistance; varying vec3 vWorldPosition; #include #include #include #include #include #include void main () { #include vec4 diffuseColor = vec4( 1.0 ); #include #include #include float dist = length( vWorldPosition - referencePosition ); dist = ( dist - nearDistance ) / ( farDistance - nearDistance ); dist = saturate( dist ); gl_FragColor = packDepthToRGBA( dist ); }`, PI = `#define DISTANCE varying vec3 vWorldPosition; #include #include #include #include #include #include void main() { #include #include #ifdef USE_DISPLACEMENTMAP #include #include #include #endif #include #include #include #include #include #include #include vWorldPosition = worldPosition.xyz; }`, II = `uniform sampler2D tEquirect; varying vec3 vWorldDirection; #include void main() { vec3 direction = normalize( vWorldDirection ); vec2 sampleUV = equirectUv( direction ); vec4 texColor = texture2D( tEquirect, sampleUV ); gl_FragColor = mapTexelToLinear( texColor ); #include #include }`, DI = `varying vec3 vWorldDirection; #include void main() { vWorldDirection = transformDirection( position, modelMatrix ); #include #include }`, NI = `uniform vec3 diffuse; uniform float opacity; uniform float dashSize; uniform float totalSize; varying float vLineDistance; #include #include #include #include #include void main() { #include if ( mod( vLineDistance, totalSize ) > dashSize ) { discard; } vec3 outgoingLight = vec3( 0.0 ); vec4 diffuseColor = vec4( diffuse, opacity ); #include #include outgoingLight = diffuseColor.rgb; gl_FragColor = vec4( outgoingLight, diffuseColor.a ); #include #include #include #include }`, BI = `uniform float scale; attribute float lineDistance; varying float vLineDistance; #include #include #include #include #include #include void main() { vLineDistance = scale * lineDistance; #include #include #include #include #include #include #include }`, kI = `uniform vec3 diffuse; uniform float opacity; #ifndef FLAT_SHADED varying vec3 vNormal; #endif #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include void main() { #include vec4 diffuseColor = vec4( diffuse, opacity ); #include #include #include #include #include #include ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); #ifdef USE_LIGHTMAP vec4 lightMapTexel= texture2D( lightMap, vUv2 ); reflectedLight.indirectDiffuse += lightMapTexelToLinear( lightMapTexel ).rgb * lightMapIntensity; #else reflectedLight.indirectDiffuse += vec3( 1.0 ); #endif #include reflectedLight.indirectDiffuse *= diffuseColor.rgb; vec3 outgoingLight = reflectedLight.indirectDiffuse; #include gl_FragColor = vec4( outgoingLight, diffuseColor.a ); #include #include #include #include #include }`, zI = `#include #include #include #include #include #include #include #include #include #include void main() { #include #include #include #include #ifdef USE_ENVMAP #include #include #include #include #endif #include #include #include #include #include #include #include #include #include }`, FI = `uniform vec3 diffuse; uniform vec3 emissive; uniform float opacity; varying vec3 vLightFront; varying vec3 vIndirectFront; #ifdef DOUBLE_SIDED varying vec3 vLightBack; varying vec3 vIndirectBack; #endif #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include void main() { #include vec4 diffuseColor = vec4( diffuse, opacity ); ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); vec3 totalEmissiveRadiance = emissive; #include #include #include #include #include #include #include #ifdef DOUBLE_SIDED reflectedLight.indirectDiffuse += ( gl_FrontFacing ) ? vIndirectFront : vIndirectBack; #else reflectedLight.indirectDiffuse += vIndirectFront; #endif #include reflectedLight.indirectDiffuse *= BRDF_Diffuse_Lambert( diffuseColor.rgb ); #ifdef DOUBLE_SIDED reflectedLight.directDiffuse = ( gl_FrontFacing ) ? vLightFront : vLightBack; #else reflectedLight.directDiffuse = vLightFront; #endif reflectedLight.directDiffuse *= BRDF_Diffuse_Lambert( diffuseColor.rgb ) * getShadowMask(); #include vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance; #include gl_FragColor = vec4( outgoingLight, diffuseColor.a ); #include #include #include #include #include }`, VI = `#define LAMBERT varying vec3 vLightFront; varying vec3 vIndirectFront; #ifdef DOUBLE_SIDED varying vec3 vLightBack; varying vec3 vIndirectBack; #endif #include #include #include #include #include #include #include #include #include #include #include #include #include void main() { #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include }`, UI = `#define MATCAP uniform vec3 diffuse; uniform float opacity; uniform sampler2D matcap; varying vec3 vViewPosition; #ifndef FLAT_SHADED varying vec3 vNormal; #endif #include #include #include #include #include #include #include #include #include #include #include void main() { #include vec4 diffuseColor = vec4( diffuse, opacity ); #include #include #include #include #include #include #include vec3 viewDir = normalize( vViewPosition ); vec3 x = normalize( vec3( viewDir.z, 0.0, - viewDir.x ) ); vec3 y = cross( viewDir, x ); vec2 uv = vec2( dot( x, normal ), dot( y, normal ) ) * 0.495 + 0.5; #ifdef USE_MATCAP vec4 matcapColor = texture2D( matcap, uv ); matcapColor = matcapTexelToLinear( matcapColor ); #else vec4 matcapColor = vec4( 1.0 ); #endif vec3 outgoingLight = diffuseColor.rgb * matcapColor.rgb; gl_FragColor = vec4( outgoingLight, diffuseColor.a ); #include #include #include #include #include }`, GI = `#define MATCAP varying vec3 vViewPosition; #ifndef FLAT_SHADED varying vec3 vNormal; #endif #include #include #include #include #include #include #include #include #include void main() { #include #include #include #include #include #include #include #ifndef FLAT_SHADED vNormal = normalize( transformedNormal ); #endif #include #include #include #include #include #include #include #include vViewPosition = - mvPosition.xyz; }`, HI = `#define TOON uniform vec3 diffuse; uniform vec3 emissive; uniform float opacity; #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include void main() { #include vec4 diffuseColor = vec4( diffuse, opacity ); ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); vec3 totalEmissiveRadiance = emissive; #include #include #include #include #include #include #include #include #include #include #include #include #include vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance; gl_FragColor = vec4( outgoingLight, diffuseColor.a ); #include #include #include #include #include }`, jI = `#define TOON varying vec3 vViewPosition; #ifndef FLAT_SHADED varying vec3 vNormal; #endif #include #include #include #include #include #include #include #include #include #include #include void main() { #include #include #include #include #include #include #include #include #ifndef FLAT_SHADED vNormal = normalize( transformedNormal ); #endif #include #include #include #include #include #include #include vViewPosition = - mvPosition.xyz; #include #include #include }`, WI = `#define PHONG uniform vec3 diffuse; uniform vec3 emissive; uniform vec3 specular; uniform float shininess; uniform float opacity; #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include void main() { #include vec4 diffuseColor = vec4( diffuse, opacity ); ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); vec3 totalEmissiveRadiance = emissive; #include #include #include #include #include #include #include #include #include #include #include #include #include #include vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance; #include gl_FragColor = vec4( outgoingLight, diffuseColor.a ); #include #include #include #include #include }`, $I = `#define PHONG varying vec3 vViewPosition; #ifndef FLAT_SHADED varying vec3 vNormal; #endif #include #include #include #include #include #include #include #include #include #include #include #include void main() { #include #include #include #include #include #include #include #include #ifndef FLAT_SHADED vNormal = normalize( transformedNormal ); #endif #include #include #include #include #include #include #include vViewPosition = - mvPosition.xyz; #include #include #include #include }`, qI = `#define STANDARD #ifdef PHYSICAL #define REFLECTIVITY #define CLEARCOAT #endif uniform vec3 diffuse; uniform vec3 emissive; uniform float roughness; uniform float metalness; uniform float opacity; #ifdef USE_TRANSMISSION uniform float transmission; uniform float thickness; uniform vec3 attenuationColor; uniform float attenuationDistance; #endif #ifdef REFLECTIVITY uniform float reflectivity; #endif #ifdef CLEARCOAT uniform float clearcoat; uniform float clearcoatRoughness; #endif #ifdef USE_SHEEN uniform vec3 sheen; #endif varying vec3 vViewPosition; #ifndef FLAT_SHADED varying vec3 vNormal; #ifdef USE_TANGENT varying vec3 vTangent; varying vec3 vBitangent; #endif #endif #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include void main() { #include vec4 diffuseColor = vec4( diffuse, opacity ); ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); vec3 totalEmissiveRadiance = emissive; #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include vec3 totalDiffuse = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse; vec3 totalSpecular = reflectedLight.directSpecular + reflectedLight.indirectSpecular; #include vec3 outgoingLight = totalDiffuse + totalSpecular + totalEmissiveRadiance; gl_FragColor = vec4( outgoingLight, diffuseColor.a ); #include #include #include #include #include }`, XI = `#define STANDARD varying vec3 vViewPosition; #ifndef FLAT_SHADED varying vec3 vNormal; #ifdef USE_TANGENT varying vec3 vTangent; varying vec3 vBitangent; #endif #endif #ifdef USE_TRANSMISSION varying vec4 vWorldPosition; #endif #include #include #include #include #include #include #include #include #include #include #include void main() { #include #include #include #include #include #include #include #include #ifndef FLAT_SHADED vNormal = normalize( transformedNormal ); #ifdef USE_TANGENT vTangent = normalize( transformedTangent ); vBitangent = normalize( cross( vNormal, vTangent ) * tangent.w ); #endif #endif #include #include #include #include #include #include #include vViewPosition = - mvPosition.xyz; #include #include #include #ifdef USE_TRANSMISSION vWorldPosition = worldPosition; #endif }`, ZI = `#define NORMAL uniform float opacity; #if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( TANGENTSPACE_NORMALMAP ) varying vec3 vViewPosition; #endif #ifndef FLAT_SHADED varying vec3 vNormal; #ifdef USE_TANGENT varying vec3 vTangent; varying vec3 vBitangent; #endif #endif #include #include #include #include #include #include void main() { #include #include #include #include gl_FragColor = vec4( packNormalToRGB( normal ), opacity ); }`, YI = `#define NORMAL #if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( TANGENTSPACE_NORMALMAP ) varying vec3 vViewPosition; #endif #ifndef FLAT_SHADED varying vec3 vNormal; #ifdef USE_TANGENT varying vec3 vTangent; varying vec3 vBitangent; #endif #endif #include #include #include #include #include #include #include void main() { #include #include #include #include #include #include #ifndef FLAT_SHADED vNormal = normalize( transformedNormal ); #ifdef USE_TANGENT vTangent = normalize( transformedTangent ); vBitangent = normalize( cross( vNormal, vTangent ) * tangent.w ); #endif #endif #include #include #include #include #include #include #include #if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( TANGENTSPACE_NORMALMAP ) vViewPosition = - mvPosition.xyz; #endif }`, JI = `uniform vec3 diffuse; uniform float opacity; #include #include #include #include #include #include void main() { #include vec3 outgoingLight = vec3( 0.0 ); vec4 diffuseColor = vec4( diffuse, opacity ); #include #include #include #include outgoingLight = diffuseColor.rgb; gl_FragColor = vec4( outgoingLight, diffuseColor.a ); #include #include #include #include }`, KI = `uniform float size; uniform float scale; #include #include #include #include #include #include void main() { #include #include #include #include gl_PointSize = size; #ifdef USE_SIZEATTENUATION bool isPerspective = isPerspectiveMatrix( projectionMatrix ); if ( isPerspective ) gl_PointSize *= ( scale / - mvPosition.z ); #endif #include #include #include #include }`, QI = `uniform vec3 color; uniform float opacity; #include #include #include #include #include #include #include void main() { gl_FragColor = vec4( color, opacity * ( 1.0 - getShadowMask() ) ); #include #include #include }`, eD = `#include #include #include void main() { #include #include #include #include #include #include #include #include #include #include }`, tD = `uniform vec3 diffuse; uniform float opacity; #include #include #include #include #include #include #include void main() { #include vec3 outgoingLight = vec3( 0.0 ); vec4 diffuseColor = vec4( diffuse, opacity ); #include #include #include #include outgoingLight = diffuseColor.rgb; gl_FragColor = vec4( outgoingLight, diffuseColor.a ); #include #include #include }`, iD = `uniform float rotation; uniform vec2 center; #include #include #include #include #include void main() { #include vec4 mvPosition = modelViewMatrix * vec4( 0.0, 0.0, 0.0, 1.0 ); vec2 scale; scale.x = length( vec3( modelMatrix[ 0 ].x, modelMatrix[ 0 ].y, modelMatrix[ 0 ].z ) ); scale.y = length( vec3( modelMatrix[ 1 ].x, modelMatrix[ 1 ].y, modelMatrix[ 1 ].z ) ); #ifndef USE_SIZEATTENUATION bool isPerspective = isPerspectiveMatrix( projectionMatrix ); if ( isPerspective ) scale *= - mvPosition.z; #endif vec2 alignedPosition = ( position.xy - ( center - vec2( 0.5 ) ) ) * scale; vec2 rotatedPosition; rotatedPosition.x = cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y; rotatedPosition.y = sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y; mvPosition.xy += rotatedPosition; gl_Position = projectionMatrix * mvPosition; #include #include #include }`; const lt = { alphamap_fragment: BO, alphamap_pars_fragment: kO, alphatest_fragment: zO, aomap_fragment: FO, aomap_pars_fragment: VO, begin_vertex: UO, beginnormal_vertex: GO, bsdfs: HO, bumpmap_pars_fragment: jO, clipping_planes_fragment: WO, clipping_planes_pars_fragment: $O, clipping_planes_pars_vertex: qO, clipping_planes_vertex: XO, color_fragment: ZO, color_pars_fragment: YO, color_pars_vertex: JO, color_vertex: KO, common: QO, cube_uv_reflection_fragment: eP, defaultnormal_vertex: tP, displacementmap_pars_vertex: iP, displacementmap_vertex: rP, emissivemap_fragment: nP, emissivemap_pars_fragment: oP, encodings_fragment: aP, encodings_pars_fragment: sP, envmap_fragment: lP, envmap_common_pars_fragment: cP, envmap_pars_fragment: uP, envmap_pars_vertex: hP, envmap_physical_pars_fragment: _P, envmap_vertex: dP, fog_vertex: pP, fog_pars_vertex: fP, fog_fragment: mP, fog_pars_fragment: gP, gradientmap_pars_fragment: vP, lightmap_fragment: yP, lightmap_pars_fragment: bP, lights_lambert_vertex: xP, lights_pars_begin: wP, lights_toon_fragment: MP, lights_toon_pars_fragment: SP, lights_phong_fragment: TP, lights_phong_pars_fragment: EP, lights_physical_fragment: AP, lights_physical_pars_fragment: CP, lights_fragment_begin: LP, lights_fragment_maps: RP, lights_fragment_end: OP, logdepthbuf_fragment: PP, logdepthbuf_pars_fragment: IP, logdepthbuf_pars_vertex: DP, logdepthbuf_vertex: NP, map_fragment: BP, map_pars_fragment: kP, map_particle_fragment: zP, map_particle_pars_fragment: FP, metalnessmap_fragment: VP, metalnessmap_pars_fragment: UP, morphnormal_vertex: GP, morphtarget_pars_vertex: HP, morphtarget_vertex: jP, normal_fragment_begin: WP, normal_fragment_maps: $P, normalmap_pars_fragment: qP, clearcoat_normal_fragment_begin: XP, clearcoat_normal_fragment_maps: ZP, clearcoat_pars_fragment: YP, packing: JP, premultiplied_alpha_fragment: KP, project_vertex: QP, dithering_fragment: eI, dithering_pars_fragment: tI, roughnessmap_fragment: iI, roughnessmap_pars_fragment: rI, shadowmap_pars_fragment: nI, shadowmap_pars_vertex: oI, shadowmap_vertex: aI, shadowmask_pars_fragment: sI, skinbase_vertex: lI, skinning_pars_vertex: cI, skinning_vertex: uI, skinnormal_vertex: hI, specularmap_fragment: dI, specularmap_pars_fragment: pI, tonemapping_fragment: fI, tonemapping_pars_fragment: mI, transmission_fragment: gI, transmission_pars_fragment: vI, uv_pars_fragment: yI, uv_pars_vertex: bI, uv_vertex: xI, uv2_pars_fragment: wI, uv2_pars_vertex: _I, uv2_vertex: MI, worldpos_vertex: SI, background_frag: TI, background_vert: EI, cube_frag: AI, cube_vert: CI, depth_frag: LI, depth_vert: RI, distanceRGBA_frag: OI, distanceRGBA_vert: PI, equirect_frag: II, equirect_vert: DI, linedashed_frag: NI, linedashed_vert: BI, meshbasic_frag: kI, meshbasic_vert: zI, meshlambert_frag: FI, meshlambert_vert: VI, meshmatcap_frag: UI, meshmatcap_vert: GI, meshtoon_frag: HI, meshtoon_vert: jI, meshphong_frag: WI, meshphong_vert: $I, meshphysical_frag: qI, meshphysical_vert: XI, normal_frag: ZI, normal_vert: YI, points_frag: JI, points_vert: KI, shadow_frag: QI, shadow_vert: eD, sprite_frag: tD, sprite_vert: iD }, Fe = { common: { diffuse: { value: new Be(16777215) }, opacity: { value: 1 }, map: { value: null }, uvTransform: { value: new ii() }, uv2Transform: { value: new ii() }, alphaMap: { value: null } }, specularmap: { specularMap: { value: null } }, envmap: { envMap: { value: null }, flipEnvMap: { value: -1 }, reflectivity: { value: 1 }, refractionRatio: { value: 0.98 }, maxMipLevel: { value: 0 } }, aomap: { aoMap: { value: null }, aoMapIntensity: { value: 1 } }, lightmap: { lightMap: { value: null }, lightMapIntensity: { value: 1 } }, emissivemap: { emissiveMap: { value: null } }, bumpmap: { bumpMap: { value: null }, bumpScale: { value: 1 } }, normalmap: { normalMap: { value: null }, normalScale: { value: new Oe(1, 1) } }, displacementmap: { displacementMap: { value: null }, displacementScale: { value: 1 }, displacementBias: { value: 0 } }, roughnessmap: { roughnessMap: { value: null } }, metalnessmap: { metalnessMap: { value: null } }, gradientmap: { gradientMap: { value: null } }, fog: { fogDensity: { value: 25e-5 }, fogNear: { value: 1 }, fogFar: { value: 2e3 }, fogColor: { value: new Be(16777215) } }, lights: { ambientLightColor: { value: [] }, lightProbe: { value: [] }, directionalLights: { value: [], properties: { direction: {}, color: {} } }, directionalLightShadows: { value: [], properties: { shadowBias: {}, shadowNormalBias: {}, shadowRadius: {}, shadowMapSize: {} } }, directionalShadowMap: { value: [] }, directionalShadowMatrix: { value: [] }, spotLights: { value: [], properties: { color: {}, position: {}, direction: {}, distance: {}, coneCos: {}, penumbraCos: {}, decay: {} } }, spotLightShadows: { value: [], properties: { shadowBias: {}, shadowNormalBias: {}, shadowRadius: {}, shadowMapSize: {} } }, spotShadowMap: { value: [] }, spotShadowMatrix: { value: [] }, pointLights: { value: [], properties: { color: {}, position: {}, decay: {}, distance: {} } }, pointLightShadows: { value: [], properties: { shadowBias: {}, shadowNormalBias: {}, shadowRadius: {}, shadowMapSize: {}, shadowCameraNear: {}, shadowCameraFar: {} } }, pointShadowMap: { value: [] }, pointShadowMatrix: { value: [] }, hemisphereLights: { value: [], properties: { direction: {}, skyColor: {}, groundColor: {} } }, // TODO (abelnation): RectAreaLight BRDF data needs to be moved from example to main src rectAreaLights: { value: [], properties: { color: {}, position: {}, width: {}, height: {} } }, ltc_1: { value: null }, ltc_2: { value: null } }, points: { diffuse: { value: new Be(16777215) }, opacity: { value: 1 }, size: { value: 1 }, scale: { value: 1 }, map: { value: null }, alphaMap: { value: null }, uvTransform: { value: new ii() } }, sprite: { diffuse: { value: new Be(16777215) }, opacity: { value: 1 }, center: { value: new Oe(0.5, 0.5) }, rotation: { value: 0 }, map: { value: null }, alphaMap: { value: null }, uvTransform: { value: new ii() } } }, fr = { basic: { uniforms: wi([ Fe.common, Fe.specularmap, Fe.envmap, Fe.aomap, Fe.lightmap, Fe.fog ]), vertexShader: lt.meshbasic_vert, fragmentShader: lt.meshbasic_frag }, lambert: { uniforms: wi([ Fe.common, Fe.specularmap, Fe.envmap, Fe.aomap, Fe.lightmap, Fe.emissivemap, Fe.fog, Fe.lights, { emissive: { value: new Be(0) } } ]), vertexShader: lt.meshlambert_vert, fragmentShader: lt.meshlambert_frag }, phong: { uniforms: wi([ Fe.common, Fe.specularmap, Fe.envmap, Fe.aomap, Fe.lightmap, Fe.emissivemap, Fe.bumpmap, Fe.normalmap, Fe.displacementmap, Fe.fog, Fe.lights, { emissive: { value: new Be(0) }, specular: { value: new Be(1118481) }, shininess: { value: 30 } } ]), vertexShader: lt.meshphong_vert, fragmentShader: lt.meshphong_frag }, standard: { uniforms: wi([ Fe.common, Fe.envmap, Fe.aomap, Fe.lightmap, Fe.emissivemap, Fe.bumpmap, Fe.normalmap, Fe.displacementmap, Fe.roughnessmap, Fe.metalnessmap, Fe.fog, Fe.lights, { emissive: { value: new Be(0) }, roughness: { value: 1 }, metalness: { value: 0 }, envMapIntensity: { value: 1 } // temporary } ]), vertexShader: lt.meshphysical_vert, fragmentShader: lt.meshphysical_frag }, toon: { uniforms: wi([ Fe.common, Fe.aomap, Fe.lightmap, Fe.emissivemap, Fe.bumpmap, Fe.normalmap, Fe.displacementmap, Fe.gradientmap, Fe.fog, Fe.lights, { emissive: { value: new Be(0) } } ]), vertexShader: lt.meshtoon_vert, fragmentShader: lt.meshtoon_frag }, matcap: { uniforms: wi([ Fe.common, Fe.bumpmap, Fe.normalmap, Fe.displacementmap, Fe.fog, { matcap: { value: null } } ]), vertexShader: lt.meshmatcap_vert, fragmentShader: lt.meshmatcap_frag }, points: { uniforms: wi([ Fe.points, Fe.fog ]), vertexShader: lt.points_vert, fragmentShader: lt.points_frag }, dashed: { uniforms: wi([ Fe.common, Fe.fog, { scale: { value: 1 }, dashSize: { value: 1 }, totalSize: { value: 2 } } ]), vertexShader: lt.linedashed_vert, fragmentShader: lt.linedashed_frag }, depth: { uniforms: wi([ Fe.common, Fe.displacementmap ]), vertexShader: lt.depth_vert, fragmentShader: lt.depth_frag }, normal: { uniforms: wi([ Fe.common, Fe.bumpmap, Fe.normalmap, Fe.displacementmap, { opacity: { value: 1 } } ]), vertexShader: lt.normal_vert, fragmentShader: lt.normal_frag }, sprite: { uniforms: wi([ Fe.sprite, Fe.fog ]), vertexShader: lt.sprite_vert, fragmentShader: lt.sprite_frag }, background: { uniforms: { uvTransform: { value: new ii() }, t2D: { value: null } }, vertexShader: lt.background_vert, fragmentShader: lt.background_frag }, /* ------------------------------------------------------------------------- // Cube map shader ------------------------------------------------------------------------- */ cube: { uniforms: wi([ Fe.envmap, { opacity: { value: 1 } } ]), vertexShader: lt.cube_vert, fragmentShader: lt.cube_frag }, equirect: { uniforms: { tEquirect: { value: null } }, vertexShader: lt.equirect_vert, fragmentShader: lt.equirect_frag }, distanceRGBA: { uniforms: wi([ Fe.common, Fe.displacementmap, { referencePosition: { value: new Z() }, nearDistance: { value: 1 }, farDistance: { value: 1e3 } } ]), vertexShader: lt.distanceRGBA_vert, fragmentShader: lt.distanceRGBA_frag }, shadow: { uniforms: wi([ Fe.lights, Fe.fog, { color: { value: new Be(0) }, opacity: { value: 1 } } ]), vertexShader: lt.shadow_vert, fragmentShader: lt.shadow_frag } }; fr.physical = { uniforms: wi([ fr.standard.uniforms, { clearcoat: { value: 0 }, clearcoatMap: { value: null }, clearcoatRoughness: { value: 0 }, clearcoatRoughnessMap: { value: null }, clearcoatNormalScale: { value: new Oe(1, 1) }, clearcoatNormalMap: { value: null }, sheen: { value: new Be(0) }, transmission: { value: 0 }, transmissionMap: { value: null }, transmissionSamplerSize: { value: new Oe() }, transmissionSamplerMap: { value: null }, thickness: { value: 0 }, thicknessMap: { value: null }, attenuationDistance: { value: 0 }, attenuationColor: { value: new Be(0) } } ]), vertexShader: lt.meshphysical_vert, fragmentShader: lt.meshphysical_frag }; function rD(i, e, t, r, n) { const o = new Be(0); let a = 0, s, c, l = null, h = 0, u = null; function p(m, d) { let y = !1, f = d.isScene === !0 ? d.background : null; f && f.isTexture && (f = e.get(f)); const v = i.xr, M = v.getSession && v.getSession(); M && M.environmentBlendMode === "additive" && (f = null), f === null ? g(o, a) : f && f.isColor && (g(f, 1), y = !0), (i.autoClear || y) && i.clear(i.autoClearColor, i.autoClearDepth, i.autoClearStencil), f && (f.isCubeTexture || f.mapping === ls) ? (c === void 0 && (c = new Yt( new un(1, 1, 1), new hn({ name: "BackgroundCubeMaterial", uniforms: Va(fr.cube.uniforms), vertexShader: fr.cube.vertexShader, fragmentShader: fr.cube.fragmentShader, side: $t, depthTest: !1, depthWrite: !1, fog: !1 }) ), c.geometry.deleteAttribute("normal"), c.geometry.deleteAttribute("uv"), c.onBeforeRender = function(S, T, x) { this.matrixWorld.copyPosition(x.matrixWorld); }, Object.defineProperty(c.material, "envMap", { get: function() { return this.uniforms.envMap.value; } }), r.update(c)), c.material.uniforms.envMap.value = f, c.material.uniforms.flipEnvMap.value = f.isCubeTexture && f._needsFlipEnvMap ? -1 : 1, (l !== f || h !== f.version || u !== i.toneMapping) && (c.material.needsUpdate = !0, l = f, h = f.version, u = i.toneMapping), m.unshift(c, c.geometry, c.material, 0, 0, null)) : f && f.isTexture && (s === void 0 && (s = new Yt( new No(2, 2), new hn({ name: "BackgroundMaterial", uniforms: Va(fr.background.uniforms), vertexShader: fr.background.vertexShader, fragmentShader: fr.background.fragmentShader, side: qn, depthTest: !1, depthWrite: !1, fog: !1 }) ), s.geometry.deleteAttribute("normal"), Object.defineProperty(s.material, "map", { get: function() { return this.uniforms.t2D.value; } }), r.update(s)), s.material.uniforms.t2D.value = f, f.matrixAutoUpdate === !0 && f.updateMatrix(), s.material.uniforms.uvTransform.value.copy(f.matrix), (l !== f || h !== f.version || u !== i.toneMapping) && (s.material.needsUpdate = !0, l = f, h = f.version, u = i.toneMapping), m.unshift(s, s.geometry, s.material, 0, 0, null)); } function g(m, d) { t.buffers.color.setClear(m.r, m.g, m.b, d, n); } return { getClearColor: function() { return o; }, setClearColor: function(m, d = 1) { o.set(m), a = d, g(o, a); }, getClearAlpha: function() { return a; }, setClearAlpha: function(m) { a = m, g(o, a); }, render: p }; } function nD(i, e, t, r) { const n = i.getParameter(34921), o = r.isWebGL2 ? null : e.get("OES_vertex_array_object"), a = r.isWebGL2 || o !== null, s = {}, c = d(null); let l = c; function h(C, I, R, b, P) { let N = !1; if (a) { const D = m(b, R, I); l !== D && (l = D, p(l.object)), N = y(b, P), N && f(b, P); } else { const D = I.wireframe === !0; (l.geometry !== b.id || l.program !== R.id || l.wireframe !== D) && (l.geometry = b.id, l.program = R.id, l.wireframe = D, N = !0); } C.isInstancedMesh === !0 && (N = !0), P !== null && t.update(P, 34963), N && (w(C, I, R, b), P !== null && i.bindBuffer(34963, t.get(P).buffer)); } function u() { return r.isWebGL2 ? i.createVertexArray() : o.createVertexArrayOES(); } function p(C) { return r.isWebGL2 ? i.bindVertexArray(C) : o.bindVertexArrayOES(C); } function g(C) { return r.isWebGL2 ? i.deleteVertexArray(C) : o.deleteVertexArrayOES(C); } function m(C, I, R) { const b = R.wireframe === !0; let P = s[C.id]; P === void 0 && (P = {}, s[C.id] = P); let N = P[I.id]; N === void 0 && (N = {}, P[I.id] = N); let D = N[b]; return D === void 0 && (D = d(u()), N[b] = D), D; } function d(C) { const I = [], R = [], b = []; for (let P = 0; P < n; P++) I[P] = 0, R[P] = 0, b[P] = 0; return { // for backward compatibility on non-VAO support browser geometry: null, program: null, wireframe: !1, newAttributes: I, enabledAttributes: R, attributeDivisors: b, object: C, attributes: {}, index: null }; } function y(C, I) { const R = l.attributes, b = C.attributes; let P = 0; for (const N in b) { const D = R[N], k = b[N]; if (D === void 0 || D.attribute !== k || D.data !== k.data) return !0; P++; } return l.attributesNum !== P || l.index !== I; } function f(C, I) { const R = {}, b = C.attributes; let P = 0; for (const N in b) { const D = b[N], k = {}; k.attribute = D, D.data && (k.data = D.data), R[N] = k, P++; } l.attributes = R, l.attributesNum = P, l.index = I; } function v() { const C = l.newAttributes; for (let I = 0, R = C.length; I < R; I++) C[I] = 0; } function M(C) { S(C, 0); } function S(C, I) { const R = l.newAttributes, b = l.enabledAttributes, P = l.attributeDivisors; R[C] = 1, b[C] === 0 && (i.enableVertexAttribArray(C), b[C] = 1), P[C] !== I && ((r.isWebGL2 ? i : e.get("ANGLE_instanced_arrays"))[r.isWebGL2 ? "vertexAttribDivisor" : "vertexAttribDivisorANGLE"](C, I), P[C] = I); } function T() { const C = l.newAttributes, I = l.enabledAttributes; for (let R = 0, b = I.length; R < b; R++) I[R] !== C[R] && (i.disableVertexAttribArray(R), I[R] = 0); } function x(C, I, R, b, P, N) { r.isWebGL2 === !0 && (R === 5124 || R === 5125) ? i.vertexAttribIPointer(C, I, R, P, N) : i.vertexAttribPointer(C, I, R, b, P, N); } function w(C, I, R, b) { if (r.isWebGL2 === !1 && (C.isInstancedMesh || b.isInstancedBufferGeometry) && e.get("ANGLE_instanced_arrays") === null) return; v(); const P = b.attributes, N = R.getAttributes(), D = I.defaultAttributeValues; for (const k in N) { const V = N[k]; if (V >= 0) { const q = P[k]; if (q !== void 0) { const Y = q.normalized, ne = q.itemSize, X = t.get(q); if (X === void 0) continue; const z = X.buffer, H = X.type, ee = X.bytesPerElement; if (q.isInterleavedBufferAttribute) { const Q = q.data, J = Q.stride, W = q.offset; Q && Q.isInstancedInterleavedBuffer ? (S(V, Q.meshPerAttribute), b._maxInstanceCount === void 0 && (b._maxInstanceCount = Q.meshPerAttribute * Q.count)) : M(V), i.bindBuffer(34962, z), x(V, ne, H, Y, J * ee, W * ee); } else q.isInstancedBufferAttribute ? (S(V, q.meshPerAttribute), b._maxInstanceCount === void 0 && (b._maxInstanceCount = q.meshPerAttribute * q.count)) : M(V), i.bindBuffer(34962, z), x(V, ne, H, Y, 0, 0); } else if (k === "instanceMatrix") { const Y = t.get(C.instanceMatrix); if (Y === void 0) continue; const ne = Y.buffer, X = Y.type; S(V + 0, 1), S(V + 1, 1), S(V + 2, 1), S(V + 3, 1), i.bindBuffer(34962, ne), i.vertexAttribPointer(V + 0, 4, X, !1, 64, 0), i.vertexAttribPointer(V + 1, 4, X, !1, 64, 16), i.vertexAttribPointer(V + 2, 4, X, !1, 64, 32), i.vertexAttribPointer(V + 3, 4, X, !1, 64, 48); } else if (k === "instanceColor") { const Y = t.get(C.instanceColor); if (Y === void 0) continue; const ne = Y.buffer, X = Y.type; S(V, 1), i.bindBuffer(34962, ne), i.vertexAttribPointer(V, 3, X, !1, 12, 0); } else if (D !== void 0) { const Y = D[k]; if (Y !== void 0) switch (Y.length) { case 2: i.vertexAttrib2fv(V, Y); break; case 3: i.vertexAttrib3fv(V, Y); break; case 4: i.vertexAttrib4fv(V, Y); break; default: i.vertexAttrib1fv(V, Y); } } } } T(); } function A() { O(); for (const C in s) { const I = s[C]; for (const R in I) { const b = I[R]; for (const P in b) g(b[P].object), delete b[P]; delete I[R]; } delete s[C]; } } function _(C) { if (s[C.id] === void 0) return; const I = s[C.id]; for (const R in I) { const b = I[R]; for (const P in b) g(b[P].object), delete b[P]; delete I[R]; } delete s[C.id]; } function E(C) { for (const I in s) { const R = s[I]; if (R[C.id] === void 0) continue; const b = R[C.id]; for (const P in b) g(b[P].object), delete b[P]; delete R[C.id]; } } function O() { L(), l !== c && (l = c, p(l.object)); } function L() { c.geometry = null, c.program = null, c.wireframe = !1; } return { setup: h, reset: O, resetDefaultState: L, dispose: A, releaseStatesOfGeometry: _, releaseStatesOfProgram: E, initAttributes: v, enableAttribute: M, disableUnusedAttributes: T }; } function oD(i, e, t, r) { const n = r.isWebGL2; let o; function a(l) { o = l; } function s(l, h) { i.drawArrays(o, l, h), t.update(h, o, 1); } function c(l, h, u) { if (u === 0) return; let p, g; if (n) p = i, g = "drawArraysInstanced"; else if (p = e.get("ANGLE_instanced_arrays"), g = "drawArraysInstancedANGLE", p === null) { console.error("THREE.WebGLBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays."); return; } p[g](o, l, h, u), t.update(h, o, u); } this.setMode = a, this.render = s, this.renderInstances = c; } function aD(i, e, t) { let r; function n() { if (r !== void 0) return r; if (e.has("EXT_texture_filter_anisotropic") === !0) { const w = e.get("EXT_texture_filter_anisotropic"); r = i.getParameter(w.MAX_TEXTURE_MAX_ANISOTROPY_EXT); } else r = 0; return r; } function o(w) { if (w === "highp") { if (i.getShaderPrecisionFormat(35633, 36338).precision > 0 && i.getShaderPrecisionFormat(35632, 36338).precision > 0) return "highp"; w = "mediump"; } return w === "mediump" && i.getShaderPrecisionFormat(35633, 36337).precision > 0 && i.getShaderPrecisionFormat(35632, 36337).precision > 0 ? "mediump" : "lowp"; } const a = typeof WebGL2RenderingContext < "u" && i instanceof WebGL2RenderingContext || typeof WebGL2ComputeRenderingContext < "u" && i instanceof WebGL2ComputeRenderingContext; let s = t.precision !== void 0 ? t.precision : "highp"; const c = o(s); c !== s && (console.warn("THREE.WebGLRenderer:", s, "not supported, using", c, "instead."), s = c); const l = a || e.has("WEBGL_draw_buffers"), h = t.logarithmicDepthBuffer === !0, u = i.getParameter(34930), p = i.getParameter(35660), g = i.getParameter(3379), m = i.getParameter(34076), d = i.getParameter(34921), y = i.getParameter(36347), f = i.getParameter(36348), v = i.getParameter(36349), M = p > 0, S = a || e.has("OES_texture_float"), T = M && S, x = a ? i.getParameter(36183) : 0; return { isWebGL2: a, drawBuffers: l, getMaxAnisotropy: n, getMaxPrecision: o, precision: s, logarithmicDepthBuffer: h, maxTextures: u, maxVertexTextures: p, maxTextureSize: g, maxCubemapSize: m, maxAttributes: d, maxVertexUniforms: y, maxVaryings: f, maxFragmentUniforms: v, vertexTextures: M, floatFragmentTextures: S, floatVertexTextures: T, maxSamples: x }; } function sD(i) { const e = this; let t = null, r = 0, n = !1, o = !1; const a = new Ar(), s = new ii(), c = { value: null, needsUpdate: !1 }; this.uniform = c, this.numPlanes = 0, this.numIntersection = 0, this.init = function(u, p, g) { const m = u.length !== 0 || p || // enable state of previous frame - the clipping code has to // run another frame in order to reset the state: r !== 0 || n; return n = p, t = h(u, g, 0), r = u.length, m; }, this.beginShadows = function() { o = !0, h(null); }, this.endShadows = function() { o = !1, l(); }, this.setState = function(u, p, g) { const m = u.clippingPlanes, d = u.clipIntersection, y = u.clipShadows, f = i.get(u); if (!n || m === null || m.length === 0 || o && !y) o ? h(null) : l(); else { const v = o ? 0 : r, M = v * 4; let S = f.clippingState || null; c.value = S, S = h(m, p, M, g); for (let T = 0; T !== M; ++T) S[T] = t[T]; f.clippingState = S, this.numIntersection = d ? this.numPlanes : 0, this.numPlanes += v; } }; function l() { c.value !== t && (c.value = t, c.needsUpdate = r > 0), e.numPlanes = r, e.numIntersection = 0; } function h(u, p, g, m) { const d = u !== null ? u.length : 0; let y = null; if (d !== 0) { if (y = c.value, m !== !0 || y === null) { const f = g + d * 4, v = p.matrixWorldInverse; s.getNormalMatrix(v), (y === null || y.length < f) && (y = new Float32Array(f)); for (let M = 0, S = g; M !== d; ++M, S += 4) a.copy(u[M]).applyMatrix4(v, s), a.normal.toArray(y, S), y[S + 3] = a.constant; } c.value = y, c.needsUpdate = !0; } return e.numPlanes = d, e.numIntersection = 0, y; } } function lD(i) { let e = /* @__PURE__ */ new WeakMap(); function t(a, s) { return s === Qc ? a.mapping = yl : s === eu && (a.mapping = bl), a; } function r(a) { if (a && a.isTexture) { const s = a.mapping; if (s === Qc || s === eu) if (e.has(a)) { const c = e.get(a).texture; return t(c, a.mapping); } else { const c = a.image; if (c && c.height > 0) { const l = i.getRenderTarget(), h = new Pu(c.height / 2); return h.fromEquirectangularTexture(i, a), e.set(a, h), i.setRenderTarget(l), a.addEventListener("dispose", n), t(h.texture, a.mapping); } else return null; } } return a; } function n(a) { const s = a.target; s.removeEventListener("dispose", n); const c = e.get(s); c !== void 0 && (e.delete(s), c.dispose()); } function o() { e = /* @__PURE__ */ new WeakMap(); } return { get: r, dispose: o }; } function cD(i) { const e = {}; function t(r) { if (e[r] !== void 0) return e[r]; let n; switch (r) { case "WEBGL_depth_texture": n = i.getExtension("WEBGL_depth_texture") || i.getExtension("MOZ_WEBGL_depth_texture") || i.getExtension("WEBKIT_WEBGL_depth_texture"); break; case "EXT_texture_filter_anisotropic": n = i.getExtension("EXT_texture_filter_anisotropic") || i.getExtension("MOZ_EXT_texture_filter_anisotropic") || i.getExtension("WEBKIT_EXT_texture_filter_anisotropic"); break; case "WEBGL_compressed_texture_s3tc": n = i.getExtension("WEBGL_compressed_texture_s3tc") || i.getExtension("MOZ_WEBGL_compressed_texture_s3tc") || i.getExtension("WEBKIT_WEBGL_compressed_texture_s3tc"); break; case "WEBGL_compressed_texture_pvrtc": n = i.getExtension("WEBGL_compressed_texture_pvrtc") || i.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc"); break; default: n = i.getExtension(r); } return e[r] = n, n; } return { has: function(r) { return t(r) !== null; }, init: function(r) { r.isWebGL2 ? t("EXT_color_buffer_float") : (t("WEBGL_depth_texture"), t("OES_texture_float"), t("OES_texture_half_float"), t("OES_texture_half_float_linear"), t("OES_standard_derivatives"), t("OES_element_index_uint"), t("OES_vertex_array_object"), t("ANGLE_instanced_arrays")), t("OES_texture_float_linear"), t("EXT_color_buffer_half_float"); }, get: function(r) { const n = t(r); return n === null && console.warn("THREE.WebGLRenderer: " + r + " extension not supported."), n; } }; } function uD(i, e, t, r) { const n = {}, o = /* @__PURE__ */ new WeakMap(); function a(u) { const p = u.target; p.index !== null && e.remove(p.index); for (const m in p.attributes) e.remove(p.attributes[m]); p.removeEventListener("dispose", a), delete n[p.id]; const g = o.get(p); g && (e.remove(g), o.delete(p)), r.releaseStatesOfGeometry(p), p.isInstancedBufferGeometry === !0 && delete p._maxInstanceCount, t.memory.geometries--; } function s(u, p) { return n[p.id] === !0 || (p.addEventListener("dispose", a), n[p.id] = !0, t.memory.geometries++), p; } function c(u) { const p = u.attributes; for (const m in p) e.update(p[m], 34962); const g = u.morphAttributes; for (const m in g) { const d = g[m]; for (let y = 0, f = d.length; y < f; y++) e.update(d[y], 34962); } } function l(u) { const p = [], g = u.index, m = u.attributes.position; let d = 0; if (g !== null) { const v = g.array; d = g.version; for (let M = 0, S = v.length; M < S; M += 3) { const T = v[M + 0], x = v[M + 1], w = v[M + 2]; p.push(T, x, x, w, w, T); } } else { const v = m.array; d = m.version; for (let M = 0, S = v.length / 3 - 1; M < S; M += 3) { const T = M + 0, x = M + 1, w = M + 2; p.push(T, x, x, w, w, T); } } const y = new (Mx(p) > 65535 ? Ru : Lu)(p, 1); y.version = d; const f = o.get(u); f && e.remove(f), o.set(u, y); } function h(u) { const p = o.get(u); if (p) { const g = u.index; g !== null && p.version < g.version && l(u); } else l(u); return o.get(u); } return { get: s, update: c, getWireframeAttribute: h }; } function hD(i, e, t, r) { const n = r.isWebGL2; let o; function a(p) { o = p; } let s, c; function l(p) { s = p.type, c = p.bytesPerElement; } function h(p, g) { i.drawElements(o, g, s, p * c), t.update(g, o, 1); } function u(p, g, m) { if (m === 0) return; let d, y; if (n) d = i, y = "drawElementsInstanced"; else if (d = e.get("ANGLE_instanced_arrays"), y = "drawElementsInstancedANGLE", d === null) { console.error("THREE.WebGLIndexedBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays."); return; } d[y](o, g, s, p * c, m), t.update(g, o, m); } this.setMode = a, this.setIndex = l, this.render = h, this.renderInstances = u; } function dD(i) { const e = { geometries: 0, textures: 0 }, t = { frame: 0, calls: 0, triangles: 0, points: 0, lines: 0 }; function r(o, a, s) { switch (t.calls++, a) { case 4: t.triangles += s * (o / 3); break; case 1: t.lines += s * (o / 2); break; case 3: t.lines += s * (o - 1); break; case 2: t.lines += s * o; break; case 0: t.points += s * o; break; default: console.error("THREE.WebGLInfo: Unknown draw mode:", a); break; } } function n() { t.frame++, t.calls = 0, t.triangles = 0, t.points = 0, t.lines = 0; } return { memory: e, render: t, programs: null, autoReset: !0, reset: n, update: r }; } function pD(i, e) { return i[0] - e[0]; } function fD(i, e) { return Math.abs(e[1]) - Math.abs(i[1]); } function mD(i) { const e = {}, t = new Float32Array(8), r = []; for (let o = 0; o < 8; o++) r[o] = [o, 0]; function n(o, a, s, c) { const l = o.morphTargetInfluences, h = l === void 0 ? 0 : l.length; let u = e[a.id]; if (u === void 0 || u.length !== h) { u = []; for (let y = 0; y < h; y++) u[y] = [y, 0]; e[a.id] = u; } for (let y = 0; y < h; y++) { const f = u[y]; f[0] = y, f[1] = l[y]; } u.sort(fD); for (let y = 0; y < 8; y++) y < h && u[y][1] ? (r[y][0] = u[y][0], r[y][1] = u[y][1]) : (r[y][0] = Number.MAX_SAFE_INTEGER, r[y][1] = 0); r.sort(pD); const p = s.morphTargets && a.morphAttributes.position, g = s.morphNormals && a.morphAttributes.normal; let m = 0; for (let y = 0; y < 8; y++) { const f = r[y], v = f[0], M = f[1]; v !== Number.MAX_SAFE_INTEGER && M ? (p && a.getAttribute("morphTarget" + y) !== p[v] && a.setAttribute("morphTarget" + y, p[v]), g && a.getAttribute("morphNormal" + y) !== g[v] && a.setAttribute("morphNormal" + y, g[v]), t[y] = M, m += M) : (p && a.hasAttribute("morphTarget" + y) === !0 && a.deleteAttribute("morphTarget" + y), g && a.hasAttribute("morphNormal" + y) === !0 && a.deleteAttribute("morphNormal" + y), t[y] = 0); } const d = a.morphTargetsRelative ? 1 : 1 - m; c.getUniforms().setValue(i, "morphTargetBaseInfluence", d), c.getUniforms().setValue(i, "morphTargetInfluences", t); } return { update: n }; } function gD(i, e, t, r) { let n = /* @__PURE__ */ new WeakMap(); function o(c) { const l = r.render.frame, h = c.geometry, u = e.get(c, h); return n.get(u) !== l && (e.update(u), n.set(u, l)), c.isInstancedMesh && (c.hasEventListener("dispose", s) === !1 && c.addEventListener("dispose", s), t.update(c.instanceMatrix, 34962), c.instanceColor !== null && t.update(c.instanceColor, 34962)), u; } function a() { n = /* @__PURE__ */ new WeakMap(); } function s(c) { const l = c.target; l.removeEventListener("dispose", s), t.remove(l.instanceMatrix), l.instanceColor !== null && t.remove(l.instanceColor); } return { update: o, dispose: a }; } class Yp extends Jt { constructor(e = null, t = 1, r = 1, n = 1) { super(null), this.image = { data: e, width: t, height: r, depth: n }, this.magFilter = qt, this.minFilter = qt, this.wrapR = li, this.generateMipmaps = !1, this.flipY = !1, this.unpackAlignment = 1, this.needsUpdate = !0; } } Yp.prototype.isDataTexture2DArray = !0; class Jp extends Jt { constructor(e = null, t = 1, r = 1, n = 1) { super(null), this.image = { data: e, width: t, height: r, depth: n }, this.magFilter = qt, this.minFilter = qt, this.wrapR = li, this.generateMipmaps = !1, this.flipY = !1, this.unpackAlignment = 1, this.needsUpdate = !0; } } Jp.prototype.isDataTexture3D = !0; const Ex = new Jt(), vD = new Yp(), yD = new Jp(), Ax = new cs(), Mg = [], Sg = [], Tg = new Float32Array(16), Eg = new Float32Array(9), Ag = new Float32Array(4); function us(i, e, t) { const r = i[0]; if (r <= 0 || r > 0) return i; const n = e * t; let o = Mg[n]; if (o === void 0 && (o = new Float32Array(n), Mg[n] = o), e !== 0) { r.toArray(o, 0); for (let a = 1, s = 0; a !== e; ++a) s += t, i[a].toArray(o, s); } return o; } function Oi(i, e) { if (i.length !== e.length) return !1; for (let t = 0, r = i.length; t < r; t++) if (i[t] !== e[t]) return !1; return !0; } function Ti(i, e) { for (let t = 0, r = e.length; t < r; t++) i[t] = e[t]; } function Cx(i, e) { let t = Sg[e]; t === void 0 && (t = new Int32Array(e), Sg[e] = t); for (let r = 0; r !== e; ++r) t[r] = i.allocateTextureUnit(); return t; } function bD(i, e) { const t = this.cache; t[0] !== e && (i.uniform1f(this.addr, e), t[0] = e); } function xD(i, e) { const t = this.cache; if (e.x !== void 0) (t[0] !== e.x || t[1] !== e.y) && (i.uniform2f(this.addr, e.x, e.y), t[0] = e.x, t[1] = e.y); else { if (Oi(t, e)) return; i.uniform2fv(this.addr, e), Ti(t, e); } } function wD(i, e) { const t = this.cache; if (e.x !== void 0) (t[0] !== e.x || t[1] !== e.y || t[2] !== e.z) && (i.uniform3f(this.addr, e.x, e.y, e.z), t[0] = e.x, t[1] = e.y, t[2] = e.z); else if (e.r !== void 0) (t[0] !== e.r || t[1] !== e.g || t[2] !== e.b) && (i.uniform3f(this.addr, e.r, e.g, e.b), t[0] = e.r, t[1] = e.g, t[2] = e.b); else { if (Oi(t, e)) return; i.uniform3fv(this.addr, e), Ti(t, e); } } function _D(i, e) { const t = this.cache; if (e.x !== void 0) (t[0] !== e.x || t[1] !== e.y || t[2] !== e.z || t[3] !== e.w) && (i.uniform4f(this.addr, e.x, e.y, e.z, e.w), t[0] = e.x, t[1] = e.y, t[2] = e.z, t[3] = e.w); else { if (Oi(t, e)) return; i.uniform4fv(this.addr, e), Ti(t, e); } } function MD(i, e) { const t = this.cache, r = e.elements; if (r === void 0) { if (Oi(t, e)) return; i.uniformMatrix2fv(this.addr, !1, e), Ti(t, e); } else { if (Oi(t, r)) return; Ag.set(r), i.uniformMatrix2fv(this.addr, !1, Ag), Ti(t, r); } } function SD(i, e) { const t = this.cache, r = e.elements; if (r === void 0) { if (Oi(t, e)) return; i.uniformMatrix3fv(this.addr, !1, e), Ti(t, e); } else { if (Oi(t, r)) return; Eg.set(r), i.uniformMatrix3fv(this.addr, !1, Eg), Ti(t, r); } } function TD(i, e) { const t = this.cache, r = e.elements; if (r === void 0) { if (Oi(t, e)) return; i.uniformMatrix4fv(this.addr, !1, e), Ti(t, e); } else { if (Oi(t, r)) return; Tg.set(r), i.uniformMatrix4fv(this.addr, !1, Tg), Ti(t, r); } } function ED(i, e) { const t = this.cache; t[0] !== e && (i.uniform1i(this.addr, e), t[0] = e); } function AD(i, e) { const t = this.cache; Oi(t, e) || (i.uniform2iv(this.addr, e), Ti(t, e)); } function CD(i, e) { const t = this.cache; Oi(t, e) || (i.uniform3iv(this.addr, e), Ti(t, e)); } function LD(i, e) { const t = this.cache; Oi(t, e) || (i.uniform4iv(this.addr, e), Ti(t, e)); } function RD(i, e) { const t = this.cache; t[0] !== e && (i.uniform1ui(this.addr, e), t[0] = e); } function OD(i, e) { const t = this.cache; Oi(t, e) || (i.uniform2uiv(this.addr, e), Ti(t, e)); } function PD(i, e) { const t = this.cache; Oi(t, e) || (i.uniform3uiv(this.addr, e), Ti(t, e)); } function ID(i, e) { const t = this.cache; Oi(t, e) || (i.uniform4uiv(this.addr, e), Ti(t, e)); } function DD(i, e, t) { const r = this.cache, n = t.allocateTextureUnit(); r[0] !== n && (i.uniform1i(this.addr, n), r[0] = n), t.safeSetTexture2D(e || Ex, n); } function ND(i, e, t) { const r = this.cache, n = t.allocateTextureUnit(); r[0] !== n && (i.uniform1i(this.addr, n), r[0] = n), t.setTexture3D(e || yD, n); } function BD(i, e, t) { const r = this.cache, n = t.allocateTextureUnit(); r[0] !== n && (i.uniform1i(this.addr, n), r[0] = n), t.safeSetTextureCube(e || Ax, n); } function kD(i, e, t) { const r = this.cache, n = t.allocateTextureUnit(); r[0] !== n && (i.uniform1i(this.addr, n), r[0] = n), t.setTexture2DArray(e || vD, n); } function zD(i) { switch (i) { case 5126: return bD; case 35664: return xD; case 35665: return wD; case 35666: return _D; case 35674: return MD; case 35675: return SD; case 35676: return TD; case 5124: case 35670: return ED; case 35667: case 35671: return AD; case 35668: case 35672: return CD; case 35669: case 35673: return LD; case 5125: return RD; case 36294: return OD; case 36295: return PD; case 36296: return ID; case 35678: case 36198: case 36298: case 36306: case 35682: return DD; case 35679: case 36299: case 36307: return ND; case 35680: case 36300: case 36308: case 36293: return BD; case 36289: case 36303: case 36311: case 36292: return kD; } } function FD(i, e) { i.uniform1fv(this.addr, e); } function VD(i, e) { const t = us(e, this.size, 2); i.uniform2fv(this.addr, t); } function UD(i, e) { const t = us(e, this.size, 3); i.uniform3fv(this.addr, t); } function GD(i, e) { const t = us(e, this.size, 4); i.uniform4fv(this.addr, t); } function HD(i, e) { const t = us(e, this.size, 4); i.uniformMatrix2fv(this.addr, !1, t); } function jD(i, e) { const t = us(e, this.size, 9); i.uniformMatrix3fv(this.addr, !1, t); } function WD(i, e) { const t = us(e, this.size, 16); i.uniformMatrix4fv(this.addr, !1, t); } function $D(i, e) { i.uniform1iv(this.addr, e); } function qD(i, e) { i.uniform2iv(this.addr, e); } function XD(i, e) { i.uniform3iv(this.addr, e); } function ZD(i, e) { i.uniform4iv(this.addr, e); } function YD(i, e) { i.uniform1uiv(this.addr, e); } function JD(i, e) { i.uniform2uiv(this.addr, e); } function KD(i, e) { i.uniform3uiv(this.addr, e); } function QD(i, e) { i.uniform4uiv(this.addr, e); } function eN(i, e, t) { const r = e.length, n = Cx(t, r); i.uniform1iv(this.addr, n); for (let o = 0; o !== r; ++o) t.safeSetTexture2D(e[o] || Ex, n[o]); } function tN(i, e, t) { const r = e.length, n = Cx(t, r); i.uniform1iv(this.addr, n); for (let o = 0; o !== r; ++o) t.safeSetTextureCube(e[o] || Ax, n[o]); } function iN(i) { switch (i) { case 5126: return FD; case 35664: return VD; case 35665: return UD; case 35666: return GD; case 35674: return HD; case 35675: return jD; case 35676: return WD; case 5124: case 35670: return $D; case 35667: case 35671: return qD; case 35668: case 35672: return XD; case 35669: case 35673: return ZD; case 5125: return YD; case 36294: return JD; case 36295: return KD; case 36296: return QD; case 35678: case 36198: case 36298: case 36306: case 35682: return eN; case 35680: case 36300: case 36308: case 36293: return tN; } } function rN(i, e, t) { this.id = i, this.addr = t, this.cache = [], this.setValue = zD(e.type); } function Lx(i, e, t) { this.id = i, this.addr = t, this.cache = [], this.size = e.size, this.setValue = iN(e.type); } Lx.prototype.updateCache = function(i) { const e = this.cache; i instanceof Float32Array && e.length !== i.length && (this.cache = new Float32Array(i.length)), Ti(e, i); }; function Rx(i) { this.id = i, this.seq = [], this.map = {}; } Rx.prototype.setValue = function(i, e, t) { const r = this.seq; for (let n = 0, o = r.length; n !== o; ++n) { const a = r[n]; a.setValue(i, e[a.id], t); } }; const Lh = /(\w+)(\])?(\[|\.)?/g; function Cg(i, e) { i.seq.push(e), i.map[e.id] = e; } function nN(i, e, t) { const r = i.name, n = r.length; for (Lh.lastIndex = 0; ; ) { const o = Lh.exec(r), a = Lh.lastIndex; let s = o[1]; const c = o[2] === "]", l = o[3]; if (c && (s = s | 0), l === void 0 || l === "[" && a + 2 === n) { Cg(t, l === void 0 ? new rN(s, i, e) : new Lx(s, i, e)); break; } else { let h = t.map[s]; h === void 0 && (h = new Rx(s), Cg(t, h)), t = h; } } } function Vn(i, e) { this.seq = [], this.map = {}; const t = i.getProgramParameter(e, 35718); for (let r = 0; r < t; ++r) { const n = i.getActiveUniform(e, r), o = i.getUniformLocation(e, n.name); nN(n, o, this); } } Vn.prototype.setValue = function(i, e, t, r) { const n = this.map[e]; n !== void 0 && n.setValue(i, t, r); }; Vn.prototype.setOptional = function(i, e, t) { const r = e[t]; r !== void 0 && this.setValue(i, t, r); }; Vn.upload = function(i, e, t, r) { for (let n = 0, o = e.length; n !== o; ++n) { const a = e[n], s = t[a.id]; s.needsUpdate !== !1 && a.setValue(i, s.value, r); } }; Vn.seqWithValue = function(i, e) { const t = []; for (let r = 0, n = i.length; r !== n; ++r) { const o = i[r]; o.id in e && t.push(o); } return t; }; function Lg(i, e, t) { const r = i.createShader(e); return i.shaderSource(r, t), i.compileShader(r), r; } let oN = 0; function aN(i) { const e = i.split(` `); for (let t = 0; t < e.length; t++) e[t] = t + 1 + ": " + e[t]; return e.join(` `); } function Ox(i) { switch (i) { case Ri: return ["Linear", "( value )"]; case Do: return ["sRGB", "( value )"]; case Cu: return ["RGBE", "( value )"]; case jp: return ["RGBM", "( value, 7.0 )"]; case Wp: return ["RGBM", "( value, 16.0 )"]; case $p: return ["RGBD", "( value, 256.0 )"]; case Au: return ["Gamma", "( value, float( GAMMA_FACTOR ) )"]; case sx: return ["LogLuv", "( value )"]; default: return console.warn("THREE.WebGLProgram: Unsupported encoding:", i), ["Linear", "( value )"]; } } function Rg(i, e, t) { const r = i.getShaderParameter(e, 35713), n = i.getShaderInfoLog(e).trim(); if (r && n === "") return ""; const o = i.getShaderSource(e); return "THREE.WebGLShader: gl.getShaderInfoLog() " + t + ` ` + n + aN(o); } function Ms(i, e) { const t = Ox(e); return "vec4 " + i + "( vec4 value ) { return " + t[0] + "ToLinear" + t[1] + "; }"; } function sN(i, e) { const t = Ox(e); return "vec4 " + i + "( vec4 value ) { return LinearTo" + t[0] + t[1] + "; }"; } function lN(i, e) { let t; switch (e) { case ob: t = "Linear"; break; case ab: t = "Reinhard"; break; case sb: t = "OptimizedCineon"; break; case lb: t = "ACESFilmic"; break; case cb: t = "Custom"; break; default: console.warn("THREE.WebGLProgram: Unsupported toneMapping:", e), t = "Linear"; } return "vec3 " + i + "( vec3 color ) { return " + t + "ToneMapping( color ); }"; } function cN(i) { return [ i.extensionDerivatives || i.envMapCubeUV || i.bumpMap || i.tangentSpaceNormalMap || i.clearcoatNormalMap || i.flatShading || i.shaderID === "physical" ? "#extension GL_OES_standard_derivatives : enable" : "", (i.extensionFragDepth || i.logarithmicDepthBuffer) && i.rendererExtensionFragDepth ? "#extension GL_EXT_frag_depth : enable" : "", i.extensionDrawBuffers && i.rendererExtensionDrawBuffers ? "#extension GL_EXT_draw_buffers : require" : "", (i.extensionShaderTextureLOD || i.envMap || i.transmission > 0) && i.rendererExtensionShaderTextureLod ? "#extension GL_EXT_shader_texture_lod : enable" : "" ].filter(Ds).join(` `); } function uN(i) { const e = []; for (const t in i) { const r = i[t]; r !== !1 && e.push("#define " + t + " " + r); } return e.join(` `); } function hN(i, e) { const t = {}, r = i.getProgramParameter(e, 35721); for (let n = 0; n < r; n++) { const o = i.getActiveAttrib(e, n).name; t[o] = i.getAttribLocation(e, o); } return t; } function Ds(i) { return i !== ""; } function Og(i, e) { return i.replace(/NUM_DIR_LIGHTS/g, e.numDirLights).replace(/NUM_SPOT_LIGHTS/g, e.numSpotLights).replace(/NUM_RECT_AREA_LIGHTS/g, e.numRectAreaLights).replace(/NUM_POINT_LIGHTS/g, e.numPointLights).replace(/NUM_HEMI_LIGHTS/g, e.numHemiLights).replace(/NUM_DIR_LIGHT_SHADOWS/g, e.numDirLightShadows).replace(/NUM_SPOT_LIGHT_SHADOWS/g, e.numSpotLightShadows).replace(/NUM_POINT_LIGHT_SHADOWS/g, e.numPointLightShadows); } function Pg(i, e) { return i.replace(/NUM_CLIPPING_PLANES/g, e.numClippingPlanes).replace(/UNION_CLIPPING_PLANES/g, e.numClippingPlanes - e.numClipIntersection); } const dN = /^[ \t]*#include +<([\w\d./]+)>/gm; function Bd(i) { return i.replace(dN, pN); } function pN(i, e) { const t = lt[e]; if (t === void 0) throw new Error("Can not resolve #include <" + e + ">"); return Bd(t); } const fN = /#pragma unroll_loop[\s]+?for \( int i \= (\d+)\; i < (\d+)\; i \+\+ \) \{([\s\S]+?)(?=\})\}/g, mN = /#pragma unroll_loop_start\s+for\s*\(\s*int\s+i\s*=\s*(\d+)\s*;\s*i\s*<\s*(\d+)\s*;\s*i\s*\+\+\s*\)\s*{([\s\S]+?)}\s+#pragma unroll_loop_end/g; function Ig(i) { return i.replace(mN, Px).replace(fN, gN); } function gN(i, e, t, r) { return console.warn("WebGLProgram: #pragma unroll_loop shader syntax is deprecated. Please use #pragma unroll_loop_start syntax instead."), Px(i, e, t, r); } function Px(i, e, t, r) { let n = ""; for (let o = parseInt(e); o < parseInt(t); o++) n += r.replace(/\[\s*i\s*\]/g, "[ " + o + " ]").replace(/UNROLLED_LOOP_INDEX/g, o); return n; } function Dg(i) { let e = "precision " + i.precision + ` float; precision ` + i.precision + " int;"; return i.precision === "highp" ? e += ` #define HIGH_PRECISION` : i.precision === "mediump" ? e += ` #define MEDIUM_PRECISION` : i.precision === "lowp" && (e += ` #define LOW_PRECISION`), e; } function vN(i) { let e = "SHADOWMAP_TYPE_BASIC"; return i.shadowMapType === zp ? e = "SHADOWMAP_TYPE_PCF" : i.shadowMapType === ky ? e = "SHADOWMAP_TYPE_PCF_SOFT" : i.shadowMapType === wa && (e = "SHADOWMAP_TYPE_VSM"), e; } function yN(i) { let e = "ENVMAP_TYPE_CUBE"; if (i.envMap) switch (i.envMapMode) { case yl: case bl: e = "ENVMAP_TYPE_CUBE"; break; case ls: case xl: e = "ENVMAP_TYPE_CUBE_UV"; break; } return e; } function bN(i) { let e = "ENVMAP_MODE_REFLECTION"; if (i.envMap) switch (i.envMapMode) { case bl: case xl: e = "ENVMAP_MODE_REFRACTION"; break; } return e; } function xN(i) { let e = "ENVMAP_BLENDING_NONE"; if (i.envMap) switch (i.combine) { case vl: e = "ENVMAP_BLENDING_MULTIPLY"; break; case rb: e = "ENVMAP_BLENDING_MIX"; break; case nb: e = "ENVMAP_BLENDING_ADD"; break; } return e; } function wN(i, e, t, r) { const n = i.getContext(), o = t.defines; let a = t.vertexShader, s = t.fragmentShader; const c = vN(t), l = yN(t), h = bN(t), u = xN(t), p = i.gammaFactor > 0 ? i.gammaFactor : 1, g = t.isWebGL2 ? "" : cN(t), m = uN(o), d = n.createProgram(); let y, f, v = t.glslVersion ? "#version " + t.glslVersion + ` ` : ""; t.isRawShaderMaterial ? (y = [ m ].filter(Ds).join(` `), y.length > 0 && (y += ` `), f = [ g, m ].filter(Ds).join(` `), f.length > 0 && (f += ` `)) : (y = [ Dg(t), "#define SHADER_NAME " + t.shaderName, m, t.instancing ? "#define USE_INSTANCING" : "", t.instancingColor ? "#define USE_INSTANCING_COLOR" : "", t.supportsVertexTextures ? "#define VERTEX_TEXTURES" : "", "#define GAMMA_FACTOR " + p, "#define MAX_BONES " + t.maxBones, t.useFog && t.fog ? "#define USE_FOG" : "", t.useFog && t.fogExp2 ? "#define FOG_EXP2" : "", t.map ? "#define USE_MAP" : "", t.envMap ? "#define USE_ENVMAP" : "", t.envMap ? "#define " + h : "", t.lightMap ? "#define USE_LIGHTMAP" : "", t.aoMap ? "#define USE_AOMAP" : "", t.emissiveMap ? "#define USE_EMISSIVEMAP" : "", t.bumpMap ? "#define USE_BUMPMAP" : "", t.normalMap ? "#define USE_NORMALMAP" : "", t.normalMap && t.objectSpaceNormalMap ? "#define OBJECTSPACE_NORMALMAP" : "", t.normalMap && t.tangentSpaceNormalMap ? "#define TANGENTSPACE_NORMALMAP" : "", t.clearcoatMap ? "#define USE_CLEARCOATMAP" : "", t.clearcoatRoughnessMap ? "#define USE_CLEARCOAT_ROUGHNESSMAP" : "", t.clearcoatNormalMap ? "#define USE_CLEARCOAT_NORMALMAP" : "", t.displacementMap && t.supportsVertexTextures ? "#define USE_DISPLACEMENTMAP" : "", t.specularMap ? "#define USE_SPECULARMAP" : "", t.roughnessMap ? "#define USE_ROUGHNESSMAP" : "", t.metalnessMap ? "#define USE_METALNESSMAP" : "", t.alphaMap ? "#define USE_ALPHAMAP" : "", t.transmission ? "#define USE_TRANSMISSION" : "", t.transmissionMap ? "#define USE_TRANSMISSIONMAP" : "", t.thicknessMap ? "#define USE_THICKNESSMAP" : "", t.vertexTangents ? "#define USE_TANGENT" : "", t.vertexColors ? "#define USE_COLOR" : "", t.vertexAlphas ? "#define USE_COLOR_ALPHA" : "", t.vertexUvs ? "#define USE_UV" : "", t.uvsVertexOnly ? "#define UVS_VERTEX_ONLY" : "", t.flatShading ? "#define FLAT_SHADED" : "", t.skinning ? "#define USE_SKINNING" : "", t.useVertexTexture ? "#define BONE_TEXTURE" : "", t.morphTargets ? "#define USE_MORPHTARGETS" : "", t.morphNormals && t.flatShading === !1 ? "#define USE_MORPHNORMALS" : "", t.doubleSided ? "#define DOUBLE_SIDED" : "", t.flipSided ? "#define FLIP_SIDED" : "", t.shadowMapEnabled ? "#define USE_SHADOWMAP" : "", t.shadowMapEnabled ? "#define " + c : "", t.sizeAttenuation ? "#define USE_SIZEATTENUATION" : "", t.logarithmicDepthBuffer ? "#define USE_LOGDEPTHBUF" : "", t.logarithmicDepthBuffer && t.rendererExtensionFragDepth ? "#define USE_LOGDEPTHBUF_EXT" : "", "uniform mat4 modelMatrix;", "uniform mat4 modelViewMatrix;", "uniform mat4 projectionMatrix;", "uniform mat4 viewMatrix;", "uniform mat3 normalMatrix;", "uniform vec3 cameraPosition;", "uniform bool isOrthographic;", "#ifdef USE_INSTANCING", " attribute mat4 instanceMatrix;", "#endif", "#ifdef USE_INSTANCING_COLOR", " attribute vec3 instanceColor;", "#endif", "attribute vec3 position;", "attribute vec3 normal;", "attribute vec2 uv;", "#ifdef USE_TANGENT", " attribute vec4 tangent;", "#endif", "#if defined( USE_COLOR_ALPHA )", " attribute vec4 color;", "#elif defined( USE_COLOR )", " attribute vec3 color;", "#endif", "#ifdef USE_MORPHTARGETS", " attribute vec3 morphTarget0;", " attribute vec3 morphTarget1;", " attribute vec3 morphTarget2;", " attribute vec3 morphTarget3;", " #ifdef USE_MORPHNORMALS", " attribute vec3 morphNormal0;", " attribute vec3 morphNormal1;", " attribute vec3 morphNormal2;", " attribute vec3 morphNormal3;", " #else", " attribute vec3 morphTarget4;", " attribute vec3 morphTarget5;", " attribute vec3 morphTarget6;", " attribute vec3 morphTarget7;", " #endif", "#endif", "#ifdef USE_SKINNING", " attribute vec4 skinIndex;", " attribute vec4 skinWeight;", "#endif", ` ` ].filter(Ds).join(` `), f = [ g, Dg(t), "#define SHADER_NAME " + t.shaderName, m, t.alphaTest ? "#define ALPHATEST " + t.alphaTest + (t.alphaTest % 1 ? "" : ".0") : "", // add '.0' if integer "#define GAMMA_FACTOR " + p, t.useFog && t.fog ? "#define USE_FOG" : "", t.useFog && t.fogExp2 ? "#define FOG_EXP2" : "", t.map ? "#define USE_MAP" : "", t.matcap ? "#define USE_MATCAP" : "", t.envMap ? "#define USE_ENVMAP" : "", t.envMap ? "#define " + l : "", t.envMap ? "#define " + h : "", t.envMap ? "#define " + u : "", t.lightMap ? "#define USE_LIGHTMAP" : "", t.aoMap ? "#define USE_AOMAP" : "", t.emissiveMap ? "#define USE_EMISSIVEMAP" : "", t.bumpMap ? "#define USE_BUMPMAP" : "", t.normalMap ? "#define USE_NORMALMAP" : "", t.normalMap && t.objectSpaceNormalMap ? "#define OBJECTSPACE_NORMALMAP" : "", t.normalMap && t.tangentSpaceNormalMap ? "#define TANGENTSPACE_NORMALMAP" : "", t.clearcoatMap ? "#define USE_CLEARCOATMAP" : "", t.clearcoatRoughnessMap ? "#define USE_CLEARCOAT_ROUGHNESSMAP" : "", t.clearcoatNormalMap ? "#define USE_CLEARCOAT_NORMALMAP" : "", t.specularMap ? "#define USE_SPECULARMAP" : "", t.roughnessMap ? "#define USE_ROUGHNESSMAP" : "", t.metalnessMap ? "#define USE_METALNESSMAP" : "", t.alphaMap ? "#define USE_ALPHAMAP" : "", t.sheen ? "#define USE_SHEEN" : "", t.transmission ? "#define USE_TRANSMISSION" : "", t.transmissionMap ? "#define USE_TRANSMISSIONMAP" : "", t.thicknessMap ? "#define USE_THICKNESSMAP" : "", t.vertexTangents ? "#define USE_TANGENT" : "", t.vertexColors || t.instancingColor ? "#define USE_COLOR" : "", t.vertexAlphas ? "#define USE_COLOR_ALPHA" : "", t.vertexUvs ? "#define USE_UV" : "", t.uvsVertexOnly ? "#define UVS_VERTEX_ONLY" : "", t.gradientMap ? "#define USE_GRADIENTMAP" : "", t.flatShading ? "#define FLAT_SHADED" : "", t.doubleSided ? "#define DOUBLE_SIDED" : "", t.flipSided ? "#define FLIP_SIDED" : "", t.shadowMapEnabled ? "#define USE_SHADOWMAP" : "", t.shadowMapEnabled ? "#define " + c : "", t.premultipliedAlpha ? "#define PREMULTIPLIED_ALPHA" : "", t.physicallyCorrectLights ? "#define PHYSICALLY_CORRECT_LIGHTS" : "", t.logarithmicDepthBuffer ? "#define USE_LOGDEPTHBUF" : "", t.logarithmicDepthBuffer && t.rendererExtensionFragDepth ? "#define USE_LOGDEPTHBUF_EXT" : "", (t.extensionShaderTextureLOD || t.envMap) && t.rendererExtensionShaderTextureLod ? "#define TEXTURE_LOD_EXT" : "", "uniform mat4 viewMatrix;", "uniform vec3 cameraPosition;", "uniform bool isOrthographic;", t.toneMapping !== Fn ? "#define TONE_MAPPING" : "", t.toneMapping !== Fn ? lt.tonemapping_pars_fragment : "", // this code is required here because it is used by the toneMapping() function defined below t.toneMapping !== Fn ? lN("toneMapping", t.toneMapping) : "", t.dithering ? "#define DITHERING" : "", lt.encodings_pars_fragment, // this code is required here because it is used by the various encoding/decoding function defined below t.map ? Ms("mapTexelToLinear", t.mapEncoding) : "", t.matcap ? Ms("matcapTexelToLinear", t.matcapEncoding) : "", t.envMap ? Ms("envMapTexelToLinear", t.envMapEncoding) : "", t.emissiveMap ? Ms("emissiveMapTexelToLinear", t.emissiveMapEncoding) : "", t.lightMap ? Ms("lightMapTexelToLinear", t.lightMapEncoding) : "", sN("linearToOutputTexel", t.outputEncoding), t.depthPacking ? "#define DEPTH_PACKING " + t.depthPacking : "", ` ` ].filter(Ds).join(` `)), a = Bd(a), a = Og(a, t), a = Pg(a, t), s = Bd(s), s = Og(s, t), s = Pg(s, t), a = Ig(a), s = Ig(s), t.isWebGL2 && t.isRawShaderMaterial !== !0 && (v = `#version 300 es `, y = [ "#define attribute in", "#define varying out", "#define texture2D texture" ].join(` `) + ` ` + y, f = [ "#define varying in", t.glslVersion === Id ? "" : "out highp vec4 pc_fragColor;", t.glslVersion === Id ? "" : "#define gl_FragColor pc_fragColor", "#define gl_FragDepthEXT gl_FragDepth", "#define texture2D texture", "#define textureCube texture", "#define texture2DProj textureProj", "#define texture2DLodEXT textureLod", "#define texture2DProjLodEXT textureProjLod", "#define textureCubeLodEXT textureLod", "#define texture2DGradEXT textureGrad", "#define texture2DProjGradEXT textureProjGrad", "#define textureCubeGradEXT textureGrad" ].join(` `) + ` ` + f); const M = v + y + a, S = v + f + s, T = Lg(n, 35633, M), x = Lg(n, 35632, S); if (n.attachShader(d, T), n.attachShader(d, x), t.index0AttributeName !== void 0 ? n.bindAttribLocation(d, 0, t.index0AttributeName) : t.morphTargets === !0 && n.bindAttribLocation(d, 0, "position"), n.linkProgram(d), i.debug.checkShaderErrors) { const _ = n.getProgramInfoLog(d).trim(), E = n.getShaderInfoLog(T).trim(), O = n.getShaderInfoLog(x).trim(); let L = !0, C = !0; if (n.getProgramParameter(d, 35714) === !1) { L = !1; const I = Rg(n, T, "vertex"), R = Rg(n, x, "fragment"); console.error("THREE.WebGLProgram: shader error: ", n.getError(), "35715", n.getProgramParameter(d, 35715), "gl.getProgramInfoLog", _, I, R); } else _ !== "" ? console.warn("THREE.WebGLProgram: gl.getProgramInfoLog()", _) : (E === "" || O === "") && (C = !1); C && (this.diagnostics = { runnable: L, programLog: _, vertexShader: { log: E, prefix: y }, fragmentShader: { log: O, prefix: f } }); } n.deleteShader(T), n.deleteShader(x); let w; this.getUniforms = function() { return w === void 0 && (w = new Vn(n, d)), w; }; let A; return this.getAttributes = function() { return A === void 0 && (A = hN(n, d)), A; }, this.destroy = function() { r.releaseStatesOfProgram(this), n.deleteProgram(d), this.program = void 0; }, this.name = t.shaderName, this.id = oN++, this.cacheKey = e, this.usedTimes = 1, this.program = d, this.vertexShader = T, this.fragmentShader = x, this; } function _N(i, e, t, r, n, o) { const a = [], s = r.isWebGL2, c = r.logarithmicDepthBuffer, l = r.floatVertexTextures, h = r.maxVertexUniforms, u = r.vertexTextures; let p = r.precision; const g = { MeshDepthMaterial: "depth", MeshDistanceMaterial: "distanceRGBA", MeshNormalMaterial: "normal", MeshBasicMaterial: "basic", MeshLambertMaterial: "lambert", MeshPhongMaterial: "phong", MeshToonMaterial: "toon", MeshStandardMaterial: "physical", MeshPhysicalMaterial: "physical", MeshMatcapMaterial: "matcap", LineBasicMaterial: "basic", LineDashedMaterial: "dashed", PointsMaterial: "points", ShadowMaterial: "shadow", SpriteMaterial: "sprite" }, m = [ "precision", "isWebGL2", "supportsVertexTextures", "outputEncoding", "instancing", "instancingColor", "map", "mapEncoding", "matcap", "matcapEncoding", "envMap", "envMapMode", "envMapEncoding", "envMapCubeUV", "lightMap", "lightMapEncoding", "aoMap", "emissiveMap", "emissiveMapEncoding", "bumpMap", "normalMap", "objectSpaceNormalMap", "tangentSpaceNormalMap", "clearcoatMap", "clearcoatRoughnessMap", "clearcoatNormalMap", "displacementMap", "specularMap", "roughnessMap", "metalnessMap", "gradientMap", "alphaMap", "combine", "vertexColors", "vertexAlphas", "vertexTangents", "vertexUvs", "uvsVertexOnly", "fog", "useFog", "fogExp2", "flatShading", "sizeAttenuation", "logarithmicDepthBuffer", "skinning", "maxBones", "useVertexTexture", "morphTargets", "morphNormals", "premultipliedAlpha", "numDirLights", "numPointLights", "numSpotLights", "numHemiLights", "numRectAreaLights", "numDirLightShadows", "numPointLightShadows", "numSpotLightShadows", "shadowMapEnabled", "shadowMapType", "toneMapping", "physicallyCorrectLights", "alphaTest", "doubleSided", "flipSided", "numClippingPlanes", "numClipIntersection", "depthPacking", "dithering", "sheen", "transmission", "transmissionMap", "thicknessMap" ]; function d(x) { const w = x.skeleton.bones; if (l) return 1024; { const A = Math.floor((h - 20) / 4), _ = Math.min(A, w.length); return _ < w.length ? (console.warn("THREE.WebGLRenderer: Skeleton has " + w.length + " bones. This GPU supports " + _ + "."), 0) : _; } } function y(x) { let w; return x && x.isTexture ? w = x.encoding : x && x.isWebGLRenderTarget ? (console.warn("THREE.WebGLPrograms.getTextureEncodingFromMap: don't use render targets as textures. Use their .texture property instead."), w = x.texture.encoding) : w = Ri, w; } function f(x, w, A, _, E) { const O = _.fog, L = x.isMeshStandardMaterial ? _.environment : null, C = e.get(x.envMap || L), I = g[x.type], R = E.isSkinnedMesh ? d(E) : 0; x.precision !== null && (p = r.getMaxPrecision(x.precision), p !== x.precision && console.warn("THREE.WebGLProgram.getParameters:", x.precision, "not supported, using", p, "instead.")); let b, P; if (I) { const D = fr[I]; b = D.vertexShader, P = D.fragmentShader; } else b = x.vertexShader, P = x.fragmentShader; const N = i.getRenderTarget(); return { isWebGL2: s, shaderID: I, shaderName: x.type, vertexShader: b, fragmentShader: P, defines: x.defines, isRawShaderMaterial: x.isRawShaderMaterial === !0, glslVersion: x.glslVersion, precision: p, instancing: E.isInstancedMesh === !0, instancingColor: E.isInstancedMesh === !0 && E.instanceColor !== null, supportsVertexTextures: u, outputEncoding: N !== null ? y(N.texture) : i.outputEncoding, map: !!x.map, mapEncoding: y(x.map), matcap: !!x.matcap, matcapEncoding: y(x.matcap), envMap: !!C, envMapMode: C && C.mapping, envMapEncoding: y(C), envMapCubeUV: !!C && (C.mapping === ls || C.mapping === xl), lightMap: !!x.lightMap, lightMapEncoding: y(x.lightMap), aoMap: !!x.aoMap, emissiveMap: !!x.emissiveMap, emissiveMapEncoding: y(x.emissiveMap), bumpMap: !!x.bumpMap, normalMap: !!x.normalMap, objectSpaceNormalMap: x.normalMapType === ux, tangentSpaceNormalMap: x.normalMapType === eo, clearcoatMap: !!x.clearcoatMap, clearcoatRoughnessMap: !!x.clearcoatRoughnessMap, clearcoatNormalMap: !!x.clearcoatNormalMap, displacementMap: !!x.displacementMap, roughnessMap: !!x.roughnessMap, metalnessMap: !!x.metalnessMap, specularMap: !!x.specularMap, alphaMap: !!x.alphaMap, gradientMap: !!x.gradientMap, sheen: !!x.sheen, transmission: !!x.transmission, transmissionMap: !!x.transmissionMap, thicknessMap: !!x.thicknessMap, combine: x.combine, vertexTangents: x.normalMap && x.vertexTangents, vertexColors: x.vertexColors, vertexAlphas: x.vertexColors === !0 && E.geometry && E.geometry.attributes.color && E.geometry.attributes.color.itemSize === 4, vertexUvs: !!x.map || !!x.bumpMap || !!x.normalMap || !!x.specularMap || !!x.alphaMap || !!x.emissiveMap || !!x.roughnessMap || !!x.metalnessMap || !!x.clearcoatMap || !!x.clearcoatRoughnessMap || !!x.clearcoatNormalMap || !!x.displacementMap || !!x.transmissionMap || !!x.thicknessMap, uvsVertexOnly: !(x.map || x.bumpMap || x.normalMap || x.specularMap || x.alphaMap || x.emissiveMap || x.roughnessMap || x.metalnessMap || x.clearcoatNormalMap || x.transmission || x.transmissionMap || x.thicknessMap) && !!x.displacementMap, fog: !!O, useFog: x.fog, fogExp2: O && O.isFogExp2, flatShading: !!x.flatShading, sizeAttenuation: x.sizeAttenuation, logarithmicDepthBuffer: c, skinning: E.isSkinnedMesh === !0 && R > 0, maxBones: R, useVertexTexture: l, morphTargets: x.morphTargets, morphNormals: x.morphNormals, numDirLights: w.directional.length, numPointLights: w.point.length, numSpotLights: w.spot.length, numRectAreaLights: w.rectArea.length, numHemiLights: w.hemi.length, numDirLightShadows: w.directionalShadowMap.length, numPointLightShadows: w.pointShadowMap.length, numSpotLightShadows: w.spotShadowMap.length, numClippingPlanes: o.numPlanes, numClipIntersection: o.numIntersection, dithering: x.dithering, shadowMapEnabled: i.shadowMap.enabled && A.length > 0, shadowMapType: i.shadowMap.type, toneMapping: x.toneMapped ? i.toneMapping : Fn, physicallyCorrectLights: i.physicallyCorrectLights, premultipliedAlpha: x.premultipliedAlpha, alphaTest: x.alphaTest, doubleSided: x.side === Xn, flipSided: x.side === $t, depthPacking: x.depthPacking !== void 0 ? x.depthPacking : !1, index0AttributeName: x.index0AttributeName, extensionDerivatives: x.extensions && x.extensions.derivatives, extensionFragDepth: x.extensions && x.extensions.fragDepth, extensionDrawBuffers: x.extensions && x.extensions.drawBuffers, extensionShaderTextureLOD: x.extensions && x.extensions.shaderTextureLOD, rendererExtensionFragDepth: s || t.has("EXT_frag_depth"), rendererExtensionDrawBuffers: s || t.has("WEBGL_draw_buffers"), rendererExtensionShaderTextureLod: s || t.has("EXT_shader_texture_lod"), customProgramCacheKey: x.customProgramCacheKey() }; } function v(x) { const w = []; if (x.shaderID ? w.push(x.shaderID) : (w.push(x.fragmentShader), w.push(x.vertexShader)), x.defines !== void 0) for (const A in x.defines) w.push(A), w.push(x.defines[A]); if (x.isRawShaderMaterial === !1) { for (let A = 0; A < m.length; A++) w.push(x[m[A]]); w.push(i.outputEncoding), w.push(i.gammaFactor); } return w.push(x.customProgramCacheKey), w.join(); } function M(x) { const w = g[x.type]; let A; if (w) { const _ = fr[w]; A = Sx.clone(_.uniforms); } else A = x.uniforms; return A; } function S(x, w) { let A; for (let _ = 0, E = a.length; _ < E; _++) { const O = a[_]; if (O.cacheKey === w) { A = O, ++A.usedTimes; break; } } return A === void 0 && (A = new wN(i, w, x, n), a.push(A)), A; } function T(x) { if (--x.usedTimes === 0) { const w = a.indexOf(x); a[w] = a[a.length - 1], a.pop(), x.destroy(); } } return { getParameters: f, getProgramCacheKey: v, getUniforms: M, acquireProgram: S, releaseProgram: T, // Exposed for resource monitoring & error feedback via renderer.info: programs: a }; } function MN() { let i = /* @__PURE__ */ new WeakMap(); function e(o) { let a = i.get(o); return a === void 0 && (a = {}, i.set(o, a)), a; } function t(o) { i.delete(o); } function r(o, a, s) { i.get(o)[a] = s; } function n() { i = /* @__PURE__ */ new WeakMap(); } return { get: e, remove: t, update: r, dispose: n }; } function SN(i, e) { return i.groupOrder !== e.groupOrder ? i.groupOrder - e.groupOrder : i.renderOrder !== e.renderOrder ? i.renderOrder - e.renderOrder : i.program !== e.program ? i.program.id - e.program.id : i.material.id !== e.material.id ? i.material.id - e.material.id : i.z !== e.z ? i.z - e.z : i.id - e.id; } function Ng(i, e) { return i.groupOrder !== e.groupOrder ? i.groupOrder - e.groupOrder : i.renderOrder !== e.renderOrder ? i.renderOrder - e.renderOrder : i.z !== e.z ? e.z - i.z : i.id - e.id; } function Bg(i) { const e = []; let t = 0; const r = [], n = [], o = [], a = { id: -1 }; function s() { t = 0, r.length = 0, n.length = 0, o.length = 0; } function c(g, m, d, y, f, v) { let M = e[t]; const S = i.get(d); return M === void 0 ? (M = { id: g.id, object: g, geometry: m, material: d, program: S.program || a, groupOrder: y, renderOrder: g.renderOrder, z: f, group: v }, e[t] = M) : (M.id = g.id, M.object = g, M.geometry = m, M.material = d, M.program = S.program || a, M.groupOrder = y, M.renderOrder = g.renderOrder, M.z = f, M.group = v), t++, M; } function l(g, m, d, y, f, v) { const M = c(g, m, d, y, f, v); d.transmission > 0 ? n.push(M) : d.transparent === !0 ? o.push(M) : r.push(M); } function h(g, m, d, y, f, v) { const M = c(g, m, d, y, f, v); d.transmission > 0 ? n.unshift(M) : d.transparent === !0 ? o.unshift(M) : r.unshift(M); } function u(g, m) { r.length > 1 && r.sort(g || SN), n.length > 1 && n.sort(m || Ng), o.length > 1 && o.sort(m || Ng); } function p() { for (let g = t, m = e.length; g < m; g++) { const d = e[g]; if (d.id === null) break; d.id = null, d.object = null, d.geometry = null, d.material = null, d.program = null, d.group = null; } } return { opaque: r, transmissive: n, transparent: o, init: s, push: l, unshift: h, finish: p, sort: u }; } function TN(i) { let e = /* @__PURE__ */ new WeakMap(); function t(n, o) { let a; return e.has(n) === !1 ? (a = new Bg(i), e.set(n, [a])) : o >= e.get(n).length ? (a = new Bg(i), e.get(n).push(a)) : a = e.get(n)[o], a; } function r() { e = /* @__PURE__ */ new WeakMap(); } return { get: t, dispose: r }; } function EN() { const i = {}; return { get: function(e) { if (i[e.id] !== void 0) return i[e.id]; let t; switch (e.type) { case "DirectionalLight": t = { direction: new Z(), color: new Be() }; break; case "SpotLight": t = { position: new Z(), direction: new Z(), color: new Be(), distance: 0, coneCos: 0, penumbraCos: 0, decay: 0 }; break; case "PointLight": t = { position: new Z(), color: new Be(), distance: 0, decay: 0 }; break; case "HemisphereLight": t = { direction: new Z(), skyColor: new Be(), groundColor: new Be() }; break; case "RectAreaLight": t = { color: new Be(), position: new Z(), halfWidth: new Z(), halfHeight: new Z() }; break; } return i[e.id] = t, t; } }; } function AN() { const i = {}; return { get: function(e) { if (i[e.id] !== void 0) return i[e.id]; let t; switch (e.type) { case "DirectionalLight": t = { shadowBias: 0, shadowNormalBias: 0, shadowRadius: 1, shadowMapSize: new Oe() }; break; case "SpotLight": t = { shadowBias: 0, shadowNormalBias: 0, shadowRadius: 1, shadowMapSize: new Oe() }; break; case "PointLight": t = { shadowBias: 0, shadowNormalBias: 0, shadowRadius: 1, shadowMapSize: new Oe(), shadowCameraNear: 1, shadowCameraFar: 1e3 }; break; } return i[e.id] = t, t; } }; } let CN = 0; function LN(i, e) { return (e.castShadow ? 1 : 0) - (i.castShadow ? 1 : 0); } function RN(i, e) { const t = new EN(), r = AN(), n = { version: 0, hash: { directionalLength: -1, pointLength: -1, spotLength: -1, rectAreaLength: -1, hemiLength: -1, numDirectionalShadows: -1, numPointShadows: -1, numSpotShadows: -1 }, ambient: [0, 0, 0], probe: [], directional: [], directionalShadow: [], directionalShadowMap: [], directionalShadowMatrix: [], spot: [], spotShadow: [], spotShadowMap: [], spotShadowMatrix: [], rectArea: [], rectAreaLTC1: null, rectAreaLTC2: null, point: [], pointShadow: [], pointShadowMap: [], pointShadowMatrix: [], hemi: [] }; for (let h = 0; h < 9; h++) n.probe.push(new Z()); const o = new Z(), a = new $e(), s = new $e(); function c(h) { let u = 0, p = 0, g = 0; for (let w = 0; w < 9; w++) n.probe[w].set(0, 0, 0); let m = 0, d = 0, y = 0, f = 0, v = 0, M = 0, S = 0, T = 0; h.sort(LN); for (let w = 0, A = h.length; w < A; w++) { const _ = h[w], E = _.color, O = _.intensity, L = _.distance, C = _.shadow && _.shadow.map ? _.shadow.map.texture : null; if (_.isAmbientLight) u += E.r * O, p += E.g * O, g += E.b * O; else if (_.isLightProbe) for (let I = 0; I < 9; I++) n.probe[I].addScaledVector(_.sh.coefficients[I], O); else if (_.isDirectionalLight) { const I = t.get(_); if (I.color.copy(_.color).multiplyScalar(_.intensity), _.castShadow) { const R = _.shadow, b = r.get(_); b.shadowBias = R.bias, b.shadowNormalBias = R.normalBias, b.shadowRadius = R.radius, b.shadowMapSize = R.mapSize, n.directionalShadow[m] = b, n.directionalShadowMap[m] = C, n.directionalShadowMatrix[m] = _.shadow.matrix, M++; } n.directional[m] = I, m++; } else if (_.isSpotLight) { const I = t.get(_); if (I.position.setFromMatrixPosition(_.matrixWorld), I.color.copy(E).multiplyScalar(O), I.distance = L, I.coneCos = Math.cos(_.angle), I.penumbraCos = Math.cos(_.angle * (1 - _.penumbra)), I.decay = _.decay, _.castShadow) { const R = _.shadow, b = r.get(_); b.shadowBias = R.bias, b.shadowNormalBias = R.normalBias, b.shadowRadius = R.radius, b.shadowMapSize = R.mapSize, n.spotShadow[y] = b, n.spotShadowMap[y] = C, n.spotShadowMatrix[y] = _.shadow.matrix, T++; } n.spot[y] = I, y++; } else if (_.isRectAreaLight) { const I = t.get(_); I.color.copy(E).multiplyScalar(O), I.halfWidth.set(_.width * 0.5, 0, 0), I.halfHeight.set(0, _.height * 0.5, 0), n.rectArea[f] = I, f++; } else if (_.isPointLight) { const I = t.get(_); if (I.color.copy(_.color).multiplyScalar(_.intensity), I.distance = _.distance, I.decay = _.decay, _.castShadow) { const R = _.shadow, b = r.get(_); b.shadowBias = R.bias, b.shadowNormalBias = R.normalBias, b.shadowRadius = R.radius, b.shadowMapSize = R.mapSize, b.shadowCameraNear = R.camera.near, b.shadowCameraFar = R.camera.far, n.pointShadow[d] = b, n.pointShadowMap[d] = C, n.pointShadowMatrix[d] = _.shadow.matrix, S++; } n.point[d] = I, d++; } else if (_.isHemisphereLight) { const I = t.get(_); I.skyColor.copy(_.color).multiplyScalar(O), I.groundColor.copy(_.groundColor).multiplyScalar(O), n.hemi[v] = I, v++; } } f > 0 && (e.isWebGL2 || i.has("OES_texture_float_linear") === !0 ? (n.rectAreaLTC1 = Fe.LTC_FLOAT_1, n.rectAreaLTC2 = Fe.LTC_FLOAT_2) : i.has("OES_texture_half_float_linear") === !0 ? (n.rectAreaLTC1 = Fe.LTC_HALF_1, n.rectAreaLTC2 = Fe.LTC_HALF_2) : console.error("THREE.WebGLRenderer: Unable to use RectAreaLight. Missing WebGL extensions.")), n.ambient[0] = u, n.ambient[1] = p, n.ambient[2] = g; const x = n.hash; (x.directionalLength !== m || x.pointLength !== d || x.spotLength !== y || x.rectAreaLength !== f || x.hemiLength !== v || x.numDirectionalShadows !== M || x.numPointShadows !== S || x.numSpotShadows !== T) && (n.directional.length = m, n.spot.length = y, n.rectArea.length = f, n.point.length = d, n.hemi.length = v, n.directionalShadow.length = M, n.directionalShadowMap.length = M, n.pointShadow.length = S, n.pointShadowMap.length = S, n.spotShadow.length = T, n.spotShadowMap.length = T, n.directionalShadowMatrix.length = M, n.pointShadowMatrix.length = S, n.spotShadowMatrix.length = T, x.directionalLength = m, x.pointLength = d, x.spotLength = y, x.rectAreaLength = f, x.hemiLength = v, x.numDirectionalShadows = M, x.numPointShadows = S, x.numSpotShadows = T, n.version = CN++); } function l(h, u) { let p = 0, g = 0, m = 0, d = 0, y = 0; const f = u.matrixWorldInverse; for (let v = 0, M = h.length; v < M; v++) { const S = h[v]; if (S.isDirectionalLight) { const T = n.directional[p]; T.direction.setFromMatrixPosition(S.matrixWorld), o.setFromMatrixPosition(S.target.matrixWorld), T.direction.sub(o), T.direction.transformDirection(f), p++; } else if (S.isSpotLight) { const T = n.spot[m]; T.position.setFromMatrixPosition(S.matrixWorld), T.position.applyMatrix4(f), T.direction.setFromMatrixPosition(S.matrixWorld), o.setFromMatrixPosition(S.target.matrixWorld), T.direction.sub(o), T.direction.transformDirection(f), m++; } else if (S.isRectAreaLight) { const T = n.rectArea[d]; T.position.setFromMatrixPosition(S.matrixWorld), T.position.applyMatrix4(f), s.identity(), a.copy(S.matrixWorld), a.premultiply(f), s.extractRotation(a), T.halfWidth.set(S.width * 0.5, 0, 0), T.halfHeight.set(0, S.height * 0.5, 0), T.halfWidth.applyMatrix4(s), T.halfHeight.applyMatrix4(s), d++; } else if (S.isPointLight) { const T = n.point[g]; T.position.setFromMatrixPosition(S.matrixWorld), T.position.applyMatrix4(f), g++; } else if (S.isHemisphereLight) { const T = n.hemi[y]; T.direction.setFromMatrixPosition(S.matrixWorld), T.direction.transformDirection(f), T.direction.normalize(), y++; } } } return { setup: c, setupView: l, state: n }; } function kg(i, e) { const t = new RN(i, e), r = [], n = []; function o() { r.length = 0, n.length = 0; } function a(h) { r.push(h); } function s(h) { n.push(h); } function c() { t.setup(r); } function l(h) { t.setupView(r, h); } return { init: o, state: { lightsArray: r, shadowsArray: n, lights: t }, setupLights: c, setupLightsView: l, pushLight: a, pushShadow: s }; } function ON(i, e) { let t = /* @__PURE__ */ new WeakMap(); function r(o, a = 0) { let s; return t.has(o) === !1 ? (s = new kg(i, e), t.set(o, [s])) : a >= t.get(o).length ? (s = new kg(i, e), t.get(o).push(s)) : s = t.get(o)[a], s; } function n() { t = /* @__PURE__ */ new WeakMap(); } return { get: r, dispose: n }; } class Iu extends Qt { constructor(e) { super(), this.type = "MeshDepthMaterial", this.depthPacking = lx, this.morphTargets = !1, this.map = null, this.alphaMap = null, this.displacementMap = null, this.displacementScale = 1, this.displacementBias = 0, this.wireframe = !1, this.wireframeLinewidth = 1, this.fog = !1, this.setValues(e); } copy(e) { return super.copy(e), this.depthPacking = e.depthPacking, this.morphTargets = e.morphTargets, 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; } } Iu.prototype.isMeshDepthMaterial = !0; class Du extends Qt { constructor(e) { super(), this.type = "MeshDistanceMaterial", this.referencePosition = new Z(), this.nearDistance = 1, this.farDistance = 1e3, this.morphTargets = !1, this.map = null, this.alphaMap = null, this.displacementMap = null, this.displacementScale = 1, this.displacementBias = 0, this.fog = !1, this.setValues(e); } copy(e) { return super.copy(e), this.referencePosition.copy(e.referencePosition), this.nearDistance = e.nearDistance, this.farDistance = e.farDistance, this.morphTargets = e.morphTargets, this.map = e.map, this.alphaMap = e.alphaMap, this.displacementMap = e.displacementMap, this.displacementScale = e.displacementScale, this.displacementBias = e.displacementBias, this; } } Du.prototype.isMeshDistanceMaterial = !0; var PN = `uniform sampler2D shadow_pass; uniform vec2 resolution; uniform float radius; #include void main() { float mean = 0.0; float squared_mean = 0.0; float depth = unpackRGBAToDepth( texture2D( shadow_pass, ( gl_FragCoord.xy ) / resolution ) ); for ( float i = -1.0; i < 1.0 ; i += SAMPLE_RATE) { #ifdef HORIZONTAL_PASS vec2 distribution = unpackRGBATo2Half( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( i, 0.0 ) * radius ) / resolution ) ); mean += distribution.x; squared_mean += distribution.y * distribution.y + distribution.x * distribution.x; #else float depth = unpackRGBAToDepth( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( 0.0, i ) * radius ) / resolution ) ); mean += depth; squared_mean += depth * depth; #endif } mean = mean * HALF_SAMPLE_RATE; squared_mean = squared_mean * HALF_SAMPLE_RATE; float std_dev = sqrt( squared_mean - mean * mean ); gl_FragColor = pack2HalfToRGBA( vec2( mean, std_dev ) ); }`, IN = `void main() { gl_Position = vec4( position, 1.0 ); }`; function Ix(i, e, t) { let r = new _l(); const n = new Oe(), o = new Oe(), a = new Mt(), s = [], c = [], l = {}, h = t.maxTextureSize, u = { 0: $t, 1: qn, 2: Xn }, p = new hn({ defines: { SAMPLE_RATE: 2 / 8, HALF_SAMPLE_RATE: 1 / 8 }, uniforms: { shadow_pass: { value: null }, resolution: { value: new Oe() }, radius: { value: 4 } }, vertexShader: IN, fragmentShader: PN }), g = p.clone(); g.defines.HORIZONTAL_PASS = 1; const m = new Je(); m.setAttribute( "position", new tt( new Float32Array([-1, -1, 0.5, 3, -1, 0.5, -1, 3, 0.5]), 3 ) ); const d = new Yt(m, p), y = this; this.enabled = !1, this.autoUpdate = !0, this.needsUpdate = !1, this.type = zp, this.render = function(x, w, A) { if (y.enabled === !1 || y.autoUpdate === !1 && y.needsUpdate === !1 || x.length === 0) return; const _ = i.getRenderTarget(), E = i.getActiveCubeFace(), O = i.getActiveMipmapLevel(), L = i.state; L.setBlending(on), L.buffers.color.setClear(1, 1, 1, 1), L.buffers.depth.setTest(!0), L.setScissorTest(!1); for (let C = 0, I = x.length; C < I; C++) { const R = x[C], b = R.shadow; if (b === void 0) { console.warn("THREE.WebGLShadowMap:", R, "has no shadow."); continue; } if (b.autoUpdate === !1 && b.needsUpdate === !1) continue; n.copy(b.mapSize); const P = b.getFrameExtents(); if (n.multiply(P), o.copy(b.mapSize), (n.x > h || n.y > h) && (n.x > h && (o.x = Math.floor(h / P.x), n.x = o.x * P.x, b.mapSize.x = o.x), n.y > h && (o.y = Math.floor(h / P.y), n.y = o.y * P.y, b.mapSize.y = o.y)), b.map === null && !b.isPointLightShadow && this.type === wa) { const D = { minFilter: Ut, magFilter: Ut, format: $i }; b.map = new vr(n.x, n.y, D), b.map.texture.name = R.name + ".shadowMap", b.mapPass = new vr(n.x, n.y, D), b.camera.updateProjectionMatrix(); } if (b.map === null) { const D = { minFilter: qt, magFilter: qt, format: $i }; b.map = new vr(n.x, n.y, D), b.map.texture.name = R.name + ".shadowMap", b.camera.updateProjectionMatrix(); } i.setRenderTarget(b.map), i.clear(); const N = b.getViewportCount(); for (let D = 0; D < N; D++) { const k = b.getViewport(D); a.set( o.x * k.x, o.y * k.y, o.x * k.z, o.y * k.w ), L.viewport(a), b.updateMatrices(R, D), r = b.getFrustum(), T(w, A, b.camera, R, this.type); } !b.isPointLightShadow && this.type === wa && f(b, A), b.needsUpdate = !1; } y.needsUpdate = !1, i.setRenderTarget(_, E, O); }; function f(x, w) { const A = e.update(d); p.uniforms.shadow_pass.value = x.map.texture, p.uniforms.resolution.value = x.mapSize, p.uniforms.radius.value = x.radius, i.setRenderTarget(x.mapPass), i.clear(), i.renderBufferDirect(w, null, A, p, d, null), g.uniforms.shadow_pass.value = x.mapPass.texture, g.uniforms.resolution.value = x.mapSize, g.uniforms.radius.value = x.radius, i.setRenderTarget(x.map), i.clear(), i.renderBufferDirect(w, null, A, g, d, null); } function v(x) { const w = x << 0; let A = s[w]; return A === void 0 && (A = new Iu({ depthPacking: cx, morphTargets: x }), s[w] = A), A; } function M(x) { const w = x << 0; let A = c[w]; return A === void 0 && (A = new Du({ morphTargets: x }), c[w] = A), A; } function S(x, w, A, _, E, O, L) { let C = null, I = v, R = x.customDepthMaterial; if (_.isPointLight === !0 && (I = M, R = x.customDistanceMaterial), R === void 0) { let b = !1; A.morphTargets === !0 && (b = w.morphAttributes && w.morphAttributes.position && w.morphAttributes.position.length > 0), C = I(b); } else C = R; if (i.localClippingEnabled && A.clipShadows === !0 && A.clippingPlanes.length !== 0) { const b = C.uuid, P = A.uuid; let N = l[b]; N === void 0 && (N = {}, l[b] = N); let D = N[P]; D === void 0 && (D = C.clone(), N[P] = D), C = D; } return C.visible = A.visible, C.wireframe = A.wireframe, L === wa ? C.side = A.shadowSide !== null ? A.shadowSide : A.side : C.side = A.shadowSide !== null ? A.shadowSide : u[A.side], C.clipShadows = A.clipShadows, C.clippingPlanes = A.clippingPlanes, C.clipIntersection = A.clipIntersection, C.wireframeLinewidth = A.wireframeLinewidth, C.linewidth = A.linewidth, _.isPointLight === !0 && C.isMeshDistanceMaterial === !0 && (C.referencePosition.setFromMatrixPosition(_.matrixWorld), C.nearDistance = E, C.farDistance = O), C; } function T(x, w, A, _, E) { if (x.visible === !1) return; if (x.layers.test(w.layers) && (x.isMesh || x.isLine || x.isPoints) && (x.castShadow || x.receiveShadow && E === wa) && (!x.frustumCulled || r.intersectsObject(x))) { x.modelViewMatrix.multiplyMatrices(A.matrixWorldInverse, x.matrixWorld); const L = e.update(x), C = x.material; if (Array.isArray(C)) { const I = L.groups; for (let R = 0, b = I.length; R < b; R++) { const P = I[R], N = C[P.materialIndex]; if (N && N.visible) { const D = S(x, L, N, _, A.near, A.far, E); i.renderBufferDirect(A, null, L, D, x, P); } } } else if (C.visible) { const I = S(x, L, C, _, A.near, A.far, E); i.renderBufferDirect(A, null, L, I, x, null); } } const O = x.children; for (let L = 0, C = O.length; L < C; L++) T(O[L], w, A, _, E); } } function DN(i, e, t) { const r = t.isWebGL2; function n() { let oe = !1; const Me = new Mt(); let ye = null; const we = new Mt(0, 0, 0, 0); return { setMask: function(Pe) { ye !== Pe && !oe && (i.colorMask(Pe, Pe, Pe, Pe), ye = Pe); }, setLocked: function(Pe) { oe = Pe; }, setClear: function(Pe, ut, mt, Ge, bt) { bt === !0 && (Pe *= Ge, ut *= Ge, mt *= Ge), Me.set(Pe, ut, mt, Ge), we.equals(Me) === !1 && (i.clearColor(Pe, ut, mt, Ge), we.copy(Me)); }, reset: function() { oe = !1, ye = null, we.set(-1, 0, 0, 0); } }; } function o() { let oe = !1, Me = null, ye = null, we = null; return { setTest: function(Pe) { Pe ? ne(2929) : X(2929); }, setMask: function(Pe) { Me !== Pe && !oe && (i.depthMask(Pe), Me = Pe); }, setFunc: function(Pe) { if (ye !== Pe) { if (Pe) switch (Pe) { case Yy: i.depthFunc(512); break; case Jy: i.depthFunc(519); break; case Ky: i.depthFunc(513); break; case Kc: i.depthFunc(515); break; case Qy: i.depthFunc(514); break; case eb: i.depthFunc(518); break; case tb: i.depthFunc(516); break; case ib: i.depthFunc(517); break; default: i.depthFunc(515); } else i.depthFunc(515); ye = Pe; } }, setLocked: function(Pe) { oe = Pe; }, setClear: function(Pe) { we !== Pe && (i.clearDepth(Pe), we = Pe); }, reset: function() { oe = !1, Me = null, ye = null, we = null; } }; } function a() { let oe = !1, Me = null, ye = null, we = null, Pe = null, ut = null, mt = null, Ge = null, bt = null; return { setTest: function(ze) { oe || (ze ? ne(2960) : X(2960)); }, setMask: function(ze) { Me !== ze && !oe && (i.stencilMask(ze), Me = ze); }, setFunc: function(ze, at, et) { (ye !== ze || we !== at || Pe !== et) && (i.stencilFunc(ze, at, et), ye = ze, we = at, Pe = et); }, setOp: function(ze, at, et) { (ut !== ze || mt !== at || Ge !== et) && (i.stencilOp(ze, at, et), ut = ze, mt = at, Ge = et); }, setLocked: function(ze) { oe = ze; }, setClear: function(ze) { bt !== ze && (i.clearStencil(ze), bt = ze); }, reset: function() { oe = !1, Me = null, ye = null, we = null, Pe = null, ut = null, mt = null, Ge = null, bt = null; } }; } const s = new n(), c = new o(), l = new a(); let h = {}, u = null, p = {}, g = null, m = !1, d = null, y = null, f = null, v = null, M = null, S = null, T = null, x = !1, w = null, A = null, _ = null, E = null, O = null; const L = i.getParameter(35661); let C = !1, I = 0; const R = i.getParameter(7938); R.indexOf("WebGL") !== -1 ? (I = parseFloat(/^WebGL (\d)/.exec(R)[1]), C = I >= 1) : R.indexOf("OpenGL ES") !== -1 && (I = parseFloat(/^OpenGL ES (\d)/.exec(R)[1]), C = I >= 2); let b = null, P = {}; const N = i.getParameter(3088), D = i.getParameter(2978), k = new Mt().fromArray(N), V = new Mt().fromArray(D); function q(oe, Me, ye) { const we = new Uint8Array(4), Pe = i.createTexture(); i.bindTexture(oe, Pe), i.texParameteri(oe, 10241, 9728), i.texParameteri(oe, 10240, 9728); for (let ut = 0; ut < ye; ut++) i.texImage2D(Me + ut, 0, 6408, 1, 1, 0, 6408, 5121, we); return Pe; } const Y = {}; Y[3553] = q(3553, 3553, 1), Y[34067] = q(34067, 34069, 6), s.setClear(0, 0, 0, 1), c.setClear(1), l.setClear(0), ne(2929), c.setFunc(Kc), ie(!1), B(vd), ne(2884), W(on); function ne(oe) { h[oe] !== !0 && (i.enable(oe), h[oe] = !0); } function X(oe) { h[oe] !== !1 && (i.disable(oe), h[oe] = !1); } function z(oe) { oe !== u && (i.bindFramebuffer(36160, oe), u = oe); } function H(oe, Me) { return Me === null && u !== null && (Me = u), p[oe] !== Me ? (i.bindFramebuffer(oe, Me), p[oe] = Me, r && (oe === 36009 && (p[36160] = Me), oe === 36160 && (p[36009] = Me)), !0) : !1; } function ee(oe) { return g !== oe ? (i.useProgram(oe), g = oe, !0) : !1; } const Q = { [bo]: 32774, [Fy]: 32778, [Vy]: 32779 }; if (r) Q[wd] = 32775, Q[_d] = 32776; else { const oe = e.get("EXT_blend_minmax"); oe !== null && (Q[wd] = oe.MIN_EXT, Q[_d] = oe.MAX_EXT); } const J = { [Uy]: 0, [Gy]: 1, [Hy]: 768, [Vp]: 770, [Zy]: 776, [qy]: 774, [Wy]: 772, [jy]: 769, [Up]: 771, [Xy]: 775, [$y]: 773 }; function W(oe, Me, ye, we, Pe, ut, mt, Ge) { if (oe === on) { m === !0 && (X(3042), m = !1); return; } if (m === !1 && (ne(3042), m = !0), oe !== zy) { if (oe !== d || Ge !== x) { if ((y !== bo || M !== bo) && (i.blendEquation(32774), y = bo, M = bo), Ge) switch (oe) { case Sa: i.blendFuncSeparate(1, 771, 1, 771); break; case yd: i.blendFunc(1, 1); break; case bd: i.blendFuncSeparate(0, 0, 769, 771); break; case xd: i.blendFuncSeparate(0, 768, 0, 770); break; default: console.error("THREE.WebGLState: Invalid blending: ", oe); break; } else switch (oe) { case Sa: i.blendFuncSeparate(770, 771, 1, 771); break; case yd: i.blendFunc(770, 1); break; case bd: i.blendFunc(0, 769); break; case xd: i.blendFunc(0, 768); break; default: console.error("THREE.WebGLState: Invalid blending: ", oe); break; } f = null, v = null, S = null, T = null, d = oe, x = Ge; } return; } Pe = Pe || Me, ut = ut || ye, mt = mt || we, (Me !== y || Pe !== M) && (i.blendEquationSeparate(Q[Me], Q[Pe]), y = Me, M = Pe), (ye !== f || we !== v || ut !== S || mt !== T) && (i.blendFuncSeparate(J[ye], J[we], J[ut], J[mt]), f = ye, v = we, S = ut, T = mt), d = oe, x = null; } function K(oe, Me) { oe.side === Xn ? X(2884) : ne(2884); let ye = oe.side === $t; Me && (ye = !ye), ie(ye), oe.blending === Sa && oe.transparent === !1 ? W(on) : W(oe.blending, oe.blendEquation, oe.blendSrc, oe.blendDst, oe.blendEquationAlpha, oe.blendSrcAlpha, oe.blendDstAlpha, oe.premultipliedAlpha), c.setFunc(oe.depthFunc), c.setTest(oe.depthTest), c.setMask(oe.depthWrite), s.setMask(oe.colorWrite); const we = oe.stencilWrite; l.setTest(we), we && (l.setMask(oe.stencilWriteMask), l.setFunc(oe.stencilFunc, oe.stencilRef, oe.stencilFuncMask), l.setOp(oe.stencilFail, oe.stencilZFail, oe.stencilZPass)), re(oe.polygonOffset, oe.polygonOffsetFactor, oe.polygonOffsetUnits), oe.alphaToCoverage === !0 ? ne(32926) : X(32926); } function ie(oe) { w !== oe && (oe ? i.frontFace(2304) : i.frontFace(2305), w = oe); } function B(oe) { oe !== Ny ? (ne(2884), oe !== A && (oe === vd ? i.cullFace(1029) : oe === By ? i.cullFace(1028) : i.cullFace(1032))) : X(2884), A = oe; } function j(oe) { oe !== _ && (C && i.lineWidth(oe), _ = oe); } function re(oe, Me, ye) { oe ? (ne(32823), (E !== Me || O !== ye) && (i.polygonOffset(Me, ye), E = Me, O = ye)) : X(32823); } function F(oe) { oe ? ne(3089) : X(3089); } function U(oe) { oe === void 0 && (oe = 33984 + L - 1), b !== oe && (i.activeTexture(oe), b = oe); } function se(oe, Me) { b === null && U(); let ye = P[b]; ye === void 0 && (ye = { type: void 0, texture: void 0 }, P[b] = ye), (ye.type !== oe || ye.texture !== Me) && (i.bindTexture(oe, Me || Y[oe]), ye.type = oe, ye.texture = Me); } function ue() { const oe = P[b]; oe !== void 0 && oe.type !== void 0 && (i.bindTexture(oe.type, null), oe.type = void 0, oe.texture = void 0); } function fe() { try { i.compressedTexImage2D.apply(i, arguments); } catch (oe) { console.error("THREE.WebGLState:", oe); } } function ve() { try { i.texImage2D.apply(i, arguments); } catch (oe) { console.error("THREE.WebGLState:", oe); } } function _e() { try { i.texImage3D.apply(i, arguments); } catch (oe) { console.error("THREE.WebGLState:", oe); } } function ae(oe) { k.equals(oe) === !1 && (i.scissor(oe.x, oe.y, oe.z, oe.w), k.copy(oe)); } function Te(oe) { V.equals(oe) === !1 && (i.viewport(oe.x, oe.y, oe.z, oe.w), V.copy(oe)); } function Ee() { i.disable(3042), i.disable(2884), i.disable(2929), i.disable(32823), i.disable(3089), i.disable(2960), i.disable(32926), i.blendEquation(32774), i.blendFunc(1, 0), i.blendFuncSeparate(1, 0, 1, 0), i.colorMask(!0, !0, !0, !0), i.clearColor(0, 0, 0, 0), i.depthMask(!0), i.depthFunc(513), i.clearDepth(1), i.stencilMask(4294967295), i.stencilFunc(519, 0, 4294967295), i.stencilOp(7680, 7680, 7680), i.clearStencil(0), i.cullFace(1029), i.frontFace(2305), i.polygonOffset(0, 0), i.activeTexture(33984), i.bindFramebuffer(36160, null), r === !0 && (i.bindFramebuffer(36009, null), i.bindFramebuffer(36008, null)), i.useProgram(null), i.lineWidth(1), i.scissor(0, 0, i.canvas.width, i.canvas.height), i.viewport(0, 0, i.canvas.width, i.canvas.height), h = {}, b = null, P = {}, u = null, p = {}, g = null, m = !1, d = null, y = null, f = null, v = null, M = null, S = null, T = null, x = !1, w = null, A = null, _ = null, E = null, O = null, k.set(0, 0, i.canvas.width, i.canvas.height), V.set(0, 0, i.canvas.width, i.canvas.height), s.reset(), c.reset(), l.reset(); } return { buffers: { color: s, depth: c, stencil: l }, enable: ne, disable: X, bindFramebuffer: H, bindXRFramebuffer: z, useProgram: ee, setBlending: W, setMaterial: K, setFlipSided: ie, setCullFace: B, setLineWidth: j, setPolygonOffset: re, setScissorTest: F, activeTexture: U, bindTexture: se, unbindTexture: ue, compressedTexImage2D: fe, texImage2D: ve, texImage3D: _e, scissor: ae, viewport: Te, reset: Ee }; } function NN(i, e, t, r, n, o, a) { const s = n.isWebGL2, c = n.maxTextures, l = n.maxCubemapSize, h = n.maxTextureSize, u = n.maxSamples, p = /* @__PURE__ */ new WeakMap(); let g, m = !1; try { m = typeof OffscreenCanvas < "u" && new OffscreenCanvas(1, 1).getContext("2d") !== null; } catch { } function d(F, U) { return m ? new OffscreenCanvas(F, U) : document.createElementNS("http://www.w3.org/1999/xhtml", "canvas"); } function y(F, U, se, ue) { let fe = 1; if ((F.width > ue || F.height > ue) && (fe = ue / Math.max(F.width, F.height)), fe < 1 || U === !0) if (typeof HTMLImageElement < "u" && F instanceof HTMLImageElement || typeof HTMLCanvasElement < "u" && F instanceof HTMLCanvasElement || typeof ImageBitmap < "u" && F instanceof ImageBitmap) { const ve = U ? px : Math.floor, _e = ve(fe * F.width), ae = ve(fe * F.height); g === void 0 && (g = d(_e, ae)); const Te = se ? d(_e, ae) : g; return Te.width = _e, Te.height = ae, Te.getContext("2d").drawImage(F, 0, 0, _e, ae), console.warn("THREE.WebGLRenderer: Texture has been resized from (" + F.width + "x" + F.height + ") to (" + _e + "x" + ae + ")."), Te; } else return "data" in F && console.warn("THREE.WebGLRenderer: Image in DataTexture is too big (" + F.width + "x" + F.height + ")."), F; return F; } function f(F) { return Dd(F.width) && Dd(F.height); } function v(F) { return s ? !1 : F.wrapS !== li || F.wrapT !== li || F.minFilter !== qt && F.minFilter !== Ut; } function M(F, U) { return F.generateMipmaps && U && F.minFilter !== qt && F.minFilter !== Ut; } function S(F, U, se, ue, fe = 1) { i.generateMipmap(F); const ve = r.get(U); ve.__maxMipLevel = Math.log2(Math.max(se, ue, fe)); } function T(F, U, se) { if (s === !1) return U; if (F !== null) { if (i[F] !== void 0) return i[F]; console.warn("THREE.WebGLRenderer: Attempt to use non-existing WebGL internal format '" + F + "'"); } let ue = U; return U === 6403 && (se === 5126 && (ue = 33326), se === 5131 && (ue = 33325), se === 5121 && (ue = 33321)), U === 6407 && (se === 5126 && (ue = 34837), se === 5131 && (ue = 34843), se === 5121 && (ue = 32849)), U === 6408 && (se === 5126 && (ue = 34836), se === 5131 && (ue = 34842), se === 5121 && (ue = 32856)), (ue === 33325 || ue === 33326 || ue === 34842 || ue === 34836) && e.get("EXT_color_buffer_float"), ue; } function x(F) { return F === qt || F === Ks || F === Qs ? 9728 : 9729; } function w(F) { const U = F.target; U.removeEventListener("dispose", w), _(U), U.isVideoTexture && p.delete(U), a.memory.textures--; } function A(F) { const U = F.target; U.removeEventListener("dispose", A), E(U); } function _(F) { const U = r.get(F); U.__webglInit !== void 0 && (i.deleteTexture(U.__webglTexture), r.remove(F)); } function E(F) { const U = F.texture, se = r.get(F), ue = r.get(U); if (F) { if (ue.__webglTexture !== void 0 && (i.deleteTexture(ue.__webglTexture), a.memory.textures--), F.depthTexture && F.depthTexture.dispose(), F.isWebGLCubeRenderTarget) for (let fe = 0; fe < 6; fe++) i.deleteFramebuffer(se.__webglFramebuffer[fe]), se.__webglDepthbuffer && i.deleteRenderbuffer(se.__webglDepthbuffer[fe]); else i.deleteFramebuffer(se.__webglFramebuffer), se.__webglDepthbuffer && i.deleteRenderbuffer(se.__webglDepthbuffer), se.__webglMultisampledFramebuffer && i.deleteFramebuffer(se.__webglMultisampledFramebuffer), se.__webglColorRenderbuffer && i.deleteRenderbuffer(se.__webglColorRenderbuffer), se.__webglDepthRenderbuffer && i.deleteRenderbuffer(se.__webglDepthRenderbuffer); if (F.isWebGLMultipleRenderTargets) for (let fe = 0, ve = U.length; fe < ve; fe++) { const _e = r.get(U[fe]); _e.__webglTexture && (i.deleteTexture(_e.__webglTexture), a.memory.textures--), r.remove(U[fe]); } r.remove(U), r.remove(F); } } let O = 0; function L() { O = 0; } function C() { const F = O; return F >= c && console.warn("THREE.WebGLTextures: Trying to use " + F + " texture units while this GPU supports only " + c), O += 1, F; } function I(F, U) { const se = r.get(F); if (F.isVideoTexture && K(F), F.version > 0 && se.__version !== F.version) { const ue = F.image; if (ue === void 0) console.warn("THREE.WebGLRenderer: Texture marked for update but image is undefined"); else if (ue.complete === !1) console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete"); else { q(se, F, U); return; } } t.activeTexture(33984 + U), t.bindTexture(3553, se.__webglTexture); } function R(F, U) { const se = r.get(F); if (F.version > 0 && se.__version !== F.version) { q(se, F, U); return; } t.activeTexture(33984 + U), t.bindTexture(35866, se.__webglTexture); } function b(F, U) { const se = r.get(F); if (F.version > 0 && se.__version !== F.version) { q(se, F, U); return; } t.activeTexture(33984 + U), t.bindTexture(32879, se.__webglTexture); } function P(F, U) { const se = r.get(F); if (F.version > 0 && se.__version !== F.version) { Y(se, F, U); return; } t.activeTexture(33984 + U), t.bindTexture(34067, se.__webglTexture); } const N = { [Zn]: 10497, [li]: 33071, [Na]: 33648 }, D = { [qt]: 9728, [Ks]: 9984, [Qs]: 9986, [Ut]: 9729, [Tu]: 9985, [yn]: 9987 }; function k(F, U, se) { if (se ? (i.texParameteri(F, 10242, N[U.wrapS]), i.texParameteri(F, 10243, N[U.wrapT]), (F === 32879 || F === 35866) && i.texParameteri(F, 32882, N[U.wrapR]), i.texParameteri(F, 10240, D[U.magFilter]), i.texParameteri(F, 10241, D[U.minFilter])) : (i.texParameteri(F, 10242, 33071), i.texParameteri(F, 10243, 33071), (F === 32879 || F === 35866) && i.texParameteri(F, 32882, 33071), (U.wrapS !== li || U.wrapT !== li) && console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.wrapS and Texture.wrapT should be set to THREE.ClampToEdgeWrapping."), i.texParameteri(F, 10240, x(U.magFilter)), i.texParameteri(F, 10241, x(U.minFilter)), U.minFilter !== qt && U.minFilter !== Ut && console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.minFilter should be set to THREE.NearestFilter or THREE.LinearFilter.")), e.has("EXT_texture_filter_anisotropic") === !0) { const ue = e.get("EXT_texture_filter_anisotropic"); if (U.type === en && e.has("OES_texture_float_linear") === !1 || s === !1 && U.type === Eo && e.has("OES_texture_half_float_linear") === !1) return; (U.anisotropy > 1 || r.get(U).__currentAnisotropy) && (i.texParameterf(F, ue.TEXTURE_MAX_ANISOTROPY_EXT, Math.min(U.anisotropy, n.getMaxAnisotropy())), r.get(U).__currentAnisotropy = U.anisotropy); } } function V(F, U) { F.__webglInit === void 0 && (F.__webglInit = !0, U.addEventListener("dispose", w), F.__webglTexture = i.createTexture(), a.memory.textures++); } function q(F, U, se) { let ue = 3553; U.isDataTexture2DArray && (ue = 35866), U.isDataTexture3D && (ue = 32879), V(F, U), t.activeTexture(33984 + se), t.bindTexture(ue, F.__webglTexture), i.pixelStorei(37440, U.flipY), i.pixelStorei(37441, U.premultiplyAlpha), i.pixelStorei(3317, U.unpackAlignment), i.pixelStorei(37443, 0); const fe = v(U) && f(U.image) === !1, ve = y(U.image, fe, !1, h), _e = f(ve) || s, ae = o.convert(U.format); let Te = o.convert(U.type), Ee = T(U.internalFormat, ae, Te); k(ue, U, _e); let oe; const Me = U.mipmaps; if (U.isDepthTexture) Ee = 6402, s ? U.type === en ? Ee = 36012 : U.type === Vs ? Ee = 33190 : U.type === Ta ? Ee = 35056 : Ee = 33189 : U.type === en && console.error("WebGLRenderer: Floating point depth texture requires WebGL2."), U.format === Ao && Ee === 6402 && U.type !== el && U.type !== Vs && (console.warn("THREE.WebGLRenderer: Use UnsignedShortType or UnsignedIntType for DepthFormat DepthTexture."), U.type = el, Te = o.convert(U.type)), U.format === Ba && Ee === 6402 && (Ee = 34041, U.type !== Ta && (console.warn("THREE.WebGLRenderer: Use UnsignedInt248Type for DepthStencilFormat DepthTexture."), U.type = Ta, Te = o.convert(U.type))), t.texImage2D(3553, 0, Ee, ve.width, ve.height, 0, ae, Te, null); else if (U.isDataTexture) if (Me.length > 0 && _e) { for (let ye = 0, we = Me.length; ye < we; ye++) oe = Me[ye], t.texImage2D(3553, ye, Ee, oe.width, oe.height, 0, ae, Te, oe.data); U.generateMipmaps = !1, F.__maxMipLevel = Me.length - 1; } else t.texImage2D(3553, 0, Ee, ve.width, ve.height, 0, ae, Te, ve.data), F.__maxMipLevel = 0; else if (U.isCompressedTexture) { for (let ye = 0, we = Me.length; ye < we; ye++) oe = Me[ye], U.format !== $i && U.format !== an ? ae !== null ? t.compressedTexImage2D(3553, ye, Ee, oe.width, oe.height, 0, oe.data) : console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()") : t.texImage2D(3553, ye, Ee, oe.width, oe.height, 0, ae, Te, oe.data); F.__maxMipLevel = Me.length - 1; } else if (U.isDataTexture2DArray) t.texImage3D(35866, 0, Ee, ve.width, ve.height, ve.depth, 0, ae, Te, ve.data), F.__maxMipLevel = 0; else if (U.isDataTexture3D) t.texImage3D(32879, 0, Ee, ve.width, ve.height, ve.depth, 0, ae, Te, ve.data), F.__maxMipLevel = 0; else if (Me.length > 0 && _e) { for (let ye = 0, we = Me.length; ye < we; ye++) oe = Me[ye], t.texImage2D(3553, ye, Ee, ae, Te, oe); U.generateMipmaps = !1, F.__maxMipLevel = Me.length - 1; } else t.texImage2D(3553, 0, Ee, ae, Te, ve), F.__maxMipLevel = 0; M(U, _e) && S(ue, U, ve.width, ve.height), F.__version = U.version, U.onUpdate && U.onUpdate(U); } function Y(F, U, se) { if (U.image.length !== 6) return; V(F, U), t.activeTexture(33984 + se), t.bindTexture(34067, F.__webglTexture), i.pixelStorei(37440, U.flipY), i.pixelStorei(37441, U.premultiplyAlpha), i.pixelStorei(3317, U.unpackAlignment), i.pixelStorei(37443, 0); const ue = U && (U.isCompressedTexture || U.image[0].isCompressedTexture), fe = U.image[0] && U.image[0].isDataTexture, ve = []; for (let ye = 0; ye < 6; ye++) !ue && !fe ? ve[ye] = y(U.image[ye], !1, !0, l) : ve[ye] = fe ? U.image[ye].image : U.image[ye]; const _e = ve[0], ae = f(_e) || s, Te = o.convert(U.format), Ee = o.convert(U.type), oe = T(U.internalFormat, Te, Ee); k(34067, U, ae); let Me; if (ue) { for (let ye = 0; ye < 6; ye++) { Me = ve[ye].mipmaps; for (let we = 0; we < Me.length; we++) { const Pe = Me[we]; U.format !== $i && U.format !== an ? Te !== null ? t.compressedTexImage2D(34069 + ye, we, oe, Pe.width, Pe.height, 0, Pe.data) : console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .setTextureCube()") : t.texImage2D(34069 + ye, we, oe, Pe.width, Pe.height, 0, Te, Ee, Pe.data); } } F.__maxMipLevel = Me.length - 1; } else { Me = U.mipmaps; for (let ye = 0; ye < 6; ye++) if (fe) { t.texImage2D(34069 + ye, 0, oe, ve[ye].width, ve[ye].height, 0, Te, Ee, ve[ye].data); for (let we = 0; we < Me.length; we++) { const Pe = Me[we].image[ye].image; t.texImage2D(34069 + ye, we + 1, oe, Pe.width, Pe.height, 0, Te, Ee, Pe.data); } } else { t.texImage2D(34069 + ye, 0, oe, Te, Ee, ve[ye]); for (let we = 0; we < Me.length; we++) { const Pe = Me[we]; t.texImage2D(34069 + ye, we + 1, oe, Te, Ee, Pe.image[ye]); } } F.__maxMipLevel = Me.length; } M(U, ae) && S(34067, U, _e.width, _e.height), F.__version = U.version, U.onUpdate && U.onUpdate(U); } function ne(F, U, se, ue, fe) { const ve = o.convert(se.format), _e = o.convert(se.type), ae = T(se.internalFormat, ve, _e); fe === 32879 || fe === 35866 ? t.texImage3D(fe, 0, ae, U.width, U.height, U.depth, 0, ve, _e, null) : t.texImage2D(fe, 0, ae, U.width, U.height, 0, ve, _e, null), t.bindFramebuffer(36160, F), i.framebufferTexture2D(36160, ue, fe, r.get(se).__webglTexture, 0), t.bindFramebuffer(36160, null); } function X(F, U, se) { if (i.bindRenderbuffer(36161, F), U.depthBuffer && !U.stencilBuffer) { let ue = 33189; if (se) { const fe = U.depthTexture; fe && fe.isDepthTexture && (fe.type === en ? ue = 36012 : fe.type === Vs && (ue = 33190)); const ve = W(U); i.renderbufferStorageMultisample(36161, ve, ue, U.width, U.height); } else i.renderbufferStorage(36161, ue, U.width, U.height); i.framebufferRenderbuffer(36160, 36096, 36161, F); } else if (U.depthBuffer && U.stencilBuffer) { if (se) { const ue = W(U); i.renderbufferStorageMultisample(36161, ue, 35056, U.width, U.height); } else i.renderbufferStorage(36161, 34041, U.width, U.height); i.framebufferRenderbuffer(36160, 33306, 36161, F); } else { const ue = U.isWebGLMultipleRenderTargets === !0 ? U.texture[0] : U.texture, fe = o.convert(ue.format), ve = o.convert(ue.type), _e = T(ue.internalFormat, fe, ve); if (se) { const ae = W(U); i.renderbufferStorageMultisample(36161, ae, _e, U.width, U.height); } else i.renderbufferStorage(36161, _e, U.width, U.height); } i.bindRenderbuffer(36161, null); } function z(F, U) { if (U && U.isWebGLCubeRenderTarget) throw new Error("Depth Texture with cube render targets is not supported"); if (t.bindFramebuffer(36160, F), !(U.depthTexture && U.depthTexture.isDepthTexture)) throw new Error("renderTarget.depthTexture must be an instance of THREE.DepthTexture"); (!r.get(U.depthTexture).__webglTexture || U.depthTexture.image.width !== U.width || U.depthTexture.image.height !== U.height) && (U.depthTexture.image.width = U.width, U.depthTexture.image.height = U.height, U.depthTexture.needsUpdate = !0), I(U.depthTexture, 0); const se = r.get(U.depthTexture).__webglTexture; if (U.depthTexture.format === Ao) i.framebufferTexture2D(36160, 36096, 3553, se, 0); else if (U.depthTexture.format === Ba) i.framebufferTexture2D(36160, 33306, 3553, se, 0); else throw new Error("Unknown depthTexture format"); } function H(F) { const U = r.get(F), se = F.isWebGLCubeRenderTarget === !0; if (F.depthTexture) { if (se) throw new Error("target.depthTexture not supported in Cube render targets"); z(U.__webglFramebuffer, F); } else if (se) { U.__webglDepthbuffer = []; for (let ue = 0; ue < 6; ue++) t.bindFramebuffer(36160, U.__webglFramebuffer[ue]), U.__webglDepthbuffer[ue] = i.createRenderbuffer(), X(U.__webglDepthbuffer[ue], F, !1); } else t.bindFramebuffer(36160, U.__webglFramebuffer), U.__webglDepthbuffer = i.createRenderbuffer(), X(U.__webglDepthbuffer, F, !1); t.bindFramebuffer(36160, null); } function ee(F) { const U = F.texture, se = r.get(F), ue = r.get(U); F.addEventListener("dispose", A), F.isWebGLMultipleRenderTargets !== !0 && (ue.__webglTexture = i.createTexture(), ue.__version = U.version, a.memory.textures++); const fe = F.isWebGLCubeRenderTarget === !0, ve = F.isWebGLMultipleRenderTargets === !0, _e = F.isWebGLMultisampleRenderTarget === !0, ae = U.isDataTexture3D || U.isDataTexture2DArray, Te = f(F) || s; if (s && U.format === an && (U.type === en || U.type === Eo) && (U.format = $i, console.warn("THREE.WebGLRenderer: Rendering to textures with RGB format is not supported. Using RGBA format instead.")), fe) { se.__webglFramebuffer = []; for (let Ee = 0; Ee < 6; Ee++) se.__webglFramebuffer[Ee] = i.createFramebuffer(); } else if (se.__webglFramebuffer = i.createFramebuffer(), ve) if (n.drawBuffers) { const Ee = F.texture; for (let oe = 0, Me = Ee.length; oe < Me; oe++) { const ye = r.get(Ee[oe]); ye.__webglTexture === void 0 && (ye.__webglTexture = i.createTexture(), a.memory.textures++); } } else console.warn("THREE.WebGLRenderer: WebGLMultipleRenderTargets can only be used with WebGL2 or WEBGL_draw_buffers extension."); else if (_e) if (s) { se.__webglMultisampledFramebuffer = i.createFramebuffer(), se.__webglColorRenderbuffer = i.createRenderbuffer(), i.bindRenderbuffer(36161, se.__webglColorRenderbuffer); const Ee = o.convert(U.format), oe = o.convert(U.type), Me = T(U.internalFormat, Ee, oe), ye = W(F); i.renderbufferStorageMultisample(36161, ye, Me, F.width, F.height), t.bindFramebuffer(36160, se.__webglMultisampledFramebuffer), i.framebufferRenderbuffer(36160, 36064, 36161, se.__webglColorRenderbuffer), i.bindRenderbuffer(36161, null), F.depthBuffer && (se.__webglDepthRenderbuffer = i.createRenderbuffer(), X(se.__webglDepthRenderbuffer, F, !0)), t.bindFramebuffer(36160, null); } else console.warn("THREE.WebGLRenderer: WebGLMultisampleRenderTarget can only be used with WebGL2."); if (fe) { t.bindTexture(34067, ue.__webglTexture), k(34067, U, Te); for (let Ee = 0; Ee < 6; Ee++) ne(se.__webglFramebuffer[Ee], F, U, 36064, 34069 + Ee); M(U, Te) && S(34067, U, F.width, F.height), t.bindTexture(34067, null); } else if (ve) { const Ee = F.texture; for (let oe = 0, Me = Ee.length; oe < Me; oe++) { const ye = Ee[oe], we = r.get(ye); t.bindTexture(3553, we.__webglTexture), k(3553, ye, Te), ne(se.__webglFramebuffer, F, ye, 36064 + oe, 3553), M(ye, Te) && S(3553, ye, F.width, F.height); } t.bindTexture(3553, null); } else { let Ee = 3553; ae && (s ? Ee = U.isDataTexture3D ? 32879 : 35866 : console.warn("THREE.DataTexture3D and THREE.DataTexture2DArray only supported with WebGL2.")), t.bindTexture(Ee, ue.__webglTexture), k(Ee, U, Te), ne(se.__webglFramebuffer, F, U, 36064, Ee), M(U, Te) && S(Ee, U, F.width, F.height, F.depth), t.bindTexture(Ee, null); } F.depthBuffer && H(F); } function Q(F) { const U = f(F) || s, se = F.isWebGLMultipleRenderTargets === !0 ? F.texture : [F.texture]; for (let ue = 0, fe = se.length; ue < fe; ue++) { const ve = se[ue]; if (M(ve, U)) { const _e = F.isWebGLCubeRenderTarget ? 34067 : 3553, ae = r.get(ve).__webglTexture; t.bindTexture(_e, ae), S(_e, ve, F.width, F.height), t.bindTexture(_e, null); } } } function J(F) { if (F.isWebGLMultisampleRenderTarget) if (s) { const U = F.width, se = F.height; let ue = 16384; F.depthBuffer && (ue |= 256), F.stencilBuffer && (ue |= 1024); const fe = r.get(F); t.bindFramebuffer(36008, fe.__webglMultisampledFramebuffer), t.bindFramebuffer(36009, fe.__webglFramebuffer), i.blitFramebuffer(0, 0, U, se, 0, 0, U, se, ue, 9728), t.bindFramebuffer(36008, null), t.bindFramebuffer(36009, fe.__webglMultisampledFramebuffer); } else console.warn("THREE.WebGLRenderer: WebGLMultisampleRenderTarget can only be used with WebGL2."); } function W(F) { return s && F.isWebGLMultisampleRenderTarget ? Math.min(u, F.samples) : 0; } function K(F) { const U = a.render.frame; p.get(F) !== U && (p.set(F, U), F.update()); } let ie = !1, B = !1; function j(F, U) { F && F.isWebGLRenderTarget && (ie === !1 && (console.warn("THREE.WebGLTextures.safeSetTexture2D: don't use render targets as textures. Use their .texture property instead."), ie = !0), F = F.texture), I(F, U); } function re(F, U) { F && F.isWebGLCubeRenderTarget && (B === !1 && (console.warn("THREE.WebGLTextures.safeSetTextureCube: don't use cube render targets as textures. Use their .texture property instead."), B = !0), F = F.texture), P(F, U); } this.allocateTextureUnit = C, this.resetTextureUnits = L, this.setTexture2D = I, this.setTexture2DArray = R, this.setTexture3D = b, this.setTextureCube = P, this.setupRenderTarget = ee, this.updateRenderTargetMipmap = Q, this.updateMultisampleRenderTarget = J, this.safeSetTexture2D = j, this.safeSetTextureCube = re; } function Dx(i, e, t) { const r = t.isWebGL2; function n(o) { let a; if (o === Po) return 5121; if (o === pb) return 32819; if (o === fb) return 32820; if (o === mb) return 33635; if (o === ub) return 5120; if (o === hb) return 5122; if (o === el) return 5123; if (o === db) return 5124; if (o === Vs) return 5125; if (o === en) return 5126; if (o === Eo) return r ? 5131 : (a = e.get("OES_texture_half_float"), a !== null ? a.HALF_FLOAT_OES : null); if (o === gb) return 6406; if (o === an) return 6407; if (o === $i) return 6408; if (o === vb) return 6409; if (o === yb) return 6410; if (o === Ao) return 6402; if (o === Ba) return 34041; if (o === xb) return 6403; if (o === wb) return 36244; if (o === _b) return 33319; if (o === Mb) return 33320; if (o === Sb) return 36248; if (o === Tb) return 36249; if (o === Md || o === Sd || o === Td || o === Ed) if (a = e.get("WEBGL_compressed_texture_s3tc"), a !== null) { if (o === Md) return a.COMPRESSED_RGB_S3TC_DXT1_EXT; if (o === Sd) return a.COMPRESSED_RGBA_S3TC_DXT1_EXT; if (o === Td) return a.COMPRESSED_RGBA_S3TC_DXT3_EXT; if (o === Ed) return a.COMPRESSED_RGBA_S3TC_DXT5_EXT; } else return null; if (o === Ad || o === Cd || o === Ld || o === Rd) if (a = e.get("WEBGL_compressed_texture_pvrtc"), a !== null) { if (o === Ad) return a.COMPRESSED_RGB_PVRTC_4BPPV1_IMG; if (o === Cd) return a.COMPRESSED_RGB_PVRTC_2BPPV1_IMG; if (o === Ld) return a.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG; if (o === Rd) return a.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG; } else return null; if (o === Eb) return a = e.get("WEBGL_compressed_texture_etc1"), a !== null ? a.COMPRESSED_RGB_ETC1_WEBGL : null; if ((o === Od || o === Pd) && (a = e.get("WEBGL_compressed_texture_etc"), a !== null)) { if (o === Od) return a.COMPRESSED_RGB8_ETC2; if (o === Pd) return a.COMPRESSED_RGBA8_ETC2_EAC; } if (o === Ab || o === Cb || o === Lb || o === Rb || o === Ob || o === Pb || o === Ib || o === Db || o === Nb || o === Bb || o === kb || o === zb || o === Fb || o === Vb || o === Gb || o === Hb || o === jb || o === Wb || o === $b || o === qb || o === Xb || o === Zb || o === Yb || o === Jb || o === Kb || o === Qb || o === ex || o === tx) return a = e.get("WEBGL_compressed_texture_astc"), a !== null ? o : null; if (o === Ub) return a = e.get("EXT_texture_compression_bptc"), a !== null ? o : null; if (o === Ta) return r ? 34042 : (a = e.get("WEBGL_depth_texture"), a !== null ? a.UNSIGNED_INT_24_8_WEBGL : null); } return { convert: n }; } class Kp extends ti { constructor(e = []) { super(), this.cameras = e; } } Kp.prototype.isArrayCamera = !0; class Lr extends nt { constructor() { super(), this.type = "Group"; } } Lr.prototype.isGroup = !0; const BN = { type: "move" }; class Rh { constructor() { this._targetRay = null, this._grip = null, this._hand = null; } getHandSpace() { return this._hand === null && (this._hand = new Lr(), 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 Lr(), this._targetRay.matrixAutoUpdate = !1, this._targetRay.visible = !1, this._targetRay.hasLinearVelocity = !1, this._targetRay.linearVelocity = new Z(), this._targetRay.hasAngularVelocity = !1, this._targetRay.angularVelocity = new Z()), this._targetRay; } getGripSpace() { return this._grip === null && (this._grip = new Lr(), this._grip.matrixAutoUpdate = !1, this._grip.visible = !1, this._grip.hasLinearVelocity = !1, this._grip.linearVelocity = new Z(), this._grip.hasAngularVelocity = !1, this._grip.angularVelocity = new Z()), 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; } 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, r) { let n = null, o = null, a = null; const s = this._targetRay, c = this._grip, l = this._hand; if (e && t.session.visibilityState !== "visible-blurred") if (s !== null && (n = t.getPose(e.targetRaySpace, r), n !== null && (s.matrix.fromArray(n.transform.matrix), s.matrix.decompose(s.position, s.rotation, s.scale), n.linearVelocity ? (s.hasLinearVelocity = !0, s.linearVelocity.copy(n.linearVelocity)) : s.hasLinearVelocity = !1, n.angularVelocity ? (s.hasAngularVelocity = !0, s.angularVelocity.copy(n.angularVelocity)) : s.hasAngularVelocity = !1, this.dispatchEvent(BN))), l && e.hand) { a = !0; for (const d of e.hand.values()) { const y = t.getJointPose(d, r); if (l.joints[d.jointName] === void 0) { const v = new Lr(); v.matrixAutoUpdate = !1, v.visible = !1, l.joints[d.jointName] = v, l.add(v); } const f = l.joints[d.jointName]; y !== null && (f.matrix.fromArray(y.transform.matrix), f.matrix.decompose(f.position, f.rotation, f.scale), f.jointRadius = y.radius), f.visible = y !== null; } const h = l.joints["index-finger-tip"], u = l.joints["thumb-tip"], p = h.position.distanceTo(u.position), g = 0.02, m = 5e-3; l.inputState.pinching && p > g + m ? (l.inputState.pinching = !1, this.dispatchEvent({ type: "pinchend", handedness: e.handedness, target: this })) : !l.inputState.pinching && p <= g - m && (l.inputState.pinching = !0, this.dispatchEvent({ type: "pinchstart", handedness: e.handedness, target: this })); } else c !== null && e.gripSpace && (o = t.getPose(e.gripSpace, r), o !== null && (c.matrix.fromArray(o.transform.matrix), c.matrix.decompose(c.position, c.rotation, c.scale), o.linearVelocity ? (c.hasLinearVelocity = !0, c.linearVelocity.copy(o.linearVelocity)) : c.hasLinearVelocity = !1, o.angularVelocity ? (c.hasAngularVelocity = !0, c.angularVelocity.copy(o.angularVelocity)) : c.hasAngularVelocity = !1)); return s !== null && (s.visible = n !== null), c !== null && (c.visible = o !== null), l !== null && (l.visible = a !== null), this; } } class kN extends to { constructor(e, t) { super(); const r = this, n = e.state; let o = null, a = 1, s = null, c = "local-floor", l = null, h = null, u = null, p = null; const g = [], m = /* @__PURE__ */ new Map(), d = new ti(); d.layers.enable(1), d.viewport = new Mt(); const y = new ti(); y.layers.enable(2), y.viewport = new Mt(); const f = [d, y], v = new Kp(); v.layers.enable(1), v.layers.enable(2); let M = null, S = null; this.cameraAutoUpdate = !0, this.enabled = !1, this.isPresenting = !1, this.getController = function(R) { let b = g[R]; return b === void 0 && (b = new Rh(), g[R] = b), b.getTargetRaySpace(); }, this.getControllerGrip = function(R) { let b = g[R]; return b === void 0 && (b = new Rh(), g[R] = b), b.getGripSpace(); }, this.getHand = function(R) { let b = g[R]; return b === void 0 && (b = new Rh(), g[R] = b), b.getHandSpace(); }; function T(R) { const b = m.get(R.inputSource); b && b.dispatchEvent({ type: R.type, data: R.inputSource }); } function x() { m.forEach(function(R, b) { R.disconnect(b); }), m.clear(), M = null, S = null, n.bindXRFramebuffer(null), e.setRenderTarget(e.getRenderTarget()), I.stop(), r.isPresenting = !1, r.dispatchEvent({ type: "sessionend" }); } this.setFramebufferScaleFactor = function(R) { a = R, r.isPresenting === !0 && console.warn("THREE.WebXRManager: Cannot change framebuffer scale while presenting."); }, this.setReferenceSpaceType = function(R) { c = R, r.isPresenting === !0 && console.warn("THREE.WebXRManager: Cannot change reference space type while presenting."); }, this.getReferenceSpace = function() { return s; }, this.getSession = function() { return o; }, this.setSession = async function(R) { if (o = R, o !== null) { o.addEventListener("select", T), o.addEventListener("selectstart", T), o.addEventListener("selectend", T), o.addEventListener("squeeze", T), o.addEventListener("squeezestart", T), o.addEventListener("squeezeend", T), o.addEventListener("end", x), o.addEventListener("inputsourceschange", w); const b = t.getContextAttributes(); if (b.xrCompatible !== !0 && await t.makeXRCompatible(), o.renderState.layers === void 0) { const P = { antialias: b.antialias, alpha: b.alpha, depth: b.depth, stencil: b.stencil, framebufferScaleFactor: a }, N = new XRWebGLLayer(o, t, P); o.updateRenderState({ baseLayer: N }); } else { let P = 0; b.depth && (P = b.stencil ? 34041 : 6402); const N = { colorFormat: b.alpha ? 6408 : 6407, depthFormat: P, scaleFactor: a }; h = new XRWebGLBinding(o, t), p = h.createProjectionLayer(N), u = t.createFramebuffer(), o.updateRenderState({ layers: [p] }); } s = await o.requestReferenceSpace(c), I.setContext(o), I.start(), r.isPresenting = !0, r.dispatchEvent({ type: "sessionstart" }); } }; function w(R) { const b = o.inputSources; for (let P = 0; P < g.length; P++) m.set(b[P], g[P]); for (let P = 0; P < R.removed.length; P++) { const N = R.removed[P], D = m.get(N); D && (D.dispatchEvent({ type: "disconnected", data: N }), m.delete(N)); } for (let P = 0; P < R.added.length; P++) { const N = R.added[P], D = m.get(N); D && D.dispatchEvent({ type: "connected", data: N }); } } const A = new Z(), _ = new Z(); function E(R, b, P) { A.setFromMatrixPosition(b.matrixWorld), _.setFromMatrixPosition(P.matrixWorld); const N = A.distanceTo(_), D = b.projectionMatrix.elements, k = P.projectionMatrix.elements, V = D[14] / (D[10] - 1), q = D[14] / (D[10] + 1), Y = (D[9] + 1) / D[5], ne = (D[9] - 1) / D[5], X = (D[8] - 1) / D[0], z = (k[8] + 1) / k[0], H = V * X, ee = V * z, Q = N / (-X + z), J = Q * -X; b.matrixWorld.decompose(R.position, R.quaternion, R.scale), R.translateX(J), R.translateZ(Q), R.matrixWorld.compose(R.position, R.quaternion, R.scale), R.matrixWorldInverse.copy(R.matrixWorld).invert(); const W = V + Q, K = q + Q, ie = H - J, B = ee + (N - J), j = Y * q / K * W, re = ne * q / K * W; R.projectionMatrix.makePerspective(ie, B, j, re, W, K); } function O(R, b) { b === null ? R.matrixWorld.copy(R.matrix) : R.matrixWorld.multiplyMatrices(b.matrixWorld, R.matrix), R.matrixWorldInverse.copy(R.matrixWorld).invert(); } this.updateCamera = function(R) { if (o === null) return; v.near = y.near = d.near = R.near, v.far = y.far = d.far = R.far, (M !== v.near || S !== v.far) && (o.updateRenderState({ depthNear: v.near, depthFar: v.far }), M = v.near, S = v.far); const b = R.parent, P = v.cameras; O(v, b); for (let D = 0; D < P.length; D++) O(P[D], b); v.matrixWorld.decompose(v.position, v.quaternion, v.scale), R.position.copy(v.position), R.quaternion.copy(v.quaternion), R.scale.copy(v.scale), R.matrix.copy(v.matrix), R.matrixWorld.copy(v.matrixWorld); const N = R.children; for (let D = 0, k = N.length; D < k; D++) N[D].updateMatrixWorld(!0); P.length === 2 ? E(v, d, y) : v.projectionMatrix.copy(d.projectionMatrix); }, this.getCamera = function() { return v; }; let L = null; function C(R, b) { if (l = b.getViewerPose(s), l !== null) { const N = l.views, D = o.renderState.baseLayer; o.renderState.layers === void 0 && n.bindXRFramebuffer(D.framebuffer); let k = !1; N.length !== v.cameras.length && (v.cameras.length = 0, k = !0); for (let V = 0; V < N.length; V++) { const q = N[V]; let Y = null; if (o.renderState.layers === void 0) Y = D.getViewport(q); else { const X = h.getViewSubImage(p, q); n.bindXRFramebuffer(u), t.framebufferTexture2D(36160, 36064, 3553, X.colorTexture, 0), X.depthStencilTexture !== void 0 && t.framebufferTexture2D(36160, 36096, 3553, X.depthStencilTexture, 0), Y = X.viewport; } const ne = f[V]; ne.matrix.fromArray(q.transform.matrix), ne.projectionMatrix.fromArray(q.projectionMatrix), ne.viewport.set(Y.x, Y.y, Y.width, Y.height), V === 0 && v.matrix.copy(ne.matrix), k === !0 && v.cameras.push(ne); } } const P = o.inputSources; for (let N = 0; N < g.length; N++) { const D = g[N], k = P[N]; D.update(k, b, s); } L && L(R, b); } const I = new Tx(); I.setAnimationLoop(C), this.setAnimationLoop = function(R) { L = R; }, this.dispose = function() { }; } } function zN(i) { function e(f, v) { f.fogColor.value.copy(v.color), v.isFog ? (f.fogNear.value = v.near, f.fogFar.value = v.far) : v.isFogExp2 && (f.fogDensity.value = v.density); } function t(f, v, M, S, T) { v.isMeshBasicMaterial ? r(f, v) : v.isMeshLambertMaterial ? (r(f, v), c(f, v)) : v.isMeshToonMaterial ? (r(f, v), h(f, v)) : v.isMeshPhongMaterial ? (r(f, v), l(f, v)) : v.isMeshStandardMaterial ? (r(f, v), v.isMeshPhysicalMaterial ? p(f, v, T) : u(f, v)) : v.isMeshMatcapMaterial ? (r(f, v), g(f, v)) : v.isMeshDepthMaterial ? (r(f, v), m(f, v)) : v.isMeshDistanceMaterial ? (r(f, v), d(f, v)) : v.isMeshNormalMaterial ? (r(f, v), y(f, v)) : v.isLineBasicMaterial ? (n(f, v), v.isLineDashedMaterial && o(f, v)) : v.isPointsMaterial ? a(f, v, M, S) : v.isSpriteMaterial ? s(f, v) : v.isShadowMaterial ? (f.color.value.copy(v.color), f.opacity.value = v.opacity) : v.isShaderMaterial && (v.uniformsNeedUpdate = !1); } function r(f, v) { f.opacity.value = v.opacity, v.color && f.diffuse.value.copy(v.color), v.emissive && f.emissive.value.copy(v.emissive).multiplyScalar(v.emissiveIntensity), v.map && (f.map.value = v.map), v.alphaMap && (f.alphaMap.value = v.alphaMap), v.specularMap && (f.specularMap.value = v.specularMap); const M = i.get(v).envMap; if (M) { f.envMap.value = M, f.flipEnvMap.value = M.isCubeTexture && M._needsFlipEnvMap ? -1 : 1, f.reflectivity.value = v.reflectivity, f.refractionRatio.value = v.refractionRatio; const x = i.get(M).__maxMipLevel; x !== void 0 && (f.maxMipLevel.value = x); } v.lightMap && (f.lightMap.value = v.lightMap, f.lightMapIntensity.value = v.lightMapIntensity), v.aoMap && (f.aoMap.value = v.aoMap, f.aoMapIntensity.value = v.aoMapIntensity); let S; v.map ? S = v.map : v.specularMap ? S = v.specularMap : v.displacementMap ? S = v.displacementMap : v.normalMap ? S = v.normalMap : v.bumpMap ? S = v.bumpMap : v.roughnessMap ? S = v.roughnessMap : v.metalnessMap ? S = v.metalnessMap : v.alphaMap ? S = v.alphaMap : v.emissiveMap ? S = v.emissiveMap : v.clearcoatMap ? S = v.clearcoatMap : v.clearcoatNormalMap ? S = v.clearcoatNormalMap : v.clearcoatRoughnessMap && (S = v.clearcoatRoughnessMap), S !== void 0 && (S.isWebGLRenderTarget && (S = S.texture), S.matrixAutoUpdate === !0 && S.updateMatrix(), f.uvTransform.value.copy(S.matrix)); let T; v.aoMap ? T = v.aoMap : v.lightMap && (T = v.lightMap), T !== void 0 && (T.isWebGLRenderTarget && (T = T.texture), T.matrixAutoUpdate === !0 && T.updateMatrix(), f.uv2Transform.value.copy(T.matrix)); } function n(f, v) { f.diffuse.value.copy(v.color), f.opacity.value = v.opacity; } function o(f, v) { f.dashSize.value = v.dashSize, f.totalSize.value = v.dashSize + v.gapSize, f.scale.value = v.scale; } function a(f, v, M, S) { f.diffuse.value.copy(v.color), f.opacity.value = v.opacity, f.size.value = v.size * M, f.scale.value = S * 0.5, v.map && (f.map.value = v.map), v.alphaMap && (f.alphaMap.value = v.alphaMap); let T; v.map ? T = v.map : v.alphaMap && (T = v.alphaMap), T !== void 0 && (T.matrixAutoUpdate === !0 && T.updateMatrix(), f.uvTransform.value.copy(T.matrix)); } function s(f, v) { f.diffuse.value.copy(v.color), f.opacity.value = v.opacity, f.rotation.value = v.rotation, v.map && (f.map.value = v.map), v.alphaMap && (f.alphaMap.value = v.alphaMap); let M; v.map ? M = v.map : v.alphaMap && (M = v.alphaMap), M !== void 0 && (M.matrixAutoUpdate === !0 && M.updateMatrix(), f.uvTransform.value.copy(M.matrix)); } function c(f, v) { v.emissiveMap && (f.emissiveMap.value = v.emissiveMap); } function l(f, v) { f.specular.value.copy(v.specular), f.shininess.value = Math.max(v.shininess, 1e-4), v.emissiveMap && (f.emissiveMap.value = v.emissiveMap), v.bumpMap && (f.bumpMap.value = v.bumpMap, f.bumpScale.value = v.bumpScale, v.side === $t && (f.bumpScale.value *= -1)), v.normalMap && (f.normalMap.value = v.normalMap, f.normalScale.value.copy(v.normalScale), v.side === $t && f.normalScale.value.negate()), v.displacementMap && (f.displacementMap.value = v.displacementMap, f.displacementScale.value = v.displacementScale, f.displacementBias.value = v.displacementBias); } function h(f, v) { v.gradientMap && (f.gradientMap.value = v.gradientMap), v.emissiveMap && (f.emissiveMap.value = v.emissiveMap), v.bumpMap && (f.bumpMap.value = v.bumpMap, f.bumpScale.value = v.bumpScale, v.side === $t && (f.bumpScale.value *= -1)), v.normalMap && (f.normalMap.value = v.normalMap, f.normalScale.value.copy(v.normalScale), v.side === $t && f.normalScale.value.negate()), v.displacementMap && (f.displacementMap.value = v.displacementMap, f.displacementScale.value = v.displacementScale, f.displacementBias.value = v.displacementBias); } function u(f, v) { f.roughness.value = v.roughness, f.metalness.value = v.metalness, v.roughnessMap && (f.roughnessMap.value = v.roughnessMap), v.metalnessMap && (f.metalnessMap.value = v.metalnessMap), v.emissiveMap && (f.emissiveMap.value = v.emissiveMap), v.bumpMap && (f.bumpMap.value = v.bumpMap, f.bumpScale.value = v.bumpScale, v.side === $t && (f.bumpScale.value *= -1)), v.normalMap && (f.normalMap.value = v.normalMap, f.normalScale.value.copy(v.normalScale), v.side === $t && f.normalScale.value.negate()), v.displacementMap && (f.displacementMap.value = v.displacementMap, f.displacementScale.value = v.displacementScale, f.displacementBias.value = v.displacementBias), i.get(v).envMap && (f.envMapIntensity.value = v.envMapIntensity); } function p(f, v, M) { u(f, v), f.reflectivity.value = v.reflectivity, f.clearcoat.value = v.clearcoat, f.clearcoatRoughness.value = v.clearcoatRoughness, v.sheen && f.sheen.value.copy(v.sheen), v.clearcoatMap && (f.clearcoatMap.value = v.clearcoatMap), v.clearcoatRoughnessMap && (f.clearcoatRoughnessMap.value = v.clearcoatRoughnessMap), v.clearcoatNormalMap && (f.clearcoatNormalScale.value.copy(v.clearcoatNormalScale), f.clearcoatNormalMap.value = v.clearcoatNormalMap, v.side === $t && f.clearcoatNormalScale.value.negate()), f.transmission.value = v.transmission, v.transmissionMap && (f.transmissionMap.value = v.transmissionMap), v.transmission > 0 && (f.transmissionSamplerMap.value = M.texture, f.transmissionSamplerSize.value.set(M.width, M.height)), f.thickness.value = v.thickness, v.thicknessMap && (f.thicknessMap.value = v.thicknessMap), f.attenuationDistance.value = v.attenuationDistance, f.attenuationColor.value.copy(v.attenuationColor); } function g(f, v) { v.matcap && (f.matcap.value = v.matcap), v.bumpMap && (f.bumpMap.value = v.bumpMap, f.bumpScale.value = v.bumpScale, v.side === $t && (f.bumpScale.value *= -1)), v.normalMap && (f.normalMap.value = v.normalMap, f.normalScale.value.copy(v.normalScale), v.side === $t && f.normalScale.value.negate()), v.displacementMap && (f.displacementMap.value = v.displacementMap, f.displacementScale.value = v.displacementScale, f.displacementBias.value = v.displacementBias); } function m(f, v) { v.displacementMap && (f.displacementMap.value = v.displacementMap, f.displacementScale.value = v.displacementScale, f.displacementBias.value = v.displacementBias); } function d(f, v) { v.displacementMap && (f.displacementMap.value = v.displacementMap, f.displacementScale.value = v.displacementScale, f.displacementBias.value = v.displacementBias), f.referencePosition.value.copy(v.referencePosition), f.nearDistance.value = v.nearDistance, f.farDistance.value = v.farDistance; } function y(f, v) { v.bumpMap && (f.bumpMap.value = v.bumpMap, f.bumpScale.value = v.bumpScale, v.side === $t && (f.bumpScale.value *= -1)), v.normalMap && (f.normalMap.value = v.normalMap, f.normalScale.value.copy(v.normalScale), v.side === $t && f.normalScale.value.negate()), v.displacementMap && (f.displacementMap.value = v.displacementMap, f.displacementScale.value = v.displacementScale, f.displacementBias.value = v.displacementBias); } return { refreshFogUniforms: e, refreshMaterialUniforms: t }; } function FN() { const i = document.createElementNS("http://www.w3.org/1999/xhtml", "canvas"); return i.style.display = "block", i; } function St(i = {}) { const e = i.canvas !== void 0 ? i.canvas : FN(), t = i.context !== void 0 ? i.context : null, r = i.alpha !== void 0 ? i.alpha : !1, n = i.depth !== void 0 ? i.depth : !0, o = i.stencil !== void 0 ? i.stencil : !0, a = i.antialias !== void 0 ? i.antialias : !1, s = i.premultipliedAlpha !== void 0 ? i.premultipliedAlpha : !0, c = i.preserveDrawingBuffer !== void 0 ? i.preserveDrawingBuffer : !1, l = i.powerPreference !== void 0 ? i.powerPreference : "default", h = i.failIfMajorPerformanceCaveat !== void 0 ? i.failIfMajorPerformanceCaveat : !1; let u = null, p = null; const g = [], m = []; this.domElement = e, this.debug = { /** * Enables error checking and reporting when shader programs are being compiled * @type {boolean} */ checkShaderErrors: !0 }, this.autoClear = !0, this.autoClearColor = !0, this.autoClearDepth = !0, this.autoClearStencil = !0, this.sortObjects = !0, this.clippingPlanes = [], this.localClippingEnabled = !1, this.gammaFactor = 2, this.outputEncoding = Ri, this.physicallyCorrectLights = !1, this.toneMapping = Fn, this.toneMappingExposure = 1; const d = this; let y = !1, f = 0, v = 0, M = null, S = -1, T = null; const x = new Mt(), w = new Mt(); let A = null, _ = e.width, E = e.height, O = 1, L = null, C = null; const I = new Mt(0, 0, _, E), R = new Mt(0, 0, _, E); let b = !1; const P = [], N = new _l(); let D = !1, k = !1, V = null; const q = new $e(), Y = new Z(), ne = { background: null, fog: null, environment: null, overrideMaterial: null, isScene: !0 }; function X() { return M === null ? O : 1; } let z = t; function H($, pe) { for (let de = 0; de < $.length; de++) { const be = $[de], Ce = e.getContext(be, pe); if (Ce !== null) return Ce; } return null; } try { const $ = { alpha: r, depth: n, stencil: o, antialias: a, premultipliedAlpha: s, preserveDrawingBuffer: c, powerPreference: l, failIfMajorPerformanceCaveat: h }; if (e.addEventListener("webglcontextlost", ut, !1), e.addEventListener("webglcontextrestored", mt, !1), z === null) { const pe = ["webgl2", "webgl", "experimental-webgl"]; if (d.isWebGL1Renderer === !0 && pe.shift(), z = H(pe, $), z === null) throw H(pe) ? new Error("Error creating WebGL context with your selected attributes.") : new Error("Error creating WebGL context."); } z.getShaderPrecisionFormat === void 0 && (z.getShaderPrecisionFormat = function() { return { rangeMin: 1, rangeMax: 1, precision: 1 }; }); } catch ($) { throw console.error("THREE.WebGLRenderer: " + $.message), $; } let ee, Q, J, W, K, ie, B, j, re, F, U, se, ue, fe, ve, _e, ae, Te, Ee, oe, Me, ye; function we() { ee = new cD(z), Q = new aD(z, ee, i), ee.init(Q), Me = new Dx(z, ee, Q), J = new DN(z, ee, Q), P[0] = 1029, W = new dD(), K = new MN(), ie = new NN(z, ee, J, K, Q, Me, W), B = new lD(d), j = new NO(z, Q), ye = new nD(z, ee, j, Q), re = new uD(z, j, W, ye), F = new gD(z, re, j, W), Te = new mD(z), ve = new sD(K), U = new _N(d, B, ee, Q, ye, ve), se = new zN(K), ue = new TN(K), fe = new ON(ee, Q), ae = new rD(d, B, J, F, s), _e = new Ix(d, F, Q), Ee = new oD(z, ee, W, Q), oe = new hD(z, ee, W, Q), W.programs = U.programs, d.capabilities = Q, d.extensions = ee, d.properties = K, d.renderLists = ue, d.shadowMap = _e, d.state = J, d.info = W; } we(); const Pe = new kN(d, z); this.xr = Pe, this.getContext = function() { return z; }, this.getContextAttributes = function() { return z.getContextAttributes(); }, this.forceContextLoss = function() { const $ = ee.get("WEBGL_lose_context"); $ && $.loseContext(); }, this.forceContextRestore = function() { const $ = ee.get("WEBGL_lose_context"); $ && $.restoreContext(); }, this.getPixelRatio = function() { return O; }, this.setPixelRatio = function($) { $ !== void 0 && (O = $, this.setSize(_, E, !1)); }, this.getSize = function($) { return $.set(_, E); }, this.setSize = function($, pe, de) { if (Pe.isPresenting) { console.warn("THREE.WebGLRenderer: Can't change size while VR device is presenting."); return; } _ = $, E = pe, e.width = Math.floor($ * O), e.height = Math.floor(pe * O), de !== !1 && (e.style.width = $ + "px", e.style.height = pe + "px"), this.setViewport(0, 0, $, pe); }, this.getDrawingBufferSize = function($) { return $.set(_ * O, E * O).floor(); }, this.setDrawingBufferSize = function($, pe, de) { _ = $, E = pe, O = de, e.width = Math.floor($ * de), e.height = Math.floor(pe * de), this.setViewport(0, 0, $, pe); }, this.getCurrentViewport = function($) { return $.copy(x); }, this.getViewport = function($) { return $.copy(I); }, this.setViewport = function($, pe, de, be) { $.isVector4 ? I.set($.x, $.y, $.z, $.w) : I.set($, pe, de, be), J.viewport(x.copy(I).multiplyScalar(O).floor()); }, this.getScissor = function($) { return $.copy(R); }, this.setScissor = function($, pe, de, be) { $.isVector4 ? R.set($.x, $.y, $.z, $.w) : R.set($, pe, de, be), J.scissor(w.copy(R).multiplyScalar(O).floor()); }, this.getScissorTest = function() { return b; }, this.setScissorTest = function($) { J.setScissorTest(b = $); }, this.setOpaqueSort = function($) { L = $; }, this.setTransparentSort = function($) { C = $; }, this.getClearColor = function($) { return $.copy(ae.getClearColor()); }, this.setClearColor = function() { ae.setClearColor.apply(ae, arguments); }, this.getClearAlpha = function() { return ae.getClearAlpha(); }, this.setClearAlpha = function() { ae.setClearAlpha.apply(ae, arguments); }, this.clear = function($, pe, de) { let be = 0; ($ === void 0 || $) && (be |= 16384), (pe === void 0 || pe) && (be |= 256), (de === void 0 || de) && (be |= 1024), z.clear(be); }, this.clearColor = function() { this.clear(!0, !1, !1); }, this.clearDepth = function() { this.clear(!1, !0, !1); }, this.clearStencil = function() { this.clear(!1, !1, !0); }, this.dispose = function() { e.removeEventListener("webglcontextlost", ut, !1), e.removeEventListener("webglcontextrestored", mt, !1), ue.dispose(), fe.dispose(), K.dispose(), B.dispose(), F.dispose(), ye.dispose(), Pe.dispose(), Pe.removeEventListener("sessionstart", dt), Pe.removeEventListener("sessionend", kt), V && (V.dispose(), V = null), Rt.stop(); }; function ut($) { $.preventDefault(), console.log("THREE.WebGLRenderer: Context Lost."), y = !0; } function mt() { console.log("THREE.WebGLRenderer: Context Restored."), y = !1; const $ = W.autoReset, pe = _e.enabled, de = _e.autoUpdate, be = _e.needsUpdate, Ce = _e.type; we(), W.autoReset = $, _e.enabled = pe, _e.autoUpdate = de, _e.needsUpdate = be, _e.type = Ce; } function Ge($) { const pe = $.target; pe.removeEventListener("dispose", Ge), bt(pe); } function bt($) { ze($), K.remove($); } function ze($) { const pe = K.get($).programs; pe !== void 0 && pe.forEach(function(de) { U.releaseProgram(de); }); } function at($, pe) { $.render(function(de) { d.renderBufferImmediate(de, pe); }); } this.renderBufferImmediate = function($, pe) { ye.initAttributes(); const de = K.get($); $.hasPositions && !de.position && (de.position = z.createBuffer()), $.hasNormals && !de.normal && (de.normal = z.createBuffer()), $.hasUvs && !de.uv && (de.uv = z.createBuffer()), $.hasColors && !de.color && (de.color = z.createBuffer()); const be = pe.getAttributes(); $.hasPositions && (z.bindBuffer(34962, de.position), z.bufferData(34962, $.positionArray, 35048), ye.enableAttribute(be.position), z.vertexAttribPointer(be.position, 3, 5126, !1, 0, 0)), $.hasNormals && (z.bindBuffer(34962, de.normal), z.bufferData(34962, $.normalArray, 35048), ye.enableAttribute(be.normal), z.vertexAttribPointer(be.normal, 3, 5126, !1, 0, 0)), $.hasUvs && (z.bindBuffer(34962, de.uv), z.bufferData(34962, $.uvArray, 35048), ye.enableAttribute(be.uv), z.vertexAttribPointer(be.uv, 2, 5126, !1, 0, 0)), $.hasColors && (z.bindBuffer(34962, de.color), z.bufferData(34962, $.colorArray, 35048), ye.enableAttribute(be.color), z.vertexAttribPointer(be.color, 3, 5126, !1, 0, 0)), ye.disableUnusedAttributes(), z.drawArrays(4, 0, $.count), $.count = 0; }, this.renderBufferDirect = function($, pe, de, be, Ce, he) { pe === null && (pe = ne); const xe = Ce.isMesh && Ce.matrixWorld.determinant() < 0, Ne = De($, pe, be, Ce); J.setMaterial(be, xe); let He = de.index; const Xe = de.attributes.position; if (He === null) { if (Xe === void 0 || Xe.count === 0) return; } else if (He.count === 0) return; let Qe = 1; be.wireframe === !0 && (He = re.getWireframeAttribute(de), Qe = 2), (be.morphTargets || be.morphNormals) && Te.update(Ce, de, be, Ne), ye.setup(Ce, be, Ne, de, He); let Ye, pt = Ee; He !== null && (Ye = j.get(He), pt = oe, pt.setIndex(Ye)); const bi = He !== null ? He.count : Xe.count, hi = de.drawRange.start * Qe, ao = de.drawRange.count * Qe, At = he !== null ? he.start * Qe : 0, so = he !== null ? he.count * Qe : 1 / 0, xi = Math.max(hi, At), J1 = Math.min(bi, hi + ao, At + so) - 1, Dl = Math.max(0, J1 - xi + 1); if (Dl !== 0) { if (Ce.isMesh) be.wireframe === !0 ? (J.setLineWidth(be.wireframeLinewidth * X()), pt.setMode(1)) : pt.setMode(4); else if (Ce.isLine) { let ms = be.linewidth; ms === void 0 && (ms = 1), J.setLineWidth(ms * X()), Ce.isLineSegments ? pt.setMode(1) : Ce.isLineLoop ? pt.setMode(2) : pt.setMode(3); } else Ce.isPoints ? pt.setMode(0) : Ce.isSprite && pt.setMode(4); if (Ce.isInstancedMesh) pt.renderInstances(xi, Dl, Ce.count); else if (de.isInstancedBufferGeometry) { const ms = Math.min(de.instanceCount, de._maxInstanceCount); pt.renderInstances(xi, Dl, ms); } else pt.render(xi, Dl); } }, this.compile = function($, pe) { p = fe.get($), p.init(), $.traverseVisible(function(de) { de.isLight && de.layers.test(pe.layers) && (p.pushLight(de), de.castShadow && p.pushShadow(de)); }), p.setupLights(), $.traverse(function(de) { const be = de.material; if (be) if (Array.isArray(be)) for (let Ce = 0; Ce < be.length; Ce++) { const he = be[Ce]; te(he, $, de); } else te(be, $, de); }); }; let et = null; function yt($) { et && et($); } function dt() { Rt.stop(); } function kt() { Rt.start(); } const Rt = new Tx(); Rt.setAnimationLoop(yt), typeof window < "u" && Rt.setContext(window), this.setAnimationLoop = function($) { et = $, Pe.setAnimationLoop($), $ === null ? Rt.stop() : Rt.start(); }, Pe.addEventListener("sessionstart", dt), Pe.addEventListener("sessionend", kt), this.render = function($, pe) { if (pe !== void 0 && pe.isCamera !== !0) { console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera."); return; } if (y === !0) return; $.autoUpdate === !0 && $.updateMatrixWorld(), pe.parent === null && pe.updateMatrixWorld(), Pe.enabled === !0 && Pe.isPresenting === !0 && (Pe.cameraAutoUpdate === !0 && Pe.updateCamera(pe), pe = Pe.getCamera()), $.isScene === !0 && $.onBeforeRender(d, $, pe, M), p = fe.get($, m.length), p.init(), m.push(p), q.multiplyMatrices(pe.projectionMatrix, pe.matrixWorldInverse), N.setFromProjectionMatrix(q), k = this.localClippingEnabled, D = ve.init(this.clippingPlanes, k, pe), u = ue.get($, g.length), u.init(), g.push(u), Ii($, pe, 0, d.sortObjects), u.finish(), d.sortObjects === !0 && u.sort(L, C), D === !0 && ve.beginShadows(); const de = p.state.shadowsArray; _e.render(de, $, pe), p.setupLights(), p.setupLightsView(pe), D === !0 && ve.endShadows(), this.info.autoReset === !0 && this.info.reset(), ae.render(u, $); const be = u.opaque, Ce = u.transmissive, he = u.transparent; be.length > 0 && sr(be, $, pe), Ce.length > 0 && Ui(be, Ce, $, pe), he.length > 0 && sr(he, $, pe), M !== null && (ie.updateMultisampleRenderTarget(M), ie.updateRenderTargetMipmap(M)), $.isScene === !0 && $.onAfterRender(d, $, pe), J.buffers.depth.setTest(!0), J.buffers.depth.setMask(!0), J.buffers.color.setMask(!0), J.setPolygonOffset(!1), ye.resetDefaultState(), S = -1, T = null, m.pop(), m.length > 0 ? p = m[m.length - 1] : p = null, g.pop(), g.length > 0 ? u = g[g.length - 1] : u = null; }; function Ii($, pe, de, be) { if ($.visible === !1) return; if ($.layers.test(pe.layers)) { if ($.isGroup) de = $.renderOrder; else if ($.isLOD) $.autoUpdate === !0 && $.update(pe); else if ($.isLight) p.pushLight($), $.castShadow && p.pushShadow($); else if ($.isSprite) { if (!$.frustumCulled || N.intersectsSprite($)) { be && Y.setFromMatrixPosition($.matrixWorld).applyMatrix4(q); const he = F.update($), xe = $.material; xe.visible && u.push($, he, xe, de, Y.z, null); } } else if ($.isImmediateRenderObject) be && Y.setFromMatrixPosition($.matrixWorld).applyMatrix4(q), u.push($, null, $.material, de, Y.z, null); else if (($.isMesh || $.isLine || $.isPoints) && ($.isSkinnedMesh && $.skeleton.frame !== W.render.frame && ($.skeleton.update(), $.skeleton.frame = W.render.frame), !$.frustumCulled || N.intersectsObject($))) { be && Y.setFromMatrixPosition($.matrixWorld).applyMatrix4(q); const he = F.update($), xe = $.material; if (Array.isArray(xe)) { const Ne = he.groups; for (let He = 0, Xe = Ne.length; He < Xe; He++) { const Qe = Ne[He], Ye = xe[Qe.materialIndex]; Ye && Ye.visible && u.push($, he, Ye, de, Y.z, Qe); } } else xe.visible && u.push($, he, xe, de, Y.z, null); } } const Ce = $.children; for (let he = 0, xe = Ce.length; he < xe; he++) Ii(Ce[he], pe, de, be); } function Ui($, pe, de, be) { if (V === null) { const xe = a === !0 && Q.isWebGL2 === !0 ? Xp : vr; V = new xe(1024, 1024, { generateMipmaps: !0, type: Me.convert(Eo) !== null ? Eo : Po, minFilter: yn, magFilter: qt, wrapS: li, wrapT: li }); } const Ce = d.getRenderTarget(); d.setRenderTarget(V), d.clear(); const he = d.toneMapping; d.toneMapping = Fn, sr($, de, be), d.toneMapping = he, ie.updateMultisampleRenderTarget(V), ie.updateRenderTargetMipmap(V), d.setRenderTarget(Ce), sr(pe, de, be); } function sr($, pe, de) { const be = pe.isScene === !0 ? pe.overrideMaterial : null; for (let Ce = 0, he = $.length; Ce < he; Ce++) { const xe = $[Ce], Ne = xe.object, He = xe.geometry, Xe = be === null ? xe.material : be, Qe = xe.group; if (de.isArrayCamera) { const Ye = de.cameras; for (let pt = 0, bi = Ye.length; pt < bi; pt++) { const hi = Ye[pt]; Ne.layers.test(hi.layers) && (J.viewport(x.copy(hi.viewport)), p.setupLightsView(hi), oo(Ne, pe, hi, He, Xe, Qe)); } } else oo(Ne, pe, de, He, Xe, Qe); } } function oo($, pe, de, be, Ce, he) { if ($.onBeforeRender(d, pe, de, be, Ce, he), $.modelViewMatrix.multiplyMatrices(de.matrixWorldInverse, $.matrixWorld), $.normalMatrix.getNormalMatrix($.modelViewMatrix), $.isImmediateRenderObject) { const xe = De(de, pe, Ce, $); J.setMaterial(Ce), ye.reset(), at($, xe); } else Ce.transparent === !0 && Ce.side === Xn ? (Ce.side = $t, Ce.needsUpdate = !0, d.renderBufferDirect(de, pe, be, Ce, $, he), Ce.side = qn, Ce.needsUpdate = !0, d.renderBufferDirect(de, pe, be, Ce, $, he), Ce.side = Xn) : d.renderBufferDirect(de, pe, be, Ce, $, he); $.onAfterRender(d, pe, de, be, Ce, he); } function te($, pe, de) { pe.isScene !== !0 && (pe = ne); const be = K.get($), Ce = p.state.lights, he = p.state.shadowsArray, xe = Ce.state.version, Ne = U.getParameters($, Ce.state, he, pe, de), He = U.getProgramCacheKey(Ne); let Xe = be.programs; be.environment = $.isMeshStandardMaterial ? pe.environment : null, be.fog = pe.fog, be.envMap = B.get($.envMap || be.environment), Xe === void 0 && ($.addEventListener("dispose", Ge), Xe = /* @__PURE__ */ new Map(), be.programs = Xe); let Qe = Xe.get(He); if (Qe !== void 0) { if (be.currentProgram === Qe && be.lightsStateVersion === xe) return Se($, Ne), Qe; } else Ne.uniforms = U.getUniforms($), $.onBuild(Ne, d), $.onBeforeCompile(Ne, d), Qe = U.acquireProgram(Ne, He), Xe.set(He, Qe), be.uniforms = Ne.uniforms; const Ye = be.uniforms; (!$.isShaderMaterial && !$.isRawShaderMaterial || $.clipping === !0) && (Ye.clippingPlanes = ve.uniform), Se($, Ne), be.needsLights = st($), be.lightsStateVersion = xe, be.needsLights && (Ye.ambientLightColor.value = Ce.state.ambient, Ye.lightProbe.value = Ce.state.probe, Ye.directionalLights.value = Ce.state.directional, Ye.directionalLightShadows.value = Ce.state.directionalShadow, Ye.spotLights.value = Ce.state.spot, Ye.spotLightShadows.value = Ce.state.spotShadow, Ye.rectAreaLights.value = Ce.state.rectArea, Ye.ltc_1.value = Ce.state.rectAreaLTC1, Ye.ltc_2.value = Ce.state.rectAreaLTC2, Ye.pointLights.value = Ce.state.point, Ye.pointLightShadows.value = Ce.state.pointShadow, Ye.hemisphereLights.value = Ce.state.hemi, Ye.directionalShadowMap.value = Ce.state.directionalShadowMap, Ye.directionalShadowMatrix.value = Ce.state.directionalShadowMatrix, Ye.spotShadowMap.value = Ce.state.spotShadowMap, Ye.spotShadowMatrix.value = Ce.state.spotShadowMatrix, Ye.pointShadowMap.value = Ce.state.pointShadowMap, Ye.pointShadowMatrix.value = Ce.state.pointShadowMatrix); const pt = Qe.getUniforms(), bi = Vn.seqWithValue(pt.seq, Ye); return be.currentProgram = Qe, be.uniformsList = bi, Qe; } function Se($, pe) { const de = K.get($); de.outputEncoding = pe.outputEncoding, de.instancing = pe.instancing, de.skinning = pe.skinning, de.numClippingPlanes = pe.numClippingPlanes, de.numIntersection = pe.numClipIntersection, de.vertexAlphas = pe.vertexAlphas; } function De($, pe, de, be) { pe.isScene !== !0 && (pe = ne), ie.resetTextureUnits(); const Ce = pe.fog, he = de.isMeshStandardMaterial ? pe.environment : null, xe = M === null ? d.outputEncoding : M.texture.encoding, Ne = B.get(de.envMap || he), He = de.vertexColors === !0 && be.geometry && be.geometry.attributes.color && be.geometry.attributes.color.itemSize === 4, Xe = K.get(de), Qe = p.state.lights; if (D === !0 && (k === !0 || $ !== T)) { const xi = $ === T && de.id === S; ve.setState(de, $, xi); } let Ye = !1; de.version === Xe.__version ? (Xe.needsLights && Xe.lightsStateVersion !== Qe.state.version || Xe.outputEncoding !== xe || be.isInstancedMesh && Xe.instancing === !1 || !be.isInstancedMesh && Xe.instancing === !0 || be.isSkinnedMesh && Xe.skinning === !1 || !be.isSkinnedMesh && Xe.skinning === !0 || Xe.envMap !== Ne || de.fog && Xe.fog !== Ce || Xe.numClippingPlanes !== void 0 && (Xe.numClippingPlanes !== ve.numPlanes || Xe.numIntersection !== ve.numIntersection) || Xe.vertexAlphas !== He) && (Ye = !0) : (Ye = !0, Xe.__version = de.version); let pt = Xe.currentProgram; Ye === !0 && (pt = te(de, pe, be)); let bi = !1, hi = !1, ao = !1; const At = pt.getUniforms(), so = Xe.uniforms; if (J.useProgram(pt.program) && (bi = !0, hi = !0, ao = !0), de.id !== S && (S = de.id, hi = !0), bi || T !== $) { if (At.setValue(z, "projectionMatrix", $.projectionMatrix), Q.logarithmicDepthBuffer && At.setValue( z, "logDepthBufFC", 2 / (Math.log($.far + 1) / Math.LN2) ), T !== $ && (T = $, hi = !0, ao = !0), de.isShaderMaterial || de.isMeshPhongMaterial || de.isMeshToonMaterial || de.isMeshStandardMaterial || de.envMap) { const xi = At.map.cameraPosition; xi !== void 0 && xi.setValue( z, Y.setFromMatrixPosition($.matrixWorld) ); } (de.isMeshPhongMaterial || de.isMeshToonMaterial || de.isMeshLambertMaterial || de.isMeshBasicMaterial || de.isMeshStandardMaterial || de.isShaderMaterial) && At.setValue(z, "isOrthographic", $.isOrthographicCamera === !0), (de.isMeshPhongMaterial || de.isMeshToonMaterial || de.isMeshLambertMaterial || de.isMeshBasicMaterial || de.isMeshStandardMaterial || de.isShaderMaterial || de.isShadowMaterial || be.isSkinnedMesh) && At.setValue(z, "viewMatrix", $.matrixWorldInverse); } if (be.isSkinnedMesh) { At.setOptional(z, be, "bindMatrix"), At.setOptional(z, be, "bindMatrixInverse"); const xi = be.skeleton; xi && (Q.floatVertexTextures ? (xi.boneTexture === null && xi.computeBoneTexture(), At.setValue(z, "boneTexture", xi.boneTexture, ie), At.setValue(z, "boneTextureSize", xi.boneTextureSize)) : At.setOptional(z, xi, "boneMatrices")); } return (hi || Xe.receiveShadow !== be.receiveShadow) && (Xe.receiveShadow = be.receiveShadow, At.setValue(z, "receiveShadow", be.receiveShadow)), hi && (At.setValue(z, "toneMappingExposure", d.toneMappingExposure), Xe.needsLights && We(so, ao), Ce && de.fog && se.refreshFogUniforms(so, Ce), se.refreshMaterialUniforms(so, de, O, E, V), Vn.upload(z, Xe.uniformsList, so, ie)), de.isShaderMaterial && de.uniformsNeedUpdate === !0 && (Vn.upload(z, Xe.uniformsList, so, ie), de.uniformsNeedUpdate = !1), de.isSpriteMaterial && At.setValue(z, "center", be.center), At.setValue(z, "modelViewMatrix", be.modelViewMatrix), At.setValue(z, "normalMatrix", be.normalMatrix), At.setValue(z, "modelMatrix", be.matrixWorld), pt; } function We($, pe) { $.ambientLightColor.needsUpdate = pe, $.lightProbe.needsUpdate = pe, $.directionalLights.needsUpdate = pe, $.directionalLightShadows.needsUpdate = pe, $.pointLights.needsUpdate = pe, $.pointLightShadows.needsUpdate = pe, $.spotLights.needsUpdate = pe, $.spotLightShadows.needsUpdate = pe, $.rectAreaLights.needsUpdate = pe, $.hemisphereLights.needsUpdate = pe; } function st($) { return $.isMeshLambertMaterial || $.isMeshToonMaterial || $.isMeshPhongMaterial || $.isMeshStandardMaterial || $.isShadowMaterial || $.isShaderMaterial && $.lights === !0; } this.getActiveCubeFace = function() { return f; }, this.getActiveMipmapLevel = function() { return v; }, this.getRenderTarget = function() { return M; }, this.setRenderTarget = function($, pe = 0, de = 0) { M = $, f = pe, v = de, $ && K.get($).__webglFramebuffer === void 0 && ie.setupRenderTarget($); let be = null, Ce = !1, he = !1; if ($) { const xe = $.texture; (xe.isDataTexture3D || xe.isDataTexture2DArray) && (he = !0); const Ne = K.get($).__webglFramebuffer; $.isWebGLCubeRenderTarget ? (be = Ne[pe], Ce = !0) : $.isWebGLMultisampleRenderTarget ? be = K.get($).__webglMultisampledFramebuffer : be = Ne, x.copy($.viewport), w.copy($.scissor), A = $.scissorTest; } else x.copy(I).multiplyScalar(O).floor(), w.copy(R).multiplyScalar(O).floor(), A = b; if (J.bindFramebuffer(36160, be) && Q.drawBuffers) { let xe = !1; if ($) if ($.isWebGLMultipleRenderTargets) { const Ne = $.texture; if (P.length !== Ne.length || P[0] !== 36064) { for (let He = 0, Xe = Ne.length; He < Xe; He++) P[He] = 36064 + He; P.length = Ne.length, xe = !0; } } else (P.length !== 1 || P[0] !== 36064) && (P[0] = 36064, P.length = 1, xe = !0); else (P.length !== 1 || P[0] !== 1029) && (P[0] = 1029, P.length = 1, xe = !0); xe && (Q.isWebGL2 ? z.drawBuffers(P) : ee.get("WEBGL_draw_buffers").drawBuffersWEBGL(P)); } if (J.viewport(x), J.scissor(w), J.setScissorTest(A), Ce) { const xe = K.get($.texture); z.framebufferTexture2D(36160, 36064, 34069 + pe, xe.__webglTexture, de); } else if (he) { const xe = K.get($.texture), Ne = pe || 0; z.framebufferTextureLayer(36160, 36064, xe.__webglTexture, de || 0, Ne); } }, this.readRenderTargetPixels = function($, pe, de, be, Ce, he, xe) { if (!($ && $.isWebGLRenderTarget)) { console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget."); return; } let Ne = K.get($).__webglFramebuffer; if ($.isWebGLCubeRenderTarget && xe !== void 0 && (Ne = Ne[xe]), Ne) { J.bindFramebuffer(36160, Ne); try { const He = $.texture, Xe = He.format, Qe = He.type; if (Xe !== $i && Me.convert(Xe) !== z.getParameter(35739)) { console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format."); return; } const Ye = Qe === Eo && (ee.has("EXT_color_buffer_half_float") || Q.isWebGL2 && ee.has("EXT_color_buffer_float")); if (Qe !== Po && Me.convert(Qe) !== z.getParameter(35738) && // Edge and Chrome Mac < 52 (#9513) !(Qe === en && (Q.isWebGL2 || ee.has("OES_texture_float") || ee.has("WEBGL_color_buffer_float"))) && // Chrome Mac >= 52 and Firefox !Ye) { console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type."); return; } z.checkFramebufferStatus(36160) === 36053 ? pe >= 0 && pe <= $.width - be && de >= 0 && de <= $.height - Ce && z.readPixels(pe, de, be, Ce, Me.convert(Xe), Me.convert(Qe), he) : console.error("THREE.WebGLRenderer.readRenderTargetPixels: readPixels from renderTarget failed. Framebuffer not complete."); } finally { const He = M !== null ? K.get(M).__webglFramebuffer : null; J.bindFramebuffer(36160, He); } } }, this.copyFramebufferToTexture = function($, pe, de = 0) { const be = Math.pow(2, -de), Ce = Math.floor(pe.image.width * be), he = Math.floor(pe.image.height * be); let xe = Me.convert(pe.format); Q.isWebGL2 && (xe === 6407 && (xe = 32849), xe === 6408 && (xe = 32856)), ie.setTexture2D(pe, 0), z.copyTexImage2D(3553, de, xe, $.x, $.y, Ce, he, 0), J.unbindTexture(); }, this.copyTextureToTexture = function($, pe, de, be = 0) { const Ce = pe.image.width, he = pe.image.height, xe = Me.convert(de.format), Ne = Me.convert(de.type); ie.setTexture2D(de, 0), z.pixelStorei(37440, de.flipY), z.pixelStorei(37441, de.premultiplyAlpha), z.pixelStorei(3317, de.unpackAlignment), pe.isDataTexture ? z.texSubImage2D(3553, be, $.x, $.y, Ce, he, xe, Ne, pe.image.data) : pe.isCompressedTexture ? z.compressedTexSubImage2D(3553, be, $.x, $.y, pe.mipmaps[0].width, pe.mipmaps[0].height, xe, pe.mipmaps[0].data) : z.texSubImage2D(3553, be, $.x, $.y, xe, Ne, pe.image), be === 0 && de.generateMipmaps && z.generateMipmap(3553), J.unbindTexture(); }, this.copyTextureToTexture3D = function($, pe, de, be, Ce = 0) { if (d.isWebGL1Renderer) { console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: can only be used with WebGL2."); return; } const he = $.max.x - $.min.x + 1, xe = $.max.y - $.min.y + 1, Ne = $.max.z - $.min.z + 1, He = Me.convert(be.format), Xe = Me.convert(be.type); let Qe; if (be.isDataTexture3D) ie.setTexture3D(be, 0), Qe = 32879; else if (be.isDataTexture2DArray) ie.setTexture2DArray(be, 0), Qe = 35866; else { console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: only supports THREE.DataTexture3D and THREE.DataTexture2DArray."); return; } z.pixelStorei(37440, be.flipY), z.pixelStorei(37441, be.premultiplyAlpha), z.pixelStorei(3317, be.unpackAlignment); const Ye = z.getParameter(3314), pt = z.getParameter(32878), bi = z.getParameter(3316), hi = z.getParameter(3315), ao = z.getParameter(32877), At = de.isCompressedTexture ? de.mipmaps[0] : de.image; z.pixelStorei(3314, At.width), z.pixelStorei(32878, At.height), z.pixelStorei(3316, $.min.x), z.pixelStorei(3315, $.min.y), z.pixelStorei(32877, $.min.z), de.isDataTexture || de.isDataTexture3D ? z.texSubImage3D(Qe, Ce, pe.x, pe.y, pe.z, he, xe, Ne, He, Xe, At.data) : de.isCompressedTexture ? (console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: untested support for compressed srcTexture."), z.compressedTexSubImage3D(Qe, Ce, pe.x, pe.y, pe.z, he, xe, Ne, He, At.data)) : z.texSubImage3D(Qe, Ce, pe.x, pe.y, pe.z, he, xe, Ne, He, Xe, At), z.pixelStorei(3314, Ye), z.pixelStorei(32878, pt), z.pixelStorei(3316, bi), z.pixelStorei(3315, hi), z.pixelStorei(32877, ao), Ce === 0 && be.generateMipmaps && z.generateMipmap(Qe), J.unbindTexture(); }, this.initTexture = function($) { ie.setTexture2D($, 0), J.unbindTexture(); }, this.resetState = function() { f = 0, v = 0, M = null, J.reset(), ye.reset(); }, typeof __THREE_DEVTOOLS__ < "u" && __THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe", { detail: this })); } class Nx extends St { } Nx.prototype.isWebGL1Renderer = !0; class Ml { constructor(e, t = 25e-5) { this.name = "", this.color = new Be(e), this.density = t; } clone() { return new Ml(this.color, this.density); } toJSON() { return { type: "FogExp2", color: this.color.getHex(), density: this.density }; } } Ml.prototype.isFogExp2 = !0; class Sl { constructor(e, t = 1, r = 1e3) { this.name = "", this.color = new Be(e), this.near = t, this.far = r; } clone() { return new Sl(this.color, this.near, this.far); } toJSON() { return { type: "Fog", color: this.color.getHex(), near: this.near, far: this.far }; } } Sl.prototype.isFog = !0; class Nu extends nt { constructor() { super(), this.type = "Scene", this.background = null, this.environment = null, this.fog = null, this.overrideMaterial = null, this.autoUpdate = !0, 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()), e.overrideMaterial !== null && (this.overrideMaterial = e.overrideMaterial.clone()), this.autoUpdate = e.autoUpdate, this.matrixAutoUpdate = e.matrixAutoUpdate, this; } toJSON(e) { const t = super.toJSON(e); return this.fog !== null && (t.object.fog = this.fog.toJSON()), t; } } Nu.prototype.isScene = !0; class ro { constructor(e, t) { this.array = e, this.stride = t, this.count = e !== void 0 ? e.length / t : 0, this.usage = za, this.updateRange = { offset: 0, count: -1 }, this.version = 0, this.uuid = qi(); } onUploadCallback() { } set needsUpdate(e) { e === !0 && this.version++; } setUsage(e) { return this.usage = e, this; } 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, r) { e *= this.stride, r *= t.stride; for (let n = 0, o = this.stride; n < o; n++) this.array[e + n] = t.array[r + n]; 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 = qi()), 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]), r = new this.constructor(t, this.stride); return r.setUsage(this.usage), r; } 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 = qi()), e.arrayBuffers[this.array.buffer._uuid] === void 0 && (e.arrayBuffers[this.array.buffer._uuid] = Array.prototype.slice.call(new Uint32Array(this.array.buffer))), { uuid: this.uuid, buffer: this.array.buffer._uuid, type: this.array.constructor.name, stride: this.stride }; } } ro.prototype.isInterleavedBuffer = !0; const Ht = /* @__PURE__ */ new Z(); class dn { constructor(e, t, r, n = !1) { this.name = "", this.data = e, this.itemSize = t, this.offset = r, this.normalized = n === !0; } 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, r = this.data.count; t < r; t++) Ht.x = this.getX(t), Ht.y = this.getY(t), Ht.z = this.getZ(t), Ht.applyMatrix4(e), this.setXYZ(t, Ht.x, Ht.y, Ht.z); return this; } applyNormalMatrix(e) { for (let t = 0, r = this.count; t < r; t++) Ht.x = this.getX(t), Ht.y = this.getY(t), Ht.z = this.getZ(t), Ht.applyNormalMatrix(e), this.setXYZ(t, Ht.x, Ht.y, Ht.z); return this; } transformDirection(e) { for (let t = 0, r = this.count; t < r; t++) Ht.x = this.getX(t), Ht.y = this.getY(t), Ht.z = this.getZ(t), Ht.transformDirection(e), this.setXYZ(t, Ht.x, Ht.y, Ht.z); return this; } setX(e, t) { return this.data.array[e * this.data.stride + this.offset] = t, this; } setY(e, t) { return this.data.array[e * this.data.stride + this.offset + 1] = t, this; } setZ(e, t) { return this.data.array[e * this.data.stride + this.offset + 2] = t, this; } setW(e, t) { return this.data.array[e * this.data.stride + this.offset + 3] = t, this; } getX(e) { return this.data.array[e * this.data.stride + this.offset]; } getY(e) { return this.data.array[e * this.data.stride + this.offset + 1]; } getZ(e) { return this.data.array[e * this.data.stride + this.offset + 2]; } getW(e) { return this.data.array[e * this.data.stride + this.offset + 3]; } setXY(e, t, r) { return e = e * this.data.stride + this.offset, this.data.array[e + 0] = t, this.data.array[e + 1] = r, this; } setXYZ(e, t, r, n) { return e = e * this.data.stride + this.offset, this.data.array[e + 0] = t, this.data.array[e + 1] = r, this.data.array[e + 2] = n, this; } setXYZW(e, t, r, n, o) { return e = e * this.data.stride + this.offset, this.data.array[e + 0] = t, this.data.array[e + 1] = r, this.data.array[e + 2] = n, this.data.array[e + 3] = o, this; } clone(e) { if (e === void 0) { console.log("THREE.InterleavedBufferAttribute.clone(): Cloning an interlaved buffer attribute will deinterleave buffer data."); const t = []; for (let r = 0; r < this.count; r++) { const n = r * this.data.stride + this.offset; for (let o = 0; o < this.itemSize; o++) t.push(this.data.array[n + o]); } return new tt(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 dn(e.interleavedBuffers[this.data.uuid], this.itemSize, this.offset, this.normalized); } toJSON(e) { if (e === void 0) { console.log("THREE.InterleavedBufferAttribute.toJSON(): Serializing an interlaved buffer attribute will deinterleave buffer data."); const t = []; for (let r = 0; r < this.count; r++) { const n = r * this.data.stride + this.offset; for (let o = 0; o < this.itemSize; o++) t.push(this.data.array[n + o]); } 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 }; } } dn.prototype.isInterleavedBufferAttribute = !0; class Tl extends Qt { constructor(e) { super(), this.type = "SpriteMaterial", this.color = new Be(16777215), this.map = null, this.alphaMap = null, this.rotation = 0, this.sizeAttenuation = !0, this.transparent = !0, this.setValues(e); } copy(e) { return super.copy(e), this.color.copy(e.color), this.map = e.map, this.alphaMap = e.alphaMap, this.rotation = e.rotation, this.sizeAttenuation = e.sizeAttenuation, this; } } Tl.prototype.isSpriteMaterial = !0; let ha; const Ss = /* @__PURE__ */ new Z(), da = /* @__PURE__ */ new Z(), pa = /* @__PURE__ */ new Z(), fa = /* @__PURE__ */ new Oe(), Ts = /* @__PURE__ */ new Oe(), Bx = /* @__PURE__ */ new $e(), sc = /* @__PURE__ */ new Z(), Es = /* @__PURE__ */ new Z(), lc = /* @__PURE__ */ new Z(), zg = /* @__PURE__ */ new Oe(), Oh = /* @__PURE__ */ new Oe(), Fg = /* @__PURE__ */ new Oe(); class El extends nt { constructor(e) { if (super(), this.type = "Sprite", ha === void 0) { ha = new Je(); const t = new Float32Array([ -0.5, -0.5, 0, 0, 0, 0.5, -0.5, 0, 1, 0, 0.5, 0.5, 0, 1, 1, -0.5, 0.5, 0, 0, 1 ]), r = new ro(t, 5); ha.setIndex([0, 1, 2, 0, 2, 3]), ha.setAttribute("position", new dn(r, 3, 0, !1)), ha.setAttribute("uv", new dn(r, 2, 3, !1)); } this.geometry = ha, this.material = e !== void 0 ? e : new Tl(), this.center = new Oe(0.5, 0.5); } raycast(e, t) { e.camera === null && console.error('THREE.Sprite: "Raycaster.camera" needs to be set in order to raycast against sprites.'), da.setFromMatrixScale(this.matrixWorld), Bx.copy(e.camera.matrixWorld), this.modelViewMatrix.multiplyMatrices(e.camera.matrixWorldInverse, this.matrixWorld), pa.setFromMatrixPosition(this.modelViewMatrix), e.camera.isPerspectiveCamera && this.material.sizeAttenuation === !1 && da.multiplyScalar(-pa.z); const r = this.material.rotation; let n, o; r !== 0 && (o = Math.cos(r), n = Math.sin(r)); const a = this.center; cc(sc.set(-0.5, -0.5, 0), pa, a, da, n, o), cc(Es.set(0.5, -0.5, 0), pa, a, da, n, o), cc(lc.set(0.5, 0.5, 0), pa, a, da, n, o), zg.set(0, 0), Oh.set(1, 0), Fg.set(1, 1); let s = e.ray.intersectTriangle(sc, Es, lc, !1, Ss); if (s === null && (cc(Es.set(-0.5, 0.5, 0), pa, a, da, n, o), Oh.set(0, 1), s = e.ray.intersectTriangle(sc, lc, Es, !1, Ss), s === null)) return; const c = e.ray.origin.distanceTo(Ss); c < e.near || c > e.far || t.push({ distance: c, point: Ss.clone(), uv: Xt.getUV(Ss, sc, Es, lc, zg, Oh, Fg, new Oe()), face: null, object: this }); } copy(e) { return super.copy(e), e.center !== void 0 && this.center.copy(e.center), this.material = e.material, this; } } El.prototype.isSprite = !0; function cc(i, e, t, r, n, o) { fa.subVectors(i, t).addScalar(0.5).multiply(r), n !== void 0 ? (Ts.x = o * fa.x - n * fa.y, Ts.y = n * fa.x + o * fa.y) : Ts.copy(fa), i.copy(e), i.x += Ts.x, i.y += Ts.y, i.applyMatrix4(Bx); } const uc = /* @__PURE__ */ new Z(), Vg = /* @__PURE__ */ new Z(); class kx extends nt { constructor() { super(), this._currentLevel = 0, this.type = "LOD", Object.defineProperties(this, { levels: { enumerable: !0, value: [] }, isLOD: { value: !0 } }), this.autoUpdate = !0; } copy(e) { super.copy(e, !1); const t = e.levels; for (let r = 0, n = t.length; r < n; r++) { const o = t[r]; this.addLevel(o.object.clone(), o.distance); } return this.autoUpdate = e.autoUpdate, this; } addLevel(e, t = 0) { t = Math.abs(t); const r = this.levels; let n; for (n = 0; n < r.length && !(t < r[n].distance); n++) ; return r.splice(n, 0, { distance: t, object: e }), this.add(e), this; } getCurrentLevel() { return this._currentLevel; } getObjectForDistance(e) { const t = this.levels; if (t.length > 0) { let r, n; for (r = 1, n = t.length; r < n && !(e < t[r].distance); r++) ; return t[r - 1].object; } return null; } raycast(e, t) { if (this.levels.length > 0) { uc.setFromMatrixPosition(this.matrixWorld); const r = e.ray.origin.distanceTo(uc); this.getObjectForDistance(r).raycast(e, t); } } update(e) { const t = this.levels; if (t.length > 1) { uc.setFromMatrixPosition(e.matrixWorld), Vg.setFromMatrixPosition(this.matrixWorld); const r = uc.distanceTo(Vg) / e.zoom; t[0].object.visible = !0; let n, o; for (n = 1, o = t.length; n < o && r >= t[n].distance; n++) t[n - 1].object.visible = !1, t[n].object.visible = !0; for (this._currentLevel = n - 1; n < o; n++) t[n].object.visible = !1; } } toJSON(e) { const t = super.toJSON(e); this.autoUpdate === !1 && (t.object.autoUpdate = !1), t.object.levels = []; const r = this.levels; for (let n = 0, o = r.length; n < o; n++) { const a = r[n]; t.object.levels.push({ object: a.object.uuid, distance: a.distance }); } return t; } } const Ug = /* @__PURE__ */ new Z(), Gg = /* @__PURE__ */ new Mt(), Hg = /* @__PURE__ */ new Mt(), VN = /* @__PURE__ */ new Z(), jg = /* @__PURE__ */ new $e(); class Al extends Yt { constructor(e, t) { super(e, t), this.type = "SkinnedMesh", this.bindMode = "attached", this.bindMatrix = new $e(), this.bindMatrixInverse = new $e(); } copy(e) { return super.copy(e), this.bindMode = e.bindMode, this.bindMatrix.copy(e.bindMatrix), this.bindMatrixInverse.copy(e.bindMatrixInverse), this.skeleton = e.skeleton, this; } 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 r = 0, n = t.count; r < n; r++) { e.x = t.getX(r), e.y = t.getY(r), e.z = t.getZ(r), e.w = t.getW(r); const o = 1 / e.manhattanLength(); o !== 1 / 0 ? e.multiplyScalar(o) : e.set(1, 0, 0, 0), t.setXYZW(r, e.x, e.y, e.z, e.w); } } updateMatrixWorld(e) { super.updateMatrixWorld(e), this.bindMode === "attached" ? this.bindMatrixInverse.copy(this.matrixWorld).invert() : this.bindMode === "detached" ? this.bindMatrixInverse.copy(this.bindMatrix).invert() : console.warn("THREE.SkinnedMesh: Unrecognized bindMode: " + this.bindMode); } boneTransform(e, t) { const r = this.skeleton, n = this.geometry; Gg.fromBufferAttribute(n.attributes.skinIndex, e), Hg.fromBufferAttribute(n.attributes.skinWeight, e), Ug.fromBufferAttribute(n.attributes.position, e).applyMatrix4(this.bindMatrix), t.set(0, 0, 0); for (let o = 0; o < 4; o++) { const a = Hg.getComponent(o); if (a !== 0) { const s = Gg.getComponent(o); jg.multiplyMatrices(r.bones[s].matrixWorld, r.boneInverses[s]), t.addScaledVector(VN.copy(Ug).applyMatrix4(jg), a); } } return t.applyMatrix4(this.bindMatrixInverse); } } Al.prototype.isSkinnedMesh = !0; class Cl extends nt { constructor() { super(), this.type = "Bone"; } } Cl.prototype.isBone = !0; class Lo extends Jt { constructor(e = null, t = 1, r = 1, n, o, a, s, c, l = qt, h = qt, u, p) { super(null, a, s, c, l, h, n, o, u, p), this.image = { data: e, width: t, height: r }, this.magFilter = l, this.minFilter = h, this.generateMipmaps = !1, this.flipY = !1, this.unpackAlignment = 1, this.needsUpdate = !0; } } Lo.prototype.isDataTexture = !0; const Wg = /* @__PURE__ */ new $e(), UN = /* @__PURE__ */ new $e(); class Ll { constructor(e = [], t = []) { this.uuid = qi(), this.bones = e.slice(0), this.boneInverses = t, this.boneMatrices = null, this.boneTexture = null, this.boneTextureSize = 0, this.frame = -1, 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 r = 0, n = this.bones.length; r < n; r++) this.boneInverses.push(new $e()); } } calculateInverses() { this.boneInverses.length = 0; for (let e = 0, t = this.bones.length; e < t; e++) { const r = new $e(); this.bones[e] && r.copy(this.bones[e].matrixWorld).invert(), this.boneInverses.push(r); } } pose() { for (let e = 0, t = this.bones.length; e < t; e++) { const r = this.bones[e]; r && r.matrixWorld.copy(this.boneInverses[e]).invert(); } for (let e = 0, t = this.bones.length; e < t; e++) { const r = this.bones[e]; r && (r.parent && r.parent.isBone ? (r.matrix.copy(r.parent.matrixWorld).invert(), r.matrix.multiply(r.matrixWorld)) : r.matrix.copy(r.matrixWorld), r.matrix.decompose(r.position, r.quaternion, r.scale)); } } update() { const e = this.bones, t = this.boneInverses, r = this.boneMatrices, n = this.boneTexture; for (let o = 0, a = e.length; o < a; o++) { const s = e[o] ? e[o].matrixWorld : UN; Wg.multiplyMatrices(s, t[o]), Wg.toArray(r, o * 16); } n !== null && (n.needsUpdate = !0); } clone() { return new Ll(this.bones, this.boneInverses); } computeBoneTexture() { let e = Math.sqrt(this.bones.length * 4); e = dx(e), e = Math.max(e, 4); const t = new Float32Array(e * e * 4); t.set(this.boneMatrices); const r = new Lo(t, e, e, $i, en); return this.boneMatrices = t, this.boneTexture = r, this.boneTextureSize = e, this; } getBoneByName(e) { for (let t = 0, r = this.bones.length; t < r; t++) { const n = this.bones[t]; if (n.name === e) return n; } } dispose() { this.boneTexture !== null && (this.boneTexture.dispose(), this.boneTexture = null); } fromJSON(e, t) { this.uuid = e.uuid; for (let r = 0, n = e.bones.length; r < n; r++) { const o = e.bones[r]; let a = t[o]; a === void 0 && (console.warn("THREE.Skeleton: No bone found with UUID:", o), a = new Cl()), this.bones.push(a), this.boneInverses.push(new $e().fromArray(e.boneInverses[r])); } return this.init(), this; } toJSON() { const e = { metadata: { version: 4.5, type: "Skeleton", generator: "Skeleton.toJSON" }, bones: [], boneInverses: [] }; e.uuid = this.uuid; const t = this.bones, r = this.boneInverses; for (let n = 0, o = t.length; n < o; n++) { const a = t[n]; e.bones.push(a.uuid); const s = r[n]; e.boneInverses.push(s.toArray()); } return e; } } const $g = /* @__PURE__ */ new $e(), qg = /* @__PURE__ */ new $e(), hc = [], As = /* @__PURE__ */ new Yt(); class Qp extends Yt { constructor(e, t, r) { super(e, t), this.instanceMatrix = new tt(new Float32Array(r * 16), 16), this.instanceColor = null, this.count = r, this.frustumCulled = !1; } copy(e) { return super.copy(e), this.instanceMatrix.copy(e.instanceMatrix), e.instanceColor !== null && (this.instanceColor = e.instanceColor.clone()), this.count = e.count, this; } getColorAt(e, t) { t.fromArray(this.instanceColor.array, e * 3); } getMatrixAt(e, t) { t.fromArray(this.instanceMatrix.array, e * 16); } raycast(e, t) { const r = this.matrixWorld, n = this.count; if (As.geometry = this.geometry, As.material = this.material, As.material !== void 0) for (let o = 0; o < n; o++) { this.getMatrixAt(o, $g), qg.multiplyMatrices(r, $g), As.matrixWorld = qg, As.raycast(e, hc); for (let a = 0, s = hc.length; a < s; a++) { const c = hc[a]; c.instanceId = o, c.object = this, t.push(c); } hc.length = 0; } } setColorAt(e, t) { this.instanceColor === null && (this.instanceColor = new tt(new Float32Array(this.count * 3), 3)), t.toArray(this.instanceColor.array, e * 3); } setMatrixAt(e, t) { t.toArray(this.instanceMatrix.array, e * 16); } updateMorphTargets() { } dispose() { this.dispatchEvent({ type: "dispose" }); } } Qp.prototype.isInstancedMesh = !0; class ni extends Qt { constructor(e) { super(), this.type = "LineBasicMaterial", this.color = new Be(16777215), this.linewidth = 1, this.linecap = "round", this.linejoin = "round", this.morphTargets = !1, this.setValues(e); } copy(e) { return super.copy(e), this.color.copy(e.color), this.linewidth = e.linewidth, this.linecap = e.linecap, this.linejoin = e.linejoin, this.morphTargets = e.morphTargets, this; } } ni.prototype.isLineBasicMaterial = !0; const Xg = /* @__PURE__ */ new Z(), Zg = /* @__PURE__ */ new Z(), Yg = /* @__PURE__ */ new $e(), Ph = /* @__PURE__ */ new io(), dc = /* @__PURE__ */ new bn(); class kr extends nt { constructor(e = new Je(), t = new ni()) { super(), this.type = "Line", this.geometry = e, this.material = t, this.updateMorphTargets(); } copy(e) { return super.copy(e), this.material = e.material, this.geometry = e.geometry, this; } computeLineDistances() { const e = this.geometry; if (e.isBufferGeometry) if (e.index === null) { const t = e.attributes.position, r = [0]; for (let n = 1, o = t.count; n < o; n++) Xg.fromBufferAttribute(t, n - 1), Zg.fromBufferAttribute(t, n), r[n] = r[n - 1], r[n] += Xg.distanceTo(Zg); e.setAttribute("lineDistance", new je(r, 1)); } else console.warn("THREE.Line.computeLineDistances(): Computation only possible with non-indexed BufferGeometry."); else e.isGeometry && console.error("THREE.Line.computeLineDistances() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead."); return this; } raycast(e, t) { const r = this.geometry, n = this.matrixWorld, o = e.params.Line.threshold, a = r.drawRange; if (r.boundingSphere === null && r.computeBoundingSphere(), dc.copy(r.boundingSphere), dc.applyMatrix4(n), dc.radius += o, e.ray.intersectsSphere(dc) === !1) return; Yg.copy(n).invert(), Ph.copy(e.ray).applyMatrix4(Yg); const s = o / ((this.scale.x + this.scale.y + this.scale.z) / 3), c = s * s, l = new Z(), h = new Z(), u = new Z(), p = new Z(), g = this.isLineSegments ? 2 : 1; if (r.isBufferGeometry) { const m = r.index, d = r.attributes.position; if (m !== null) { const y = Math.max(0, a.start), f = Math.min(m.count, a.start + a.count); for (let v = y, M = f - 1; v < M; v += g) { const S = m.getX(v), T = m.getX(v + 1); if (l.fromBufferAttribute(d, S), h.fromBufferAttribute(d, T), Ph.distanceSqToSegment(l, h, p, u) > c) continue; p.applyMatrix4(this.matrixWorld); const x = e.ray.origin.distanceTo(p); x < e.near || x > e.far || t.push({ distance: x, // What do we want? intersection point on the ray or on the segment?? // point: raycaster.ray.at( distance ), point: u.clone().applyMatrix4(this.matrixWorld), index: v, face: null, faceIndex: null, object: this }); } } else { const y = Math.max(0, a.start), f = Math.min(d.count, a.start + a.count); for (let v = y, M = f - 1; v < M; v += g) { if (l.fromBufferAttribute(d, v), h.fromBufferAttribute(d, v + 1), Ph.distanceSqToSegment(l, h, p, u) > c) continue; p.applyMatrix4(this.matrixWorld); const S = e.ray.origin.distanceTo(p); S < e.near || S > e.far || t.push({ distance: S, // What do we want? intersection point on the ray or on the segment?? // point: raycaster.ray.at( distance ), point: u.clone().applyMatrix4(this.matrixWorld), index: v, face: null, faceIndex: null, object: this }); } } } else r.isGeometry && console.error("THREE.Line.raycast() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead."); } updateMorphTargets() { const e = this.geometry; if (e.isBufferGeometry) { const t = e.morphAttributes, r = Object.keys(t); if (r.length > 0) { const n = t[r[0]]; if (n !== void 0) { this.morphTargetInfluences = [], this.morphTargetDictionary = {}; for (let o = 0, a = n.length; o < a; o++) { const s = n[o].name || String(o); this.morphTargetInfluences.push(0), this.morphTargetDictionary[s] = o; } } } } else { const t = e.morphTargets; t !== void 0 && t.length > 0 && console.error("THREE.Line.updateMorphTargets() does not support THREE.Geometry. Use THREE.BufferGeometry instead."); } } } kr.prototype.isLine = !0; const Jg = /* @__PURE__ */ new Z(), Kg = /* @__PURE__ */ new Z(); class Pi extends kr { constructor(e, t) { super(e, t), this.type = "LineSegments"; } computeLineDistances() { const e = this.geometry; if (e.isBufferGeometry) if (e.index === null) { const t = e.attributes.position, r = []; for (let n = 0, o = t.count; n < o; n += 2) Jg.fromBufferAttribute(t, n), Kg.fromBufferAttribute(t, n + 1), r[n] = n === 0 ? 0 : r[n - 1], r[n + 1] = r[n] + Jg.distanceTo(Kg); e.setAttribute("lineDistance", new je(r, 1)); } else console.warn("THREE.LineSegments.computeLineDistances(): Computation only possible with non-indexed BufferGeometry."); else e.isGeometry && console.error("THREE.LineSegments.computeLineDistances() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead."); return this; } } Pi.prototype.isLineSegments = !0; class Bu extends kr { constructor(e, t) { super(e, t), this.type = "LineLoop"; } } Bu.prototype.isLineLoop = !0; class no extends Qt { constructor(e) { super(), this.type = "PointsMaterial", this.color = new Be(16777215), this.map = null, this.alphaMap = null, this.size = 1, this.sizeAttenuation = !0, this.morphTargets = !1, 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.morphTargets = e.morphTargets, this; } } no.prototype.isPointsMaterial = !0; const Qg = /* @__PURE__ */ new $e(), kd = /* @__PURE__ */ new io(), pc = /* @__PURE__ */ new bn(), fc = /* @__PURE__ */ new Z(); class hs extends nt { constructor(e = new Je(), t = new no()) { super(), this.type = "Points", this.geometry = e, this.material = t, this.updateMorphTargets(); } copy(e) { return super.copy(e), this.material = e.material, this.geometry = e.geometry, this; } raycast(e, t) { const r = this.geometry, n = this.matrixWorld, o = e.params.Points.threshold, a = r.drawRange; if (r.boundingSphere === null && r.computeBoundingSphere(), pc.copy(r.boundingSphere), pc.applyMatrix4(n), pc.radius += o, e.ray.intersectsSphere(pc) === !1) return; Qg.copy(n).invert(), kd.copy(e.ray).applyMatrix4(Qg); const s = o / ((this.scale.x + this.scale.y + this.scale.z) / 3), c = s * s; if (r.isBufferGeometry) { const l = r.index, h = r.attributes.position; if (l !== null) { const u = Math.max(0, a.start), p = Math.min(l.count, a.start + a.count); for (let g = u, m = p; g < m; g++) { const d = l.getX(g); fc.fromBufferAttribute(h, d), ev(fc, d, c, n, e, t, this); } } else { const u = Math.max(0, a.start), p = Math.min(h.count, a.start + a.count); for (let g = u, m = p; g < m; g++) fc.fromBufferAttribute(h, g), ev(fc, g, c, n, e, t, this); } } else console.error("THREE.Points.raycast() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead."); } updateMorphTargets() { const e = this.geometry; if (e.isBufferGeometry) { const t = e.morphAttributes, r = Object.keys(t); if (r.length > 0) { const n = t[r[0]]; if (n !== void 0) { this.morphTargetInfluences = [], this.morphTargetDictionary = {}; for (let o = 0, a = n.length; o < a; o++) { const s = n[o].name || String(o); this.morphTargetInfluences.push(0), this.morphTargetDictionary[s] = o; } } } } else { const t = e.morphTargets; t !== void 0 && t.length > 0 && console.error("THREE.Points.updateMorphTargets() does not support THREE.Geometry. Use THREE.BufferGeometry instead."); } } } hs.prototype.isPoints = !0; function ev(i, e, t, r, n, o, a) { const s = kd.distanceSqToPoint(i); if (s < t) { const c = new Z(); kd.closestPointToPoint(i, c), c.applyMatrix4(r); const l = n.ray.origin.distanceTo(c); if (l < n.near || l > n.far) return; o.push({ distance: l, distanceToRay: Math.sqrt(s), point: c, index: e, face: null, object: a }); } } class zx extends Jt { constructor(e, t, r, n, o, a, s, c, l) { super(e, t, r, n, o, a, s, c, l), this.format = s !== void 0 ? s : an, this.minFilter = a !== void 0 ? a : Ut, this.magFilter = o !== void 0 ? o : Ut, this.generateMipmaps = !1; const h = this; function u() { h.needsUpdate = !0, e.requestVideoFrameCallback(u); } "requestVideoFrameCallback" in e && e.requestVideoFrameCallback(u); } clone() { return new this.constructor(this.image).copy(this); } update() { const e = this.image; !("requestVideoFrameCallback" in e) && e.readyState >= e.HAVE_CURRENT_DATA && (this.needsUpdate = !0); } } zx.prototype.isVideoTexture = !0; class ef extends Jt { constructor(e, t, r, n, o, a, s, c, l, h, u, p) { super(null, a, s, c, l, h, n, o, u, p), this.image = { width: t, height: r }, this.mipmaps = e, this.flipY = !1, this.generateMipmaps = !1; } } ef.prototype.isCompressedTexture = !0; class Fx extends Jt { constructor(e, t, r, n, o, a, s, c, l) { super(e, t, r, n, o, a, s, c, l), this.needsUpdate = !0; } } Fx.prototype.isCanvasTexture = !0; class Vx extends Jt { constructor(e, t, r, n, o, a, s, c, l, h) { if (h = h !== void 0 ? h : Ao, h !== Ao && h !== Ba) throw new Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat"); r === void 0 && h === Ao && (r = el), r === void 0 && h === Ba && (r = Ta), super(null, n, o, a, s, c, h, r, l), this.image = { width: e, height: t }, this.magFilter = s !== void 0 ? s : qt, this.minFilter = c !== void 0 ? c : qt, this.flipY = !1, this.generateMipmaps = !1; } } Vx.prototype.isDepthTexture = !0; class Ua extends Je { constructor(e = 1, t = 8, r = 0, n = Math.PI * 2) { super(), this.type = "CircleGeometry", this.parameters = { radius: e, segments: t, thetaStart: r, thetaLength: n }, t = Math.max(3, t); const o = [], a = [], s = [], c = [], l = new Z(), h = new Oe(); a.push(0, 0, 0), s.push(0, 0, 1), c.push(0.5, 0.5); for (let u = 0, p = 3; u <= t; u++, p += 3) { const g = r + u / t * n; l.x = e * Math.cos(g), l.y = e * Math.sin(g), a.push(l.x, l.y, l.z), s.push(0, 0, 1), h.x = (a[p] / e + 1) / 2, h.y = (a[p + 1] / e + 1) / 2, c.push(h.x, h.y); } for (let u = 1; u <= t; u++) o.push(u, u + 1, 0); this.setIndex(o), this.setAttribute("position", new je(a, 3)), this.setAttribute("normal", new je(s, 3)), this.setAttribute("uv", new je(c, 2)); } static fromJSON(e) { return new Ua(e.radius, e.segments, e.thetaStart, e.thetaLength); } } class Yn extends Je { constructor(e = 1, t = 1, r = 1, n = 8, o = 1, a = !1, s = 0, c = Math.PI * 2) { super(), this.type = "CylinderGeometry", this.parameters = { radiusTop: e, radiusBottom: t, height: r, radialSegments: n, heightSegments: o, openEnded: a, thetaStart: s, thetaLength: c }; const l = this; n = Math.floor(n), o = Math.floor(o); const h = [], u = [], p = [], g = []; let m = 0; const d = [], y = r / 2; let f = 0; v(), a === !1 && (e > 0 && M(!0), t > 0 && M(!1)), this.setIndex(h), this.setAttribute("position", new je(u, 3)), this.setAttribute("normal", new je(p, 3)), this.setAttribute("uv", new je(g, 2)); function v() { const S = new Z(), T = new Z(); let x = 0; const w = (t - e) / r; for (let A = 0; A <= o; A++) { const _ = [], E = A / o, O = E * (t - e) + e; for (let L = 0; L <= n; L++) { const C = L / n, I = C * c + s, R = Math.sin(I), b = Math.cos(I); T.x = O * R, T.y = -E * r + y, T.z = O * b, u.push(T.x, T.y, T.z), S.set(R, w, b).normalize(), p.push(S.x, S.y, S.z), g.push(C, 1 - E), _.push(m++); } d.push(_); } for (let A = 0; A < n; A++) for (let _ = 0; _ < o; _++) { const E = d[_][A], O = d[_ + 1][A], L = d[_ + 1][A + 1], C = d[_][A + 1]; h.push(E, O, C), h.push(O, L, C), x += 6; } l.addGroup(f, x, 0), f += x; } function M(S) { const T = m, x = new Oe(), w = new Z(); let A = 0; const _ = S === !0 ? e : t, E = S === !0 ? 1 : -1; for (let L = 1; L <= n; L++) u.push(0, y * E, 0), p.push(0, E, 0), g.push(0.5, 0.5), m++; const O = m; for (let L = 0; L <= n; L++) { const C = L / n * c + s, I = Math.cos(C), R = Math.sin(C); w.x = _ * R, w.y = y * E, w.z = _ * I, u.push(w.x, w.y, w.z), p.push(0, E, 0), x.x = I * 0.5 + 0.5, x.y = R * 0.5 * E + 0.5, g.push(x.x, x.y), m++; } for (let L = 0; L < n; L++) { const C = T + L, I = O + L; S === !0 ? h.push(I, I + 1, C) : h.push(I + 1, I, C), A += 3; } l.addGroup(f, A, S === !0 ? 1 : 2), f += A; } } static fromJSON(e) { return new Yn(e.radiusTop, e.radiusBottom, e.height, e.radialSegments, e.heightSegments, e.openEnded, e.thetaStart, e.thetaLength); } } class Ga extends Yn { constructor(e = 1, t = 1, r = 8, n = 1, o = !1, a = 0, s = Math.PI * 2) { super(0, e, t, r, n, o, a, s), this.type = "ConeGeometry", this.parameters = { radius: e, height: t, radialSegments: r, heightSegments: n, openEnded: o, thetaStart: a, thetaLength: s }; } static fromJSON(e) { return new Ga(e.radius, e.height, e.radialSegments, e.heightSegments, e.openEnded, e.thetaStart, e.thetaLength); } } class zr extends Je { constructor(e, t, r = 1, n = 0) { super(), this.type = "PolyhedronGeometry", this.parameters = { vertices: e, indices: t, radius: r, detail: n }; const o = [], a = []; s(n), l(r), h(), this.setAttribute("position", new je(o, 3)), this.setAttribute("normal", new je(o.slice(), 3)), this.setAttribute("uv", new je(a, 2)), n === 0 ? this.computeVertexNormals() : this.normalizeNormals(); function s(v) { const M = new Z(), S = new Z(), T = new Z(); for (let x = 0; x < t.length; x += 3) g(t[x + 0], M), g(t[x + 1], S), g(t[x + 2], T), c(M, S, T, v); } function c(v, M, S, T) { const x = T + 1, w = []; for (let A = 0; A <= x; A++) { w[A] = []; const _ = v.clone().lerp(S, A / x), E = M.clone().lerp(S, A / x), O = x - A; for (let L = 0; L <= O; L++) L === 0 && A === x ? w[A][L] = _ : w[A][L] = _.clone().lerp(E, L / O); } for (let A = 0; A < x; A++) for (let _ = 0; _ < 2 * (x - A) - 1; _++) { const E = Math.floor(_ / 2); _ % 2 === 0 ? (p(w[A][E + 1]), p(w[A + 1][E]), p(w[A][E])) : (p(w[A][E + 1]), p(w[A + 1][E + 1]), p(w[A + 1][E])); } } function l(v) { const M = new Z(); for (let S = 0; S < o.length; S += 3) M.x = o[S + 0], M.y = o[S + 1], M.z = o[S + 2], M.normalize().multiplyScalar(v), o[S + 0] = M.x, o[S + 1] = M.y, o[S + 2] = M.z; } function h() { const v = new Z(); for (let M = 0; M < o.length; M += 3) { v.x = o[M + 0], v.y = o[M + 1], v.z = o[M + 2]; const S = y(v) / 2 / Math.PI + 0.5, T = f(v) / Math.PI + 0.5; a.push(S, 1 - T); } m(), u(); } function u() { for (let v = 0; v < a.length; v += 6) { const M = a[v + 0], S = a[v + 2], T = a[v + 4], x = Math.max(M, S, T), w = Math.min(M, S, T); x > 0.9 && w < 0.1 && (M < 0.2 && (a[v + 0] += 1), S < 0.2 && (a[v + 2] += 1), T < 0.2 && (a[v + 4] += 1)); } } function p(v) { o.push(v.x, v.y, v.z); } function g(v, M) { const S = v * 3; M.x = e[S + 0], M.y = e[S + 1], M.z = e[S + 2]; } function m() { const v = new Z(), M = new Z(), S = new Z(), T = new Z(), x = new Oe(), w = new Oe(), A = new Oe(); for (let _ = 0, E = 0; _ < o.length; _ += 9, E += 6) { v.set(o[_ + 0], o[_ + 1], o[_ + 2]), M.set(o[_ + 3], o[_ + 4], o[_ + 5]), S.set(o[_ + 6], o[_ + 7], o[_ + 8]), x.set(a[E + 0], a[E + 1]), w.set(a[E + 2], a[E + 3]), A.set(a[E + 4], a[E + 5]), T.copy(v).add(M).add(S).divideScalar(3); const O = y(T); d(x, E + 0, v, O), d(w, E + 2, M, O), d(A, E + 4, S, O); } } function d(v, M, S, T) { T < 0 && v.x === 1 && (a[M] = v.x - 1), S.x === 0 && S.z === 0 && (a[M] = T / 2 / Math.PI + 0.5); } function y(v) { return Math.atan2(v.z, -v.x); } function f(v) { return Math.atan2(-v.y, Math.sqrt(v.x * v.x + v.z * v.z)); } } static fromJSON(e) { return new zr(e.vertices, e.indices, e.radius, e.details); } } class Ha extends zr { constructor(e = 1, t = 0) { const r = (1 + Math.sqrt(5)) / 2, n = 1 / r, o = [ // (±1, ±1, ±1) -1, -1, -1, -1, -1, 1, -1, 1, -1, -1, 1, 1, 1, -1, -1, 1, -1, 1, 1, 1, -1, 1, 1, 1, // (0, ±1/φ, ±φ) 0, -n, -r, 0, -n, r, 0, n, -r, 0, n, r, // (±1/φ, ±φ, 0) -n, -r, 0, -n, r, 0, n, -r, 0, n, r, 0, // (±φ, 0, ±1/φ) -r, 0, -n, r, 0, -n, -r, 0, n, r, 0, n ], a = [ 3, 11, 7, 3, 7, 15, 3, 15, 13, 7, 19, 17, 7, 17, 6, 7, 6, 15, 17, 4, 8, 17, 8, 10, 17, 10, 6, 8, 0, 16, 8, 16, 2, 8, 2, 10, 0, 12, 1, 0, 1, 18, 0, 18, 16, 6, 10, 2, 6, 2, 13, 6, 13, 15, 2, 16, 18, 2, 18, 3, 2, 3, 13, 18, 1, 9, 18, 9, 11, 18, 11, 3, 4, 14, 12, 4, 12, 0, 4, 0, 8, 11, 9, 5, 11, 5, 19, 11, 19, 7, 19, 5, 14, 19, 14, 4, 19, 4, 17, 1, 12, 14, 1, 14, 5, 1, 5, 9 ]; super(o, a, e, t), this.type = "DodecahedronGeometry", this.parameters = { radius: e, detail: t }; } static fromJSON(e) { return new Ha(e.radius, e.detail); } } const mc = new Z(), gc = new Z(), Ih = new Z(), vc = new Xt(); class tf extends Je { constructor(e, t) { if (super(), this.type = "EdgesGeometry", this.parameters = { thresholdAngle: t }, t = t !== void 0 ? t : 1, e.isGeometry === !0) { console.error("THREE.EdgesGeometry no longer supports THREE.Geometry. Use THREE.BufferGeometry instead."); return; } const r = Math.pow(10, 4), n = Math.cos(Co * t), o = e.getIndex(), a = e.getAttribute("position"), s = o ? o.count : a.count, c = [0, 0, 0], l = ["a", "b", "c"], h = new Array(3), u = {}, p = []; for (let g = 0; g < s; g += 3) { o ? (c[0] = o.getX(g), c[1] = o.getX(g + 1), c[2] = o.getX(g + 2)) : (c[0] = g, c[1] = g + 1, c[2] = g + 2); const { a: m, b: d, c: y } = vc; if (m.fromBufferAttribute(a, c[0]), d.fromBufferAttribute(a, c[1]), y.fromBufferAttribute(a, c[2]), vc.getNormal(Ih), h[0] = `${Math.round(m.x * r)},${Math.round(m.y * r)},${Math.round(m.z * r)}`, h[1] = `${Math.round(d.x * r)},${Math.round(d.y * r)},${Math.round(d.z * r)}`, h[2] = `${Math.round(y.x * r)},${Math.round(y.y * r)},${Math.round(y.z * r)}`, !(h[0] === h[1] || h[1] === h[2] || h[2] === h[0])) for (let f = 0; f < 3; f++) { const v = (f + 1) % 3, M = h[f], S = h[v], T = vc[l[f]], x = vc[l[v]], w = `${M}_${S}`, A = `${S}_${M}`; A in u && u[A] ? (Ih.dot(u[A].normal) <= n && (p.push(T.x, T.y, T.z), p.push(x.x, x.y, x.z)), u[A] = null) : w in u || (u[w] = { index0: c[f], index1: c[v], normal: Ih.clone() }); } } for (const g in u) if (u[g]) { const { index0: m, index1: d } = u[g]; mc.fromBufferAttribute(a, m), gc.fromBufferAttribute(a, d), p.push(mc.x, mc.y, mc.z), p.push(gc.x, gc.y, gc.z); } this.setAttribute("position", new je(p, 3)); } } class Zi { constructor() { this.type = "Curve", this.arcLengthDivisions = 200; } // Virtual base class method to overwrite and implement in subclasses // - t [0 .. 1] getPoint() { return console.warn("THREE.Curve: .getPoint() not implemented."), null; } // Get point at relative position in curve according to arc length // - u [0 .. 1] getPointAt(e, t) { const r = this.getUtoTmapping(e); return this.getPoint(r, t); } // Get sequence of points using getPoint( t ) getPoints(e = 5) { const t = []; for (let r = 0; r <= e; r++) t.push(this.getPoint(r / e)); return t; } // Get sequence of points using getPointAt( u ) getSpacedPoints(e = 5) { const t = []; for (let r = 0; r <= e; r++) t.push(this.getPointAt(r / e)); return t; } // Get total curve arc length getLength() { const e = this.getLengths(); return e[e.length - 1]; } // Get list of cumulative segment lengths getLengths(e = this.arcLengthDivisions) { if (this.cacheArcLengths && this.cacheArcLengths.length === e + 1 && !this.needsUpdate) return this.cacheArcLengths; this.needsUpdate = !1; const t = []; let r, n = this.getPoint(0), o = 0; t.push(0); for (let a = 1; a <= e; a++) r = this.getPoint(a / e), o += r.distanceTo(n), t.push(o), n = r; return this.cacheArcLengths = t, t; } updateArcLengths() { this.needsUpdate = !0, this.getLengths(); } // Given u ( 0 .. 1 ), get a t to find p. This gives you points which are equidistant getUtoTmapping(e, t) { const r = this.getLengths(); let n = 0; const o = r.length; let a; t ? a = t : a = e * r[o - 1]; let s = 0, c = o - 1, l; for (; s <= c; ) if (n = Math.floor(s + (c - s) / 2), l = r[n] - a, l < 0) s = n + 1; else if (l > 0) c = n - 1; else { c = n; break; } if (n = c, r[n] === a) return n / (o - 1); const h = r[n], u = r[n + 1] - h, p = (a - h) / u; return (n + p) / (o - 1); } // Returns a unit vector tangent at t // In case any sub curve does not implement its tangent derivation, // 2 points a small delta apart will be used to find its gradient // which seems to give a reasonable approximation getTangent(e, t) { let r = e - 1e-4, n = e + 1e-4; r < 0 && (r = 0), n > 1 && (n = 1); const o = this.getPoint(r), a = this.getPoint(n), s = t || (o.isVector2 ? new Oe() : new Z()); return s.copy(a).sub(o).normalize(), s; } getTangentAt(e, t) { const r = this.getUtoTmapping(e); return this.getTangent(r, t); } computeFrenetFrames(e, t) { const r = new Z(), n = [], o = [], a = [], s = new Z(), c = new $e(); for (let g = 0; g <= e; g++) { const m = g / e; n[g] = this.getTangentAt(m, new Z()), n[g].normalize(); } o[0] = new Z(), a[0] = new Z(); let l = Number.MAX_VALUE; const h = Math.abs(n[0].x), u = Math.abs(n[0].y), p = Math.abs(n[0].z); h <= l && (l = h, r.set(1, 0, 0)), u <= l && (l = u, r.set(0, 1, 0)), p <= l && r.set(0, 0, 1), s.crossVectors(n[0], r).normalize(), o[0].crossVectors(n[0], s), a[0].crossVectors(n[0], o[0]); for (let g = 1; g <= e; g++) { if (o[g] = o[g - 1].clone(), a[g] = a[g - 1].clone(), s.crossVectors(n[g - 1], n[g]), s.length() > Number.EPSILON) { s.normalize(); const m = Math.acos(mi(n[g - 1].dot(n[g]), -1, 1)); o[g].applyMatrix4(c.makeRotationAxis(s, m)); } a[g].crossVectors(n[g], o[g]); } if (t === !0) { let g = Math.acos(mi(o[0].dot(o[e]), -1, 1)); g /= e, n[0].dot(s.crossVectors(o[0], o[e])) > 0 && (g = -g); for (let m = 1; m <= e; m++) o[m].applyMatrix4(c.makeRotationAxis(n[m], g * m)), a[m].crossVectors(n[m], o[m]); } return { tangents: n, normals: o, binormals: a }; } clone() { return new this.constructor().copy(this); } copy(e) { return this.arcLengthDivisions = e.arcLengthDivisions, this; } toJSON() { const e = { metadata: { version: 4.5, type: "Curve", generator: "Curve.toJSON" } }; return e.arcLengthDivisions = this.arcLengthDivisions, e.type = this.type, e; } fromJSON(e) { return this.arcLengthDivisions = e.arcLengthDivisions, this; } } class Rl extends Zi { constructor(e = 0, t = 0, r = 1, n = 1, o = 0, a = Math.PI * 2, s = !1, c = 0) { super(), this.type = "EllipseCurve", this.aX = e, this.aY = t, this.xRadius = r, this.yRadius = n, this.aStartAngle = o, this.aEndAngle = a, this.aClockwise = s, this.aRotation = c; } getPoint(e, t) { const r = t || new Oe(), n = Math.PI * 2; let o = this.aEndAngle - this.aStartAngle; const a = Math.abs(o) < Number.EPSILON; for (; o < 0; ) o += n; for (; o > n; ) o -= n; o < Number.EPSILON && (a ? o = 0 : o = n), this.aClockwise === !0 && !a && (o === n ? o = -n : o = o - n); const s = this.aStartAngle + e * o; let c = this.aX + this.xRadius * Math.cos(s), l = this.aY + this.yRadius * Math.sin(s); if (this.aRotation !== 0) { const h = Math.cos(this.aRotation), u = Math.sin(this.aRotation), p = c - this.aX, g = l - this.aY; c = p * h - g * u + this.aX, l = p * u + g * h + this.aY; } return r.set(c, l); } copy(e) { return super.copy(e), this.aX = e.aX, this.aY = e.aY, this.xRadius = e.xRadius, this.yRadius = e.yRadius, this.aStartAngle = e.aStartAngle, this.aEndAngle = e.aEndAngle, this.aClockwise = e.aClockwise, this.aRotation = e.aRotation, this; } toJSON() { const e = super.toJSON(); return e.aX = this.aX, e.aY = this.aY, e.xRadius = this.xRadius, e.yRadius = this.yRadius, e.aStartAngle = this.aStartAngle, e.aEndAngle = this.aEndAngle, e.aClockwise = this.aClockwise, e.aRotation = this.aRotation, e; } fromJSON(e) { return super.fromJSON(e), this.aX = e.aX, this.aY = e.aY, this.xRadius = e.xRadius, this.yRadius = e.yRadius, this.aStartAngle = e.aStartAngle, this.aEndAngle = e.aEndAngle, this.aClockwise = e.aClockwise, this.aRotation = e.aRotation, this; } } Rl.prototype.isEllipseCurve = !0; class rf extends Rl { constructor(e, t, r, n, o, a) { super(e, t, r, r, n, o, a), this.type = "ArcCurve"; } } rf.prototype.isArcCurve = !0; function nf() { let i = 0, e = 0, t = 0, r = 0; function n(o, a, s, c) { i = o, e = s, t = -3 * o + 3 * a - 2 * s - c, r = 2 * o - 2 * a + s + c; } return { initCatmullRom: function(o, a, s, c, l) { n(a, s, l * (s - o), l * (c - a)); }, initNonuniformCatmullRom: function(o, a, s, c, l, h, u) { let p = (a - o) / l - (s - o) / (l + h) + (s - a) / h, g = (s - a) / h - (c - a) / (h + u) + (c - s) / u; p *= h, g *= h, n(a, s, p, g); }, calc: function(o) { const a = o * o, s = a * o; return i + e * o + t * a + r * s; } }; } const yc = new Z(), Dh = new nf(), Nh = new nf(), Bh = new nf(); class of extends Zi { constructor(e = [], t = !1, r = "centripetal", n = 0.5) { super(), this.type = "CatmullRomCurve3", this.points = e, this.closed = t, this.curveType = r, this.tension = n; } getPoint(e, t = new Z()) { const r = t, n = this.points, o = n.length, a = (o - (this.closed ? 0 : 1)) * e; let s = Math.floor(a), c = a - s; this.closed ? s += s > 0 ? 0 : (Math.floor(Math.abs(s) / o) + 1) * o : c === 0 && s === o - 1 && (s = o - 2, c = 1); let l, h; this.closed || s > 0 ? l = n[(s - 1) % o] : (yc.subVectors(n[0], n[1]).add(n[0]), l = yc); const u = n[s % o], p = n[(s + 1) % o]; if (this.closed || s + 2 < o ? h = n[(s + 2) % o] : (yc.subVectors(n[o - 1], n[o - 2]).add(n[o - 1]), h = yc), this.curveType === "centripetal" || this.curveType === "chordal") { const g = this.curveType === "chordal" ? 0.5 : 0.25; let m = Math.pow(l.distanceToSquared(u), g), d = Math.pow(u.distanceToSquared(p), g), y = Math.pow(p.distanceToSquared(h), g); d < 1e-4 && (d = 1), m < 1e-4 && (m = d), y < 1e-4 && (y = d), Dh.initNonuniformCatmullRom(l.x, u.x, p.x, h.x, m, d, y), Nh.initNonuniformCatmullRom(l.y, u.y, p.y, h.y, m, d, y), Bh.initNonuniformCatmullRom(l.z, u.z, p.z, h.z, m, d, y); } else this.curveType === "catmullrom" && (Dh.initCatmullRom(l.x, u.x, p.x, h.x, this.tension), Nh.initCatmullRom(l.y, u.y, p.y, h.y, this.tension), Bh.initCatmullRom(l.z, u.z, p.z, h.z, this.tension)); return r.set( Dh.calc(c), Nh.calc(c), Bh.calc(c) ), r; } copy(e) { super.copy(e), this.points = []; for (let t = 0, r = e.points.length; t < r; t++) { const n = e.points[t]; this.points.push(n.clone()); } return this.closed = e.closed, this.curveType = e.curveType, this.tension = e.tension, this; } toJSON() { const e = super.toJSON(); e.points = []; for (let t = 0, r = this.points.length; t < r; t++) { const n = this.points[t]; e.points.push(n.toArray()); } return e.closed = this.closed, e.curveType = this.curveType, e.tension = this.tension, e; } fromJSON(e) { super.fromJSON(e), this.points = []; for (let t = 0, r = e.points.length; t < r; t++) { const n = e.points[t]; this.points.push(new Z().fromArray(n)); } return this.closed = e.closed, this.curveType = e.curveType, this.tension = e.tension, this; } } of.prototype.isCatmullRomCurve3 = !0; function tv(i, e, t, r, n) { const o = (r - e) * 0.5, a = (n - t) * 0.5, s = i * i, c = i * s; return (2 * t - 2 * r + o + a) * c + (-3 * t + 3 * r - 2 * o - a) * s + o * i + t; } function GN(i, e) { const t = 1 - i; return t * t * e; } function HN(i, e) { return 2 * (1 - i) * i * e; } function jN(i, e) { return i * i * e; } function Gs(i, e, t, r) { return GN(i, e) + HN(i, t) + jN(i, r); } function WN(i, e) { const t = 1 - i; return t * t * t * e; } function $N(i, e) { const t = 1 - i; return 3 * t * t * i * e; } function qN(i, e) { return 3 * (1 - i) * i * i * e; } function XN(i, e) { return i * i * i * e; } function Hs(i, e, t, r, n) { return WN(i, e) + $N(i, t) + qN(i, r) + XN(i, n); } class ku extends Zi { constructor(e = new Oe(), t = new Oe(), r = new Oe(), n = new Oe()) { super(), this.type = "CubicBezierCurve", this.v0 = e, this.v1 = t, this.v2 = r, this.v3 = n; } getPoint(e, t = new Oe()) { const r = t, n = this.v0, o = this.v1, a = this.v2, s = this.v3; return r.set( Hs(e, n.x, o.x, a.x, s.x), Hs(e, n.y, o.y, a.y, s.y) ), r; } copy(e) { return super.copy(e), this.v0.copy(e.v0), this.v1.copy(e.v1), this.v2.copy(e.v2), this.v3.copy(e.v3), this; } toJSON() { const e = super.toJSON(); return e.v0 = this.v0.toArray(), e.v1 = this.v1.toArray(), e.v2 = this.v2.toArray(), e.v3 = this.v3.toArray(), e; } fromJSON(e) { return super.fromJSON(e), this.v0.fromArray(e.v0), this.v1.fromArray(e.v1), this.v2.fromArray(e.v2), this.v3.fromArray(e.v3), this; } } ku.prototype.isCubicBezierCurve = !0; class af extends Zi { constructor(e = new Z(), t = new Z(), r = new Z(), n = new Z()) { super(), this.type = "CubicBezierCurve3", this.v0 = e, this.v1 = t, this.v2 = r, this.v3 = n; } getPoint(e, t = new Z()) { const r = t, n = this.v0, o = this.v1, a = this.v2, s = this.v3; return r.set( Hs(e, n.x, o.x, a.x, s.x), Hs(e, n.y, o.y, a.y, s.y), Hs(e, n.z, o.z, a.z, s.z) ), r; } copy(e) { return super.copy(e), this.v0.copy(e.v0), this.v1.copy(e.v1), this.v2.copy(e.v2), this.v3.copy(e.v3), this; } toJSON() { const e = super.toJSON(); return e.v0 = this.v0.toArray(), e.v1 = this.v1.toArray(), e.v2 = this.v2.toArray(), e.v3 = this.v3.toArray(), e; } fromJSON(e) { return super.fromJSON(e), this.v0.fromArray(e.v0), this.v1.fromArray(e.v1), this.v2.fromArray(e.v2), this.v3.fromArray(e.v3), this; } } af.prototype.isCubicBezierCurve3 = !0; class Ol extends Zi { constructor(e = new Oe(), t = new Oe()) { super(), this.type = "LineCurve", this.v1 = e, this.v2 = t; } getPoint(e, t = new Oe()) { const r = t; return e === 1 ? r.copy(this.v2) : (r.copy(this.v2).sub(this.v1), r.multiplyScalar(e).add(this.v1)), r; } // Line curve is linear, so we can overwrite default getPointAt getPointAt(e, t) { return this.getPoint(e, t); } getTangent(e, t) { const r = t || new Oe(); return r.copy(this.v2).sub(this.v1).normalize(), r; } copy(e) { return super.copy(e), this.v1.copy(e.v1), this.v2.copy(e.v2), this; } toJSON() { const e = super.toJSON(); return e.v1 = this.v1.toArray(), e.v2 = this.v2.toArray(), e; } fromJSON(e) { return super.fromJSON(e), this.v1.fromArray(e.v1), this.v2.fromArray(e.v2), this; } } Ol.prototype.isLineCurve = !0; class Ux extends Zi { constructor(e = new Z(), t = new Z()) { super(), this.type = "LineCurve3", this.isLineCurve3 = !0, this.v1 = e, this.v2 = t; } getPoint(e, t = new Z()) { const r = t; return e === 1 ? r.copy(this.v2) : (r.copy(this.v2).sub(this.v1), r.multiplyScalar(e).add(this.v1)), r; } // Line curve is linear, so we can overwrite default getPointAt getPointAt(e, t) { return this.getPoint(e, t); } copy(e) { return super.copy(e), this.v1.copy(e.v1), this.v2.copy(e.v2), this; } toJSON() { const e = super.toJSON(); return e.v1 = this.v1.toArray(), e.v2 = this.v2.toArray(), e; } fromJSON(e) { return super.fromJSON(e), this.v1.fromArray(e.v1), this.v2.fromArray(e.v2), this; } } class zu extends Zi { constructor(e = new Oe(), t = new Oe(), r = new Oe()) { super(), this.type = "QuadraticBezierCurve", this.v0 = e, this.v1 = t, this.v2 = r; } getPoint(e, t = new Oe()) { const r = t, n = this.v0, o = this.v1, a = this.v2; return r.set( Gs(e, n.x, o.x, a.x), Gs(e, n.y, o.y, a.y) ), r; } copy(e) { return super.copy(e), this.v0.copy(e.v0), this.v1.copy(e.v1), this.v2.copy(e.v2), this; } toJSON() { const e = super.toJSON(); return e.v0 = this.v0.toArray(), e.v1 = this.v1.toArray(), e.v2 = this.v2.toArray(), e; } fromJSON(e) { return super.fromJSON(e), this.v0.fromArray(e.v0), this.v1.fromArray(e.v1), this.v2.fromArray(e.v2), this; } } zu.prototype.isQuadraticBezierCurve = !0; class sf extends Zi { constructor(e = new Z(), t = new Z(), r = new Z()) { super(), this.type = "QuadraticBezierCurve3", this.v0 = e, this.v1 = t, this.v2 = r; } getPoint(e, t = new Z()) { const r = t, n = this.v0, o = this.v1, a = this.v2; return r.set( Gs(e, n.x, o.x, a.x), Gs(e, n.y, o.y, a.y), Gs(e, n.z, o.z, a.z) ), r; } copy(e) { return super.copy(e), this.v0.copy(e.v0), this.v1.copy(e.v1), this.v2.copy(e.v2), this; } toJSON() { const e = super.toJSON(); return e.v0 = this.v0.toArray(), e.v1 = this.v1.toArray(), e.v2 = this.v2.toArray(), e; } fromJSON(e) { return super.fromJSON(e), this.v0.fromArray(e.v0), this.v1.fromArray(e.v1), this.v2.fromArray(e.v2), this; } } sf.prototype.isQuadraticBezierCurve3 = !0; class Fu extends Zi { constructor(e = []) { super(), this.type = "SplineCurve", this.points = e; } getPoint(e, t = new Oe()) { const r = t, n = this.points, o = (n.length - 1) * e, a = Math.floor(o), s = o - a, c = n[a === 0 ? a : a - 1], l = n[a], h = n[a > n.length - 2 ? n.length - 1 : a + 1], u = n[a > n.length - 3 ? n.length - 1 : a + 2]; return r.set( tv(s, c.x, l.x, h.x, u.x), tv(s, c.y, l.y, h.y, u.y) ), r; } copy(e) { super.copy(e), this.points = []; for (let t = 0, r = e.points.length; t < r; t++) { const n = e.points[t]; this.points.push(n.clone()); } return this; } toJSON() { const e = super.toJSON(); e.points = []; for (let t = 0, r = this.points.length; t < r; t++) { const n = this.points[t]; e.points.push(n.toArray()); } return e; } fromJSON(e) { super.fromJSON(e), this.points = []; for (let t = 0, r = e.points.length; t < r; t++) { const n = e.points[t]; this.points.push(new Oe().fromArray(n)); } return this; } } Fu.prototype.isSplineCurve = !0; var lf = /* @__PURE__ */ Object.freeze({ __proto__: null, ArcCurve: rf, CatmullRomCurve3: of, CubicBezierCurve: ku, CubicBezierCurve3: af, EllipseCurve: Rl, LineCurve: Ol, LineCurve3: Ux, QuadraticBezierCurve: zu, QuadraticBezierCurve3: sf, SplineCurve: Fu }); const ZN = { triangulate: function(i, e, t = 2) { const r = e && e.length, n = r ? e[0] * t : i.length; let o = Gx(i, 0, n, t, !0); const a = []; if (!o || o.next === o.prev) return a; let s, c, l, h, u, p, g; if (r && (o = eB(i, e, o, t)), i.length > 80 * t) { s = l = i[0], c = h = i[1]; for (let m = t; m < n; m += t) u = i[m], p = i[m + 1], u < s && (s = u), p < c && (c = p), u > l && (l = u), p > h && (h = p); g = Math.max(l - s, h - c), g = g !== 0 ? 1 / g : 0; } return rl(o, a, t, s, c, g), a; } }; function Gx(i, e, t, r, n) { let o, a; if (n === hB(i, e, t, r) > 0) for (o = e; o < t; o += r) a = iv(o, i[o], i[o + 1], a); else for (o = t - r; o >= e; o -= r) a = iv(o, i[o], i[o + 1], a); return a && Vu(a, a.next) && (ol(a), a = a.next), a; } function Jn(i, e) { if (!i) return i; e || (e = i); let t = i, r; do if (r = !1, !t.steiner && (Vu(t, t.next) || Nt(t.prev, t, t.next) === 0)) { if (ol(t), t = e = t.prev, t === t.next) break; r = !0; } else t = t.next; while (r || t !== e); return e; } function rl(i, e, t, r, n, o, a) { if (!i) return; !a && o && oB(i, r, n, o); let s = i, c, l; for (; i.prev !== i.next; ) { if (c = i.prev, l = i.next, o ? JN(i, r, n, o) : YN(i)) { e.push(c.i / t), e.push(i.i / t), e.push(l.i / t), ol(i), i = l.next, s = l.next; continue; } if (i = l, i === s) { a ? a === 1 ? (i = KN(Jn(i), e, t), rl(i, e, t, r, n, o, 2)) : a === 2 && QN(i, e, t, r, n, o) : rl(Jn(i), e, t, r, n, o, 1); break; } } } function YN(i) { const e = i.prev, t = i, r = i.next; if (Nt(e, t, r) >= 0) return !1; let n = i.next.next; for (; n !== i.prev; ) { if (Ma(e.x, e.y, t.x, t.y, r.x, r.y, n.x, n.y) && Nt(n.prev, n, n.next) >= 0) return !1; n = n.next; } return !0; } function JN(i, e, t, r) { const n = i.prev, o = i, a = i.next; if (Nt(n, o, a) >= 0) return !1; const s = n.x < o.x ? n.x < a.x ? n.x : a.x : o.x < a.x ? o.x : a.x, c = n.y < o.y ? n.y < a.y ? n.y : a.y : o.y < a.y ? o.y : a.y, l = n.x > o.x ? n.x > a.x ? n.x : a.x : o.x > a.x ? o.x : a.x, h = n.y > o.y ? n.y > a.y ? n.y : a.y : o.y > a.y ? o.y : a.y, u = zd(s, c, e, t, r), p = zd(l, h, e, t, r); let g = i.prevZ, m = i.nextZ; for (; g && g.z >= u && m && m.z <= p; ) { if (g !== i.prev && g !== i.next && Ma(n.x, n.y, o.x, o.y, a.x, a.y, g.x, g.y) && Nt(g.prev, g, g.next) >= 0 || (g = g.prevZ, m !== i.prev && m !== i.next && Ma(n.x, n.y, o.x, o.y, a.x, a.y, m.x, m.y) && Nt(m.prev, m, m.next) >= 0)) return !1; m = m.nextZ; } for (; g && g.z >= u; ) { if (g !== i.prev && g !== i.next && Ma(n.x, n.y, o.x, o.y, a.x, a.y, g.x, g.y) && Nt(g.prev, g, g.next) >= 0) return !1; g = g.prevZ; } for (; m && m.z <= p; ) { if (m !== i.prev && m !== i.next && Ma(n.x, n.y, o.x, o.y, a.x, a.y, m.x, m.y) && Nt(m.prev, m, m.next) >= 0) return !1; m = m.nextZ; } return !0; } function KN(i, e, t) { let r = i; do { const n = r.prev, o = r.next.next; !Vu(n, o) && Hx(n, r, r.next, o) && nl(n, o) && nl(o, n) && (e.push(n.i / t), e.push(r.i / t), e.push(o.i / t), ol(r), ol(r.next), r = i = o), r = r.next; } while (r !== i); return Jn(r); } function QN(i, e, t, r, n, o) { let a = i; do { let s = a.next.next; for (; s !== a.prev; ) { if (a.i !== s.i && lB(a, s)) { let c = jx(a, s); a = Jn(a, a.next), c = Jn(c, c.next), rl(a, e, t, r, n, o), rl(c, e, t, r, n, o); return; } s = s.next; } a = a.next; } while (a !== i); } function eB(i, e, t, r) { const n = []; let o, a, s, c, l; for (o = 0, a = e.length; o < a; o++) s = e[o] * r, c = o < a - 1 ? e[o + 1] * r : i.length, l = Gx(i, s, c, r, !1), l === l.next && (l.steiner = !0), n.push(sB(l)); for (n.sort(tB), o = 0; o < n.length; o++) iB(n[o], t), t = Jn(t, t.next); return t; } function tB(i, e) { return i.x - e.x; } function iB(i, e) { if (e = rB(i, e), e) { const t = jx(e, i); Jn(e, e.next), Jn(t, t.next); } } function rB(i, e) { let t = e; const r = i.x, n = i.y; let o = -1 / 0, a; do { if (n <= t.y && n >= t.next.y && t.next.y !== t.y) { const p = t.x + (n - t.y) * (t.next.x - t.x) / (t.next.y - t.y); if (p <= r && p > o) { if (o = p, p === r) { if (n === t.y) return t; if (n === t.next.y) return t.next; } a = t.x < t.next.x ? t : t.next; } } t = t.next; } while (t !== e); if (!a) return null; if (r === o) return a; const s = a, c = a.x, l = a.y; let h = 1 / 0, u; t = a; do r >= t.x && t.x >= c && r !== t.x && Ma(n < l ? r : o, n, c, l, n < l ? o : r, n, t.x, t.y) && (u = Math.abs(n - t.y) / (r - t.x), nl(t, i) && (u < h || u === h && (t.x > a.x || t.x === a.x && nB(a, t))) && (a = t, h = u)), t = t.next; while (t !== s); return a; } function nB(i, e) { return Nt(i.prev, i, e.prev) < 0 && Nt(e.next, i, i.next) < 0; } function oB(i, e, t, r) { let n = i; do n.z === null && (n.z = zd(n.x, n.y, e, t, r)), n.prevZ = n.prev, n.nextZ = n.next, n = n.next; while (n !== i); n.prevZ.nextZ = null, n.prevZ = null, aB(n); } function aB(i) { let e, t, r, n, o, a, s, c, l = 1; do { for (t = i, i = null, o = null, a = 0; t; ) { for (a++, r = t, s = 0, e = 0; e < l && (s++, r = r.nextZ, !!r); e++) ; for (c = l; s > 0 || c > 0 && r; ) s !== 0 && (c === 0 || !r || t.z <= r.z) ? (n = t, t = t.nextZ, s--) : (n = r, r = r.nextZ, c--), o ? o.nextZ = n : i = n, n.prevZ = o, o = n; t = r; } o.nextZ = null, l *= 2; } while (a > 1); return i; } function zd(i, e, t, r, n) { return i = 32767 * (i - t) * n, e = 32767 * (e - r) * n, i = (i | i << 8) & 16711935, i = (i | i << 4) & 252645135, i = (i | i << 2) & 858993459, i = (i | i << 1) & 1431655765, e = (e | e << 8) & 16711935, e = (e | e << 4) & 252645135, e = (e | e << 2) & 858993459, e = (e | e << 1) & 1431655765, i | e << 1; } function sB(i) { let e = i, t = i; do (e.x < t.x || e.x === t.x && e.y < t.y) && (t = e), e = e.next; while (e !== i); return t; } function Ma(i, e, t, r, n, o, a, s) { return (n - a) * (e - s) - (i - a) * (o - s) >= 0 && (i - a) * (r - s) - (t - a) * (e - s) >= 0 && (t - a) * (o - s) - (n - a) * (r - s) >= 0; } function lB(i, e) { return i.next.i !== e.i && i.prev.i !== e.i && !cB(i, e) && // dones't intersect other edges (nl(i, e) && nl(e, i) && uB(i, e) && // locally visible (Nt(i.prev, i, e.prev) || Nt(i, e.prev, e)) || // does not create opposite-facing sectors Vu(i, e) && Nt(i.prev, i, i.next) > 0 && Nt(e.prev, e, e.next) > 0); } function Nt(i, e, t) { return (e.y - i.y) * (t.x - e.x) - (e.x - i.x) * (t.y - e.y); } function Vu(i, e) { return i.x === e.x && i.y === e.y; } function Hx(i, e, t, r) { const n = xc(Nt(i, e, t)), o = xc(Nt(i, e, r)), a = xc(Nt(t, r, i)), s = xc(Nt(t, r, e)); return !!(n !== o && a !== s || n === 0 && bc(i, t, e) || o === 0 && bc(i, r, e) || a === 0 && bc(t, i, r) || s === 0 && bc(t, e, r)); } function bc(i, e, t) { return e.x <= Math.max(i.x, t.x) && e.x >= Math.min(i.x, t.x) && e.y <= Math.max(i.y, t.y) && e.y >= Math.min(i.y, t.y); } function xc(i) { return i > 0 ? 1 : i < 0 ? -1 : 0; } function cB(i, e) { let t = i; do { if (t.i !== i.i && t.next.i !== i.i && t.i !== e.i && t.next.i !== e.i && Hx(t, t.next, i, e)) return !0; t = t.next; } while (t !== i); return !1; } function nl(i, e) { return Nt(i.prev, i, i.next) < 0 ? Nt(i, e, i.next) >= 0 && Nt(i, i.prev, e) >= 0 : Nt(i, e, i.prev) < 0 || Nt(i, i.next, e) < 0; } function uB(i, e) { let t = i, r = !1; const n = (i.x + e.x) / 2, o = (i.y + e.y) / 2; do t.y > o != t.next.y > o && t.next.y !== t.y && n < (t.next.x - t.x) * (o - t.y) / (t.next.y - t.y) + t.x && (r = !r), t = t.next; while (t !== i); return r; } function jx(i, e) { const t = new Fd(i.i, i.x, i.y), r = new Fd(e.i, e.x, e.y), n = i.next, o = e.prev; return i.next = e, e.prev = i, t.next = n, n.prev = t, r.next = t, t.prev = r, o.next = r, r.prev = o, r; } function iv(i, e, t, r) { const n = new Fd(i, e, t); return r ? (n.next = r.next, n.prev = r, r.next.prev = n, r.next = n) : (n.prev = n, n.next = n), n; } function ol(i) { i.next.prev = i.prev, i.prev.next = i.next, i.prevZ && (i.prevZ.nextZ = i.nextZ), i.nextZ && (i.nextZ.prevZ = i.prevZ); } function Fd(i, e, t) { this.i = i, this.x = e, this.y = t, this.prev = null, this.next = null, this.z = null, this.prevZ = null, this.nextZ = null, this.steiner = !1; } function hB(i, e, t, r) { let n = 0; for (let o = e, a = t - r; o < t; o += r) n += (i[a] - i[o]) * (i[o + 1] + i[a + 1]), a = o; return n; } class Dr { // calculate area of the contour polygon static area(e) { const t = e.length; let r = 0; for (let n = t - 1, o = 0; o < t; n = o++) r += e[n].x * e[o].y - e[o].x * e[n].y; return r * 0.5; } static isClockWise(e) { return Dr.area(e) < 0; } static triangulateShape(e, t) { const r = [], n = [], o = []; rv(e), nv(r, e); let a = e.length; t.forEach(rv); for (let c = 0; c < t.length; c++) n.push(a), a += t[c].length, nv(r, t[c]); const s = ZN.triangulate(r, n); for (let c = 0; c < s.length; c += 3) o.push(s.slice(c, c + 3)); return o; } } function rv(i) { const e = i.length; e > 2 && i[e - 1].equals(i[0]) && i.pop(); } function nv(i, e) { for (let t = 0; t < e.length; t++) i.push(e[t].x), i.push(e[t].y); } class br extends Je { constructor(e, t) { super(), this.type = "ExtrudeGeometry", this.parameters = { shapes: e, options: t }, e = Array.isArray(e) ? e : [e]; const r = this, n = [], o = []; for (let s = 0, c = e.length; s < c; s++) { const l = e[s]; a(l); } this.setAttribute("position", new je(n, 3)), this.setAttribute("uv", new je(o, 2)), this.computeVertexNormals(); function a(s) { const c = [], l = t.curveSegments !== void 0 ? t.curveSegments : 12, h = t.steps !== void 0 ? t.steps : 1; let u = t.depth !== void 0 ? t.depth : 100, p = t.bevelEnabled !== void 0 ? t.bevelEnabled : !0, g = t.bevelThickness !== void 0 ? t.bevelThickness : 6, m = t.bevelSize !== void 0 ? t.bevelSize : g - 2, d = t.bevelOffset !== void 0 ? t.bevelOffset : 0, y = t.bevelSegments !== void 0 ? t.bevelSegments : 3; const f = t.extrudePath, v = t.UVGenerator !== void 0 ? t.UVGenerator : dB; t.amount !== void 0 && (console.warn("THREE.ExtrudeBufferGeometry: amount has been renamed to depth."), u = t.amount); let M, S = !1, T, x, w, A; f && (M = f.getSpacedPoints(h), S = !0, p = !1, T = f.computeFrenetFrames(h, !1), x = new Z(), w = new Z(), A = new Z()), p || (y = 0, g = 0, m = 0, d = 0); const _ = s.extractPoints(l); let E = _.shape; const O = _.holes; if (!Dr.isClockWise(E)) { E = E.reverse(); for (let W = 0, K = O.length; W < K; W++) { const ie = O[W]; Dr.isClockWise(ie) && (O[W] = ie.reverse()); } } const L = Dr.triangulateShape(E, O), C = E; for (let W = 0, K = O.length; W < K; W++) { const ie = O[W]; E = E.concat(ie); } function I(W, K, ie) { return K || console.error("THREE.ExtrudeGeometry: vec does not exist"), K.clone().multiplyScalar(ie).add(W); } const R = E.length, b = L.length; function P(W, K, ie) { let B, j, re; const F = W.x - K.x, U = W.y - K.y, se = ie.x - W.x, ue = ie.y - W.y, fe = F * F + U * U, ve = F * ue - U * se; if (Math.abs(ve) > Number.EPSILON) { const _e = Math.sqrt(fe), ae = Math.sqrt(se * se + ue * ue), Te = K.x - U / _e, Ee = K.y + F / _e, oe = ie.x - ue / ae, Me = ie.y + se / ae, ye = ((oe - Te) * ue - (Me - Ee) * se) / (F * ue - U * se); B = Te + F * ye - W.x, j = Ee + U * ye - W.y; const we = B * B + j * j; if (we <= 2) return new Oe(B, j); re = Math.sqrt(we / 2); } else { let _e = !1; F > Number.EPSILON ? se > Number.EPSILON && (_e = !0) : F < -Number.EPSILON ? se < -Number.EPSILON && (_e = !0) : Math.sign(U) === Math.sign(ue) && (_e = !0), _e ? (B = -U, j = F, re = Math.sqrt(fe)) : (B = F, j = U, re = Math.sqrt(fe / 2)); } return new Oe(B / re, j / re); } const N = []; for (let W = 0, K = C.length, ie = K - 1, B = W + 1; W < K; W++, ie++, B++) ie === K && (ie = 0), B === K && (B = 0), N[W] = P(C[W], C[ie], C[B]); const D = []; let k, V = N.concat(); for (let W = 0, K = O.length; W < K; W++) { const ie = O[W]; k = []; for (let B = 0, j = ie.length, re = j - 1, F = B + 1; B < j; B++, re++, F++) re === j && (re = 0), F === j && (F = 0), k[B] = P(ie[B], ie[re], ie[F]); D.push(k), V = V.concat(k); } for (let W = 0; W < y; W++) { const K = W / y, ie = g * Math.cos(K * Math.PI / 2), B = m * Math.sin(K * Math.PI / 2) + d; for (let j = 0, re = C.length; j < re; j++) { const F = I(C[j], N[j], B); z(F.x, F.y, -ie); } for (let j = 0, re = O.length; j < re; j++) { const F = O[j]; k = D[j]; for (let U = 0, se = F.length; U < se; U++) { const ue = I(F[U], k[U], B); z(ue.x, ue.y, -ie); } } } const q = m + d; for (let W = 0; W < R; W++) { const K = p ? I(E[W], V[W], q) : E[W]; S ? (w.copy(T.normals[0]).multiplyScalar(K.x), x.copy(T.binormals[0]).multiplyScalar(K.y), A.copy(M[0]).add(w).add(x), z(A.x, A.y, A.z)) : z(K.x, K.y, 0); } for (let W = 1; W <= h; W++) for (let K = 0; K < R; K++) { const ie = p ? I(E[K], V[K], q) : E[K]; S ? (w.copy(T.normals[W]).multiplyScalar(ie.x), x.copy(T.binormals[W]).multiplyScalar(ie.y), A.copy(M[W]).add(w).add(x), z(A.x, A.y, A.z)) : z(ie.x, ie.y, u / h * W); } for (let W = y - 1; W >= 0; W--) { const K = W / y, ie = g * Math.cos(K * Math.PI / 2), B = m * Math.sin(K * Math.PI / 2) + d; for (let j = 0, re = C.length; j < re; j++) { const F = I(C[j], N[j], B); z(F.x, F.y, u + ie); } for (let j = 0, re = O.length; j < re; j++) { const F = O[j]; k = D[j]; for (let U = 0, se = F.length; U < se; U++) { const ue = I(F[U], k[U], B); S ? z(ue.x, ue.y + M[h - 1].y, M[h - 1].x + ie) : z(ue.x, ue.y, u + ie); } } } Y(), ne(); function Y() { const W = n.length / 3; if (p) { let K = 0, ie = R * K; for (let B = 0; B < b; B++) { const j = L[B]; H(j[2] + ie, j[1] + ie, j[0] + ie); } K = h + y * 2, ie = R * K; for (let B = 0; B < b; B++) { const j = L[B]; H(j[0] + ie, j[1] + ie, j[2] + ie); } } else { for (let K = 0; K < b; K++) { const ie = L[K]; H(ie[2], ie[1], ie[0]); } for (let K = 0; K < b; K++) { const ie = L[K]; H(ie[0] + R * h, ie[1] + R * h, ie[2] + R * h); } } r.addGroup(W, n.length / 3 - W, 0); } function ne() { const W = n.length / 3; let K = 0; X(C, K), K += C.length; for (let ie = 0, B = O.length; ie < B; ie++) { const j = O[ie]; X(j, K), K += j.length; } r.addGroup(W, n.length / 3 - W, 1); } function X(W, K) { let ie = W.length; for (; --ie >= 0; ) { const B = ie; let j = ie - 1; j < 0 && (j = W.length - 1); for (let re = 0, F = h + y * 2; re < F; re++) { const U = R * re, se = R * (re + 1), ue = K + B + U, fe = K + j + U, ve = K + j + se, _e = K + B + se; ee(ue, fe, ve, _e); } } } function z(W, K, ie) { c.push(W), c.push(K), c.push(ie); } function H(W, K, ie) { Q(W), Q(K), Q(ie); const B = n.length / 3, j = v.generateTopUV(r, n, B - 3, B - 2, B - 1); J(j[0]), J(j[1]), J(j[2]); } function ee(W, K, ie, B) { Q(W), Q(K), Q(B), Q(K), Q(ie), Q(B); const j = n.length / 3, re = v.generateSideWallUV(r, n, j - 6, j - 3, j - 2, j - 1); J(re[0]), J(re[1]), J(re[3]), J(re[1]), J(re[2]), J(re[3]); } function Q(W) { n.push(c[W * 3 + 0]), n.push(c[W * 3 + 1]), n.push(c[W * 3 + 2]); } function J(W) { o.push(W.x), o.push(W.y); } } } toJSON() { const e = super.toJSON(), t = this.parameters.shapes, r = this.parameters.options; return pB(t, r, e); } static fromJSON(e, t) { const r = []; for (let o = 0, a = e.shapes.length; o < a; o++) { const s = t[e.shapes[o]]; r.push(s); } const n = e.options.extrudePath; return n !== void 0 && (e.options.extrudePath = new lf[n.type]().fromJSON(n)), new br(r, e.options); } } const dB = { generateTopUV: function(i, e, t, r, n) { const o = e[t * 3], a = e[t * 3 + 1], s = e[r * 3], c = e[r * 3 + 1], l = e[n * 3], h = e[n * 3 + 1]; return [ new Oe(o, a), new Oe(s, c), new Oe(l, h) ]; }, generateSideWallUV: function(i, e, t, r, n, o) { const a = e[t * 3], s = e[t * 3 + 1], c = e[t * 3 + 2], l = e[r * 3], h = e[r * 3 + 1], u = e[r * 3 + 2], p = e[n * 3], g = e[n * 3 + 1], m = e[n * 3 + 2], d = e[o * 3], y = e[o * 3 + 1], f = e[o * 3 + 2]; return Math.abs(s - h) < Math.abs(a - l) ? [ new Oe(a, 1 - c), new Oe(l, 1 - u), new Oe(p, 1 - m), new Oe(d, 1 - f) ] : [ new Oe(s, 1 - c), new Oe(h, 1 - u), new Oe(g, 1 - m), new Oe(y, 1 - f) ]; } }; function pB(i, e, t) { if (t.shapes = [], Array.isArray(i)) for (let r = 0, n = i.length; r < n; r++) { const o = i[r]; t.shapes.push(o.uuid); } else t.shapes.push(i.uuid); return e.extrudePath !== void 0 && (t.options.extrudePath = e.extrudePath.toJSON()), t; } class ja extends zr { constructor(e = 1, t = 0) { const r = (1 + Math.sqrt(5)) / 2, n = [ -1, r, 0, 1, r, 0, -1, -r, 0, 1, -r, 0, 0, -1, r, 0, 1, r, 0, -1, -r, 0, 1, -r, r, 0, -1, r, 0, 1, -r, 0, -1, -r, 0, 1 ], o = [ 0, 11, 5, 0, 5, 1, 0, 1, 7, 0, 7, 10, 0, 10, 11, 1, 5, 9, 5, 11, 4, 11, 10, 2, 10, 7, 6, 7, 1, 8, 3, 9, 4, 3, 4, 2, 3, 2, 6, 3, 6, 8, 3, 8, 9, 4, 9, 5, 2, 4, 11, 6, 2, 10, 8, 6, 7, 9, 8, 1 ]; super(n, o, e, t), this.type = "IcosahedronGeometry", this.parameters = { radius: e, detail: t }; } static fromJSON(e) { return new ja(e.radius, e.detail); } } class Wa extends Je { constructor(e, t = 12, r = 0, n = Math.PI * 2) { super(), this.type = "LatheGeometry", this.parameters = { points: e, segments: t, phiStart: r, phiLength: n }, t = Math.floor(t), n = mi(n, 0, Math.PI * 2); const o = [], a = [], s = [], c = 1 / t, l = new Z(), h = new Oe(); for (let u = 0; u <= t; u++) { const p = r + u * c * n, g = Math.sin(p), m = Math.cos(p); for (let d = 0; d <= e.length - 1; d++) l.x = e[d].x * g, l.y = e[d].y, l.z = e[d].x * m, a.push(l.x, l.y, l.z), h.x = u / t, h.y = d / (e.length - 1), s.push(h.x, h.y); } for (let u = 0; u < t; u++) for (let p = 0; p < e.length - 1; p++) { const g = p + u * e.length, m = g, d = g + e.length, y = g + e.length + 1, f = g + 1; o.push(m, d, f), o.push(d, y, f); } if (this.setIndex(o), this.setAttribute("position", new je(a, 3)), this.setAttribute("uv", new je(s, 2)), this.computeVertexNormals(), n === Math.PI * 2) { const u = this.attributes.normal.array, p = new Z(), g = new Z(), m = new Z(), d = t * e.length * 3; for (let y = 0, f = 0; y < e.length; y++, f += 3) p.x = u[f + 0], p.y = u[f + 1], p.z = u[f + 2], g.x = u[d + f + 0], g.y = u[d + f + 1], g.z = u[d + f + 2], m.addVectors(p, g).normalize(), u[f + 0] = u[d + f + 0] = m.x, u[f + 1] = u[d + f + 1] = m.y, u[f + 2] = u[d + f + 2] = m.z; } } static fromJSON(e) { return new Wa(e.points, e.segments, e.phiStart, e.phiLength); } } class Bo extends zr { constructor(e = 1, t = 0) { const r = [ 1, 0, 0, -1, 0, 0, 0, 1, 0, 0, -1, 0, 0, 0, 1, 0, 0, -1 ], n = [ 0, 2, 4, 0, 4, 3, 0, 3, 5, 0, 5, 2, 1, 2, 5, 1, 5, 3, 1, 3, 4, 1, 4, 2 ]; super(r, n, e, t), this.type = "OctahedronGeometry", this.parameters = { radius: e, detail: t }; } static fromJSON(e) { return new Bo(e.radius, e.detail); } } class tu extends Je { constructor(e, t, r) { super(), this.type = "ParametricGeometry", this.parameters = { func: e, slices: t, stacks: r }; const n = [], o = [], a = [], s = [], c = 1e-5, l = new Z(), h = new Z(), u = new Z(), p = new Z(), g = new Z(); e.length < 3 && console.error("THREE.ParametricGeometry: Function must now modify a Vector3 as third parameter."); const m = t + 1; for (let d = 0; d <= r; d++) { const y = d / r; for (let f = 0; f <= t; f++) { const v = f / t; e(v, y, h), o.push(h.x, h.y, h.z), v - c >= 0 ? (e(v - c, y, u), p.subVectors(h, u)) : (e(v + c, y, u), p.subVectors(u, h)), y - c >= 0 ? (e(v, y - c, u), g.subVectors(h, u)) : (e(v, y + c, u), g.subVectors(u, h)), l.crossVectors(p, g).normalize(), a.push(l.x, l.y, l.z), s.push(v, y); } } for (let d = 0; d < r; d++) for (let y = 0; y < t; y++) { const f = d * m + y, v = d * m + y + 1, M = (d + 1) * m + y + 1, S = (d + 1) * m + y; n.push(f, v, S), n.push(v, M, S); } this.setIndex(n), this.setAttribute("position", new je(o, 3)), this.setAttribute("normal", new je(a, 3)), this.setAttribute("uv", new je(s, 2)); } } class $a extends Je { constructor(e = 0.5, t = 1, r = 8, n = 1, o = 0, a = Math.PI * 2) { super(), this.type = "RingGeometry", this.parameters = { innerRadius: e, outerRadius: t, thetaSegments: r, phiSegments: n, thetaStart: o, thetaLength: a }, r = Math.max(3, r), n = Math.max(1, n); const s = [], c = [], l = [], h = []; let u = e; const p = (t - e) / n, g = new Z(), m = new Oe(); for (let d = 0; d <= n; d++) { for (let y = 0; y <= r; y++) { const f = o + y / r * a; g.x = u * Math.cos(f), g.y = u * Math.sin(f), c.push(g.x, g.y, g.z), l.push(0, 0, 1), m.x = (g.x / t + 1) / 2, m.y = (g.y / t + 1) / 2, h.push(m.x, m.y); } u += p; } for (let d = 0; d < n; d++) { const y = d * (r + 1); for (let f = 0; f < r; f++) { const v = f + y, M = v, S = v + r + 1, T = v + r + 2, x = v + 1; s.push(M, S, x), s.push(S, T, x); } } this.setIndex(s), this.setAttribute("position", new je(c, 3)), this.setAttribute("normal", new je(l, 3)), this.setAttribute("uv", new je(h, 2)); } static fromJSON(e) { return new $a(e.innerRadius, e.outerRadius, e.thetaSegments, e.phiSegments, e.thetaStart, e.thetaLength); } } class ko extends Je { constructor(e, t = 12) { super(), this.type = "ShapeGeometry", this.parameters = { shapes: e, curveSegments: t }; const r = [], n = [], o = [], a = []; let s = 0, c = 0; if (Array.isArray(e) === !1) l(e); else for (let h = 0; h < e.length; h++) l(e[h]), this.addGroup(s, c, h), s += c, c = 0; this.setIndex(r), this.setAttribute("position", new je(n, 3)), this.setAttribute("normal", new je(o, 3)), this.setAttribute("uv", new je(a, 2)); function l(h) { const u = n.length / 3, p = h.extractPoints(t); let g = p.shape; const m = p.holes; Dr.isClockWise(g) === !1 && (g = g.reverse()); for (let y = 0, f = m.length; y < f; y++) { const v = m[y]; Dr.isClockWise(v) === !0 && (m[y] = v.reverse()); } const d = Dr.triangulateShape(g, m); for (let y = 0, f = m.length; y < f; y++) { const v = m[y]; g = g.concat(v); } for (let y = 0, f = g.length; y < f; y++) { const v = g[y]; n.push(v.x, v.y, 0), o.push(0, 0, 1), a.push(v.x, v.y); } for (let y = 0, f = d.length; y < f; y++) { const v = d[y], M = v[0] + u, S = v[1] + u, T = v[2] + u; r.push(M, S, T), c += 3; } } } toJSON() { const e = super.toJSON(), t = this.parameters.shapes; return fB(t, e); } static fromJSON(e, t) { const r = []; for (let n = 0, o = e.shapes.length; n < o; n++) { const a = t[e.shapes[n]]; r.push(a); } return new ko(r, e.curveSegments); } } function fB(i, e) { if (e.shapes = [], Array.isArray(i)) for (let t = 0, r = i.length; t < r; t++) { const n = i[t]; e.shapes.push(n.uuid); } else e.shapes.push(i.uuid); return e; } class zo extends Je { constructor(e = 1, t = 8, r = 6, n = 0, o = Math.PI * 2, a = 0, s = Math.PI) { super(), this.type = "SphereGeometry", this.parameters = { radius: e, widthSegments: t, heightSegments: r, phiStart: n, phiLength: o, thetaStart: a, thetaLength: s }, t = Math.max(3, Math.floor(t)), r = Math.max(2, Math.floor(r)); const c = Math.min(a + s, Math.PI); let l = 0; const h = [], u = new Z(), p = new Z(), g = [], m = [], d = [], y = []; for (let f = 0; f <= r; f++) { const v = [], M = f / r; let S = 0; f == 0 && a == 0 ? S = 0.5 / t : f == r && c == Math.PI && (S = -0.5 / t); for (let T = 0; T <= t; T++) { const x = T / t; u.x = -e * Math.cos(n + x * o) * Math.sin(a + M * s), u.y = e * Math.cos(a + M * s), u.z = e * Math.sin(n + x * o) * Math.sin(a + M * s), m.push(u.x, u.y, u.z), p.copy(u).normalize(), d.push(p.x, p.y, p.z), y.push(x + S, 1 - M), v.push(l++); } h.push(v); } for (let f = 0; f < r; f++) for (let v = 0; v < t; v++) { const M = h[f][v + 1], S = h[f][v], T = h[f + 1][v], x = h[f + 1][v + 1]; (f !== 0 || a > 0) && g.push(M, S, x), (f !== r - 1 || c < Math.PI) && g.push(S, T, x); } this.setIndex(g), this.setAttribute("position", new je(m, 3)), this.setAttribute("normal", new je(d, 3)), this.setAttribute("uv", new je(y, 2)); } static fromJSON(e) { return new zo(e.radius, e.widthSegments, e.heightSegments, e.phiStart, e.phiLength, e.thetaStart, e.thetaLength); } } class qa extends zr { constructor(e = 1, t = 0) { const r = [ 1, 1, 1, -1, -1, 1, -1, 1, -1, 1, -1, -1 ], n = [ 2, 1, 0, 0, 3, 2, 1, 3, 0, 2, 3, 1 ]; super(r, n, e, t), this.type = "TetrahedronGeometry", this.parameters = { radius: e, detail: t }; } static fromJSON(e) { return new qa(e.radius, e.detail); } } class iu extends br { constructor(e, t = {}) { const r = t.font; if (!(r && r.isFont)) return console.error("THREE.TextGeometry: font parameter is not an instance of THREE.Font."), new Je(); const n = r.generateShapes(e, t.size); t.depth = t.height !== void 0 ? t.height : 50, t.bevelThickness === void 0 && (t.bevelThickness = 10), t.bevelSize === void 0 && (t.bevelSize = 8), t.bevelEnabled === void 0 && (t.bevelEnabled = !1), super(n, t), this.type = "TextGeometry"; } } class Xa extends Je { constructor(e = 1, t = 0.4, r = 8, n = 6, o = Math.PI * 2) { super(), this.type = "TorusGeometry", this.parameters = { radius: e, tube: t, radialSegments: r, tubularSegments: n, arc: o }, r = Math.floor(r), n = Math.floor(n); const a = [], s = [], c = [], l = [], h = new Z(), u = new Z(), p = new Z(); for (let g = 0; g <= r; g++) for (let m = 0; m <= n; m++) { const d = m / n * o, y = g / r * Math.PI * 2; u.x = (e + t * Math.cos(y)) * Math.cos(d), u.y = (e + t * Math.cos(y)) * Math.sin(d), u.z = t * Math.sin(y), s.push(u.x, u.y, u.z), h.x = e * Math.cos(d), h.y = e * Math.sin(d), p.subVectors(u, h).normalize(), c.push(p.x, p.y, p.z), l.push(m / n), l.push(g / r); } for (let g = 1; g <= r; g++) for (let m = 1; m <= n; m++) { const d = (n + 1) * g + m - 1, y = (n + 1) * (g - 1) + m - 1, f = (n + 1) * (g - 1) + m, v = (n + 1) * g + m; a.push(d, y, v), a.push(y, f, v); } this.setIndex(a), this.setAttribute("position", new je(s, 3)), this.setAttribute("normal", new je(c, 3)), this.setAttribute("uv", new je(l, 2)); } static fromJSON(e) { return new Xa(e.radius, e.tube, e.radialSegments, e.tubularSegments, e.arc); } } class Za extends Je { constructor(e = 1, t = 0.4, r = 64, n = 8, o = 2, a = 3) { super(), this.type = "TorusKnotGeometry", this.parameters = { radius: e, tube: t, tubularSegments: r, radialSegments: n, p: o, q: a }, r = Math.floor(r), n = Math.floor(n); const s = [], c = [], l = [], h = [], u = new Z(), p = new Z(), g = new Z(), m = new Z(), d = new Z(), y = new Z(), f = new Z(); for (let M = 0; M <= r; ++M) { const S = M / r * o * Math.PI * 2; v(S, o, a, e, g), v(S + 0.01, o, a, e, m), y.subVectors(m, g), f.addVectors(m, g), d.crossVectors(y, f), f.crossVectors(d, y), d.normalize(), f.normalize(); for (let T = 0; T <= n; ++T) { const x = T / n * Math.PI * 2, w = -t * Math.cos(x), A = t * Math.sin(x); u.x = g.x + (w * f.x + A * d.x), u.y = g.y + (w * f.y + A * d.y), u.z = g.z + (w * f.z + A * d.z), c.push(u.x, u.y, u.z), p.subVectors(u, g).normalize(), l.push(p.x, p.y, p.z), h.push(M / r), h.push(T / n); } } for (let M = 1; M <= r; M++) for (let S = 1; S <= n; S++) { const T = (n + 1) * (M - 1) + (S - 1), x = (n + 1) * M + (S - 1), w = (n + 1) * M + S, A = (n + 1) * (M - 1) + S; s.push(T, x, A), s.push(x, w, A); } this.setIndex(s), this.setAttribute("position", new je(c, 3)), this.setAttribute("normal", new je(l, 3)), this.setAttribute("uv", new je(h, 2)); function v(M, S, T, x, w) { const A = Math.cos(M), _ = Math.sin(M), E = T / S * M, O = Math.cos(E); w.x = x * (2 + O) * 0.5 * A, w.y = x * (2 + O) * _ * 0.5, w.z = x * Math.sin(E) * 0.5; } } static fromJSON(e) { return new Za(e.radius, e.tube, e.tubularSegments, e.radialSegments, e.p, e.q); } } class Ya extends Je { constructor(e, t = 64, r = 1, n = 8, o = !1) { super(), this.type = "TubeGeometry", this.parameters = { path: e, tubularSegments: t, radius: r, radialSegments: n, closed: o }; const a = e.computeFrenetFrames(t, o); this.tangents = a.tangents, this.normals = a.normals, this.binormals = a.binormals; const s = new Z(), c = new Z(), l = new Oe(); let h = new Z(); const u = [], p = [], g = [], m = []; d(), this.setIndex(m), this.setAttribute("position", new je(u, 3)), this.setAttribute("normal", new je(p, 3)), this.setAttribute("uv", new je(g, 2)); function d() { for (let M = 0; M < t; M++) y(M); y(o === !1 ? t : 0), v(), f(); } function y(M) { h = e.getPointAt(M / t, h); const S = a.normals[M], T = a.binormals[M]; for (let x = 0; x <= n; x++) { const w = x / n * Math.PI * 2, A = Math.sin(w), _ = -Math.cos(w); c.x = _ * S.x + A * T.x, c.y = _ * S.y + A * T.y, c.z = _ * S.z + A * T.z, c.normalize(), p.push(c.x, c.y, c.z), s.x = h.x + r * c.x, s.y = h.y + r * c.y, s.z = h.z + r * c.z, u.push(s.x, s.y, s.z); } } function f() { for (let M = 1; M <= t; M++) for (let S = 1; S <= n; S++) { const T = (n + 1) * (M - 1) + (S - 1), x = (n + 1) * M + (S - 1), w = (n + 1) * M + S, A = (n + 1) * (M - 1) + S; m.push(T, x, A), m.push(x, w, A); } } function v() { for (let M = 0; M <= t; M++) for (let S = 0; S <= n; S++) l.x = M / t, l.y = S / n, g.push(l.x, l.y); } } toJSON() { const e = super.toJSON(); return e.path = this.parameters.path.toJSON(), e; } static fromJSON(e) { return new Ya( new lf[e.path.type]().fromJSON(e.path), e.tubularSegments, e.radius, e.radialSegments, e.closed ); } } class cf extends Je { constructor(e) { if (super(), this.type = "WireframeGeometry", e.isGeometry === !0) { console.error("THREE.WireframeGeometry no longer supports THREE.Geometry. Use THREE.BufferGeometry instead."); return; } const t = [], r = [0, 0], n = {}, o = new Z(); if (e.index !== null) { const a = e.attributes.position, s = e.index; let c = e.groups; c.length === 0 && (c = [{ start: 0, count: s.count, materialIndex: 0 }]); for (let l = 0, h = c.length; l < h; ++l) { const u = c[l], p = u.start, g = u.count; for (let m = p, d = p + g; m < d; m += 3) for (let y = 0; y < 3; y++) { const f = s.getX(m + y), v = s.getX(m + (y + 1) % 3); r[0] = Math.min(f, v), r[1] = Math.max(f, v); const M = r[0] + "," + r[1]; n[M] === void 0 && (n[M] = { index1: r[0], index2: r[1] }); } } for (const l in n) { const h = n[l]; o.fromBufferAttribute(a, h.index1), t.push(o.x, o.y, o.z), o.fromBufferAttribute(a, h.index2), t.push(o.x, o.y, o.z); } } else { const a = e.attributes.position; for (let s = 0, c = a.count / 3; s < c; s++) for (let l = 0; l < 3; l++) { const h = 3 * s + l; o.fromBufferAttribute(a, h), t.push(o.x, o.y, o.z); const u = 3 * s + (l + 1) % 3; o.fromBufferAttribute(a, u), t.push(o.x, o.y, o.z); } } this.setAttribute("position", new je(t, 3)); } } var ov = /* @__PURE__ */ Object.freeze({ __proto__: null, BoxGeometry: un, BoxBufferGeometry: un, CircleGeometry: Ua, CircleBufferGeometry: Ua, ConeGeometry: Ga, ConeBufferGeometry: Ga, CylinderGeometry: Yn, CylinderBufferGeometry: Yn, DodecahedronGeometry: Ha, DodecahedronBufferGeometry: Ha, EdgesGeometry: tf, ExtrudeGeometry: br, ExtrudeBufferGeometry: br, IcosahedronGeometry: ja, IcosahedronBufferGeometry: ja, LatheGeometry: Wa, LatheBufferGeometry: Wa, OctahedronGeometry: Bo, OctahedronBufferGeometry: Bo, ParametricGeometry: tu, ParametricBufferGeometry: tu, PlaneGeometry: No, PlaneBufferGeometry: No, PolyhedronGeometry: zr, PolyhedronBufferGeometry: zr, RingGeometry: $a, RingBufferGeometry: $a, ShapeGeometry: ko, ShapeBufferGeometry: ko, SphereGeometry: zo, SphereBufferGeometry: zo, TetrahedronGeometry: qa, TetrahedronBufferGeometry: qa, TextGeometry: iu, TextBufferGeometry: iu, TorusGeometry: Xa, TorusBufferGeometry: Xa, TorusKnotGeometry: Za, TorusKnotBufferGeometry: Za, TubeGeometry: Ya, TubeBufferGeometry: Ya, WireframeGeometry: cf }); class uf extends Qt { constructor(e) { super(), this.type = "ShadowMaterial", this.color = new Be(0), this.transparent = !0, this.setValues(e); } copy(e) { return super.copy(e), this.color.copy(e.color), this; } } uf.prototype.isShadowMaterial = !0; class ds extends hn { constructor(e) { super(e), this.type = "RawShaderMaterial"; } } ds.prototype.isRawShaderMaterial = !0; class $o extends Qt { constructor(e) { super(), this.defines = { STANDARD: "" }, this.type = "MeshStandardMaterial", this.color = new Be(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 Be(0), this.emissiveIntensity = 1, this.emissiveMap = null, this.bumpMap = null, this.bumpScale = 1, this.normalMap = null, this.normalMapType = eo, this.normalScale = new Oe(1, 1), this.displacementMap = null, this.displacementScale = 1, this.displacementBias = 0, this.roughnessMap = null, this.metalnessMap = null, this.alphaMap = null, this.envMap = null, this.envMapIntensity = 1, this.refractionRatio = 0.98, this.wireframe = !1, this.wireframeLinewidth = 1, this.wireframeLinecap = "round", this.wireframeLinejoin = "round", this.morphTargets = !1, this.morphNormals = !1, this.flatShading = !1, this.vertexTangents = !1, 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.envMapIntensity = e.envMapIntensity, this.refractionRatio = e.refractionRatio, this.wireframe = e.wireframe, this.wireframeLinewidth = e.wireframeLinewidth, this.wireframeLinecap = e.wireframeLinecap, this.wireframeLinejoin = e.wireframeLinejoin, this.morphTargets = e.morphTargets, this.morphNormals = e.morphNormals, this.flatShading = e.flatShading, this.vertexTangents = e.vertexTangents, this; } } $o.prototype.isMeshStandardMaterial = !0; class Pl extends $o { constructor(e) { super(), this.defines = { STANDARD: "", PHYSICAL: "" }, this.type = "MeshPhysicalMaterial", this.clearcoat = 0, this.clearcoatMap = null, this.clearcoatRoughness = 0, this.clearcoatRoughnessMap = null, this.clearcoatNormalScale = new Oe(1, 1), this.clearcoatNormalMap = null, this.reflectivity = 0.5, Object.defineProperty(this, "ior", { get: function() { return (1 + 0.4 * this.reflectivity) / (1 - 0.4 * this.reflectivity); }, set: function(t) { this.reflectivity = mi(2.5 * (t - 1) / (t + 1), 0, 1); } }), this.sheen = null, this.transmission = 0, this.transmissionMap = null, this.thickness = 0.01, this.thicknessMap = null, this.attenuationDistance = 0, this.attenuationColor = new Be(1, 1, 1), this.setValues(e); } copy(e) { return super.copy(e), this.defines = { STANDARD: "", PHYSICAL: "" }, 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.reflectivity = e.reflectivity, e.sheen ? this.sheen = (this.sheen || new Be()).copy(e.sheen) : this.sheen = null, 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; } } Pl.prototype.isMeshPhysicalMaterial = !0; class hf extends Qt { constructor(e) { super(), this.type = "MeshPhongMaterial", this.color = new Be(16777215), this.specular = new Be(1118481), this.shininess = 30, this.map = null, this.lightMap = null, this.lightMapIntensity = 1, this.aoMap = null, this.aoMapIntensity = 1, this.emissive = new Be(0), this.emissiveIntensity = 1, this.emissiveMap = null, this.bumpMap = null, this.bumpScale = 1, this.normalMap = null, this.normalMapType = eo, this.normalScale = new Oe(1, 1), this.displacementMap = null, this.displacementScale = 1, this.displacementBias = 0, this.specularMap = null, this.alphaMap = null, this.envMap = null, this.combine = vl, this.reflectivity = 1, this.refractionRatio = 0.98, this.wireframe = !1, this.wireframeLinewidth = 1, this.wireframeLinecap = "round", this.wireframeLinejoin = "round", this.morphTargets = !1, this.morphNormals = !1, this.flatShading = !1, this.setValues(e); } copy(e) { return super.copy(e), this.color.copy(e.color), this.specular.copy(e.specular), this.shininess = e.shininess, 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.specularMap = e.specularMap, this.alphaMap = e.alphaMap, this.envMap = e.envMap, 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.morphTargets = e.morphTargets, this.morphNormals = e.morphNormals, this.flatShading = e.flatShading, this; } } hf.prototype.isMeshPhongMaterial = !0; class df extends Qt { constructor(e) { super(), this.defines = { TOON: "" }, this.type = "MeshToonMaterial", this.color = new Be(16777215), this.map = null, this.gradientMap = null, this.lightMap = null, this.lightMapIntensity = 1, this.aoMap = null, this.aoMapIntensity = 1, this.emissive = new Be(0), this.emissiveIntensity = 1, this.emissiveMap = null, this.bumpMap = null, this.bumpScale = 1, this.normalMap = null, this.normalMapType = eo, this.normalScale = new Oe(1, 1), this.displacementMap = null, this.displacementScale = 1, this.displacementBias = 0, this.alphaMap = null, this.wireframe = !1, this.wireframeLinewidth = 1, this.wireframeLinecap = "round", this.wireframeLinejoin = "round", this.morphTargets = !1, this.morphNormals = !1, this.setValues(e); } copy(e) { return super.copy(e), this.color.copy(e.color), this.map = e.map, this.gradientMap = e.gradientMap, 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.alphaMap = e.alphaMap, this.wireframe = e.wireframe, this.wireframeLinewidth = e.wireframeLinewidth, this.wireframeLinecap = e.wireframeLinecap, this.wireframeLinejoin = e.wireframeLinejoin, this.morphTargets = e.morphTargets, this.morphNormals = e.morphNormals, this; } } df.prototype.isMeshToonMaterial = !0; class pf extends Qt { constructor(e) { super(), this.type = "MeshNormalMaterial", this.bumpMap = null, this.bumpScale = 1, this.normalMap = null, this.normalMapType = eo, this.normalScale = new Oe(1, 1), this.displacementMap = null, this.displacementScale = 1, this.displacementBias = 0, this.wireframe = !1, this.wireframeLinewidth = 1, this.fog = !1, this.morphTargets = !1, this.morphNormals = !1, this.flatShading = !1, this.setValues(e); } copy(e) { return super.copy(e), 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.wireframe = e.wireframe, this.wireframeLinewidth = e.wireframeLinewidth, this.morphTargets = e.morphTargets, this.morphNormals = e.morphNormals, this.flatShading = e.flatShading, this; } } pf.prototype.isMeshNormalMaterial = !0; class ff extends Qt { constructor(e) { super(), this.type = "MeshLambertMaterial", this.color = new Be(16777215), this.map = null, this.lightMap = null, this.lightMapIntensity = 1, this.aoMap = null, this.aoMapIntensity = 1, this.emissive = new Be(0), this.emissiveIntensity = 1, this.emissiveMap = null, this.specularMap = null, this.alphaMap = null, this.envMap = null, this.combine = vl, this.reflectivity = 1, this.refractionRatio = 0.98, this.wireframe = !1, this.wireframeLinewidth = 1, this.wireframeLinecap = "round", this.wireframeLinejoin = "round", this.morphTargets = !1, this.morphNormals = !1, 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.emissive.copy(e.emissive), this.emissiveMap = e.emissiveMap, this.emissiveIntensity = e.emissiveIntensity, this.specularMap = e.specularMap, this.alphaMap = e.alphaMap, this.envMap = e.envMap, 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.morphTargets = e.morphTargets, this.morphNormals = e.morphNormals, this; } } ff.prototype.isMeshLambertMaterial = !0; class mf extends Qt { constructor(e) { super(), this.defines = { MATCAP: "" }, this.type = "MeshMatcapMaterial", this.color = new Be(16777215), this.matcap = null, this.map = null, this.bumpMap = null, this.bumpScale = 1, this.normalMap = null, this.normalMapType = eo, this.normalScale = new Oe(1, 1), this.displacementMap = null, this.displacementScale = 1, this.displacementBias = 0, this.alphaMap = null, this.morphTargets = !1, this.morphNormals = !1, this.flatShading = !1, this.setValues(e); } copy(e) { return super.copy(e), this.defines = { MATCAP: "" }, this.color.copy(e.color), this.matcap = e.matcap, this.map = e.map, 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.alphaMap = e.alphaMap, this.morphTargets = e.morphTargets, this.morphNormals = e.morphNormals, this.flatShading = e.flatShading, this; } } mf.prototype.isMeshMatcapMaterial = !0; class gf extends ni { constructor(e) { super(), this.type = "LineDashedMaterial", this.scale = 1, this.dashSize = 3, this.gapSize = 1, this.setValues(e); } copy(e) { return super.copy(e), this.scale = e.scale, this.dashSize = e.dashSize, this.gapSize = e.gapSize, this; } } gf.prototype.isLineDashedMaterial = !0; var mB = /* @__PURE__ */ Object.freeze({ __proto__: null, ShadowMaterial: uf, SpriteMaterial: Tl, RawShaderMaterial: ds, ShaderMaterial: hn, PointsMaterial: no, MeshPhysicalMaterial: Pl, MeshStandardMaterial: $o, MeshPhongMaterial: hf, MeshToonMaterial: df, MeshNormalMaterial: pf, MeshLambertMaterial: ff, MeshDepthMaterial: Iu, MeshDistanceMaterial: Du, MeshBasicMaterial: ki, MeshMatcapMaterial: mf, LineDashedMaterial: gf, LineBasicMaterial: ni, Material: Qt }); const Lt = { // same as Array.prototype.slice, but also works on typed arrays arraySlice: function(i, e, t) { return Lt.isTypedArray(i) ? new i.constructor(i.subarray(e, t !== void 0 ? t : i.length)) : i.slice(e, t); }, // converts an array to a specific type convertArray: function(i, e, t) { return !i || // let 'undefined' and 'null' pass !t && i.constructor === e ? i : typeof e.BYTES_PER_ELEMENT == "number" ? new e(i) : Array.prototype.slice.call(i); }, isTypedArray: function(i) { return ArrayBuffer.isView(i) && !(i instanceof DataView); }, // returns an array by which times and values can be sorted getKeyframeOrder: function(i) { function e(n, o) { return i[n] - i[o]; } const t = i.length, r = new Array(t); for (let n = 0; n !== t; ++n) r[n] = n; return r.sort(e), r; }, // uses the array previously returned by 'getKeyframeOrder' to sort data sortedArray: function(i, e, t) { const r = i.length, n = new i.constructor(r); for (let o = 0, a = 0; a !== r; ++o) { const s = t[o] * e; for (let c = 0; c !== e; ++c) n[a++] = i[s + c]; } return n; }, // function for parsing AOS keyframe formats flattenJSON: function(i, e, t, r) { let n = 1, o = i[0]; for (; o !== void 0 && o[r] === void 0; ) o = i[n++]; if (o === void 0) return; let a = o[r]; if (a !== void 0) if (Array.isArray(a)) do a = o[r], a !== void 0 && (e.push(o.time), t.push.apply(t, a)), o = i[n++]; while (o !== void 0); else if (a.toArray !== void 0) do a = o[r], a !== void 0 && (e.push(o.time), a.toArray(t, t.length)), o = i[n++]; while (o !== void 0); else do a = o[r], a !== void 0 && (e.push(o.time), t.push(a)), o = i[n++]; while (o !== void 0); }, subclip: function(i, e, t, r, n = 30) { const o = i.clone(); o.name = e; const a = []; for (let c = 0; c < o.tracks.length; ++c) { const l = o.tracks[c], h = l.getValueSize(), u = [], p = []; for (let g = 0; g < l.times.length; ++g) { const m = l.times[g] * n; if (!(m < t || m >= r)) { u.push(l.times[g]); for (let d = 0; d < h; ++d) p.push(l.values[g * h + d]); } } u.length !== 0 && (l.times = Lt.convertArray(u, l.times.constructor), l.values = Lt.convertArray(p, l.values.constructor), a.push(l)); } o.tracks = a; let s = 1 / 0; for (let c = 0; c < o.tracks.length; ++c) s > o.tracks[c].times[0] && (s = o.tracks[c].times[0]); for (let c = 0; c < o.tracks.length; ++c) o.tracks[c].shift(-1 * s); return o.resetDuration(), o; }, makeClipAdditive: function(i, e = 0, t = i, r = 30) { r <= 0 && (r = 30); const n = t.tracks.length, o = e / r; for (let a = 0; a < n; ++a) { const s = t.tracks[a], c = s.ValueTypeName; if (c === "bool" || c === "string") continue; const l = i.tracks.find(function(f) { return f.name === s.name && f.ValueTypeName === c; }); if (l === void 0) continue; let h = 0; const u = s.getValueSize(); s.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline && (h = u / 3); let p = 0; const g = l.getValueSize(); l.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline && (p = g / 3); const m = s.times.length - 1; let d; if (o <= s.times[0]) { const f = h, v = u - h; d = Lt.arraySlice(s.values, f, v); } else if (o >= s.times[m]) { const f = m * u + h, v = f + u - h; d = Lt.arraySlice(s.values, f, v); } else { const f = s.createInterpolant(), v = h, M = u - h; f.evaluate(o), d = Lt.arraySlice(f.resultBuffer, v, M); } c === "quaternion" && new vi().fromArray(d).normalize().conjugate().toArray(d); const y = l.times.length; for (let f = 0; f < y; ++f) { const v = f * g + p; if (c === "quaternion") vi.multiplyQuaternionsFlat( l.values, v, d, 0, l.values, v ); else { const M = g - p * 2; for (let S = 0; S < M; ++S) l.values[v + S] -= d[S]; } } } return i.blendMode = Gp, i; } }; class Fr { constructor(e, t, r, n) { this.parameterPositions = e, this._cachedIndex = 0, this.resultBuffer = n !== void 0 ? n : new t.constructor(r), this.sampleValues = t, this.valueSize = r, this.settings = null, this.DefaultSettings_ = {}; } evaluate(e) { const t = this.parameterPositions; let r = this._cachedIndex, n = t[r], o = t[r - 1]; e: { t: { let a; i: { r: if (!(e < n)) { for (let s = r + 2; ; ) { if (n === void 0) { if (e < o) break r; return r = t.length, this._cachedIndex = r, this.afterEnd_(r - 1, e, o); } if (r === s) break; if (o = n, n = t[++r], e < n) break t; } a = t.length; break i; } if (!(e >= o)) { const s = t[1]; e < s && (r = 2, o = s); for (let c = r - 2; ; ) { if (o === void 0) return this._cachedIndex = 0, this.beforeStart_(0, e, n); if (r === c) break; if (n = o, o = t[--r - 1], e >= o) break t; } a = r, r = 0; break i; } break e; } for (; r < a; ) { const s = r + a >>> 1; e < t[s] ? a = s : r = s + 1; } if (n = t[r], o = t[r - 1], o === void 0) return this._cachedIndex = 0, this.beforeStart_(0, e, n); if (n === void 0) return r = t.length, this._cachedIndex = r, this.afterEnd_(r - 1, o, e); } this._cachedIndex = r, this.intervalChanged_(r, o, n); } return this.interpolate_(r, o, e, n); } getSettings_() { return this.settings || this.DefaultSettings_; } copySampleValue_(e) { const t = this.resultBuffer, r = this.sampleValues, n = this.valueSize, o = e * n; for (let a = 0; a !== n; ++a) t[a] = r[o + a]; return t; } // Template methods for derived classes: interpolate_() { throw new Error("call to abstract method"); } intervalChanged_() { } } Fr.prototype.beforeStart_ = Fr.prototype.copySampleValue_; Fr.prototype.afterEnd_ = Fr.prototype.copySampleValue_; class Wx extends Fr { constructor(e, t, r, n) { super(e, t, r, n), this._weightPrev = -0, this._offsetPrev = -0, this._weightNext = -0, this._offsetNext = -0, this.DefaultSettings_ = { endingStart: wo, endingEnd: wo }; } intervalChanged_(e, t, r) { const n = this.parameterPositions; let o = e - 2, a = e + 1, s = n[o], c = n[a]; if (s === void 0) switch (this.getSettings_().endingStart) { case _o: o = e, s = 2 * t - r; break; case tl: o = n.length - 2, s = t + n[o] - n[o + 1]; break; default: o = e, s = r; } if (c === void 0) switch (this.getSettings_().endingEnd) { case _o: a = e, c = 2 * r - t; break; case tl: a = 1, c = r + n[1] - n[0]; break; default: a = e - 1, c = t; } const l = (r - t) * 0.5, h = this.valueSize; this._weightPrev = l / (t - s), this._weightNext = l / (c - r), this._offsetPrev = o * h, this._offsetNext = a * h; } interpolate_(e, t, r, n) { const o = this.resultBuffer, a = this.sampleValues, s = this.valueSize, c = e * s, l = c - s, h = this._offsetPrev, u = this._offsetNext, p = this._weightPrev, g = this._weightNext, m = (r - t) / (n - t), d = m * m, y = d * m, f = -p * y + 2 * p * d - p * m, v = (1 + p) * y + (-1.5 - 2 * p) * d + (-0.5 + p) * m + 1, M = (-1 - g) * y + (1.5 + g) * d + 0.5 * m, S = g * y - g * d; for (let T = 0; T !== s; ++T) o[T] = f * a[h + T] + v * a[l + T] + M * a[c + T] + S * a[u + T]; return o; } } class vf extends Fr { constructor(e, t, r, n) { super(e, t, r, n); } interpolate_(e, t, r, n) { const o = this.resultBuffer, a = this.sampleValues, s = this.valueSize, c = e * s, l = c - s, h = (r - t) / (n - t), u = 1 - h; for (let p = 0; p !== s; ++p) o[p] = a[l + p] * u + a[c + p] * h; return o; } } class $x extends Fr { constructor(e, t, r, n) { super(e, t, r, n); } interpolate_(e) { return this.copySampleValue_(e - 1); } } class Mr { constructor(e, t, r, n) { 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 = Lt.convertArray(t, this.TimeBufferType), this.values = Lt.convertArray(r, this.ValueBufferType), this.setInterpolation(n || this.DefaultInterpolation); } // Serialization (in static context, because of constructor invocation // and automatic invocation of .toJSON): static toJSON(e) { const t = e.constructor; let r; if (t.toJSON !== this.toJSON) r = t.toJSON(e); else { r = { name: e.name, times: Lt.convertArray(e.times, Array), values: Lt.convertArray(e.values, Array) }; const n = e.getInterpolation(); n !== e.DefaultInterpolation && (r.interpolation = n); } return r.type = e.ValueTypeName, r; } InterpolantFactoryMethodDiscrete(e) { return new $x(this.times, this.values, this.getValueSize(), e); } InterpolantFactoryMethodLinear(e) { return new vf(this.times, this.values, this.getValueSize(), e); } InterpolantFactoryMethodSmooth(e) { return new Wx(this.times, this.values, this.getValueSize(), e); } setInterpolation(e) { let t; switch (e) { case ka: t = this.InterpolantFactoryMethodDiscrete; break; case Io: t = this.InterpolantFactoryMethodLinear; break; case Vc: t = this.InterpolantFactoryMethodSmooth; break; } if (t === void 0) { const r = "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(r); return console.warn("THREE.KeyframeTrack:", r), this; } return this.createInterpolant = t, this; } getInterpolation() { switch (this.createInterpolant) { case this.InterpolantFactoryMethodDiscrete: return ka; case this.InterpolantFactoryMethodLinear: return Io; case this.InterpolantFactoryMethodSmooth: return Vc; } } getValueSize() { return this.values.length / this.times.length; } // move all keyframes either forwards or backwards in time shift(e) { if (e !== 0) { const t = this.times; for (let r = 0, n = t.length; r !== n; ++r) t[r] += e; } return this; } // scale all keyframe times by a factor (useful for frame <-> seconds conversions) scale(e) { if (e !== 1) { const t = this.times; for (let r = 0, n = t.length; r !== n; ++r) t[r] *= e; } return this; } // removes keyframes before and after animation without changing any values within the range [startTime, endTime]. // IMPORTANT: We do not shift around keys to the start of the track time, because for interpolated keys this will change their values trim(e, t) { const r = this.times, n = r.length; let o = 0, a = n - 1; for (; o !== n && r[o] < e; ) ++o; for (; a !== -1 && r[a] > t; ) --a; if (++a, o !== 0 || a !== n) { o >= a && (a = Math.max(a, 1), o = a - 1); const s = this.getValueSize(); this.times = Lt.arraySlice(r, o, a), this.values = Lt.arraySlice(this.values, o * s, a * s); } return this; } // ensure we do not get a GarbageInGarbageOut situation, make sure tracks are at least minimally viable 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 r = this.times, n = this.values, o = r.length; o === 0 && (console.error("THREE.KeyframeTrack: Track is empty.", this), e = !1); let a = null; for (let s = 0; s !== o; s++) { const c = r[s]; if (typeof c == "number" && isNaN(c)) { console.error("THREE.KeyframeTrack: Time is not a valid number.", this, s, c), e = !1; break; } if (a !== null && a > c) { console.error("THREE.KeyframeTrack: Out of order keys.", this, s, c, a), e = !1; break; } a = c; } if (n !== void 0 && Lt.isTypedArray(n)) for (let s = 0, c = n.length; s !== c; ++s) { const l = n[s]; if (isNaN(l)) { console.error("THREE.KeyframeTrack: Value is not a valid number.", this, s, l), e = !1; break; } } return e; } // removes equivalent sequential keys as common in morph target sequences // (0,0,0,0,1,1,1,0,0,0,0,0,0,0) --> (0,0,1,1,0,0) optimize() { const e = Lt.arraySlice(this.times), t = Lt.arraySlice(this.values), r = this.getValueSize(), n = this.getInterpolation() === Vc, o = e.length - 1; let a = 1; for (let s = 1; s < o; ++s) { let c = !1; const l = e[s], h = e[s + 1]; if (l !== h && (s !== 1 || l !== e[0])) if (n) c = !0; else { const u = s * r, p = u - r, g = u + r; for (let m = 0; m !== r; ++m) { const d = t[u + m]; if (d !== t[p + m] || d !== t[g + m]) { c = !0; break; } } } if (c) { if (s !== a) { e[a] = e[s]; const u = s * r, p = a * r; for (let g = 0; g !== r; ++g) t[p + g] = t[u + g]; } ++a; } } if (o > 0) { e[a] = e[o]; for (let s = o * r, c = a * r, l = 0; l !== r; ++l) t[c + l] = t[s + l]; ++a; } return a !== e.length ? (this.times = Lt.arraySlice(e, 0, a), this.values = Lt.arraySlice(t, 0, a * r)) : (this.times = e, this.values = t), this; } clone() { const e = Lt.arraySlice(this.times, 0), t = Lt.arraySlice(this.values, 0), r = this.constructor, n = new r(this.name, e, t); return n.createInterpolant = this.createInterpolant, n; } } Mr.prototype.TimeBufferType = Float32Array; Mr.prototype.ValueBufferType = Float32Array; Mr.prototype.DefaultInterpolation = Io; class qo extends Mr { } qo.prototype.ValueTypeName = "bool"; qo.prototype.ValueBufferType = Array; qo.prototype.DefaultInterpolation = ka; qo.prototype.InterpolantFactoryMethodLinear = void 0; qo.prototype.InterpolantFactoryMethodSmooth = void 0; class yf extends Mr { } yf.prototype.ValueTypeName = "color"; class Ja extends Mr { } Ja.prototype.ValueTypeName = "number"; class qx extends Fr { constructor(e, t, r, n) { super(e, t, r, n); } interpolate_(e, t, r, n) { const o = this.resultBuffer, a = this.sampleValues, s = this.valueSize, c = (r - t) / (n - t); let l = e * s; for (let h = l + s; l !== h; l += 4) vi.slerpFlat(o, 0, a, l - s, a, l, c); return o; } } class Xo extends Mr { InterpolantFactoryMethodLinear(e) { return new qx(this.times, this.values, this.getValueSize(), e); } } Xo.prototype.ValueTypeName = "quaternion"; Xo.prototype.DefaultInterpolation = Io; Xo.prototype.InterpolantFactoryMethodSmooth = void 0; class Zo extends Mr { } Zo.prototype.ValueTypeName = "string"; Zo.prototype.ValueBufferType = Array; Zo.prototype.DefaultInterpolation = ka; Zo.prototype.InterpolantFactoryMethodLinear = void 0; Zo.prototype.InterpolantFactoryMethodSmooth = void 0; class Ka extends Mr { } Ka.prototype.ValueTypeName = "vector"; class Qa { constructor(e, t = -1, r, n = Eu) { this.name = e, this.tracks = r, this.duration = t, this.blendMode = n, this.uuid = qi(), this.duration < 0 && this.resetDuration(); } static parse(e) { const t = [], r = e.tracks, n = 1 / (e.fps || 1); for (let a = 0, s = r.length; a !== s; ++a) t.push(vB(r[a]).scale(n)); const o = new this(e.name, e.duration, t, e.blendMode); return o.uuid = e.uuid, o; } static toJSON(e) { const t = [], r = e.tracks, n = { name: e.name, duration: e.duration, tracks: t, uuid: e.uuid, blendMode: e.blendMode }; for (let o = 0, a = r.length; o !== a; ++o) t.push(Mr.toJSON(r[o])); return n; } static CreateFromMorphTargetSequence(e, t, r, n) { const o = t.length, a = []; for (let s = 0; s < o; s++) { let c = [], l = []; c.push( (s + o - 1) % o, s, (s + 1) % o ), l.push(0, 1, 0); const h = Lt.getKeyframeOrder(c); c = Lt.sortedArray(c, 1, h), l = Lt.sortedArray(l, 1, h), !n && c[0] === 0 && (c.push(o), l.push(l[0])), a.push( new Ja( ".morphTargetInfluences[" + t[s].name + "]", c, l ).scale(1 / r) ); } return new this(e, -1, a); } static findByName(e, t) { let r = e; if (!Array.isArray(e)) { const n = e; r = n.geometry && n.geometry.animations || n.animations; } for (let n = 0; n < r.length; n++) if (r[n].name === t) return r[n]; return null; } static CreateClipsFromMorphTargetSequences(e, t, r) { const n = {}, o = /^([\w-]*?)([\d]+)$/; for (let s = 0, c = e.length; s < c; s++) { const l = e[s], h = l.name.match(o); if (h && h.length > 1) { const u = h[1]; let p = n[u]; p || (n[u] = p = []), p.push(l); } } const a = []; for (const s in n) a.push(this.CreateFromMorphTargetSequence(s, n[s], t, r)); return a; } // parse the animation.hierarchy format static parseAnimation(e, t) { if (!e) return console.error("THREE.AnimationClip: No animation in JSONLoader data."), null; const r = function(h, u, p, g, m) { if (p.length !== 0) { const d = [], y = []; Lt.flattenJSON(p, d, y, g), d.length !== 0 && m.push(new h(u, d, y)); } }, n = [], o = e.name || "default", a = e.fps || 30, s = e.blendMode; let c = e.length || -1; const l = e.hierarchy || []; for (let h = 0; h < l.length; h++) { const u = l[h].keys; if (!(!u || u.length === 0)) if (u[0].morphTargets) { const p = {}; let g; for (g = 0; g < u.length; g++) if (u[g].morphTargets) for (let m = 0; m < u[g].morphTargets.length; m++) p[u[g].morphTargets[m]] = -1; for (const m in p) { const d = [], y = []; for (let f = 0; f !== u[g].morphTargets.length; ++f) { const v = u[g]; d.push(v.time), y.push(v.morphTarget === m ? 1 : 0); } n.push(new Ja(".morphTargetInfluence[" + m + "]", d, y)); } c = p.length * (a || 1); } else { const p = ".bones[" + t[h].name + "]"; r( Ka, p + ".position", u, "pos", n ), r( Xo, p + ".quaternion", u, "rot", n ), r( Ka, p + ".scale", u, "scl", n ); } } return n.length === 0 ? null : new this(o, c, n, s); } resetDuration() { const e = this.tracks; let t = 0; for (let r = 0, n = e.length; r !== n; ++r) { const o = this.tracks[r]; t = Math.max(t, o.times[o.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 gB(i) { switch (i.toLowerCase()) { case "scalar": case "double": case "float": case "number": case "integer": return Ja; case "vector": case "vector2": case "vector3": case "vector4": return Ka; case "color": return yf; case "quaternion": return Xo; case "bool": case "boolean": return qo; case "string": return Zo; } throw new Error("THREE.KeyframeTrack: Unsupported typeName: " + i); } function vB(i) { if (i.type === void 0) throw new Error("THREE.KeyframeTrack: track type undefined, can not parse"); const e = gB(i.type); if (i.times === void 0) { const t = [], r = []; Lt.flattenJSON(i.keys, t, r, "value"), i.times = t, i.values = r; } return e.parse !== void 0 ? e.parse(i) : new e(i.name, i.times, i.values, i.interpolation); } const Fo = { enabled: !1, files: {}, add: function(i, e) { this.enabled !== !1 && (this.files[i] = e); }, get: function(i) { if (this.enabled !== !1) return this.files[i]; }, remove: function(i) { delete this.files[i]; }, clear: function() { this.files = {}; } }; class bf { constructor(e, t, r) { const n = this; let o = !1, a = 0, s = 0, c; const l = []; this.onStart = void 0, this.onLoad = e, this.onProgress = t, this.onError = r, this.itemStart = function(h) { s++, o === !1 && n.onStart !== void 0 && n.onStart(h, a, s), o = !0; }, this.itemEnd = function(h) { a++, n.onProgress !== void 0 && n.onProgress(h, a, s), a === s && (o = !1, n.onLoad !== void 0 && n.onLoad()); }, this.itemError = function(h) { n.onError !== void 0 && n.onError(h); }, this.resolveURL = function(h) { return c ? c(h) : h; }, this.setURLModifier = function(h) { return c = h, this; }, this.addHandler = function(h, u) { return l.push(h, u), this; }, this.removeHandler = function(h) { const u = l.indexOf(h); return u !== -1 && l.splice(u, 2), this; }, this.getHandler = function(h) { for (let u = 0, p = l.length; u < p; u += 2) { const g = l[u], m = l[u + 1]; if (g.global && (g.lastIndex = 0), g.test(h)) return m; } return null; }; } } const Xx = new bf(); class yi { constructor(e) { this.manager = e !== void 0 ? e : Xx, this.crossOrigin = "anonymous", this.withCredentials = !1, this.path = "", this.resourcePath = "", this.requestHeader = {}; } load() { } loadAsync(e, t) { const r = this; return new Promise(function(n, o) { r.load(e, n, t, o); }); } 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; } } const dr = {}; class Yi extends yi { constructor(e) { super(e); } load(e, t, r, n) { e === void 0 && (e = ""), this.path !== void 0 && (e = this.path + e), e = this.manager.resolveURL(e); const o = this, a = Fo.get(e); if (a !== void 0) return o.manager.itemStart(e), setTimeout(function() { t && t(a), o.manager.itemEnd(e); }, 0), a; if (dr[e] !== void 0) { dr[e].push({ onLoad: t, onProgress: r, onError: n }); return; } const s = /^data:(.*?)(;base64)?,(.*)$/, c = e.match(s); let l; if (c) { const h = c[1], u = !!c[2]; let p = c[3]; p = decodeURIComponent(p), u && (p = atob(p)); try { let g; const m = (this.responseType || "").toLowerCase(); switch (m) { case "arraybuffer": case "blob": const d = new Uint8Array(p.length); for (let y = 0; y < p.length; y++) d[y] = p.charCodeAt(y); m === "blob" ? g = new Blob([d.buffer], { type: h }) : g = d.buffer; break; case "document": g = new DOMParser().parseFromString(p, h); break; case "json": g = JSON.parse(p); break; default: g = p; break; } setTimeout(function() { t && t(g), o.manager.itemEnd(e); }, 0); } catch (g) { setTimeout(function() { n && n(g), o.manager.itemError(e), o.manager.itemEnd(e); }, 0); } } else { dr[e] = [], dr[e].push({ onLoad: t, onProgress: r, onError: n }), l = new XMLHttpRequest(), l.open("GET", e, !0), l.addEventListener("load", function(h) { const u = this.response, p = dr[e]; if (delete dr[e], this.status === 200 || this.status === 0) { this.status === 0 && console.warn("THREE.FileLoader: HTTP Status 0 received."), Fo.add(e, u); for (let g = 0, m = p.length; g < m; g++) { const d = p[g]; d.onLoad && d.onLoad(u); } o.manager.itemEnd(e); } else { for (let g = 0, m = p.length; g < m; g++) { const d = p[g]; d.onError && d.onError(h); } o.manager.itemError(e), o.manager.itemEnd(e); } }, !1), l.addEventListener("progress", function(h) { const u = dr[e]; for (let p = 0, g = u.length; p < g; p++) { const m = u[p]; m.onProgress && m.onProgress(h); } }, !1), l.addEventListener("error", function(h) { const u = dr[e]; delete dr[e]; for (let p = 0, g = u.length; p < g; p++) { const m = u[p]; m.onError && m.onError(h); } o.manager.itemError(e), o.manager.itemEnd(e); }, !1), l.addEventListener("abort", function(h) { const u = dr[e]; delete dr[e]; for (let p = 0, g = u.length; p < g; p++) { const m = u[p]; m.onError && m.onError(h); } o.manager.itemError(e), o.manager.itemEnd(e); }, !1), this.responseType !== void 0 && (l.responseType = this.responseType), this.withCredentials !== void 0 && (l.withCredentials = this.withCredentials), l.overrideMimeType && l.overrideMimeType(this.mimeType !== void 0 ? this.mimeType : "text/plain"); for (const h in this.requestHeader) l.setRequestHeader(h, this.requestHeader[h]); l.send(null); } return o.manager.itemStart(e), l; } setResponseType(e) { return this.responseType = e, this; } setMimeType(e) { return this.mimeType = e, this; } } class yB extends yi { constructor(e) { super(e); } load(e, t, r, n) { const o = this, a = new Yi(this.manager); a.setPath(this.path), a.setRequestHeader(this.requestHeader), a.setWithCredentials(this.withCredentials), a.load(e, function(s) { try { t(o.parse(JSON.parse(s))); } catch (c) { n ? n(c) : console.error(c), o.manager.itemError(e); } }, r, n); } parse(e) { const t = []; for (let r = 0; r < e.length; r++) { const n = Qa.parse(e[r]); t.push(n); } return t; } } class bB extends yi { constructor(e) { super(e); } load(e, t, r, n) { const o = this, a = [], s = new ef(), c = new Yi(this.manager); c.setPath(this.path), c.setResponseType("arraybuffer"), c.setRequestHeader(this.requestHeader), c.setWithCredentials(o.withCredentials); let l = 0; function h(u) { c.load(e[u], function(p) { const g = o.parse(p, !0); a[u] = { width: g.width, height: g.height, format: g.format, mipmaps: g.mipmaps }, l += 1, l === 6 && (g.mipmapCount === 1 && (s.minFilter = Ut), s.image = a, s.format = g.format, s.needsUpdate = !0, t && t(s)); }, r, n); } if (Array.isArray(e)) for (let u = 0, p = e.length; u < p; ++u) h(u); else c.load(e, function(u) { const p = o.parse(u, !0); if (p.isCubemap) { const g = p.mipmaps.length / p.mipmapCount; for (let m = 0; m < g; m++) { a[m] = { mipmaps: [] }; for (let d = 0; d < p.mipmapCount; d++) a[m].mipmaps.push(p.mipmaps[m * p.mipmapCount + d]), a[m].format = p.format, a[m].width = p.width, a[m].height = p.height; } s.image = a; } else s.image.width = p.width, s.image.height = p.height, s.mipmaps = p.mipmaps; p.mipmapCount === 1 && (s.minFilter = Ut), s.format = p.format, s.needsUpdate = !0, t && t(s); }, r, n); return s; } } class al extends yi { constructor(e) { super(e); } load(e, t, r, n) { this.path !== void 0 && (e = this.path + e), e = this.manager.resolveURL(e); const o = this, a = Fo.get(e); if (a !== void 0) return o.manager.itemStart(e), setTimeout(function() { t && t(a), o.manager.itemEnd(e); }, 0), a; const s = document.createElementNS("http://www.w3.org/1999/xhtml", "img"); function c() { s.removeEventListener("load", c, !1), s.removeEventListener("error", l, !1), Fo.add(e, this), t && t(this), o.manager.itemEnd(e); } function l(h) { s.removeEventListener("load", c, !1), s.removeEventListener("error", l, !1), n && n(h), o.manager.itemError(e), o.manager.itemEnd(e); } return s.addEventListener("load", c, !1), s.addEventListener("error", l, !1), e.substr(0, 5) !== "data:" && this.crossOrigin !== void 0 && (s.crossOrigin = this.crossOrigin), o.manager.itemStart(e), s.src = e, s; } } class Zx extends yi { constructor(e) { super(e); } load(e, t, r, n) { const o = new cs(), a = new al(this.manager); a.setCrossOrigin(this.crossOrigin), a.setPath(this.path); let s = 0; function c(l) { a.load(e[l], function(h) { o.images[l] = h, s++, s === 6 && (o.needsUpdate = !0, t && t(o)); }, void 0, n); } for (let l = 0; l < e.length; ++l) c(l); return o; } } class Yx extends yi { constructor(e) { super(e); } load(e, t, r, n) { const o = this, a = new Lo(), s = new Yi(this.manager); return s.setResponseType("arraybuffer"), s.setRequestHeader(this.requestHeader), s.setPath(this.path), s.setWithCredentials(o.withCredentials), s.load(e, function(c) { const l = o.parse(c); l && (l.image !== void 0 ? a.image = l.image : l.data !== void 0 && (a.image.width = l.width, a.image.height = l.height, a.image.data = l.data), a.wrapS = l.wrapS !== void 0 ? l.wrapS : li, a.wrapT = l.wrapT !== void 0 ? l.wrapT : li, a.magFilter = l.magFilter !== void 0 ? l.magFilter : Ut, a.minFilter = l.minFilter !== void 0 ? l.minFilter : Ut, a.anisotropy = l.anisotropy !== void 0 ? l.anisotropy : 1, l.encoding !== void 0 && (a.encoding = l.encoding), l.flipY !== void 0 && (a.flipY = l.flipY), l.format !== void 0 && (a.format = l.format), l.type !== void 0 && (a.type = l.type), l.mipmaps !== void 0 && (a.mipmaps = l.mipmaps, a.minFilter = yn), l.mipmapCount === 1 && (a.minFilter = Ut), l.generateMipmaps !== void 0 && (a.generateMipmaps = l.generateMipmaps), a.needsUpdate = !0, t && t(a, l)); }, r, n), a; } } class xf extends yi { constructor(e) { super(e); } load(e, t, r, n) { const o = new Jt(), a = new al(this.manager); return a.setCrossOrigin(this.crossOrigin), a.setPath(this.path), a.load(e, function(s) { o.image = s; const c = e.search(/\.jpe?g($|\?)/i) > 0 || e.search(/^data\:image\/jpeg/) === 0; o.format = c ? an : $i, o.needsUpdate = !0, t !== void 0 && t(o); }, r, n), o; } } class Jx extends Zi { constructor() { super(), this.type = "CurvePath", this.curves = [], this.autoClose = !1; } add(e) { this.curves.push(e); } closePath() { const e = this.curves[0].getPoint(0), t = this.curves[this.curves.length - 1].getPoint(1); e.equals(t) || this.curves.push(new Ol(t, e)); } // To get accurate point with reference to // entire path distance at time t, // following has to be done: // 1. Length of each sub path have to be known // 2. Locate and identify type of curve // 3. Get t for the curve // 4. Return curve.getPointAt(t') getPoint(e) { const t = e * this.getLength(), r = this.getCurveLengths(); let n = 0; for (; n < r.length; ) { if (r[n] >= t) { const o = r[n] - t, a = this.curves[n], s = a.getLength(), c = s === 0 ? 0 : 1 - o / s; return a.getPointAt(c); } n++; } return null; } // We cannot use the default THREE.Curve getPoint() with getLength() because in // THREE.Curve, getLength() depends on getPoint() but in THREE.CurvePath // getPoint() depends on getLength getLength() { const e = this.getCurveLengths(); return e[e.length - 1]; } // cacheLengths must be recalculated. updateArcLengths() { this.needsUpdate = !0, this.cacheLengths = null, this.getCurveLengths(); } // Compute lengths and cache them // We cannot overwrite getLengths() because UtoT mapping uses it. getCurveLengths() { if (this.cacheLengths && this.cacheLengths.length === this.curves.length) return this.cacheLengths; const e = []; let t = 0; for (let r = 0, n = this.curves.length; r < n; r++) t += this.curves[r].getLength(), e.push(t); return this.cacheLengths = e, e; } getSpacedPoints(e = 40) { const t = []; for (let r = 0; r <= e; r++) t.push(this.getPoint(r / e)); return this.autoClose && t.push(t[0]), t; } getPoints(e = 12) { const t = []; let r; for (let n = 0, o = this.curves; n < o.length; n++) { const a = o[n], s = a && a.isEllipseCurve ? e * 2 : a && (a.isLineCurve || a.isLineCurve3) ? 1 : a && a.isSplineCurve ? e * a.points.length : e, c = a.getPoints(s); for (let l = 0; l < c.length; l++) { const h = c[l]; r && r.equals(h) || (t.push(h), r = h); } } return this.autoClose && t.length > 1 && !t[t.length - 1].equals(t[0]) && t.push(t[0]), t; } copy(e) { super.copy(e), this.curves = []; for (let t = 0, r = e.curves.length; t < r; t++) { const n = e.curves[t]; this.curves.push(n.clone()); } return this.autoClose = e.autoClose, this; } toJSON() { const e = super.toJSON(); e.autoClose = this.autoClose, e.curves = []; for (let t = 0, r = this.curves.length; t < r; t++) { const n = this.curves[t]; e.curves.push(n.toJSON()); } return e; } fromJSON(e) { super.fromJSON(e), this.autoClose = e.autoClose, this.curves = []; for (let t = 0, r = e.curves.length; t < r; t++) { const n = e.curves[t]; this.curves.push(new lf[n.type]().fromJSON(n)); } return this; } } class sl extends Jx { constructor(e) { super(), this.type = "Path", this.currentPoint = new Oe(), e && this.setFromPoints(e); } setFromPoints(e) { this.moveTo(e[0].x, e[0].y); for (let t = 1, r = e.length; t < r; t++) this.lineTo(e[t].x, e[t].y); return this; } moveTo(e, t) { return this.currentPoint.set(e, t), this; } lineTo(e, t) { const r = new Ol(this.currentPoint.clone(), new Oe(e, t)); return this.curves.push(r), this.currentPoint.set(e, t), this; } quadraticCurveTo(e, t, r, n) { const o = new zu( this.currentPoint.clone(), new Oe(e, t), new Oe(r, n) ); return this.curves.push(o), this.currentPoint.set(r, n), this; } bezierCurveTo(e, t, r, n, o, a) { const s = new ku( this.currentPoint.clone(), new Oe(e, t), new Oe(r, n), new Oe(o, a) ); return this.curves.push(s), this.currentPoint.set(o, a), this; } splineThru(e) { const t = [this.currentPoint.clone()].concat(e), r = new Fu(t); return this.curves.push(r), this.currentPoint.copy(e[e.length - 1]), this; } arc(e, t, r, n, o, a) { const s = this.currentPoint.x, c = this.currentPoint.y; return this.absarc( e + s, t + c, r, n, o, a ), this; } absarc(e, t, r, n, o, a) { return this.absellipse(e, t, r, r, n, o, a), this; } ellipse(e, t, r, n, o, a, s, c) { const l = this.currentPoint.x, h = this.currentPoint.y; return this.absellipse(e + l, t + h, r, n, o, a, s, c), this; } absellipse(e, t, r, n, o, a, s, c) { const l = new Rl(e, t, r, n, o, a, s, c); if (this.curves.length > 0) { const u = l.getPoint(0); u.equals(this.currentPoint) || this.lineTo(u.x, u.y); } this.curves.push(l); const h = l.getPoint(1); return this.currentPoint.copy(h), this; } copy(e) { return super.copy(e), this.currentPoint.copy(e.currentPoint), this; } toJSON() { const e = super.toJSON(); return e.currentPoint = this.currentPoint.toArray(), e; } fromJSON(e) { return super.fromJSON(e), this.currentPoint.fromArray(e.currentPoint), this; } } class Un extends sl { constructor(e) { super(e), this.uuid = qi(), this.type = "Shape", this.holes = []; } getPointsHoles(e) { const t = []; for (let r = 0, n = this.holes.length; r < n; r++) t[r] = this.holes[r].getPoints(e); return t; } // get points of shape and holes (keypoints based on segments parameter) extractPoints(e) { return { shape: this.getPoints(e), holes: this.getPointsHoles(e) }; } copy(e) { super.copy(e), this.holes = []; for (let t = 0, r = e.holes.length; t < r; t++) { const n = e.holes[t]; this.holes.push(n.clone()); } return this; } toJSON() { const e = super.toJSON(); e.uuid = this.uuid, e.holes = []; for (let t = 0, r = this.holes.length; t < r; t++) { const n = this.holes[t]; e.holes.push(n.toJSON()); } return e; } fromJSON(e) { super.fromJSON(e), this.uuid = e.uuid, this.holes = []; for (let t = 0, r = e.holes.length; t < r; t++) { const n = e.holes[t]; this.holes.push(new sl().fromJSON(n)); } return this; } } class xr extends nt { constructor(e, t = 1) { super(), this.type = "Light", this.color = new Be(e), this.intensity = t; } dispose() { } copy(e) { return super.copy(e), 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()), t; } } xr.prototype.isLight = !0; class wf extends xr { constructor(e, t, r) { super(e, r), this.type = "HemisphereLight", this.position.copy(nt.DefaultUp), this.updateMatrix(), this.groundColor = new Be(t); } copy(e) { return xr.prototype.copy.call(this, e), this.groundColor.copy(e.groundColor), this; } } wf.prototype.isHemisphereLight = !0; const av = /* @__PURE__ */ new $e(), sv = /* @__PURE__ */ new Z(), lv = /* @__PURE__ */ new Z(); class _f { constructor(e) { this.camera = e, this.bias = 0, this.normalBias = 0, this.radius = 1, this.mapSize = new Oe(512, 512), this.map = null, this.mapPass = null, this.matrix = new $e(), this.autoUpdate = !0, this.needsUpdate = !1, this._frustum = new _l(), this._frameExtents = new Oe(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, r = this.matrix; sv.setFromMatrixPosition(e.matrixWorld), t.position.copy(sv), lv.setFromMatrixPosition(e.target.matrixWorld), t.lookAt(lv), t.updateMatrixWorld(), av.multiplyMatrices(t.projectionMatrix, t.matrixWorldInverse), this._frustum.setFromProjectionMatrix(av), r.set( 0.5, 0, 0, 0.5, 0, 0.5, 0, 0.5, 0, 0, 0.5, 0.5, 0, 0, 0, 1 ), r.multiply(t.projectionMatrix), r.multiply(t.matrixWorldInverse); } 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.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.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 Kx extends _f { constructor() { super(new ti(50, 1, 0.5, 500)), this.focus = 1; } updateMatrices(e) { const t = this.camera, r = il * 2 * e.angle * this.focus, n = this.mapSize.width / this.mapSize.height, o = e.distance || t.far; (r !== t.fov || n !== t.aspect || o !== t.far) && (t.fov = r, t.aspect = n, t.far = o, t.updateProjectionMatrix()), super.updateMatrices(e); } copy(e) { return super.copy(e), this.focus = e.focus, this; } } Kx.prototype.isSpotLightShadow = !0; class Uu extends xr { constructor(e, t, r = 0, n = Math.PI / 3, o = 0, a = 1) { super(e, t), this.type = "SpotLight", this.position.copy(nt.DefaultUp), this.updateMatrix(), this.target = new nt(), this.distance = r, this.angle = n, this.penumbra = o, this.decay = a, this.shadow = new Kx(); } get power() { return this.intensity * Math.PI; } set power(e) { this.intensity = e / Math.PI; } dispose() { this.shadow.dispose(); } copy(e) { return super.copy(e), 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; } } Uu.prototype.isSpotLight = !0; const cv = /* @__PURE__ */ new $e(), Cs = /* @__PURE__ */ new Z(), kh = /* @__PURE__ */ new Z(); class Qx extends _f { constructor() { super(new ti(90, 1, 0.5, 500)), this._frameExtents = new Oe(4, 2), this._viewportCount = 6, this._viewports = [ // These viewports map a cube-map onto a 2D texture with the // following orientation: // // xzXZ // y Y // // X - Positive x direction // x - Negative x direction // Y - Positive y direction // y - Negative y direction // Z - Positive z direction // z - Negative z direction // positive X new Mt(2, 1, 1, 1), // negative X new Mt(0, 1, 1, 1), // positive Z new Mt(3, 1, 1, 1), // negative Z new Mt(1, 1, 1, 1), // positive Y new Mt(3, 0, 1, 1), // negative Y new Mt(1, 0, 1, 1) ], this._cubeDirections = [ new Z(1, 0, 0), new Z(-1, 0, 0), new Z(0, 0, 1), new Z(0, 0, -1), new Z(0, 1, 0), new Z(0, -1, 0) ], this._cubeUps = [ new Z(0, 1, 0), new Z(0, 1, 0), new Z(0, 1, 0), new Z(0, 1, 0), new Z(0, 0, 1), new Z(0, 0, -1) ]; } updateMatrices(e, t = 0) { const r = this.camera, n = this.matrix, o = e.distance || r.far; o !== r.far && (r.far = o, r.updateProjectionMatrix()), Cs.setFromMatrixPosition(e.matrixWorld), r.position.copy(Cs), kh.copy(r.position), kh.add(this._cubeDirections[t]), r.up.copy(this._cubeUps[t]), r.lookAt(kh), r.updateMatrixWorld(), n.makeTranslation(-Cs.x, -Cs.y, -Cs.z), cv.multiplyMatrices(r.projectionMatrix, r.matrixWorldInverse), this._frustum.setFromProjectionMatrix(cv); } } Qx.prototype.isPointLightShadow = !0; class Gu extends xr { constructor(e, t, r = 0, n = 1) { super(e, t), this.type = "PointLight", this.distance = r, this.decay = n, this.shadow = new Qx(); } get power() { return this.intensity * 4 * Math.PI; } set power(e) { this.intensity = e / (4 * Math.PI); } dispose() { this.shadow.dispose(); } copy(e) { return super.copy(e), this.distance = e.distance, this.decay = e.decay, this.shadow = e.shadow.clone(), this; } } Gu.prototype.isPointLight = !0; class ps extends wl { constructor(e = -1, t = 1, r = 1, n = -1, o = 0.1, a = 2e3) { super(), this.type = "OrthographicCamera", this.zoom = 1, this.view = null, this.left = e, this.right = t, this.top = r, this.bottom = n, this.near = o, this.far = a, 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, r, n, o, a) { 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 = r, this.view.offsetY = n, this.view.width = o, this.view.height = a, 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), r = (this.right + this.left) / 2, n = (this.top + this.bottom) / 2; let o = r - e, a = r + e, s = n + t, c = n - t; if (this.view !== null && this.view.enabled) { const l = (this.right - this.left) / this.view.fullWidth / this.zoom, h = (this.top - this.bottom) / this.view.fullHeight / this.zoom; o += l * this.view.offsetX, a = o + l * this.view.width, s -= h * this.view.offsetY, c = s - h * this.view.height; } this.projectionMatrix.makeOrthographic(o, a, s, c, this.near, this.far), 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; } } ps.prototype.isOrthographicCamera = !0; class e1 extends _f { constructor() { super(new ps(-5, 5, 5, -5, 0.5, 500)); } } e1.prototype.isDirectionalLightShadow = !0; class Hu extends xr { constructor(e, t) { super(e, t), this.type = "DirectionalLight", this.position.copy(nt.DefaultUp), this.updateMatrix(), this.target = new nt(), this.shadow = new e1(); } dispose() { this.shadow.dispose(); } copy(e) { return super.copy(e), this.target = e.target.clone(), this.shadow = e.shadow.clone(), this; } } Hu.prototype.isDirectionalLight = !0; class Mf extends xr { constructor(e, t) { super(e, t), this.type = "AmbientLight"; } } Mf.prototype.isAmbientLight = !0; class Sf extends xr { constructor(e, t, r = 10, n = 10) { super(e, t), this.type = "RectAreaLight", this.width = r, this.height = n; } copy(e) { return super.copy(e), this.width = e.width, this.height = e.height, this; } toJSON(e) { const t = super.toJSON(e); return t.object.width = this.width, t.object.height = this.height, t; } } Sf.prototype.isRectAreaLight = !0; class Tf { constructor() { this.coefficients = []; for (let e = 0; e < 9; e++) this.coefficients.push(new Z()); } set(e) { for (let t = 0; t < 9; t++) this.coefficients[t].copy(e[t]); return this; } zero() { for (let e = 0; e < 9; e++) this.coefficients[e].set(0, 0, 0); return this; } // get the radiance in the direction of the normal // target is a Vector3 getAt(e, t) { const r = e.x, n = e.y, o = e.z, a = this.coefficients; return t.copy(a[0]).multiplyScalar(0.282095), t.addScaledVector(a[1], 0.488603 * n), t.addScaledVector(a[2], 0.488603 * o), t.addScaledVector(a[3], 0.488603 * r), t.addScaledVector(a[4], 1.092548 * (r * n)), t.addScaledVector(a[5], 1.092548 * (n * o)), t.addScaledVector(a[6], 0.315392 * (3 * o * o - 1)), t.addScaledVector(a[7], 1.092548 * (r * o)), t.addScaledVector(a[8], 0.546274 * (r * r - n * n)), t; } // get the irradiance (radiance convolved with cosine lobe) in the direction of the normal // target is a Vector3 // https://graphics.stanford.edu/papers/envmap/envmap.pdf getIrradianceAt(e, t) { const r = e.x, n = e.y, o = e.z, a = this.coefficients; return t.copy(a[0]).multiplyScalar(0.886227), t.addScaledVector(a[1], 2 * 0.511664 * n), t.addScaledVector(a[2], 2 * 0.511664 * o), t.addScaledVector(a[3], 2 * 0.511664 * r), t.addScaledVector(a[4], 2 * 0.429043 * r * n), t.addScaledVector(a[5], 2 * 0.429043 * n * o), t.addScaledVector(a[6], 0.743125 * o * o - 0.247708), t.addScaledVector(a[7], 2 * 0.429043 * r * o), t.addScaledVector(a[8], 0.429043 * (r * r - n * n)), t; } add(e) { for (let t = 0; t < 9; t++) this.coefficients[t].add(e.coefficients[t]); return this; } addScaledSH(e, t) { for (let r = 0; r < 9; r++) this.coefficients[r].addScaledVector(e.coefficients[r], t); return this; } scale(e) { for (let t = 0; t < 9; t++) this.coefficients[t].multiplyScalar(e); return this; } lerp(e, t) { for (let r = 0; r < 9; r++) this.coefficients[r].lerp(e.coefficients[r], t); return this; } equals(e) { for (let t = 0; t < 9; t++) if (!this.coefficients[t].equals(e.coefficients[t])) return !1; return !0; } copy(e) { return this.set(e.coefficients); } clone() { return new this.constructor().copy(this); } fromArray(e, t = 0) { const r = this.coefficients; for (let n = 0; n < 9; n++) r[n].fromArray(e, t + n * 3); return this; } toArray(e = [], t = 0) { const r = this.coefficients; for (let n = 0; n < 9; n++) r[n].toArray(e, t + n * 3); return e; } // evaluate the basis functions // shBasis is an Array[ 9 ] static getBasisAt(e, t) { const r = e.x, n = e.y, o = e.z; t[0] = 0.282095, t[1] = 0.488603 * n, t[2] = 0.488603 * o, t[3] = 0.488603 * r, t[4] = 1.092548 * r * n, t[5] = 1.092548 * n * o, t[6] = 0.315392 * (3 * o * o - 1), t[7] = 1.092548 * r * o, t[8] = 0.546274 * (r * r - n * n); } } Tf.prototype.isSphericalHarmonics3 = !0; class Il extends xr { constructor(e = new Tf(), t = 1) { super(void 0, t), this.sh = e; } copy(e) { return super.copy(e), this.sh.copy(e.sh), this; } fromJSON(e) { return this.intensity = e.intensity, this.sh.fromArray(e.sh), this; } toJSON(e) { const t = super.toJSON(e); return t.object.sh = this.sh.toArray(), t; } } Il.prototype.isLightProbe = !0; class t1 extends yi { constructor(e) { super(e), this.textures = {}; } load(e, t, r, n) { const o = this, a = new Yi(o.manager); a.setPath(o.path), a.setRequestHeader(o.requestHeader), a.setWithCredentials(o.withCredentials), a.load(e, function(s) { try { t(o.parse(JSON.parse(s))); } catch (c) { n ? n(c) : console.error(c), o.manager.itemError(e); } }, r, n); } parse(e) { const t = this.textures; function r(o) { return t[o] === void 0 && console.warn("THREE.MaterialLoader: Undefined texture", o), t[o]; } const n = new mB[e.type](); if (e.uuid !== void 0 && (n.uuid = e.uuid), e.name !== void 0 && (n.name = e.name), e.color !== void 0 && n.color !== void 0 && n.color.setHex(e.color), e.roughness !== void 0 && (n.roughness = e.roughness), e.metalness !== void 0 && (n.metalness = e.metalness), e.sheen !== void 0 && (n.sheen = new Be().setHex(e.sheen)), e.emissive !== void 0 && n.emissive !== void 0 && n.emissive.setHex(e.emissive), e.specular !== void 0 && n.specular !== void 0 && n.specular.setHex(e.specular), e.shininess !== void 0 && (n.shininess = e.shininess), e.clearcoat !== void 0 && (n.clearcoat = e.clearcoat), e.clearcoatRoughness !== void 0 && (n.clearcoatRoughness = e.clearcoatRoughness), e.transmission !== void 0 && (n.transmission = e.transmission), e.thickness !== void 0 && (n.thickness = e.thickness), e.attenuationDistance !== void 0 && (n.attenuationDistance = e.attenuationDistance), e.attenuationColor !== void 0 && n.attenuationColor !== void 0 && n.attenuationColor.setHex(e.attenuationColor), e.fog !== void 0 && (n.fog = e.fog), e.flatShading !== void 0 && (n.flatShading = e.flatShading), e.blending !== void 0 && (n.blending = e.blending), e.combine !== void 0 && (n.combine = e.combine), e.side !== void 0 && (n.side = e.side), e.shadowSide !== void 0 && (n.shadowSide = e.shadowSide), e.opacity !== void 0 && (n.opacity = e.opacity), e.transparent !== void 0 && (n.transparent = e.transparent), e.alphaTest !== void 0 && (n.alphaTest = e.alphaTest), e.depthTest !== void 0 && (n.depthTest = e.depthTest), e.depthWrite !== void 0 && (n.depthWrite = e.depthWrite), e.colorWrite !== void 0 && (n.colorWrite = e.colorWrite), e.stencilWrite !== void 0 && (n.stencilWrite = e.stencilWrite), e.stencilWriteMask !== void 0 && (n.stencilWriteMask = e.stencilWriteMask), e.stencilFunc !== void 0 && (n.stencilFunc = e.stencilFunc), e.stencilRef !== void 0 && (n.stencilRef = e.stencilRef), e.stencilFuncMask !== void 0 && (n.stencilFuncMask = e.stencilFuncMask), e.stencilFail !== void 0 && (n.stencilFail = e.stencilFail), e.stencilZFail !== void 0 && (n.stencilZFail = e.stencilZFail), e.stencilZPass !== void 0 && (n.stencilZPass = e.stencilZPass), e.wireframe !== void 0 && (n.wireframe = e.wireframe), e.wireframeLinewidth !== void 0 && (n.wireframeLinewidth = e.wireframeLinewidth), e.wireframeLinecap !== void 0 && (n.wireframeLinecap = e.wireframeLinecap), e.wireframeLinejoin !== void 0 && (n.wireframeLinejoin = e.wireframeLinejoin), e.rotation !== void 0 && (n.rotation = e.rotation), e.linewidth !== 1 && (n.linewidth = e.linewidth), e.dashSize !== void 0 && (n.dashSize = e.dashSize), e.gapSize !== void 0 && (n.gapSize = e.gapSize), e.scale !== void 0 && (n.scale = e.scale), e.polygonOffset !== void 0 && (n.polygonOffset = e.polygonOffset), e.polygonOffsetFactor !== void 0 && (n.polygonOffsetFactor = e.polygonOffsetFactor), e.polygonOffsetUnits !== void 0 && (n.polygonOffsetUnits = e.polygonOffsetUnits), e.morphTargets !== void 0 && (n.morphTargets = e.morphTargets), e.morphNormals !== void 0 && (n.morphNormals = e.morphNormals), e.dithering !== void 0 && (n.dithering = e.dithering), e.alphaToCoverage !== void 0 && (n.alphaToCoverage = e.alphaToCoverage), e.premultipliedAlpha !== void 0 && (n.premultipliedAlpha = e.premultipliedAlpha), e.vertexTangents !== void 0 && (n.vertexTangents = e.vertexTangents), e.visible !== void 0 && (n.visible = e.visible), e.toneMapped !== void 0 && (n.toneMapped = e.toneMapped), e.userData !== void 0 && (n.userData = e.userData), e.vertexColors !== void 0 && (typeof e.vertexColors == "number" ? n.vertexColors = e.vertexColors > 0 : n.vertexColors = e.vertexColors), e.uniforms !== void 0) for (const o in e.uniforms) { const a = e.uniforms[o]; switch (n.uniforms[o] = {}, a.type) { case "t": n.uniforms[o].value = r(a.value); break; case "c": n.uniforms[o].value = new Be().setHex(a.value); break; case "v2": n.uniforms[o].value = new Oe().fromArray(a.value); break; case "v3": n.uniforms[o].value = new Z().fromArray(a.value); break; case "v4": n.uniforms[o].value = new Mt().fromArray(a.value); break; case "m3": n.uniforms[o].value = new ii().fromArray(a.value); break; case "m4": n.uniforms[o].value = new $e().fromArray(a.value); break; default: n.uniforms[o].value = a.value; } } if (e.defines !== void 0 && (n.defines = e.defines), e.vertexShader !== void 0 && (n.vertexShader = e.vertexShader), e.fragmentShader !== void 0 && (n.fragmentShader = e.fragmentShader), e.extensions !== void 0) for (const o in e.extensions) n.extensions[o] = e.extensions[o]; if (e.shading !== void 0 && (n.flatShading = e.shading === 1), e.size !== void 0 && (n.size = e.size), e.sizeAttenuation !== void 0 && (n.sizeAttenuation = e.sizeAttenuation), e.map !== void 0 && (n.map = r(e.map)), e.matcap !== void 0 && (n.matcap = r(e.matcap)), e.alphaMap !== void 0 && (n.alphaMap = r(e.alphaMap)), e.bumpMap !== void 0 && (n.bumpMap = r(e.bumpMap)), e.bumpScale !== void 0 && (n.bumpScale = e.bumpScale), e.normalMap !== void 0 && (n.normalMap = r(e.normalMap)), e.normalMapType !== void 0 && (n.normalMapType = e.normalMapType), e.normalScale !== void 0) { let o = e.normalScale; Array.isArray(o) === !1 && (o = [o, o]), n.normalScale = new Oe().fromArray(o); } return e.displacementMap !== void 0 && (n.displacementMap = r(e.displacementMap)), e.displacementScale !== void 0 && (n.displacementScale = e.displacementScale), e.displacementBias !== void 0 && (n.displacementBias = e.displacementBias), e.roughnessMap !== void 0 && (n.roughnessMap = r(e.roughnessMap)), e.metalnessMap !== void 0 && (n.metalnessMap = r(e.metalnessMap)), e.emissiveMap !== void 0 && (n.emissiveMap = r(e.emissiveMap)), e.emissiveIntensity !== void 0 && (n.emissiveIntensity = e.emissiveIntensity), e.specularMap !== void 0 && (n.specularMap = r(e.specularMap)), e.envMap !== void 0 && (n.envMap = r(e.envMap)), e.envMapIntensity !== void 0 && (n.envMapIntensity = e.envMapIntensity), e.reflectivity !== void 0 && (n.reflectivity = e.reflectivity), e.refractionRatio !== void 0 && (n.refractionRatio = e.refractionRatio), e.lightMap !== void 0 && (n.lightMap = r(e.lightMap)), e.lightMapIntensity !== void 0 && (n.lightMapIntensity = e.lightMapIntensity), e.aoMap !== void 0 && (n.aoMap = r(e.aoMap)), e.aoMapIntensity !== void 0 && (n.aoMapIntensity = e.aoMapIntensity), e.gradientMap !== void 0 && (n.gradientMap = r(e.gradientMap)), e.clearcoatMap !== void 0 && (n.clearcoatMap = r(e.clearcoatMap)), e.clearcoatRoughnessMap !== void 0 && (n.clearcoatRoughnessMap = r(e.clearcoatRoughnessMap)), e.clearcoatNormalMap !== void 0 && (n.clearcoatNormalMap = r(e.clearcoatNormalMap)), e.clearcoatNormalScale !== void 0 && (n.clearcoatNormalScale = new Oe().fromArray(e.clearcoatNormalScale)), e.transmissionMap !== void 0 && (n.transmissionMap = r(e.transmissionMap)), e.thicknessMap !== void 0 && (n.thicknessMap = r(e.thicknessMap)), n; } setTextures(e) { return this.textures = e, this; } } class sn { static decodeText(e) { if (typeof TextDecoder < "u") return new TextDecoder().decode(e); let t = ""; for (let r = 0, n = e.length; r < n; r++) t += String.fromCharCode(e[r]); try { return decodeURIComponent(escape(t)); } catch { return t; } } static extractUrlBase(e) { const t = e.lastIndexOf("/"); return t === -1 ? "./" : e.substr(0, t + 1); } } class Ef extends Je { constructor() { super(), this.type = "InstancedBufferGeometry", this.instanceCount = 1 / 0; } copy(e) { return super.copy(e), this.instanceCount = e.instanceCount, this; } clone() { return new this.constructor().copy(this); } toJSON() { const e = super.toJSON(this); return e.instanceCount = this.instanceCount, e.isInstancedBufferGeometry = !0, e; } } Ef.prototype.isInstancedBufferGeometry = !0; class Af extends tt { constructor(e, t, r, n = 1) { typeof r == "number" && (n = r, r = !1, console.error("THREE.InstancedBufferAttribute: The constructor now expects normalized as the third argument.")), super(e, t, r), this.meshPerAttribute = n; } 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; } } Af.prototype.isInstancedBufferAttribute = !0; class i1 extends yi { constructor(e) { super(e); } load(e, t, r, n) { const o = this, a = new Yi(o.manager); a.setPath(o.path), a.setRequestHeader(o.requestHeader), a.setWithCredentials(o.withCredentials), a.load(e, function(s) { try { t(o.parse(JSON.parse(s))); } catch (c) { n ? n(c) : console.error(c), o.manager.itemError(e); } }, r, n); } parse(e) { const t = {}, r = {}; function n(p, g) { if (t[g] !== void 0) return t[g]; const m = p.interleavedBuffers[g], d = o(p, m.buffer), y = _a(m.type, d), f = new ro(y, m.stride); return f.uuid = m.uuid, t[g] = f, f; } function o(p, g) { if (r[g] !== void 0) return r[g]; const m = p.arrayBuffers[g], d = new Uint32Array(m).buffer; return r[g] = d, d; } const a = e.isInstancedBufferGeometry ? new Ef() : new Je(), s = e.data.index; if (s !== void 0) { const p = _a(s.type, s.array); a.setIndex(new tt(p, 1)); } const c = e.data.attributes; for (const p in c) { const g = c[p]; let m; if (g.isInterleavedBufferAttribute) { const d = n(e.data, g.data); m = new dn(d, g.itemSize, g.offset, g.normalized); } else { const d = _a(g.type, g.array), y = g.isInstancedBufferAttribute ? Af : tt; m = new y(d, g.itemSize, g.normalized); } g.name !== void 0 && (m.name = g.name), g.usage !== void 0 && m.setUsage(g.usage), g.updateRange !== void 0 && (m.updateRange.offset = g.updateRange.offset, m.updateRange.count = g.updateRange.count), a.setAttribute(p, m); } const l = e.data.morphAttributes; if (l) for (const p in l) { const g = l[p], m = []; for (let d = 0, y = g.length; d < y; d++) { const f = g[d]; let v; if (f.isInterleavedBufferAttribute) { const M = n(e.data, f.data); v = new dn(M, f.itemSize, f.offset, f.normalized); } else { const M = _a(f.type, f.array); v = new tt(M, f.itemSize, f.normalized); } f.name !== void 0 && (v.name = f.name), m.push(v); } a.morphAttributes[p] = m; } e.data.morphTargetsRelative && (a.morphTargetsRelative = !0); const h = e.data.groups || e.data.drawcalls || e.data.offsets; if (h !== void 0) for (let p = 0, g = h.length; p !== g; ++p) { const m = h[p]; a.addGroup(m.start, m.count, m.materialIndex); } const u = e.data.boundingSphere; if (u !== void 0) { const p = new Z(); u.center !== void 0 && p.fromArray(u.center), a.boundingSphere = new bn(p, u.radius); } return e.name && (a.name = e.name), e.userData && (a.userData = e.userData), a; } } class xB extends yi { constructor(e) { super(e); } load(e, t, r, n) { const o = this, a = this.path === "" ? sn.extractUrlBase(e) : this.path; this.resourcePath = this.resourcePath || a; const s = new Yi(this.manager); s.setPath(this.path), s.setRequestHeader(this.requestHeader), s.setWithCredentials(this.withCredentials), s.load(e, function(c) { let l = null; try { l = JSON.parse(c); } catch (u) { n !== void 0 && n(u), console.error("THREE:ObjectLoader: Can't parse " + e + ".", u.message); return; } const h = l.metadata; if (h === void 0 || h.type === void 0 || h.type.toLowerCase() === "geometry") { console.error("THREE.ObjectLoader: Can't load " + e); return; } o.parse(l, t); }, r, n); } async loadAsync(e, t) { const r = this, n = this.path === "" ? sn.extractUrlBase(e) : this.path; this.resourcePath = this.resourcePath || n; const o = new Yi(this.manager); o.setPath(this.path), o.setRequestHeader(this.requestHeader), o.setWithCredentials(this.withCredentials); const a = await o.loadAsync(e, t), s = JSON.parse(a), c = s.metadata; if (c === void 0 || c.type === void 0 || c.type.toLowerCase() === "geometry") throw new Error("THREE.ObjectLoader: Can't load " + e); return await r.parseAsync(s); } parse(e, t) { const r = this.parseAnimations(e.animations), n = this.parseShapes(e.shapes), o = this.parseGeometries(e.geometries, n), a = this.parseImages(e.images, function() { t !== void 0 && t(l); }), s = this.parseTextures(e.textures, a), c = this.parseMaterials(e.materials, s), l = this.parseObject(e.object, o, c, s, r), h = this.parseSkeletons(e.skeletons, l); if (this.bindSkeletons(l, h), t !== void 0) { let u = !1; for (const p in a) if (a[p] instanceof HTMLImageElement) { u = !0; break; } u === !1 && t(l); } return l; } async parseAsync(e) { const t = this.parseAnimations(e.animations), r = this.parseShapes(e.shapes), n = this.parseGeometries(e.geometries, r), o = await this.parseImagesAsync(e.images), a = this.parseTextures(e.textures, o), s = this.parseMaterials(e.materials, a), c = this.parseObject(e.object, n, s, a, t), l = this.parseSkeletons(e.skeletons, c); return this.bindSkeletons(c, l), c; } parseShapes(e) { const t = {}; if (e !== void 0) for (let r = 0, n = e.length; r < n; r++) { const o = new Un().fromJSON(e[r]); t[o.uuid] = o; } return t; } parseSkeletons(e, t) { const r = {}, n = {}; if (t.traverse(function(o) { o.isBone && (n[o.uuid] = o); }), e !== void 0) for (let o = 0, a = e.length; o < a; o++) { const s = new Ll().fromJSON(e[o], n); r[s.uuid] = s; } return r; } parseGeometries(e, t) { const r = {}; if (e !== void 0) { const n = new i1(); for (let o = 0, a = e.length; o < a; o++) { let s; const c = e[o]; switch (c.type) { case "BufferGeometry": case "InstancedBufferGeometry": s = n.parse(c); break; case "Geometry": console.error("THREE.ObjectLoader: The legacy Geometry type is no longer supported."); break; default: c.type in ov ? s = ov[c.type].fromJSON(c, t) : console.warn(`THREE.ObjectLoader: Unsupported geometry type "${c.type}"`); } s.uuid = c.uuid, c.name !== void 0 && (s.name = c.name), s.isBufferGeometry === !0 && c.userData !== void 0 && (s.userData = c.userData), r[c.uuid] = s; } } return r; } parseMaterials(e, t) { const r = {}, n = {}; if (e !== void 0) { const o = new t1(); o.setTextures(t); for (let a = 0, s = e.length; a < s; a++) { const c = e[a]; if (c.type === "MultiMaterial") { const l = []; for (let h = 0; h < c.materials.length; h++) { const u = c.materials[h]; r[u.uuid] === void 0 && (r[u.uuid] = o.parse(u)), l.push(r[u.uuid]); } n[c.uuid] = l; } else r[c.uuid] === void 0 && (r[c.uuid] = o.parse(c)), n[c.uuid] = r[c.uuid]; } } return n; } parseAnimations(e) { const t = {}; if (e !== void 0) for (let r = 0; r < e.length; r++) { const n = e[r], o = Qa.parse(n); t[o.uuid] = o; } return t; } parseImages(e, t) { const r = this, n = {}; let o; function a(c) { return r.manager.itemStart(c), o.load(c, function() { r.manager.itemEnd(c); }, void 0, function() { r.manager.itemError(c), r.manager.itemEnd(c); }); } function s(c) { if (typeof c == "string") { const l = c, h = /^(\/\/)|([a-z]+:(\/\/)?)/i.test(l) ? l : r.resourcePath + l; return a(h); } else return c.data ? { data: _a(c.type, c.data), width: c.width, height: c.height } : null; } if (e !== void 0 && e.length > 0) { const c = new bf(t); o = new al(c), o.setCrossOrigin(this.crossOrigin); for (let l = 0, h = e.length; l < h; l++) { const u = e[l], p = u.url; if (Array.isArray(p)) { n[u.uuid] = []; for (let g = 0, m = p.length; g < m; g++) { const d = p[g], y = s(d); y !== null && (y instanceof HTMLImageElement ? n[u.uuid].push(y) : n[u.uuid].push(new Lo(y.data, y.width, y.height))); } } else { const g = s(u.url); g !== null && (n[u.uuid] = g); } } } return n; } async parseImagesAsync(e) { const t = this, r = {}; let n; async function o(a) { if (typeof a == "string") { const s = a, c = /^(\/\/)|([a-z]+:(\/\/)?)/i.test(s) ? s : t.resourcePath + s; return await n.loadAsync(c); } else return a.data ? { data: _a(a.type, a.data), width: a.width, height: a.height } : null; } if (e !== void 0 && e.length > 0) { n = new al(this.manager), n.setCrossOrigin(this.crossOrigin); for (let a = 0, s = e.length; a < s; a++) { const c = e[a], l = c.url; if (Array.isArray(l)) { r[c.uuid] = []; for (let h = 0, u = l.length; h < u; h++) { const p = l[h], g = await o(p); g !== null && (g instanceof HTMLImageElement ? r[c.uuid].push(g) : r[c.uuid].push(new Lo(g.data, g.width, g.height))); } } else { const h = await o(c.url); h !== null && (r[c.uuid] = h); } } } return r; } parseTextures(e, t) { function r(o, a) { return typeof o == "number" ? o : (console.warn("THREE.ObjectLoader.parseTexture: Constant should be in numeric form.", o), a[o]); } const n = {}; if (e !== void 0) for (let o = 0, a = e.length; o < a; o++) { const s = e[o]; s.image === void 0 && console.warn('THREE.ObjectLoader: No "image" specified for', s.uuid), t[s.image] === void 0 && console.warn("THREE.ObjectLoader: Undefined image", s.image); let c; const l = t[s.image]; Array.isArray(l) ? (c = new cs(l), l.length === 6 && (c.needsUpdate = !0)) : (l && l.data ? c = new Lo(l.data, l.width, l.height) : c = new Jt(l), l && (c.needsUpdate = !0)), c.uuid = s.uuid, s.name !== void 0 && (c.name = s.name), s.mapping !== void 0 && (c.mapping = r(s.mapping, wB)), s.offset !== void 0 && c.offset.fromArray(s.offset), s.repeat !== void 0 && c.repeat.fromArray(s.repeat), s.center !== void 0 && c.center.fromArray(s.center), s.rotation !== void 0 && (c.rotation = s.rotation), s.wrap !== void 0 && (c.wrapS = r(s.wrap[0], uv), c.wrapT = r(s.wrap[1], uv)), s.format !== void 0 && (c.format = s.format), s.type !== void 0 && (c.type = s.type), s.encoding !== void 0 && (c.encoding = s.encoding), s.minFilter !== void 0 && (c.minFilter = r(s.minFilter, hv)), s.magFilter !== void 0 && (c.magFilter = r(s.magFilter, hv)), s.anisotropy !== void 0 && (c.anisotropy = s.anisotropy), s.flipY !== void 0 && (c.flipY = s.flipY), s.premultiplyAlpha !== void 0 && (c.premultiplyAlpha = s.premultiplyAlpha), s.unpackAlignment !== void 0 && (c.unpackAlignment = s.unpackAlignment), n[s.uuid] = c; } return n; } parseObject(e, t, r, n, o) { let a; function s(p) { return t[p] === void 0 && console.warn("THREE.ObjectLoader: Undefined geometry", p), t[p]; } function c(p) { if (p !== void 0) { if (Array.isArray(p)) { const g = []; for (let m = 0, d = p.length; m < d; m++) { const y = p[m]; r[y] === void 0 && console.warn("THREE.ObjectLoader: Undefined material", y), g.push(r[y]); } return g; } return r[p] === void 0 && console.warn("THREE.ObjectLoader: Undefined material", p), r[p]; } } function l(p) { return n[p] === void 0 && console.warn("THREE.ObjectLoader: Undefined texture", p), n[p]; } let h, u; switch (e.type) { case "Scene": a = new Nu(), e.background !== void 0 && (Number.isInteger(e.background) ? a.background = new Be(e.background) : a.background = l(e.background)), e.environment !== void 0 && (a.environment = l(e.environment)), e.fog !== void 0 && (e.fog.type === "Fog" ? a.fog = new Sl(e.fog.color, e.fog.near, e.fog.far) : e.fog.type === "FogExp2" && (a.fog = new Ml(e.fog.color, e.fog.density))); break; case "PerspectiveCamera": a = new ti(e.fov, e.aspect, e.near, e.far), e.focus !== void 0 && (a.focus = e.focus), e.zoom !== void 0 && (a.zoom = e.zoom), e.filmGauge !== void 0 && (a.filmGauge = e.filmGauge), e.filmOffset !== void 0 && (a.filmOffset = e.filmOffset), e.view !== void 0 && (a.view = Object.assign({}, e.view)); break; case "OrthographicCamera": a = new ps(e.left, e.right, e.top, e.bottom, e.near, e.far), e.zoom !== void 0 && (a.zoom = e.zoom), e.view !== void 0 && (a.view = Object.assign({}, e.view)); break; case "AmbientLight": a = new Mf(e.color, e.intensity); break; case "DirectionalLight": a = new Hu(e.color, e.intensity); break; case "PointLight": a = new Gu(e.color, e.intensity, e.distance, e.decay); break; case "RectAreaLight": a = new Sf(e.color, e.intensity, e.width, e.height); break; case "SpotLight": a = new Uu(e.color, e.intensity, e.distance, e.angle, e.penumbra, e.decay); break; case "HemisphereLight": a = new wf(e.color, e.groundColor, e.intensity); break; case "LightProbe": a = new Il().fromJSON(e); break; case "SkinnedMesh": h = s(e.geometry), u = c(e.material), a = new Al(h, u), e.bindMode !== void 0 && (a.bindMode = e.bindMode), e.bindMatrix !== void 0 && a.bindMatrix.fromArray(e.bindMatrix), e.skeleton !== void 0 && (a.skeleton = e.skeleton); break; case "Mesh": h = s(e.geometry), u = c(e.material), a = new Yt(h, u); break; case "InstancedMesh": h = s(e.geometry), u = c(e.material); const p = e.count, g = e.instanceMatrix, m = e.instanceColor; a = new Qp(h, u, p), a.instanceMatrix = new tt(new Float32Array(g.array), 16), m !== void 0 && (a.instanceColor = new tt(new Float32Array(m.array), m.itemSize)); break; case "LOD": a = new kx(); break; case "Line": a = new kr(s(e.geometry), c(e.material)); break; case "LineLoop": a = new Bu(s(e.geometry), c(e.material)); break; case "LineSegments": a = new Pi(s(e.geometry), c(e.material)); break; case "PointCloud": case "Points": a = new hs(s(e.geometry), c(e.material)); break; case "Sprite": a = new El(c(e.material)); break; case "Group": a = new Lr(); break; case "Bone": a = new Cl(); break; default: a = new nt(); } if (a.uuid = e.uuid, e.name !== void 0 && (a.name = e.name), e.matrix !== void 0 ? (a.matrix.fromArray(e.matrix), e.matrixAutoUpdate !== void 0 && (a.matrixAutoUpdate = e.matrixAutoUpdate), a.matrixAutoUpdate && a.matrix.decompose(a.position, a.quaternion, a.scale)) : (e.position !== void 0 && a.position.fromArray(e.position), e.rotation !== void 0 && a.rotation.fromArray(e.rotation), e.quaternion !== void 0 && a.quaternion.fromArray(e.quaternion), e.scale !== void 0 && a.scale.fromArray(e.scale)), e.castShadow !== void 0 && (a.castShadow = e.castShadow), e.receiveShadow !== void 0 && (a.receiveShadow = e.receiveShadow), e.shadow && (e.shadow.bias !== void 0 && (a.shadow.bias = e.shadow.bias), e.shadow.normalBias !== void 0 && (a.shadow.normalBias = e.shadow.normalBias), e.shadow.radius !== void 0 && (a.shadow.radius = e.shadow.radius), e.shadow.mapSize !== void 0 && a.shadow.mapSize.fromArray(e.shadow.mapSize), e.shadow.camera !== void 0 && (a.shadow.camera = this.parseObject(e.shadow.camera))), e.visible !== void 0 && (a.visible = e.visible), e.frustumCulled !== void 0 && (a.frustumCulled = e.frustumCulled), e.renderOrder !== void 0 && (a.renderOrder = e.renderOrder), e.userData !== void 0 && (a.userData = e.userData), e.layers !== void 0 && (a.layers.mask = e.layers), e.children !== void 0) { const p = e.children; for (let g = 0; g < p.length; g++) a.add(this.parseObject(p[g], t, r, n, o)); } if (e.animations !== void 0) { const p = e.animations; for (let g = 0; g < p.length; g++) { const m = p[g]; a.animations.push(o[m]); } } if (e.type === "LOD") { e.autoUpdate !== void 0 && (a.autoUpdate = e.autoUpdate); const p = e.levels; for (let g = 0; g < p.length; g++) { const m = p[g], d = a.getObjectByProperty("uuid", m.object); d !== void 0 && a.addLevel(d, m.distance); } } return a; } bindSkeletons(e, t) { Object.keys(t).length !== 0 && e.traverse(function(r) { if (r.isSkinnedMesh === !0 && r.skeleton !== void 0) { const n = t[r.skeleton]; n === void 0 ? console.warn("THREE.ObjectLoader: No skeleton found with UUID:", r.skeleton) : r.bind(n, r.bindMatrix); } }); } /* DEPRECATED */ setTexturePath(e) { return console.warn("THREE.ObjectLoader: .setTexturePath() has been renamed to .setResourcePath()."), this.setResourcePath(e); } } const wB = { UVMapping: Su, CubeReflectionMapping: yl, CubeRefractionMapping: bl, EquirectangularReflectionMapping: Qc, EquirectangularRefractionMapping: eu, CubeUVReflectionMapping: ls, CubeUVRefractionMapping: xl }, uv = { RepeatWrapping: Zn, ClampToEdgeWrapping: li, MirroredRepeatWrapping: Na }, hv = { NearestFilter: qt, NearestMipmapNearestFilter: Ks, NearestMipmapLinearFilter: Qs, LinearFilter: Ut, LinearMipmapNearestFilter: Tu, LinearMipmapLinearFilter: yn }; class Cf extends yi { constructor(e) { super(e), 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, r, n) { e === void 0 && (e = ""), this.path !== void 0 && (e = this.path + e), e = this.manager.resolveURL(e); const o = this, a = Fo.get(e); if (a !== void 0) return o.manager.itemStart(e), setTimeout(function() { t && t(a), o.manager.itemEnd(e); }, 0), a; const s = {}; s.credentials = this.crossOrigin === "anonymous" ? "same-origin" : "include", s.headers = this.requestHeader, fetch(e, s).then(function(c) { return c.blob(); }).then(function(c) { return createImageBitmap(c, Object.assign(o.options, { colorSpaceConversion: "none" })); }).then(function(c) { Fo.add(e, c), t && t(c), o.manager.itemEnd(e); }).catch(function(c) { n && n(c), o.manager.itemError(e), o.manager.itemEnd(e); }), o.manager.itemStart(e); } } Cf.prototype.isImageBitmapLoader = !0; class r1 { constructor() { this.type = "ShapePath", this.color = new Be(), this.subPaths = [], this.currentPath = null; } moveTo(e, t) { return this.currentPath = new sl(), this.subPaths.push(this.currentPath), this.currentPath.moveTo(e, t), this; } lineTo(e, t) { return this.currentPath.lineTo(e, t), this; } quadraticCurveTo(e, t, r, n) { return this.currentPath.quadraticCurveTo(e, t, r, n), this; } bezierCurveTo(e, t, r, n, o, a) { return this.currentPath.bezierCurveTo(e, t, r, n, o, a), this; } splineThru(e) { return this.currentPath.splineThru(e), this; } toShapes(e, t) { function r(v) { const M = []; for (let S = 0, T = v.length; S < T; S++) { const x = v[S], w = new Un(); w.curves = x.curves, M.push(w); } return M; } function n(v, M) { const S = M.length; let T = !1; for (let x = S - 1, w = 0; w < S; x = w++) { let A = M[x], _ = M[w], E = _.x - A.x, O = _.y - A.y; if (Math.abs(O) > Number.EPSILON) { if (O < 0 && (A = M[w], E = -E, _ = M[x], O = -O), v.y < A.y || v.y > _.y) continue; if (v.y === A.y) { if (v.x === A.x) return !0; } else { const L = O * (v.x - A.x) - E * (v.y - A.y); if (L === 0) return !0; if (L < 0) continue; T = !T; } } else { if (v.y !== A.y) continue; if (_.x <= v.x && v.x <= A.x || A.x <= v.x && v.x <= _.x) return !0; } } return T; } const o = Dr.isClockWise, a = this.subPaths; if (a.length === 0) return []; if (t === !0) return r(a); let s, c, l; const h = []; if (a.length === 1) return c = a[0], l = new Un(), l.curves = c.curves, h.push(l), h; let u = !o(a[0].getPoints()); u = e ? !u : u; const p = [], g = []; let m = [], d = 0, y; g[d] = void 0, m[d] = []; for (let v = 0, M = a.length; v < M; v++) c = a[v], y = c.getPoints(), s = o(y), s = e ? !s : s, s ? (!u && g[d] && d++, g[d] = { s: new Un(), p: y }, g[d].s.curves = c.curves, u && d++, m[d] = []) : m[d].push({ h: c, p: y[0] }); if (!g[0]) return r(a); if (g.length > 1) { let v = !1; const M = []; for (let S = 0, T = g.length; S < T; S++) p[S] = []; for (let S = 0, T = g.length; S < T; S++) { const x = m[S]; for (let w = 0; w < x.length; w++) { const A = x[w]; let _ = !0; for (let E = 0; E < g.length; E++) n(A.p, g[E].p) && (S !== E && M.push({ froms: S, tos: E, hole: w }), _ ? (_ = !1, p[E].push(A)) : v = !0); _ && p[S].push(A); } } M.length > 0 && (v || (m = p)); } let f; for (let v = 0, M = g.length; v < M; v++) { l = g[v].s, h.push(l), f = m[v]; for (let S = 0, T = f.length; S < T; S++) l.holes.push(f[S].h); } return h; } } class Lf { constructor(e) { this.type = "Font", this.data = e; } generateShapes(e, t = 100) { const r = [], n = _B(e, t, this.data); for (let o = 0, a = n.length; o < a; o++) Array.prototype.push.apply(r, n[o].toShapes()); return r; } } function _B(i, e, t) { const r = Array.from(i), n = e / t.resolution, o = (t.boundingBox.yMax - t.boundingBox.yMin + t.underlineThickness) * n, a = []; let s = 0, c = 0; for (let l = 0; l < r.length; l++) { const h = r[l]; if (h === ` `) s = 0, c -= o; else { const u = MB(h, n, s, c, t); s += u.offsetX, a.push(u.path); } } return a; } function MB(i, e, t, r, n) { const o = n.glyphs[i] || n.glyphs["?"]; if (!o) { console.error('THREE.Font: character "' + i + '" does not exists in font family ' + n.familyName + "."); return; } const a = new r1(); let s, c, l, h, u, p, g, m; if (o.o) { const d = o._cachedOutline || (o._cachedOutline = o.o.split(" ")); for (let y = 0, f = d.length; y < f; ) switch (d[y++]) { case "m": s = d[y++] * e + t, c = d[y++] * e + r, a.moveTo(s, c); break; case "l": s = d[y++] * e + t, c = d[y++] * e + r, a.lineTo(s, c); break; case "q": l = d[y++] * e + t, h = d[y++] * e + r, u = d[y++] * e + t, p = d[y++] * e + r, a.quadraticCurveTo(u, p, l, h); break; case "b": l = d[y++] * e + t, h = d[y++] * e + r, u = d[y++] * e + t, p = d[y++] * e + r, g = d[y++] * e + t, m = d[y++] * e + r, a.bezierCurveTo(u, p, g, m, l, h); break; } } return { offsetX: o.ha * e, path: a }; } Lf.prototype.isFont = !0; class SB extends yi { constructor(e) { super(e); } load(e, t, r, n) { const o = this, a = new Yi(this.manager); a.setPath(this.path), a.setRequestHeader(this.requestHeader), a.setWithCredentials(o.withCredentials), a.load(e, function(s) { let c; try { c = JSON.parse(s); } catch { console.warn("THREE.FontLoader: typeface.js support is being deprecated. Use typeface.json instead."), c = JSON.parse(s.substring(65, s.length - 2)); } const l = o.parse(c); t && t(l); }, r, n); } parse(e) { return new Lf(e); } } let wc; const Rf = { getContext: function() { return wc === void 0 && (wc = new (window.AudioContext || window.webkitAudioContext)()), wc; }, setContext: function(i) { wc = i; } }; class n1 extends yi { constructor(e) { super(e); } load(e, t, r, n) { const o = this, a = new Yi(this.manager); a.setResponseType("arraybuffer"), a.setPath(this.path), a.setRequestHeader(this.requestHeader), a.setWithCredentials(this.withCredentials), a.load(e, function(s) { try { const c = s.slice(0); Rf.getContext().decodeAudioData(c, function(l) { t(l); }); } catch (c) { n ? n(c) : console.error(c), o.manager.itemError(e); } }, r, n); } } class o1 extends Il { constructor(e, t, r = 1) { super(void 0, r); const n = new Be().set(e), o = new Be().set(t), a = new Z(n.r, n.g, n.b), s = new Z(o.r, o.g, o.b), c = Math.sqrt(Math.PI), l = c * Math.sqrt(0.75); this.sh.coefficients[0].copy(a).add(s).multiplyScalar(c), this.sh.coefficients[1].copy(a).sub(s).multiplyScalar(l); } } o1.prototype.isHemisphereLightProbe = !0; class a1 extends Il { constructor(e, t = 1) { super(void 0, t); const r = new Be().set(e); this.sh.coefficients[0].set(r.r, r.g, r.b).multiplyScalar(2 * Math.sqrt(Math.PI)); } } a1.prototype.isAmbientLightProbe = !0; const dv = /* @__PURE__ */ new $e(), pv = /* @__PURE__ */ new $e(); class TB { constructor() { this.type = "StereoCamera", this.aspect = 1, this.eyeSep = 0.064, this.cameraL = new ti(), this.cameraL.layers.enable(1), this.cameraL.matrixAutoUpdate = !1, this.cameraR = new ti(), this.cameraR.layers.enable(2), this.cameraR.matrixAutoUpdate = !1, this._cache = { focus: null, fov: null, aspect: null, near: null, far: null, zoom: null, eyeSep: null }; } update(e) { const t = this._cache; if (t.focus !== e.focus || t.fov !== e.fov || t.aspect !== e.aspect * this.aspect || t.near !== e.near || t.far !== e.far || t.zoom !== e.zoom || t.eyeSep !== this.eyeSep) { t.focus = e.focus, t.fov = e.fov, t.aspect = e.aspect * this.aspect, t.near = e.near, t.far = e.far, t.zoom = e.zoom, t.eyeSep = this.eyeSep; const r = e.projectionMatrix.clone(), n = t.eyeSep / 2, o = n * t.near / t.focus, a = t.near * Math.tan(Co * t.fov * 0.5) / t.zoom; let s, c; pv.elements[12] = -n, dv.elements[12] = n, s = -a * t.aspect + o, c = a * t.aspect + o, r.elements[0] = 2 * t.near / (c - s), r.elements[8] = (c + s) / (c - s), this.cameraL.projectionMatrix.copy(r), s = -a * t.aspect - o, c = a * t.aspect - o, r.elements[0] = 2 * t.near / (c - s), r.elements[8] = (c + s) / (c - s), this.cameraR.projectionMatrix.copy(r); } this.cameraL.matrixWorld.copy(e.matrixWorld).multiply(pv), this.cameraR.matrixWorld.copy(e.matrixWorld).multiply(dv); } } class s1 { constructor(e = !0) { this.autoStart = e, this.startTime = 0, this.oldTime = 0, this.elapsedTime = 0, this.running = !1; } start() { this.startTime = fv(), 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 = fv(); e = (t - this.oldTime) / 1e3, this.oldTime = t, this.elapsedTime += e; } return e; } } function fv() { return (typeof performance > "u" ? Date : performance).now(); } const ho = /* @__PURE__ */ new Z(), mv = /* @__PURE__ */ new vi(), EB = /* @__PURE__ */ new Z(), po = /* @__PURE__ */ new Z(); class AB extends nt { constructor() { super(), this.type = "AudioListener", this.context = Rf.getContext(), this.gain = this.context.createGain(), this.gain.connect(this.context.destination), this.filter = null, this.timeDelta = 0, this._clock = new s1(); } getInput() { return this.gain; } removeFilter() { return this.filter !== null && (this.gain.disconnect(this.filter), this.filter.disconnect(this.context.destination), this.gain.connect(this.context.destination), this.filter = null), this; } getFilter() { return this.filter; } setFilter(e) { return this.filter !== null ? (this.gain.disconnect(this.filter), this.filter.disconnect(this.context.destination)) : this.gain.disconnect(this.context.destination), this.filter = e, this.gain.connect(this.filter), this.filter.connect(this.context.destination), this; } getMasterVolume() { return this.gain.gain.value; } setMasterVolume(e) { return this.gain.gain.setTargetAtTime(e, this.context.currentTime, 0.01), this; } updateMatrixWorld(e) { super.updateMatrixWorld(e); const t = this.context.listener, r = this.up; if (this.timeDelta = this._clock.getDelta(), this.matrixWorld.decompose(ho, mv, EB), po.set(0, 0, -1).applyQuaternion(mv), t.positionX) { const n = this.context.currentTime + this.timeDelta; t.positionX.linearRampToValueAtTime(ho.x, n), t.positionY.linearRampToValueAtTime(ho.y, n), t.positionZ.linearRampToValueAtTime(ho.z, n), t.forwardX.linearRampToValueAtTime(po.x, n), t.forwardY.linearRampToValueAtTime(po.y, n), t.forwardZ.linearRampToValueAtTime(po.z, n), t.upX.linearRampToValueAtTime(r.x, n), t.upY.linearRampToValueAtTime(r.y, n), t.upZ.linearRampToValueAtTime(r.z, n); } else t.setPosition(ho.x, ho.y, ho.z), t.setOrientation(po.x, po.y, po.z, r.x, r.y, r.z); } } class Of extends nt { constructor(e) { super(), this.type = "Audio", this.listener = e, this.context = e.context, this.gain = this.context.createGain(), this.gain.connect(e.getInput()), this.autoplay = !1, this.buffer = null, this.detune = 0, this.loop = !1, this.loopStart = 0, this.loopEnd = 0, this.offset = 0, this.duration = void 0, this.playbackRate = 1, this.isPlaying = !1, this.hasPlaybackControl = !0, this.source = null, this.sourceType = "empty", this._startedAt = 0, this._progress = 0, this._connected = !1, this.filters = []; } getOutput() { return this.gain; } setNodeSource(e) { return this.hasPlaybackControl = !1, this.sourceType = "audioNode", this.source = e, this.connect(), this; } setMediaElementSource(e) { return this.hasPlaybackControl = !1, this.sourceType = "mediaNode", this.source = this.context.createMediaElementSource(e), this.connect(), this; } setMediaStreamSource(e) { return this.hasPlaybackControl = !1, this.sourceType = "mediaStreamNode", this.source = this.context.createMediaStreamSource(e), this.connect(), this; } setBuffer(e) { return this.buffer = e, this.sourceType = "buffer", this.autoplay && this.play(), this; } play(e = 0) { if (this.isPlaying === !0) { console.warn("THREE.Audio: Audio is already playing."); return; } if (this.hasPlaybackControl === !1) { console.warn("THREE.Audio: this Audio has no playback control."); return; } this._startedAt = this.context.currentTime + e; const t = this.context.createBufferSource(); return t.buffer = this.buffer, t.loop = this.loop, t.loopStart = this.loopStart, t.loopEnd = this.loopEnd, t.onended = this.onEnded.bind(this), t.start(this._startedAt, this._progress + this.offset, this.duration), this.isPlaying = !0, this.source = t, this.setDetune(this.detune), this.setPlaybackRate(this.playbackRate), this.connect(); } pause() { if (this.hasPlaybackControl === !1) { console.warn("THREE.Audio: this Audio has no playback control."); return; } return this.isPlaying === !0 && (this._progress += Math.max(this.context.currentTime - this._startedAt, 0) * this.playbackRate, this.loop === !0 && (this._progress = this._progress % (this.duration || this.buffer.duration)), this.source.stop(), this.source.onended = null, this.isPlaying = !1), this; } stop() { if (this.hasPlaybackControl === !1) { console.warn("THREE.Audio: this Audio has no playback control."); return; } return this._progress = 0, this.source.stop(), this.source.onended = null, this.isPlaying = !1, this; } connect() { if (this.filters.length > 0) { this.source.connect(this.filters[0]); for (let e = 1, t = this.filters.length; e < t; e++) this.filters[e - 1].connect(this.filters[e]); this.filters[this.filters.length - 1].connect(this.getOutput()); } else this.source.connect(this.getOutput()); return this._connected = !0, this; } disconnect() { if (this.filters.length > 0) { this.source.disconnect(this.filters[0]); for (let e = 1, t = this.filters.length; e < t; e++) this.filters[e - 1].disconnect(this.filters[e]); this.filters[this.filters.length - 1].disconnect(this.getOutput()); } else this.source.disconnect(this.getOutput()); return this._connected = !1, this; } getFilters() { return this.filters; } setFilters(e) { return e || (e = []), this._connected === !0 ? (this.disconnect(), this.filters = e.slice(), this.connect()) : this.filters = e.slice(), this; } setDetune(e) { if (this.detune = e, this.source.detune !== void 0) return this.isPlaying === !0 && this.source.detune.setTargetAtTime(this.detune, this.context.currentTime, 0.01), this; } getDetune() { return this.detune; } getFilter() { return this.getFilters()[0]; } setFilter(e) { return this.setFilters(e ? [e] : []); } setPlaybackRate(e) { if (this.hasPlaybackControl === !1) { console.warn("THREE.Audio: this Audio has no playback control."); return; } return this.playbackRate = e, this.isPlaying === !0 && this.source.playbackRate.setTargetAtTime(this.playbackRate, this.context.currentTime, 0.01), this; } getPlaybackRate() { return this.playbackRate; } onEnded() { this.isPlaying = !1; } getLoop() { return this.hasPlaybackControl === !1 ? (console.warn("THREE.Audio: this Audio has no playback control."), !1) : this.loop; } setLoop(e) { if (this.hasPlaybackControl === !1) { console.warn("THREE.Audio: this Audio has no playback control."); return; } return this.loop = e, this.isPlaying === !0 && (this.source.loop = this.loop), this; } setLoopStart(e) { return this.loopStart = e, this; } setLoopEnd(e) { return this.loopEnd = e, this; } getVolume() { return this.gain.gain.value; } setVolume(e) { return this.gain.gain.setTargetAtTime(e, this.context.currentTime, 0.01), this; } } const fo = /* @__PURE__ */ new Z(), gv = /* @__PURE__ */ new vi(), CB = /* @__PURE__ */ new Z(), mo = /* @__PURE__ */ new Z(); class LB extends Of { constructor(e) { super(e), this.panner = this.context.createPanner(), this.panner.panningModel = "HRTF", this.panner.connect(this.gain); } getOutput() { return this.panner; } getRefDistance() { return this.panner.refDistance; } setRefDistance(e) { return this.panner.refDistance = e, this; } getRolloffFactor() { return this.panner.rolloffFactor; } setRolloffFactor(e) { return this.panner.rolloffFactor = e, this; } getDistanceModel() { return this.panner.distanceModel; } setDistanceModel(e) { return this.panner.distanceModel = e, this; } getMaxDistance() { return this.panner.maxDistance; } setMaxDistance(e) { return this.panner.maxDistance = e, this; } setDirectionalCone(e, t, r) { return this.panner.coneInnerAngle = e, this.panner.coneOuterAngle = t, this.panner.coneOuterGain = r, this; } updateMatrixWorld(e) { if (super.updateMatrixWorld(e), this.hasPlaybackControl === !0 && this.isPlaying === !1) return; this.matrixWorld.decompose(fo, gv, CB), mo.set(0, 0, 1).applyQuaternion(gv); const t = this.panner; if (t.positionX) { const r = this.context.currentTime + this.listener.timeDelta; t.positionX.linearRampToValueAtTime(fo.x, r), t.positionY.linearRampToValueAtTime(fo.y, r), t.positionZ.linearRampToValueAtTime(fo.z, r), t.orientationX.linearRampToValueAtTime(mo.x, r), t.orientationY.linearRampToValueAtTime(mo.y, r), t.orientationZ.linearRampToValueAtTime(mo.z, r); } else t.setPosition(fo.x, fo.y, fo.z), t.setOrientation(mo.x, mo.y, mo.z); } } class l1 { constructor(e, t = 2048) { this.analyser = e.context.createAnalyser(), this.analyser.fftSize = t, this.data = new Uint8Array(this.analyser.frequencyBinCount), e.getOutput().connect(this.analyser); } getFrequencyData() { return this.analyser.getByteFrequencyData(this.data), this.data; } getAverageFrequency() { let e = 0; const t = this.getFrequencyData(); for (let r = 0; r < t.length; r++) e += t[r]; return e / t.length; } } class c1 { constructor(e, t, r) { this.binding = e, this.valueSize = r; let n, o, a; switch (t) { case "quaternion": n = this._slerp, o = this._slerpAdditive, a = this._setAdditiveIdentityQuaternion, this.buffer = new Float64Array(r * 6), this._workIndex = 5; break; case "string": case "bool": n = this._select, o = this._select, a = this._setAdditiveIdentityOther, this.buffer = new Array(r * 5); break; default: n = this._lerp, o = this._lerpAdditive, a = this._setAdditiveIdentityNumeric, this.buffer = new Float64Array(r * 5); } this._mixBufferRegion = n, this._mixBufferRegionAdditive = o, this._setIdentity = a, this._origIndex = 3, this._addIndex = 4, this.cumulativeWeight = 0, this.cumulativeWeightAdditive = 0, this.useCount = 0, this.referenceCount = 0; } // accumulate data in the 'incoming' region into 'accu' accumulate(e, t) { const r = this.buffer, n = this.valueSize, o = e * n + n; let a = this.cumulativeWeight; if (a === 0) { for (let s = 0; s !== n; ++s) r[o + s] = r[s]; a = t; } else { a += t; const s = t / a; this._mixBufferRegion(r, o, 0, s, n); } this.cumulativeWeight = a; } // accumulate data in the 'incoming' region into 'add' accumulateAdditive(e) { const t = this.buffer, r = this.valueSize, n = r * this._addIndex; this.cumulativeWeightAdditive === 0 && this._setIdentity(), this._mixBufferRegionAdditive(t, n, 0, e, r), this.cumulativeWeightAdditive += e; } // apply the state of 'accu' to the binding when accus differ apply(e) { const t = this.valueSize, r = this.buffer, n = e * t + t, o = this.cumulativeWeight, a = this.cumulativeWeightAdditive, s = this.binding; if (this.cumulativeWeight = 0, this.cumulativeWeightAdditive = 0, o < 1) { const c = t * this._origIndex; this._mixBufferRegion( r, n, c, 1 - o, t ); } a > 0 && this._mixBufferRegionAdditive(r, n, this._addIndex * t, 1, t); for (let c = t, l = t + t; c !== l; ++c) if (r[c] !== r[c + t]) { s.setValue(r, n); break; } } // remember the state of the bound property and copy it to both accus saveOriginalState() { const e = this.binding, t = this.buffer, r = this.valueSize, n = r * this._origIndex; e.getValue(t, n); for (let o = r, a = n; o !== a; ++o) t[o] = t[n + o % r]; this._setIdentity(), this.cumulativeWeight = 0, this.cumulativeWeightAdditive = 0; } // apply the state previously taken via 'saveOriginalState' to the binding 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 r = e; r < t; r++) this.buffer[r] = 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 r = 0; r < this.valueSize; r++) this.buffer[t + r] = this.buffer[e + r]; } // mix functions _select(e, t, r, n, o) { if (n >= 0.5) for (let a = 0; a !== o; ++a) e[t + a] = e[r + a]; } _slerp(e, t, r, n) { vi.slerpFlat(e, t, e, t, e, r, n); } _slerpAdditive(e, t, r, n, o) { const a = this._workIndex * o; vi.multiplyQuaternionsFlat(e, a, e, t, e, r), vi.slerpFlat(e, t, e, t, e, a, n); } _lerp(e, t, r, n, o) { const a = 1 - n; for (let s = 0; s !== o; ++s) { const c = t + s; e[c] = e[c] * a + e[r + s] * n; } } _lerpAdditive(e, t, r, n, o) { for (let a = 0; a !== o; ++a) { const s = t + a; e[s] = e[s] + e[r + a] * n; } } } const Pf = "\\[\\]\\.:\\/", RB = new RegExp("[" + Pf + "]", "g"), If = "[^" + Pf + "]", OB = "[^" + Pf.replace("\\.", "") + "]", PB = /((?:WC+[\/:])*)/.source.replace("WC", If), IB = /(WCOD+)?/.source.replace("WCOD", OB), DB = /(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace("WC", If), NB = /\.(WC+)(?:\[(.+)\])?/.source.replace("WC", If), BB = new RegExp( "^" + PB + IB + DB + NB + "$" ), kB = ["material", "materials", "bones"]; class zB { constructor(e, t, r) { const n = r || ft.parseTrackName(t); this._targetGroup = e, this._bindings = e.subscribe_(t, n); } getValue(e, t) { this.bind(); const r = this._targetGroup.nCachedObjects_, n = this._bindings[r]; n !== void 0 && n.getValue(e, t); } setValue(e, t) { const r = this._bindings; for (let n = this._targetGroup.nCachedObjects_, o = r.length; n !== o; ++n) r[n].setValue(e, t); } bind() { const e = this._bindings; for (let t = this._targetGroup.nCachedObjects_, r = e.length; t !== r; ++t) e[t].bind(); } unbind() { const e = this._bindings; for (let t = this._targetGroup.nCachedObjects_, r = e.length; t !== r; ++t) e[t].unbind(); } } class ft { constructor(e, t, r) { this.path = t, this.parsedPath = r || ft.parseTrackName(t), this.node = ft.findNode(e, this.parsedPath.nodeName) || e, this.rootNode = e, this.getValue = this._getValue_unbound, this.setValue = this._setValue_unbound; } static create(e, t, r) { return e && e.isAnimationObjectGroup ? new ft.Composite(e, t, r) : new ft(e, t, r); } /** * Replaces spaces with underscores and removes unsupported characters from * node names, to ensure compatibility with parseTrackName(). * * @param {string} name Node name to be sanitized. * @return {string} */ static sanitizeNodeName(e) { return e.replace(/\s/g, "_").replace(RB, ""); } static parseTrackName(e) { const t = BB.exec(e); if (!t) throw new Error("PropertyBinding: Cannot parse trackName: " + e); const r = { // directoryName: matches[ 1 ], // (tschw) currently unused nodeName: t[2], objectName: t[3], objectIndex: t[4], propertyName: t[5], // required propertyIndex: t[6] }, n = r.nodeName && r.nodeName.lastIndexOf("."); if (n !== void 0 && n !== -1) { const o = r.nodeName.substring(n + 1); kB.indexOf(o) !== -1 && (r.nodeName = r.nodeName.substring(0, n), r.objectName = o); } if (r.propertyName === null || r.propertyName.length === 0) throw new Error("PropertyBinding: can not parse propertyName from trackName: " + e); return r; } static findNode(e, t) { if (!t || t === "" || t === "." || t === -1 || t === e.name || t === e.uuid) return e; if (e.skeleton) { const r = e.skeleton.getBoneByName(t); if (r !== void 0) return r; } if (e.children) { const r = function(o) { for (let a = 0; a < o.length; a++) { const s = o[a]; if (s.name === t || s.uuid === t) return s; const c = r(s.children); if (c) return c; } return null; }, n = r(e.children); if (n) return n; } return null; } // these are used to "bind" a nonexistent property _getValue_unavailable() { } _setValue_unavailable() { } // Getters _getValue_direct(e, t) { e[t] = this.node[this.propertyName]; } _getValue_array(e, t) { const r = this.resolvedProperty; for (let n = 0, o = r.length; n !== o; ++n) e[t++] = r[n]; } _getValue_arrayElement(e, t) { e[t] = this.resolvedProperty[this.propertyIndex]; } _getValue_toArray(e, t) { this.resolvedProperty.toArray(e, t); } // Direct _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; } // EntireArray _setValue_array(e, t) { const r = this.resolvedProperty; for (let n = 0, o = r.length; n !== o; ++n) r[n] = e[t++]; } _setValue_array_setNeedsUpdate(e, t) { const r = this.resolvedProperty; for (let n = 0, o = r.length; n !== o; ++n) r[n] = e[t++]; this.targetObject.needsUpdate = !0; } _setValue_array_setMatrixWorldNeedsUpdate(e, t) { const r = this.resolvedProperty; for (let n = 0, o = r.length; n !== o; ++n) r[n] = e[t++]; this.targetObject.matrixWorldNeedsUpdate = !0; } // ArrayElement _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; } // HasToFromArray _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); } // create getter / setter pair for a property in the scene graph bind() { let e = this.node; const t = this.parsedPath, r = t.objectName, n = t.propertyName; let o = t.propertyIndex; if (e || (e = ft.findNode(this.rootNode, t.nodeName) || this.rootNode, this.node = e), this.getValue = this._getValue_unavailable, this.setValue = this._setValue_unavailable, !e) { console.error("THREE.PropertyBinding: Trying to update node for track: " + this.path + " but it wasn't found."); return; } if (r) { let l = t.objectIndex; switch (r) { 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 h = 0; h < e.length; h++) if (e[h].name === l) { l = h; break; } break; default: if (e[r] === void 0) { console.error("THREE.PropertyBinding: Can not bind to objectName of node undefined.", this); return; } e = e[r]; } if (l !== void 0) { if (e[l] === void 0) { console.error("THREE.PropertyBinding: Trying to bind to objectIndex of objectName, but is undefined.", this, e); return; } e = e[l]; } } const a = e[n]; if (a === void 0) { const l = t.nodeName; console.error("THREE.PropertyBinding: Trying to update property for track: " + l + "." + n + " but it wasn't found.", e); return; } let s = this.Versioning.None; this.targetObject = e, e.needsUpdate !== void 0 ? s = this.Versioning.NeedsUpdate : e.matrixWorldNeedsUpdate !== void 0 && (s = this.Versioning.MatrixWorldNeedsUpdate); let c = this.BindingType.Direct; if (o !== void 0) { if (n === "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.isBufferGeometry) { 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[o] !== void 0 && (o = e.morphTargetDictionary[o]); } else { console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences on THREE.Geometry. Use THREE.BufferGeometry instead.", this); return; } } c = this.BindingType.ArrayElement, this.resolvedProperty = a, this.propertyIndex = o; } else a.fromArray !== void 0 && a.toArray !== void 0 ? (c = this.BindingType.HasFromToArray, this.resolvedProperty = a) : Array.isArray(a) ? (c = this.BindingType.EntireArray, this.resolvedProperty = a) : this.propertyName = n; this.getValue = this.GetterByBindingType[c], this.setValue = this.SetterByBindingTypeAndVersioning[c][s]; } unbind() { this.node = null, this.getValue = this._getValue_unbound, this.setValue = this._setValue_unbound; } } ft.Composite = zB; ft.prototype.BindingType = { Direct: 0, EntireArray: 1, ArrayElement: 2, HasFromToArray: 3 }; ft.prototype.Versioning = { None: 0, NeedsUpdate: 1, MatrixWorldNeedsUpdate: 2 }; ft.prototype.GetterByBindingType = [ ft.prototype._getValue_direct, ft.prototype._getValue_array, ft.prototype._getValue_arrayElement, ft.prototype._getValue_toArray ]; ft.prototype.SetterByBindingTypeAndVersioning = [ [ // Direct ft.prototype._setValue_direct, ft.prototype._setValue_direct_setNeedsUpdate, ft.prototype._setValue_direct_setMatrixWorldNeedsUpdate ], [ // EntireArray ft.prototype._setValue_array, ft.prototype._setValue_array_setNeedsUpdate, ft.prototype._setValue_array_setMatrixWorldNeedsUpdate ], [ // ArrayElement ft.prototype._setValue_arrayElement, ft.prototype._setValue_arrayElement_setNeedsUpdate, ft.prototype._setValue_arrayElement_setMatrixWorldNeedsUpdate ], [ // HasToFromArray ft.prototype._setValue_fromArray, ft.prototype._setValue_fromArray_setNeedsUpdate, ft.prototype._setValue_fromArray_setMatrixWorldNeedsUpdate ] ]; class u1 { constructor() { this.uuid = qi(), this._objects = Array.prototype.slice.call(arguments), this.nCachedObjects_ = 0; const e = {}; this._indicesByUUID = e; for (let r = 0, n = arguments.length; r !== n; ++r) e[arguments[r].uuid] = r; this._paths = [], this._parsedPaths = [], this._bindings = [], this._bindingsIndicesByPath = {}; const t = this; this.stats = { objects: { get total() { return t._objects.length; }, get inUse() { return this.total - t.nCachedObjects_; } }, get bindingsPerObject() { return t._bindings.length; } }; } add() { const e = this._objects, t = this._indicesByUUID, r = this._paths, n = this._parsedPaths, o = this._bindings, a = o.length; let s, c = e.length, l = this.nCachedObjects_; for (let h = 0, u = arguments.length; h !== u; ++h) { const p = arguments[h], g = p.uuid; let m = t[g]; if (m === void 0) { m = c++, t[g] = m, e.push(p); for (let d = 0, y = a; d !== y; ++d) o[d].push(new ft(p, r[d], n[d])); } else if (m < l) { s = e[m]; const d = --l, y = e[d]; t[y.uuid] = m, e[m] = y, t[g] = d, e[d] = p; for (let f = 0, v = a; f !== v; ++f) { const M = o[f], S = M[d]; let T = M[m]; M[m] = S, T === void 0 && (T = new ft(p, r[f], n[f])), M[d] = T; } } else e[m] !== s && console.error("THREE.AnimationObjectGroup: Different objects with the same UUID detected. Clean the caches or recreate your infrastructure when reloading scenes."); } this.nCachedObjects_ = l; } remove() { const e = this._objects, t = this._indicesByUUID, r = this._bindings, n = r.length; let o = this.nCachedObjects_; for (let a = 0, s = arguments.length; a !== s; ++a) { const c = arguments[a], l = c.uuid, h = t[l]; if (h !== void 0 && h >= o) { const u = o++, p = e[u]; t[p.uuid] = h, e[h] = p, t[l] = u, e[u] = c; for (let g = 0, m = n; g !== m; ++g) { const d = r[g], y = d[u], f = d[h]; d[h] = y, d[u] = f; } } } this.nCachedObjects_ = o; } // remove & forget uncache() { const e = this._objects, t = this._indicesByUUID, r = this._bindings, n = r.length; let o = this.nCachedObjects_, a = e.length; for (let s = 0, c = arguments.length; s !== c; ++s) { const l = arguments[s], h = l.uuid, u = t[h]; if (u !== void 0) if (delete t[h], u < o) { const p = --o, g = e[p], m = --a, d = e[m]; t[g.uuid] = u, e[u] = g, t[d.uuid] = p, e[p] = d, e.pop(); for (let y = 0, f = n; y !== f; ++y) { const v = r[y], M = v[p], S = v[m]; v[u] = M, v[p] = S, v.pop(); } } else { const p = --a, g = e[p]; p > 0 && (t[g.uuid] = u), e[u] = g, e.pop(); for (let m = 0, d = n; m !== d; ++m) { const y = r[m]; y[u] = y[p], y.pop(); } } } this.nCachedObjects_ = o; } // Internal interface used by befriended PropertyBinding.Composite: subscribe_(e, t) { const r = this._bindingsIndicesByPath; let n = r[e]; const o = this._bindings; if (n !== void 0) return o[n]; const a = this._paths, s = this._parsedPaths, c = this._objects, l = c.length, h = this.nCachedObjects_, u = new Array(l); n = o.length, r[e] = n, a.push(e), s.push(t), o.push(u); for (let p = h, g = c.length; p !== g; ++p) { const m = c[p]; u[p] = new ft(m, e, t); } return u; } unsubscribe_(e) { const t = this._bindingsIndicesByPath, r = t[e]; if (r !== void 0) { const n = this._paths, o = this._parsedPaths, a = this._bindings, s = a.length - 1, c = a[s], l = e[s]; t[l] = r, a[r] = c, a.pop(), o[r] = o[s], o.pop(), n[r] = n[s], n.pop(); } } } u1.prototype.isAnimationObjectGroup = !0; class FB { constructor(e, t, r = null, n = t.blendMode) { this._mixer = e, this._clip = t, this._localRoot = r, this.blendMode = n; const o = t.tracks, a = o.length, s = new Array(a), c = { endingStart: wo, endingEnd: wo }; for (let l = 0; l !== a; ++l) { const h = o[l].createInterpolant(null); s[l] = h, h.settings = c; } this._interpolantSettings = c, this._interpolants = s, this._propertyBindings = new Array(a), this._cacheIndex = null, this._byClipCacheIndex = null, this._timeScaleInterpolant = null, this._weightInterpolant = null, this.loop = rx, 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; } // State & Scheduling 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); } // return true when play has been called isScheduled() { return this._mixer._isActiveAction(this); } startAt(e) { return this._startTime = e, this; } setLoop(e, t) { return this.loop = e, this.repetitions = t, this; } // Weight // set the weight stopping any scheduled fading // although .enabled = false yields an effective weight of zero, this // method does *not* change .enabled, because it would be confusing setEffectiveWeight(e) { return this.weight = e, this._effectiveWeight = this.enabled ? e : 0, this.stopFading(); } // return the weight considering fading and .enabled getEffectiveWeight() { return this._effectiveWeight; } fadeIn(e) { return this._scheduleFading(e, 0, 1); } fadeOut(e) { return this._scheduleFading(e, 1, 0); } crossFadeFrom(e, t, r) { if (e.fadeOut(t), this.fadeIn(t), r) { const n = this._clip.duration, o = e._clip.duration, a = o / n, s = n / o; e.warp(1, a, t), this.warp(s, 1, t); } return this; } crossFadeTo(e, t, r) { return e.crossFadeFrom(this, t, r); } stopFading() { const e = this._weightInterpolant; return e !== null && (this._weightInterpolant = null, this._mixer._takeBackControlInterpolant(e)), this; } // Time Scale Control // set the time scale stopping any scheduled warping // although .paused = true yields an effective time scale of zero, this // method does *not* change .paused, because it would be confusing setEffectiveTimeScale(e) { return this.timeScale = e, this._effectiveTimeScale = this.paused ? 0 : e, this.stopWarping(); } // return the time scale considering warping and .paused 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, r) { const n = this._mixer, o = n.time, a = this.timeScale; let s = this._timeScaleInterpolant; s === null && (s = n._lendControlInterpolant(), this._timeScaleInterpolant = s); const c = s.parameterPositions, l = s.sampleValues; return c[0] = o, c[1] = o + r, l[0] = e / a, l[1] = t / a, this; } stopWarping() { const e = this._timeScaleInterpolant; return e !== null && (this._timeScaleInterpolant = null, this._mixer._takeBackControlInterpolant(e)), this; } // Object Accessors getMixer() { return this._mixer; } getClip() { return this._clip; } getRoot() { return this._localRoot || this._mixer._root; } // Interna _update(e, t, r, n) { if (!this.enabled) { this._updateWeight(e); return; } const o = this._startTime; if (o !== null) { const c = (e - o) * r; if (c < 0 || r === 0) return; this._startTime = null, t = r * c; } t *= this._updateTimeScale(e); const a = this._updateTime(t), s = this._updateWeight(e); if (s > 0) { const c = this._interpolants, l = this._propertyBindings; switch (this.blendMode) { case Gp: for (let h = 0, u = c.length; h !== u; ++h) c[h].evaluate(a), l[h].accumulateAdditive(s); break; case Eu: default: for (let h = 0, u = c.length; h !== u; ++h) c[h].evaluate(a), l[h].accumulate(n, s); } } } _updateWeight(e) { let t = 0; if (this.enabled) { t = this.weight; const r = this._weightInterpolant; if (r !== null) { const n = r.evaluate(e)[0]; t *= n, e > r.parameterPositions[1] && (this.stopFading(), n === 0 && (this.enabled = !1)); } } return this._effectiveWeight = t, t; } _updateTimeScale(e) { let t = 0; if (!this.paused) { t = this.timeScale; const r = this._timeScaleInterpolant; if (r !== null) { const n = r.evaluate(e)[0]; t *= n, e > r.parameterPositions[1] && (this.stopWarping(), t === 0 ? this.paused = !0 : this.timeScale = t); } } return this._effectiveTimeScale = t, t; } _updateTime(e) { const t = this._clip.duration, r = this.loop; let n = this.time + e, o = this._loopCount; const a = r === nx; if (e === 0) return o === -1 ? n : a && (o & 1) === 1 ? t - n : n; if (r === ix) { o === -1 && (this._loopCount = 0, this._setEndings(!0, !0, !1)); e: { if (n >= t) n = t; else if (n < 0) n = 0; else { this.time = n; break e; } this.clampWhenFinished ? this.paused = !0 : this.enabled = !1, this.time = n, this._mixer.dispatchEvent({ type: "finished", action: this, direction: e < 0 ? -1 : 1 }); } } else { if (o === -1 && (e >= 0 ? (o = 0, this._setEndings(!0, this.repetitions === 0, a)) : this._setEndings(this.repetitions === 0, !0, a)), n >= t || n < 0) { const s = Math.floor(n / t); n -= t * s, o += Math.abs(s); const c = this.repetitions - o; if (c <= 0) this.clampWhenFinished ? this.paused = !0 : this.enabled = !1, n = e > 0 ? t : 0, this.time = n, this._mixer.dispatchEvent({ type: "finished", action: this, direction: e > 0 ? 1 : -1 }); else { if (c === 1) { const l = e < 0; this._setEndings(l, !l, a); } else this._setEndings(!1, !1, a); this._loopCount = o, this.time = n, this._mixer.dispatchEvent({ type: "loop", action: this, loopDelta: s }); } } else this.time = n; if (a && (o & 1) === 1) return t - n; } return n; } _setEndings(e, t, r) { const n = this._interpolantSettings; r ? (n.endingStart = _o, n.endingEnd = _o) : (e ? n.endingStart = this.zeroSlopeAtStart ? _o : wo : n.endingStart = tl, t ? n.endingEnd = this.zeroSlopeAtEnd ? _o : wo : n.endingEnd = tl); } _scheduleFading(e, t, r) { const n = this._mixer, o = n.time; let a = this._weightInterpolant; a === null && (a = n._lendControlInterpolant(), this._weightInterpolant = a); const s = a.parameterPositions, c = a.sampleValues; return s[0] = o, c[0] = t, s[1] = o + e, c[1] = r, this; } } class h1 extends to { constructor(e) { super(), this._root = e, this._initMemoryManager(), this._accuIndex = 0, this.time = 0, this.timeScale = 1; } _bindAction(e, t) { const r = e._localRoot || this._root, n = e._clip.tracks, o = n.length, a = e._propertyBindings, s = e._interpolants, c = r.uuid, l = this._bindingsByRootAndName; let h = l[c]; h === void 0 && (h = {}, l[c] = h); for (let u = 0; u !== o; ++u) { const p = n[u], g = p.name; let m = h[g]; if (m !== void 0) a[u] = m; else { if (m = a[u], m !== void 0) { m._cacheIndex === null && (++m.referenceCount, this._addInactiveBinding(m, c, g)); continue; } const d = t && t._propertyBindings[u].binding.parsedPath; m = new c1( ft.create(r, g, d), p.ValueTypeName, p.getValueSize() ), ++m.referenceCount, this._addInactiveBinding(m, c, g), a[u] = m; } s[u].resultBuffer = m.buffer; } } _activateAction(e) { if (!this._isActiveAction(e)) { if (e._cacheIndex === null) { const r = (e._localRoot || this._root).uuid, n = e._clip.uuid, o = this._actionsByClip[n]; this._bindAction( e, o && o.knownActions[0] ), this._addInactiveAction(e, n, r); } const t = e._propertyBindings; for (let r = 0, n = t.length; r !== n; ++r) { const o = t[r]; o.useCount++ === 0 && (this._lendBinding(o), o.saveOriginalState()); } this._lendAction(e); } } _deactivateAction(e) { if (this._isActiveAction(e)) { const t = e._propertyBindings; for (let r = 0, n = t.length; r !== n; ++r) { const o = t[r]; --o.useCount === 0 && (o.restoreOriginalState(), this._takeBackBinding(o)); } this._takeBackAction(e); } } // Memory manager _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; } } }; } // Memory management for AnimationAction objects _isActiveAction(e) { const t = e._cacheIndex; return t !== null && t < this._nActiveActions; } _addInactiveAction(e, t, r) { const n = this._actions, o = this._actionsByClip; let a = o[t]; if (a === void 0) a = { knownActions: [e], actionByRoot: {} }, e._byClipCacheIndex = 0, o[t] = a; else { const s = a.knownActions; e._byClipCacheIndex = s.length, s.push(e); } e._cacheIndex = n.length, n.push(e), a.actionByRoot[r] = e; } _removeInactiveAction(e) { const t = this._actions, r = t[t.length - 1], n = e._cacheIndex; r._cacheIndex = n, t[n] = r, t.pop(), e._cacheIndex = null; const o = e._clip.uuid, a = this._actionsByClip, s = a[o], c = s.knownActions, l = c[c.length - 1], h = e._byClipCacheIndex; l._byClipCacheIndex = h, c[h] = l, c.pop(), e._byClipCacheIndex = null; const u = s.actionByRoot, p = (e._localRoot || this._root).uuid; delete u[p], c.length === 0 && delete a[o], this._removeInactiveBindingsForAction(e); } _removeInactiveBindingsForAction(e) { const t = e._propertyBindings; for (let r = 0, n = t.length; r !== n; ++r) { const o = t[r]; --o.referenceCount === 0 && this._removeInactiveBinding(o); } } _lendAction(e) { const t = this._actions, r = e._cacheIndex, n = this._nActiveActions++, o = t[n]; e._cacheIndex = n, t[n] = e, o._cacheIndex = r, t[r] = o; } _takeBackAction(e) { const t = this._actions, r = e._cacheIndex, n = --this._nActiveActions, o = t[n]; e._cacheIndex = n, t[n] = e, o._cacheIndex = r, t[r] = o; } // Memory management for PropertyMixer objects _addInactiveBinding(e, t, r) { const n = this._bindingsByRootAndName, o = this._bindings; let a = n[t]; a === void 0 && (a = {}, n[t] = a), a[r] = e, e._cacheIndex = o.length, o.push(e); } _removeInactiveBinding(e) { const t = this._bindings, r = e.binding, n = r.rootNode.uuid, o = r.path, a = this._bindingsByRootAndName, s = a[n], c = t[t.length - 1], l = e._cacheIndex; c._cacheIndex = l, t[l] = c, t.pop(), delete s[o], Object.keys(s).length === 0 && delete a[n]; } _lendBinding(e) { const t = this._bindings, r = e._cacheIndex, n = this._nActiveBindings++, o = t[n]; e._cacheIndex = n, t[n] = e, o._cacheIndex = r, t[r] = o; } _takeBackBinding(e) { const t = this._bindings, r = e._cacheIndex, n = --this._nActiveBindings, o = t[n]; e._cacheIndex = n, t[n] = e, o._cacheIndex = r, t[r] = o; } // Memory management of Interpolants for weight and time scale _lendControlInterpolant() { const e = this._controlInterpolants, t = this._nActiveControlInterpolants++; let r = e[t]; return r === void 0 && (r = new vf( new Float32Array(2), new Float32Array(2), 1, this._controlInterpolantsResultBuffer ), r.__cacheIndex = t, e[t] = r), r; } _takeBackControlInterpolant(e) { const t = this._controlInterpolants, r = e.__cacheIndex, n = --this._nActiveControlInterpolants, o = t[n]; e.__cacheIndex = n, t[n] = e, o.__cacheIndex = r, t[r] = o; } // return an action for a clip optionally using a custom root target // object (this method allocates a lot of dynamic memory in case a // previously unknown clip/root combination is specified) clipAction(e, t, r) { const n = t || this._root, o = n.uuid; let a = typeof e == "string" ? Qa.findByName(n, e) : e; const s = a !== null ? a.uuid : e, c = this._actionsByClip[s]; let l = null; if (r === void 0 && (a !== null ? r = a.blendMode : r = Eu), c !== void 0) { const u = c.actionByRoot[o]; if (u !== void 0 && u.blendMode === r) return u; l = c.knownActions[0], a === null && (a = l._clip); } if (a === null) return null; const h = new FB(this, a, t, r); return this._bindAction(h, l), this._addInactiveAction(h, s, o), h; } // get an existing action existingAction(e, t) { const r = t || this._root, n = r.uuid, o = typeof e == "string" ? Qa.findByName(r, e) : e, a = o ? o.uuid : e, s = this._actionsByClip[a]; return s !== void 0 && s.actionByRoot[n] || null; } // deactivates all previously scheduled actions stopAllAction() { const e = this._actions, t = this._nActiveActions; for (let r = t - 1; r >= 0; --r) e[r].stop(); return this; } // advance the time and update apply the animation update(e) { e *= this.timeScale; const t = this._actions, r = this._nActiveActions, n = this.time += e, o = Math.sign(e), a = this._accuIndex ^= 1; for (let l = 0; l !== r; ++l) t[l]._update(n, e, o, a); const s = this._bindings, c = this._nActiveBindings; for (let l = 0; l !== c; ++l) s[l].apply(a); return this; } // Allows you to seek to a specific time in an animation. setTime(e) { this.time = 0; for (let t = 0; t < this._actions.length; t++) this._actions[t].time = 0; return this.update(e); } // return this mixer's root target object getRoot() { return this._root; } // free all resources specific to a particular clip uncacheClip(e) { const t = this._actions, r = e.uuid, n = this._actionsByClip, o = n[r]; if (o !== void 0) { const a = o.knownActions; for (let s = 0, c = a.length; s !== c; ++s) { const l = a[s]; this._deactivateAction(l); const h = l._cacheIndex, u = t[t.length - 1]; l._cacheIndex = null, l._byClipCacheIndex = null, u._cacheIndex = h, t[h] = u, t.pop(), this._removeInactiveBindingsForAction(l); } delete n[r]; } } // free all resources specific to a particular root target object uncacheRoot(e) { const t = e.uuid, r = this._actionsByClip; for (const a in r) { const s = r[a].actionByRoot, c = s[t]; c !== void 0 && (this._deactivateAction(c), this._removeInactiveAction(c)); } const n = this._bindingsByRootAndName, o = n[t]; if (o !== void 0) for (const a in o) { const s = o[a]; s.restoreOriginalState(), this._removeInactiveBinding(s); } } // remove a targeted clip from the cache uncacheAction(e, t) { const r = this.existingAction(e, t); r !== null && (this._deactivateAction(r), this._removeInactiveAction(r)); } } h1.prototype._controlInterpolantsResultBuffer = new Float32Array(1); class ju { constructor(e) { typeof e == "string" && (console.warn("THREE.Uniform: Type parameter is no longer needed."), e = arguments[1]), this.value = e; } clone() { return new ju(this.value.clone === void 0 ? this.value : this.value.clone()); } } class d1 extends ro { constructor(e, t, r = 1) { super(e, t), this.meshPerAttribute = r; } 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; } } d1.prototype.isInstancedInterleavedBuffer = !0; class p1 { constructor(e, t, r, n, o) { this.buffer = e, this.type = t, this.itemSize = r, this.elementSize = n, this.count = o, this.version = 0; } set needsUpdate(e) { e === !0 && this.version++; } setBuffer(e) { return this.buffer = e, this; } setType(e, t) { return this.type = e, this.elementSize = t, this; } setItemSize(e) { return this.itemSize = e, this; } setCount(e) { return this.count = e, this; } } p1.prototype.isGLBufferAttribute = !0; class VB { constructor(e, t, r = 0, n = 1 / 0) { this.ray = new io(e, t), this.near = r, this.far = n, this.camera = null, this.layers = new Zp(), this.params = { Mesh: {}, Line: { threshold: 1 }, LOD: {}, Points: { threshold: 1 }, Sprite: {} }; } set(e, t) { this.ray.set(e, t); } setFromCamera(e, t) { t && t.isPerspectiveCamera ? (this.ray.origin.setFromMatrixPosition(t.matrixWorld), this.ray.direction.set(e.x, e.y, 0.5).unproject(t).sub(this.ray.origin).normalize(), this.camera = t) : t && t.isOrthographicCamera ? (this.ray.origin.set(e.x, e.y, (t.near + t.far) / (t.near - t.far)).unproject(t), this.ray.direction.set(0, 0, -1).transformDirection(t.matrixWorld), this.camera = t) : console.error("THREE.Raycaster: Unsupported camera type: " + t.type); } intersectObject(e, t = !1, r = []) { return Vd(e, this, r, t), r.sort(vv), r; } intersectObjects(e, t = !1, r = []) { for (let n = 0, o = e.length; n < o; n++) Vd(e[n], this, r, t); return r.sort(vv), r; } } function vv(i, e) { return i.distance - e.distance; } function Vd(i, e, t, r) { if (i.layers.test(e.layers) && i.raycast(e, t), r === !0) { const n = i.children; for (let o = 0, a = n.length; o < a; o++) Vd(n[o], e, t, !0); } } class UB { constructor(e = 1, t = 0, r = 0) { return this.radius = e, this.phi = t, this.theta = r, this; } set(e, t, r) { return this.radius = e, this.phi = t, this.theta = r, this; } copy(e) { return this.radius = e.radius, this.phi = e.phi, this.theta = e.theta, this; } // restrict phi to be betwee EPS and PI-EPS makeSafe() { return this.phi = Math.max(1e-6, Math.min(Math.PI - 1e-6, this.phi)), this; } setFromVector3(e) { return this.setFromCartesianCoords(e.x, e.y, e.z); } setFromCartesianCoords(e, t, r) { return this.radius = Math.sqrt(e * e + t * t + r * r), this.radius === 0 ? (this.theta = 0, this.phi = 0) : (this.theta = Math.atan2(e, r), this.phi = Math.acos(mi(t / this.radius, -1, 1))), this; } clone() { return new this.constructor().copy(this); } } class GB { constructor(e = 1, t = 0, r = 0) { return this.radius = e, this.theta = t, this.y = r, this; } set(e, t, r) { return this.radius = e, this.theta = t, this.y = r, this; } copy(e) { return this.radius = e.radius, this.theta = e.theta, this.y = e.y, this; } setFromVector3(e) { return this.setFromCartesianCoords(e.x, e.y, e.z); } setFromCartesianCoords(e, t, r) { return this.radius = Math.sqrt(e * e + r * r), this.theta = Math.atan2(e, r), this.y = t, this; } clone() { return new this.constructor().copy(this); } } const yv = /* @__PURE__ */ new Oe(); class fs { constructor(e = new Oe(1 / 0, 1 / 0), t = new Oe(-1 / 0, -1 / 0)) { this.min = e, this.max = t; } set(e, t) { return this.min.copy(e), this.max.copy(t), this; } setFromPoints(e) { this.makeEmpty(); for (let t = 0, r = e.length; t < r; t++) this.expandByPoint(e[t]); return this; } setFromCenterAndSize(e, t) { const r = yv.copy(t).multiplyScalar(0.5); return this.min.copy(e).sub(r), this.max.copy(e).add(r), this; } 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 = 1 / 0, this.max.x = this.max.y = -1 / 0, this; } isEmpty() { return this.max.x < this.min.x || this.max.y < this.min.y; } getCenter(e) { return this.isEmpty() ? e.set(0, 0) : e.addVectors(this.min, this.max).multiplyScalar(0.5); } getSize(e) { return this.isEmpty() ? e.set(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; } containsPoint(e) { return !(e.x < this.min.x || e.x > this.max.x || e.y < this.min.y || e.y > this.max.y); } 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; } 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) ); } 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); } clampPoint(e, t) { return t.copy(e).clamp(this.min, this.max); } distanceToPoint(e) { return yv.copy(e).clamp(this.min, this.max).sub(e).length(); } intersect(e) { return this.min.max(e.min), this.max.min(e.max), this; } union(e) { return this.min.min(e.min), this.max.max(e.max), 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); } } fs.prototype.isBox2 = !0; const bv = /* @__PURE__ */ new Z(), _c = /* @__PURE__ */ new Z(); class f1 { constructor(e = new Z(), t = new Z()) { this.start = e, this.end = t; } set(e, t) { return this.start.copy(e), this.end.copy(t), this; } copy(e) { return this.start.copy(e.start), this.end.copy(e.end), this; } getCenter(e) { return e.addVectors(this.start, this.end).multiplyScalar(0.5); } delta(e) { return e.subVectors(this.end, this.start); } distanceSq() { return this.start.distanceToSquared(this.end); } distance() { return this.start.distanceTo(this.end); } at(e, t) { return this.delta(t).multiplyScalar(e).add(this.start); } closestPointToPointParameter(e, t) { bv.subVectors(e, this.start), _c.subVectors(this.end, this.start); const r = _c.dot(_c); let n = _c.dot(bv) / r; return t && (n = mi(n, 0, 1)), n; } closestPointToPoint(e, t, r) { const n = this.closestPointToPointParameter(e, t); return this.delta(r).multiplyScalar(n).add(this.start); } applyMatrix4(e) { return this.start.applyMatrix4(e), this.end.applyMatrix4(e), this; } equals(e) { return e.start.equals(this.start) && e.end.equals(this.end); } clone() { return new this.constructor().copy(this); } } class m1 extends nt { constructor(e) { super(), this.material = e, this.render = function() { }, this.hasPositions = !1, this.hasNormals = !1, this.hasColors = !1, this.hasUvs = !1, this.positionArray = null, this.normalArray = null, this.colorArray = null, this.uvArray = null, this.count = 0; } } m1.prototype.isImmediateRenderObject = !0; const xv = /* @__PURE__ */ new Z(); class HB extends nt { constructor(e, t) { super(), this.light = e, this.light.updateMatrixWorld(), this.matrix = e.matrixWorld, this.matrixAutoUpdate = !1, this.color = t; const r = new Je(), n = [ 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 0, 0, 0, -1, 0, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, -1, 1 ]; for (let a = 0, s = 1, c = 32; a < c; a++, s++) { const l = a / c * Math.PI * 2, h = s / c * Math.PI * 2; n.push( Math.cos(l), Math.sin(l), 1, Math.cos(h), Math.sin(h), 1 ); } r.setAttribute("position", new je(n, 3)); const o = new ni({ fog: !1, toneMapped: !1 }); this.cone = new Pi(r, o), this.add(this.cone), this.update(); } dispose() { this.cone.geometry.dispose(), this.cone.material.dispose(); } update() { this.light.updateMatrixWorld(); const e = this.light.distance ? this.light.distance : 1e3, t = e * Math.tan(this.light.angle); this.cone.scale.set(t, t, e), xv.setFromMatrixPosition(this.light.target.matrixWorld), this.cone.lookAt(xv), this.color !== void 0 ? this.cone.material.color.set(this.color) : this.cone.material.color.copy(this.light.color); } } const Ln = /* @__PURE__ */ new Z(), Mc = /* @__PURE__ */ new $e(), zh = /* @__PURE__ */ new $e(); class g1 extends Pi { constructor(e) { const t = v1(e), r = new Je(), n = [], o = [], a = new Be(0, 0, 1), s = new Be(0, 1, 0); for (let l = 0; l < t.length; l++) { const h = t[l]; h.parent && h.parent.isBone && (n.push(0, 0, 0), n.push(0, 0, 0), o.push(a.r, a.g, a.b), o.push(s.r, s.g, s.b)); } r.setAttribute("position", new je(n, 3)), r.setAttribute("color", new je(o, 3)); const c = new ni({ vertexColors: !0, depthTest: !1, depthWrite: !1, toneMapped: !1, transparent: !0 }); super(r, c), this.type = "SkeletonHelper", this.isSkeletonHelper = !0, this.root = e, this.bones = t, this.matrix = e.matrixWorld, this.matrixAutoUpdate = !1; } updateMatrixWorld(e) { const t = this.bones, r = this.geometry, n = r.getAttribute("position"); zh.copy(this.root.matrixWorld).invert(); for (let o = 0, a = 0; o < t.length; o++) { const s = t[o]; s.parent && s.parent.isBone && (Mc.multiplyMatrices(zh, s.matrixWorld), Ln.setFromMatrixPosition(Mc), n.setXYZ(a, Ln.x, Ln.y, Ln.z), Mc.multiplyMatrices(zh, s.parent.matrixWorld), Ln.setFromMatrixPosition(Mc), n.setXYZ(a + 1, Ln.x, Ln.y, Ln.z), a += 2); } r.getAttribute("position").needsUpdate = !0, super.updateMatrixWorld(e); } } function v1(i) { const e = []; i && i.isBone && e.push(i); for (let t = 0; t < i.children.length; t++) e.push.apply(e, v1(i.children[t])); return e; } class jB extends Yt { constructor(e, t, r) { const n = new zo(t, 4, 2), o = new ki({ wireframe: !0, fog: !1, toneMapped: !1 }); super(n, o), this.light = e, this.light.updateMatrixWorld(), this.color = r, this.type = "PointLightHelper", this.matrix = this.light.matrixWorld, this.matrixAutoUpdate = !1, this.update(); } dispose() { this.geometry.dispose(), this.material.dispose(); } update() { this.color !== void 0 ? this.material.color.set(this.color) : this.material.color.copy(this.light.color); } } const WB = /* @__PURE__ */ new Z(), wv = /* @__PURE__ */ new Be(), _v = /* @__PURE__ */ new Be(); class $B extends nt { constructor(e, t, r) { super(), this.light = e, this.light.updateMatrixWorld(), this.matrix = e.matrixWorld, this.matrixAutoUpdate = !1, this.color = r; const n = new Bo(t); n.rotateY(Math.PI * 0.5), this.material = new ki({ wireframe: !0, fog: !1, toneMapped: !1 }), this.color === void 0 && (this.material.vertexColors = !0); const o = n.getAttribute("position"), a = new Float32Array(o.count * 3); n.setAttribute("color", new tt(a, 3)), this.add(new Yt(n, this.material)), this.update(); } dispose() { this.children[0].geometry.dispose(), this.children[0].material.dispose(); } update() { const e = this.children[0]; if (this.color !== void 0) this.material.color.set(this.color); else { const t = e.geometry.getAttribute("color"); wv.copy(this.light.color), _v.copy(this.light.groundColor); for (let r = 0, n = t.count; r < n; r++) { const o = r < n / 2 ? wv : _v; t.setXYZ(r, o.r, o.g, o.b); } t.needsUpdate = !0; } e.lookAt(WB.setFromMatrixPosition(this.light.matrixWorld).negate()); } } class y1 extends Pi { constructor(e = 10, t = 10, r = 4473924, n = 8947848) { r = new Be(r), n = new Be(n); const o = t / 2, a = e / t, s = e / 2, c = [], l = []; for (let p = 0, g = 0, m = -s; p <= t; p++, m += a) { c.push(-s, 0, m, s, 0, m), c.push(m, 0, -s, m, 0, s); const d = p === o ? r : n; d.toArray(l, g), g += 3, d.toArray(l, g), g += 3, d.toArray(l, g), g += 3, d.toArray(l, g), g += 3; } const h = new Je(); h.setAttribute("position", new je(c, 3)), h.setAttribute("color", new je(l, 3)); const u = new ni({ vertexColors: !0, toneMapped: !1 }); super(h, u), this.type = "GridHelper"; } } class qB extends Pi { constructor(e = 10, t = 16, r = 8, n = 64, o = 4473924, a = 8947848) { o = new Be(o), a = new Be(a); const s = [], c = []; for (let u = 0; u <= t; u++) { const p = u / t * (Math.PI * 2), g = Math.sin(p) * e, m = Math.cos(p) * e; s.push(0, 0, 0), s.push(g, 0, m); const d = u & 1 ? o : a; c.push(d.r, d.g, d.b), c.push(d.r, d.g, d.b); } for (let u = 0; u <= r; u++) { const p = u & 1 ? o : a, g = e - e / r * u; for (let m = 0; m < n; m++) { let d = m / n * (Math.PI * 2), y = Math.sin(d) * g, f = Math.cos(d) * g; s.push(y, 0, f), c.push(p.r, p.g, p.b), d = (m + 1) / n * (Math.PI * 2), y = Math.sin(d) * g, f = Math.cos(d) * g, s.push(y, 0, f), c.push(p.r, p.g, p.b); } } const l = new Je(); l.setAttribute("position", new je(s, 3)), l.setAttribute("color", new je(c, 3)); const h = new ni({ vertexColors: !0, toneMapped: !1 }); super(l, h), this.type = "PolarGridHelper"; } } const Mv = /* @__PURE__ */ new Z(), Sc = /* @__PURE__ */ new Z(), Sv = /* @__PURE__ */ new Z(); class XB extends nt { constructor(e, t, r) { super(), this.light = e, this.light.updateMatrixWorld(), this.matrix = e.matrixWorld, this.matrixAutoUpdate = !1, this.color = r, t === void 0 && (t = 1); let n = new Je(); n.setAttribute("position", new je([ -t, t, 0, t, t, 0, t, -t, 0, -t, -t, 0, -t, t, 0 ], 3)); const o = new ni({ fog: !1, toneMapped: !1 }); this.lightPlane = new kr(n, o), this.add(this.lightPlane), n = new Je(), n.setAttribute("position", new je([0, 0, 0, 0, 0, 1], 3)), this.targetLine = new kr(n, o), this.add(this.targetLine), this.update(); } dispose() { this.lightPlane.geometry.dispose(), this.lightPlane.material.dispose(), this.targetLine.geometry.dispose(), this.targetLine.material.dispose(); } update() { Mv.setFromMatrixPosition(this.light.matrixWorld), Sc.setFromMatrixPosition(this.light.target.matrixWorld), Sv.subVectors(Sc, Mv), this.lightPlane.lookAt(Sc), this.color !== void 0 ? (this.lightPlane.material.color.set(this.color), this.targetLine.material.color.set(this.color)) : (this.lightPlane.material.color.copy(this.light.color), this.targetLine.material.color.copy(this.light.color)), this.targetLine.lookAt(Sc), this.targetLine.scale.z = Sv.length(); } } const Tc = /* @__PURE__ */ new Z(), zt = /* @__PURE__ */ new wl(); class ZB extends Pi { constructor(e) { const t = new Je(), r = new ni({ color: 16777215, vertexColors: !0, toneMapped: !1 }), n = [], o = [], a = {}, s = new Be(16755200), c = new Be(16711680), l = new Be(43775), h = new Be(16777215), u = new Be(3355443); p("n1", "n2", s), p("n2", "n4", s), p("n4", "n3", s), p("n3", "n1", s), p("f1", "f2", s), p("f2", "f4", s), p("f4", "f3", s), p("f3", "f1", s), p("n1", "f1", s), p("n2", "f2", s), p("n3", "f3", s), p("n4", "f4", s), p("p", "n1", c), p("p", "n2", c), p("p", "n3", c), p("p", "n4", c), p("u1", "u2", l), p("u2", "u3", l), p("u3", "u1", l), p("c", "t", h), p("p", "c", u), p("cn1", "cn2", u), p("cn3", "cn4", u), p("cf1", "cf2", u), p("cf3", "cf4", u); function p(m, d, y) { g(m, y), g(d, y); } function g(m, d) { n.push(0, 0, 0), o.push(d.r, d.g, d.b), a[m] === void 0 && (a[m] = []), a[m].push(n.length / 3 - 1); } t.setAttribute("position", new je(n, 3)), t.setAttribute("color", new je(o, 3)), super(t, r), this.type = "CameraHelper", this.camera = e, this.camera.updateProjectionMatrix && this.camera.updateProjectionMatrix(), this.matrix = e.matrixWorld, this.matrixAutoUpdate = !1, this.pointMap = a, this.update(); } update() { const e = this.geometry, t = this.pointMap, r = 1, n = 1; zt.projectionMatrixInverse.copy(this.camera.projectionMatrixInverse), jt("c", t, e, zt, 0, 0, -1), jt("t", t, e, zt, 0, 0, 1), jt("n1", t, e, zt, -r, -n, -1), jt("n2", t, e, zt, r, -n, -1), jt("n3", t, e, zt, -r, n, -1), jt("n4", t, e, zt, r, n, -1), jt("f1", t, e, zt, -r, -n, 1), jt("f2", t, e, zt, r, -n, 1), jt("f3", t, e, zt, -r, n, 1), jt("f4", t, e, zt, r, n, 1), jt("u1", t, e, zt, r * 0.7, n * 1.1, -1), jt("u2", t, e, zt, -r * 0.7, n * 1.1, -1), jt("u3", t, e, zt, 0, n * 2, -1), jt("cf1", t, e, zt, -r, 0, 1), jt("cf2", t, e, zt, r, 0, 1), jt("cf3", t, e, zt, 0, -n, 1), jt("cf4", t, e, zt, 0, n, 1), jt("cn1", t, e, zt, -r, 0, -1), jt("cn2", t, e, zt, r, 0, -1), jt("cn3", t, e, zt, 0, -n, -1), jt("cn4", t, e, zt, 0, n, -1), e.getAttribute("position").needsUpdate = !0; } dispose() { this.geometry.dispose(), this.material.dispose(); } } function jt(i, e, t, r, n, o, a) { Tc.set(n, o, a).unproject(r); const s = e[i]; if (s !== void 0) { const c = t.getAttribute("position"); for (let l = 0, h = s.length; l < h; l++) c.setXYZ(s[l], Tc.x, Tc.y, Tc.z); } } const Ec = /* @__PURE__ */ new Vi(); class b1 extends Pi { constructor(e, t = 16776960) { const r = new Uint16Array([0, 1, 1, 2, 2, 3, 3, 0, 4, 5, 5, 6, 6, 7, 7, 4, 0, 4, 1, 5, 2, 6, 3, 7]), n = new Float32Array(8 * 3), o = new Je(); o.setIndex(new tt(r, 1)), o.setAttribute("position", new tt(n, 3)), super(o, new ni({ color: t, toneMapped: !1 })), this.object = e, this.type = "BoxHelper", this.matrixAutoUpdate = !1, this.update(); } update(e) { if (e !== void 0 && console.warn("THREE.BoxHelper: .update() has no longer arguments."), this.object !== void 0 && Ec.setFromObject(this.object), Ec.isEmpty()) return; const t = Ec.min, r = Ec.max, n = this.geometry.attributes.position, o = n.array; o[0] = r.x, o[1] = r.y, o[2] = r.z, o[3] = t.x, o[4] = r.y, o[5] = r.z, o[6] = t.x, o[7] = t.y, o[8] = r.z, o[9] = r.x, o[10] = t.y, o[11] = r.z, o[12] = r.x, o[13] = r.y, o[14] = t.z, o[15] = t.x, o[16] = r.y, o[17] = t.z, o[18] = t.x, o[19] = t.y, o[20] = t.z, o[21] = r.x, o[22] = t.y, o[23] = t.z, n.needsUpdate = !0, this.geometry.computeBoundingSphere(); } setFromObject(e) { return this.object = e, this.update(), this; } copy(e) { return Pi.prototype.copy.call(this, e), this.object = e.object, this; } } class YB extends Pi { constructor(e, t = 16776960) { const r = new Uint16Array([0, 1, 1, 2, 2, 3, 3, 0, 4, 5, 5, 6, 6, 7, 7, 4, 0, 4, 1, 5, 2, 6, 3, 7]), n = [1, 1, 1, -1, 1, 1, -1, -1, 1, 1, -1, 1, 1, 1, -1, -1, 1, -1, -1, -1, -1, 1, -1, -1], o = new Je(); o.setIndex(new tt(r, 1)), o.setAttribute("position", new je(n, 3)), super(o, new ni({ color: t, toneMapped: !1 })), this.box = e, this.type = "Box3Helper", this.geometry.computeBoundingSphere(); } updateMatrixWorld(e) { const t = this.box; t.isEmpty() || (t.getCenter(this.position), t.getSize(this.scale), this.scale.multiplyScalar(0.5), super.updateMatrixWorld(e)); } } class JB extends kr { constructor(e, t = 1, r = 16776960) { const n = r, o = [1, -1, 1, -1, 1, 1, -1, -1, 1, 1, 1, 1, -1, 1, 1, -1, -1, 1, 1, -1, 1, 1, 1, 1, 0, 0, 1, 0, 0, 0], a = new Je(); a.setAttribute("position", new je(o, 3)), a.computeBoundingSphere(), super(a, new ni({ color: n, toneMapped: !1 })), this.type = "PlaneHelper", this.plane = e, this.size = t; const s = [1, 1, 1, -1, 1, 1, -1, -1, 1, 1, 1, 1, -1, -1, 1, 1, -1, 1], c = new Je(); c.setAttribute("position", new je(s, 3)), c.computeBoundingSphere(), this.add(new Yt(c, new ki({ color: n, opacity: 0.2, transparent: !0, depthWrite: !1, toneMapped: !1 }))); } updateMatrixWorld(e) { let t = -this.plane.constant; Math.abs(t) < 1e-8 && (t = 1e-8), this.scale.set(0.5 * this.size, 0.5 * this.size, t), this.children[0].material.side = t < 0 ? $t : qn, this.lookAt(this.plane.normal), super.updateMatrixWorld(e); } } const Tv = /* @__PURE__ */ new Z(); let Ac, Fh; class KB extends nt { // dir is assumed to be normalized constructor(e = new Z(0, 0, 1), t = new Z(0, 0, 0), r = 1, n = 16776960, o = r * 0.2, a = o * 0.2) { super(), this.type = "ArrowHelper", Ac === void 0 && (Ac = new Je(), Ac.setAttribute("position", new je([0, 0, 0, 0, 1, 0], 3)), Fh = new Yn(0, 0.5, 1, 5, 1), Fh.translate(0, -0.5, 0)), this.position.copy(t), this.line = new kr(Ac, new ni({ color: n, toneMapped: !1 })), this.line.matrixAutoUpdate = !1, this.add(this.line), this.cone = new Yt(Fh, new ki({ color: n, toneMapped: !1 })), this.cone.matrixAutoUpdate = !1, this.add(this.cone), this.setDirection(e), this.setLength(r, o, a); } setDirection(e) { if (e.y > 0.99999) this.quaternion.set(0, 0, 0, 1); else if (e.y < -0.99999) this.quaternion.set(1, 0, 0, 0); else { Tv.set(e.z, 0, -e.x).normalize(); const t = Math.acos(e.y); this.quaternion.setFromAxisAngle(Tv, t); } } setLength(e, t = e * 0.2, r = t * 0.2) { this.line.scale.set(1, Math.max(1e-4, e - t), 1), this.line.updateMatrix(), this.cone.scale.set(r, t, r), this.cone.position.y = e, this.cone.updateMatrix(); } setColor(e) { this.line.material.color.set(e), this.cone.material.color.set(e); } copy(e) { return super.copy(e, !1), this.line.copy(e.line), this.cone.copy(e.cone), this; } } class x1 extends Pi { constructor(e = 1) { const t = [ 0, 0, 0, e, 0, 0, 0, 0, 0, 0, e, 0, 0, 0, 0, 0, 0, e ], r = [ 1, 0, 0, 1, 0.6, 0, 0, 1, 0, 0.6, 1, 0, 0, 0, 1, 0, 0.6, 1 ], n = new Je(); n.setAttribute("position", new je(t, 3)), n.setAttribute("color", new je(r, 3)); const o = new ni({ vertexColors: !0, toneMapped: !1 }); super(n, o), this.type = "AxesHelper"; } setColors(e, t, r) { const n = new Be(), o = this.geometry.attributes.color.array; return n.set(e), n.toArray(o, 0), n.toArray(o, 3), n.set(t), n.toArray(o, 6), n.toArray(o, 9), n.set(r), n.toArray(o, 12), n.toArray(o, 15), this.geometry.attributes.color.needsUpdate = !0, this; } dispose() { this.geometry.dispose(), this.material.dispose(); } } const w1 = new Float32Array(1), QB = new Int32Array(w1.buffer); class ek { // Converts float32 to float16 (stored as uint16 value). static toHalfFloat(e) { w1[0] = e; const t = QB[0]; let r = t >> 16 & 32768, n = t >> 12 & 2047; const o = t >> 23 & 255; return o < 103 ? r : o > 142 ? (r |= 31744, r |= (o == 255 ? 0 : 1) && t & 8388607, r) : o < 113 ? (n |= 2048, r |= (n >> 114 - o) + (n >> 113 - o & 1), r) : (r |= o - 112 << 10 | n >> 1, r += n & 1, r); } } const Ea = 4, Gn = 8, Er = Math.pow(2, Gn), _1 = [0.125, 0.215, 0.35, 0.446, 0.526, 0.582], M1 = Gn - Ea + 1 + _1.length, ma = 20, Rr = { [Ri]: 0, [Do]: 1, [Cu]: 2, [jp]: 3, [Wp]: 4, [$p]: 5, [Au]: 6 }, go = new ki({ side: $t, depthWrite: !1, depthTest: !1 }), tk = new Yt(new un(), go), Vh = /* @__PURE__ */ new ps(), { _lodPlanes: Ls, _sizeLods: Ev, _sigmas: Cc } = /* @__PURE__ */ nk(), Av = /* @__PURE__ */ new Be(); let Uh = null; const vo = (1 + Math.sqrt(5)) / 2, ga = 1 / vo, Cv = [ /* @__PURE__ */ new Z(1, 1, 1), /* @__PURE__ */ new Z(-1, 1, 1), /* @__PURE__ */ new Z(1, 1, -1), /* @__PURE__ */ new Z(-1, 1, -1), /* @__PURE__ */ new Z(0, vo, ga), /* @__PURE__ */ new Z(0, vo, -ga), /* @__PURE__ */ new Z(ga, 0, vo), /* @__PURE__ */ new Z(-ga, 0, vo), /* @__PURE__ */ new Z(vo, ga, 0), /* @__PURE__ */ new Z(-vo, ga, 0) ]; function Lv(i) { const e = Math.max(i.r, i.g, i.b), t = Math.min(Math.max(Math.ceil(Math.log2(e)), -128), 127); return i.multiplyScalar(Math.pow(2, -t)), (t + 128) / 255; } class ik { constructor(e) { this._renderer = e, this._pingPongRenderTarget = null, this._blurMaterial = ok(ma), this._equirectShader = null, this._cubemapShader = null, this._compileMaterial(this._blurMaterial); } /** * Generates a PMREM from a supplied Scene, which can be faster than using an * image if networking bandwidth is low. Optional sigma specifies a blur radius * in radians to be applied to the scene before PMREM generation. Optional near * and far planes ensure the scene is rendered in its entirety (the cubeCamera * is placed at the origin). */ fromScene(e, t = 0, r = 0.1, n = 100) { Uh = this._renderer.getRenderTarget(); const o = this._allocateTargets(); return this._sceneToCubeUV(e, r, n, o), t > 0 && this._blur(o, 0, 0, t), this._applyPMREM(o), this._cleanup(o), o; } /** * Generates a PMREM from an equirectangular texture, which can be either LDR * (RGBFormat) or HDR (RGBEFormat). The ideal input image size is 1k (1024 x 512), * as this matches best with the 256 x 256 cubemap output. */ fromEquirectangular(e) { return this._fromTexture(e); } /** * Generates a PMREM from an cubemap texture, which can be either LDR * (RGBFormat) or HDR (RGBEFormat). The ideal input cube size is 256 x 256, * as this matches best with the 256 x 256 cubemap output. */ fromCubemap(e) { return this._fromTexture(e); } /** * Pre-compiles the cubemap shader. You can get faster start-up by invoking this method during * your texture's network fetch for increased concurrency. */ compileCubemapShader() { this._cubemapShader === null && (this._cubemapShader = Pv(), this._compileMaterial(this._cubemapShader)); } /** * Pre-compiles the equirectangular shader. You can get faster start-up by invoking this method during * your texture's network fetch for increased concurrency. */ compileEquirectangularShader() { this._equirectShader === null && (this._equirectShader = Ov(), this._compileMaterial(this._equirectShader)); } /** * Disposes of the PMREMGenerator's internal memory. Note that PMREMGenerator is a static class, * so you should not need more than one PMREMGenerator object. If you do, calling dispose() on * one of them will cause any others to also become unusable. */ dispose() { this._blurMaterial.dispose(), this._cubemapShader !== null && this._cubemapShader.dispose(), this._equirectShader !== null && this._equirectShader.dispose(); for (let e = 0; e < Ls.length; e++) Ls[e].dispose(); } // private interface _cleanup(e) { this._pingPongRenderTarget.dispose(), this._renderer.setRenderTarget(Uh), e.scissorTest = !1, Lc(e, 0, 0, e.width, e.height); } _fromTexture(e) { Uh = this._renderer.getRenderTarget(); const t = this._allocateTargets(e); return this._textureToCubeUV(e, t), this._applyPMREM(t), this._cleanup(t), t; } _allocateTargets(e) { const t = { magFilter: qt, minFilter: qt, generateMipmaps: !1, type: Po, format: bb, encoding: rk(e) ? e.encoding : Cu, depthBuffer: !1 }, r = Rv(t); return r.depthBuffer = !e, this._pingPongRenderTarget = Rv(t), r; } _compileMaterial(e) { const t = new Yt(Ls[0], e); this._renderer.compile(t, Vh); } _sceneToCubeUV(e, t, r, n) { const o = new ti(90, 1, t, r), a = [1, -1, 1, 1, 1, 1], s = [1, 1, 1, -1, -1, -1], c = this._renderer, l = c.autoClear, h = c.outputEncoding, u = c.toneMapping; c.getClearColor(Av), c.toneMapping = Fn, c.outputEncoding = Ri, c.autoClear = !1; let p = !1; const g = e.background; if (g) { if (g.isColor) { go.color.copy(g).convertSRGBToLinear(), e.background = null; const m = Lv(go.color); go.opacity = m, p = !0; } } else { go.color.copy(Av).convertSRGBToLinear(); const m = Lv(go.color); go.opacity = m, p = !0; } for (let m = 0; m < 6; m++) { const d = m % 3; d == 0 ? (o.up.set(0, a[m], 0), o.lookAt(s[m], 0, 0)) : d == 1 ? (o.up.set(0, 0, a[m]), o.lookAt(0, s[m], 0)) : (o.up.set(0, a[m], 0), o.lookAt(0, 0, s[m])), Lc( n, d * Er, m > 2 ? Er : 0, Er, Er ), c.setRenderTarget(n), p && c.render(tk, o), c.render(e, o); } c.toneMapping = u, c.outputEncoding = h, c.autoClear = l; } _textureToCubeUV(e, t) { const r = this._renderer; e.isCubeTexture ? this._cubemapShader == null && (this._cubemapShader = Pv()) : this._equirectShader == null && (this._equirectShader = Ov()); const n = e.isCubeTexture ? this._cubemapShader : this._equirectShader, o = new Yt(Ls[0], n), a = n.uniforms; a.envMap.value = e, e.isCubeTexture || a.texelSize.value.set(1 / e.image.width, 1 / e.image.height), a.inputEncoding.value = Rr[e.encoding], a.outputEncoding.value = Rr[t.texture.encoding], Lc(t, 0, 0, 3 * Er, 2 * Er), r.setRenderTarget(t), r.render(o, Vh); } _applyPMREM(e) { const t = this._renderer, r = t.autoClear; t.autoClear = !1; for (let n = 1; n < M1; n++) { const o = Math.sqrt(Cc[n] * Cc[n] - Cc[n - 1] * Cc[n - 1]), a = Cv[(n - 1) % Cv.length]; this._blur(e, n - 1, n, o, a); } t.autoClear = r; } /** * This is a two-pass Gaussian blur for a cubemap. Normally this is done * vertically and horizontally, but this breaks down on a cube. Here we apply * the blur latitudinally (around the poles), and then longitudinally (towards * the poles) to approximate the orthogonally-separable blur. It is least * accurate at the poles, but still does a decent job. */ _blur(e, t, r, n, o) { const a = this._pingPongRenderTarget; this._halfBlur( e, a, t, r, n, "latitudinal", o ), this._halfBlur( a, e, r, r, n, "longitudinal", o ); } _halfBlur(e, t, r, n, o, a, s) { const c = this._renderer, l = this._blurMaterial; a !== "latitudinal" && a !== "longitudinal" && console.error( "blur direction must be either latitudinal or longitudinal!" ); const h = 3, u = new Yt(Ls[n], l), p = l.uniforms, g = Ev[r] - 1, m = isFinite(o) ? Math.PI / (2 * g) : 2 * Math.PI / (2 * ma - 1), d = o / m, y = isFinite(o) ? 1 + Math.floor(h * d) : ma; y > ma && console.warn(`sigmaRadians, ${o}, is too large and will clip, as it requested ${y} samples when the maximum is set to ${ma}`); const f = []; let v = 0; for (let x = 0; x < ma; ++x) { const w = x / d, A = Math.exp(-w * w / 2); f.push(A), x == 0 ? v += A : x < y && (v += 2 * A); } for (let x = 0; x < f.length; x++) f[x] = f[x] / v; p.envMap.value = e.texture, p.samples.value = y, p.weights.value = f, p.latitudinal.value = a === "latitudinal", s && (p.poleAxis.value = s), p.dTheta.value = m, p.mipInt.value = Gn - r, p.inputEncoding.value = Rr[e.texture.encoding], p.outputEncoding.value = Rr[e.texture.encoding]; const M = Ev[n], S = 3 * Math.max(0, Er - 2 * M), T = (n === 0 ? 0 : 2 * Er) + 2 * M * (n > Gn - Ea ? n - Gn + Ea : 0); Lc(t, S, T, 3 * M, 2 * M), c.setRenderTarget(t), c.render(u, Vh); } } function rk(i) { return i === void 0 || i.type !== Po ? !1 : i.encoding === Ri || i.encoding === Do || i.encoding === Au; } function nk() { const i = [], e = [], t = []; let r = Gn; for (let n = 0; n < M1; n++) { const o = Math.pow(2, r); e.push(o); let a = 1 / o; n > Gn - Ea ? a = _1[n - Gn + Ea - 1] : n == 0 && (a = 0), t.push(a); const s = 1 / (o - 1), c = -s / 2, l = 1 + s / 2, h = [c, c, l, c, l, l, c, c, l, l, c, l], u = 6, p = 6, g = 3, m = 2, d = 1, y = new Float32Array(g * p * u), f = new Float32Array(m * p * u), v = new Float32Array(d * p * u); for (let S = 0; S < u; S++) { const T = S % 3 * 2 / 3 - 1, x = S > 2 ? 0 : -1, w = [ T, x, 0, T + 2 / 3, x, 0, T + 2 / 3, x + 1, 0, T, x, 0, T + 2 / 3, x + 1, 0, T, x + 1, 0 ]; y.set(w, g * p * S), f.set(h, m * p * S); const A = [S, S, S, S, S, S]; v.set(A, d * p * S); } const M = new Je(); M.setAttribute("position", new tt(y, g)), M.setAttribute("uv", new tt(f, m)), M.setAttribute("faceIndex", new tt(v, d)), i.push(M), r > Ea && r--; } return { _lodPlanes: i, _sizeLods: e, _sigmas: t }; } function Rv(i) { const e = new vr(3 * Er, 3 * Er, i); return e.texture.mapping = ls, e.texture.name = "PMREM.cubeUv", e.scissorTest = !0, e; } function Lc(i, e, t, r, n) { i.viewport.set(e, t, r, n), i.scissor.set(e, t, r, n); } function ok(i) { const e = new Float32Array(i), t = new Z(0, 1, 0); return new ds({ name: "SphericalGaussianBlur", defines: { n: i }, uniforms: { envMap: { value: null }, samples: { value: 1 }, weights: { value: e }, latitudinal: { value: !1 }, dTheta: { value: 0 }, mipInt: { value: 0 }, poleAxis: { value: t }, inputEncoding: { value: Rr[Ri] }, outputEncoding: { value: Rr[Ri] } }, vertexShader: Df(), fragmentShader: ( /* glsl */ ` precision mediump float; precision mediump int; varying vec3 vOutputDirection; uniform sampler2D envMap; uniform int samples; uniform float weights[ n ]; uniform bool latitudinal; uniform float dTheta; uniform float mipInt; uniform vec3 poleAxis; ${Nf()} #define ENVMAP_TYPE_CUBE_UV #include vec3 getSample( float theta, vec3 axis ) { float cosTheta = cos( theta ); // Rodrigues' axis-angle rotation vec3 sampleDirection = vOutputDirection * cosTheta + cross( axis, vOutputDirection ) * sin( theta ) + axis * dot( axis, vOutputDirection ) * ( 1.0 - cosTheta ); return bilinearCubeUV( envMap, sampleDirection, mipInt ); } void main() { vec3 axis = latitudinal ? poleAxis : cross( poleAxis, vOutputDirection ); if ( all( equal( axis, vec3( 0.0 ) ) ) ) { axis = vec3( vOutputDirection.z, 0.0, - vOutputDirection.x ); } axis = normalize( axis ); gl_FragColor = vec4( 0.0, 0.0, 0.0, 1.0 ); gl_FragColor.rgb += weights[ 0 ] * getSample( 0.0, axis ); for ( int i = 1; i < n; i++ ) { if ( i >= samples ) { break; } float theta = dTheta * float( i ); gl_FragColor.rgb += weights[ i ] * getSample( -1.0 * theta, axis ); gl_FragColor.rgb += weights[ i ] * getSample( theta, axis ); } gl_FragColor = linearToOutputTexel( gl_FragColor ); } ` ), blending: on, depthTest: !1, depthWrite: !1 }); } function Ov() { const i = new Oe(1, 1); return new ds({ name: "EquirectangularToCubeUV", uniforms: { envMap: { value: null }, texelSize: { value: i }, inputEncoding: { value: Rr[Ri] }, outputEncoding: { value: Rr[Ri] } }, vertexShader: Df(), fragmentShader: ( /* glsl */ ` precision mediump float; precision mediump int; varying vec3 vOutputDirection; uniform sampler2D envMap; uniform vec2 texelSize; ${Nf()} #include void main() { gl_FragColor = vec4( 0.0, 0.0, 0.0, 1.0 ); vec3 outputDirection = normalize( vOutputDirection ); vec2 uv = equirectUv( outputDirection ); vec2 f = fract( uv / texelSize - 0.5 ); uv -= f * texelSize; vec3 tl = envMapTexelToLinear( texture2D ( envMap, uv ) ).rgb; uv.x += texelSize.x; vec3 tr = envMapTexelToLinear( texture2D ( envMap, uv ) ).rgb; uv.y += texelSize.y; vec3 br = envMapTexelToLinear( texture2D ( envMap, uv ) ).rgb; uv.x -= texelSize.x; vec3 bl = envMapTexelToLinear( texture2D ( envMap, uv ) ).rgb; vec3 tm = mix( tl, tr, f.x ); vec3 bm = mix( bl, br, f.x ); gl_FragColor.rgb = mix( tm, bm, f.y ); gl_FragColor = linearToOutputTexel( gl_FragColor ); } ` ), blending: on, depthTest: !1, depthWrite: !1 }); } function Pv() { return new ds({ name: "CubemapToCubeUV", uniforms: { envMap: { value: null }, inputEncoding: { value: Rr[Ri] }, outputEncoding: { value: Rr[Ri] } }, vertexShader: Df(), fragmentShader: ( /* glsl */ ` precision mediump float; precision mediump int; varying vec3 vOutputDirection; uniform samplerCube envMap; ${Nf()} void main() { gl_FragColor = vec4( 0.0, 0.0, 0.0, 1.0 ); gl_FragColor.rgb = envMapTexelToLinear( textureCube( envMap, vec3( - vOutputDirection.x, vOutputDirection.yz ) ) ).rgb; gl_FragColor = linearToOutputTexel( gl_FragColor ); } ` ), blending: on, depthTest: !1, depthWrite: !1 }); } function Df() { return ( /* glsl */ ` precision mediump float; precision mediump int; attribute vec3 position; attribute vec2 uv; attribute float faceIndex; varying vec3 vOutputDirection; // RH coordinate system; PMREM face-indexing convention vec3 getDirection( vec2 uv, float face ) { uv = 2.0 * uv - 1.0; vec3 direction = vec3( uv, 1.0 ); if ( face == 0.0 ) { direction = direction.zyx; // ( 1, v, u ) pos x } else if ( face == 1.0 ) { direction = direction.xzy; direction.xz *= -1.0; // ( -u, 1, -v ) pos y } else if ( face == 2.0 ) { direction.x *= -1.0; // ( -u, v, 1 ) pos z } else if ( face == 3.0 ) { direction = direction.zyx; direction.xz *= -1.0; // ( -1, v, -u ) neg x } else if ( face == 4.0 ) { direction = direction.xzy; direction.xy *= -1.0; // ( -u, -1, v ) neg y } else if ( face == 5.0 ) { direction.z *= -1.0; // ( u, v, -1 ) neg z } return direction; } void main() { vOutputDirection = getDirection( uv, faceIndex ); gl_Position = vec4( position, 1.0 ); } ` ); } function Nf() { return ( /* glsl */ ` uniform int inputEncoding; uniform int outputEncoding; #include vec4 inputTexelToLinear( vec4 value ) { if ( inputEncoding == 0 ) { return value; } else if ( inputEncoding == 1 ) { return sRGBToLinear( value ); } else if ( inputEncoding == 2 ) { return RGBEToLinear( value ); } else if ( inputEncoding == 3 ) { return RGBMToLinear( value, 7.0 ); } else if ( inputEncoding == 4 ) { return RGBMToLinear( value, 16.0 ); } else if ( inputEncoding == 5 ) { return RGBDToLinear( value, 256.0 ); } else { return GammaToLinear( value, 2.2 ); } } vec4 linearToOutputTexel( vec4 value ) { if ( outputEncoding == 0 ) { return value; } else if ( outputEncoding == 1 ) { return LinearTosRGB( value ); } else if ( outputEncoding == 2 ) { return LinearToRGBE( value ); } else if ( outputEncoding == 3 ) { return LinearToRGBM( value, 7.0 ); } else if ( outputEncoding == 4 ) { return LinearToRGBM( value, 16.0 ); } else if ( outputEncoding == 5 ) { return LinearToRGBD( value, 256.0 ); } else { return LinearToGamma( value, 2.2 ); } } vec4 envMapTexelToLinear( vec4 color ) { return inputTexelToLinear( color ); } ` ); } const ak = 0, sk = 1, lk = 0, ck = 1, uk = 2; function hk(i) { return console.warn("THREE.MeshFaceMaterial has been removed. Use an Array instead."), i; } function dk(i = []) { return console.warn("THREE.MultiMaterial has been removed. Use an Array instead."), i.isMultiMaterial = !0, i.materials = i, i.clone = function() { return i.slice(); }, i; } function pk(i, e) { return console.warn("THREE.PointCloud has been renamed to THREE.Points."), new hs(i, e); } function fk(i) { return console.warn("THREE.Particle has been renamed to THREE.Sprite."), new El(i); } function mk(i, e) { return console.warn("THREE.ParticleSystem has been renamed to THREE.Points."), new hs(i, e); } function gk(i) { return console.warn("THREE.PointCloudMaterial has been renamed to THREE.PointsMaterial."), new no(i); } function vk(i) { return console.warn("THREE.ParticleBasicMaterial has been renamed to THREE.PointsMaterial."), new no(i); } function yk(i) { return console.warn("THREE.ParticleSystemMaterial has been renamed to THREE.PointsMaterial."), new no(i); } function bk(i, e, t) { return console.warn("THREE.Vertex has been removed. Use THREE.Vector3 instead."), new Z(i, e, t); } function xk(i, e) { return console.warn("THREE.DynamicBufferAttribute has been removed. Use new THREE.BufferAttribute().setUsage( THREE.DynamicDrawUsage ) instead."), new tt(i, e).setUsage(Fa); } function wk(i, e) { return console.warn("THREE.Int8Attribute has been removed. Use new THREE.Int8BufferAttribute() instead."), new gx(i, e); } function _k(i, e) { return console.warn("THREE.Uint8Attribute has been removed. Use new THREE.Uint8BufferAttribute() instead."), new vx(i, e); } function Mk(i, e) { return console.warn("THREE.Uint8ClampedAttribute has been removed. Use new THREE.Uint8ClampedBufferAttribute() instead."), new yx(i, e); } function Sk(i, e) { return console.warn("THREE.Int16Attribute has been removed. Use new THREE.Int16BufferAttribute() instead."), new bx(i, e); } function Tk(i, e) { return console.warn("THREE.Uint16Attribute has been removed. Use new THREE.Uint16BufferAttribute() instead."), new Lu(i, e); } function Ek(i, e) { return console.warn("THREE.Int32Attribute has been removed. Use new THREE.Int32BufferAttribute() instead."), new xx(i, e); } function Ak(i, e) { return console.warn("THREE.Uint32Attribute has been removed. Use new THREE.Uint32BufferAttribute() instead."), new Ru(i, e); } function Ck(i, e) { return console.warn("THREE.Float32Attribute has been removed. Use new THREE.Float32BufferAttribute() instead."), new je(i, e); } function Lk(i, e) { return console.warn("THREE.Float64Attribute has been removed. Use new THREE.Float64BufferAttribute() instead."), new _x(i, e); } Zi.create = function(i, e) { return console.log("THREE.Curve.create() has been deprecated"), i.prototype = Object.create(Zi.prototype), i.prototype.constructor = i, i.prototype.getPoint = e, i; }; sl.prototype.fromPoints = function(i) { return console.warn("THREE.Path: .fromPoints() has been renamed to .setFromPoints()."), this.setFromPoints(i); }; function Rk(i) { return console.warn("THREE.AxisHelper has been renamed to THREE.AxesHelper."), new x1(i); } function Ok(i, e) { return console.warn("THREE.BoundingBoxHelper has been deprecated. Creating a THREE.BoxHelper instead."), new b1(i, e); } function Pk(i, e) { return console.warn("THREE.EdgesHelper has been removed. Use THREE.EdgesGeometry instead."), new Pi(new tf(i.geometry), new ni({ color: e !== void 0 ? e : 16777215 })); } y1.prototype.setColors = function() { console.error("THREE.GridHelper: setColors() has been deprecated, pass them in the constructor instead."); }; g1.prototype.update = function() { console.error("THREE.SkeletonHelper: update() no longer needs to be called."); }; function Ik(i, e) { return console.warn("THREE.WireframeHelper has been removed. Use THREE.WireframeGeometry instead."), new Pi(new cf(i.geometry), new ni({ color: e !== void 0 ? e : 16777215 })); } yi.prototype.extractUrlBase = function(i) { return console.warn("THREE.Loader: .extractUrlBase() has been deprecated. Use THREE.LoaderUtils.extractUrlBase() instead."), sn.extractUrlBase(i); }; yi.Handlers = { add: function() { console.error("THREE.Loader: Handlers.add() has been removed. Use LoadingManager.addHandler() instead."); }, get: function() { console.error("THREE.Loader: Handlers.get() has been removed. Use LoadingManager.getHandler() instead."); } }; function Dk(i) { return console.warn("THREE.XHRLoader has been renamed to THREE.FileLoader."), new Yi(i); } function Nk(i) { return console.warn("THREE.BinaryTextureLoader has been renamed to THREE.DataTextureLoader."), new Yx(i); } fs.prototype.center = function(i) { return console.warn("THREE.Box2: .center() has been renamed to .getCenter()."), this.getCenter(i); }; fs.prototype.empty = function() { return console.warn("THREE.Box2: .empty() has been renamed to .isEmpty()."), this.isEmpty(); }; fs.prototype.isIntersectionBox = function(i) { return console.warn("THREE.Box2: .isIntersectionBox() has been renamed to .intersectsBox()."), this.intersectsBox(i); }; fs.prototype.size = function(i) { return console.warn("THREE.Box2: .size() has been renamed to .getSize()."), this.getSize(i); }; Vi.prototype.center = function(i) { return console.warn("THREE.Box3: .center() has been renamed to .getCenter()."), this.getCenter(i); }; Vi.prototype.empty = function() { return console.warn("THREE.Box3: .empty() has been renamed to .isEmpty()."), this.isEmpty(); }; Vi.prototype.isIntersectionBox = function(i) { return console.warn("THREE.Box3: .isIntersectionBox() has been renamed to .intersectsBox()."), this.intersectsBox(i); }; Vi.prototype.isIntersectionSphere = function(i) { return console.warn("THREE.Box3: .isIntersectionSphere() has been renamed to .intersectsSphere()."), this.intersectsSphere(i); }; Vi.prototype.size = function(i) { return console.warn("THREE.Box3: .size() has been renamed to .getSize()."), this.getSize(i); }; bn.prototype.empty = function() { return console.warn("THREE.Sphere: .empty() has been renamed to .isEmpty()."), this.isEmpty(); }; _l.prototype.setFromMatrix = function(i) { return console.warn("THREE.Frustum: .setFromMatrix() has been renamed to .setFromProjectionMatrix()."), this.setFromProjectionMatrix(i); }; f1.prototype.center = function(i) { return console.warn("THREE.Line3: .center() has been renamed to .getCenter()."), this.getCenter(i); }; ii.prototype.flattenToArrayOffset = function(i, e) { return console.warn("THREE.Matrix3: .flattenToArrayOffset() has been deprecated. Use .toArray() instead."), this.toArray(i, e); }; ii.prototype.multiplyVector3 = function(i) { return console.warn("THREE.Matrix3: .multiplyVector3() has been removed. Use vector.applyMatrix3( matrix ) instead."), i.applyMatrix3(this); }; ii.prototype.multiplyVector3Array = function() { console.error("THREE.Matrix3: .multiplyVector3Array() has been removed."); }; ii.prototype.applyToBufferAttribute = function(i) { return console.warn("THREE.Matrix3: .applyToBufferAttribute() has been removed. Use attribute.applyMatrix3( matrix ) instead."), i.applyMatrix3(this); }; ii.prototype.applyToVector3Array = function() { console.error("THREE.Matrix3: .applyToVector3Array() has been removed."); }; ii.prototype.getInverse = function(i) { return console.warn("THREE.Matrix3: .getInverse() has been removed. Use matrixInv.copy( matrix ).invert(); instead."), this.copy(i).invert(); }; $e.prototype.extractPosition = function(i) { return console.warn("THREE.Matrix4: .extractPosition() has been renamed to .copyPosition()."), this.copyPosition(i); }; $e.prototype.flattenToArrayOffset = function(i, e) { return console.warn("THREE.Matrix4: .flattenToArrayOffset() has been deprecated. Use .toArray() instead."), this.toArray(i, e); }; $e.prototype.getPosition = function() { return console.warn("THREE.Matrix4: .getPosition() has been removed. Use Vector3.setFromMatrixPosition( matrix ) instead."), new Z().setFromMatrixColumn(this, 3); }; $e.prototype.setRotationFromQuaternion = function(i) { return console.warn("THREE.Matrix4: .setRotationFromQuaternion() has been renamed to .makeRotationFromQuaternion()."), this.makeRotationFromQuaternion(i); }; $e.prototype.multiplyToArray = function() { console.warn("THREE.Matrix4: .multiplyToArray() has been removed."); }; $e.prototype.multiplyVector3 = function(i) { return console.warn("THREE.Matrix4: .multiplyVector3() has been removed. Use vector.applyMatrix4( matrix ) instead."), i.applyMatrix4(this); }; $e.prototype.multiplyVector4 = function(i) { return console.warn("THREE.Matrix4: .multiplyVector4() has been removed. Use vector.applyMatrix4( matrix ) instead."), i.applyMatrix4(this); }; $e.prototype.multiplyVector3Array = function() { console.error("THREE.Matrix4: .multiplyVector3Array() has been removed."); }; $e.prototype.rotateAxis = function(i) { console.warn("THREE.Matrix4: .rotateAxis() has been removed. Use Vector3.transformDirection( matrix ) instead."), i.transformDirection(this); }; $e.prototype.crossVector = function(i) { return console.warn("THREE.Matrix4: .crossVector() has been removed. Use vector.applyMatrix4( matrix ) instead."), i.applyMatrix4(this); }; $e.prototype.translate = function() { console.error("THREE.Matrix4: .translate() has been removed."); }; $e.prototype.rotateX = function() { console.error("THREE.Matrix4: .rotateX() has been removed."); }; $e.prototype.rotateY = function() { console.error("THREE.Matrix4: .rotateY() has been removed."); }; $e.prototype.rotateZ = function() { console.error("THREE.Matrix4: .rotateZ() has been removed."); }; $e.prototype.rotateByAxis = function() { console.error("THREE.Matrix4: .rotateByAxis() has been removed."); }; $e.prototype.applyToBufferAttribute = function(i) { return console.warn("THREE.Matrix4: .applyToBufferAttribute() has been removed. Use attribute.applyMatrix4( matrix ) instead."), i.applyMatrix4(this); }; $e.prototype.applyToVector3Array = function() { console.error("THREE.Matrix4: .applyToVector3Array() has been removed."); }; $e.prototype.makeFrustum = function(i, e, t, r, n, o) { return console.warn("THREE.Matrix4: .makeFrustum() has been removed. Use .makePerspective( left, right, top, bottom, near, far ) instead."), this.makePerspective(i, e, r, t, n, o); }; $e.prototype.getInverse = function(i) { return console.warn("THREE.Matrix4: .getInverse() has been removed. Use matrixInv.copy( matrix ).invert(); instead."), this.copy(i).invert(); }; Ar.prototype.isIntersectionLine = function(i) { return console.warn("THREE.Plane: .isIntersectionLine() has been renamed to .intersectsLine()."), this.intersectsLine(i); }; vi.prototype.multiplyVector3 = function(i) { return console.warn("THREE.Quaternion: .multiplyVector3() has been removed. Use is now vector.applyQuaternion( quaternion ) instead."), i.applyQuaternion(this); }; vi.prototype.inverse = function() { return console.warn("THREE.Quaternion: .inverse() has been renamed to invert()."), this.invert(); }; io.prototype.isIntersectionBox = function(i) { return console.warn("THREE.Ray: .isIntersectionBox() has been renamed to .intersectsBox()."), this.intersectsBox(i); }; io.prototype.isIntersectionPlane = function(i) { return console.warn("THREE.Ray: .isIntersectionPlane() has been renamed to .intersectsPlane()."), this.intersectsPlane(i); }; io.prototype.isIntersectionSphere = function(i) { return console.warn("THREE.Ray: .isIntersectionSphere() has been renamed to .intersectsSphere()."), this.intersectsSphere(i); }; Xt.prototype.area = function() { return console.warn("THREE.Triangle: .area() has been renamed to .getArea()."), this.getArea(); }; Xt.prototype.barycoordFromPoint = function(i, e) { return console.warn("THREE.Triangle: .barycoordFromPoint() has been renamed to .getBarycoord()."), this.getBarycoord(i, e); }; Xt.prototype.midpoint = function(i) { return console.warn("THREE.Triangle: .midpoint() has been renamed to .getMidpoint()."), this.getMidpoint(i); }; Xt.prototypenormal = function(i) { return console.warn("THREE.Triangle: .normal() has been renamed to .getNormal()."), this.getNormal(i); }; Xt.prototype.plane = function(i) { return console.warn("THREE.Triangle: .plane() has been renamed to .getPlane()."), this.getPlane(i); }; Xt.barycoordFromPoint = function(i, e, t, r, n) { return console.warn("THREE.Triangle: .barycoordFromPoint() has been renamed to .getBarycoord()."), Xt.getBarycoord(i, e, t, r, n); }; Xt.normal = function(i, e, t, r) { return console.warn("THREE.Triangle: .normal() has been renamed to .getNormal()."), Xt.getNormal(i, e, t, r); }; Un.prototype.extractAllPoints = function(i) { return console.warn("THREE.Shape: .extractAllPoints() has been removed. Use .extractPoints() instead."), this.extractPoints(i); }; Un.prototype.extrude = function(i) { return console.warn("THREE.Shape: .extrude() has been removed. Use ExtrudeGeometry() instead."), new br(this, i); }; Un.prototype.makeGeometry = function(i) { return console.warn("THREE.Shape: .makeGeometry() has been removed. Use ShapeGeometry() instead."), new ko(this, i); }; Oe.prototype.fromAttribute = function(i, e, t) { return console.warn("THREE.Vector2: .fromAttribute() has been renamed to .fromBufferAttribute()."), this.fromBufferAttribute(i, e, t); }; Oe.prototype.distanceToManhattan = function(i) { return console.warn("THREE.Vector2: .distanceToManhattan() has been renamed to .manhattanDistanceTo()."), this.manhattanDistanceTo(i); }; Oe.prototype.lengthManhattan = function() { return console.warn("THREE.Vector2: .lengthManhattan() has been renamed to .manhattanLength()."), this.manhattanLength(); }; Z.prototype.setEulerFromRotationMatrix = function() { console.error("THREE.Vector3: .setEulerFromRotationMatrix() has been removed. Use Euler.setFromRotationMatrix() instead."); }; Z.prototype.setEulerFromQuaternion = function() { console.error("THREE.Vector3: .setEulerFromQuaternion() has been removed. Use Euler.setFromQuaternion() instead."); }; Z.prototype.getPositionFromMatrix = function(i) { return console.warn("THREE.Vector3: .getPositionFromMatrix() has been renamed to .setFromMatrixPosition()."), this.setFromMatrixPosition(i); }; Z.prototype.getScaleFromMatrix = function(i) { return console.warn("THREE.Vector3: .getScaleFromMatrix() has been renamed to .setFromMatrixScale()."), this.setFromMatrixScale(i); }; Z.prototype.getColumnFromMatrix = function(i, e) { return console.warn("THREE.Vector3: .getColumnFromMatrix() has been renamed to .setFromMatrixColumn()."), this.setFromMatrixColumn(e, i); }; Z.prototype.applyProjection = function(i) { return console.warn("THREE.Vector3: .applyProjection() has been removed. Use .applyMatrix4( m ) instead."), this.applyMatrix4(i); }; Z.prototype.fromAttribute = function(i, e, t) { return console.warn("THREE.Vector3: .fromAttribute() has been renamed to .fromBufferAttribute()."), this.fromBufferAttribute(i, e, t); }; Z.prototype.distanceToManhattan = function(i) { return console.warn("THREE.Vector3: .distanceToManhattan() has been renamed to .manhattanDistanceTo()."), this.manhattanDistanceTo(i); }; Z.prototype.lengthManhattan = function() { return console.warn("THREE.Vector3: .lengthManhattan() has been renamed to .manhattanLength()."), this.manhattanLength(); }; Mt.prototype.fromAttribute = function(i, e, t) { return console.warn("THREE.Vector4: .fromAttribute() has been renamed to .fromBufferAttribute()."), this.fromBufferAttribute(i, e, t); }; Mt.prototype.lengthManhattan = function() { return console.warn("THREE.Vector4: .lengthManhattan() has been renamed to .manhattanLength()."), this.manhattanLength(); }; nt.prototype.getChildByName = function(i) { return console.warn("THREE.Object3D: .getChildByName() has been renamed to .getObjectByName()."), this.getObjectByName(i); }; nt.prototype.renderDepth = function() { console.warn("THREE.Object3D: .renderDepth has been removed. Use .renderOrder, instead."); }; nt.prototype.translate = function(i, e) { return console.warn("THREE.Object3D: .translate() has been removed. Use .translateOnAxis( axis, distance ) instead."), this.translateOnAxis(e, i); }; nt.prototype.getWorldRotation = function() { console.error("THREE.Object3D: .getWorldRotation() has been removed. Use THREE.Object3D.getWorldQuaternion( target ) instead."); }; nt.prototype.applyMatrix = function(i) { return console.warn("THREE.Object3D: .applyMatrix() has been renamed to .applyMatrix4()."), this.applyMatrix4(i); }; Object.defineProperties(nt.prototype, { eulerOrder: { get: function() { return console.warn("THREE.Object3D: .eulerOrder is now .rotation.order."), this.rotation.order; }, set: function(i) { console.warn("THREE.Object3D: .eulerOrder is now .rotation.order."), this.rotation.order = i; } }, useQuaternion: { get: function() { console.warn("THREE.Object3D: .useQuaternion has been removed. The library now uses quaternions by default."); }, set: function() { console.warn("THREE.Object3D: .useQuaternion has been removed. The library now uses quaternions by default."); } } }); Yt.prototype.setDrawMode = function() { console.error("THREE.Mesh: .setDrawMode() has been removed. The renderer now always assumes THREE.TrianglesDrawMode. Transform your geometry via BufferGeometryUtils.toTrianglesDrawMode() if necessary."); }; Object.defineProperties(Yt.prototype, { drawMode: { get: function() { return console.error("THREE.Mesh: .drawMode has been removed. The renderer now always assumes THREE.TrianglesDrawMode."), ox; }, set: function() { console.error("THREE.Mesh: .drawMode has been removed. The renderer now always assumes THREE.TrianglesDrawMode. Transform your geometry via BufferGeometryUtils.toTrianglesDrawMode() if necessary."); } } }); Al.prototype.initBones = function() { console.error("THREE.SkinnedMesh: initBones() has been removed."); }; ti.prototype.setLens = function(i, e) { console.warn("THREE.PerspectiveCamera.setLens is deprecated. Use .setFocalLength and .filmGauge for a photographic setup."), e !== void 0 && (this.filmGauge = e), this.setFocalLength(i); }; Object.defineProperties(xr.prototype, { onlyShadow: { set: function() { console.warn("THREE.Light: .onlyShadow has been removed."); } }, shadowCameraFov: { set: function(i) { console.warn("THREE.Light: .shadowCameraFov is now .shadow.camera.fov."), this.shadow.camera.fov = i; } }, shadowCameraLeft: { set: function(i) { console.warn("THREE.Light: .shadowCameraLeft is now .shadow.camera.left."), this.shadow.camera.left = i; } }, shadowCameraRight: { set: function(i) { console.warn("THREE.Light: .shadowCameraRight is now .shadow.camera.right."), this.shadow.camera.right = i; } }, shadowCameraTop: { set: function(i) { console.warn("THREE.Light: .shadowCameraTop is now .shadow.camera.top."), this.shadow.camera.top = i; } }, shadowCameraBottom: { set: function(i) { console.warn("THREE.Light: .shadowCameraBottom is now .shadow.camera.bottom."), this.shadow.camera.bottom = i; } }, shadowCameraNear: { set: function(i) { console.warn("THREE.Light: .shadowCameraNear is now .shadow.camera.near."), this.shadow.camera.near = i; } }, shadowCameraFar: { set: function(i) { console.warn("THREE.Light: .shadowCameraFar is now .shadow.camera.far."), this.shadow.camera.far = i; } }, shadowCameraVisible: { set: function() { console.warn("THREE.Light: .shadowCameraVisible has been removed. Use new THREE.CameraHelper( light.shadow.camera ) instead."); } }, shadowBias: { set: function(i) { console.warn("THREE.Light: .shadowBias is now .shadow.bias."), this.shadow.bias = i; } }, shadowDarkness: { set: function() { console.warn("THREE.Light: .shadowDarkness has been removed."); } }, shadowMapWidth: { set: function(i) { console.warn("THREE.Light: .shadowMapWidth is now .shadow.mapSize.width."), this.shadow.mapSize.width = i; } }, shadowMapHeight: { set: function(i) { console.warn("THREE.Light: .shadowMapHeight is now .shadow.mapSize.height."), this.shadow.mapSize.height = i; } } }); Object.defineProperties(tt.prototype, { length: { get: function() { return console.warn("THREE.BufferAttribute: .length has been deprecated. Use .count instead."), this.array.length; } }, dynamic: { get: function() { return console.warn("THREE.BufferAttribute: .dynamic has been deprecated. Use .usage instead."), this.usage === Fa; }, set: function() { console.warn("THREE.BufferAttribute: .dynamic has been deprecated. Use .usage instead."), this.setUsage(Fa); } } }); tt.prototype.setDynamic = function(i) { return console.warn("THREE.BufferAttribute: .setDynamic() has been deprecated. Use .setUsage() instead."), this.setUsage(i === !0 ? Fa : za), this; }; tt.prototype.copyIndicesArray = function() { console.error("THREE.BufferAttribute: .copyIndicesArray() has been removed."); }, tt.prototype.setArray = function() { console.error("THREE.BufferAttribute: .setArray has been removed. Use BufferGeometry .setAttribute to replace/resize attribute buffers"); }; Je.prototype.addIndex = function(i) { console.warn("THREE.BufferGeometry: .addIndex() has been renamed to .setIndex()."), this.setIndex(i); }; Je.prototype.addAttribute = function(i, e) { return console.warn("THREE.BufferGeometry: .addAttribute() has been renamed to .setAttribute()."), !(e && e.isBufferAttribute) && !(e && e.isInterleavedBufferAttribute) ? (console.warn("THREE.BufferGeometry: .addAttribute() now expects ( name, attribute )."), this.setAttribute(i, new tt(arguments[1], arguments[2]))) : i === "index" ? (console.warn("THREE.BufferGeometry.addAttribute: Use .setIndex() for index attribute."), this.setIndex(e), this) : this.setAttribute(i, e); }; Je.prototype.addDrawCall = function(i, e, t) { t !== void 0 && console.warn("THREE.BufferGeometry: .addDrawCall() no longer supports indexOffset."), console.warn("THREE.BufferGeometry: .addDrawCall() is now .addGroup()."), this.addGroup(i, e); }; Je.prototype.clearDrawCalls = function() { console.warn("THREE.BufferGeometry: .clearDrawCalls() is now .clearGroups()."), this.clearGroups(); }; Je.prototype.computeOffsets = function() { console.warn("THREE.BufferGeometry: .computeOffsets() has been removed."); }; Je.prototype.removeAttribute = function(i) { return console.warn("THREE.BufferGeometry: .removeAttribute() has been renamed to .deleteAttribute()."), this.deleteAttribute(i); }; Je.prototype.applyMatrix = function(i) { return console.warn("THREE.BufferGeometry: .applyMatrix() has been renamed to .applyMatrix4()."), this.applyMatrix4(i); }; Object.defineProperties(Je.prototype, { drawcalls: { get: function() { return console.error("THREE.BufferGeometry: .drawcalls has been renamed to .groups."), this.groups; } }, offsets: { get: function() { return console.warn("THREE.BufferGeometry: .offsets has been renamed to .groups."), this.groups; } } }); ro.prototype.setDynamic = function(i) { return console.warn("THREE.InterleavedBuffer: .setDynamic() has been deprecated. Use .setUsage() instead."), this.setUsage(i === !0 ? Fa : za), this; }; ro.prototype.setArray = function() { console.error("THREE.InterleavedBuffer: .setArray has been removed. Use BufferGeometry .setAttribute to replace/resize attribute buffers"); }; br.prototype.getArrays = function() { console.error("THREE.ExtrudeGeometry: .getArrays() has been removed."); }; br.prototype.addShapeList = function() { console.error("THREE.ExtrudeGeometry: .addShapeList() has been removed."); }; br.prototype.addShape = function() { console.error("THREE.ExtrudeGeometry: .addShape() has been removed."); }; Nu.prototype.dispose = function() { console.error("THREE.Scene: .dispose() has been removed."); }; ju.prototype.onUpdate = function() { return console.warn("THREE.Uniform: .onUpdate() has been removed. Use object.onBeforeRender() instead."), this; }; Object.defineProperties(Qt.prototype, { wrapAround: { get: function() { console.warn("THREE.Material: .wrapAround has been removed."); }, set: function() { console.warn("THREE.Material: .wrapAround has been removed."); } }, overdraw: { get: function() { console.warn("THREE.Material: .overdraw has been removed."); }, set: function() { console.warn("THREE.Material: .overdraw has been removed."); } }, wrapRGB: { get: function() { return console.warn("THREE.Material: .wrapRGB has been removed."), new Be(); } }, shading: { get: function() { console.error("THREE." + this.type + ": .shading has been removed. Use the boolean .flatShading instead."); }, set: function(i) { console.warn("THREE." + this.type + ": .shading has been removed. Use the boolean .flatShading instead."), this.flatShading = i === Fp; } }, stencilMask: { get: function() { return console.warn("THREE." + this.type + ": .stencilMask has been removed. Use .stencilFuncMask instead."), this.stencilFuncMask; }, set: function(i) { console.warn("THREE." + this.type + ": .stencilMask has been removed. Use .stencilFuncMask instead."), this.stencilFuncMask = i; } } }); Object.defineProperties(hn.prototype, { derivatives: { get: function() { return console.warn("THREE.ShaderMaterial: .derivatives has been moved to .extensions.derivatives."), this.extensions.derivatives; }, set: function(i) { console.warn("THREE. ShaderMaterial: .derivatives has been moved to .extensions.derivatives."), this.extensions.derivatives = i; } } }); St.prototype.clearTarget = function(i, e, t, r) { console.warn("THREE.WebGLRenderer: .clearTarget() has been deprecated. Use .setRenderTarget() and .clear() instead."), this.setRenderTarget(i), this.clear(e, t, r); }; St.prototype.animate = function(i) { console.warn("THREE.WebGLRenderer: .animate() is now .setAnimationLoop()."), this.setAnimationLoop(i); }; St.prototype.getCurrentRenderTarget = function() { return console.warn("THREE.WebGLRenderer: .getCurrentRenderTarget() is now .getRenderTarget()."), this.getRenderTarget(); }; St.prototype.getMaxAnisotropy = function() { return console.warn("THREE.WebGLRenderer: .getMaxAnisotropy() is now .capabilities.getMaxAnisotropy()."), this.capabilities.getMaxAnisotropy(); }; St.prototype.getPrecision = function() { return console.warn("THREE.WebGLRenderer: .getPrecision() is now .capabilities.precision."), this.capabilities.precision; }; St.prototype.resetGLState = function() { return console.warn("THREE.WebGLRenderer: .resetGLState() is now .state.reset()."), this.state.reset(); }; St.prototype.supportsFloatTextures = function() { return console.warn("THREE.WebGLRenderer: .supportsFloatTextures() is now .extensions.get( 'OES_texture_float' )."), this.extensions.get("OES_texture_float"); }; St.prototype.supportsHalfFloatTextures = function() { return console.warn("THREE.WebGLRenderer: .supportsHalfFloatTextures() is now .extensions.get( 'OES_texture_half_float' )."), this.extensions.get("OES_texture_half_float"); }; St.prototype.supportsStandardDerivatives = function() { return console.warn("THREE.WebGLRenderer: .supportsStandardDerivatives() is now .extensions.get( 'OES_standard_derivatives' )."), this.extensions.get("OES_standard_derivatives"); }; St.prototype.supportsCompressedTextureS3TC = function() { return console.warn("THREE.WebGLRenderer: .supportsCompressedTextureS3TC() is now .extensions.get( 'WEBGL_compressed_texture_s3tc' )."), this.extensions.get("WEBGL_compressed_texture_s3tc"); }; St.prototype.supportsCompressedTexturePVRTC = function() { return console.warn("THREE.WebGLRenderer: .supportsCompressedTexturePVRTC() is now .extensions.get( 'WEBGL_compressed_texture_pvrtc' )."), this.extensions.get("WEBGL_compressed_texture_pvrtc"); }; St.prototype.supportsBlendMinMax = function() { return console.warn("THREE.WebGLRenderer: .supportsBlendMinMax() is now .extensions.get( 'EXT_blend_minmax' )."), this.extensions.get("EXT_blend_minmax"); }; St.prototype.supportsVertexTextures = function() { return console.warn("THREE.WebGLRenderer: .supportsVertexTextures() is now .capabilities.vertexTextures."), this.capabilities.vertexTextures; }; St.prototype.supportsInstancedArrays = function() { return console.warn("THREE.WebGLRenderer: .supportsInstancedArrays() is now .extensions.get( 'ANGLE_instanced_arrays' )."), this.extensions.get("ANGLE_instanced_arrays"); }; St.prototype.enableScissorTest = function(i) { console.warn("THREE.WebGLRenderer: .enableScissorTest() is now .setScissorTest()."), this.setScissorTest(i); }; St.prototype.initMaterial = function() { console.warn("THREE.WebGLRenderer: .initMaterial() has been removed."); }; St.prototype.addPrePlugin = function() { console.warn("THREE.WebGLRenderer: .addPrePlugin() has been removed."); }; St.prototype.addPostPlugin = function() { console.warn("THREE.WebGLRenderer: .addPostPlugin() has been removed."); }; St.prototype.updateShadowMap = function() { console.warn("THREE.WebGLRenderer: .updateShadowMap() has been removed."); }; St.prototype.setFaceCulling = function() { console.warn("THREE.WebGLRenderer: .setFaceCulling() has been removed."); }; St.prototype.allocTextureUnit = function() { console.warn("THREE.WebGLRenderer: .allocTextureUnit() has been removed."); }; St.prototype.setTexture = function() { console.warn("THREE.WebGLRenderer: .setTexture() has been removed."); }; St.prototype.setTexture2D = function() { console.warn("THREE.WebGLRenderer: .setTexture2D() has been removed."); }; St.prototype.setTextureCube = function() { console.warn("THREE.WebGLRenderer: .setTextureCube() has been removed."); }; St.prototype.getActiveMipMapLevel = function() { return console.warn("THREE.WebGLRenderer: .getActiveMipMapLevel() is now .getActiveMipmapLevel()."), this.getActiveMipmapLevel(); }; Object.defineProperties(St.prototype, { shadowMapEnabled: { get: function() { return this.shadowMap.enabled; }, set: function(i) { console.warn("THREE.WebGLRenderer: .shadowMapEnabled is now .shadowMap.enabled."), this.shadowMap.enabled = i; } }, shadowMapType: { get: function() { return this.shadowMap.type; }, set: function(i) { console.warn("THREE.WebGLRenderer: .shadowMapType is now .shadowMap.type."), this.shadowMap.type = i; } }, shadowMapCullFace: { get: function() { console.warn("THREE.WebGLRenderer: .shadowMapCullFace has been removed. Set Material.shadowSide instead."); }, set: function() { console.warn("THREE.WebGLRenderer: .shadowMapCullFace has been removed. Set Material.shadowSide instead."); } }, context: { get: function() { return console.warn("THREE.WebGLRenderer: .context has been removed. Use .getContext() instead."), this.getContext(); } }, vr: { get: function() { return console.warn("THREE.WebGLRenderer: .vr has been renamed to .xr"), this.xr; } }, gammaInput: { get: function() { return console.warn("THREE.WebGLRenderer: .gammaInput has been removed. Set the encoding for textures via Texture.encoding instead."), !1; }, set: function() { console.warn("THREE.WebGLRenderer: .gammaInput has been removed. Set the encoding for textures via Texture.encoding instead."); } }, gammaOutput: { get: function() { return console.warn("THREE.WebGLRenderer: .gammaOutput has been removed. Set WebGLRenderer.outputEncoding instead."), !1; }, set: function(i) { console.warn("THREE.WebGLRenderer: .gammaOutput has been removed. Set WebGLRenderer.outputEncoding instead."), this.outputEncoding = i === !0 ? Do : Ri; } }, toneMappingWhitePoint: { get: function() { return console.warn("THREE.WebGLRenderer: .toneMappingWhitePoint has been removed."), 1; }, set: function() { console.warn("THREE.WebGLRenderer: .toneMappingWhitePoint has been removed."); } } }); Object.defineProperties(Ix.prototype, { cullFace: { get: function() { console.warn("THREE.WebGLRenderer: .shadowMap.cullFace has been removed. Set Material.shadowSide instead."); }, set: function() { console.warn("THREE.WebGLRenderer: .shadowMap.cullFace has been removed. Set Material.shadowSide instead."); } }, renderReverseSided: { get: function() { console.warn("THREE.WebGLRenderer: .shadowMap.renderReverseSided has been removed. Set Material.shadowSide instead."); }, set: function() { console.warn("THREE.WebGLRenderer: .shadowMap.renderReverseSided has been removed. Set Material.shadowSide instead."); } }, renderSingleSided: { get: function() { console.warn("THREE.WebGLRenderer: .shadowMap.renderSingleSided has been removed. Set Material.shadowSide instead."); }, set: function() { console.warn("THREE.WebGLRenderer: .shadowMap.renderSingleSided has been removed. Set Material.shadowSide instead."); } } }); function Bk(i, e, t) { return console.warn("THREE.WebGLRenderTargetCube( width, height, options ) is now WebGLCubeRenderTarget( size, options )."), new Pu(i, t); } Object.defineProperties(vr.prototype, { wrapS: { get: function() { return console.warn("THREE.WebGLRenderTarget: .wrapS is now .texture.wrapS."), this.texture.wrapS; }, set: function(i) { console.warn("THREE.WebGLRenderTarget: .wrapS is now .texture.wrapS."), this.texture.wrapS = i; } }, wrapT: { get: function() { return console.warn("THREE.WebGLRenderTarget: .wrapT is now .texture.wrapT."), this.texture.wrapT; }, set: function(i) { console.warn("THREE.WebGLRenderTarget: .wrapT is now .texture.wrapT."), this.texture.wrapT = i; } }, magFilter: { get: function() { return console.warn("THREE.WebGLRenderTarget: .magFilter is now .texture.magFilter."), this.texture.magFilter; }, set: function(i) { console.warn("THREE.WebGLRenderTarget: .magFilter is now .texture.magFilter."), this.texture.magFilter = i; } }, minFilter: { get: function() { return console.warn("THREE.WebGLRenderTarget: .minFilter is now .texture.minFilter."), this.texture.minFilter; }, set: function(i) { console.warn("THREE.WebGLRenderTarget: .minFilter is now .texture.minFilter."), this.texture.minFilter = i; } }, anisotropy: { get: function() { return console.warn("THREE.WebGLRenderTarget: .anisotropy is now .texture.anisotropy."), this.texture.anisotropy; }, set: function(i) { console.warn("THREE.WebGLRenderTarget: .anisotropy is now .texture.anisotropy."), this.texture.anisotropy = i; } }, offset: { get: function() { return console.warn("THREE.WebGLRenderTarget: .offset is now .texture.offset."), this.texture.offset; }, set: function(i) { console.warn("THREE.WebGLRenderTarget: .offset is now .texture.offset."), this.texture.offset = i; } }, repeat: { get: function() { return console.warn("THREE.WebGLRenderTarget: .repeat is now .texture.repeat."), this.texture.repeat; }, set: function(i) { console.warn("THREE.WebGLRenderTarget: .repeat is now .texture.repeat."), this.texture.repeat = i; } }, format: { get: function() { return console.warn("THREE.WebGLRenderTarget: .format is now .texture.format."), this.texture.format; }, set: function(i) { console.warn("THREE.WebGLRenderTarget: .format is now .texture.format."), this.texture.format = i; } }, type: { get: function() { return console.warn("THREE.WebGLRenderTarget: .type is now .texture.type."), this.texture.type; }, set: function(i) { console.warn("THREE.WebGLRenderTarget: .type is now .texture.type."), this.texture.type = i; } }, generateMipmaps: { get: function() { return console.warn("THREE.WebGLRenderTarget: .generateMipmaps is now .texture.generateMipmaps."), this.texture.generateMipmaps; }, set: function(i) { console.warn("THREE.WebGLRenderTarget: .generateMipmaps is now .texture.generateMipmaps."), this.texture.generateMipmaps = i; } } }); Of.prototype.load = function(i) { console.warn("THREE.Audio: .load has been deprecated. Use THREE.AudioLoader instead."); const e = this; return new n1().load(i, function(t) { e.setBuffer(t); }), this; }; l1.prototype.getData = function() { return console.warn("THREE.AudioAnalyser: .getData() is now .getFrequencyData()."), this.getFrequencyData(); }; Ou.prototype.updateCubeMap = function(i, e) { return console.warn("THREE.CubeCamera: .updateCubeMap() is now .update()."), this.update(i, e); }; Ou.prototype.clear = function(i, e, t, r) { return console.warn("THREE.CubeCamera: .clear() is now .renderTarget.clear()."), this.renderTarget.clear(i, e, t, r); }; jo.crossOrigin = void 0; jo.loadTexture = function(i, e, t, r) { console.warn("THREE.ImageUtils.loadTexture has been deprecated. Use THREE.TextureLoader() instead."); const n = new xf(); n.setCrossOrigin(this.crossOrigin); const o = n.load(i, t, void 0, r); return e && (o.mapping = e), o; }; jo.loadTextureCube = function(i, e, t, r) { console.warn("THREE.ImageUtils.loadTextureCube has been deprecated. Use THREE.CubeTextureLoader() instead."); const n = new Zx(); n.setCrossOrigin(this.crossOrigin); const o = n.load(i, t, void 0, r); return e && (o.mapping = e), o; }; jo.loadCompressedTexture = function() { console.error("THREE.ImageUtils.loadCompressedTexture has been removed. Use THREE.DDSLoader instead."); }; jo.loadCompressedTextureCube = function() { console.error("THREE.ImageUtils.loadCompressedTextureCube has been removed. Use THREE.DDSLoader instead."); }; function kk() { console.error("THREE.CanvasRenderer has been removed"); } function zk() { console.error("THREE.JSONLoader has been removed."); } const Fk = { createMultiMaterialObject: function() { console.error("THREE.SceneUtils has been moved to /examples/jsm/utils/SceneUtils.js"); }, detach: function() { console.error("THREE.SceneUtils has been moved to /examples/jsm/utils/SceneUtils.js"); }, attach: function() { console.error("THREE.SceneUtils has been moved to /examples/jsm/utils/SceneUtils.js"); } }; function Vk() { console.error("THREE.LensFlare has been moved to /examples/jsm/objects/Lensflare.js"); } typeof __THREE_DEVTOOLS__ < "u" && __THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("register", { detail: { revision: kp } })); typeof window < "u" && (window.__THREE__ ? console.warn("WARNING: Multiple instances of Three.js being imported.") : window.__THREE__ = kp); const Uk = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, ACESFilmicToneMapping: lb, AddEquation: bo, AddOperation: nb, AdditiveAnimationBlendMode: Gp, AdditiveBlending: yd, AlphaFormat: gb, AlwaysDepth: Jy, AlwaysStencilFunc: hx, AmbientLight: Mf, AmbientLightProbe: a1, AnimationClip: Qa, AnimationLoader: yB, AnimationMixer: h1, AnimationObjectGroup: u1, AnimationUtils: Lt, ArcCurve: rf, ArrayCamera: Kp, ArrowHelper: KB, Audio: Of, AudioAnalyser: l1, AudioContext: Rf, AudioListener: AB, AudioLoader: n1, AxesHelper: x1, AxisHelper: Rk, BackSide: $t, BasicDepthPacking: lx, BasicShadowMap: P3, BinaryTextureLoader: Nk, Bone: Cl, BooleanKeyframeTrack: qo, BoundingBoxHelper: Ok, Box2: fs, Box3: Vi, Box3Helper: YB, BoxBufferGeometry: un, BoxGeometry: un, BoxHelper: b1, BufferAttribute: tt, BufferGeometry: Je, BufferGeometryLoader: i1, ByteType: ub, Cache: Fo, Camera: wl, CameraHelper: ZB, CanvasRenderer: kk, CanvasTexture: Fx, CatmullRomCurve3: of, CineonToneMapping: sb, CircleBufferGeometry: Ua, CircleGeometry: Ua, ClampToEdgeWrapping: li, Clock: s1, Color: Be, ColorKeyframeTrack: yf, CompressedTexture: ef, CompressedTextureLoader: bB, ConeBufferGeometry: Ga, ConeGeometry: Ga, CubeCamera: Ou, CubeReflectionMapping: yl, CubeRefractionMapping: bl, CubeTexture: cs, CubeTextureLoader: Zx, CubeUVReflectionMapping: ls, CubeUVRefractionMapping: xl, CubicBezierCurve: ku, CubicBezierCurve3: af, CubicInterpolant: Wx, CullFaceBack: vd, CullFaceFront: By, CullFaceFrontBack: O3, CullFaceNone: Ny, Curve: Zi, CurvePath: Jx, CustomBlending: zy, CustomToneMapping: cb, CylinderBufferGeometry: Yn, CylinderGeometry: Yn, Cylindrical: GB, DataTexture: Lo, DataTexture2DArray: Yp, DataTexture3D: Jp, DataTextureLoader: Yx, DataUtils: ek, DecrementStencilOp: U3, DecrementWrapStencilOp: H3, DefaultLoadingManager: Xx, DepthFormat: Ao, DepthStencilFormat: Ba, DepthTexture: Vx, DirectionalLight: Hu, DirectionalLightHelper: XB, DiscreteInterpolant: $x, DodecahedronBufferGeometry: Ha, DodecahedronGeometry: Ha, DoubleSide: Xn, DstAlphaFactor: Wy, DstColorFactor: qy, DynamicBufferAttribute: xk, DynamicCopyUsage: rO, DynamicDrawUsage: Fa, DynamicReadUsage: eO, EdgesGeometry: tf, EdgesHelper: Pk, EllipseCurve: Rl, EqualDepth: Qy, EqualStencilFunc: q3, EquirectangularReflectionMapping: Qc, EquirectangularRefractionMapping: eu, Euler: Wo, EventDispatcher: to, ExtrudeBufferGeometry: br, ExtrudeGeometry: br, FaceColors: ck, FileLoader: Yi, FlatShading: Fp, Float16BufferAttribute: wx, Float32Attribute: Ck, Float32BufferAttribute: je, Float64Attribute: Lk, Float64BufferAttribute: _x, FloatType: en, Fog: Sl, FogExp2: Ml, Font: Lf, FontLoader: SB, FrontSide: qn, Frustum: _l, GLBufferAttribute: p1, GLSL1: oO, GLSL3: Id, GammaEncoding: Au, GreaterDepth: tb, GreaterEqualDepth: eb, GreaterEqualStencilFunc: J3, GreaterStencilFunc: Z3, GridHelper: y1, Group: Lr, HalfFloatType: Eo, HemisphereLight: wf, HemisphereLightHelper: $B, HemisphereLightProbe: o1, IcosahedronBufferGeometry: ja, IcosahedronGeometry: ja, ImageBitmapLoader: Cf, ImageLoader: al, ImageUtils: jo, ImmediateRenderObject: m1, IncrementStencilOp: V3, IncrementWrapStencilOp: G3, InstancedBufferAttribute: Af, InstancedBufferGeometry: Ef, InstancedInterleavedBuffer: d1, InstancedMesh: Qp, Int16Attribute: Sk, Int16BufferAttribute: bx, Int32Attribute: Ek, Int32BufferAttribute: xx, Int8Attribute: wk, Int8BufferAttribute: gx, IntType: db, InterleavedBuffer: ro, InterleavedBufferAttribute: dn, Interpolant: Fr, InterpolateDiscrete: ka, InterpolateLinear: Io, InterpolateSmooth: Vc, InvertStencilOp: j3, JSONLoader: zk, KeepStencilOp: Uc, KeyframeTrack: Mr, LOD: kx, LatheBufferGeometry: Wa, LatheGeometry: Wa, Layers: Zp, LensFlare: Vk, LessDepth: Ky, LessEqualDepth: Kc, LessEqualStencilFunc: X3, LessStencilFunc: $3, Light: xr, LightProbe: Il, Line: kr, Line3: f1, LineBasicMaterial: ni, LineCurve: Ol, LineCurve3: Ux, LineDashedMaterial: gf, LineLoop: Bu, LinePieces: sk, LineSegments: Pi, LineStrip: ak, LinearEncoding: Ri, LinearFilter: Ut, LinearInterpolant: vf, LinearMipMapLinearFilter: k3, LinearMipMapNearestFilter: B3, LinearMipmapLinearFilter: yn, LinearMipmapNearestFilter: Tu, LinearToneMapping: ob, Loader: yi, LoaderUtils: sn, LoadingManager: bf, LogLuvEncoding: sx, LoopOnce: ix, LoopPingPong: nx, LoopRepeat: rx, LuminanceAlphaFormat: yb, LuminanceFormat: vb, MOUSE: L3, Material: Qt, MaterialLoader: t1, Math: Nd, MathUtils: Nd, Matrix3: ii, Matrix4: $e, MaxEquation: _d, Mesh: Yt, MeshBasicMaterial: ki, MeshDepthMaterial: Iu, MeshDistanceMaterial: Du, MeshFaceMaterial: hk, MeshLambertMaterial: ff, MeshMatcapMaterial: mf, MeshNormalMaterial: pf, MeshPhongMaterial: hf, MeshPhysicalMaterial: Pl, MeshStandardMaterial: $o, MeshToonMaterial: df, MinEquation: wd, MirroredRepeatWrapping: Na, MixOperation: rb, MultiMaterial: dk, MultiplyBlending: xd, MultiplyOperation: vl, NearestFilter: qt, NearestMipMapLinearFilter: N3, NearestMipMapNearestFilter: D3, NearestMipmapLinearFilter: Qs, NearestMipmapNearestFilter: Ks, NeverDepth: Yy, NeverStencilFunc: W3, NoBlending: on, NoColors: lk, NoToneMapping: Fn, NormalAnimationBlendMode: Eu, NormalBlending: Sa, NotEqualDepth: ib, NotEqualStencilFunc: Y3, NumberKeyframeTrack: Ja, Object3D: nt, ObjectLoader: xB, ObjectSpaceNormalMap: ux, OctahedronBufferGeometry: Bo, OctahedronGeometry: Bo, OneFactor: Gy, OneMinusDstAlphaFactor: $y, OneMinusDstColorFactor: Xy, OneMinusSrcAlphaFactor: Up, OneMinusSrcColorFactor: jy, OrthographicCamera: ps, PCFShadowMap: zp, PCFSoftShadowMap: ky, PMREMGenerator: ik, ParametricBufferGeometry: tu, ParametricGeometry: tu, Particle: fk, ParticleBasicMaterial: vk, ParticleSystem: mk, ParticleSystemMaterial: yk, Path: sl, PerspectiveCamera: ti, Plane: Ar, PlaneBufferGeometry: No, PlaneGeometry: No, PlaneHelper: JB, PointCloud: pk, PointCloudMaterial: gk, PointLight: Gu, PointLightHelper: jB, Points: hs, PointsMaterial: no, PolarGridHelper: qB, PolyhedronBufferGeometry: zr, PolyhedronGeometry: zr, PositionalAudio: LB, PropertyBinding: ft, PropertyMixer: c1, QuadraticBezierCurve: zu, QuadraticBezierCurve3: sf, Quaternion: vi, QuaternionKeyframeTrack: Xo, QuaternionLinearInterpolant: qx, REVISION: kp, RGBADepthPacking: cx, RGBAFormat: $i, RGBAIntegerFormat: Tb, RGBA_ASTC_10x10_Format: zb, RGBA_ASTC_10x5_Format: Nb, RGBA_ASTC_10x6_Format: Bb, RGBA_ASTC_10x8_Format: kb, RGBA_ASTC_12x10_Format: Fb, RGBA_ASTC_12x12_Format: Vb, RGBA_ASTC_4x4_Format: Ab, RGBA_ASTC_5x4_Format: Cb, RGBA_ASTC_5x5_Format: Lb, RGBA_ASTC_6x5_Format: Rb, RGBA_ASTC_6x6_Format: Ob, RGBA_ASTC_8x5_Format: Pb, RGBA_ASTC_8x6_Format: Ib, RGBA_ASTC_8x8_Format: Db, RGBA_BPTC_Format: Ub, RGBA_ETC2_EAC_Format: Pd, RGBA_PVRTC_2BPPV1_Format: Rd, RGBA_PVRTC_4BPPV1_Format: Ld, RGBA_S3TC_DXT1_Format: Sd, RGBA_S3TC_DXT3_Format: Td, RGBA_S3TC_DXT5_Format: Ed, RGBDEncoding: $p, RGBEEncoding: Cu, RGBEFormat: bb, RGBFormat: an, RGBIntegerFormat: Sb, RGBM16Encoding: Wp, RGBM7Encoding: jp, RGB_ETC1_Format: Eb, RGB_ETC2_Format: Od, RGB_PVRTC_2BPPV1_Format: Cd, RGB_PVRTC_4BPPV1_Format: Ad, RGB_S3TC_DXT1_Format: Md, RGFormat: _b, RGIntegerFormat: Mb, RawShaderMaterial: ds, Ray: io, Raycaster: VB, RectAreaLight: Sf, RedFormat: xb, RedIntegerFormat: wb, ReinhardToneMapping: ab, RepeatWrapping: Zn, ReplaceStencilOp: F3, ReverseSubtractEquation: Vy, RingBufferGeometry: $a, RingGeometry: $a, SRGB8_ALPHA8_ASTC_10x10_Format: Qb, SRGB8_ALPHA8_ASTC_10x5_Format: Yb, SRGB8_ALPHA8_ASTC_10x6_Format: Jb, SRGB8_ALPHA8_ASTC_10x8_Format: Kb, SRGB8_ALPHA8_ASTC_12x10_Format: ex, SRGB8_ALPHA8_ASTC_12x12_Format: tx, SRGB8_ALPHA8_ASTC_4x4_Format: Gb, SRGB8_ALPHA8_ASTC_5x4_Format: Hb, SRGB8_ALPHA8_ASTC_5x5_Format: jb, SRGB8_ALPHA8_ASTC_6x5_Format: Wb, SRGB8_ALPHA8_ASTC_6x6_Format: $b, SRGB8_ALPHA8_ASTC_8x5_Format: qb, SRGB8_ALPHA8_ASTC_8x6_Format: Xb, SRGB8_ALPHA8_ASTC_8x8_Format: Zb, Scene: Nu, SceneUtils: Fk, ShaderChunk: lt, ShaderLib: fr, ShaderMaterial: hn, ShadowMaterial: uf, Shape: Un, ShapeBufferGeometry: ko, ShapeGeometry: ko, ShapePath: r1, ShapeUtils: Dr, ShortType: hb, Skeleton: Ll, SkeletonHelper: g1, SkinnedMesh: Al, SmoothShading: I3, Sphere: bn, SphereBufferGeometry: zo, SphereGeometry: zo, Spherical: UB, SphericalHarmonics3: Tf, SplineCurve: Fu, SpotLight: Uu, SpotLightHelper: HB, Sprite: El, SpriteMaterial: Tl, SrcAlphaFactor: Vp, SrcAlphaSaturateFactor: Zy, SrcColorFactor: Hy, StaticCopyUsage: iO, StaticDrawUsage: za, StaticReadUsage: Q3, StereoCamera: TB, StreamCopyUsage: nO, StreamDrawUsage: K3, StreamReadUsage: tO, StringKeyframeTrack: Zo, SubtractEquation: Fy, SubtractiveBlending: bd, TOUCH: R3, TangentSpaceNormalMap: eo, TetrahedronBufferGeometry: qa, TetrahedronGeometry: qa, TextBufferGeometry: iu, TextGeometry: iu, Texture: Jt, TextureLoader: xf, TorusBufferGeometry: Xa, TorusGeometry: Xa, TorusKnotBufferGeometry: Za, TorusKnotGeometry: Za, Triangle: Xt, TriangleFanDrawMode: Hp, TriangleStripDrawMode: ax, TrianglesDrawMode: ox, TubeBufferGeometry: Ya, TubeGeometry: Ya, UVMapping: Su, Uint16Attribute: Tk, Uint16BufferAttribute: Lu, Uint32Attribute: Ak, Uint32BufferAttribute: Ru, Uint8Attribute: _k, Uint8BufferAttribute: vx, Uint8ClampedAttribute: Mk, Uint8ClampedBufferAttribute: yx, Uniform: ju, UniformsLib: Fe, UniformsUtils: Sx, UnsignedByteType: Po, UnsignedInt248Type: Ta, UnsignedIntType: Vs, UnsignedShort4444Type: pb, UnsignedShort5551Type: fb, UnsignedShort565Type: mb, UnsignedShortType: el, VSMShadowMap: wa, Vector2: Oe, Vector3: Z, Vector4: Mt, VectorKeyframeTrack: Ka, Vertex: bk, VertexColors: uk, VideoTexture: zx, WebGL1Renderer: Nx, WebGLCubeRenderTarget: Pu, WebGLMultipleRenderTargets: fx, WebGLMultisampleRenderTarget: Xp, WebGLRenderTarget: vr, WebGLRenderTargetCube: Bk, WebGLRenderer: St, WebGLUtils: Dx, WireframeGeometry: cf, WireframeHelper: Ik, WrapAroundEnding: tl, XHRLoader: Dk, ZeroCurvatureEnding: wo, ZeroFactor: Uy, ZeroSlopeEnding: _o, ZeroStencilOp: z3, sRGBEncoding: Do }, Symbol.toStringTag, { value: "Module" })), Gk = /* @__PURE__ */ xu(Uk); function Hk(i, e) { if (!(i instanceof e)) throw new TypeError("Cannot call a class as a function"); } function jk(i, e) { for (var t = 0; t < e.length; t++) { var r = e[t]; r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(i, r.key, r); } } function Wk(i, e, t) { return e && jk(i.prototype, e), i; } function $k(i, e) { if (typeof e != "function" && e !== null) throw new TypeError("Super expression must either be null or a function"); i.prototype = Object.create(e && e.prototype, { constructor: { value: i, writable: !0, configurable: !0 } }), e && Ud(i, e); } function ru(i) { return ru = Object.setPrototypeOf ? Object.getPrototypeOf : function(e) { return e.__proto__ || Object.getPrototypeOf(e); }, ru(i); } function Ud(i, e) { return Ud = Object.setPrototypeOf || function(t, r) { return t.__proto__ = r, t; }, Ud(i, e); } function qk() { if (typeof Reflect > "u" || !Reflect.construct || Reflect.construct.sham) return !1; if (typeof Proxy == "function") return !0; try { return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { })), !0; } catch { return !1; } } function Xk(i) { if (i === void 0) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); return i; } function Zk(i, e) { return e && (typeof e == "object" || typeof e == "function") ? e : Xk(i); } function Yk(i) { var e = qk(); return function() { var t = ru(i), r; if (e) { var n = ru(this).constructor; r = Reflect.construct(t, arguments, n); } else r = t.apply(this, arguments); return Zk(this, r); }; } function Iv(i, e) { return Kk(i) || e4(i, e) || S1(i, e) || i4(); } function Rc(i) { return Jk(i) || Qk(i) || S1(i) || t4(); } function Jk(i) { if (Array.isArray(i)) return Gd(i); } function Kk(i) { if (Array.isArray(i)) return i; } function Qk(i) { if (typeof Symbol < "u" && i[Symbol.iterator] != null || i["@@iterator"] != null) return Array.from(i); } function e4(i, e) { var t = i && (typeof Symbol < "u" && i[Symbol.iterator] || i["@@iterator"]); if (t != null) { var r = [], n = !0, o = !1, a, s; try { for (t = t.call(i); !(n = (a = t.next()).done) && (r.push(a.value), !(e && r.length === e)); n = !0) ; } catch (c) { o = !0, s = c; } finally { try { !n && t.return != null && t.return(); } finally { if (o) throw s; } } return r; } } function S1(i, e) { if (i) { if (typeof i == "string") return Gd(i, e); var t = Object.prototype.toString.call(i).slice(8, -1); if (t === "Object" && i.constructor && (t = i.constructor.name), t === "Map" || t === "Set") return Array.from(i); if (t === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)) return Gd(i, e); } } function Gd(i, e) { (e == null || e > i.length) && (e = i.length); for (var t = 0, r = new Array(e); t < e; t++) r[t] = i[t]; return r; } function t4() { throw new TypeError(`Invalid attempt to spread non-iterable instance. In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`); } function i4() { throw new TypeError(`Invalid attempt to destructure non-iterable instance. In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`); } var Rs = typeof window < "u" && window.THREE ? window.THREE : { LinearFilter: Ut, Sprite: El, SpriteMaterial: Tl, Texture: Jt }, r4 = /* @__PURE__ */ function(i) { $k(t, i); var e = Yk(t); function t() { var r, n = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : "", o = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 10, a = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : "rgba(255, 255, 255, 1)"; return Hk(this, t), r = e.call(this, new Rs.SpriteMaterial({ map: new Rs.Texture() })), r._text = "".concat(n), r._textHeight = o, r._color = a, r._backgroundColor = !1, r._padding = 0, r._borderWidth = 0, r._borderRadius = 0, r._borderColor = "white", r._strokeWidth = 0, r._strokeColor = "white", r._fontFace = "Arial", r._fontSize = 90, r._fontWeight = "normal", r._canvas = document.createElement("canvas"), r._texture = r.material.map, r._texture.minFilter = Rs.LinearFilter, r._genCanvas(), r; } return Wk(t, [{ key: "text", get: function() { return this._text; }, set: function(r) { this._text = r, this._genCanvas(); } }, { key: "textHeight", get: function() { return this._textHeight; }, set: function(r) { this._textHeight = r, this._genCanvas(); } }, { key: "color", get: function() { return this._color; }, set: function(r) { this._color = r, this._genCanvas(); } }, { key: "backgroundColor", get: function() { return this._backgroundColor; }, set: function(r) { this._backgroundColor = r, this._genCanvas(); } }, { key: "padding", get: function() { return this._padding; }, set: function(r) { this._padding = r, this._genCanvas(); } }, { key: "borderWidth", get: function() { return this._borderWidth; }, set: function(r) { this._borderWidth = r, this._genCanvas(); } }, { key: "borderRadius", get: function() { return this._borderRadius; }, set: function(r) { this._borderRadius = r, this._genCanvas(); } }, { key: "borderColor", get: function() { return this._borderColor; }, set: function(r) { this._borderColor = r, this._genCanvas(); } }, { key: "fontFace", get: function() { return this._fontFace; }, set: function(r) { this._fontFace = r, this._genCanvas(); } }, { key: "fontSize", get: function() { return this._fontSize; }, set: function(r) { this._fontSize = r, this._genCanvas(); } }, { key: "fontWeight", get: function() { return this._fontWeight; }, set: function(r) { this._fontWeight = r, this._genCanvas(); } }, { key: "strokeWidth", get: function() { return this._strokeWidth; }, set: function(r) { this._strokeWidth = r, this._genCanvas(); } }, { key: "strokeColor", get: function() { return this._strokeColor; }, set: function(r) { this._strokeColor = r, this._genCanvas(); } }, { key: "_genCanvas", value: function() { var r = this, n = this._canvas, o = n.getContext("2d"), a = Array.isArray(this.borderWidth) ? this.borderWidth : [this.borderWidth, this.borderWidth], s = a.map(function(x) { return x * r.fontSize * 0.1; }), c = Array.isArray(this.borderRadius) ? this.borderRadius : [this.borderRadius, this.borderRadius, this.borderRadius, this.borderRadius], l = c.map(function(x) { return x * r.fontSize * 0.1; }), h = Array.isArray(this.padding) ? this.padding : [this.padding, this.padding], u = h.map(function(x) { return x * r.fontSize * 0.1; }), p = this.text.split(` `), g = "".concat(this.fontWeight, " ").concat(this.fontSize, "px ").concat(this.fontFace); o.font = g; var m = Math.max.apply(Math, Rc(p.map(function(x) { return o.measureText(x).width; }))), d = this.fontSize * p.length; if (n.width = m + s[0] * 2 + u[0] * 2, n.height = d + s[1] * 2 + u[1] * 2, this.borderWidth) { if (o.strokeStyle = this.borderColor, s[0]) { var y = s[0] / 2; o.lineWidth = s[0], o.beginPath(), o.moveTo(y, l[0]), o.lineTo(y, n.height - l[3]), o.moveTo(n.width - y, l[1]), o.lineTo(n.width - y, n.height - l[2]), o.stroke(); } if (s[1]) { var f = s[1] / 2; o.lineWidth = s[1], o.beginPath(), o.moveTo(Math.max(s[0], l[0]), f), o.lineTo(n.width - Math.max(s[0], l[1]), f), o.moveTo(Math.max(s[0], l[3]), n.height - f), o.lineTo(n.width - Math.max(s[0], l[2]), n.height - f), o.stroke(); } if (this.borderRadius) { var v = Math.max.apply(Math, Rc(s)), M = v / 2; o.lineWidth = v, o.beginPath(), [!!l[0] && [l[0], M, M, l[0]], !!l[1] && [n.width - l[1], n.width - M, M, l[1]], !!l[2] && [n.width - l[2], n.width - M, n.height - M, n.height - l[2]], !!l[3] && [l[3], M, n.height - M, n.height - l[3]]].filter(function(x) { return x; }).forEach(function(x) { var w = Iv(x, 4), A = w[0], _ = w[1], E = w[2], O = w[3]; o.moveTo(A, E), o.quadraticCurveTo(_, E, _, O); }), o.stroke(); } } this.backgroundColor && (o.fillStyle = this.backgroundColor, this.borderRadius ? (o.beginPath(), o.moveTo(s[0], l[0]), [ [s[0], l[0], n.width - l[1], s[1], s[1], s[1]], // t [n.width - s[0], n.width - s[0], n.width - s[0], s[1], l[1], n.height - l[2]], // r [n.width - s[0], n.width - l[2], l[3], n.height - s[1], n.height - s[1], n.height - s[1]], // b [s[0], s[0], s[0], n.height - s[1], n.height - l[3], l[0]] // t ].forEach(function(x) { var w = Iv(x, 6), A = w[0], _ = w[1], E = w[2], O = w[3], L = w[4], C = w[5]; o.quadraticCurveTo(A, O, _, L), o.lineTo(E, C); }), o.closePath(), o.fill()) : o.fillRect(s[0], s[1], n.width - s[0] * 2, n.height - s[1] * 2)), o.translate.apply(o, Rc(s)), o.translate.apply(o, Rc(u)), o.font = g, o.fillStyle = this.color, o.textBaseline = "bottom"; var S = this.strokeWidth > 0; S && (o.lineWidth = this.strokeWidth * this.fontSize / 10, o.strokeStyle = this.strokeColor), p.forEach(function(x, w) { var A = (m - o.measureText(x).width) / 2, _ = (w + 1) * r.fontSize; S && o.strokeText(x, A, _), o.fillText(x, A, _); }), this._texture.image = n, this._texture.needsUpdate = !0; var T = this.textHeight * p.length + a[1] * 2 + h[1] * 2; this.scale.set(T * n.width / n.height, T, 0); } }, { key: "clone", value: function() { return new this.constructor(this.text, this.textHeight, this.color).copy(this); } }, { key: "copy", value: function(r) { return Rs.Sprite.prototype.copy.call(this, r), this.color = r.color, this.backgroundColor = r.backgroundColor, this.padding = r.padding, this.borderWidth = r.borderWidth, this.borderColor = r.borderColor, this.fontFace = r.fontFace, this.fontSize = r.fontSize, this.fontWeight = r.fontWeight, this.strokeWidth = r.strokeWidth, this.strokeColor = r.strokeColor, this; } }]), t; }(Rs.Sprite); const n4 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, default: r4 }, Symbol.toStringTag, { value: "Module" })), o4 = /* @__PURE__ */ xu(n4); var Dv = { exports: {} }, Nv; function a4() { return Nv || (Nv = 1, function(i, e) { (function(t, r) { i.exports = r(); })(typeof window < "u" ? window : Nn, function() { if (typeof window > "u") return null; var t = typeof window < "u" && window.Math == Math ? window : typeof self < "u" && self.Math == Math ? self : Function("return this")(), r = t.requestAnimationFrame || t.mozRequestAnimationFrame || t.webkitRequestAnimationFrame || function(h) { return t.setTimeout(h, 20); }, n = t.cancelAnimationFrame || t.mozCancelAnimationFrame || t.webkitCancelAnimationFrame || function(h) { t.clearTimeout(h); }; function o(h, u) { var p = Object.prototype.toString.call(h), g = p === "[object Array]" || p === "[object NodeList]" || p === "[object HTMLCollection]" || p === "[object Object]" || typeof jQuery < "u" && h instanceof jQuery || typeof Elements < "u" && h instanceof Elements, m = 0, d = h.length; if (g) for (; m < d; m++) u(h[m]); else u(h); } function a(h) { if (!h.getBoundingClientRect) return { width: h.offsetWidth, height: h.offsetHeight }; var u = h.getBoundingClientRect(); return { width: Math.round(u.width), height: Math.round(u.height) }; } function s(h, u) { Object.keys(u).forEach(function(p) { h.style[p] = u[p]; }); } var c = function(h, u) { var p = 0; function g() { var d = []; this.add = function(v) { d.push(v); }; var y, f; this.call = function(v) { for (y = 0, f = d.length; y < f; y++) d[y].call(this, v); }, this.remove = function(v) { var M = []; for (y = 0, f = d.length; y < f; y++) d[y] !== v && M.push(d[y]); d = M; }, this.length = function() { return d.length; }; } function m(d, y) { if (d) { if (d.resizedAttached) { d.resizedAttached.add(y); return; } d.resizedAttached = new g(), d.resizedAttached.add(y), d.resizeSensor = document.createElement("div"), d.resizeSensor.dir = "ltr", d.resizeSensor.className = "resize-sensor"; var f = { pointerEvents: "none", position: "absolute", left: "0px", top: "0px", right: "0px", bottom: "0px", overflow: "hidden", zIndex: "-1", visibility: "hidden", maxWidth: "100%" }, v = { position: "absolute", left: "0px", top: "0px", transition: "0s" }; s(d.resizeSensor, f); var M = document.createElement("div"); M.className = "resize-sensor-expand", s(M, f); var S = document.createElement("div"); s(S, v), M.appendChild(S); var T = document.createElement("div"); T.className = "resize-sensor-shrink", s(T, f); var x = document.createElement("div"); s(x, v), s(x, { width: "200%", height: "200%" }), T.appendChild(x), d.resizeSensor.appendChild(M), d.resizeSensor.appendChild(T), d.appendChild(d.resizeSensor); var w = window.getComputedStyle(d), A = w ? w.getPropertyValue("position") : null; A !== "absolute" && A !== "relative" && A !== "fixed" && A !== "sticky" && (d.style.position = "relative"); var _ = !1, E = 0, O = a(d), L = 0, C = 0, I = !0; p = 0; var R = function() { var k = d.offsetWidth, V = d.offsetHeight; S.style.width = k + 10 + "px", S.style.height = V + 10 + "px", M.scrollLeft = k + 10, M.scrollTop = V + 10, T.scrollLeft = k + 10, T.scrollTop = V + 10; }, b = function() { if (I) { var k = d.offsetWidth === 0 && d.offsetHeight === 0; if (k) { p || (p = r(function() { p = 0, b(); })); return; } else I = !1; } R(); }; d.resizeSensor.resetSensor = b; var P = function() { E = 0, _ && (L = O.width, C = O.height, d.resizedAttached && d.resizedAttached.call(O)); }, N = function() { O = a(d), _ = O.width !== L || O.height !== C, _ && !E && (E = r(P)), b(); }, D = function(k, V, q) { k.attachEvent ? k.attachEvent("on" + V, q) : k.addEventListener(V, q); }; D(M, "scroll", N), D(T, "scroll", N), p = r(function() { p = 0, b(); }); } } o(h, function(d) { m(d, u); }), this.detach = function(d) { p || (n(p), p = 0), c.detach(h, d); }, this.reset = function() { h.resizeSensor.resetSensor(); }; }; if (c.reset = function(h) { o(h, function(u) { u.resizeSensor.resetSensor(); }); }, c.detach = function(h, u) { o(h, function(p) { p && (p.resizedAttached && typeof u == "function" && (p.resizedAttached.remove(u), p.resizedAttached.length()) || p.resizeSensor && (p.contains(p.resizeSensor) && p.removeChild(p.resizeSensor), delete p.resizeSensor, delete p.resizedAttached)); }); }, typeof MutationObserver < "u") { var l = new MutationObserver(function(h) { for (var u in h) if (h.hasOwnProperty(u)) for (var p = h[u].addedNodes, g = 0; g < p.length; g++) p[g].resizeSensor && c.reset(p[g]); }); document.addEventListener("DOMContentLoaded", function(h) { l.observe(document.body, { childList: !0, subtree: !0 }); }); } return c; }); }(Dv)), Dv.exports; } class s4 extends yi { constructor(e) { super(e), this.dracoLoader = null, this.ktx2Loader = null, this.meshoptDecoder = null, this.pluginCallbacks = [], this.register(function(t) { return new h4(t); }), this.register(function(t) { return new p4(t); }), this.register(function(t) { return new f4(t); }), this.register(function(t) { return new d4(t); }), this.register(function(t) { return new c4(t); }), this.register(function(t) { return new m4(t); }); } load(e, t, r, n) { const o = this; let a; this.resourcePath !== "" ? a = this.resourcePath : this.path !== "" ? a = this.path : a = sn.extractUrlBase(e), this.manager.itemStart(e); const s = function(l) { n ? n(l) : console.error(l), o.manager.itemError(e), o.manager.itemEnd(e); }, c = new Yi(this.manager); c.setPath(this.path), c.setResponseType("arraybuffer"), c.setRequestHeader(this.requestHeader), c.setWithCredentials(this.withCredentials), c.load(e, function(l) { try { o.parse(l, a, function(h) { t(h), o.manager.itemEnd(e); }, s); } catch (h) { s(h); } }, r, s); } setDRACOLoader(e) { return this.dracoLoader = e, this; } setDDSLoader() { throw new Error( 'THREE.GLTFLoader: "MSFT_texture_dds" no longer supported. Please update to "KHR_texture_basisu".' ); } setKTX2Loader(e) { return this.ktx2Loader = e, this; } setMeshoptDecoder(e) { return this.meshoptDecoder = e, this; } register(e) { return this.pluginCallbacks.indexOf(e) === -1 && this.pluginCallbacks.push(e), this; } unregister(e) { return this.pluginCallbacks.indexOf(e) !== -1 && this.pluginCallbacks.splice(this.pluginCallbacks.indexOf(e), 1), this; } parse(e, t, r, n) { let o; const a = {}, s = {}; if (typeof e == "string") o = e; else if (sn.decodeText(new Uint8Array(e, 0, 4)) === T1) { try { a[gt.KHR_BINARY_GLTF] = new g4(e); } catch (h) { n && n(h); return; } o = a[gt.KHR_BINARY_GLTF].content; } else o = sn.decodeText(new Uint8Array(e)); const c = JSON.parse(o); if (c.asset === void 0 || c.asset.version[0] < 2) { n && n(new Error("THREE.GLTFLoader: Unsupported asset. glTF versions >=2.0 are supported.")); return; } const l = new E4(c, { path: t || this.resourcePath || "", crossOrigin: this.crossOrigin, requestHeader: this.requestHeader, manager: this.manager, ktx2Loader: this.ktx2Loader, meshoptDecoder: this.meshoptDecoder }); l.fileLoader.setRequestHeader(this.requestHeader); for (let h = 0; h < this.pluginCallbacks.length; h++) { const u = this.pluginCallbacks[h](l); s[u.name] = u, a[u.name] = !0; } if (c.extensionsUsed) for (let h = 0; h < c.extensionsUsed.length; ++h) { const u = c.extensionsUsed[h], p = c.extensionsRequired || []; switch (u) { case gt.KHR_MATERIALS_UNLIT: a[u] = new u4(); break; case gt.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS: a[u] = new b4(); break; case gt.KHR_DRACO_MESH_COMPRESSION: a[u] = new v4(c, this.dracoLoader); break; case gt.KHR_TEXTURE_TRANSFORM: a[u] = new y4(); break; case gt.KHR_MESH_QUANTIZATION: a[u] = new x4(); break; default: p.indexOf(u) >= 0 && s[u] === void 0 && console.warn('THREE.GLTFLoader: Unknown extension "' + u + '".'); } } l.setExtensions(a), l.setPlugins(s), l.parse(r, n); } } function l4() { let i = {}; return { get: function(e) { return i[e]; }, add: function(e, t) { i[e] = t; }, remove: function(e) { delete i[e]; }, removeAll: function() { i = {}; } }; } const gt = { KHR_BINARY_GLTF: "KHR_binary_glTF", KHR_DRACO_MESH_COMPRESSION: "KHR_draco_mesh_compression", KHR_LIGHTS_PUNCTUAL: "KHR_lights_punctual", KHR_MATERIALS_CLEARCOAT: "KHR_materials_clearcoat", KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS: "KHR_materials_pbrSpecularGlossiness", KHR_MATERIALS_TRANSMISSION: "KHR_materials_transmission", KHR_MATERIALS_UNLIT: "KHR_materials_unlit", KHR_TEXTURE_BASISU: "KHR_texture_basisu", KHR_TEXTURE_TRANSFORM: "KHR_texture_transform", KHR_MESH_QUANTIZATION: "KHR_mesh_quantization", EXT_TEXTURE_WEBP: "EXT_texture_webp", EXT_MESHOPT_COMPRESSION: "EXT_meshopt_compression" }; class c4 { constructor(e) { this.parser = e, this.name = gt.KHR_LIGHTS_PUNCTUAL, this.cache = { refs: {}, uses: {} }; } _markDefs() { const e = this.parser, t = this.parser.json.nodes || []; for (let r = 0, n = t.length; r < n; r++) { const o = t[r]; o.extensions && o.extensions[this.name] && o.extensions[this.name].light !== void 0 && e._addNodeRef(this.cache, o.extensions[this.name].light); } } _loadLight(e) { const t = this.parser, r = "light:" + e; let n = t.cache.get(r); if (n) return n; const o = t.json, a = ((o.extensions && o.extensions[this.name] || {}).lights || [])[e]; let s; const c = new Be(16777215); a.color !== void 0 && c.fromArray(a.color); const l = a.range !== void 0 ? a.range : 0; switch (a.type) { case "directional": s = new Hu(c), s.target.position.set(0, 0, -1), s.add(s.target); break; case "point": s = new Gu(c), s.distance = l; break; case "spot": s = new Uu(c), s.distance = l, a.spot = a.spot || {}, a.spot.innerConeAngle = a.spot.innerConeAngle !== void 0 ? a.spot.innerConeAngle : 0, a.spot.outerConeAngle = a.spot.outerConeAngle !== void 0 ? a.spot.outerConeAngle : Math.PI / 4, s.angle = a.spot.outerConeAngle, s.penumbra = 1 - a.spot.innerConeAngle / a.spot.outerConeAngle, s.target.position.set(0, 0, -1), s.add(s.target); break; default: throw new Error("THREE.GLTFLoader: Unexpected light type: " + a.type); } return s.position.set(0, 0, 0), s.decay = 2, a.intensity !== void 0 && (s.intensity = a.intensity), s.name = t.createUniqueName(a.name || "light_" + e), n = Promise.resolve(s), t.cache.add(r, n), n; } createNodeAttachment(e) { const t = this, r = this.parser, n = r.json.nodes[e], o = (n.extensions && n.extensions[this.name] || {}).light; return o === void 0 ? null : this._loadLight(o).then(function(a) { return r._getNodeRef(t.cache, o, a); }); } } class u4 { constructor() { this.name = gt.KHR_MATERIALS_UNLIT; } getMaterialType() { return ki; } extendParams(e, t, r) { const n = []; e.color = new Be(1, 1, 1), e.opacity = 1; const o = t.pbrMetallicRoughness; if (o) { if (Array.isArray(o.baseColorFactor)) { const a = o.baseColorFactor; e.color.fromArray(a), e.opacity = a[3]; } o.baseColorTexture !== void 0 && n.push(r.assignTexture(e, "map", o.baseColorTexture)); } return Promise.all(n); } } class h4 { constructor(e) { this.parser = e, this.name = gt.KHR_MATERIALS_CLEARCOAT; } getMaterialType(e) { const t = this.parser.json.materials[e]; return !t.extensions || !t.extensions[this.name] ? null : Pl; } extendMaterialParams(e, t) { const r = this.parser, n = r.json.materials[e]; if (!n.extensions || !n.extensions[this.name]) return Promise.resolve(); const o = [], a = n.extensions[this.name]; if (a.clearcoatFactor !== void 0 && (t.clearcoat = a.clearcoatFactor), a.clearcoatTexture !== void 0 && o.push(r.assignTexture(t, "clearcoatMap", a.clearcoatTexture)), a.clearcoatRoughnessFactor !== void 0 && (t.clearcoatRoughness = a.clearcoatRoughnessFactor), a.clearcoatRoughnessTexture !== void 0 && o.push(r.assignTexture(t, "clearcoatRoughnessMap", a.clearcoatRoughnessTexture)), a.clearcoatNormalTexture !== void 0 && (o.push(r.assignTexture(t, "clearcoatNormalMap", a.clearcoatNormalTexture)), a.clearcoatNormalTexture.scale !== void 0)) { const s = a.clearcoatNormalTexture.scale; t.clearcoatNormalScale = new Oe(s, -s); } return Promise.all(o); } } class d4 { constructor(e) { this.parser = e, this.name = gt.KHR_MATERIALS_TRANSMISSION; } getMaterialType(e) { const t = this.parser.json.materials[e]; return !t.extensions || !t.extensions[this.name] ? null : Pl; } extendMaterialParams(e, t) { const r = this.parser, n = r.json.materials[e]; if (!n.extensions || !n.extensions[this.name]) return Promise.resolve(); const o = [], a = n.extensions[this.name]; return a.transmissionFactor !== void 0 && (t.transmission = a.transmissionFactor), a.transmissionTexture !== void 0 && o.push(r.assignTexture(t, "transmissionMap", a.transmissionTexture)), Promise.all(o); } } class p4 { constructor(e) { this.parser = e, this.name = gt.KHR_TEXTURE_BASISU; } loadTexture(e) { const t = this.parser, r = t.json, n = r.textures[e]; if (!n.extensions || !n.extensions[this.name]) return null; const o = n.extensions[this.name], a = r.images[o.source], s = t.options.ktx2Loader; if (!s) { if (r.extensionsRequired && r.extensionsRequired.indexOf(this.name) >= 0) throw new Error("THREE.GLTFLoader: setKTX2Loader must be called before loading KTX2 textures"); return null; } return t.loadTextureImage(e, a, s); } } class f4 { constructor(e) { this.parser = e, this.name = gt.EXT_TEXTURE_WEBP, this.isSupported = null; } loadTexture(e) { const t = this.name, r = this.parser, n = r.json, o = n.textures[e]; if (!o.extensions || !o.extensions[t]) return null; const a = o.extensions[t], s = n.images[a.source]; let c = r.textureLoader; if (s.uri) { const l = r.options.manager.getHandler(s.uri); l !== null && (c = l); } return this.detectSupport().then(function(l) { if (l) return r.loadTextureImage(e, s, c); if (n.extensionsRequired && n.extensionsRequired.indexOf(t) >= 0) throw new Error("THREE.GLTFLoader: WebP required by asset but unsupported."); return r.loadTexture(e); }); } detectSupport() { return this.isSupported || (this.isSupported = new Promise(function(e) { const t = new Image(); t.src = "data:image/webp;base64,UklGRiIAAABXRUJQVlA4IBYAAAAwAQCdASoBAAEADsD+JaQAA3AAAAAA", t.onload = t.onerror = function() { e(t.height === 1); }; })), this.isSupported; } } class m4 { constructor(e) { this.name = gt.EXT_MESHOPT_COMPRESSION, this.parser = e; } loadBufferView(e) { const t = this.parser.json, r = t.bufferViews[e]; if (r.extensions && r.extensions[this.name]) { const n = r.extensions[this.name], o = this.parser.getDependency("buffer", n.buffer), a = this.parser.options.meshoptDecoder; if (!a || !a.supported) { if (t.extensionsRequired && t.extensionsRequired.indexOf(this.name) >= 0) throw new Error("THREE.GLTFLoader: setMeshoptDecoder must be called before loading compressed files"); return null; } return Promise.all([o, a.ready]).then(function(s) { const c = n.byteOffset || 0, l = n.byteLength || 0, h = n.count, u = n.byteStride, p = new ArrayBuffer(h * u), g = new Uint8Array(s[0], c, l); return a.decodeGltfBuffer(new Uint8Array(p), h, u, g, n.mode, n.filter), p; }); } else return null; } } const T1 = "glTF", Os = 12, Bv = { JSON: 1313821514, BIN: 5130562 }; class g4 { constructor(e) { this.name = gt.KHR_BINARY_GLTF, this.content = null, this.body = null; const t = new DataView(e, 0, Os); if (this.header = { magic: sn.decodeText(new Uint8Array(e.slice(0, 4))), version: t.getUint32(4, !0), length: t.getUint32(8, !0) }, this.header.magic !== T1) throw new Error("THREE.GLTFLoader: Unsupported glTF-Binary header."); if (this.header.version < 2) throw new Error("THREE.GLTFLoader: Legacy binary file detected."); const r = this.header.length - Os, n = new DataView(e, Os); let o = 0; for (; o < r; ) { const a = n.getUint32(o, !0); o += 4; const s = n.getUint32(o, !0); if (o += 4, s === Bv.JSON) { const c = new Uint8Array(e, Os + o, a); this.content = sn.decodeText(c); } else if (s === Bv.BIN) { const c = Os + o; this.body = e.slice(c, c + a); } o += a; } if (this.content === null) throw new Error("THREE.GLTFLoader: JSON content not found."); } } class v4 { constructor(e, t) { if (!t) throw new Error("THREE.GLTFLoader: No DRACOLoader instance provided."); this.name = gt.KHR_DRACO_MESH_COMPRESSION, this.json = e, this.dracoLoader = t, this.dracoLoader.preload(); } decodePrimitive(e, t) { const r = this.json, n = this.dracoLoader, o = e.extensions[this.name].bufferView, a = e.extensions[this.name].attributes, s = {}, c = {}, l = {}; for (const h in a) { const u = jd[h] || h.toLowerCase(); s[u] = a[h]; } for (const h in e.attributes) { const u = jd[h] || h.toLowerCase(); if (a[h] !== void 0) { const p = r.accessors[e.attributes[h]], g = ll[p.componentType]; l[u] = g, c[u] = p.normalized === !0; } } return t.getDependency("bufferView", o).then(function(h) { return new Promise(function(u) { n.decodeDracoFile(h, function(p) { for (const g in p.attributes) { const m = p.attributes[g], d = c[g]; d !== void 0 && (m.normalized = d); } u(p); }, s, l); }); }); } } class y4 { constructor() { this.name = gt.KHR_TEXTURE_TRANSFORM; } extendTexture(e, t) { return t.texCoord !== void 0 && console.warn('THREE.GLTFLoader: Custom UV sets in "' + this.name + '" extension not yet supported.'), t.offset === void 0 && t.rotation === void 0 && t.scale === void 0 || (e = e.clone(), t.offset !== void 0 && e.offset.fromArray(t.offset), t.rotation !== void 0 && (e.rotation = t.rotation), t.scale !== void 0 && e.repeat.fromArray(t.scale), e.needsUpdate = !0), e; } } class Hd extends $o { constructor(e) { super(), this.isGLTFSpecularGlossinessMaterial = !0; const t = [ "#ifdef USE_SPECULARMAP", " uniform sampler2D specularMap;", "#endif" ].join(` `), r = [ "#ifdef USE_GLOSSINESSMAP", " uniform sampler2D glossinessMap;", "#endif" ].join(` `), n = [ "vec3 specularFactor = specular;", "#ifdef USE_SPECULARMAP", " vec4 texelSpecular = texture2D( specularMap, vUv );", " texelSpecular = sRGBToLinear( texelSpecular );", " // reads channel RGB, compatible with a glTF Specular-Glossiness (RGBA) texture", " specularFactor *= texelSpecular.rgb;", "#endif" ].join(` `), o = [ "float glossinessFactor = glossiness;", "#ifdef USE_GLOSSINESSMAP", " vec4 texelGlossiness = texture2D( glossinessMap, vUv );", " // reads channel A, compatible with a glTF Specular-Glossiness (RGBA) texture", " glossinessFactor *= texelGlossiness.a;", "#endif" ].join(` `), a = [ "PhysicalMaterial material;", "material.diffuseColor = diffuseColor.rgb * ( 1. - max( specularFactor.r, max( specularFactor.g, specularFactor.b ) ) );", "vec3 dxy = max( abs( dFdx( geometryNormal ) ), abs( dFdy( geometryNormal ) ) );", "float geometryRoughness = max( max( dxy.x, dxy.y ), dxy.z );", "material.specularRoughness = max( 1.0 - glossinessFactor, 0.0525 ); // 0.0525 corresponds to the base mip of a 256 cubemap.", "material.specularRoughness += geometryRoughness;", "material.specularRoughness = min( material.specularRoughness, 1.0 );", "material.specularColor = specularFactor;" ].join(` `), s = { specular: { value: new Be().setHex(16777215) }, glossiness: { value: 1 }, specularMap: { value: null }, glossinessMap: { value: null } }; this._extraUniforms = s, this.onBeforeCompile = function(c) { for (const l in s) c.uniforms[l] = s[l]; c.fragmentShader = c.fragmentShader.replace("uniform float roughness;", "uniform vec3 specular;").replace("uniform float metalness;", "uniform float glossiness;").replace("#include ", t).replace("#include ", r).replace("#include ", n).replace("#include ", o).replace("#include ", a); }, Object.defineProperties(this, { specular: { get: function() { return s.specular.value; }, set: function(c) { s.specular.value = c; } }, specularMap: { get: function() { return s.specularMap.value; }, set: function(c) { s.specularMap.value = c, c ? this.defines.USE_SPECULARMAP = "" : delete this.defines.USE_SPECULARMAP; } }, glossiness: { get: function() { return s.glossiness.value; }, set: function(c) { s.glossiness.value = c; } }, glossinessMap: { get: function() { return s.glossinessMap.value; }, set: function(c) { s.glossinessMap.value = c, c ? (this.defines.USE_GLOSSINESSMAP = "", this.defines.USE_UV = "") : (delete this.defines.USE_GLOSSINESSMAP, delete this.defines.USE_UV); } } }), delete this.metalness, delete this.roughness, delete this.metalnessMap, delete this.roughnessMap, this.setValues(e); } copy(e) { return super.copy(e), this.specularMap = e.specularMap, this.specular.copy(e.specular), this.glossinessMap = e.glossinessMap, this.glossiness = e.glossiness, delete this.metalness, delete this.roughness, delete this.metalnessMap, delete this.roughnessMap, this; } } class b4 { constructor() { this.name = gt.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS, this.specularGlossinessParams = [ "color", "map", "lightMap", "lightMapIntensity", "aoMap", "aoMapIntensity", "emissive", "emissiveIntensity", "emissiveMap", "bumpMap", "bumpScale", "normalMap", "normalMapType", "displacementMap", "displacementScale", "displacementBias", "specularMap", "specular", "glossinessMap", "glossiness", "alphaMap", "envMap", "envMapIntensity", "refractionRatio" ]; } getMaterialType() { return Hd; } extendParams(e, t, r) { const n = t.extensions[this.name]; e.color = new Be(1, 1, 1), e.opacity = 1; const o = []; if (Array.isArray(n.diffuseFactor)) { const a = n.diffuseFactor; e.color.fromArray(a), e.opacity = a[3]; } if (n.diffuseTexture !== void 0 && o.push(r.assignTexture(e, "map", n.diffuseTexture)), e.emissive = new Be(0, 0, 0), e.glossiness = n.glossinessFactor !== void 0 ? n.glossinessFactor : 1, e.specular = new Be(1, 1, 1), Array.isArray(n.specularFactor) && e.specular.fromArray(n.specularFactor), n.specularGlossinessTexture !== void 0) { const a = n.specularGlossinessTexture; o.push(r.assignTexture(e, "glossinessMap", a)), o.push(r.assignTexture(e, "specularMap", a)); } return Promise.all(o); } createMaterial(e) { const t = new Hd(e); return t.fog = !0, t.color = e.color, t.map = e.map === void 0 ? null : e.map, t.lightMap = null, t.lightMapIntensity = 1, t.aoMap = e.aoMap === void 0 ? null : e.aoMap, t.aoMapIntensity = 1, t.emissive = e.emissive, t.emissiveIntensity = 1, t.emissiveMap = e.emissiveMap === void 0 ? null : e.emissiveMap, t.bumpMap = e.bumpMap === void 0 ? null : e.bumpMap, t.bumpScale = 1, t.normalMap = e.normalMap === void 0 ? null : e.normalMap, t.normalMapType = eo, e.normalScale && (t.normalScale = e.normalScale), t.displacementMap = null, t.displacementScale = 1, t.displacementBias = 0, t.specularMap = e.specularMap === void 0 ? null : e.specularMap, t.specular = e.specular, t.glossinessMap = e.glossinessMap === void 0 ? null : e.glossinessMap, t.glossiness = e.glossiness, t.alphaMap = null, t.envMap = e.envMap === void 0 ? null : e.envMap, t.envMapIntensity = 1, t.refractionRatio = 0.98, t; } } class x4 { constructor() { this.name = gt.KHR_MESH_QUANTIZATION; } } class es extends Fr { constructor(e, t, r, n) { super(e, t, r, n); } copySampleValue_(e) { const t = this.resultBuffer, r = this.sampleValues, n = this.valueSize, o = e * n * 3 + n; for (let a = 0; a !== n; a++) t[a] = r[o + a]; return t; } } es.prototype.beforeStart_ = es.prototype.copySampleValue_; es.prototype.afterEnd_ = es.prototype.copySampleValue_; es.prototype.interpolate_ = function(i, e, t, r) { const n = this.resultBuffer, o = this.sampleValues, a = this.valueSize, s = a * 2, c = a * 3, l = r - e, h = (t - e) / l, u = h * h, p = u * h, g = i * c, m = g - c, d = -2 * p + 3 * u, y = p - u, f = 1 - d, v = y - u + h; for (let M = 0; M !== a; M++) { const S = o[m + M + a], T = o[m + M + s] * l, x = o[g + M + a], w = o[g + M] * l; n[M] = f * S + v * T + d * x + y * w; } return n; }; const Zr = { FLOAT: 5126, //FLOAT_MAT2: 35674, FLOAT_MAT3: 35675, FLOAT_MAT4: 35676, FLOAT_VEC2: 35664, FLOAT_VEC3: 35665, FLOAT_VEC4: 35666, LINEAR: 9729, REPEAT: 10497, SAMPLER_2D: 35678, POINTS: 0, LINES: 1, LINE_LOOP: 2, LINE_STRIP: 3, TRIANGLES: 4, TRIANGLE_STRIP: 5, TRIANGLE_FAN: 6, UNSIGNED_BYTE: 5121, UNSIGNED_SHORT: 5123 }, ll = { 5120: Int8Array, 5121: Uint8Array, 5122: Int16Array, 5123: Uint16Array, 5125: Uint32Array, 5126: Float32Array }, kv = { 9728: qt, 9729: Ut, 9984: Ks, 9985: Tu, 9986: Qs, 9987: yn }, zv = { 33071: li, 33648: Na, 10497: Zn }, Fv = { SCALAR: 1, VEC2: 2, VEC3: 3, VEC4: 4, MAT2: 4, MAT3: 9, MAT4: 16 }, jd = { POSITION: "position", NORMAL: "normal", TANGENT: "tangent", TEXCOORD_0: "uv", TEXCOORD_1: "uv2", COLOR_0: "color", WEIGHTS_0: "skinWeight", JOINTS_0: "skinIndex" }, Rn = { scale: "scale", translation: "position", rotation: "quaternion", weights: "morphTargetInfluences" }, w4 = { CUBICSPLINE: void 0, // We use a custom interpolant (GLTFCubicSplineInterpolation) for CUBICSPLINE tracks. Each // keyframe track will be initialized with a default interpolation type, then modified. LINEAR: Io, STEP: ka }, Gh = { OPAQUE: "OPAQUE", MASK: "MASK", BLEND: "BLEND" }; function Vv(i, e) { return typeof i != "string" || i === "" ? "" : (/^https?:\/\//i.test(e) && /^\//.test(i) && (e = e.replace(/(^https?:\/\/[^\/]+).*/i, "$1")), /^(https?:)?\/\//i.test(i) || /^data:.*,.*$/i.test(i) || /^blob:.*$/i.test(i) ? i : e + i); } function _4(i) { return i.DefaultMaterial === void 0 && (i.DefaultMaterial = new $o({ color: 16777215, emissive: 0, metalness: 1, roughness: 1, transparent: !1, depthTest: !0, side: qn })), i.DefaultMaterial; } function Ps(i, e, t) { for (const r in t.extensions) i[r] === void 0 && (e.userData.gltfExtensions = e.userData.gltfExtensions || {}, e.userData.gltfExtensions[r] = t.extensions[r]); } function yo(i, e) { e.extras !== void 0 && (typeof e.extras == "object" ? Object.assign(i.userData, e.extras) : console.warn("THREE.GLTFLoader: Ignoring primitive type .extras, " + e.extras)); } function M4(i, e, t) { let r = !1, n = !1; for (let s = 0, c = e.length; s < c; s++) { const l = e[s]; if (l.POSITION !== void 0 && (r = !0), l.NORMAL !== void 0 && (n = !0), r && n) break; } if (!r && !n) return Promise.resolve(i); const o = [], a = []; for (let s = 0, c = e.length; s < c; s++) { const l = e[s]; if (r) { const h = l.POSITION !== void 0 ? t.getDependency("accessor", l.POSITION) : i.attributes.position; o.push(h); } if (n) { const h = l.NORMAL !== void 0 ? t.getDependency("accessor", l.NORMAL) : i.attributes.normal; a.push(h); } } return Promise.all([ Promise.all(o), Promise.all(a) ]).then(function(s) { const c = s[0], l = s[1]; return r && (i.morphAttributes.position = c), n && (i.morphAttributes.normal = l), i.morphTargetsRelative = !0, i; }); } function S4(i, e) { if (i.updateMorphTargets(), e.weights !== void 0) for (let t = 0, r = e.weights.length; t < r; t++) i.morphTargetInfluences[t] = e.weights[t]; if (e.extras && Array.isArray(e.extras.targetNames)) { const t = e.extras.targetNames; if (i.morphTargetInfluences.length === t.length) { i.morphTargetDictionary = {}; for (let r = 0, n = t.length; r < n; r++) i.morphTargetDictionary[t[r]] = r; } else console.warn("THREE.GLTFLoader: Invalid extras.targetNames length. Ignoring names."); } } function T4(i) { const e = i.extensions && i.extensions[gt.KHR_DRACO_MESH_COMPRESSION]; let t; return e ? t = "draco:" + e.bufferView + ":" + e.indices + ":" + Uv(e.attributes) : t = i.indices + ":" + Uv(i.attributes) + ":" + i.mode, t; } function Uv(i) { let e = ""; const t = Object.keys(i).sort(); for (let r = 0, n = t.length; r < n; r++) e += t[r] + ":" + i[t[r]] + ";"; return e; } function Wd(i) { switch (i) { case Int8Array: return 1 / 127; case Uint8Array: return 1 / 255; case Int16Array: return 1 / 32767; case Uint16Array: return 1 / 65535; default: throw new Error("THREE.GLTFLoader: Unsupported normalized accessor component type."); } } class E4 { constructor(e = {}, t = {}) { this.json = e, this.extensions = {}, this.plugins = {}, this.options = t, this.cache = new l4(), this.associations = /* @__PURE__ */ new Map(), this.primitiveCache = {}, this.meshCache = { refs: {}, uses: {} }, this.cameraCache = { refs: {}, uses: {} }, this.lightCache = { refs: {}, uses: {} }, this.textureCache = {}, this.nodeNamesUsed = {}, typeof createImageBitmap < "u" && /Firefox/.test(navigator.userAgent) === !1 ? this.textureLoader = new Cf(this.options.manager) : this.textureLoader = new xf(this.options.manager), this.textureLoader.setCrossOrigin(this.options.crossOrigin), this.textureLoader.setRequestHeader(this.options.requestHeader), this.fileLoader = new Yi(this.options.manager), this.fileLoader.setResponseType("arraybuffer"), this.options.crossOrigin === "use-credentials" && this.fileLoader.setWithCredentials(!0); } setExtensions(e) { this.extensions = e; } setPlugins(e) { this.plugins = e; } parse(e, t) { const r = this, n = this.json, o = this.extensions; this.cache.removeAll(), this._invokeAll(function(a) { return a._markDefs && a._markDefs(); }), Promise.all(this._invokeAll(function(a) { return a.beforeRoot && a.beforeRoot(); })).then(function() { return Promise.all([ r.getDependencies("scene"), r.getDependencies("animation"), r.getDependencies("camera") ]); }).then(function(a) { const s = { scene: a[0][n.scene || 0], scenes: a[0], animations: a[1], cameras: a[2], asset: n.asset, parser: r, userData: {} }; Ps(o, s, n), yo(s, n), Promise.all(r._invokeAll(function(c) { return c.afterRoot && c.afterRoot(s); })).then(function() { e(s); }); }).catch(t); } /** * Marks the special nodes/meshes in json for efficient parse. */ _markDefs() { const e = this.json.nodes || [], t = this.json.skins || [], r = this.json.meshes || []; for (let n = 0, o = t.length; n < o; n++) { const a = t[n].joints; for (let s = 0, c = a.length; s < c; s++) e[a[s]].isBone = !0; } for (let n = 0, o = e.length; n < o; n++) { const a = e[n]; a.mesh !== void 0 && (this._addNodeRef(this.meshCache, a.mesh), a.skin !== void 0 && (r[a.mesh].isSkinnedMesh = !0)), a.camera !== void 0 && this._addNodeRef(this.cameraCache, a.camera); } } /** * Counts references to shared node / Object3D resources. These resources * can be reused, or "instantiated", at multiple nodes in the scene * hierarchy. Mesh, Camera, and Light instances are instantiated and must * be marked. Non-scenegraph resources (like Materials, Geometries, and * Textures) can be reused directly and are not marked here. * * Example: CesiumMilkTruck sample model reuses "Wheel" meshes. */ _addNodeRef(e, t) { t !== void 0 && (e.refs[t] === void 0 && (e.refs[t] = e.uses[t] = 0), e.refs[t]++); } /** Returns a reference to a shared resource, cloning it if necessary. */ _getNodeRef(e, t, r) { if (e.refs[t] <= 1) return r; const n = r.clone(); return n.name += "_instance_" + e.uses[t]++, n; } _invokeOne(e) { const t = Object.values(this.plugins); t.push(this); for (let r = 0; r < t.length; r++) { const n = e(t[r]); if (n) return n; } return null; } _invokeAll(e) { const t = Object.values(this.plugins); t.unshift(this); const r = []; for (let n = 0; n < t.length; n++) { const o = e(t[n]); o && r.push(o); } return r; } /** * Requests the specified dependency asynchronously, with caching. * @param {string} type * @param {number} index * @return {Promise} */ getDependency(e, t) { const r = e + ":" + t; let n = this.cache.get(r); if (!n) { switch (e) { case "scene": n = this.loadScene(t); break; case "node": n = this.loadNode(t); break; case "mesh": n = this._invokeOne(function(o) { return o.loadMesh && o.loadMesh(t); }); break; case "accessor": n = this.loadAccessor(t); break; case "bufferView": n = this._invokeOne(function(o) { return o.loadBufferView && o.loadBufferView(t); }); break; case "buffer": n = this.loadBuffer(t); break; case "material": n = this._invokeOne(function(o) { return o.loadMaterial && o.loadMaterial(t); }); break; case "texture": n = this._invokeOne(function(o) { return o.loadTexture && o.loadTexture(t); }); break; case "skin": n = this.loadSkin(t); break; case "animation": n = this.loadAnimation(t); break; case "camera": n = this.loadCamera(t); break; default: throw new Error("Unknown type: " + e); } this.cache.add(r, n); } return n; } /** * Requests all dependencies of the specified type asynchronously, with caching. * @param {string} type * @return {Promise>} */ getDependencies(e) { let t = this.cache.get(e); if (!t) { const r = this, n = this.json[e + (e === "mesh" ? "es" : "s")] || []; t = Promise.all(n.map(function(o, a) { return r.getDependency(e, a); })), this.cache.add(e, t); } return t; } /** * Specification: https://github.com/KhronosGroup/glTF/blob/master/specification/2.0/README.md#buffers-and-buffer-views * @param {number} bufferIndex * @return {Promise} */ loadBuffer(e) { const t = this.json.buffers[e], r = this.fileLoader; if (t.type && t.type !== "arraybuffer") throw new Error("THREE.GLTFLoader: " + t.type + " buffer type is not supported."); if (t.uri === void 0 && e === 0) return Promise.resolve(this.extensions[gt.KHR_BINARY_GLTF].body); const n = this.options; return new Promise(function(o, a) { r.load(Vv(t.uri, n.path), o, void 0, function() { a(new Error('THREE.GLTFLoader: Failed to load buffer "' + t.uri + '".')); }); }); } /** * Specification: https://github.com/KhronosGroup/glTF/blob/master/specification/2.0/README.md#buffers-and-buffer-views * @param {number} bufferViewIndex * @return {Promise} */ loadBufferView(e) { const t = this.json.bufferViews[e]; return this.getDependency("buffer", t.buffer).then(function(r) { const n = t.byteLength || 0, o = t.byteOffset || 0; return r.slice(o, o + n); }); } /** * Specification: https://github.com/KhronosGroup/glTF/blob/master/specification/2.0/README.md#accessors * @param {number} accessorIndex * @return {Promise} */ loadAccessor(e) { const t = this, r = this.json, n = this.json.accessors[e]; if (n.bufferView === void 0 && n.sparse === void 0) return Promise.resolve(null); const o = []; return n.bufferView !== void 0 ? o.push(this.getDependency("bufferView", n.bufferView)) : o.push(null), n.sparse !== void 0 && (o.push(this.getDependency("bufferView", n.sparse.indices.bufferView)), o.push(this.getDependency("bufferView", n.sparse.values.bufferView))), Promise.all(o).then(function(a) { const s = a[0], c = Fv[n.type], l = ll[n.componentType], h = l.BYTES_PER_ELEMENT, u = h * c, p = n.byteOffset || 0, g = n.bufferView !== void 0 ? r.bufferViews[n.bufferView].byteStride : void 0, m = n.normalized === !0; let d, y; if (g && g !== u) { const f = Math.floor(p / g), v = "InterleavedBuffer:" + n.bufferView + ":" + n.componentType + ":" + f + ":" + n.count; let M = t.cache.get(v); M || (d = new l(s, f * g, n.count * g / h), M = new ro(d, g / h), t.cache.add(v, M)), y = new dn(M, c, p % g / h, m); } else s === null ? d = new l(n.count * c) : d = new l(s, p, n.count * c), y = new tt(d, c, m); if (n.sparse !== void 0) { const f = Fv.SCALAR, v = ll[n.sparse.indices.componentType], M = n.sparse.indices.byteOffset || 0, S = n.sparse.values.byteOffset || 0, T = new v(a[1], M, n.sparse.count * f), x = new l(a[2], S, n.sparse.count * c); s !== null && (y = new tt(y.array.slice(), y.itemSize, y.normalized)); for (let w = 0, A = T.length; w < A; w++) { const _ = T[w]; if (y.setX(_, x[w * c]), c >= 2 && y.setY(_, x[w * c + 1]), c >= 3 && y.setZ(_, x[w * c + 2]), c >= 4 && y.setW(_, x[w * c + 3]), c >= 5) throw new Error("THREE.GLTFLoader: Unsupported itemSize in sparse BufferAttribute."); } } return y; }); } /** * Specification: https://github.com/KhronosGroup/glTF/tree/master/specification/2.0#textures * @param {number} textureIndex * @return {Promise} */ loadTexture(e) { const t = this.json, r = this.options, n = t.textures[e], o = t.images[n.source]; let a = this.textureLoader; if (o.uri) { const s = r.manager.getHandler(o.uri); s !== null && (a = s); } return this.loadTextureImage(e, o, a); } loadTextureImage(e, t, r) { const n = this, o = this.json, a = this.options, s = o.textures[e], c = (t.uri || t.bufferView) + ":" + s.sampler; if (this.textureCache[c]) return this.textureCache[c]; const l = self.URL || self.webkitURL; let h = t.uri || "", u = !1, p = !0; const g = h.search(/\.jpe?g($|\?)/i) > 0 || h.search(/^data\:image\/jpeg/) === 0; if ((t.mimeType === "image/jpeg" || g) && (p = !1), t.bufferView !== void 0) h = n.getDependency("bufferView", t.bufferView).then(function(d) { if (t.mimeType === "image/png") { const f = new DataView(d, 25, 1).getUint8(0, !1); p = f === 6 || f === 4 || f === 3; } u = !0; const y = new Blob([d], { type: t.mimeType }); return h = l.createObjectURL(y), h; }); else if (t.uri === void 0) throw new Error("THREE.GLTFLoader: Image " + e + " is missing URI and bufferView"); const m = Promise.resolve(h).then(function(d) { return new Promise(function(y, f) { let v = y; r.isImageBitmapLoader === !0 && (v = function(M) { const S = new Jt(M); S.needsUpdate = !0, y(S); }), r.load(Vv(d, a.path), v, void 0, f); }); }).then(function(d) { u === !0 && l.revokeObjectURL(h), d.flipY = !1, s.name && (d.name = s.name), p || (d.format = an); const y = (o.samplers || {})[s.sampler] || {}; return d.magFilter = kv[y.magFilter] || Ut, d.minFilter = kv[y.minFilter] || yn, d.wrapS = zv[y.wrapS] || Zn, d.wrapT = zv[y.wrapT] || Zn, n.associations.set(d, { type: "textures", index: e }), d; }).catch(function() { return console.error("THREE.GLTFLoader: Couldn't load texture", h), null; }); return this.textureCache[c] = m, m; } /** * Asynchronously assigns a texture to the given material parameters. * @param {Object} materialParams * @param {string} mapName * @param {Object} mapDef * @return {Promise} */ assignTexture(e, t, r) { const n = this; return this.getDependency("texture", r.index).then(function(o) { if (r.texCoord !== void 0 && r.texCoord != 0 && !(t === "aoMap" && r.texCoord == 1) && console.warn("THREE.GLTFLoader: Custom UV set " + r.texCoord + " for texture " + t + " not yet supported."), n.extensions[gt.KHR_TEXTURE_TRANSFORM]) { const a = r.extensions !== void 0 ? r.extensions[gt.KHR_TEXTURE_TRANSFORM] : void 0; if (a) { const s = n.associations.get(o); o = n.extensions[gt.KHR_TEXTURE_TRANSFORM].extendTexture(o, a), n.associations.set(o, s); } } e[t] = o; }); } /** * Assigns final material to a Mesh, Line, or Points instance. The instance * already has a material (generated from the glTF material options alone) * but reuse of the same glTF material may require multiple threejs materials * to accommodate different primitive types, defines, etc. New materials will * be created if necessary, and reused from a cache. * @param {Object3D} mesh Mesh, Line, or Points instance. */ assignFinalMaterial(e) { const t = e.geometry; let r = e.material; const n = t.attributes.tangent !== void 0, o = t.attributes.color !== void 0, a = t.attributes.normal === void 0, s = Object.keys(t.morphAttributes).length > 0, c = s && t.morphAttributes.normal !== void 0; if (e.isPoints) { const l = "PointsMaterial:" + r.uuid; let h = this.cache.get(l); h || (h = new no(), Qt.prototype.copy.call(h, r), h.color.copy(r.color), h.map = r.map, h.sizeAttenuation = !1, this.cache.add(l, h)), r = h; } else if (e.isLine) { const l = "LineBasicMaterial:" + r.uuid; let h = this.cache.get(l); h || (h = new ni(), Qt.prototype.copy.call(h, r), h.color.copy(r.color), this.cache.add(l, h)), r = h; } if (n || o || a || s) { let l = "ClonedMaterial:" + r.uuid + ":"; r.isGLTFSpecularGlossinessMaterial && (l += "specular-glossiness:"), n && (l += "vertex-tangents:"), o && (l += "vertex-colors:"), a && (l += "flat-shading:"), s && (l += "morph-targets:"), c && (l += "morph-normals:"); let h = this.cache.get(l); h || (h = r.clone(), o && (h.vertexColors = !0), a && (h.flatShading = !0), s && (h.morphTargets = !0), c && (h.morphNormals = !0), n && (h.vertexTangents = !0, h.normalScale && (h.normalScale.y *= -1), h.clearcoatNormalScale && (h.clearcoatNormalScale.y *= -1)), this.cache.add(l, h), this.associations.set(h, this.associations.get(r))), r = h; } r.aoMap && t.attributes.uv2 === void 0 && t.attributes.uv !== void 0 && t.setAttribute("uv2", t.attributes.uv), e.material = r; } getMaterialType() { return $o; } /** * Specification: https://github.com/KhronosGroup/glTF/blob/master/specification/2.0/README.md#materials * @param {number} materialIndex * @return {Promise} */ loadMaterial(e) { const t = this, r = this.json, n = this.extensions, o = r.materials[e]; let a; const s = {}, c = o.extensions || {}, l = []; if (c[gt.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS]) { const u = n[gt.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS]; a = u.getMaterialType(), l.push(u.extendParams(s, o, t)); } else if (c[gt.KHR_MATERIALS_UNLIT]) { const u = n[gt.KHR_MATERIALS_UNLIT]; a = u.getMaterialType(), l.push(u.extendParams(s, o, t)); } else { const u = o.pbrMetallicRoughness || {}; if (s.color = new Be(1, 1, 1), s.opacity = 1, Array.isArray(u.baseColorFactor)) { const p = u.baseColorFactor; s.color.fromArray(p), s.opacity = p[3]; } u.baseColorTexture !== void 0 && l.push(t.assignTexture(s, "map", u.baseColorTexture)), s.metalness = u.metallicFactor !== void 0 ? u.metallicFactor : 1, s.roughness = u.roughnessFactor !== void 0 ? u.roughnessFactor : 1, u.metallicRoughnessTexture !== void 0 && (l.push(t.assignTexture(s, "metalnessMap", u.metallicRoughnessTexture)), l.push(t.assignTexture(s, "roughnessMap", u.metallicRoughnessTexture))), a = this._invokeOne(function(p) { return p.getMaterialType && p.getMaterialType(e); }), l.push(Promise.all(this._invokeAll(function(p) { return p.extendMaterialParams && p.extendMaterialParams(e, s); }))); } o.doubleSided === !0 && (s.side = Xn); const h = o.alphaMode || Gh.OPAQUE; return h === Gh.BLEND ? (s.transparent = !0, s.depthWrite = !1) : (s.transparent = !1, h === Gh.MASK && (s.alphaTest = o.alphaCutoff !== void 0 ? o.alphaCutoff : 0.5)), o.normalTexture !== void 0 && a !== ki && (l.push(t.assignTexture(s, "normalMap", o.normalTexture)), s.normalScale = new Oe(1, -1), o.normalTexture.scale !== void 0 && s.normalScale.set(o.normalTexture.scale, -o.normalTexture.scale)), o.occlusionTexture !== void 0 && a !== ki && (l.push(t.assignTexture(s, "aoMap", o.occlusionTexture)), o.occlusionTexture.strength !== void 0 && (s.aoMapIntensity = o.occlusionTexture.strength)), o.emissiveFactor !== void 0 && a !== ki && (s.emissive = new Be().fromArray(o.emissiveFactor)), o.emissiveTexture !== void 0 && a !== ki && l.push(t.assignTexture(s, "emissiveMap", o.emissiveTexture)), Promise.all(l).then(function() { let u; return a === Hd ? u = n[gt.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS].createMaterial(s) : u = new a(s), o.name && (u.name = o.name), u.map && (u.map.encoding = Do), u.emissiveMap && (u.emissiveMap.encoding = Do), yo(u, o), t.associations.set(u, { type: "materials", index: e }), o.extensions && Ps(n, u, o), u; }); } /** When Object3D instances are targeted by animation, they need unique names. */ createUniqueName(e) { const t = ft.sanitizeNodeName(e || ""); let r = t; for (let n = 1; this.nodeNamesUsed[r]; ++n) r = t + "_" + n; return this.nodeNamesUsed[r] = !0, r; } /** * Specification: https://github.com/KhronosGroup/glTF/blob/master/specification/2.0/README.md#geometry * * Creates BufferGeometries from primitives. * * @param {Array} primitives * @return {Promise>} */ loadGeometries(e) { const t = this, r = this.extensions, n = this.primitiveCache; function o(s) { return r[gt.KHR_DRACO_MESH_COMPRESSION].decodePrimitive(s, t).then(function(c) { return Gv(c, s, t); }); } const a = []; for (let s = 0, c = e.length; s < c; s++) { const l = e[s], h = T4(l), u = n[h]; if (u) a.push(u.promise); else { let p; l.extensions && l.extensions[gt.KHR_DRACO_MESH_COMPRESSION] ? p = o(l) : p = Gv(new Je(), l, t), n[h] = { primitive: l, promise: p }, a.push(p); } } return Promise.all(a); } /** * Specification: https://github.com/KhronosGroup/glTF/blob/master/specification/2.0/README.md#meshes * @param {number} meshIndex * @return {Promise} */ loadMesh(e) { const t = this, r = this.json, n = this.extensions, o = r.meshes[e], a = o.primitives, s = []; for (let c = 0, l = a.length; c < l; c++) { const h = a[c].material === void 0 ? _4(this.cache) : this.getDependency("material", a[c].material); s.push(h); } return s.push(t.loadGeometries(a)), Promise.all(s).then(function(c) { const l = c.slice(0, c.length - 1), h = c[c.length - 1], u = []; for (let g = 0, m = h.length; g < m; g++) { const d = h[g], y = a[g]; let f; const v = l[g]; if (y.mode === Zr.TRIANGLES || y.mode === Zr.TRIANGLE_STRIP || y.mode === Zr.TRIANGLE_FAN || y.mode === void 0) f = o.isSkinnedMesh === !0 ? new Al(d, v) : new Yt(d, v), f.isSkinnedMesh === !0 && !f.geometry.attributes.skinWeight.normalized && f.normalizeSkinWeights(), y.mode === Zr.TRIANGLE_STRIP ? f.geometry = Hv(f.geometry, ax) : y.mode === Zr.TRIANGLE_FAN && (f.geometry = Hv(f.geometry, Hp)); else if (y.mode === Zr.LINES) f = new Pi(d, v); else if (y.mode === Zr.LINE_STRIP) f = new kr(d, v); else if (y.mode === Zr.LINE_LOOP) f = new Bu(d, v); else if (y.mode === Zr.POINTS) f = new hs(d, v); else throw new Error("THREE.GLTFLoader: Primitive mode unsupported: " + y.mode); Object.keys(f.geometry.morphAttributes).length > 0 && S4(f, o), f.name = t.createUniqueName(o.name || "mesh_" + e), yo(f, o), y.extensions && Ps(n, f, y), t.assignFinalMaterial(f), u.push(f); } if (u.length === 1) return u[0]; const p = new Lr(); for (let g = 0, m = u.length; g < m; g++) p.add(u[g]); return p; }); } /** * Specification: https://github.com/KhronosGroup/glTF/tree/master/specification/2.0#cameras * @param {number} cameraIndex * @return {Promise} */ loadCamera(e) { let t; const r = this.json.cameras[e], n = r[r.type]; if (!n) { console.warn("THREE.GLTFLoader: Missing camera parameters."); return; } return r.type === "perspective" ? t = new ti(Nd.radToDeg(n.yfov), n.aspectRatio || 1, n.znear || 1, n.zfar || 2e6) : r.type === "orthographic" && (t = new ps(-n.xmag, n.xmag, n.ymag, -n.ymag, n.znear, n.zfar)), r.name && (t.name = this.createUniqueName(r.name)), yo(t, r), Promise.resolve(t); } /** * Specification: https://github.com/KhronosGroup/glTF/tree/master/specification/2.0#skins * @param {number} skinIndex * @return {Promise} */ loadSkin(e) { const t = this.json.skins[e], r = { joints: t.joints }; return t.inverseBindMatrices === void 0 ? Promise.resolve(r) : this.getDependency("accessor", t.inverseBindMatrices).then(function(n) { return r.inverseBindMatrices = n, r; }); } /** * Specification: https://github.com/KhronosGroup/glTF/tree/master/specification/2.0#animations * @param {number} animationIndex * @return {Promise} */ loadAnimation(e) { const t = this.json.animations[e], r = [], n = [], o = [], a = [], s = []; for (let c = 0, l = t.channels.length; c < l; c++) { const h = t.channels[c], u = t.samplers[h.sampler], p = h.target, g = p.node !== void 0 ? p.node : p.id, m = t.parameters !== void 0 ? t.parameters[u.input] : u.input, d = t.parameters !== void 0 ? t.parameters[u.output] : u.output; r.push(this.getDependency("node", g)), n.push(this.getDependency("accessor", m)), o.push(this.getDependency("accessor", d)), a.push(u), s.push(p); } return Promise.all([ Promise.all(r), Promise.all(n), Promise.all(o), Promise.all(a), Promise.all(s) ]).then(function(c) { const l = c[0], h = c[1], u = c[2], p = c[3], g = c[4], m = []; for (let y = 0, f = l.length; y < f; y++) { const v = l[y], M = h[y], S = u[y], T = p[y], x = g[y]; if (v === void 0) continue; v.updateMatrix(), v.matrixAutoUpdate = !0; let w; switch (Rn[x.path]) { case Rn.weights: w = Ja; break; case Rn.rotation: w = Xo; break; case Rn.position: case Rn.scale: default: w = Ka; break; } const A = v.name ? v.name : v.uuid, _ = T.interpolation !== void 0 ? w4[T.interpolation] : Io, E = []; Rn[x.path] === Rn.weights ? v.traverse(function(L) { L.isMesh === !0 && L.morphTargetInfluences && E.push(L.name ? L.name : L.uuid); }) : E.push(A); let O = S.array; if (S.normalized) { const L = Wd(O.constructor), C = new Float32Array(O.length); for (let I = 0, R = O.length; I < R; I++) C[I] = O[I] * L; O = C; } for (let L = 0, C = E.length; L < C; L++) { const I = new w( E[L] + "." + Rn[x.path], M.array, O, _ ); T.interpolation === "CUBICSPLINE" && (I.createInterpolant = function(R) { return new es(this.times, this.values, this.getValueSize() / 3, R); }, I.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline = !0), m.push(I); } } const d = t.name ? t.name : "animation_" + e; return new Qa(d, void 0, m); }); } createNodeMesh(e) { const t = this.json, r = this, n = t.nodes[e]; return n.mesh === void 0 ? null : r.getDependency("mesh", n.mesh).then(function(o) { const a = r._getNodeRef(r.meshCache, n.mesh, o); return n.weights !== void 0 && a.traverse(function(s) { if (s.isMesh) for (let c = 0, l = n.weights.length; c < l; c++) s.morphTargetInfluences[c] = n.weights[c]; }), a; }); } /** * Specification: https://github.com/KhronosGroup/glTF/tree/master/specification/2.0#nodes-and-hierarchy * @param {number} nodeIndex * @return {Promise} */ loadNode(e) { const t = this.json, r = this.extensions, n = this, o = t.nodes[e], a = o.name ? n.createUniqueName(o.name) : ""; return function() { const s = [], c = n._invokeOne(function(l) { return l.createNodeMesh && l.createNodeMesh(e); }); return c && s.push(c), o.camera !== void 0 && s.push(n.getDependency("camera", o.camera).then(function(l) { return n._getNodeRef(n.cameraCache, o.camera, l); })), n._invokeAll(function(l) { return l.createNodeAttachment && l.createNodeAttachment(e); }).forEach(function(l) { s.push(l); }), Promise.all(s); }().then(function(s) { let c; if (o.isBone === !0 ? c = new Cl() : s.length > 1 ? c = new Lr() : s.length === 1 ? c = s[0] : c = new nt(), c !== s[0]) for (let l = 0, h = s.length; l < h; l++) c.add(s[l]); if (o.name && (c.userData.name = o.name, c.name = a), yo(c, o), o.extensions && Ps(r, c, o), o.matrix !== void 0) { const l = new $e(); l.fromArray(o.matrix), c.applyMatrix4(l); } else o.translation !== void 0 && c.position.fromArray(o.translation), o.rotation !== void 0 && c.quaternion.fromArray(o.rotation), o.scale !== void 0 && c.scale.fromArray(o.scale); return n.associations.set(c, { type: "nodes", index: e }), c; }); } /** * Specification: https://github.com/KhronosGroup/glTF/tree/master/specification/2.0#scenes * @param {number} sceneIndex * @return {Promise} */ loadScene(e) { const t = this.json, r = this.extensions, n = this.json.scenes[e], o = this, a = new Lr(); n.name && (a.name = o.createUniqueName(n.name)), yo(a, n), n.extensions && Ps(r, a, n); const s = n.nodes || [], c = []; for (let l = 0, h = s.length; l < h; l++) c.push(E1(s[l], a, t, o)); return Promise.all(c).then(function() { return a; }); } } function E1(i, e, t, r) { const n = t.nodes[i]; return r.getDependency("node", i).then(function(o) { if (n.skin === void 0) return o; let a; return r.getDependency("skin", n.skin).then(function(s) { a = s; const c = []; for (let l = 0, h = a.joints.length; l < h; l++) c.push(r.getDependency("node", a.joints[l])); return Promise.all(c); }).then(function(s) { return o.traverse(function(c) { if (!c.isMesh) return; const l = [], h = []; for (let u = 0, p = s.length; u < p; u++) { const g = s[u]; if (g) { l.push(g); const m = new $e(); a.inverseBindMatrices !== void 0 && m.fromArray(a.inverseBindMatrices.array, u * 16), h.push(m); } else console.warn('THREE.GLTFLoader: Joint "%s" could not be found.', a.joints[u]); } c.bind(new Ll(l, h), c.matrixWorld); }), o; }); }).then(function(o) { e.add(o); const a = []; if (n.children) { const s = n.children; for (let c = 0, l = s.length; c < l; c++) { const h = s[c]; a.push(E1(h, o, t, r)); } } return Promise.all(a); }); } function A4(i, e, t) { const r = e.attributes, n = new Vi(); if (r.POSITION !== void 0) { const s = t.json.accessors[r.POSITION], c = s.min, l = s.max; if (c !== void 0 && l !== void 0) { if (n.set( new Z(c[0], c[1], c[2]), new Z(l[0], l[1], l[2]) ), s.normalized) { const h = Wd(ll[s.componentType]); n.min.multiplyScalar(h), n.max.multiplyScalar(h); } } else { console.warn("THREE.GLTFLoader: Missing min/max properties for accessor POSITION."); return; } } else return; const o = e.targets; if (o !== void 0) { const s = new Z(), c = new Z(); for (let l = 0, h = o.length; l < h; l++) { const u = o[l]; if (u.POSITION !== void 0) { const p = t.json.accessors[u.POSITION], g = p.min, m = p.max; if (g !== void 0 && m !== void 0) { if (c.setX(Math.max(Math.abs(g[0]), Math.abs(m[0]))), c.setY(Math.max(Math.abs(g[1]), Math.abs(m[1]))), c.setZ(Math.max(Math.abs(g[2]), Math.abs(m[2]))), p.normalized) { const d = Wd(ll[p.componentType]); c.multiplyScalar(d); } s.max(c); } else console.warn("THREE.GLTFLoader: Missing min/max properties for accessor POSITION."); } } n.expandByVector(s); } i.boundingBox = n; const a = new bn(); n.getCenter(a.center), a.radius = n.min.distanceTo(n.max) / 2, i.boundingSphere = a; } function Gv(i, e, t) { const r = e.attributes, n = []; function o(a, s) { return t.getDependency("accessor", a).then(function(c) { i.setAttribute(s, c); }); } for (const a in r) { const s = jd[a] || a.toLowerCase(); s in i.attributes || n.push(o(r[a], s)); } if (e.indices !== void 0 && !i.index) { const a = t.getDependency("accessor", e.indices).then(function(s) { i.setIndex(s); }); n.push(a); } return yo(i, e), A4(i, e, t), Promise.all(n).then(function() { return e.targets !== void 0 ? M4(i, e.targets, t) : i; }); } function Hv(i, e) { let t = i.getIndex(); if (t === null) { const a = [], s = i.getAttribute("position"); if (s !== void 0) { for (let c = 0; c < s.count; c++) a.push(c); i.setIndex(a), t = i.getIndex(); } else return console.error("THREE.GLTFLoader.toTrianglesDrawMode(): Undefined position attribute. Processing not possible."), i; } const r = t.count - 2, n = []; if (e === Hp) for (let a = 1; a <= r; a++) n.push(t.getX(0)), n.push(t.getX(a)), n.push(t.getX(a + 1)); else for (let a = 0; a < r; a++) a % 2 === 0 ? (n.push(t.getX(a)), n.push(t.getX(a + 1)), n.push(t.getX(a + 2))) : (n.push(t.getX(a + 2)), n.push(t.getX(a + 1)), n.push(t.getX(a))); n.length / 3 !== r && console.error("THREE.GLTFLoader.toTrianglesDrawMode(): Unable to generate correct amount of triangles."); const o = i.clone(); return o.setIndex(n), o; } const C4 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, GLTFLoader: s4 }, Symbol.toStringTag, { value: "Module" })), L4 = /* @__PURE__ */ xu(C4); var jv = { exports: {} }, Wv; function R4() { return Wv || (Wv = 1, function(i) { function e(l) { var h = {}; function u(g) { if (h[g]) return h[g].exports; var m = h[g] = { /******/ i: g, /******/ l: !1, /******/ exports: {} /******/ }; return l[g].call(m.exports, m, m.exports, u), m.l = !0, m.exports; } u.m = l, u.c = h, u.i = function(g) { return g; }, u.d = function(g, m, d) { u.o(g, m) || Object.defineProperty(g, m, { /******/ configurable: !1, /******/ enumerable: !0, /******/ get: d /******/ }); }, u.r = function(g) { Object.defineProperty(g, "__esModule", { value: !0 }); }, u.n = function(g) { var m = g && g.__esModule ? ( /******/ function() { return g.default; } ) : ( /******/ function() { return g; } ); return u.d(m, "a", m), m; }, u.o = function(g, m) { return Object.prototype.hasOwnProperty.call(g, m); }, u.p = "/", u.oe = function(g) { throw console.error(g), g; }; var p = u(u.s = ENTRY_MODULE); return p.default || p; } var t = "[\\.|\\-|\\+|\\w|/|@]+", r = "\\(\\s*(/\\*.*?\\*/)?\\s*.*?(" + t + ").*?\\)"; function n(l) { return (l + "").replace(/[.?*+^$[\]\\(){}|-]/g, "\\$&"); } function o(l) { return !isNaN(1 * l); } function a(l, h, u) { var p = {}; p[u] = []; var g = h.toString(), m = g.match(/^function\s?\w*\(\w+,\s*\w+,\s*(\w+)\)/); if (!m) return p; for (var d = m[1], y = new RegExp("(\\\\n|\\W)" + n(d) + r, "g"), f; f = y.exec(g); ) f[3] !== "dll-reference" && p[u].push(f[3]); for (y = new RegExp("\\(" + n(d) + '\\("(dll-reference\\s(' + t + '))"\\)\\)' + r, "g"); f = y.exec(g); ) l[f[2]] || (p[u].push(f[1]), l[f[2]] = __webpack_require__(f[1]).m), p[f[2]] = p[f[2]] || [], p[f[2]].push(f[4]); for (var v = Object.keys(p), M = 0; M < v.length; M++) for (var S = 0; S < p[v[M]].length; S++) o(p[v[M]][S]) && (p[v[M]][S] = 1 * p[v[M]][S]); return p; } function s(l) { var h = Object.keys(l); return h.reduce(function(u, p) { return u || l[p].length > 0; }, !1); } function c(l, h) { for (var u = { main: [h] }, p = { main: [] }, g = { main: {} }; s(u); ) for (var m = Object.keys(u), d = 0; d < m.length; d++) { var y = m[d], f = u[y], v = f.pop(); if (g[y] = g[y] || {}, !(g[y][v] || !l[y][v])) { g[y][v] = !0, p[y] = p[y] || [], p[y].push(v); for (var M = a(l, l[y][v], y), S = Object.keys(M), T = 0; T < S.length; T++) u[S[T]] = u[S[T]] || [], u[S[T]] = u[S[T]].concat(M[S[T]]); } } return p; } i.exports = function(l, h) { h = h || {}; var u = { main: __webpack_modules__ }, p = h.all ? { main: Object.keys(u.main) } : c(u, l), g = ""; Object.keys(p).filter(function(v) { return v !== "main"; }).forEach(function(v) { for (var M = 0; p[v][M]; ) M++; p[v].push(M), u[v][M] = "(function(module, exports, __webpack_require__) { module.exports = __webpack_require__; })", g = g + "var " + v + " = (" + e.toString().replace("ENTRY_MODULE", JSON.stringify(M)) + ")({" + p[v].map(function(S) { return "" + JSON.stringify(S) + ": " + u[v][S].toString(); }).join(",") + `}); `; }), g = g + "new ((" + e.toString().replace("ENTRY_MODULE", JSON.stringify(l)) + ")({" + p.main.map(function(v) { return "" + JSON.stringify(v) + ": " + u.main[v].toString(); }).join(",") + "}))(self);"; var m = new window.Blob([g], { type: "text/javascript" }); if (h.bare) return m; var d = window.URL || window.webkitURL || window.mozURL || window.msURL, y = d.createObjectURL(m), f = new window.Worker(y); return f.objectURL = y, f; }; }(jv)), jv.exports; } function O4(i) { var e = this.constructor; return this.then( function(t) { return e.resolve(i()).then(function() { return t; }); }, function(t) { return e.resolve(i()).then(function() { return e.reject(t); }); } ); } function P4(i) { var e = this; return new e(function(t, r) { if (!(i && typeof i.length < "u")) return r( new TypeError( typeof i + " " + i + " is not iterable(cannot read property Symbol(Symbol.iterator))" ) ); var n = Array.prototype.slice.call(i); if (n.length === 0) return t([]); var o = n.length; function a(c, l) { if (l && (typeof l == "object" || typeof l == "function")) { var h = l.then; if (typeof h == "function") { h.call( l, function(u) { a(c, u); }, function(u) { n[c] = { status: "rejected", reason: u }, --o === 0 && t(n); } ); return; } } n[c] = { status: "fulfilled", value: l }, --o === 0 && t(n); } for (var s = 0; s < n.length; s++) a(s, n[s]); }); } function A1(i, e) { this.name = "AggregateError", this.errors = i, this.message = e || ""; } A1.prototype = Error.prototype; function I4(i) { var e = this; return new e(function(t, r) { if (!(i && typeof i.length < "u")) return r(new TypeError("Promise.any accepts an array")); var n = Array.prototype.slice.call(i); if (n.length === 0) return r(); for (var o = [], a = 0; a < n.length; a++) try { e.resolve(n[a]).then(t).catch(function(s) { o.push(s), o.length === n.length && r( new A1( o, "All promises were rejected" ) ); }); } catch (s) { r(s); } }); } var D4 = setTimeout; function C1(i) { return !!(i && typeof i.length < "u"); } function N4() { } function B4(i, e) { return function() { i.apply(e, arguments); }; } function Bt(i) { if (!(this instanceof Bt)) throw new TypeError("Promises must be constructed via new"); if (typeof i != "function") throw new TypeError("not a function"); this._state = 0, this._handled = !1, this._value = void 0, this._deferreds = [], R1(i, this); } function L1(i, e) { for (; i._state === 3; ) i = i._value; if (i._state === 0) { i._deferreds.push(e); return; } i._handled = !0, Bt._immediateFn(function() { var t = i._state === 1 ? e.onFulfilled : e.onRejected; if (t === null) { (i._state === 1 ? $d : cl)(e.promise, i._value); return; } var r; try { r = t(i._value); } catch (n) { cl(e.promise, n); return; } $d(e.promise, r); }); } function $d(i, e) { try { if (e === i) throw new TypeError("A promise cannot be resolved with itself."); if (e && (typeof e == "object" || typeof e == "function")) { var t = e.then; if (e instanceof Bt) { i._state = 3, i._value = e, qd(i); return; } else if (typeof t == "function") { R1(B4(t, e), i); return; } } i._state = 1, i._value = e, qd(i); } catch (r) { cl(i, r); } } function cl(i, e) { i._state = 2, i._value = e, qd(i); } function qd(i) { i._state === 2 && i._deferreds.length === 0 && Bt._immediateFn(function() { i._handled || Bt._unhandledRejectionFn(i._value); }); for (var e = 0, t = i._deferreds.length; e < t; e++) L1(i, i._deferreds[e]); i._deferreds = null; } function k4(i, e, t) { this.onFulfilled = typeof i == "function" ? i : null, this.onRejected = typeof e == "function" ? e : null, this.promise = t; } function R1(i, e) { var t = !1; try { i( function(r) { t || (t = !0, $d(e, r)); }, function(r) { t || (t = !0, cl(e, r)); } ); } catch (r) { if (t) return; t = !0, cl(e, r); } } Bt.prototype.catch = function(i) { return this.then(null, i); }; Bt.prototype.then = function(i, e) { var t = new this.constructor(N4); return L1(this, new k4(i, e, t)), t; }; Bt.prototype.finally = O4; Bt.all = function(i) { return new Bt(function(e, t) { if (!C1(i)) return t(new TypeError("Promise.all accepts an array")); var r = Array.prototype.slice.call(i); if (r.length === 0) return e([]); var n = r.length; function o(s, c) { try { if (c && (typeof c == "object" || typeof c == "function")) { var l = c.then; if (typeof l == "function") { l.call( c, function(h) { o(s, h); }, t ); return; } } r[s] = c, --n === 0 && e(r); } catch (h) { t(h); } } for (var a = 0; a < r.length; a++) o(a, r[a]); }); }; Bt.any = I4; Bt.allSettled = P4; Bt.resolve = function(i) { return i && typeof i == "object" && i.constructor === Bt ? i : new Bt(function(e) { e(i); }); }; Bt.reject = function(i) { return new Bt(function(e, t) { t(i); }); }; Bt.race = function(i) { return new Bt(function(e, t) { if (!C1(i)) return t(new TypeError("Promise.race accepts an array")); for (var r = 0, n = i.length; r < n; r++) Bt.resolve(i[r]).then(e, t); }); }; Bt._immediateFn = // @ts-ignore typeof setImmediate == "function" && function(i) { setImmediate(i); } || function(i) { D4(i, 0); }; Bt._unhandledRejectionFn = function(i) { typeof console < "u" && console && console.warn("Possible Unhandled Promise Rejection:", i); }; const z4 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, default: Bt }, Symbol.toStringTag, { value: "Module" })), F4 = /* @__PURE__ */ xu(z4); (function(i, e) { (function(t, r) { i.exports = r(); })(Nn, () => ( /******/ (() => { var t = [ /* 0 */ /***/ (a, s, c) => { c(1); var l = c(2), h = l.version, u = function() { this.Revision = h, this.defaultMaterialColor = 16777215, this.defaultOpacity = 1, this.modelPrefix = void 0, this.Geometry = c(3).Geometry, this.Glyph = c(16).Glyph, this.Glyphset = c(18).Glyphset, this.Pointset = c(22).Pointset, this.Label = c(17).Label, this.Lines = c(24).Lines, this.TextureArray = c(25).TextureArray, this.TextureSlides = c(27).TextureSlides, this.Renderer = c(30).Renderer, this.Scene = c(32).Scene, this.GeometryCSG = c(50).GeometryCSG, this.GlyphsetCSG = c(56).GlyphsetCSG, this.Viewport = c(43).Viewport, this.CameraControls = c(43).CameraControls, this.SmoothCameraTransition = c(43).SmoothCameraTransition, this.RayCaster = c(43).RayCaster, this.CameraAutoTumble = c(43).CameraAutoTumble, this.StereoEffect = c(43).StereoEffect, this.loadExternalFile = c(5).loadExternalFile, this.loadExternalFiles = c(5).loadExternalFiles, this.THREE = c(4); }; a.exports = new u(); }, /* 1 */ /***/ (a) => { a.exports = C3(); }, /* 2 */ /***/ (a) => { a.exports = /* @__PURE__ */ JSON.parse('{"name":"zincjs","version":"1.11.7","description":"ZincJS (Web-based-Zinc-Visualisation)","main":"build/zinc.js","directories":{"doc":"docs"},"files":["package.json","LICENSE","README.md","src/*","build/zinc.js","build/zinc.frontend.js","build/zinc.js.map","webpack.config.js"],"scripts":{"build-bundle":"webpack --config webpack.frontend.js; webpack --config webpack.backend.js","build-backend":"webpack --config webpack.backend.js","test":"npm --prefix ./test install && npm --prefix ./test run test-ci","changelog":"auto-changelog -p --output CHANGELOG.md --template keepachangelog","jsdoc":"jsdoc -c jsdoc_conf.json","version":"npm run build-bundle;npm run jsdoc;npm run changelog; git add CHANGELOG.md docs","release:beta":"npm version prerelease --preid=beta; npm publish --tag beta","release:minor":"npm version minor; npm publish","release:patch":"npm version patch; npm publish"},"repository":{"type":"git","url":"git+https://github.com/alan-wu/ZincJS.git"},"keywords":["library","webgl","3d","zincjs"],"author":"Alan Wu ","license":"MIT","bugs":{"url":"https://github.com/alan-wu/ZincJS/issues"},"homepage":"http://alan-wu.github.io/ZincJS/","devDependencies":{"@babel/core":"^7.23.9","@babel/preset-env":"^7.23.9","auto-changelog":"^2.4.0","babel-loader":"^9.1.3","babel-preset-minify":"^0.5.1","file-loader":"^6.2.0","jsdoc":"^4.0.2","raw-loader":"^4.0.2","webpack":"^5.90.3","webpack-cli":"^5.1.4","webpack-node-externals":"^3.0.0"},"dependencies":{"css-element-queries":"^1.2.2","lodash":"^4.17.19","promise-polyfill":"^8.1.3","three":"^0.130.1","three-spritetext":"1.6.2","url-loader":"^4.1.1","url-polyfill":"^1.1.7","webworkify-webpack":"^2.1.5"}}'); }, /* 3 */ /***/ function(a, s, c) { var l = c(4), h = c(5).toBufferGeometry, u = (g, m, d) => { var y = h(g, d), f = !1; 1 > d.opacity && (f = !0); var v; if (y._video === void 0) { var M = d.localTimeEnabled || d.localMorphColour; m ? (v = m, v.morphTargets = M, v.morphNormals = d.localTimeEnabled) : y instanceof l.BufferGeometry && y.attributes.color === void 0 ? v = new l.MeshPhongMaterial({ color: d.colour, morphTargets: M, morphNormals: d.localTimeEnabled, transparent: f, opacity: d.opacity, side: l.DoubleSide }) : v = new l.MeshPhongMaterial({ color: d.colour, morphTargets: M, morphNormals: d.localTimeEnabled, vertexColors: l.VertexColors, transparent: f, opacity: d.opacity, side: l.DoubleSide }), d.localMorphColour && y.morphAttributes.color && (v.onBeforeCompile = c(9).augmentMorphColor()); } else { var S = y._video.createCanvasVideoTexture(); v = new l.MeshBasicMaterial({ morphTargets: d.localTimeEnabled, color: new l.Color(1, 1, 1), transparent: f, opacity: d.opacity, map: S, side: l.DoubleSide }), this.videoHandler = y._video; } return new l.Mesh(y, v); }, p = function() { c(10).ZincObject.call(this), this.videoHandler = void 0, this.isGeometry = !0, this.createMesh = (g, m, d) => { if (!(this.morph && this.morph.geometry && g != null)) { var y = u(g, m, d); this.setMesh(y, d.localTimeEnabled, d.localMorphColour); } }, this.calculateUVs = () => { this.geometry.computeBoundingBox(); var g = this.geometry.boundingBox.max, m = this.geometry.boundingBox.min, d = new l.Vector2(0 - m.x, 0 - m.y), y = new l.Vector2(g.x - m.x, g.y - m.y); this.geometry.faceVertexUvs[0] = []; for (var f = 0; f < this.geometry.faces.length; f++) { var v = this.geometry.vertices[this.geometry.faces[f].a], M = this.geometry.vertices[this.geometry.faces[f].b], S = this.geometry.vertices[this.geometry.faces[f].c]; geometry.faceVertexUvs[0].push([new l.Vector2((v.x + d.x) / y.x, (v.y + d.y) / y.y), new l.Vector2((M.x + d.x) / y.x, (M.y + d.y) / y.y), new l.Vector2((S.x + d.x) / y.x, (S.y + d.y) / y.y)]); } geometry.uvsNeedUpdate = !0; }, this.checkTransparentMesh = function() { this._lod.checkTransparentMesh(); }, this.setWireframe = (g) => { this.morph.material.wireframe = g; }, this.editVertices = function(g, m) { if (g && g.length) { var d = this.getMorph(), y = d.geometry.getAttribute("position"); if (!d || 0 > m) return; var f = 3 * m; g.forEach((v) => { y.array[f++] = v[0], y.array[f++] = v[1], y.array[f++] = v[2]; }), y.needsUpdate = !0, d.geometry.computeBoundingBox(), d.geometry.computeBoundingSphere(), this.boundingBoxUpdateRequired = !0; } }; }; p.prototype = Object.create(c(10).ZincObject.prototype), s.Geometry = p; }, /* 4 */ /***/ (a) => { a.exports = Gk; }, /* 5 */ /***/ (a, s, c) => { function l(w) { throw new TypeError('"' + w + '" is read-only'); } var h = c(4), u = c(6).Geometry, p = c(7).default; function g(w) { var A = w, _ = c(0).modelPrefix; return _ && (_[_.length - 1] != "/" && l("prefix"), /^(?:[a-z]+:)?\/\//i.test(w) || (A = _ + w)), A; } function m(w, A) { var _ = (O, L) => { try { var C = new URL(O, L).href; if (O && 2 > O.split("?").length) { var I = L.split("?"); I.length === 2 && (C = C + "?" + I[1]); } return C; } catch { console.error("There is an issue creating the url link with: ".concat(O, ".")); } }; if (!Array.isArray(w)) return _(w, A); var E = []; return w.forEach((O) => { E.push(_(O, A)); }), E; } function d(w, A, _, E, O) { var L = w.morphTargetInfluences, C = void 0; w.geometry && (C = w.geometry.morphAttributes); var I = !1; if (L && C && C.position) { E.set(0, 0, 0), O.set(0, 0, 0); for (var R = 0; R < L.length; R++) 0 < L[R] && (I = !0, _.setFromArray(C.position[R].array), E.add(_.min.multiplyScalar(L[R])), O.add(_.max.multiplyScalar(L[R]))); I && A.set(E, O); } I || A.setFromBufferAttribute(w.geometry.attributes.position), w.updateWorldMatrix(!0, !0), A.applyMatrix4(w.matrixWorld); } function y(w, A, _, E) { var O = new XMLHttpRequest(); O.open("GET", g(w), !0), O.onreadystatechange = () => { O.readyState == 4 && (O.status == 200 ? _(O.responseText, A) : E(w)); }, O.send(null); } function f(w, A, _) { function E(R, b) { C[b] = R, L++, L == O && A(C); } for (var O = w.length, L = 0, C = [], I = 0; I < O; I++) y(w[I], I, E, _); } s.getColorsRGB = (w, A) => { var _ = Math.floor(A / 3), E = A % 3, O = 0; E == 0 ? O = w[_].r : E == 1 ? O = w[_].g : E == 2 && (O = w[_].b); var L = new h.Color(O); return [L.r, L.g, L.b]; }, s.updateMorphColorAttribute = function(w, A) { if (A && w && w.morphAttributes && w.morphAttributes.color) { var _ = w.morphAttributes.color, E = A.morphTargetInfluences, O = E.length; w.deleteAttribute("morphColor0"), w.deleteAttribute("morphColor1"); for (var L = 0, C = [], I = 0; 1 > L || I < O; I++) 0 < E[I] && (L++, C.push([I, E[I]])); C.length == 2 ? (w.setAttribute("morphColor0", _[C[0][0]]), w.setAttribute("morphColor1", _[C[1][0]])) : C.length == 1 && (w.setAttribute("morphColor0", _[C[0][0]]), w.setAttribute("morphColor1", _[C[0][0]])); } }, s.toBufferGeometry = (w, A) => { var _; return w instanceof u ? (A.localTimeEnabled && !w.morphNormalsReady && (w.morphNormals == null || w.morphNormals.length == 0) && w.computeMorphNormals(), _ = w.toIndexedBufferGeometry(), A.localMorphColour && v(w, _)) : w instanceof h.BufferGeometry && (_ = w.clone()), _.colorsNeedUpdate = !0, _.computeBoundingBox(), _.computeBoundingSphere(), w._video && (_._video = w._video), _; }, s.copyMorphColorsToBufferGeometry = (w, A) => { if (w && w.morphColors && 0 < w.morphColors.length) { for (var _ = [], E = w.morphColors, O = c(5).getColorsRGB, L = 0, C = E.length; L < C; L++) { for (var I = E[L], R = [], b = 0; b < w.faces.length; b++) { var P = w.faces[b], N = O(I.colors, P.a); R.push(N[0], N[1], N[2]), N = O(I.colors, P.b), R.push(N[0], N[1], N[2]), N = O(I.colors, P.c), R.push(N[0], N[1], N[2]); } var D = new h.Float32BufferAttribute(3 * (3 * w.faces.length), 3); D.name = I.name, _.push(D.copyArray(R)); } A.morphAttributes.color = _; } }; var v = (w, A) => { if (w && w.morphColors && 0 < w.morphColors.length) { for (var _ = [], E = w.morphColors, O = c(5).getColorsRGB, L = 0, C = E.length; L < C; L++) { for (var I, R = E[L], b = [], P = 0; P < 3 * R.colors.length; P++) I = O(R.colors, P), b.push(I[0], I[1], I[2]); var N = new h.Float32BufferAttribute(b, 3); N.name = R.name, _.push(N); } A.morphAttributes.color = _; } }; s.mergeVertices = function(w) { var A = 1 < arguments.length && arguments[1] !== void 0 ? arguments[1] : 1e-4; A = Math.max(A, Number.EPSILON); for (var _, E = {}, O = w.getIndex(), L = w.getAttribute("position"), C = O ? O.count : L.count, I = 0, R = Object.keys(w.attributes), b = {}, P = {}, fe = [], N = ["getX", "getY", "getZ", "getW"], D = 0, k = R.length; D < k; D++) { _ = R[D], b[_] = []; var V = w.morphAttributes[_]; V && (P[_] = Array(V.length).fill().map(() => [])); } for (var q = Math.log10(1 / A), Y = Math.pow(10, q), D = 0; D < C; D++) { for (var ne = O ? O.getX(D) : D, X = "", z = 0, k = R.length; z < k; z++) for (var _ = R[z], H = w.getAttribute(_), ee = H.itemSize, Q = 0; Q < ee; Q++) X += "".concat(~~(H[N[Q]](ne) * Y), ","); if (X in E) fe.push(E[X]); else { for (var z = 0, k = R.length; z < k; z++) for (var J, _ = R[z], H = w.getAttribute(_), V = w.morphAttributes[_], ee = H.itemSize, W = b[_], K = P[_], Q = 0; Q < ee; Q++) if (J = N[Q], W.push(H[J](ne)), V) for (var ie = 0, B = V.length; ie < B; ie++) K[ie].push(V[ie][J](ne)); E[X] = I, fe.push(I), I++; } } for (var j = w.clone(), D = 0, k = R.length; D < k; D++) { var H, _ = R[D], re = w.getAttribute(_), F = new re.array.constructor(b[_]); if (re.isInterleavedBufferAttribute ? H = new h.BufferAttribute(F, re.itemSize, re.itemSize) : (H = w.getAttribute(_).clone(), H.setArray(F)), j.setAttribute(_, H), _ in P) for (var U, z = 0; z < P[_].length; z++) U = w.morphAttributes[_][z].clone(), U.setArray(new U.array.constructor(P[_][z])), j.morphAttributes[_][z] = U; } var se = Uint8Array; fe.length >= Math.pow(2, 8) && (se = Uint16Array), fe.length >= Math.pow(2, 16) && (se = Uint32Array); var ue = new se(fe), fe = null; return O === null ? fe = new h.BufferAttribute(ue, 1) : (fe = w.getIndex().clone(), fe.setArray(ue)), j.setIndex(fe), j; }; function M(w) { if (w.isMeshPhongMaterial) { var A = new h.MeshToonMaterial({ color: w.color.clone(), morphTargets: w.morphTargets, morphNormals: w.morphNormals, vertexColors: w.vertexColors, transparent: w.transparent, opacity: w.opacity, side: w.side }); return w.map && (A.map = w.map), A; } return w; } function S(w, A) { if (A && w >= A.length) { var _ = new h.BufferGeometry(), E = new Float32Array(3 * w), O = 0; return A.forEach((L) => { E[O++] = L[0], E[O++] = L[1], E[O++] = L[2]; }), _.setAttribute("position", new h.BufferAttribute(E, 3)), _.setDrawRange(0, A.length), _; } } function T() { var w = new Image(); w.src = c(8); var A = new h.Texture(); return A.image = w, A.needsUpdate = !0, A; } function x(w, A, _, E, O, L) { var C = new p(w, A, _, E, O, L); return C.fontFace = E, C.fontSize = O, C.fontWeight = L, C.material.map.generateMipmaps = !1, C.material.map.anisotropy = 4, C.material.sizeAttenuation = !1, C.material.alphaTest = 0.5, C.material.transparent = !0, C.material.depthWrite = !1, C.material.depthTest = !1, C.center.set(0.5, -1.2), C.renderOrder = 1e4, C; } s.getBoundingBox = d, s.createNewURL = m, s.createBufferGeometry = S, s.getCircularTexture = T, s.resolveURL = g, s.loadExternalFile = y, s.loadExternalFiles = f, s.PhongToToon = M, s.createNewSpriteText = x; }, /* 6 */ /***/ (a, s, c) => { c.r(s), c.d(s, { /* harmony export */ Face3: () => ( /* binding */ y ), /* harmony export */ Geometry: () => ( /* binding */ m ) /* harmony export */ }); var l = c(4), h = new l.Matrix4(), u = new l.Object3D(), p = new l.Vector3(), g = new l.Vector3(); function m() { this.uuid = l.MathUtils.generateUUID(), this.name = "", this.type = "Geometry", this.vertices = [], this.colors = [], this.faces = [], this.faceVertexUvs = [[]], this.normals = [], this.uvs = [], this.morphTargets = [], this.morphNormals = [], this.skinWeights = [], this.skinIndices = [], this.lineDistances = [], this.boundingBox = null, this.boundingSphere = null, this.elementsNeedUpdate = !1, this.verticesNeedUpdate = !1, this.uvsNeedUpdate = !1, this.normalsNeedUpdate = !1, this.colorsNeedUpdate = !1, this.lineDistancesNeedUpdate = !1, this.groupsNeedUpdate = !1, this.morphNormalsReady = !1; } m.prototype = Object.assign(Object.create(l.EventDispatcher.prototype), { constructor: m, isGeometry: !0, applyMatrix4: function(f) { for (var v, M = new l.Matrix3().getNormalMatrix(f), S = 0, T = this.vertices.length; S < T; S++) v = this.vertices[S], v.applyMatrix4(f); for (var x, w = 0, A = this.faces.length; w < A; w++) { x = this.faces[w], x.normal.applyMatrix3(M).normalize(); for (var _ = 0, E = x.vertexNormals.length; _ < E; _++) x.vertexNormals[_].applyMatrix3(M).normalize(); } return this.boundingBox !== null && this.computeBoundingBox(), this.boundingSphere !== null && this.computeBoundingSphere(), this.verticesNeedUpdate = !0, this.normalsNeedUpdate = !0, this; }, rotateX: function(f) { return h.makeRotationX(f), this.applyMatrix4(h), this; }, rotateY: function(f) { return h.makeRotationY(f), this.applyMatrix4(h), this; }, rotateZ: function(f) { return h.makeRotationZ(f), this.applyMatrix4(h), this; }, translate: function(f, v, M) { return h.makeTranslation(f, v, M), this.applyMatrix4(h), this; }, scale: function(f, v, M) { return h.makeScale(f, v, M), this.applyMatrix4(h), this; }, lookAt: function(f) { return u.lookAt(f), u.updateMatrix(), this.applyMatrix4(u.matrix), this; }, fromBufferGeometry: function(f) { function v(V, q, Y, ne) { var X = A === void 0 ? [] : [M.colors[V].clone(), M.colors[q].clone(), M.colors[Y].clone()], z = w === void 0 ? [] : [new l.Vector3().fromBufferAttribute(w, V), new l.Vector3().fromBufferAttribute(w, q), new l.Vector3().fromBufferAttribute(w, Y)], H = new y(V, q, Y, z, X, ne); M.faces.push(H), _ !== void 0 && M.faceVertexUvs[0].push([new l.Vector2().fromBufferAttribute(_, V), new l.Vector2().fromBufferAttribute(_, q), new l.Vector2().fromBufferAttribute(_, Y)]), E !== void 0 && M.faceVertexUvs[1].push([new l.Vector2().fromBufferAttribute(E, V), new l.Vector2().fromBufferAttribute(E, q), new l.Vector2().fromBufferAttribute(E, Y)]); } var M = this, S = f.index === null ? void 0 : f.index, T = f.attributes; if (T.position === void 0) return console.error("THREE.Geometry.fromBufferGeometry(): Position attribute required for conversion."), this; var x = T.position, w = T.normal, A = T.color, _ = T.uv, E = T.uv2; E !== void 0 && (this.faceVertexUvs[1] = []); for (var O = 0; O < x.count; O++) M.vertices.push(new l.Vector3().fromBufferAttribute(x, O)), A !== void 0 && M.colors.push(new l.Color().fromBufferAttribute(A, O)); var L = f.groups; if (0 < L.length) for (var C = 0; C < L.length; C++) for (var I = L[C], R = I.start, b = I.count, P = R, N = R + b; P < N; P += 3) S === void 0 ? v(P, P + 1, P + 2, I.materialIndex) : v(S.getX(P), S.getX(P + 1), S.getX(P + 2), I.materialIndex); else if (S !== void 0) for (var D = 0; D < S.count; D += 3) v(S.getX(D), S.getX(D + 1), S.getX(D + 2)); else for (var k = 0; k < x.count; k += 3) v(k, k + 1, k + 2); return this.computeFaceNormals(), f.boundingBox !== null && (this.boundingBox = f.boundingBox.clone()), f.boundingSphere !== null && (this.boundingSphere = f.boundingSphere.clone()), this; }, center: function() { return this.computeBoundingBox(), this.boundingBox.getCenter(p).negate(), this.translate(p.x, p.y, p.z), this; }, normalize: function() { this.computeBoundingSphere(); var f = this.boundingSphere.center, v = this.boundingSphere.radius, M = v === 0 ? 1 : 1 / v, S = new l.Matrix4(); return S.set(M, 0, 0, -M * f.x, 0, M, 0, -M * f.y, 0, 0, M, -M * f.z, 0, 0, 0, 1), this.applyMatrix4(S), this; }, computeFaceNormals: function() { for (var f = new l.Vector3(), v = new l.Vector3(), M = 0, S = this.faces.length; M < S; M++) { var T = this.faces[M], x = this.vertices[T.a], w = this.vertices[T.b], A = this.vertices[T.c]; f.subVectors(A, w), v.subVectors(x, w), f.cross(v), f.normalize(), T.normal.copy(f); } }, computeVertexNormals: function() { for (var f = !(0 < arguments.length && arguments[0] !== void 0) || arguments[0], v = Array(this.vertices.length), M = 0, S = this.vertices.length; M < S; M++) v[M] = new l.Vector3(); if (f) for (var T = new l.Vector3(), x = new l.Vector3(), w = 0, A = this.faces.length; w < A; w++) { var _ = this.faces[w], E = this.vertices[_.a], O = this.vertices[_.b], L = this.vertices[_.c]; T.subVectors(L, O), x.subVectors(E, O), T.cross(x), v[_.a].add(T), v[_.b].add(T), v[_.c].add(T); } else { this.computeFaceNormals(); for (var C, I = 0, R = this.faces.length; I < R; I++) C = this.faces[I], v[C.a].add(C.normal), v[C.b].add(C.normal), v[C.c].add(C.normal); } for (var b = 0, P = this.vertices.length; b < P; b++) v[b].normalize(); for (var N = 0, D = this.faces.length; N < D; N++) { var k = this.faces[N], V = k.vertexNormals; V.length === 3 ? (V[0].copy(v[k.a]), V[1].copy(v[k.b]), V[2].copy(v[k.c])) : (V[0] = v[k.a].clone(), V[1] = v[k.b].clone(), V[2] = v[k.c].clone()); } return 0 < this.faces.length && (this.normalsNeedUpdate = !0), v; }, computeFlatVertexNormals: function() { this.computeFaceNormals(); for (var f = 0, v = this.faces.length; f < v; f++) { var M = this.faces[f], S = M.vertexNormals; S.length === 3 ? (S[0].copy(M.normal), S[1].copy(M.normal), S[2].copy(M.normal)) : (S[0] = M.normal.clone(), S[1] = M.normal.clone(), S[2] = M.normal.clone()); } 0 < this.faces.length && (this.normalsNeedUpdate = !0); }, computeMorphNormals: function() { for (var f, v = 0, M = this.faces.length; v < M; v++) { f = this.faces[v], f.__originalFaceNormal ? f.__originalFaceNormal.copy(f.normal) : f.__originalFaceNormal = f.normal.clone(), f.__originalVertexNormals || (f.__originalVertexNormals = []); for (var S = 0, T = f.vertexNormals.length; S < T; S++) f.__originalVertexNormals[S] ? f.__originalVertexNormals[S].copy(f.vertexNormals[S]) : f.__originalVertexNormals[S] = f.vertexNormals[S].clone(); } var x = new m(); x.faces = this.faces; for (var w = 0, A = this.morphTargets.length; w < A; w++) { if (!this.morphNormals[w]) { this.morphNormals[w] = {}, this.morphNormals[w].faceNormals = [], this.morphNormals[w].vertexNormals = []; for (var _ = this.morphNormals[w].faceNormals, E = this.morphNormals[w].vertexNormals, O = 0, L = this.faces.length; O < L; O++) { var C = new l.Vector3(), I = { a: new l.Vector3(), b: new l.Vector3(), c: new l.Vector3() }; _.push(C), E.push(I); } } var R = this.morphNormals[w]; x.vertices = this.morphTargets[w].vertices, x.computeFaceNormals(); var b = x.computeVertexNormals(); if (b && 0 < b.length) { this.morphTargets[w].normals = Array(this.vertices.length); for (var P = 0; P < b.length; P++) this.morphTargets[w].normals[P] = b[P].clone(); } for (var N = 0, D = this.faces.length; N < D; N++) { var k = this.faces[N], V = R.faceNormals[N], q = R.vertexNormals[N]; V.copy(k.normal), q.a.copy(k.vertexNormals[0]), q.b.copy(k.vertexNormals[1]), q.c.copy(k.vertexNormals[2]); } } for (var Y, ne = 0, X = this.faces.length; ne < X; ne++) Y = this.faces[ne], Y.normal = Y.__originalFaceNormal, Y.vertexNormals = Y.__originalVertexNormals; this.morphNormalsReady = !0; }, computeBoundingBox: function() { this.boundingBox === null && (this.boundingBox = new l.Box3()), this.boundingBox.setFromPoints(this.vertices); }, computeBoundingSphere: function() { this.boundingSphere === null && (this.boundingSphere = new l.Sphere()), this.boundingSphere.setFromPoints(this.vertices); }, mergeMorph: function(f, v) { var M = this.morphTargets.length, S = this.morphTargets, T = f.morphTargets, x = this.morphColors.length, w = this.morphColors, A = f.morphColors; if (0 < M && M == T.length) for (var _ = 0, E = S.length; _ < E; _++) { for (var O = S[_], L = T[_], C = 0, I = L.vertices.length; C < I; C++) { var R = L.vertices[C], b = R.clone(); v !== void 0 && b.applyMatrix4(v), O.vertices.push(b); } if (O.normals && L.normals) for (var P = 0; P < L.normals.length; P += 3) g.set(L.normals2[P], L.normals2[P + 1], L.normals2[P + 2]), v !== void 0 && g.applyMatrix4(v), O.normals.push(g.x, g.y, g.z); } if (0 < x && x == A.length) for (var N = 0, D = w.length; N < D; N++) for (var k = w[N], V = A[N], q = 0, Y = V.colors; q < Y; q++) k.colors.push(V.colors[q].clone()); }, merge: function(f, v) { var M = 2 < arguments.length && arguments[2] !== void 0 ? arguments[2] : 0; if (!(f && f.isGeometry)) return void console.error("THREE.Geometry.merge(): geometry not an instance of THREE.Geometry.", f); var S, T = this.vertices.length, x = this.vertices, w = f.vertices, A = f.normals, _ = this.faces, E = f.faces, O = this.colors, L = f.colors; v !== void 0 && (S = new l.Matrix3().getNormalMatrix(v)); for (var C = 0, I = w.length; C < I; C++) { var R = w[C], b = R.clone(); v !== void 0 && b.applyMatrix4(v), x.push(b); } for (var P = 0; P < A.length; P += 3) g.set(A[P], A[P + 1], A[P + 2]), v !== void 0 && g.applyMatrix4(v), this.normals.push(g.x, g.y, g.z); for (var N = 0, D = L.length; N < D; N++) typeof L[N] == "number" ? O.push(L[N]) : O.push(L[N].clone()); for (var k = 0, V = E.length; k < V; k++) { var q = E[k], Y = void 0, ne = void 0, X = q.vertexNormals, z = q.vertexColors, H = new y(q.a + T, q.b + T, q.c + T); H.normal.copy(q.normal), S !== void 0 && H.normal.applyMatrix3(S).normalize(); for (var ee = 0, Q = X.length; ee < Q; ee++) Y = X[ee].clone(), S !== void 0 && Y.applyMatrix3(S).normalize(), H.vertexNormals.push(Y); H.color.copy(q.color); for (var J = 0, W = z.length; J < W; J++) ne = z[J], H.vertexColors.push(ne.clone()); H.materialIndex = q.materialIndex + M, _.push(H); } for (var K, ie = 0, B = f.faceVertexUvs.length; ie < B; ie++) { K = f.faceVertexUvs[ie], this.faceVertexUvs[ie] === void 0 && (this.faceVertexUvs[ie] = []); for (var j = 0, re = K.length; j < re; j++) { for (var F = K[j], U = [], se = 0, ue = F.length; se < ue; se++) U.push(F[se].clone()); this.faceVertexUvs[ie].push(U); } } this.mergeMorph(f, v); }, mergeMesh: function(f) { return f && f.isMesh ? (f.matrixAutoUpdate && f.updateMatrix(), void this.merge(f.geometry, f.matrix)) : void console.error("THREE.Geometry.mergeMesh(): mesh not an instance of THREE.Mesh.", f); }, /* * Checks for duplicate vertices with hashmap. * Duplicated vertices are removed * and faces' vertices are updated. */ mergeVertices: function() { for (var f = 0 < arguments.length && arguments[0] !== void 0 ? arguments[0] : 4, v = {}, M = [], S = [], T = Math.pow(10, f), x = 0, w = this.vertices.length; x < w; x++) { var A = this.vertices[x], _ = Math.round(A.x * T) + "_" + Math.round(A.y * T) + "_" + Math.round(A.z * T); v[_] === void 0 ? (v[_] = x, M.push(this.vertices[x]), S[x] = M.length - 1) : S[x] = S[v[_]]; } for (var E, O = [], L = 0, C = this.faces.length; L < C; L++) { E = this.faces[L], E.a = S[E.a], E.b = S[E.b], E.c = S[E.c]; for (var I = [E.a, E.b, E.c], R = 0; 3 > R; R++) if (I[R] === I[(R + 1) % 3]) { O.push(L); break; } } for (var b, P = O.length - 1; 0 <= P; P--) { b = O[P], this.faces.splice(b, 1); for (var N = 0, D = this.faceVertexUvs.length; N < D; N++) this.faceVertexUvs[N].splice(b, 1); } var k = this.vertices.length - M.length; return this.vertices = M, k; }, setFromPoints: function(f) { this.vertices = []; for (var v, M = 0, S = f.length; M < S; M++) v = f[M], this.vertices.push(new l.Vector3(v.x, v.y, v.z || 0)); return this; }, sortFacesByMaterialIndex: function() { for (var f = this.faces, v = f.length, M = 0; M < v; M++) f[M]._id = M; f.sort(function(E, O) { return E.materialIndex - O.materialIndex; }); var S, T, x = this.faceVertexUvs[0], w = this.faceVertexUvs[1]; x && x.length === v && (S = []), w && w.length === v && (T = []); for (var A, _ = 0; _ < v; _++) A = f[_]._id, S && S.push(x[A]), T && T.push(w[A]); S && (this.faceVertexUvs[0] = S), T && (this.faceVertexUvs[1] = T); }, toJSON: function() { function f(W, K, ie) { return ie ? W | 1 << K : W & ~(1 << K); } function v(W) { var K = W.x.toString() + W.y.toString() + W.z.toString(); return C[K] === void 0 && (C[K] = L.length / 3, L.push(W.x, W.y, W.z)), C[K]; } function M(W) { var K = W.r.toString() + W.g.toString() + W.b.toString(); return R[K] === void 0 && (R[K] = I.length, I.push(W.getHex())), R[K]; } function S(W) { var K = W.x.toString() + W.y.toString(); return P[K] === void 0 && (P[K] = b.length / 2, b.push(W.x, W.y)), P[K]; } var T = { metadata: { version: 4.5, type: "Geometry", generator: "Geometry.toJSON" } }; if (T.uuid = this.uuid, T.type = this.type, this.name !== "" && (T.name = this.name), this.parameters !== void 0) { var x = this.parameters; for (var w in x) x[w] !== void 0 && (T[w] = x[w]); return T; } for (var A, _ = [], E = 0; E < this.vertices.length; E++) A = this.vertices[E], _.push(A.x, A.y, A.z); for (var O = [], L = [], C = {}, I = [], R = {}, b = [], P = {}, N = 0; N < this.faces.length; N++) { var D = this.faces[N], k = !0, V = !1, q = this.faceVertexUvs[0][N] !== void 0, Y = 0 < D.normal.length(), ne = 0 < D.vertexNormals.length, X = D.color.r !== 1 || D.color.g !== 1 || D.color.b !== 1, z = 0 < D.vertexColors.length, H = 0; if (H = f(H, 0, 0), H = f(H, 1, k), H = f(H, 2, V), H = f(H, 3, q), H = f(H, 4, Y), H = f(H, 5, ne), H = f(H, 6, X), H = f(H, 7, z), O.push(H), O.push(D.a, D.b, D.c), O.push(D.materialIndex), q) { var ee = this.faceVertexUvs[0][N]; O.push(S(ee[0]), S(ee[1]), S(ee[2])); } if (Y && O.push(v(D.normal)), ne) { var Q = D.vertexNormals; O.push(v(Q[0]), v(Q[1]), v(Q[2])); } if (X && O.push(M(D.color)), z) { var J = D.vertexColors; O.push(M(J[0]), M(J[1]), M(J[2])); } } return T.data = {}, T.data.vertices = _, T.data.normals = L, 0 < I.length && (T.data.colors = I), 0 < b.length && (T.data.uvs = [b]), T.data.faces = O, T; }, clone: function() { return new m().copy(this); }, copy: function(f) { this.vertices = [], this.colors = [], this.faces = [], this.faceVertexUvs = [[]], this.morphTargets = [], this.morphNormals = [], this.skinWeights = [], this.skinIndices = [], this.lineDistances = [], this.boundingBox = null, this.boundingSphere = null, this.name = f.name; for (var v = f.vertices, M = 0, S = v.length; M < S; M++) this.vertices.push(v[M].clone()); for (var T = f.colors, x = 0, w = T.length; x < w; x++) this.colors.push(T[x].clone()); for (var A = f.faces, _ = 0, E = A.length; _ < E; _++) this.faces.push(A[_].clone()); for (var O, L = 0, C = f.faceVertexUvs.length; L < C; L++) { O = f.faceVertexUvs[L], this.faceVertexUvs[L] === void 0 && (this.faceVertexUvs[L] = []); for (var I = 0, R = O.length; I < R; I++) { for (var b, P = O[I], N = [], D = 0, k = P.length; D < k; D++) b = P[D], N.push(b.clone()); this.faceVertexUvs[L].push(N); } } for (var V, q = f.morphTargets, Y = 0, ne = q.length; Y < ne; Y++) { if (V = {}, V.name = q[Y].name, q[Y].vertices !== void 0) { V.vertices = []; for (var X = 0, z = q[Y].vertices.length; X < z; X++) V.vertices.push(q[Y].vertices[X].clone()); } if (q[Y].normals !== void 0) { V.normals = []; for (var H = 0, ee = q[Y].normals.length; H < ee; H++) V.normals.push(q[Y].normals[H].clone()); } this.morphTargets.push(V); } for (var Q, J = f.morphNormals, W = 0, K = J.length; W < K; W++) { if (Q = {}, J[W].vertexNormals !== void 0) { Q.vertexNormals = []; for (var ie = 0, B = J[W].vertexNormals.length; ie < B; ie++) { var j = J[W].vertexNormals[ie], re = {}; re.a = j.a.clone(), re.b = j.b.clone(), re.c = j.c.clone(), Q.vertexNormals.push(re); } } if (J[W].faceNormals !== void 0) { Q.faceNormals = []; for (var F = 0, U = J[W].faceNormals.length; F < U; F++) Q.faceNormals.push(J[W].faceNormals[F].clone()); } this.morphNormals.push(Q); } for (var se = f.skinWeights, ue = 0, fe = se.length; ue < fe; ue++) this.skinWeights.push(se[ue].clone()); for (var ve = f.skinIndices, _e = 0, ae = ve.length; _e < ae; _e++) this.skinIndices.push(ve[_e].clone()); for (var Te = f.lineDistances, Ee = 0, oe = Te.length; Ee < oe; Ee++) this.lineDistances.push(Te[Ee]); var Me = f.boundingBox; Me !== null && (this.boundingBox = Me.clone()); var ye = f.boundingSphere; return ye !== null && (this.boundingSphere = ye.clone()), this.elementsNeedUpdate = f.elementsNeedUpdate, this.verticesNeedUpdate = f.verticesNeedUpdate, this.uvsNeedUpdate = f.uvsNeedUpdate, this.normalsNeedUpdate = f.normalsNeedUpdate, this.colorsNeedUpdate = f.colorsNeedUpdate, this.lineDistancesNeedUpdate = f.lineDistancesNeedUpdate, this.groupsNeedUpdate = f.groupsNeedUpdate, this; }, computeGroups() { var f, v, M = [], S = void 0, T = this.faces; for (v = 0; v < T.length; v++) { var x = T[v]; x.materialIndex !== S && (S = x.materialIndex, f !== void 0 && (f.count = 3 * v - f.start, M.push(f)), f = { start: 3 * v, materialIndex: S }); } return f !== void 0 && (f.count = 3 * v - f.start, M.push(f)), M; }, toBufferGeometry: function() { var f = new d().fromGeometry(this), v = new l.BufferGeometry(), M = new Float32Array(3 * f.vertices.length); if (v.setAttribute("position", new l.BufferAttribute(M, 3).copyVector3sArray(f.vertices)), 0 < f.normals.length) { var S = new Float32Array(3 * f.normals.length); v.setAttribute("normal", new l.BufferAttribute(S, 3).copyVector3sArray(f.normals)); } if (0 < f.colors.length) { var T = new Float32Array(3 * f.colors.length); v.setAttribute("color", new l.BufferAttribute(T, 3).copyColorsArray(f.colors)); } if (0 < f.uvs.length) { var x = new Float32Array(2 * f.uvs.length); v.setAttribute("uv", new l.BufferAttribute(x, 2).copyVector2sArray(f.uvs)); } if (0 < f.uvs2.length) { var w = new Float32Array(2 * f.uvs2.length); v.setAttribute("uv2", new l.BufferAttribute(w, 2).copyVector2sArray(f.uvs2)); } for (var A in v.groups = f.groups, f.morphTargets) { for (var _ = [], E = f.morphTargets[A], O = 0, L = E.length; O < L; O++) { var C = E[O], I = new l.Float32BufferAttribute(3 * C.data.length, 3); I.name = C.name, _.push(I.copyVector3sArray(C.data)); } v.morphAttributes[A] = _; } if (0 < f.skinIndices.length) { var R = new l.Float32BufferAttribute(4 * f.skinIndices.length, 4); v.setAttribute("skinIndex", R.copyVector4sArray(f.skinIndices)); } if (0 < f.skinWeights.length) { var b = new l.Float32BufferAttribute(4 * f.skinWeights.length, 4); v.setAttribute("skinWeight", b.copyVector4sArray(f.skinWeights)); } return f.boundingSphere !== null && (v.boundingSphere = f.boundingSphere.clone()), f.boundingBox !== null && (v.boundingBox = f.boundingBox.clone()), v; }, toIndexedBufferGeometry: function() { var f = new l.BufferGeometry(), v = new Float32Array(3 * this.vertices.length); if (f.setAttribute("position", new l.BufferAttribute(v, 3).copyVector3sArray(this.vertices)), 0 < this.normals.length) { var M = new Float32Array(this.normals.length), S = new l.BufferAttribute(M, 3).copyArray(this.normals); f.setAttribute("normal", S); } if (0 < this.uvs.length && 0 < this.uvs[0].length) { var T = new Float32Array(2 * this.uvs[0].length); f.setAttribute("uv", new l.BufferAttribute(T, 2).copyArray(this.uvs[0])); } if (1 < this.uvs.length && 0 < this.uvs[1].length) { var x = new Float32Array(2 * this.uvs[1].length); f.setAttribute("uv2", new l.BufferAttribute(x, 2).copyArray(this.uvs[1])); } if (0 < this.colors.length) { for (var w = [], A = 0; A < this.colors.length; A++) w.push(new l.Color(this.colors[A])); var _ = new Float32Array(3 * w.length); f.setAttribute("color", new l.BufferAttribute(_, 3).copyColorsArray(w)); } else { for (var E = new Float32Array(3 * this.vertices.length), O = 0; O < 3 * this.vertices.length; O++) E[O] = 1; f.setAttribute("color", new l.BufferAttribute(E, 3)); } if (0 < this.faces.length) { for (var L = [], C = [], I = 0; I < this.faces.length; I++) { C.push(this.faces[I].a, this.faces[I].b, this.faces[I].c); var R = this.faces[I].vertexColors; if (R.length === 3) L.push(R[0], R[1], R[2]); else { var b = this.faces[I].color; L.push(b, b, b); } } f.setIndex(C), f.groups = this.computeGroups(); } if (0 < this.morphTargets.length) { for (var P = [], N = [], D = 0, k = this.morphTargets.length; D < k; D++) { var V = this.morphTargets[D], q = new l.Float32BufferAttribute(3 * V.vertices.length, 3); if (q.name = V.name, P.push(q.copyVector3sArray(V.vertices)), V.normals) { var Y = new l.Float32BufferAttribute(3 * V.normals.length, 3); Y.name = V.name, N.push(Y.copyVector3sArray(V.normals)); } } f.morphAttributes.position = P, f.morphAttributes.normal = N; } if (0 < this.skinIndices.length) { var ne = new l.Float32BufferAttribute(4 * this.skinIndices.length, 4); f.setAttribute("skinIndex", ne.copyVector4sArray(this.skinIndices)); } if (0 < this.skinWeights.length) { var X = new l.Float32BufferAttribute(4 * this.skinWeights.length, 4); f.setAttribute("skinWeight", X.copyVector4sArray(this.skinWeights)); } return this.boundingSphere !== null && (f.boundingSphere = this.boundingSphere.clone()), this.boundingBox !== null && (f.boundingBox = this.boundingBox.clone()), f; }, computeTangents: function() { console.error("THREE.Geometry: .computeTangents() has been removed."); }, computeLineDistances: function() { console.error("THREE.Geometry: .computeLineDistances() has been removed. Use THREE.Line.computeLineDistances() instead."); }, applyMatrix: function(f) { return console.warn("THREE.Geometry: .applyMatrix() has been renamed to .applyMatrix4()."), this.applyMatrix4(f); }, dispose: function() { this.dispatchEvent({ type: "dispose" }); } }), m.createBufferGeometryFromObject = function(f) { var v = new l.BufferGeometry(), M = f.geometry; if (f.isPoints || f.isLine) { var S = new l.Float32BufferAttribute(3 * M.vertices.length, 3), T = new l.Float32BufferAttribute(3 * M.colors.length, 3); if (v.setAttribute("position", S.copyVector3sArray(M.vertices)), v.setAttribute("color", T.copyColorsArray(M.colors)), M.lineDistances && M.lineDistances.length === M.vertices.length) { var x = new l.Float32BufferAttribute(M.lineDistances.length, 1); v.setAttribute("lineDistance", x.copyArray(M.lineDistances)); } M.boundingSphere !== null && (v.boundingSphere = M.boundingSphere.clone()), M.boundingBox !== null && (v.boundingBox = M.boundingBox.clone()); } else f.isMesh && (v = M.toBufferGeometry()); return v; }; class d { constructor() { this.vertices = [], this.normals = [], this.colors = [], this.uvs = [], this.uvs2 = [], this.groups = [], this.morphTargets = {}, this.skinWeights = [], this.skinIndices = [], this.boundingBox = null, this.boundingSphere = null, this.verticesNeedUpdate = !1, this.normalsNeedUpdate = !1, this.colorsNeedUpdate = !1, this.uvsNeedUpdate = !1, this.groupsNeedUpdate = !1; } computeGroups(v) { var M, S, T = [], x = void 0, w = v.faces; for (S = 0; S < w.length; S++) { var A = w[S]; A.materialIndex !== x && (x = A.materialIndex, M !== void 0 && (M.count = 3 * S - M.start, T.push(M)), M = { start: 3 * S, materialIndex: x }); } M !== void 0 && (M.count = 3 * S - M.start, T.push(M)), this.groups = T; } fromGeometry(v) { var M, S = v.faces, T = v.vertices, x = v.faceVertexUvs, w = x[0] && 0 < x[0].length, A = x[1] && 0 < x[1].length, _ = v.morphTargets, E = _.length; if (0 < E) { M = []; for (var O = 0; O < E; O++) M[O] = { name: _[O].name, data: [] }; this.morphTargets.position = M; } var L, C = v.morphNormals, I = C.length; if (0 < I) { L = []; for (var R = 0; R < I; R++) L[R] = { name: C[R].name, data: [] }; this.morphTargets.normal = L; } var b = v.skinIndices, P = v.skinWeights, N = b.length === T.length, D = P.length === T.length; 0 < T.length && S.length === 0 && console.error("THREE.DirectGeometry: Faceless geometries are not supported."); for (var k, V = 0; V < S.length; V++) { k = S[V], this.vertices.push(T[k.a], T[k.b], T[k.c]); var q = k.vertexNormals; if (q.length === 3) this.normals.push(q[0], q[1], q[2]); else { var Y = k.normal; this.normals.push(Y, Y, Y); } var ne = k.vertexColors; if (ne.length === 3) this.colors.push(ne[0], ne[1], ne[2]); else { var X = k.color; this.colors.push(X, X, X); } if (w === !0) { var z = x[0][V]; z === void 0 ? (console.warn("THREE.DirectGeometry.fromGeometry(): Undefined vertexUv ", V), this.uvs.push(new l.Vector2(), new l.Vector2(), new l.Vector2())) : this.uvs.push(z[0], z[1], z[2]); } if (A === !0) { var H = x[1][V]; H === void 0 ? (console.warn("THREE.DirectGeometry.fromGeometry(): Undefined vertexUv2 ", V), this.uvs2.push(new l.Vector2(), new l.Vector2(), new l.Vector2())) : this.uvs2.push(H[0], H[1], H[2]); } for (var ee, Q = 0; Q < E; Q++) ee = _[Q].vertices, M[Q].data.push(ee[k.a], ee[k.b], ee[k.c]); for (var J, W = 0; W < I; W++) J = C[W].vertexNormals[V], L[W].data.push(J.a, J.b, J.c); N && this.skinIndices.push(b[k.a], b[k.b], b[k.c]), D && this.skinWeights.push(P[k.a], P[k.b], P[k.c]); } return this.computeGroups(v), this.verticesNeedUpdate = v.verticesNeedUpdate, this.normalsNeedUpdate = v.normalsNeedUpdate, this.colorsNeedUpdate = v.colorsNeedUpdate, this.uvsNeedUpdate = v.uvsNeedUpdate, this.groupsNeedUpdate = v.groupsNeedUpdate, v.boundingSphere !== null && (this.boundingSphere = v.boundingSphere.clone()), v.boundingBox !== null && (this.boundingBox = v.boundingBox.clone()), this; } } class y { constructor(v, M, S, T, x) { var w = 5 < arguments.length && arguments[5] !== void 0 ? arguments[5] : 0; this.a = v, this.b = M, this.c = S, this.normal = T && T.isVector3 ? T : new l.Vector3(), this.vertexNormals = Array.isArray(T) ? T : [], this.color = x && x.isColor ? x : new l.Color(), this.vertexColors = Array.isArray(x) ? x : [], this.materialIndex = w; } clone() { return new this.constructor().copy(this); } copy(v) { this.a = v.a, this.b = v.b, this.c = v.c, this.normal.copy(v.normal), this.color.copy(v.color), this.materialIndex = v.materialIndex; for (var M = 0, S = v.vertexNormals.length; M < S; M++) this.vertexNormals[M] = v.vertexNormals[M].clone(); for (var T = 0, x = v.vertexColors.length; T < x; T++) this.vertexColors[T] = v.vertexColors[T].clone(); return this; } } }, /* 7 */ /***/ (a) => { a.exports = o4; }, /* 8 */ /***/ (a) => { a.exports = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAAXNSR0IArs4c6QAAAAZiS0dEAAAAAAAA+UO7fwAAAAlwSFlzAAALEwAACxMBAJqcGAAAAAd0SU1FB9sHDgwCEMBJZu0AAAAdaVRYdENvbW1lbnQAAAAAAENyZWF0ZWQgd2l0aCBHSU1QZC5lBwAABM5JREFUWMO1V0tPG2cUPZ4Hxh6DazIOrjFNqJs0FIMqWFgWQkatsmvVbtggKlSVRVf5AWz4AWz4AUSKEChll19QJYSXkECuhFxsHjEhxCYm+DWGMZ5HF72DJq4bAzFXurI0M/I5997v3u9cC65vTJVn2lX/xHINQOYSBLTLEuIuCWw4Z3IGAEvf6ASmVHjNzHCXBG4A0AjACsAOwEbO0nsFQBnAGYASAIl+ZRMR7SolMEdsByD09fV5R0ZGgg8ePPjW5/N1iqLYpuu6RZblciKR2I9Go69evnwZnZ+fjwI4IS8AKBIRzeQfJWCANwKwh0KhtrGxsYehUOin1tbW+zzP23ietzY2NnIAoGmaLsuyUiqVyvl8XtrY2NiamZn589mzZxsAUgCOAeQAnFI2tI+VxIjaAeDzoaGh7xYWFuZOTk6OZVk+12uYqqq6JEnn0Wg0OT4+/geAXwGEAdwDIFJQXC1wO4DWR48e/RCPxxclSSroVzRFUbSDg4P848ePFwH8DuAhkWih83TRQWxFOXgAwvDwcOfo6OhvXV1d39tsNtuVBwTDWBwOh1UUxVsMw1hXVlbSdCgNV43uYSvrHg6H24aHh38eHBz85TrgF9FYLHA4HLzH43FvbW2d7u/vG+dANp8FpqIlbd3d3V8Fg8EfBUFw4BONZVmL3+9vHhkZCQL4AoAHgJPK8G+yzC0XDofdoVAo5PP5vkadTBAEtr+/39ff3x8gAp/RPOEqx2qjx+NpvXv3bk9DQ0NDvQgwDIOWlhZrMBj8kgi0UJdxRgYMArzL5XJ7vd57qLPZ7Xamp6fnNgBXtQxcjFuHw+Hyer3t9SYgCAITCAScAJoBNNEY/08GOFVVrfVMv7kMNDntFD1vjIAPrlRN0xjckOm6biFQ3jwNPwDMZrOnqVTqfb3Bi8Wivru7W/VCYkwPlKOjo0IikXh7EwQikYgE4Nw0CfXKDCipVCoTj8df3QABbW1tLUc6oUgkFPMkVACUNjc337148eKvw8PDbJ2jP1taWkoCyNDVXDSECmNSK4qiKNLq6urW8+fPI/UicHx8rD59+jSVy+WOAKSJhKENwFItLtoxk8mwsixzHR0dHe3t7c5PAU+n09rs7OzJkydPYqVSaQfANoDXALIk31S2smU1TWMPDg7K5XKZ7+3t9TudTut1U7+wsFCcmJiIpdPpbQBxADsAknQWymYCOukBHYCuKApisdhpMpnURFEU79y503TVyKenpzOTk5M7e3t7MQKPV0Zv1gNm+awB0MvlshqLxfLb29uyJElWURSbXC4XXyvqxcXFs6mpqeTc3Nzu3t7e3wQcA7BPZ8Cov1pNlJplmQtAG8MwHV6v95tAINA5MDBwPxAIuLu6upr8fr/VAN3c3JQjkcjZ+vp6fnl5+d2bN29SuVzuNYAEpf01CdRChUL+X1VskHACuA3Ay3Fcu9vt7nA6nZ7m5uYWQRCaNE3jVVW15PP580KhIGUymWw2m00DOAJwSP4WwPtq4LX2Ao6USxNlQyS/RcQcdLGwlNIz6vEMAaZpNzCk2Pll94LK/cDYimxERiBwG10sxjgvEZBE0UpE6vxj+0Ct5bTaXthgEhRmja8QWNkkPGsuIpfdjpkK+cZUWTC0KredVmtD/gdlSl6EG4AMvQAAAABJRU5ErkJggg=="; }, /* 9 */ /***/ (a, s) => { s.augmentMorphColor = function() { return function(c) { c.vertexShader = c.vertexShader.replace("#include ", ["varying vec3 vColor;", "attribute vec3 morphColor0;", "attribute vec3 morphColor1;"].join(` `)), c.vertexShader = c.vertexShader.replace("#include ", ["vColor.xyz = color.xyz;", "#ifdef USE_MORPHTARGETS", "vColor = morphColor0 * morphTargetInfluences[ 0 ];", "vColor += morphColor1 * morphTargetInfluences[ 1 ];", "#endif"].join(` `)); }; }; }, /* 10 */ /***/ (a, s, c) => { var l = c(4), h = c(5).createBufferGeometry, u = c(5).resolveURL, p = 0, g = function() { return "pr" + p++; }, m = function() { this.isZincObject = !0, this.geometry = void 0, this.morph = void 0, this.group = new l.Group(), this._lod = new (c(11)).LOD(this), this.groupName = void 0, this.timeEnabled = !1, this.morphColour = !1, this.inbuildTime = 0, this.mixer = void 0, this.animationGroup = void 0, this.duration = 6e3, this.clipAction = void 0, this.userData = {}, this.videoHandler = void 0, this.marker = void 0, this.markerNumber = void 0, this.markerUpdateRequired = !0, this.closestVertexIndex = -1, this.boundingBoxUpdateRequired = !0, this.cachedBoundingBox = new l.Box3(), this.anatomicalId = void 0, this.region = void 0, this.animationClip = void 0, this.markerMode = "inherited", this.uuid = g(), this._v1 = new l.Vector3(), this._v2 = new l.Vector3(), this._b1 = new l.Box3(), this.center = new l.Vector3(), this.radius = 0, this.visible = !0, this.drawRange = -1; }; m.prototype.setDuration = function(d) { this.duration = d, this.clipAction && this.clipAction.setDuration(this.duration); }, m.prototype.getDuration = function() { return this.duration; }, m.prototype.setRegion = function(d) { this.region = d; }, m.prototype.getRegion = function() { return this.region; }, m.prototype.getMorph = function() { var d = this._lod.getCurrentMorph(); return d || this.morph; }, m.prototype.getGroup = function() { return this.group; }, m.prototype.setMorph = function(d) { this.morph = d, this.group.add(this.morph); var y = this._lod.calculateDistance("far"); this._lod.addLevel(d, y), this._lod.setMaterial(d.material); }, m.prototype.checkTransparentMesh = function() { }, m.prototype.setMesh = function(d, y, f) { this.animationGroup = new l.AnimationObjectGroup(d), this.mixer = new l.AnimationMixer(this.animationGroup); var v = d.geometry; if (this.geometry = d.geometry, this.clipAction = void 0, v && v.morphAttributes) { var M = v.morphAttributes.position; M || (M = v.morphAttributes.color ? v.morphAttributes.color : v.morphAttributes.normal), M && (this.animationClip = l.AnimationClip.CreateClipsFromMorphTargetSequences(M, 10, !0), this.animationClip && this.animationClip[0] != null && (this.clipAction = this.mixer.clipAction(this.animationClip[0]).setDuration(this.duration), this.clipAction.loop = l.loopOnce, this.clipAction.clampWhenFinished = !0, this.clipAction.play())); } this.timeEnabled = y, this.morphColour = f, d.userData = this, d.matrixAutoUpdate = !1, this.setMorph(d), this.checkTransparentMesh(), this.timeEnabled ? this.setFrustumCulled(!1) : this.morphColour && (v.setAttribute("morphTarget0", v.getAttribute("position")), v.setAttribute("morphTarget1", v.getAttribute("position"))), this.boundingBoxUpdateRequired = !0; }, m.prototype.setName = function(d) { this.groupName = d, this._lod.setName(d); }, m.prototype.getCurrentTime = function() { if (this.clipAction) { var d = this.clipAction.time / this.clipAction._clip.duration; return this.duration * d; } return this.inbuildTime; }, m.prototype.setMorphTime = function(d) { var y = !1; if (this.clipAction) { var f = d / this.duration, v = this.clipAction._clip.duration, M = f * v; M != this.clipAction.time && (this.clipAction.time = M, y = !0), y && this.isTimeVarying() && this.mixer.update(0); } else { var S = d; S = d > this.duration ? this.duration : 0 > d ? 0 : d, S != this.inbuildTime && (this.inbuildTime = S, y = !0); } y && (this.boundingBoxUpdateRequired = !0, this._lod.updateMorphColorAttribute(!0), this.timeEnabled && (this.markerUpdateRequired = !0)); }, m.prototype.isTimeVarying = function() { return !!(this.timeEnabled || this.morphColour); }, m.prototype.getVisibility = function() { return this.visible; }, m.prototype.setVisibility = function(d) { d !== this.visible && (this.visible = d, this.group.visible = d, this.region && (this.region.pickableUpdateRequired = !0)); }, m.prototype.setAlpha = function(d) { var y = this._lod._material, f = !1; 1 > d && (f = !0), y.opacity = d, y.transparent = f, this.checkTransparentMesh(); }, m.prototype.setFrustumCulled = function(d) { this._lod.setFrustumCulled(d); }, m.prototype.setVertexColors = function(d) { this._lod.setVertexColors(d); }, m.prototype.getColour = function() { return this._lod._material ? this._lod._material.color : void 0; }, m.prototype.setColour = function(d) { this._lod.setColour(d); }, m.prototype.getColourHex = function() { return !this.morphColour && this._lod._material && this._lod._material.color ? this._lod._material.color.getHexString() : void 0; }, m.prototype.setColourHex = function(d) { this._lod._material.color.setHex(d), this._lod._secondaryMaterial && this._lod._secondaryMaterial.color.setHex(d); }, m.prototype.setEmissiveRGB = function(d) { this._lod._material && this._lod._material.emissive && this._lod._material.emissive.setRGB(...d), this._lod._secondaryMaterial && this._lod._secondaryMaterial.emissive.setRGB(...d); }, m.prototype.setMaterial = function(d) { this._lod.setMaterial(d); }, m.prototype.getClosestVertexIndex = function() { var d = -1, y = this.getMorph(); if (y && y.geoemtry) { var f = y.geometry.attributes.position; if (this._b1.setFromBufferAttribute(f), this._b1.getCenter(this._v1), f) for (var v = -1, M = 0, S = 0; S < f.count; S++) this._v2.fromArray(f.array, 3 * S), M = this._v2.distanceTo(this._v1), v == -1 ? v = M : v > M && (v = M, d = S); } return d; }, m.prototype.getClosestVertex = function(d) { var y = new l.Vector3(); this.closestVertexIndex == -1 && (this.closestVertexIndex = this.getClosestVertexIndex()); var f = this.getMorph(); if (f && f.geometry && 0 <= this.closestVertexIndex) { var v = f.morphTargetInfluences, M = f.geometry.morphAttributes; if (v && M && M.position) { for (var S = !1, T = 0; T < v.length; T++) 0 < v[T] && (S = !0, this._v1.fromArray(M.position[T].array, 3 * this.closestVertexIndex), y.add(this._v1.multiplyScalar(v[T]))); if (S) return d ? y.applyMatrix4(f.matrixWorld) : y; } else return y.fromArray(f.geometry.attributes.position.array, 3 * this.closestVertexIndex), d ? y.applyMatrix4(f.matrixWorld) : y; } return this.getBoundingBox(), y.copy(this.center), d ? y.applyMatrix4(this.morph.matrixWorld) : y; }, m.prototype.getBoundingBox = function() { if (this.visible) { var d = this._lod.getCurrentMorph(); if (d && d.visible) return this.boundingBoxUpdateRequired && (c(5).getBoundingBox(d, this.cachedBoundingBox, this._b1, this._v1, this._v2), this.cachedBoundingBox.getCenter(this.center), this.radius = this.center.distanceTo(this.cachedBoundingBox.max), this.boundingBoxUpdateRequired = !1), this.cachedBoundingBox; } }, m.prototype.dispose = function() { this._lod.dispose(), this.animationGroup = void 0, this.mixer = void 0, this.morph = void 0, this.group = void 0, this.clipAction = void 0, this.groupName = void 0; }, m.prototype.markerIsRequired = function(d) { return !!(this.visible && (this.markerMode === "on" || d && d.displayMarkers && this.markerMode === "inherited")); }, m.prototype.updateMarker = function(d, y) { if (d == !1 && this.markerIsRequired(y)) { var f = y.ndcToBeUpdated; if (this.groupName) { if (this.marker || (this.marker = new (c(14)).Marker(this), this.markerUpdateRequired = !0), this.markerUpdateRequired) { var v = this.getClosestVertex(!1); v && (this.marker.setPosition(v.x, v.y, v.z), this.markerUpdateRequired = !1); } this.marker.isEnabled() || (y.markersList && !(this.marker.uuid in y.markersList) && (f = !0, y.markersList[this.marker.uuid] = this.marker), this.marker.enable(), this.group.add(this.marker.morph)), this.marker.setNumber(this.markerNumber), this.markerImgURL ? this.marker.loadUserSprite(this.markerImgURL) : this.marker.setDefaultSprite(), y && y.camera && (f || y.markerCluster.markerUpdateRequired) && (this.marker.updateNDC(y.camera.cameraObject), y.markerCluster.markerUpdateRequired = !0); } } else this.marker && this.marker.isEnabled() && (this.marker.disable(), this.group.remove(this.marker.morph), y.markersList && this.marker.uuid in y.markersList && (y.markerCluster.markerUpdateRequired = !0, delete y.markersList[this.marker.uuid])), this.markerUpdateRequired = !0; }, m.prototype.processMarkerVisual = function(d, y) { this.marker && this.marker.isEnabled() && this.marker.updateVisual(d, y); }, m.prototype.initiateMorphColor = function() { this.morphColour == 1 && this._lod.updateMorphColorAttribute(!1); }, m.prototype.setRenderOrder = function(d) { this._lod.setRenderOrder(d); }, m.prototype.getClosestVertexDOMElementCoords = function(d) { if (d && d.camera) { var y = !0, f = this.getClosestVertex(!0); return f.project(d.camera), f.z = Math.min(Math.max(f.z, 0), 1), (1 < f.x || -1 > f.x || 1 < f.y || -1 > f.y) && (y = !1), d.getZincCameraControls().getRelativeCoordsFromNDC(f.x, f.y, f), { position: f, inView: y }; } }, m.prototype.setMarkerMode = function(d, y) { d !== this.markerMode && (this.markerMode = d === "on" || d === "off" ? d : "inherited", this.region && (this.region.pickableUpdateRequired = !0)), y && (this.markerNumber = y.number, this.markerImgURL = y.imgURL); }, m.prototype.render = function(d, y, f, v) { if (this.visible && !(this.timeEnabled && y) && this._lod.update(f, this.center), y == !0) { if (this.clipAction && this.isTimeVarying()) this.mixer.update(d); else { var M = this.inbuildTime + d; M > this.duration && (M -= this.duration), this.inbuildTime = M; } this.visible && d != 0 && (this.boundingBoxUpdateRequired = !0, this.morphColour == 1 && this._lod.updateMorphColorAttribute(!0)); } this.updateMarker(y, v); }, m.prototype.addLOD = function(d, y, f, v, M) { this._lod.addLevelFromURL(d, y, f, v, M); }, m.prototype.addVertices = function(d) { var y = this.getMorph(), f = void 0; if (!y) f = h(500, d), this.drawRange = d.length; else if (-1 < this.drawRange) { var v = y.geometry.getAttribute("position"); d.forEach((M) => { v.setXYZ(this.drawRange, M[0], M[1], M[2]), ++this.drawRange; }), v.needsUpdate = !0, y.geometry.setDrawRange(0, this.drawRange), y.geometry.computeBoundingBox(), y.geometry.computeBoundingSphere(), f = y.geoemtry, this.boundingBoxUpdateRequired = !0; } return f; }, m.prototype.setPosition = function(d, y, f) { var v = this.getGroup(); v && (v.position.set(d, y, f), v.updateMatrix(), this.boundingBoxUpdateRequired = !0); }, m.prototype.loadAdditionalSources = function(d) { d.load(u(filename), meshloader(region, colour, opacity, localTimeEnabled, localMorphColour, void 0, void 0, void 0, void 0, finishCallback), this.onProgress(filename), this.onError(finishCallback)); }, m.prototype.setScaleAll = function(d) { var y = this.getGroup(); y && (y.scale.set(d, d, d), y.updateMatrix(), this.boundingBoxUpdateRequired = !0); }, s.ZincObject = m; }, /* 11 */ /***/ (a, s, c) => { var l = c(4), h = c(5).updateMorphColorAttribute, u = c(5).toBufferGeometry, p = function(g) { this.levels = [], this._currentLevel = 0, this._renderOrder = 1, this._material = void 0, this._secondaryMaterial = void 0, this._loader = void 0, this._parent = g, this.addLevel = (d, y) => { if (d) { var f, v = Math.abs(y); for (f = 0; f < this.levels.length && !(v < this.levels[f].distance); f++) ; this.levels.splice(f, 0, { distance: v, morph: d, loaded: !0, loading: !1, url: "" }), d.renderOrder = this._renderOrder; } }, this.levelLoaded = (d, y) => { if (d) { for (var f = Math.abs(y), v = 0; v < this.levels.length; v++) if (f === this.levels[v].distance) { this._parent.group.add(d), this.levels[v].morph = d, this.levels[v].loaded = !0, this.levels[v].loading = !1; break; } this.checkTransparentMesh(); } }, this.addLevelFromURL = (d, y, f, v, M) => { this._loader = d; var S, T = this.calculateDistance(y); for (S = 0; S < this.levels.length && !(T < this.levels[S].distance); S++) ; this.levels.splice(S, 0, { distance: T, morph: void 0, loaded: !1, loading: !1, url: f, index: v }), M && this.loadLevel(S); }, this.loadLevel = (d) => { var y = this.levels[d]; return y.morph || y.loaded || y.loading || (y.loading = !0, this._loader.load(y.url, this.lodLoader(y.distance), void 0, void 0, { index: y.index })), y.morph === void 0; }, this.calculateDistance = function(d) { this._parent.getBoundingBox(); var y = this._parent.radius, f = 0; return d === "far" ? f = 4.5 * y : d === "medium" ? f = 2.5 * y : d == "close" && (f = 0), f; }, this.containsLevels = () => !!(this.levels && 1 < this.levels.length), this.checkTransparentMesh = () => { var d = this.levels[this._currentLevel]; this._material && (this._material.transparent ? (!this._secondaryMaterial && (this._secondaryMaterial = this._material.clone(), this._secondaryMaterial.side = l.FrontSide), this._secondaryMaterial.opacity = this._material.opacity, this._secondaryMaterial.emissive && this._secondaryMaterial.emissive.copy(this._material.emissive), this._secondaryMaterial.needsUpdate = !0, !d.secondaryMesh && (d.secondaryMesh = new l.Mesh(d.morph.geometry, this._secondaryMaterial), d.secondaryMesh.renderOrder = d.morph.renderOrder + 1, d.secondaryMesh.userData = d.morph.userData, d.secondaryMesh.name = d.morph.name), this._material.side = l.BackSide, this._material.needsUpdate = !0, !d.secondaryMesh.parent && (d.morph.add(d.secondaryMesh), this._parent.animationGroup && this._parent.animationGroup.add(d.secondaryMesh))) : (d.secondaryMesh && (d.morph.remove(d.secondaryMesh), this._parent.animationGroup && (this._parent.animationGroup.uncache(d.secondaryMesh), this._parent.animationGroup.remove(d.secondaryMesh))), this._material.side = l.DoubleSide, this._material.needsUpdate = !0)); }, this.dispose = () => { this.levels.forEach((d) => { d.morph && d.morph.geometry && d.morph.geometry.dispose(); }), this._material && this._material.dispose(), this._secondaryMaterial && this._secondaryMaterial.dispose(); }, this.getCurrentLevel = () => this._currentLevel, this.getCurrentMorph = () => { var d = this.levels[this._currentLevel]; return d && d.morph ? d.morph : this._parent.morph; }, this.lodLoader = function(d) { return (y) => { var f = this._material, v = { localTimeEnabled: this._parent.timeEnabled, localMorphColour: this._parent.morphColour }, M = u(y, v), S = void 0; this._parent.isGeometry ? S = new l.Mesh(M, f) : this._parent.isLines && (S = new (c(12)).LineSegments(M, f)), S.userData = this._parent, S.renderOrder = this._renderOrder, y.dispose(), this.levelLoaded(S, d); }; }, this.updateMorphColorAttribute = (d) => { if (this._material && (this._material.vertexColors == l.VertexColors || this._material.vertexColors == !0)) if (d) { var y = this.getCurrentMorph(); h(y.geometry, y); } else this.levels.forEach((f) => { f.morph && f.morph.geometry && h(f.morph.geometry, f.morph); }); }, this.setColour = (d) => { this._material.color = d, this._secondaryMaterial && (this._secondaryMaterial.color = d), m(); }, this.setFrustumCulled = (d) => { this.levels.forEach((y) => { y.morph && (y.morph.frustumCulled = d), y.secondaryMesh && (y.secondaryMesh.frustumCulled = d); }); }, this.setMaterial = (d) => { d && (!this._material || this._material.id !== d.id) && (this._material = d, this._secondaryMaterial && this._secondaryMaterial.dispose(), this._secondaryMaterial = d.clone(), this._secondaryMaterial.side = l.FrontSide, this._secondaryMaterial.transparent = !0, this.levels.forEach((y) => { y.morph && (y.morph.material = this._material, y.morph.geometry && (y.morph.geometry.colorsNeedUpdate = !0)), y.secondaryMesh && (y.secondaryMesh.material = this._secondaryMaterial); })); }, this.setName = (d) => { this.levels.forEach((y) => { y.morph && (y.morph.name = d), y.secondaryMesh && (y.secondaryMesh.name = d); }); }, this.setRenderOrder = (d) => { this._renderOrder = d, this.levels.forEach((y) => { y.morph && (y.morph.renderOrder = d), y.secondaryMesh && (y.secondaryMesh.renderOrder = d); }); }, this.setVertexColors = (d) => { this._material.vertexColors = d, m(), this._secondaryMaterial && (this._secondaryMaterial.vertexColors = d); }, this.update = (d, y) => { var f = this.levels; if (1 < f.length) { var v, M, S = d.cameraObject.position.distanceTo(y), T = -1, x = -1; for (v = 0, M = f.length; v < M && S >= f[v].distance; v++) f[v].morph ? (-1 < T && f[T].morph && (f[T].morph.visible = !1), T = v, f[v].morph.visible = !0, x = -1) : x = v; for (-1 < x && this.loadLevel(x); v < M; v++) f[v].morph && (-1 < T ? f[v].morph.visible = !1 : (f[v].morph.visible = !0, T = v)); this._currentLevel != T && (this._currentLevel = T, this.checkTransparentMesh()); } }, this.toggleMarker = (d, y) => { this.levels.forEach((f) => { f.morph && (y ? f.morph.add(d) : f.morph.remove(d)); }); }; var m = () => { this.levels.forEach((d) => { d.morph && d.morph.geometry && (d.morph.geometry.colorsNeedUpdate = !0); }); }; }; s.LOD = p; }, /* 12 */ /***/ (a, s, c) => { c.r(s), c.d(s, { /* harmony export */ LineSegments: () => ( /* binding */ g ) /* harmony export */ }); var l = c(13), h = c(4), u = /* @__PURE__ */ new h.Vector3(), p = /* @__PURE__ */ new h.Vector3(); class g extends l.Line { constructor(d, y) { super(d, y), this.type = "LineSegments"; } computeLineDistances() { var d = this.geometry; if (!d.isBufferGeometry) d.isGeometry && console.error("THREE.LineSegments.computeLineDistances() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead."); else if (d.index === null) { for (var y = d.attributes.position, f = [], v = 0, M = y.count; v < M; v += 2) u.fromBufferAttribute(y, v), p.fromBufferAttribute(y, v + 1), f[v] = v == 0 ? 0 : f[v - 1], f[v + 1] = f[v] + u.distanceTo(p); d.setAttribute("lineDistance", new h.Float32BufferAttribute(f, 1)); } else console.warn("THREE.LineSegments.computeLineDistances(): Computation only possible with non-indexed BufferGeometry."); return this; } } g.prototype.isLineSegments = !0; }, /* 13 */ /***/ (a, s, c) => { c.r(s), c.d(s, { /* harmony export */ Line: () => ( /* binding */ M ) /* harmony export */ }); var l = c(4), h = /* @__PURE__ */ new l.Vector3(), u = /* @__PURE__ */ new l.Vector3(), p = /* @__PURE__ */ new l.Matrix4(), g = /* @__PURE__ */ new l.Ray(), m = /* @__PURE__ */ new l.Sphere(), d = /* @__PURE__ */ new l.Vector3(), y = /* @__PURE__ */ new l.Vector3(), f = /* @__PURE__ */ new l.Vector3(), v = /* @__PURE__ */ new l.Vector3(); class M extends l.Object3D { constructor() { var x = 0 < arguments.length && arguments[0] !== void 0 ? arguments[0] : new l.BufferGeometry(), w = 1 < arguments.length && arguments[1] !== void 0 ? arguments[1] : new l.LineBasicMaterial(); super(), this.type = "Line", this.geometry = x, this.material = w, this.updateMorphTargets(); } copy(x) { return super.copy(x), this.material = x.material, this.geometry = x.geometry, this; } computeLineDistances() { var x = this.geometry; if (!x.isBufferGeometry) x.isGeometry && console.error("THREE.Line.computeLineDistances() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead."); else if (x.index === null) { for (var w = x.attributes.position, A = [0], _ = 1, E = w.count; _ < E; _++) h.fromBufferAttribute(w, _ - 1), u.fromBufferAttribute(w, _), A[_] = A[_ - 1], A[_] += h.distanceTo(u); x.setAttribute("lineDistance", new l.Float32BufferAttribute(A, 1)); } else console.warn("THREE.Line.computeLineDistances(): Computation only possible with non-indexed BufferGeometry."); return this; } raycast(x, w) { var A = this.geometry, _ = this.matrixWorld, E = x.params.Line.threshold, O = A.drawRange, L = A.morphAttributes.position; if (A.boundingSphere === null && A.computeBoundingSphere(), m.copy(A.boundingSphere), m.applyMatrix4(_), m.radius += E, x.ray.intersectsSphere(m) !== !1) { p.copy(_).invert(), g.copy(x.ray).applyMatrix4(p); var C = E / ((this.scale.x + this.scale.y + this.scale.z) / 3), I = C * C, R = new l.Vector3(), b = new l.Vector3(), P = new l.Vector3(), N = new l.Vector3(), D = this.isLineSegments ? 2 : 1; if (A.isBufferGeometry) { var k = A.index, V = A.attributes, q = V.position; if (k !== null) for (var Y = Math.max(0, O.start), ne = Math.min(k.count, O.start + O.count), X = Y; X < ne - 1; X += D) { var z = k.getX(X), H = k.getX(X + 1); S(R, b, this, q, L, z, H); var ee = g.distanceSqToSegment(R, b, N, P); if (!(ee > I)) { N.applyMatrix4(this.matrixWorld); var Q = x.ray.origin.distanceTo(N); Q < x.near || Q > x.far || w.push({ distance: Q, // What do we want? intersection point on the ray or on the segment?? // point: raycaster.ray.at( distance ), point: P.clone().applyMatrix4(this.matrixWorld), index: X, face: null, faceIndex: null, object: this }); } } else for (var J = Math.max(0, O.start), W = Math.min(q.count, O.start + O.count), K = J; K < W - 1; K += D) { S(R, b, this, q, L, K, K + 1); var ie = g.distanceSqToSegment(R, b, N, P); if (!(ie > I)) { N.applyMatrix4(this.matrixWorld); var B = x.ray.origin.distanceTo(N); B < x.near || B > x.far || w.push({ distance: B, // What do we want? intersection point on the ray or on the segment?? // point: raycaster.ray.at( distance ), point: P.clone().applyMatrix4(this.matrixWorld), index: K, face: null, faceIndex: null, object: this }); } } } else A.isGeometry && console.error("THREE.Line.raycast() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead."); } } updateMorphTargets() { var x = this.geometry; if (x.isBufferGeometry) { var w = x.morphAttributes, A = Object.keys(w); if (0 < A.length) { var _ = w[A[0]]; if (_ !== void 0) { this.morphTargetInfluences = [], this.morphTargetDictionary = {}; for (var E, O = 0, L = _.length; O < L; O++) E = _[O].name || O + "", this.morphTargetInfluences.push(0), this.morphTargetDictionary[E] = O; } } } else { var C = x.morphTargets; C !== void 0 && 0 < C.length && console.error("THREE.Line.updateMorphTargets() does not support THREE.Geometry. Use THREE.BufferGeometry instead."); } } } function S(T, x, w, A, _, E, O) { T.fromBufferAttribute(A, E), x.fromBufferAttribute(A, O); var L = w.morphTargetInfluences; if (w.material.morphTargets && _ && L) { d.set(0, 0, 0), y.set(0, 0, 0); for (var C = 0, I = _.length; C < I; C++) { var R = L[C], b = _[C]; R !== 0 && (f.fromBufferAttribute(b, E), v.fromBufferAttribute(b, O), d.addScaledVector(f.sub(T), R), y.addScaledVector(v.sub(x), R)); } T.add(d), x.add(y); } } M.prototype.isLine = !0; }, /* 14 */ /***/ (a, s, c) => { var l = c(4), h = new Image(128, 128); h.src = c(15); var u = new l.Texture(); u.image = h, u.needsUpdate = !0; var p = [0.02, 0.03, 1], g = new l.SpriteMaterial({ map: u, alphaTest: 0.5, transparent: !0, depthTest: !1, depthWrite: !1, sizeAttenuation: !1 }), m = c(5).createNewSpriteText, d = function(y) { c(10).ZincObject.call(this), this.texture = u; var f = void 0, v = void 0, M = void 0, S = void 0, T = void 0, x = !0; this.morph = new l.Group(), this.group = this.morph, this.parent = y, this.isMarker = !0; var w = !1; this.ndc = new l.Vector3(); var A = void 0, _ = void 0, E = () => { f = new l.Sprite(g), f.center.set(0.5, 0), this.morph.add(f), this.morph.position.set(0, 0, 0), this.morph.renderOrder = 1e4, f.scale.set(p[0], p[1], p[2]), f.userData = this; }; this.updateVisual = (O, L) => { var C = 1, I = 0; O !== L && (I = 1 - (this.ndc.z - O) / (L - O), C = 0.6 + 0.4 * I), this.setSpriteSize(C); }, this.updateNDC = (O) => (this.ndc.copy(this.morph.position), this.ndc.project(O), this.ndc.z = Math.min(Math.max(this.ndc.z, 0), 1), this.ndc), this.setPosition = (O, L, C) => { this.morph.position.set(O, L, C); }, this.setSpriteSize = (O) => { f.scale.set(0.015, 0.02, 1), f.scale.multiplyScalar(O); }, this.setUserSprite = () => { S && (this.morph.add(S), x && (this.morph.remove(f), _ && this.morph.remove(_), x = !1)); }, this.setImageForUserSprite = (O, L) => { S && (this.morph.remove(S), S = void 0), v && v.dispose(), M && M.dispose(), v = new l.Texture(), v.image = O, v.needsUpdate = !0, M = new l.SpriteMaterial({ map: v, alphaTest: 0.5, transparent: !0, depthTest: !1, depthWrite: !1, sizeAttenuation: !1 }), L || (L = [0.05, 0.05, 1]), S = new l.Sprite(M), S.center.set(0.5, 0), S.scale.set(L[0], L[1], L[2]), S.userData = this, this.setUserSprite(); }, this.setDefaultSprite = () => { x || (x = !0, this.morph.add(f), S && this.morph.remove(S), _ && this.morph.add(_)); }, this.loadUserSprite = (O, L) => { if (O) if (O !== T) { T = O; var C = new Image(128, 128); C.crossOrigin = "anonymous", C.onload = () => { this.setImageForUserSprite(C, L); }, C.src = O; } else this.setUserSprite(); }, this.dispose = () => { this.morph && this.morph.clear(), f && (f.clear(), f = void 0), _ && (_.material.map.dispose(), _.material.dispose(), _ = void 0); }, this.isEnabled = () => w, this.setNumber = (O) => { (!O || A != O) && _ && (this.morph.remove(_), _.material.map.dispose(), _.material.dispose(), _ = void 0), !_ && O && (_ = m(O, 0.012, "black", "Asap", 120, 700), this.morph.add(_)), A = O; }, this.getNumber = () => A || 1, this.setVisibility = function(O) { O !== this.visible && (this.visible = O, this.group.visible = O, this.parent.region && (this.parent.region.pickableUpdateRequired = !0)); }, this.enable = () => { w = !0, this.morph.visible = !0, this.visible = !0; }, this.disable = () => { w = !1, this.morph.visible = !1, this.visible = !1; }, E(); }; d.prototype = Object.create(c(10).ZincObject.prototype), s.Marker = d; }, /* 15 */ /***/ (a) => { a.exports = "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiIHN0YW5kYWxvbmU9Im5vIiA/Pg0KPCFET0NUWVBFIHN2ZyBQVUJMSUMgIi0vL1czQy8vRFREIFNWRyAxLjEvL0VOIiAiaHR0cDovL3d3dy53My5vcmcvR3JhcGhpY3MvU1ZHLzEuMS9EVEQvc3ZnMTEuZHRkIj4NCjxzdmcgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgdmVyc2lvbj0iMS4xIiB3aWR0aD0iMzY1IiBoZWlnaHQ9IjU2MCIgdmlld0JveD0iMCAwIDM2NSA1NjAiIHhtbDpzcGFjZT0icHJlc2VydmUiPg0KPGRlc2M+Q3JlYXRlZCB3aXRoIEZhYnJpYy5qcyA1LjIuNDwvZGVzYz4NCjxkZWZzPg0KPC9kZWZzPg0KPHJlY3QgeD0iMCIgeT0iMCIgd2lkdGg9IjEwMCUiIGhlaWdodD0iMTAwJSIgZmlsbD0idHJhbnNwYXJlbnQiPjwvcmVjdD4NCjxnIHRyYW5zZm9ybT0ibWF0cml4KDAgMCAwIDAgMCAwKSIgaWQ9IjgwOGVkMjgzLTI1MjQtNDQwZi04OGFlLTNiZGI0N2JiNTc0OSIgID4NCjwvZz4NCjxnIHRyYW5zZm9ybT0ibWF0cml4KDEgMCAwIDEgMTgyLjUgMjgwKSIgaWQ9ImRiMzA0MTNkLTViZmYtNGI5OC1hYjU5LTQ2NDQ5N2VlMTk5ZSIgID4NCjxyZWN0IHN0eWxlPSJzdHJva2U6IG5vbmU7IHN0cm9rZS13aWR0aDogMTsgc3Ryb2tlLWRhc2hhcnJheTogbm9uZTsgc3Ryb2tlLWxpbmVjYXA6IGJ1dHQ7IHN0cm9rZS1kYXNob2Zmc2V0OiAwOyBzdHJva2UtbGluZWpvaW46IG1pdGVyOyBzdHJva2UtbWl0ZXJsaW1pdDogNDsgZmlsbDogcmdiKDI1NSwyNTUsMjU1KTsgZmlsbC1ydWxlOiBub256ZXJvOyBvcGFjaXR5OiAxOyB2aXNpYmlsaXR5OiBoaWRkZW47IiB2ZWN0b3ItZWZmZWN0PSJub24tc2NhbGluZy1zdHJva2UiICB4PSItMTgyLjUiIHk9Ii0yODAiIHJ4PSIwIiByeT0iMCIgd2lkdGg9IjM2NSIgaGVpZ2h0PSI1NjAiIC8+DQo8L2c+DQo8ZyB0cmFuc2Zvcm09Im1hdHJpeCgwIDAgMCAwIDAgOTcuNSkiICA+DQo8ZyBzdHlsZT0iIiAgID4NCjwvZz4NCjwvZz4NCjxnIHRyYW5zZm9ybT0ibWF0cml4KDAgMCAwIDAgMCA5Ny41KSIgID4NCjxnIHN0eWxlPSIiICAgPg0KPC9nPg0KPC9nPg0KPGcgdHJhbnNmb3JtPSJtYXRyaXgoMC45OSAwIDAgMC45OSAxODIuNSAyODApIiAgPg0KPGcgc3R5bGU9IiIgdmVjdG9yLWVmZmVjdD0ibm9uLXNjYWxpbmctc3Ryb2tlIiAgID4NCgkJPGcgdHJhbnNmb3JtPSJtYXRyaXgoMSAwIDAgMSAwIDApIiAgPg0KPHJlY3Qgc3R5bGU9InN0cm9rZTogbm9uZTsgc3Ryb2tlLXdpZHRoOiAxOyBzdHJva2UtZGFzaGFycmF5OiBub25lOyBzdHJva2UtbGluZWNhcDogYnV0dDsgc3Ryb2tlLWRhc2hvZmZzZXQ6IDA7IHN0cm9rZS1saW5lam9pbjogbWl0ZXI7IHN0cm9rZS1taXRlcmxpbWl0OiA0OyBmaWxsOiByZ2IoMjU1LDI1NSwyNTUpOyBmaWxsLXJ1bGU6IG5vbnplcm87IG9wYWNpdHk6IDE7IHZpc2liaWxpdHk6IGhpZGRlbjsiIHZlY3Rvci1lZmZlY3Q9Im5vbi1zY2FsaW5nLXN0cm9rZSIgIHg9Ii01NDAiIHk9Ii01NDAiIHJ4PSIwIiByeT0iMCIgd2lkdGg9IjEwODAiIGhlaWdodD0iMTA4MCIgLz4NCjwvZz4NCgkJPGcgdHJhbnNmb3JtPSJtYXRyaXgoMSAwIDAgMSAwIDApIiAgPg0KPHBhdGggc3R5bGU9InN0cm9rZTogcmdiKDAsMCwwKTsgc3Ryb2tlLXdpZHRoOiAwOyBzdHJva2UtZGFzaGFycmF5OiBub25lOyBzdHJva2UtbGluZWNhcDogYnV0dDsgc3Ryb2tlLWRhc2hvZmZzZXQ6IDA7IHN0cm9rZS1saW5lam9pbjogbWl0ZXI7IHN0cm9rZS1taXRlcmxpbWl0OiA0OyBmaWxsOiByZ2IoMCw4OSwxMTYpOyBmaWxsLXJ1bGU6IG5vbnplcm87IG9wYWNpdHk6IDE7IiB2ZWN0b3ItZWZmZWN0PSJub24tc2NhbGluZy1zdHJva2UiICB0cmFuc2Zvcm09IiB0cmFuc2xhdGUoLTE4Mi45LCAtMjc5Ljg1KSIgZD0iTSAxODIuOSA1NTEuNyBDIDE4Mi45IDU1MS44MDAwMDAwMDAwMDAxIDE4My4xIDU1MiAxODMuMSA1NTIgQyAxODMuMSA1NTIgMzU4LjMgMjgzIDM1OC4zIDE5NC42IEMgMzU4LjMgNjQuNSAyNjkuNSA3LjkwMDAwMDAwMDAwMDAwNiAxODIuOSA3LjY5OTk5OTk5OTk5OTk4OSBDIDk2LjMgNy45IDcuNSA2NC41IDcuNSAxOTQuNiBDIDcuNSAyODMgMTgyLjggNTUyIDE4Mi44IDU1MiBDIDE4Mi44IDU1MiAxODIuOSA1NTEuNyAxODIuOSA1NTEuNyB6IE0gMTIyLjIgMTg3LjIgQyAxMjIuMiAxNTMuNiAxNDkuNCAxMjYuMzk5OTk5OTk5OTk5OTkgMTgzIDEyNi4zOTk5OTk5OTk5OTk5OSBDIDIxNi42IDEyNi4zOTk5OTk5OTk5OTk5OSAyNDMuOCAxNTMuNiAyNDMuOCAxODcuMiBDIDI0My44IDIyMC43OTk5OTk5OTk5OTk5OCAyMTYuNSAyNDggMTgyLjkgMjQ4IEMgMTQ5LjQgMjQ4IDEyMi4yIDIyMC44IDEyMi4yIDE4Ny4yIHoiIHN0cm9rZS1saW5lY2FwPSJyb3VuZCIgLz4NCjwvZz4NCgkJPGcgdHJhbnNmb3JtPSJtYXRyaXgoMy44MiAwIDAgMy44MiAwIC0xMDAuNzcpIiAgPg0KPGNpcmNsZSBzdHlsZT0ic3Ryb2tlOiByZ2IoMCwwLDApOyBzdHJva2Utd2lkdGg6IDA7IHN0cm9rZS1kYXNoYXJyYXk6IG5vbmU7IHN0cm9rZS1saW5lY2FwOiBidXR0OyBzdHJva2UtZGFzaG9mZnNldDogMDsgc3Ryb2tlLWxpbmVqb2luOiBtaXRlcjsgc3Ryb2tlLW1pdGVybGltaXQ6IDQ7IGZpbGw6IHJnYigyNTUsMjU1LDI1NSk7IGZpbGwtcnVsZTogbm9uemVybzsgb3BhY2l0eTogMTsiIHZlY3Rvci1lZmZlY3Q9Im5vbi1zY2FsaW5nLXN0cm9rZSIgIGN4PSIwIiBjeT0iMCIgcj0iMzUiIC8+DQo8L2c+DQo8L2c+DQo8L2c+DQo8L3N2Zz4="; }, /* 16 */ /***/ (a, s, c) => { var l = c(4), h = function(u, p, g, m) { c(10).ZincObject.call(this); var d; p && (d = p.clone(), d.vertexColors = l.FaceColors), this.id = g; var y = void 0, f = void 0; this.isGlyph = !0, this.fromMesh = (v) => !!(v && v.isMesh) && (this.morph = v.clone(), this.morph.userData = this, this.group.add(this.morph), !0), u && d && this.fromMesh(new l.Mesh(u, d)), this.getGlyphset = function() { return m; }, this.setLabel = (v) => { v && (typeof v == "string" || v instanceof String) && (f = v, this.morph && (this.morph.name = v)), y && this.showLabel(); }, this.showLabel = (v) => { if (y && (position = y.getPosition(), this.group.remove(y.getSprite()), y.dispose(), y = void 0), f && (typeof f == "string" || f instanceof String)) { var M = [0, 0, 0]; y = new (c(17)).Label(f, v), y.setPosition(M[0], M[1], M[2]), this.group.add(y.getSprite()); } }, this.getLabel = () => f, this.getMesh = () => this.morph, this.setTransformation = (v, M, S, T) => { this.morph && (this.morph.matrix.elements[0] = M[0], this.morph.matrix.elements[1] = M[1], this.morph.matrix.elements[2] = M[2], this.morph.matrix.elements[3] = 0, this.morph.matrix.elements[4] = S[0], this.morph.matrix.elements[5] = S[1], this.morph.matrix.elements[6] = S[2], this.morph.matrix.elements[7] = 0, this.morph.matrix.elements[8] = T[0], this.morph.matrix.elements[9] = T[1], this.morph.matrix.elements[10] = T[2], this.morph.matrix.elements[11] = 0, this.morph.matrix.elements[12] = v[0], this.morph.matrix.elements[13] = v[1], this.morph.matrix.elements[14] = v[2], this.morph.matrix.elements[15] = 1, this.morph.matrixAutoUpdate = !1), y && y.setPosition(v[0], v[1], v[2]); }, this.setColour = (v) => { y && y.setColour(v), this.secondaryMesh && this.secondaryMesh.material && (this.secondaryMesh.material.color = colour), this.geometry.colorsNeedUpdate = !0; }, this.dispose = () => { this.material && this.material.dispose(), this.morph = void 0; }; }; h.prototype = Object.create(c(10).ZincObject.prototype), s.Glyph = h; }, /* 17 */ /***/ (a, s, c) => { var l = c(7).default; s.Label = function(h, u) { var p = h, g = void 0; g = u ? new l(p, 0.015, u.getStyle()) : new l(p, 0.015), g.fontFace = "Asap", g.fontWeight = 700, g.material.map.generateMipmaps = !1, g.material.sizeAttenuation = !1, g.center.x = -0.05, g.center.y = 0, this.getPosition = () => g ? [g.position.x, g.position.y, g.position.z] : [0, 0, 0], this.setPosition = (m, d, y) => { g && g.position.set(m, d, y); }, this.setColour = (m) => { g.color = m.getStyle(); }, this.setScale = (m) => { g && 0 < m && g.scale.set(m, m, 1); }, this.dispose = () => { g.dispose(); }, this.getSprite = () => g, this.getString = () => p; }; }, /* 18 */ /***/ (a, s, c) => { function l(g) { throw new TypeError('"' + g + '" is read-only'); } var h = c(4), u = c(19).JSONLoader, p = function() { c(10).ZincObject.call(this); var g = [], m = void 0, d = void 0, y = void 0, f = void 0, v = void 0, M = void 0, S = void 0, T = 0, x = 0, w = [0, 0, 0], A = [0, 0, 0], _ = [0, 0, 0], E = "NONE"; this.ready = !1; var O = !1, L = !1; this.isGlyphset = !0; for (var C = new h.Matrix4(), I = new h.Color(), R = new h.Color(), b = new h.Box3(), P = new h.Box3(), N = new h.Box3(), D = [], k = [], V = [], q = [], Y = [], ne = [], X = [], z = [], H = 0; 8 > H; H++) D[H] = new h.Vector3(); this.load = (B, j, re, F, U) => { m = B.axis1, d = B.axis2, y = B.axis3, f = B.positions, v = B.scale, M = B.colors, S = B.label, O = B.metadata.MorphColours, L = B.metadata.MorphVertices, T = B.metadata.number_of_time_steps, E = B.metadata.repeat_mode, x = B.metadata.number_of_vertices, E == "AXES_2D" || E == "MIRROR" ? x *= 2 : E == "AXES_3D" && (x *= 3), w = B.metadata.base_size, A = B.metadata.offset, _ = B.metadata.scale_factors; var se = new u(); this.geometry = new h.BufferGeometry(); var ue = new h.InstancedMesh(this.geometry, void 0, x); if (this.setMorph(ue), F) { var fe = se.parse(j); ie(re, U)(fe.geometry, fe.materials), fe.geometry.dispose(); } else se.crossOrigin = "Anonymous", se.load(j, ie(re, U)); }; var ee = (B, j, re, F, U, se) => { if (E == "NONE" || E == "MIRROR") { for (var ue, fe = [0, 0, 0], ve = [0, 0, 0], _e = [0, 0, 0], ae = [0, 0, 0], Te = [0, 0, 0], Ee = [0, 0, 0], oe = [0, 0, 0], Me = [0, 0, 0], ye = [0, 0, 0], we = 0; 3 > we; we++) ue = 0 > U[we] ? -1 : 1, fe[we] = ue * w[we] + U[we] * _[we]; for (var we = 0; 3 > we; we++) ve[we] = j[we] * fe[0], _e[we] = re[we] * fe[1], ae[we] = F[we] * fe[2], Te[we] = B[we] + A[0] * ve[we] + A[1] * _e[we] + A[2] * ae[we], E == "MIRROR" && (Ee[we] = -ve[we], oe[we] = -_e[we], Me[we] = -ae[we], ye[we] = Te[we], 0 > U[0] && (Te[we] -= ve[we], ye[we] -= Ee[we])); 0 > ae[0] * (ve[1] * _e[2] - ve[2] * _e[1]) + ae[1] * (ve[2] * _e[0] - ve[0] * _e[2]) + ae[2] * (ve[0] * _e[1] - ve[1] * _e[0]) && (ae[0] = -ae[0], ae[1] = -ae[1], ae[2] = -ae[2]), se[0] = [Te, ve, _e, ae], E == "MIRROR" && (0 > Me[0] * (Ee[1] * oe[2] - Ee[2] * oe[1]) + Me[1] * (Ee[2] * oe[0] - Ee[0] * oe[2]) + Me[2] * (Ee[0] * oe[1] - Ee[1] * oe[0]) && (Me[0] = -Me[0], Me[1] = -Me[1], Me[2] = -Me[2]), se[1] = [ye, Ee, oe, Me]); } else if (E == "AXES_2D" || E == "AXES_3D") { for (var ue, Pe = [0, 0, 0], ut = [0, 0, 0], we = 0; 3 > we; we++) ue = 0 > U[we] ? -1 : 1, Pe[we] = ue * w[0] + U[we] * _[0]; for (var we = 0; 3 > we; we++) ut[we] = B[we] + A[0] * Pe[0] * j[we] + A[1] * Pe[1] * re[we] + A[2] * Pe[2] * F[we]; for (var mt = glyph_repeat_mode == "AXES_2D" ? 2 : 3, Ge = 0; Ge < mt; Ge++) { var bt = void 0, ze = void 0, at = U[Ge], et = [0, 0, 0], yt = [0, 0, 0], dt = [0, 0, 0]; Ge == 0 ? (bt = j, ze = re) : Ge == 1 ? (bt = re, ze = glyph_repeat_mode == "AXES_2D" ? j : F) : (bt = F, ze = j); var kt = w[0] + at * _[0]; et[0] = bt[0] * kt, et[1] = bt[1] * kt, et[2] = bt[2] * kt, dt[0] = et[1] * ze[2] - ze[1] * et[2], dt[1] = et[2] * ze[0] - ze[2] * et[0], dt[2] = et[0] * ze[1] - et[1] * ze[0]; var Rt = Math.sqrt(dt[0] * dt[0] + dt[1] * dt[1] + dt[2] * dt[2]); if (0 < Rt) { var Ii = (w[2] + at * _[2]) / Rt; E == "AXES_2D" && 0 < Ge && (Ii *= -1), dt[0] *= Ii, dt[1] *= Ii, dt[2] *= Ii; } if (yt[0] = dt[1] * et[2] - et[1] * dt[2], yt[1] = dt[2] * et[0] - et[2] * dt[0], yt[2] = dt[0] * et[1] - dt[1] * et[0], Rt = Math.sqrt(yt[0] * yt[0] + yt[1] * yt[1] + yt[2] * yt[2]), 0 < Rt) { var Ui = (w[1] + at * _[1]) / Rt; yt[0] *= Ui, yt[1] *= Ui, yt[2] *= Ui; } se[Ge] = [ut, et, yt, dt]; } } return se; }, Q = (B, j, re, F, U) => { var se = 1; E == "AXES_2D" || E == "MIRROR" ? se = 2 : E == "AXES_3D" && (se = 3); var ue = B.length / 3, fe = 0; z.length = se; for (var ve = 0; ve < ue; ve++) { var _e = 3 * ve, ae = [B[_e], B[_e + 1], B[_e + 2]], Te = [j[_e], j[_e + 1], j[_e + 2]], Ee = [re[_e], re[_e + 1], re[_e + 2]], oe = [F[_e], F[_e + 1], F[_e + 2]], Me = [U[_e], U[_e + 1], U[_e + 2]], ye = ee(ae, Te, Ee, oe, Me, z); if (ye.length == se) for (var we = 0; we < se; we++) { C.elements[0] = ye[we][1][0], C.elements[1] = ye[we][1][1], C.elements[2] = ye[we][1][2], C.elements[3] = 0, C.elements[4] = ye[we][2][0], C.elements[5] = ye[we][2][1], C.elements[6] = ye[we][2][2], C.elements[7] = 0, C.elements[8] = ye[we][3][0], C.elements[9] = ye[we][3][1], C.elements[10] = ye[we][3][2], C.elements[11] = 0, C.elements[12] = ye[we][0][0], C.elements[13] = ye[we][0][1], C.elements[14] = ye[we][0][2], C.elements[15] = 1, this.morph.setMatrixAt(fe, C); var Pe = g[fe]; Pe && Pe.setTransformation(ye[we][0], ye[we][1], ye[we][2], ye[we][3]), fe++; } } this.morph.instanceMatrix.needsUpdate = !0; }, J = (B) => { var j = 1; E == "AXES_2D" || E == "MIRROR" ? j = 2 : E == "AXES_3D" && (j = 3); for (var re, F = B.length, U = 0, se = 0; se < F; se++) { re = B[se]; for (var ue = 0; ue < j; ue++) { I.setHex(re), this.morph.setColorAt(U, I); var fe = g[U]; fe && fe.setColour(I), U++; } } this.morph.instanceColor.needsUpdate = !0; }, W = () => { var B = k, j = V, re = q, F = Y, U = ne, se = X, ue = this.inbuildTime / this.duration * (T - 1), fe = Math.floor(ue), ve = 1 - (ue - fe), _e = Math.ceil(ue); if (L) { var ae = f[fe.toString()], Te = f[_e.toString()], Ee = m[fe.toString()], oe = m[_e.toString()], Me = d[fe.toString()], ye = d[_e.toString()], we = y[fe.toString()], Pe = y[_e.toString()], ut = v[fe.toString()], mt = v[_e.toString()]; k.length = ae.length, V.length = ae.length, q.length = ae.length, Y.length = ae.length, ne.length = ae.length; for (var Ge = 0; Ge < ae.length; Ge++) B[Ge] = ve * ae[Ge] + (1 - ve) * Te[Ge], j[Ge] = ve * Ee[Ge] + (1 - ve) * oe[Ge], re[Ge] = ve * Me[Ge] + (1 - ve) * ye[Ge], F[Ge] = ve * we[Ge] + (1 - ve) * Pe[Ge], U[Ge] = ve * ut[Ge] + (1 - ve) * mt[Ge]; } else f[0], l("current_positions"), m[0], l("current_axis1s"), d[0], l("current_axis2s"), y[0], l("current_axis3s"), v[0], l("current_scales"); if (Q(B, j, re, F, U), this.boundingBoxUpdateRequired = !0, M != null) { if (O) { var bt = M[fe.toString()], ze = M[_e.toString()]; se.length = bt.length; for (var at = 0; at < bt.length; at++) I.setHex(bt[at]), R.setHex(ze[at]), I.setRGB(I.r * ve + R.r * (1 - ve), I.g * ve + R.g * (1 - ve), I.b * ve + R.b * (1 - ve)), se[at] = I.getHex(); } else M[0], l("current_colors"); J(se); } }; this.showLabel = () => { for (var B = 0; B < g.length; B++) g[B].showLabel(this.morph.material ? this.morph.material.color : void 0); }; var K = (B) => { if (S != null && B) for (var j, re = 0; re < x; re++) j = new (c(16)).Glyph(void 0, void 0, re, this), S != null && S[re] != null && j.setLabel(S[re]), 0 < T && j.setFrustumCulled(!1), g[re] = j, this.morph.add(j.getGroup()); S != null && B && this.showLabel(this.morph.material ? this.morph.material.color : void 0), Q(f[0], m[0], d[0], y[0], v[0]), M != null && J(M[0]), this.ready = !0, this.boundingBoxUpdateRequired = !0; }; this.addCustomGlyph = (B) => { B.isGlyph && g.push(B), this.ready = !0, this.boundingBoxUpdateRequired = !0; }, this.addMeshAsGlyph = (B, j) => { if (B.isMesh) { var re = new (c(16)).Glyph(void 0, void 0, j, this); return re.fromMesh(B), g.push(re), this.morph.add(re.getGroup()), this.ready = !0, this.boundingBoxUpdateRequired = !0, re; } }, this.forEachGlyph = (B) => { for (var j = 0; j < g.length; j++) B(g[j]); }; var ie = (B, j) => (re, F) => { var U = re.toBufferGeometry(); this.geometry.copy(U), this.geometry.computeBoundingSphere(), this.geometry.computeBoundingBox(), U.dispose(), F && F[0] && (this.morph.material = F[0]), K(j), this.morph.name = this.groupName, this.morph.userData = this, this.setMorph(this.morph), re.dispose(), B != null && typeof B == "function" && B(this); }; this.getClosestVertexIndex = function() { var B = -1; if (this.morph && this.ready) { this.getBoundingBox().getCenter(this._v1); for (var j, re = f[0], F = re.length / 3, U = -1, se = 0, ue = 0; ue < F; ue++) j = 3 * ue, this._v2.set(re[j], re[j + 1], re[j + 2]), se = this._v1.distanceTo(this._v2), (U == -1 || U > se) && (U = se, B = ue); } return B; }, this.getClosestVertex = function() { if (this.closestVertexIndex == -1 && (this.closestVertexIndex = this.getClosestVertexIndex()), 0 <= this.closestVertexIndex && this.morph) { var B = new h.Vector3(); return this.morph.getMatrixAt(this.closestVertexIndex, C), B.setFromMatrixPosition(C), B; } }, this.getBoundingBox = () => { if (this.morph && this.ready && this.morph.visible) { if (this.boundingBoxUpdateRequired) { b.setFromBufferAttribute(this.morph.geometry.attributes.position); for (var B = 0; B < x; B++) this.morph.getMatrixAt(B, C), P.copy(b).applyMatrix4(C), B == 0 ? N.copy(P) : N.union(P); if (N) this.cachedBoundingBox.copy(N), this.morph.updateWorldMatrix(!0, !0), this.cachedBoundingBox.applyMatrix4(this.morph.matrixWorld), this.boundingBoxUpdateRequired = !1; else return; } return this.cachedBoundingBox; } }, this.setMorphTime = (B) => { this.inbuildTime = B > this.duration ? this.duration : 0 > B ? 0 : B, (O || L) && (W(), L && (this.markerUpdateRequired = !0)); }, this.isTimeVarying = () => !!((this.ready === !1 || 0 < T) && (O || L)), this.getCurrentTime = () => this.inbuildTime, this.dispose = () => { for (var B = g.length - 1; 0 <= B; B--) g[B].dispose(); this.geometry && this.geometry.dispose(), this.morph && this.morph.material.dispose(), m = void 0, d = void 0, y = void 0, f = void 0, v = void 0, M = void 0, this.ready = !1, this.groupName = void 0; }, this.render = (B, j, re) => { if (j == !0) { var F = this.inbuildTime + B; F > this.duration && (F -= this.duration), this.inbuildTime = F, (O || L) && W(); } this.updateMarker(j, re); }; }; p.prototype = Object.create(c(10).ZincObject.prototype), s.Glyphset = p; }, /* 19 */ /***/ (a, s, c) => { c.r(s), c.d(s, { /* harmony export */ JSONLoader: () => ( /* binding */ x ) /* harmony export */ }); var l = c(4), h = c(20).Loader, u = l.LoaderUtils, p = l.AnimationClip, g = l.Vector3, m = l.Vector4, d = l.Color, y = l.Vector2, f = c(6).Face3, v = c(6).Geometry, M = l.FileLoader, S = l.DefaultLoadingManager, T = c(21).VideoHandler; function x(w) { typeof w == "boolean" && (console.warn("THREE.JSONLoader: showStatus parameter has been removed from constructor."), w = void 0), this.manager = w === void 0 ? S : w, this.withCredentials = !1, this.paramsString = ""; } Object.assign(x.prototype, { load: function(w, A, _, E) { var O = this, L = this.texturePath && typeof this.texturePath == "string" ? this.texturePath : u.extractUrlBase(w), C = new M(this.manager); w.split("?"), this.paramsString = w.length === 2 ? paramsStrings[1] : "", C.setWithCredentials(this.withCredentials), C.load(w, function(I) { var R; try { R = JSON.parse(I); } catch { if (console.error("The loader has encountered an error while parsing the content of a resource."), E) return void E({ responseURL: w }); } var b = R.metadata; if (b !== void 0) { var P = b.type; if (P !== void 0 && P.toLowerCase() === "object") return void console.error("THREE.JSONLoader: " + w + " should be loaded with THREE.ObjectLoader instead."); } if (O && O.parse) { var N = O.parse(R, L); A(N.geometry, N.materials); } }, _, E); }, setTexturePath: function(w) { this.texturePath = w; }, parse: /* @__PURE__ */ function() { function w(O, L) { function C(Me, ye) { return Me & 1 << ye; } var I, R, b, P, N, D, k, V, q, Y, ne, X, z, H, ee, Q, J, W, K, ie, B, j, re, F, U, se, ue, fe = O.faces, ve = O.vertices, _e = O.normals, ae = O.colors, Te = O.scale, Ee = 0; if (O.uvs !== void 0) { for (I = 0; I < O.uvs.length; I++) O.uvs[I].length && Ee++; for (I = 0; I < Ee; I++) L.faceVertexUvs[I] = []; } for (P = 0, N = ve.length; P < N; ) W = new g(), W.x = ve[P++] * Te, W.y = ve[P++] * Te, W.z = ve[P++] * Te, L.vertices.push(W); if (P = 0, N = fe.length, O.uvs) for (I = 0; I < O.uvs.length; I++) { L.uvs[I] = []; for (var oe = 0; oe < O.uvs[I].length; oe++) L.uvs[I][oe] = O.uvs[I][oe]; } if (_e) for (I = 0; I < _e.length; I++) L.normals[I] = _e[I]; if (ae) for (I = 0; I < ae.length; I++) L.colors[I] = ae[I]; for (; P < N; ) if (Y = fe[P++], ne = C(Y, 0), X = C(Y, 1), z = C(Y, 3), H = C(Y, 4), ee = C(Y, 5), Q = C(Y, 6), J = C(Y, 7), ne) { if (ie = new f(), ie.a = fe[P], ie.b = fe[P + 1], ie.c = fe[P + 3], B = new f(), B.a = fe[P + 1], B.b = fe[P + 2], B.c = fe[P + 3], P += 4, X && (q = fe[P++], ie.materialIndex = q, B.materialIndex = q), b = L.faces.length, z) for (I = 0; I < Ee; I++) for (F = O.uvs[I], L.faceVertexUvs[I][b] = [], L.faceVertexUvs[I][b + 1] = [], R = 0; 4 > R; R++) V = fe[P++], se = F[2 * V], ue = F[2 * V + 1], U = new y(se, ue), R !== 2 && L.faceVertexUvs[I][b].push(U), R !== 0 && L.faceVertexUvs[I][b + 1].push(U); if (H && (k = 3 * fe[P++], ie.normal.set(_e[k++], _e[k++], _e[k]), B.normal.copy(ie.normal)), ee) for (I = 0; 4 > I; I++) k = 3 * fe[P++], re = new g(_e[k++], _e[k++], _e[k]), I !== 2 && ie.vertexNormals.push(re), I !== 0 && B.vertexNormals.push(re); if (Q && (D = fe[P++], j = ae[D], ie.color.setHex(j), B.color.setHex(j)), J) for (I = 0; 4 > I; I++) D = fe[P++], j = ae[D], I !== 2 && ie.vertexColors.push(new d(j)), I !== 0 && B.vertexColors.push(new d(j)); L.faces.push(ie), L.faces.push(B); } else { if (K = new f(), K.a = fe[P++], K.b = fe[P++], K.c = fe[P++], X && (q = fe[P++], K.materialIndex = q), b = L.faces.length, z) for (I = 0; I < Ee; I++) for (F = O.uvs[I], L.faceVertexUvs[I][b] = [], R = 0; 3 > R; R++) V = fe[P++], se = F[2 * V], ue = F[2 * V + 1], U = new y(se, ue), L.faceVertexUvs[I][b].push(U); if (H && (k = 3 * fe[P++], K.normal.set(_e[k++], _e[k++], _e[k])), ee) for (I = 0; 3 > I; I++) k = 3 * fe[P++], re = new g(_e[k++], _e[k++], _e[k]), K.vertexNormals.push(re); if (Q && (D = fe[P++], K.color.setHex(ae[D])), J) for (I = 0; 3 > I; I++) D = fe[P++], K.vertexColors.push(new d(ae[D])); L.faces.push(K); } } function A(O, L) { var C = O.influencesPerVertex === void 0 ? 2 : O.influencesPerVertex; if (O.skinWeights) for (var I = 0, R = O.skinWeights.length; I < R; I += C) { var b = O.skinWeights[I], P = 1 < C ? O.skinWeights[I + 1] : 0, N = 2 < C ? O.skinWeights[I + 2] : 0, D = 3 < C ? O.skinWeights[I + 3] : 0; L.skinWeights.push(new m(b, P, N, D)); } if (O.skinIndices) for (var I = 0, R = O.skinIndices.length; I < R; I += C) { var k = O.skinIndices[I], V = 1 < C ? O.skinIndices[I + 1] : 0, q = 2 < C ? O.skinIndices[I + 2] : 0, Y = 3 < C ? O.skinIndices[I + 3] : 0; L.skinIndices.push(new m(k, V, q, Y)); } L.bones = O.bones, L.bones && 0 < L.bones.length && (L.skinWeights.length !== L.skinIndices.length || L.skinIndices.length !== L.vertices.length) && console.warn("When skinning, number of vertices (" + L.vertices.length + "), skinIndices (" + L.skinIndices.length + "), and skinWeights (" + L.skinWeights.length + ") should match."); } function _(O, L) { var C = O.scale; if (O.morphTargets !== void 0) for (var I = 0, R = O.morphTargets.length; I < R; I++) { L.morphTargets[I] = {}, L.morphTargets[I].name = O.morphTargets[I].name, L.morphTargets[I].vertices = []; for (var b, P = L.morphTargets[I].vertices, N = O.morphTargets[I].vertices, D = 0, k = N.length; D < k; D += 3) b = new g(), b.x = N[D] * C, b.y = N[D + 1] * C, b.z = N[D + 2] * C, P.push(b); } if (O.morphNormals !== void 0) { for (var I = 0, R = O.morphNormals.length; I < R; I++) if (L.morphTargets[I]) { L.morphTargets[I].normals = []; for (var V, q = L.morphTargets[I].normals, Y = O.morphNormals[I].normals, D = 0, k = Y.length; D < k; D += 3) V = new g(), V.x = Y[D], V.y = Y[D + 1], V.z = Y[D + 2], q.push(V); L.morphNormalsReady = !0; } } if (O.morphColors !== void 0) { var I, R, ne, X, z, H, ee; for (I = 0, R = O.morphColors.length; I < R; I++) for (L.morphColors[I] = {}, L.morphColors[I].name = O.morphColors[I].name, L.morphColors[I].colors = [], z = L.morphColors[I].colors, H = O.morphColors[I].colors, ne = 0, X = H.length; ne < X; ne += 3) ee = new l.Color(16755200), ee.setRGB(H[ne], H[ne + 1], H[ne + 2]), z.push(ee); } } function E(O, L) { var C = [], I = []; O.animation !== void 0 && I.push(O.animation), O.animations !== void 0 && (O.animations.length ? I = I.concat(O.animations) : I.push(O.animations)); for (var R, b = 0; b < I.length; b++) R = p.parseAnimation(I[b], L.bones), R && C.push(R); if (L.morphTargets) { var P = p.CreateClipsFromMorphTargetSequences(L.morphTargets, 10); C = C.concat(P); } 0 < C.length && (L.animations = C); } return function(O, L) { O.data !== void 0 && (O = O.data), O.scale = O.scale === void 0 ? 1 : 1 / O.scale; var C = new v(); if (C.morphColors = [], w(O, C), A(O, C), _(O, C), E(O, C), C.computeFaceNormals(), C.computeBoundingSphere(), O.materials === void 0 || O.materials.length === 0) return { geometry: C }; var I = h.prototype.initMaterials(O.materials, L, "Anonymous"); if (O.materials[0].video) { var R = L + O.materials[0].video; this.paramsString && (R += "?".concat(this.paramsString)); var b = new T(R); C._video = b; } return I && 0 < I.length && (I[0].side = O.materials[0].singleSided ? l.FrontSide : O.materials[0].flipSided ? l.BackSide : l.DoubleSide, O.materials[0].specularCoef && (I[0].shininess = Math.floor(O.materials[0].specularCoef / 3))), { geometry: C, materials: I }; }; }() }); }, /* 20 */ /***/ (a, s, c) => { c.r(s), c.d(s, { /* harmony export */ Loader: () => ( /* binding */ h ) /* harmony export */ }); var l = c(4); c(4); function h() { } h.Handlers = { handlers: [], add: function(u, p) { this.handlers.push(u, p); }, get: function(u) { for (var p = this.handlers, g = 0, m = p.length; g < m; g += 2) { var d = p[g], y = p[g + 1]; if (d.test(u)) return y; } return null; } }, Object.assign(h.prototype, { crossOrigin: "anonymous", onLoadStart: function() { }, onLoadProgress: function() { }, onLoadComplete: function() { }, initMaterials: function(u, p, g) { for (var m = [], d = 0; d < u.length; ++d) m[d] = this.createMaterial(u[d], p, g); return m; }, createMaterial: function() { var u = { NoBlending: l.NoBlending, NormalBlending: l.NormalBlending, AdditiveBlending: l.AdditiveBlending, SubtractiveBlending: l.SubtractiveBlending, MultiplyBlending: l.MultiplyBlending, CustomBlending: l.CustomBlending }, p = new l.Color(), g = new l.TextureLoader(), m = new l.MaterialLoader(); return function(d, y, f) { function v(w, A, _, E, O) { var L, C = y + w, I = h.Handlers.get(C); I === null ? (g.setCrossOrigin(f), L = g.load(C)) : L = I.load(C), A !== void 0 && (L.repeat.fromArray(A), A[0] !== 1 && (L.wrapS = l.RepeatWrapping), A[1] !== 1 && (L.wrapT = l.RepeatWrapping)), _ !== void 0 && L.offset.fromArray(_), E !== void 0 && (E[0] === "repeat" && (L.wrapS = l.RepeatWrapping), E[0] === "mirror" && (L.wrapS = l.MirroredRepeatWrapping), E[1] === "repeat" && (L.wrapT = l.RepeatWrapping), E[1] === "mirror" && (L.wrapT = l.MirroredRepeatWrapping)), O !== void 0 && (L.anisotropy = O); var R = l.MathUtils.generateUUID(); return M[R] = L, R; } var M = {}, S = { uuid: l.MathUtils.generateUUID(), type: "MeshLambertMaterial" }; for (var T in d) { var x = d[T]; switch (T) { case "DbgColor": case "DbgIndex": case "opticalDensity": case "illumination": break; case "DbgName": S.name = x; break; case "blending": S.blending = u[x]; break; case "colorAmbient": case "mapAmbient": console.warn("THREE.Loader.createMaterial:", T, "is no longer supported."); break; case "colorDiffuse": S.color = p.fromArray(x).getHex(); break; case "colorSpecular": S.specular = p.fromArray(x).getHex(); break; case "colorEmissive": S.emissive = p.fromArray(x).getHex(); break; case "specularCoef": S.shininess = x; break; case "shading": x.toLowerCase() === "basic" && (S.type = "MeshBasicMaterial"), x.toLowerCase() === "phong" && (S.type = "MeshPhongMaterial"), x.toLowerCase() === "standard" && (S.type = "MeshStandardMaterial"); break; case "mapDiffuse": S.map = v(x, d.mapDiffuseRepeat, d.mapDiffuseOffset, d.mapDiffuseWrap, d.mapDiffuseAnisotropy); break; case "mapDiffuseRepeat": case "mapDiffuseOffset": case "mapDiffuseWrap": case "mapDiffuseAnisotropy": break; case "mapEmissive": S.emissiveMap = v(x, d.mapEmissiveRepeat, d.mapEmissiveOffset, d.mapEmissiveWrap, d.mapEmissiveAnisotropy); break; case "mapEmissiveRepeat": case "mapEmissiveOffset": case "mapEmissiveWrap": case "mapEmissiveAnisotropy": break; case "mapLight": S.lightMap = v(x, d.mapLightRepeat, d.mapLightOffset, d.mapLightWrap, d.mapLightAnisotropy); break; case "mapLightRepeat": case "mapLightOffset": case "mapLightWrap": case "mapLightAnisotropy": break; case "mapAO": S.aoMap = v(x, d.mapAORepeat, d.mapAOOffset, d.mapAOWrap, d.mapAOAnisotropy); break; case "mapAORepeat": case "mapAOOffset": case "mapAOWrap": case "mapAOAnisotropy": break; case "mapBump": S.bumpMap = v(x, d.mapBumpRepeat, d.mapBumpOffset, d.mapBumpWrap, d.mapBumpAnisotropy); break; case "mapBumpScale": S.bumpScale = x; break; case "mapBumpRepeat": case "mapBumpOffset": case "mapBumpWrap": case "mapBumpAnisotropy": break; case "mapNormal": S.normalMap = v(x, d.mapNormalRepeat, d.mapNormalOffset, d.mapNormalWrap, d.mapNormalAnisotropy); break; case "mapNormalFactor": S.normalScale = x; break; case "mapNormalRepeat": case "mapNormalOffset": case "mapNormalWrap": case "mapNormalAnisotropy": break; case "mapSpecular": S.specularMap = v(x, d.mapSpecularRepeat, d.mapSpecularOffset, d.mapSpecularWrap, d.mapSpecularAnisotropy); break; case "mapSpecularRepeat": case "mapSpecularOffset": case "mapSpecularWrap": case "mapSpecularAnisotropy": break; case "mapMetalness": S.metalnessMap = v(x, d.mapMetalnessRepeat, d.mapMetalnessOffset, d.mapMetalnessWrap, d.mapMetalnessAnisotropy); break; case "mapMetalnessRepeat": case "mapMetalnessOffset": case "mapMetalnessWrap": case "mapMetalnessAnisotropy": break; case "mapRoughness": S.roughnessMap = v(x, d.mapRoughnessRepeat, d.mapRoughnessOffset, d.mapRoughnessWrap, d.mapRoughnessAnisotropy); break; case "mapRoughnessRepeat": case "mapRoughnessOffset": case "mapRoughnessWrap": case "mapRoughnessAnisotropy": break; case "mapAlpha": S.alphaMap = v(x, d.mapAlphaRepeat, d.mapAlphaOffset, d.mapAlphaWrap, d.mapAlphaAnisotropy); break; case "mapAlphaRepeat": case "mapAlphaOffset": case "mapAlphaWrap": case "mapAlphaAnisotropy": break; case "flipSided": S.side = l.BackSide; break; case "doubleSided": S.side = l.DoubleSide; break; case "transparency": console.warn("THREE.Loader.createMaterial: transparency has been renamed to opacity"), S.opacity = x; break; case "depthTest": case "depthWrite": case "colorWrite": case "opacity": case "reflectivity": case "transparent": case "visible": case "wireframe": S[T] = x; break; case "vertexColors": x === !0 && (S.vertexColors = l.VertexColors), x === "face" && (S.vertexColors = l.FaceColors); break; default: console.error("THREE.Loader.createMaterial: Unsupported", T, x); } } return S.type === "MeshBasicMaterial" && delete S.emissive, S.type !== "MeshPhongMaterial" && delete S.specular, 1 > S.opacity && (S.transparent = !0), m.setTextures(M), m.parse(S); }; }() }); }, /* 21 */ /***/ (a, s, c) => { var l = c(4); s.VideoHandler = function(h) { var u = this; this.video = void 0, this.videoTexture = void 0, this.setMorphTime = function(p, g) { var m = p / g * u.video.duration; u.video.currentTime = m; }, this.getVideoDuration = function() { return u.video.duration; }, this.createCanvasVideoTexture = function() { return u.videoTexture = new l.VideoTexture(u.video), u.videoTexture.minFilter = l.LinearFilter, u.videoTexture.magFilter = l.LinearFilter, u.videoTexture.format = l.RGBFormat, u.video.currentTime = 0, u.videoTexture; }, this.getCurrentTime = function(p) { return u.video ? p * (u.video.currentTime / u.video.duration) : 0; }, this.isReadyToPlay = function() { return !!(u.video && 3 <= u.video.readyState); }, function() { document && (u.video = document.createElement("video"), u.video.crossOrigin = "anonymous", u.video.src = h, u.video.load(), u.video.loop = !0); }(); }; }, /* 22 */ /***/ (a, s, c) => { var l = c(4), h = c(23).Points, u = c(5).toBufferGeometry, p = c(5).getCircularTexture, g = c(17).Label, m = function() { c(10).ZincObject.call(this), this.isPointset = !0; var d = []; this.createMesh = (f, v, M) => { if (f && v) { var S = u(f, M), T = p(); v.map = T; var x = new h(S, v); this.setMesh(x, M.localTimeEnabled, M.localMorphColour); } }; var y = (f, v, M, S) => { if (M) { var T = new l.Color(S), x = new g(M, T); x.setPosition(v[0], v[1], v[2]); var w = x.getSprite(); w.material.sizeAttenuation = !1, w.material.alphaTest = 0.5, w.material.transparent = !0, w.material.depthWrite = !1, w.material.depthTest = !1, this.group.add(w), d[f] = x; } }; this.addPoints = (f, v, M) => { if (f && 0 < f.length) { var S = this.drawRange - 1, T = this.addVertices(f), x = this.getMorph(); if (!x) { var w = new l.PointsMaterial({ alphaTest: 0.5, size: 10, color: M, sizeAttenuation: !1 }); T.colorsNeedUpdate = !0, this.createMesh(T, w, { localTimeEnabled: !1, localMorphColour: !1 }); } var A = S + f.length, _ = 0; if (Array.isArray(v) && v.length === f.length || typeof v == "string") for (S; S + _ < A; ) { var E = typeof v == "string" ? v : v[_]; y(_, f[_], E, M), _++; } this.region && (this.region.pickableUpdateRequired = !0); } }, this.setSize = (f) => { this.morph && this.morph.material && (this.morph.material.size = f, this.morph.material.needsUpdate = !0); }, this.setSizeAttenuation = (f) => { this.morph && this.morph.material && (this.morph.material.sizeAttenuation = f, this.morph.material.needsUpdate = !0); }, this.getVerticesByIndex = function(f) { if (0 <= f && this.drawRange > f) { var v = this.getMorph().geometry.getAttribute("position"); return [v.getX(f), v.getY(f), v.getZ(f)]; } }, this.editVertices = function(f, v) { if (f && f.length) { var M = this.getMorph(), S = v + f.length - 1; if (!M || 0 > v || S >= this.drawRange) return; var T = M.geometry.getAttribute("position"), x = v; f.forEach((w) => { var A = d[x]; A && A.setPosition(w[0], w[1], w[2]), T.setXYZ(x++, w[0], w[1], w[2]); }), T.needsUpdate = !0, this.boundingBoxUpdateRequired = !0; } }, this.render = (f, v, M, S) => { this.morph && M && (this.morph.sizePerPixel = M.pixelHeight), m.prototype.render.call(this, f, v, M, S); }; }; m.prototype = Object.create(c(10).ZincObject.prototype), s.Pointset = m; }, /* 23 */ /***/ (a, s, c) => { c.r(s), c.d(s, { /* harmony export */ Points: () => ( /* binding */ y ) /* harmony export */ }); var l = c(4), h = /* @__PURE__ */ new l.Matrix4(), u = /* @__PURE__ */ new l.Ray(), p = /* @__PURE__ */ new l.Sphere(), g = /* @__PURE__ */ new l.Vector3(), m = /* @__PURE__ */ new l.Vector3(), d = /* @__PURE__ */ new l.Vector3(); class y extends l.Object3D { constructor() { var S = 0 < arguments.length && arguments[0] !== void 0 ? arguments[0] : new l.BufferGeometry(), T = 1 < arguments.length && arguments[1] !== void 0 ? arguments[1] : new l.PointsMaterial(); super(), this.type = "Points", this.geometry = S, this.material = T, this.sizePerPixel = 1, this.updateMorphTargets(); } copy(S) { return super.copy(S), this.material = S.material, this.geometry = S.geometry, this; } raycast(S, T) { var x = this.geometry, w = this.matrixWorld, A = S.params.Points.threshold, _ = x.drawRange; if (x.boundingSphere === null && x.computeBoundingSphere(), p.copy(x.boundingSphere), p.applyMatrix4(w), p.radius += A, S.ray.intersectsSphere(p) !== !1) { h.copy(w).invert(), u.copy(S.ray).applyMatrix4(h); var E = A / ((this.scale.x + this.scale.y + this.scale.z) / 3) * this.material.size * this.sizePerPixel, O = E * E; if (x.isBufferGeometry) { var L = x.index, C = x.attributes, I = C.position, R = x.morphAttributes.position; if (L !== null) for (var b, P = Math.max(0, _.start), N = Math.min(L.count, _.start + _.count), D = P; D < N; D++) b = L.getX(D), v(this, I, R, b), f(g, b, O, w, S, T, this); else for (var k = Math.max(0, _.start), V = Math.min(I.count, _.start + _.count), q = k; q < V; q++) v(this, I, R, q), f(g, q, O, w, S, T, this); } else console.error("THREE.Points.raycast() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead."); } } updateMorphTargets() { var S = this.geometry; if (S.isBufferGeometry) { var T = S.morphAttributes, x = Object.keys(T); if (0 < x.length) { var w = T[x[0]]; if (w !== void 0) { this.morphTargetInfluences = [], this.morphTargetDictionary = {}; for (var A, _ = 0, E = w.length; _ < E; _++) A = w[_].name || _ + "", this.morphTargetInfluences.push(0), this.morphTargetDictionary[A] = _; } } } else { var O = S.morphTargets; O !== void 0 && 0 < O.length && console.error("THREE.Points.updateMorphTargets() does not support THREE.Geometry. Use THREE.BufferGeometry instead."); } } } y.prototype.isPoints = !0; function f(M, S, T, x, w, A, _) { var E = u.distanceSqToPoint(M); if (E < T) { var O = new l.Vector3(); u.closestPointToPoint(M, O), O.applyMatrix4(x); var L = w.ray.origin.distanceTo(O); if (L < w.near || L > w.far) return; A.push({ distance: L, distanceToRay: Math.sqrt(E), point: O, index: S, face: null, object: _ }); } } function v(M, S, T, x) { g.fromBufferAttribute(S, x); var w = M.morphTargetInfluences; if (M.material.morphTargets && T && w) { m.set(0, 0, 0); for (var A = 0, _ = T.length; A < _; A++) { var E = w[A], O = T[A]; E !== 0 && (d.fromBufferAttribute(O, x), m.addScaledVector(d.sub(g), E)); } g.add(m); } } }, /* 24 */ /***/ (a, s, c) => { var l = c(4), h = c(5).toBufferGeometry, u = function() { c(10).ZincObject.call(this), this.isLines = !0, this.createLineSegment = (p, g, m) => { if (p && g) { var d = h(p, m); m.localMorphColour && d.morphAttributes.color && (g.onBeforeCompile = c(9).augmentMorphColor()); var y = new (c(12)).LineSegments(d, g); this.setMesh(y, m.localTimeEnabled, m.localMorphColour); } }, this.setWidth = (p) => { this.morph && this.morph.material && (this.morph.material.linewidth = p, this.morph.material.needsUpdate = !0); }, this.addLines = (p, g) => { if (p && 0 < p.length) { var m = this.addVertices(p), d = this.getMorph(); if (!d) { var y = new l.LineBasicMaterial({ color: g }); m.colorsNeedUpdate = !0, this.createLineSegment(m, y, { localTimeEnabled: !1, localMorphColour: !1 }); } this.region && (this.region.pickableUpdateRequired = !0); } }; }; u.prototype = Object.create(c(10).ZincObject.prototype), s.Lines = u; }, /* 25 */ /***/ (a, s, c) => { function l(g, m, d, y, f, v, M) { try { var S = g[v](M), T = S.value; } catch (x) { return void d(x); } S.done ? m(T) : Promise.resolve(T).then(y, f); } function h(g) { return function() { var m = this, d = arguments; return new Promise(function(y, f) { function v(T) { l(S, y, f, v, M, "next", T); } function M(T) { l(S, y, f, v, M, "throw", T); } var S = g.apply(m, d); v(void 0); }); }; } var u = c(4), p = function() { var g = this; c(26).Texture.call(this), this.isTextureArray = !0, this.loadFromImages = /* @__PURE__ */ function() { var m = h(function* (d) { var y = 1, f = 1, v = 0; if (d && d.length) { g.isLoading = !0; var M = new Image(); M.crossOrigin = "Anonymous"; for (var S, T = document.createElement("canvas"), x = 0, w = Array(d.length), A = 0; A < d.length; A++) S = yield g.imageToUint8Array(g, M, d[A], T), S && S.array && (y = S.width, f = S.height, w[v] = S.array, x += w[v].length, v++); var _ = new Uint8Array(x); x = 0, w.forEach((E) => { _.set(E, x), x += E.length; }), g.impl = new u.DataTexture2DArray(_, y, f, v), g.size = { width: y, height: f, depth: v }, g.isLoading = !1, g.impl.needsUpdate = !0; } }); return function() { return m.apply(this, arguments); }; }(), this.getMaterial = (m) => { if (this.impl) { var d; if (!m) d = new u.MeshBasicMaterial({ color: new u.Color(1, 1, 1), transparent: !1, opacity: 1, map: this.impl, side: u.DoubleSide }); else if (m.vs && m.fs) { var y = !0; m.transparent && (y = m.transparent); var f = u.FrontSide; m.side && (f = m.side), d = new u.ShaderMaterial({ transparent: y, uniforms: m.uniforms, vertexShader: m.vs, fragmentShader: m.fs, side: f }), m.glslVersion && (d.glslVersion = m.glslVersion); } if (d) return d.needsUpdate = !0, d; } }; }; p.prototype = Object.create(c(26).Texture.prototype), s.TextureArray = p; }, /* 26 */ /***/ (a, s, c) => { function l(g, m, d, y, f, v, M) { try { var S = g[v](M), T = S.value; } catch (x) { return void d(x); } S.done ? m(T) : Promise.resolve(T).then(y, f); } function h(g) { return function() { var m = this, d = arguments; return new Promise(function(y, f) { function v(T) { l(S, y, f, v, M, "next", T); } function M(T) { l(S, y, f, v, M, "throw", T); } var S = g.apply(m, d); v(void 0); }); }; } var u = c(4), p = function() { this.isTexture = !0, this.impl = void 0, this.isLoading = !1, this.size = { width: 1, height: 1, depth: 0 }; }; p.prototype.loadImage = function(g, m) { return new Promise((d, y) => { g.onload = () => d(g), g.onerror = y, g.src = m; }); }, p.prototype.imageToUint8Array = /* @__PURE__ */ function() { var g = h(function* (m, d, y, f) { yield m.loadImage(d, y), f.width = d.width, f.height = d.height; var v = f.getContext("2d"); return v.drawImage(d, 0, 0), { array: new Uint8Array(v.getImageData(0, 0, f.width, f.height).data.buffer), width: f.width, height: f.height }; }); return function() { return g.apply(this, arguments); }; }(), p.prototype.loadFromImages = /* @__PURE__ */ function() { var g = h(function* () { }); return function() { return g.apply(this, arguments); }; }(), p.prototype.isReady = function() { return !(!this.impl || this.isLoading); }, p.prototype.getMaterial = function() { if (this.impl) return new u.MeshBasicMaterial({ color: new u.Color(1, 1, 1), transparent: !1, opacity: 1, map: this.impl, side: u.DoubleSide }); }, s.Texture = p; }, /* 27 */ /***/ (a, s, c) => { function l(f, v) { var M = Object.keys(f); if (Object.getOwnPropertySymbols) { var S = Object.getOwnPropertySymbols(f); v && (S = S.filter(function(T) { return Object.getOwnPropertyDescriptor(f, T).enumerable; })), M.push.apply(M, S); } return M; } function h(f) { for (var v, M = 1; M < arguments.length; M++) v = arguments[M] == null ? {} : arguments[M], M % 2 ? l(Object(v), !0).forEach(function(S) { u(f, S, v[S]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(f, Object.getOwnPropertyDescriptors(v)) : l(Object(v)).forEach(function(S) { Object.defineProperty(f, S, Object.getOwnPropertyDescriptor(v, S)); }); return f; } function u(f, v, M) { return v = p(v), v in f ? Object.defineProperty(f, v, { value: M, enumerable: !0, configurable: !0, writable: !0 }) : f[v] = M, f; } function p(f) { var v = g(f, "string"); return typeof v == "symbol" ? v : v + ""; } function g(f, v) { if (typeof f != "object" || !f) return f; var M = f[Symbol.toPrimitive]; if (M !== void 0) { var S = M.call(f, v || "default"); if (typeof S != "object") return S; throw new TypeError("@@toPrimitive must return a primitive value."); } return (v === "string" ? String : Number)(f); } var m = c(4), d = c(28), y = function(f) { c(29).TexturePrimitive.call(this, f), this.isTextureSlides = !0; var v = [], M = {}; this.morph = new m.Group(), this.group = this.morph, this.morph.userData = this; var S = !0; this.createSlides = (w) => { w.forEach((A) => this.createSlide(A)); }; var T = (w, A) => { var _ = w.material, E = _.uniforms; switch (w.rotation.x = 0, w.rotation.y = 0, w.rotation.z = 0, w.position.x = 0, w.position.y = 0, w.position.z = 0, A.direction) { case "x": var O = S ? -Math.PI / 2 : Math.PI / 2; w.rotation.y = O, E.direction.value = 1, E.slide.value.set(A.value, 0, 0), w.position.x = A.value; break; case "y": w.rotation.x = Math.PI / 2, E.direction.value = 2, E.slide.value.set(0, A.value, 0), w.position.y = A.value; break; case "z": E.direction.value = 3, E.slide.value.set(0, 0, A.value), w.position.z = A.value; break; } _.needsUpdate = !0, this.boundingBoxUpdateRequired = !0; }; this.modifySlideSettings = (w) => { w && w.id && w.id in M && M[w.id] && T(M[w.id], w); }, this.createSlide = (w) => { if (this.texture && this.texture.isTextureArray && this.texture.isReady() && w && w.direction && w.value !== void 0) { var A = new m.PlaneGeometry(1, 1); A.translate(0.5, 0.5, 0); var _ = d.getUniforms(); _.diffuse.value = this.texture.impl, _.depth.value = this.texture.size.depth, _.flipY.value = S; var E = { fs: d.fs, vs: d.vs, uniforms: _, glslVersion: d.glslVersion, side: m.DoubleSide, transparent: !1 }, O = this.texture.getMaterial(E); O.needsUpdate = !0; var L = new m.Mesh(A, O); L.name = this.groupName, L.userData = this; var C = { value: w.value, direction: w.direction, id: L.id }; return v.push(C), T(L, C), M[L.id] = L, this.morph.add(L), this.boundingBoxUpdateRequired = !0, C; } }, this.getTextureSettings = () => [...v], this.getTextureSettingsWithId = (w) => { for (var A = 0; A < v.length; A++) if (w === v[A].id) return h({}, v[A]); }, this.getSlides = () => this.morph ? [...this.morph.children] : [], this.removeSlide = (w) => { w && this.removeSlideWithId(w.id); }, this.removeSlideWithId = (w) => { if (this.morph && w in M && M[w]) { if (this.morph.getObjectById(w)) { var A = M[w]; this.morph.remove(A), A.clear(), A.geometry && A.geometry.dispose(), A.material && A.material.dispose(), this.boundingBoxUpdateRequired = !0; } var _ = v.findIndex((E) => E.id === w); -1 < _ && v.splice(_, 1); } }, this.dispose = () => { this.morph.children.forEach((w) => { w.geometry && w.geometry.dispose(), w.material && w.material.dispose(); }), c(29).TexturePrimitive.prototype.dispose.call(this), this.boundingBoxUpdateRequired = !0; }; var x = (w, A, _) => { switch (A.direction.value) { case 1: _.copy(A.slide.value), w.expandByPoint(_), _.setY(1), _.setZ(1), w.expandByPoint(_); break; case 2: _.copy(A.slide.value), w.expandByPoint(_), _.setX(1), _.setZ(1), w.expandByPoint(_); break; case 3: _.copy(A.slide.value), w.expandByPoint(_), _.setX(1), _.setY(1), w.expandByPoint(_); break; } }; this.getBoundingBox = () => { if (this.morph && this.morph.children && this.morph.visible && this.boundingBoxUpdateRequired) { this.cachedBoundingBox.makeEmpty(); var w = new m.Vector3(0, 0, 0); this.morph.children.forEach((A) => { x(this.cachedBoundingBox, A.material.uniforms, w); }), this.morph.updateMatrixWorld(!0, !0), this.cachedBoundingBox.applyMatrix4(this.morph.matrixWorld), this.boundingBoxUpdateRequired = !1; } return this.cachedBoundingBox; }, this.applyTransformation = (w, A, _) => { var E = new m.Matrix4(); E.set(w[0], w[1], w[2], 0, w[3], w[4], w[5], 0, w[6], w[7], w[8], 0, 0, 0, 0, 0); var O = new m.Quaternion().setFromRotationMatrix(E); this.morph.position.set(...A), this.morph.quaternion.copy(O), this.morph.scale.set(..._), this.morph.updateMatrix(), this.boundingBoxUpdateRequired = !0; }, this.initialise = (w, A) => { if (w) { var _ = w.locations; _ && 0 < _.length && (this.applyTransformation(_[0].orientation, _[0].position, _[0].scale), "flipY" in _[0] && (S = _[0].flipY)), this.createSlides(w.settings.slides), A != null && typeof A == "function" && A(this); } }; }; y.prototype = Object.create(c(29).TexturePrimitive.prototype), y.prototype.constructor = y, s.TextureSlides = y; }, /* 28 */ /***/ (a, s, c) => { var l = c(4), h = l.GLSL3, u = ` precision highp float; precision highp int; precision highp sampler2DArray; uniform sampler2DArray diffuse; in vec3 vUw; out vec4 outColor; void main() { vec4 color = texture( diffuse, vUw ); // lighten a bit outColor = vec4( color.rgb + .2, 1.0 ); } `, p = ` out vec3 vUw; uniform float depth; uniform vec3 slide; uniform int direction; uniform bool flipY; void main() { vec3 slidePos = position.xyz; gl_Position = projectionMatrix * modelViewMatrix * vec4( position.xyz, 1.0 ); if (direction == 1) slidePos = vec3(slide.x, position.y, position.x); if (direction == 2) slidePos = vec3(position.x, slide.y, position.y); if (direction == 3) slidePos = vec3(position.x, position.y, slide.z); if (flipY) slidePos.y = 1.0 - slidePos.y; vUw.xyz = vec3(slidePos.x, slidePos.y, slidePos.z * depth); } `, g = function() { return { diffuse: { value: void 0 }, depth: { value: 1 }, slide: { value: new l.Vector3(0, 0, 1) }, direction: { value: 1 }, flipY: { value: !0 } }; }; s.fs = u, s.vs = p, s.glslVersion = h, s.getUniforms = g; }, /* 29 */ /***/ (a, s, c) => { c(4); var l = c(5).resolveURL, h = function(u) { c(10).ZincObject.call(this), this.isTexturePrimitive = !0, this.texture = u, this.load = (p, g) => { if (p && p.images && p.images.source) { var m = new (c(25)).TextureArray(), d = []; p.images.source.forEach((f) => { d.push(l(f)); }); var y = this; m.loadFromImages(d).then(() => { y.texture = m, y.initialise(p, g); }); } }, this.initialise = (p, g) => { g != null && typeof g == "function" && g(this); }; }; h.prototype = Object.create(c(10).ZincObject.prototype), h.prototype.constructor = h, s.TexturePrimitive = h; }, /* 30 */ /***/ (a, s, c) => { var l = c(4), h = c(31); s.Renderer = function(u) { var p = u, g = void 0, m = void 0, d = new l.Clock(!1); this.playAnimation = !0; var y = 1e3, f = [], v = 0, M = [], S = 0, T = void 0, x = void 0, w = void 0, A = void 0, _ = [], E = [], O = new l.Group(), L = void 0, C = void 0, I = !1; this.getDrawingWidth = () => p ? p.clientWidth : L ? typeof L.clientWidth > "u" ? Math.round(L.width) : Math.round(L.clientWidth) : 0, this.getDrawingHeight = () => p ? p.clientHeight : L ? typeof L.clientHeight > "u" ? Math.round(L.height) : Math.round(L.clientHeight) : 0, this.onWindowResize = () => { m.onWindowResize(); var P = this.getDrawingWidth(), N = this.getDrawingHeight(); if (g != null) { var D; p ? (D = p.getBoundingClientRect(), g.setSize(P, N)) : L && (typeof L.getBoundingClientRect > "u" || (D = L.getBoundingClientRect(), L.width = P, L.height = N), g.setSize(P, N, !1)), D && (D.left, D.top); var k = new l.Vector2(); g.getSize(k), k.x, k.y; } }, this.initialiseVisualisation = (P) => { if (P = P || {}, P.antialias === void 0) { var N = !1; try { /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent) && (N = !0); } catch { N = !1; } P.antialias = !N; } P.canvas && (p = void 0, L = P.canvas), g = new l.WebGLRenderer(P), p !== void 0 && p.appendChild(g.domElement), g.setClearColor(16777215, 1), L && L.style && (L.style.height = "100%", L.style.width = "100%"), g.autoClear = !1; var D = this.createScene("default"); this.setCurrentScene(D); }, this.getCurrentScene = () => m, this.setCurrentScene = (P) => { if (P) { this.removeActiveScene(P); var N = m; m = P, N && N.setInteractiveControlEnable(!1), m.setInteractiveControlEnable(!0), m.setAdditionalScenesGroup(O), this.onWindowResize(); } }, this.getSceneByName = (P) => _[P], this.createScene = (P) => { if (_[P] == null) { var N; return N = L ? new (c(32)).Scene(L, g) : new (c(32)).Scene(p, g), _[P] = N, N.sceneName = P, N; } }, this.resetView = () => { m.resetView(); }, this.viewAll = () => { if (m) { var P = m.getBoundingBox(); if (P) { for (var N, D = 0; D < E.length; D++) N = E[D].getBoundingBox(), N && P.union(N); m.viewAllWithBoundingBox(P); } } }, this.loadModelsURL = (P, N, D, k, V, q) => { m.loadModelsURL(P, N, D, k, V, q); }, this.loadViewURL = (P) => { m.loadViewURL(P); }, this.loadFromViewURL = (P, N) => { m.loadFromViewURL(P, N); }, this.updateDirectionalLight = () => { m.updateDirectionalLight(); }; var R = () => { I ? (T = requestAnimationFrame(R), this.render()) : (cancelAnimationFrame(T), T = void 0); }; this.stopAnimate = () => { I && (d.stop(), I = !1); }, this.animate = () => { I || (d.start(), I = !0, R()); }, this.addPreRenderCallbackFunction = (P) => (++v, f[v] = P, v), this.removePreRenderCallbackFunction = (P) => { P in f && delete f[P]; }, this.addPostRenderCallbackFunction = (P) => (++S, M[S] = P, S), this.removePostRenderCallbackFunction = (P) => { P in M && delete M[P]; }, this.getPlayRate = () => y, this.setPlayRate = (P) => { y = P; }, this.getCurrentTime = () => m.getCurrentTime(), this.setMorphsTime = (P) => { m.setMorphsTime(P); }, this.getZincGeometryByID = (P) => m.getZincGeometryByID(P), this.addToScene = (P) => { m.addObject(P); }, this.addToOrthoScene = (P) => { if (w == null && (w = new l.Scene()), x == null) { var N = this.getDrawingWidth(), D = this.getDrawingHeight(); x = new l.OrthographicCamera(-N / 2, N / 2, D / 2, -D / 2, 1, 10), x.position.z = 10; } w.add(P); }; var b = (P) => (N) => { N.needsUpdate = !0; var D = new l.SpriteMaterial({ map: N }), k = D.map.image.width, V = D.map.image.height; P.material = D, P.scale.set(k, V, 1); var q = this.getDrawingWidth(), Y = this.getDrawingHeight(); P.position.set((q - k) / 2, (-Y + V) / 2, 1), this.addToOrthoScene(P); }; this.addLogo = () => { A = new l.Sprite(), l.ImageUtils.loadTexture("images/abi_big_logo_transparent_small.png", void 0, b(A)); }, this.render = () => { C || (p ? 0 < p.clientWidth && 0 < p.clientHeight && (C = new h(p, this.onWindowResize)) : L && 0 < L.width && 0 < L.height && (C = new h(L, this.onWindowResize))); var P = d.getDelta(); m.renderGeometries(y, P, this.playAnimation); for (var N, D = 0; D < E.length; D++) N = E[D], N.renderGeometries(y, P, this.playAnimation); for (var k in x != null && w != null && (g.clearDepth(), g.render(w, x)), f) f.hasOwnProperty(k) && f[k].call(); for (var V in m.render(g), M) M.hasOwnProperty(V) && M[V].call(); }, this.getThreeJSRenderer = () => g, this.isSceneActive = (P) => { if (m === P) return !0; for (var N, D = 0; D < E.length; D++) if (N = E[D], N === P) return !0; return !1; }, this.addActiveScene = (P) => { this.isSceneActive(P) || (E.push(P), O.add(P.getThreeJSScene())); }, this.removeActiveScene = (P) => { for (var N, D = 0; D < E.length; D++) if (N = E[D], N === P) return E.splice(D, 1), void O.remove(P.getThreeJSScene()); }, this.clearAllActiveScene = () => { for (var P = 0; P < E.length; P++) O.remove(E[P].getThreeJSScene()); E.splice(0, E.length); }, this.dispose = () => { for (var P in I && cancelAnimationFrame(T), _) _.hasOwnProperty(P) && _[P].clearAll(); _ = [], E = [], O = new l.Group(), this.stopAnimate(), f = [], v = 0, x = void 0, w = void 0, A = void 0; var N = this.createScene("default"); this.setCurrentScene(N), C = void 0; }, this.transitionScene = (P, N) => { if (m) { var D = m.getZincCameraControls(), k = P.getBoundingBox(); if (k) { var V = k.min.distanceTo(k.max) / 2, q = (k.min.x + k.max.x) / 2, Y = (k.min.y + k.max.y) / 2, ne = (k.min.z + k.max.z) / 2, X = D.getViewportFromCentreAndRadius(q, Y, ne, V, 40, V * 4), z = D.getCurrentViewport(); D.cameraTransition(z, X, N), D.enableCameraTransition(); } } }, this.isWebGL2 = () => !!g && g.capabilities.isWebGL2; }; }, /* 31 */ /***/ (a) => { a.exports = a4(); }, /* 32 */ /***/ (a, s, c) => { var l = c(4), h = c(33).MarkerCluster, u = c(35).SceneLoader, p = c(41).SceneExporter, g = c(43).Viewport, m = c(5).createBufferGeometry, d = c(5).getCircularTexture, y = 0, f = function() { return "sc" + y++; }, v = function() { return { Duration: "6 secs", OriginalDuration: "-", TimeStamps: {} }; }, M = 6e3; s.Scene = function(S, T) { var x = this, w = S, A = void 0, _ = new u(this), E = void 0, O = {}, L = 0, C = {}, I = 0, R = new l.Scene(), b = new (c(44)).Region(void 0, this); R.add(b.getGroup()); var P = new l.Group(); R.add(P), this.directionalLight = void 0, this.ambient = void 0, this.camera = void 0; var N = 6e3, D = void 0; this.sceneName = void 0; var k = !1, V = void 0; this.autoClearFlag = !0, this.displayMarkers = !1, this.displayMinimap = !1, this.minimapScissor = { x_offset: 16, y_offset: 16, width: 128, height: 128, align: "top-left", updateRequired: !0 }; var q = { x: 0, y: 0 }, Y = v(), ne = new l.Vector2(), X = []; this.forcePickableObjectsUpdate = !1, this.uuid = f(); var z = new h(this); z.disable(), R.add(z.group); var H = () => w ? typeof w.clientWidth > "u" ? w.width : w.clientWidth : 0, ee = () => w ? typeof w.clientHeight > "u" ? w.height : w.clientHeight : 0; this.getDownloadProgress = () => _.getDownloadProgress(), this.onWindowResize = () => { var B = ee(); this.camera.aspect = H() / B, this.camera.updateProjectionMatrix(), this.minimapScissor.updateRequired = !0, D.onResize(), D.calculateHeightPerPixelAtZeroDepth(B); }, this.resetView = () => { this.onWindowResize(), D.resetView(); }, this.changeZoomByScrollRateUnit = (B) => { D.changeZoomByScrollRateUnit(B); }; var Q = () => { this.camera = new l.PerspectiveCamera(40, H() / ee(), 0, 10), this.ambient = new l.AmbientLight(16777215, 0.2), R.add(this.ambient), this.directionalLight = new l.DirectionalLight(16777215, 0.8), R.add(this.directionalLight), D = new (c(43)).CameraControls(this.camera, T.domElement, T, this), D.setDirectionalLight(this.directionalLight), D.resetView(), E = new (c(49)).Minimap(this); }; Q(), this.loadView = (B) => { var j = new g(); return j.setFromObject(B), D.setCurrentCameraSettings(j), !0; }, this.setupMultipleViews = (B, j) => { for (var [re, F] of Object.entries(j)) { var U = new g(); U.setFromObject(F), D.addViewport(re, U); } D.setDefaultViewport(B); }, this.getBoundingBox = () => b.getBoundingBox(!0), this.viewAllWithBoundingBox = (B) => { if (B) { var j = D.getViewportFromBoundingBox(B, 1); D.setCurrentCameraSettings(j), D.calculateHeightPerPixelAtZeroDepth(ee()), z.markerUpdateRequired = !0; } }, this.viewAll = () => { var B = this.getBoundingBox(); this.viewAllWithBoundingBox(B), z.markerUpdateRequired = !0; }, this.forEachGeometry = (B) => { b.forEachGeometry(B, !0); }, this.forEachGlyphset = (B) => { b.forEachGlyphset(B, !0); }, this.forEachPointset = (B) => { b.forEachPointset(B, !0); }, this.forEachLine = (B) => { b.forEachLine(B, !0); }, this.findGeometriesWithGroupName = (B) => b.findGeometriesWithGroupName(B, !0), this.findPointsetsWithGroupName = (B) => b.findPointsetsWithGroupName(B, !0), this.findGlyphsetsWithGroupName = (B) => b.findGlyphsetsWithGroupName(B, !0), this.findLinesWithGroupName = (B) => b.findLinesWithGroupName(B, !0), this.findObjectsWithGroupName = (B) => b.findObjectsWithGroupName(B, !0), this.findObjectsWithAnatomicalId = (B) => b.findObjectsWithAnatomicalId(B, !0), this.getBoundingBoxOfZincObjects = (B) => { for (var j, re = void 0, F = 0; F < B.length; F++) j = B[F].getBoundingBox(), j && (re ? re.union(j) : re = j); return re; }, this.vectorToScreenXY = (B) => { B.project(this.camera); var j = H(), re = ee(), F = j / 2, U = re / 2; return B.x = B.x * F + F, B.y = -(B.y * U) + U, B; }, this.getObjectsScreenXY = (B) => { if (B && 0 < B.length) { var j = this.getBoundingBoxOfZincObjects(B), re = new l.Vector3(); return j.getCenter(re), this.vectorToScreenXY(re); } }, this.getNamedObjectsScreenXY = (B) => { var j = this.findObjectsWithGroupName(B); return this.getObjectsScreenXY(j); }, this.addZincObject = (B) => { B && (b.addZincObject(B), D && D.calculateMaxAllowedDistance(this)); }, this.loadGlyphsetURL = (B, j, re, F) => { _.loadGlyphsetURL(b, B, j, re, F); }, this.loadPointsetURL = (B, j, re, F, U) => { _.loadPointsetURL(b, B, j, re, F, U); }, this.loadLinesURL = (B, j, re, F, U) => { _.loadLinesURL(b, B, j, re, F, U); }, this.loadSTL = (B, j, re) => { _.loadSTL(b, B, j, re); }, this.loadOBJ = (B, j, re) => { _.loadOBJ(b, B, j, re); }, this.loadMetadataURL = (B, j, re) => { _.loadMetadataURL(b, B, j, re); }, this.loadModelsURL = (B, j, re, F, U, se) => { _.loadModelsURL(b.urls, j, re, F, U, se); }, this.loadViewURL = (B) => { _.loadViewURL(B); }, this.loadFromViewURL = (B, j) => { _.loadFromViewURL(B, j); }, this.loadGLTF = (B, j, re, F) => { _.loadGLTF(b, B, j, re, F); }, this.updateDirectionalLight = () => { D.updateDirectionalLight(); }, this.addObject = (B) => { R.add(B); }, this.removeObject = (B) => { R.remove(B); }, this.getCurrentTime = () => { if (A != null) return A.getCurrentTime(N); var B = b.getCurrentTime(); return B === -1 ? 0 : B; }, this.setMorphsTime = (B) => { A != null && A.setMorphTime(B, N), b.setMorphTime(B, !0); }, this.isTimeVarying = () => !!(A && A.video && !A.video.error) || b.isTimeVarying(), this.renderGeometries = (B, j, re) => { var F = {}; if (F.camera = D, F.displayMarkers = this.displayMarkers, F.markerCluster = z, F.markersList = z.markers, F.ndcToBeUpdated = !1, re && (F.markerCluster.markerUpdateRequired = !0), !A) _.toBeDownloaded == 0 ? (F.ndcToBeUpdated = D.update(j), F.ndcToBeUpdated && D.calculateHeightPerPixelAtZeroDepth(ee()), b.renderGeometries(B, j, re, D, F, !0)) : D.update(0); else if (A.isReadyToPlay()) { re ? A.video.play() : A.video.pause(); var U = A.video.currentTime / A.getVideoDuration() * N; _.toBeDownloaded == 0 ? (D.setTime(U), F.ndcToBeUpdated = D.update(0), F.ndcToBeUpdated && D.calculateHeightPerPixelAtZeroDepth(ee()), b.setMorphTime(U, !0), b.renderGeometries(0, 0, re, D, F, !0)) : D.update(0); } else myPlayRate = 0; }, this.getThreeJSScene = () => R, this.setVideoHandler = (B) => { A || (A = B); }, this.setAdditionalScenesGroup = (B) => { R.add(B); }; var J = (B, j, re, F, U, se, ue) => { var fe = 0, ve = 0; return ve = B.includes("top") ? ue - U - re : B.includes("bottom") ? re : Math.floor((ue - U) / 2), fe = B.includes("left") ? j : B.includes("right") ? se - j - F : Math.floor((se - F) / 2), { x: fe, y: ve }; }, W = (B) => { this.displayMinimap === !0 && (B.setScissorTest(!0), B.getSize(ne), this.minimapScissor.updateRequired && (q = J(this.minimapScissor.align, this.minimapScissor.x_offset, this.minimapScissor.y_offset, this.minimapScissor.width, this.minimapScissor.height, ne.x, ne.y), this.minimapScissor.updateRequired = !1), B.setScissor(q.x, q.y, this.minimapScissor.width, this.minimapScissor.height), B.setViewport(q.x, q.y, this.minimapScissor.width, this.minimapScissor.height), E.updateCamera(), R.add(E.mask), B.render(R, E.camera), R.remove(E.mask), B.setScissorTest(!1), B.setViewport(0, 0, ne.x, ne.y)); }; this.render = (B) => { this.autoClearFlag && B.clear(), k && V ? V.render(R, this.camera) : (B.render(R, this.camera), W(B)); }, this.setInteractiveControlEnable = (B) => { B == !0 ? D.enable() : D.disable(); }, this.getZincCameraControls = () => D, this.getThreeJSScene = () => R, this.setDuration = (B) => { b.setDuration(B), N = B, D.setPathDuration(B), _.duration = B; }, this.getDuration = () => N, this.setStereoEffectEnable = (B) => { B != !0 || V || (V = new c(43).StereoEffect(T)), T.setSize(H(), ee()), this.camera.updateProjectionMatrix(), k = B; }, this.objectIsInScene = (B) => b.objectIsInRegion(B, !0), this.alignBoundingBoxToCameraView = (B, j) => { if (B) { var re = new l.Vector3(); B.getCenter(re); var F = this.getZincCameraControls().getCurrentViewport(), U = new l.Vector3(F.targetPosition[0], F.targetPosition[1], F.targetPosition[2]), se = new l.Vector3(F.eyePosition[0], F.eyePosition[1], F.eyePosition[2]), ue = new l.Vector3(), fe = new l.Vector3(); ue.subVectors(U, se).normalize(), fe.subVectors(U, re).normalize(); var ve = new l.Vector3(); ve.crossVectors(ue, fe); var _e = ue.angleTo(fe); 0 < j ? (this.getZincCameraControls().rotateCameraTransition(ve, _e, j), this.getZincCameraControls().enableCameraTransition()) : this.getZincCameraControls().rotateAboutLookAtpoint(ve, _e), z.markerUpdateRequired = !0; } }, this.translateBoundingBoxToCameraView = (B, j, re) => { if (B) { var F = this.getZincCameraControls().getCurrentViewport(), U = this.getZincCameraControls().getViewportFromBoundingBox(B, j); 0 < re && (this.getZincCameraControls().cameraTransition(F, U, re), this.getZincCameraControls().enableCameraTransition()), z.markerUpdateRequired = !0; } }, this.alignObjectToCameraView = (B, j) => { if (this.objectIsInScene(B)) { var re = B.getBoundingBox(); this.alignBoundingBoxToCameraView(re, j); } }, this.setCameraTargetToObject = (B) => { if (this.objectIsInScene(B)) { var j = new l.Vector3(), re = B.getBoundingBox(), F = this.getZincCameraControls().getCurrentViewport(); re.getCenter(j); var U = new l.Vector3(F.targetPosition[0], F.targetPosition[1], F.targetPosition[2]), se = new l.Vector3(F.eyePosition[0], F.eyePosition[1], F.eyePosition[2]), ue = new l.Vector3(), fe = new l.Vector3(); ue.subVectors(se, U), fe.addVectors(j, ue), F.eyePosition[0] = fe.x, F.eyePosition[1] = fe.y, F.eyePosition[2] = fe.z, F.targetPosition[0] = j.x, F.targetPosition[1] = j.y, F.targetPosition[2] = j.z, this.getZincCameraControls().setCurrentCameraSettings(F), z.markerUpdateRequired = !0; } }, this.isStereoEffectEnable = () => k, this.removeZincObject = (B) => { b.removeZincObject(B), D && D.calculateMaxAllowedDistance(this), z.markerUpdateRequired = !0; }, this.updatePickableThreeJSObjects = () => { X.length = 0, z.isEnabled && X.push(z.group), b.getPickableThreeJSObjects(X, !0), this.forcePickableObjectsUpdate = !1; }, this.getPickableThreeJSObjects = () => ((this.forcePickableObjectsUpdate || b.checkPickableUpdateRequred(!0)) && this.updatePickableThreeJSObjects(), X), this.getNormalisedMinimapCoordinates = (B, j) => { if (this.displayMinimap) { var re = new l.Vector2(); B.getSize(re); var F = re.y - j.clientY; if (q.x + this.minimapScissor.width > j.clientX && j.clientX > q.x && q.y + this.minimapScissor.height > F && F > q.y) { var U = 2 * ((j.clientX - q.x) / this.minimapScissor.width) - 1, se = 2 * ((F - q.y) / this.minimapScissor.height) - 1; return { x: U, y: se }; } } }, this.getMinimapDiffFromNormalised = (B, j) => E ? E.getDiffFromNormalised(B, j) : void 0, this.isWebGL2 = () => T.isWebGL2(), this.clearAll = () => { z.clear(), b.clear(!0), this.clearZincObjectAddedCallbacks(), this.clearZincObjectRemovedCallbacks(), _.toBeDwonloaded = 0, D && D.calculateMaxAllowedDistance(this), z.markerUpdateRequired = !0; }, this.addMetadataTimeStamp = (B, j) => { Y.TimeStamps[B] = ie(j); }, this.getMetadataTag = (B) => Y[B], this.getMetadata = () => Y, this.setMetadataTag = (B, j) => { Y[B] = j; }, this.removeMetadataTag = (B) => { delete Y[B]; }, this.resetMetadata = () => { Y = v(); }, this.resetDuration = () => { this.setDuration(M); }; var K = (B) => [...B.years ? ["".concat(B.years, "years")] : [], ...B.months ? ["".concat(B.months, "months")] : [], ...B.weeks ? ["".concat(B.weeks, "weeks")] : [], ...B.days ? ["".concat(B.days, "days")] : [], ...B.hours ? ["".concat(B.hours, "hours")] : [], ...B.mins ? ["".concat(B.mins, "mins")] : [], ...B.secs ? ["".concat(B.secs, "secs")] : []].join(" "), ie = (B) => B.years ? 31536e6 * B.years : 0 + B.months ? 2592e6 * B.months : 0 + B.weeks ? 6048e5 * B.weeks : 0 + B.days ? 864e5 * B.days : 0 + B.hours ? 36e5 * B.hours : 0 + B.mins ? 6e4 * B.mins : 0 + B.secs ? 1e3 * B.secs : 0; this.setDurationFromObject = (B) => { var j = K(B), re = ie(B); this.setMetadataTag("Duration", j), this.setDuration(re); }, this.setOriginalDurationFromObject = (B) => { var j = K(B); this.setMetadataTag("OriginalDuration", j); }, this.exportGLTF = (B) => { var j = new p(this); return j.exportGLTF(B); }, this.getRootRegion = () => b, this.createLines = (B, j, re, F) => { var U = b.findChildFromPath(B); return U === void 0 && (U = b.createChildFromPath(B)), U.createLines(j, re, F); }, this.createPoints = (B, j, re, F, U) => { var se = b.findChildFromPath(B); return se === void 0 && (se = b.createChildFromPath(B)), se.createPoints(j, re, F, U); }, this.addZincObjectAddedCallbacks = (B) => (++L, O[L] = B, L), this.addZincObjectRemovedCallbacks = (B) => (++I, C[I] = B, I), this.removeZincObjectAddedCallbacks = (B) => { B in L && delete O[B]; }, this.removeZincObjectRemovedCallbacks = (B) => { B in I && delete C[B]; }, this.clearZincObjectAddedCallbacks = () => { O = {}, L = 0; }, this.clearZincObjectRemovedCallbacks = () => { C = {}, I = 0; }, this.triggerObjectAddedCallback = (B) => { for (var j in O) O.hasOwnProperty(j) && O[j](B); }, this.triggerObjectRemovedCallback = (B) => { for (var j in C) C.hasOwnProperty(j) && C[j](B); }, this.addTemporaryPoints = (B, j) => { var re = m(B.length, B), F = new l.PointsMaterial({ alphaTest: 0.5, size: 15, color: j, sizeAttenuation: !1 }), U = d(); F.map = U; var se = new (c(23)).Points(re, F); return P.add(se), se; }, this.addTemporaryLines = (B, j) => { var re = m(B.length, B), F = new l.LineBasicMaterial({ color: j }), U = new (c(12)).LineSegments(re, F); return P.add(U), U; }, this.removeTemporaryPrimitive = (B) => { P.remove(B), B.geometry.dispose(), B.material.dispose(); }, this.clearTemporaryPrimitives = () => { var B = 0, j = P.children; return j.forEach((re) => { re.geometry.dispose(), re.material.dispose(), B++; }), P.clear(), B; }, this.addBoundingBoxPrimitive = function(B, j, re, F, U) { var se = 5 < arguments.length && arguments[5] !== void 0 ? arguments[5] : void 0, ue = b.findChildFromPath(B); ue === void 0 && (ue = b.createChildFromPath(B)); var fe = se || x.getBoundingBox(), ve = new l.Vector3().subVectors(fe.max, fe.min), _e = new l.BoxGeometry(ve.x, ve.y, ve.z), ae = ue.createGeometryFromThreeJSGeometry(j, _e, re, F, U, 1e4); return ve.addVectors(fe.min, fe.max).multiplyScalar(0.5), ae.setPosition(ve.x, ve.y, ve.z), ae; }, this.addSlicesPrimitive = function(B, j, re, F, U) { var se = 5 < arguments.length && arguments[5] !== void 0 ? arguments[5] : void 0; if (j && 3 <= j.length && re && 3 <= re.length) { var ue = b.findChildFromPath(B); ue === void 0 && (ue = b.createChildFromPath(B)); var fe = se || x.getBoundingBox(), ve = new l.Vector3().subVectors(fe.max, fe.min), _e = [], ae = 0; return ["x", "y", "z"].forEach((Te) => { var Ee; switch (Te) { case "x": Ee = new l.PlaneGeometry(ve.z, ve.y), Ee.rotateY(Math.PI / 2); break; case "y": Ee = new l.PlaneGeometry(ve.x, ve.z), Ee.rotateX(Math.PI / 2); break; case "z": Ee = new l.PlaneGeometry(ve.x, ve.y); break; } var oe = ue.createGeometryFromThreeJSGeometry(j[ae], Ee, re[ae], F, U, 10001); _e.push(oe), ae++; }), ve.addVectors(fe.min, fe.max).multiplyScalar(0.5), _e.forEach((Te) => { Te.setPosition(ve.x, ve.y, ve.z); }), _e; } }, this.enableMarkerCluster = (B) => { B ? (z.markerUpdateRequired = !0, z.enable()) : (z.markerUpdateRequired = !1, z.disable()), this.forcePickableObjectsUpdate = !0; }; }; }, /* 33 */ /***/ (a, s, c) => { function l(T, x) { var w = Object.keys(T); if (Object.getOwnPropertySymbols) { var A = Object.getOwnPropertySymbols(T); x && (A = A.filter(function(_) { return Object.getOwnPropertyDescriptor(T, _).enumerable; })), w.push.apply(w, A); } return w; } function h(T) { for (var x, w = 1; w < arguments.length; w++) x = arguments[w] == null ? {} : arguments[w], w % 2 ? l(Object(x), !0).forEach(function(A) { u(T, A, x[A]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(T, Object.getOwnPropertyDescriptors(x)) : l(Object(x)).forEach(function(A) { Object.defineProperty(T, A, Object.getOwnPropertyDescriptor(x, A)); }); return T; } function u(T, x, w) { return x = p(x), x in T ? Object.defineProperty(T, x, { value: w, enumerable: !0, configurable: !0, writable: !0 }) : T[x] = w, T; } function p(T) { var x = g(T, "string"); return typeof x == "symbol" ? x : x + ""; } function g(T, x) { if (typeof T != "object" || !T) return T; var w = T[Symbol.toPrimitive]; if (w !== void 0) { var A = w.call(T, x || "default"); if (typeof A != "object") return A; throw new TypeError("@@toPrimitive must return a primitive value."); } return (x === "string" ? String : Number)(T); } var m = c(4), d = new Image(128, 128); d.src = c(34); var y = new m.Texture(); y.image = d, y.needsUpdate = !0; var f = [0.02, 0.03, 1], v = new m.SpriteMaterial({ map: y, alphaTest: 0.5, transparent: !0, depthTest: !1, depthWrite: !1, sizeAttenuation: !1 }), M = c(5).createNewSpriteText, S = function(T) { c(10).ZincObject.call(this), this.texture = y; var x = void 0; this.morph = new m.Group(), this.group = this.morph, this.isMarkerCluster = !0; var w = !0, A = []; this.markers = {}; var _ = new m.Vector2(), E = new m.Vector2(), O = Date.now(); this.setSpriteSize = (b) => { x.scale.set(0.015, 0.02, 1), x.scale.multiplyScalar(b); }, this.clear = () => { this.group.clear(), this.markers = {}; }, this.dispose = () => { this.clear(), this.morph && this.morph.clear(); }; var L = (b) => { var P = new m.Group(), N = new m.Sprite(v); return N.clusterIndex = b, N.center.set(0.5, 0), N.position.set(0, 0, 0), N.renderOrder = 1e4, N.scale.set(f[0], f[1], f[2]), N.userData = this, P.add(N), this.group.add(P), { group: P, marker: N, label: void 0, number: 0, min: [0, 0, 0], max: [1, 1, 1] }; }, C = (b, P, N) => { b.group.visible = !0, b.group.position.set(P.coords[0], P.coords[1], P.coords[2]), (b.label === void 0 || N !== b.number) && (b.label && (b.group.remove(b.label), b.label.material.map.dispose(), b.label.material.dispose()), b.label = M(N, 0.012, "black", "Asap", 120, 700), b.number = N, b.group.add(b.label)), b.min = P.min, b.max = P.max; }, I = (b) => { var P = 0; for (b.forEach((N) => { var D = N.members.length, k = 0; D === 1 ? N.members[0].setVisibility(!0) : (N.members.forEach((V) => { k += V.getNumber(), V.setVisibility(!1); }), !A[P] && A.push(L(P)), C(A[P], N, k), P++); }), P; P < A.length; P++) A[P].group.visible = !1; }, R = (b, P) => { var N = !0, D = { members: [], coords: [0, 0, 0], min: [0, 0, 0], max: [1, 1, 1] }, k = 0; for (var V in b) N ? (_.set(b[V].ndc.x, b[V].ndc.y), this._b1.setFromPoints([b[V].morph.position]), N = !1, D.members.push(b[V]), D.coords = [b[V].morph.position.x, b[V].morph.position.y, b[V].morph.position.z], P.push(D), delete b[V]) : (E.set(b[V].ndc.x, b[V].ndc.y), k = _.distanceTo(E), 0.1 > k && (D.members.push(b[V]), this._b1.expandByPoint(b[V].morph.position), delete b[V])); D.min = [this._b1.min.x, this._b1.min.y, this._b1.min.z], D.max = [this._b1.max.x, this._b1.max.y, this._b1.max.z], N != !0 && R(b, P); }; this.calculate = () => { if (w) { var b = Date.now(); if (500 < b - O) { var P = []; R(h({}, this.markers), P), I(P), O = Date.now(), this.markerUpdateRequired = !1; } } }, this.isEnabled = () => w, this.enable = () => { w = !0, this.morph.visible = !0; }, this.disable = () => { for (var b in w = !1, this.morph.visible = !1, this.markers) { var P; (P = this.markers[b]) !== null && P !== void 0 && P.isMarker && this.markers[b].isEnabled() && this.markers[b].setVisibility(!0); } }, this.zoomToCluster = (b) => !!(b !== void 0 && -1 < b && (this._v1.set(...A[b].min), this._v2.set(...A[b].max), Math.abs(0 < this._v1.distanceTo(this._v2)))) && (this._b1.set(this._v1, this._v2), T.translateBoundingBoxToCameraView(this._b1, 3, 300), this.markerUpdateRequired = !0, !0), this.clusterIsVisible = (b) => { if (b !== void 0 && -1 < b && A[b]) { var P; return (P = A[b].group) === null || P === void 0 ? void 0 : P.visible; } return !1; }; }; S.prototype = Object.create(c(10).ZincObject.prototype), s.MarkerCluster = S; }, /* 34 */ /***/ (a) => { a.exports = "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiIHN0YW5kYWxvbmU9Im5vIiA/Pgo8IURPQ1RZUEUgc3ZnIFBVQkxJQyAiLS8vVzNDLy9EVEQgU1ZHIDEuMS8vRU4iICJodHRwOi8vd3d3LnczLm9yZy9HcmFwaGljcy9TVkcvMS4xL0RURC9zdmcxMS5kdGQiPgo8c3ZnIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHZlcnNpb249IjEuMSIgd2lkdGg9IjM2NSIgaGVpZ2h0PSI1NjAiIHZpZXdCb3g9IjAgMCAzNjUgNTYwIiB4bWw6c3BhY2U9InByZXNlcnZlIj4KPGRlc2M+Q3JlYXRlZCB3aXRoIEZhYnJpYy5qcyA1LjIuNDwvZGVzYz4KPGRlZnM+CjwvZGVmcz4KPHJlY3QgeD0iMCIgeT0iMCIgd2lkdGg9IjEwMCUiIGhlaWdodD0iMTAwJSIgZmlsbD0idHJhbnNwYXJlbnQiPjwvcmVjdD4KPGcgdHJhbnNmb3JtPSJtYXRyaXgoMCAwIDAgMCAwIDApIiBpZD0iODA4ZWQyODMtMjUyNC00NDBmLTg4YWUtM2JkYjQ3YmI1NzQ5IiAgPgo8L2c+CjxnIHRyYW5zZm9ybT0ibWF0cml4KDEgMCAwIDEgMTgyLjUgMjgwKSIgaWQ9ImRiMzA0MTNkLTViZmYtNGI5OC1hYjU5LTQ2NDQ5N2VlMTk5ZSIgID4KPHJlY3Qgc3R5bGU9InN0cm9rZTogbm9uZTsgc3Ryb2tlLXdpZHRoOiAxOyBzdHJva2UtZGFzaGFycmF5OiBub25lOyBzdHJva2UtbGluZWNhcDogYnV0dDsgc3Ryb2tlLWRhc2hvZmZzZXQ6IDA7IHN0cm9rZS1saW5lam9pbjogbWl0ZXI7IHN0cm9rZS1taXRlcmxpbWl0OiA0OyBmaWxsOiByZ2IoMjU1LDI1NSwyNTUpOyBmaWxsLXJ1bGU6IG5vbnplcm87IG9wYWNpdHk6IDE7IHZpc2liaWxpdHk6IGhpZGRlbjsiIHZlY3Rvci1lZmZlY3Q9Im5vbi1zY2FsaW5nLXN0cm9rZSIgIHg9Ii0xODIuNSIgeT0iLTI4MCIgcng9IjAiIHJ5PSIwIiB3aWR0aD0iMzY1IiBoZWlnaHQ9IjU2MCIgLz4KPC9nPgo8ZyB0cmFuc2Zvcm09Im1hdHJpeCgwIDAgMCAwIDAgOTcuNSkiICA+CjxnIHN0eWxlPSIiICAgPgo8L2c+CjwvZz4KPGcgdHJhbnNmb3JtPSJtYXRyaXgoMCAwIDAgMCAwIDk3LjUpIiAgPgo8ZyBzdHlsZT0iIiAgID4KPC9nPgo8L2c+CjxnIHRyYW5zZm9ybT0ibWF0cml4KDAuOTkgMCAwIDAuOTkgMTgyLjUgMjgwKSIgID4KPGcgc3R5bGU9IiIgdmVjdG9yLWVmZmVjdD0ibm9uLXNjYWxpbmctc3Ryb2tlIiAgID4KCQk8ZyB0cmFuc2Zvcm09Im1hdHJpeCgxIDAgMCAxIDAgMCkiICA+CjxyZWN0IHN0eWxlPSJzdHJva2U6IG5vbmU7IHN0cm9rZS13aWR0aDogMTsgc3Ryb2tlLWRhc2hhcnJheTogbm9uZTsgc3Ryb2tlLWxpbmVjYXA6IGJ1dHQ7IHN0cm9rZS1kYXNob2Zmc2V0OiAwOyBzdHJva2UtbGluZWpvaW46IG1pdGVyOyBzdHJva2UtbWl0ZXJsaW1pdDogNDsgZmlsbDogcmdiKDI1NSwyNTUsMjU1KTsgZmlsbC1ydWxlOiBub256ZXJvOyBvcGFjaXR5OiAxOyB2aXNpYmlsaXR5OiBoaWRkZW47IiB2ZWN0b3ItZWZmZWN0PSJub24tc2NhbGluZy1zdHJva2UiICB4PSItNTQwIiB5PSItNTQwIiByeD0iMCIgcnk9IjAiIHdpZHRoPSIxMDgwIiBoZWlnaHQ9IjEwODAiIC8+CjwvZz4KCQk8ZyB0cmFuc2Zvcm09Im1hdHJpeCgxIDAgMCAxIDAgMCkiICA+CjxwYXRoIHN0eWxlPSJzdHJva2U6IHJnYigwLDAsMCk7IHN0cm9rZS13aWR0aDogMDsgc3Ryb2tlLWRhc2hhcnJheTogbm9uZTsgc3Ryb2tlLWxpbmVjYXA6IGJ1dHQ7IHN0cm9rZS1kYXNob2Zmc2V0OiAwOyBzdHJva2UtbGluZWpvaW46IG1pdGVyOyBzdHJva2UtbWl0ZXJsaW1pdDogNDsgZmlsbDogcmdiKDI1NSwxNjUsMCk7IGZpbGwtcnVsZTogbm9uemVybzsgb3BhY2l0eTogMTsiIHZlY3Rvci1lZmZlY3Q9Im5vbi1zY2FsaW5nLXN0cm9rZSIgIHRyYW5zZm9ybT0iIHRyYW5zbGF0ZSgtMTgyLjksIC0yNzkuODUpIiBkPSJNIDE4Mi45IDU1MS43IEMgMTgyLjkgNTUxLjgwMDAwMDAwMDAwMDEgMTgzLjEgNTUyIDE4My4xIDU1MiBDIDE4My4xIDU1MiAzNTguMyAyODMgMzU4LjMgMTk0LjYgQyAzNTguMyA2NC41IDI2OS41IDcuOTAwMDAwMDAwMDAwMDA2IDE4Mi45IDcuNjk5OTk5OTk5OTk5OTg5IEMgOTYuMyA3LjkgNy41IDY0LjUgNy41IDE5NC42IEMgNy41IDI4MyAxODIuOCA1NTIgMTgyLjggNTUyIEMgMTgyLjggNTUyIDE4Mi45IDU1MS43IDE4Mi45IDU1MS43IHogTSAxMjIuMiAxODcuMiBDIDEyMi4yIDE1My42IDE0OS40IDEyNi4zOTk5OTk5OTk5OTk5OSAxODMgMTI2LjM5OTk5OTk5OTk5OTk5IEMgMjE2LjYgMTI2LjM5OTk5OTk5OTk5OTk5IDI0My44IDE1My42IDI0My44IDE4Ny4yIEMgMjQzLjggMjIwLjc5OTk5OTk5OTk5OTk4IDIxNi41IDI0OCAxODIuOSAyNDggQyAxNDkuNCAyNDggMTIyLjIgMjIwLjggMTIyLjIgMTg3LjIgeiIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIiAvPgo8L2c+CgkJPGcgdHJhbnNmb3JtPSJtYXRyaXgoMy44MiAwIDAgMy44MiAwIC0xMDAuNzcpIiAgPgo8Y2lyY2xlIHN0eWxlPSJzdHJva2U6IHJnYigwLDAsMCk7IHN0cm9rZS13aWR0aDogMDsgc3Ryb2tlLWRhc2hhcnJheTogbm9uZTsgc3Ryb2tlLWxpbmVjYXA6IGJ1dHQ7IHN0cm9rZS1kYXNob2Zmc2V0OiAwOyBzdHJva2UtbGluZWpvaW46IG1pdGVyOyBzdHJva2UtbWl0ZXJsaW1pdDogNDsgZmlsbDogcmdiKDI1NSwyNTUsMjU1KTsgZmlsbC1ydWxlOiBub256ZXJvOyBvcGFjaXR5OiAxOyIgdmVjdG9yLWVmZmVjdD0ibm9uLXNjYWxpbmctc3Ryb2tlIiAgY3g9IjAiIGN5PSIwIiByPSIzNSIgLz4KPC9nPgo8L2c+CjwvZz4KPC9zdmc+"; }, /* 35 */ /***/ (a, s, c) => { var l = c(4), h = c(5).resolveURL, u = c(5).createNewURL, p = c(36).STLLoader, g = c(37).OBJLoader, m = c(38).PrimitivesLoader; s.SceneLoader = function(d) { var y = d; this.toBeDownloaded = 0, this.progressMap = {}; var f = !1, v = !1, M = new m(); this.getDownloadProgress = () => { var X = 0, z = 0, H = !1; for (var ee in this.progressMap) { var Q = this.progressMap[ee]; X += Q[1], z += Q[0], Q[1] == 0 && (H = !0); } return H && (X = 0), [X, z, v]; }, this.onProgress = (X) => (z) => { this.progressMap[X] = [z.loaded, z.total]; }, this.onError = (X) => (z) => { --this.toBeDownloaded, v = !0, console.error("There is an issue with external resource: ".concat(z == null ? void 0 : z.responseURL, ".")), X && X({ type: "Error", xhr: z }); }; var S = (X, z) => { var H = z.Default; if (z.Inline) y.setupMultipleViews(H, z.Entries); else { var ee = [], Q = function(K) { X && (newURL = u(W, X), ee.push(new Promise((ie, B) => { fetch(newURL).then((j) => j.json()).then((j) => ie({ key: K, data: j })).catch((j) => B(j)); }))); }; for (var [J, W] of Object.entries(z.Entries)) Q(J); Promise.all(ee).then((K) => { var ie = {}; K.forEach((j) => { ie[j.key] = j.data; }), y.setupMultipleViews(H, ie); var B = y.getZincCameraControls(); B && B.setCurrentViewport(H), f = !0; }); } }; this.loadViewURL = (X, z) => { this.toBeDownloaded += 1; var H = new XMLHttpRequest(); H.onreadystatechange = () => { if (H.readyState == 4) if (H.status == 200) { var Q = JSON.parse(H.responseText); y.setupMultipleViews("default", { default: Q }), y.resetView(), f = !0, --this.toBeDownloaded, z != null && typeof z == "function" && z(); } else this.onError(); }; var ee = h(X); H.open("GET", ee, !0), H.send(); }, this.loadModelsURL = (X, z, H, ee, Q, J, W) => { var K = z.length; this.toBeDownloaded += K; for (var ie = 0; ie < K; ie++) { var B = z[ie], j = c(0).defaultMaterialColor, re = c(0).defaultOpacity; H != null && H[ie] != null && (j = !!H[ie]), ee != null && ee[ie] != null && (re = ee[ie]); var F = 0; Q != null && Q[ie] != null && (F = !!Q[ie]); var U = 0; J != null && J[ie] != null && (U = !!J[ie]), M.load(h(B), I(X, j, re, F, U, void 0, void 0, void 0, void 0, W), this.onProgress(B), this.onError(W)); } }, this.loadFromViewURL = (X, z, H) => { var ee = new XMLHttpRequest(); ee.onreadystatechange = () => { if (ee.readyState == 4 && ee.status == 200) { var J = JSON.parse(ee.responseText); y.loadView(J); for (var W, K = [], ie = z + "_", B = 0; B < J.numberOfResources; B++) W = ie + (B + 1) + ".json", K.push(W); this.loadModelsURL(X, K, J.colour, J.opacity, J.timeEnabled, J.morphColour, H); } }; var Q = h(z + "_view.json"); ee.open("GET", Q, !0), ee.send(); }; var T = (X, z, H, ee, Q, J, W, K) => (ie, B) => { var j = new (c(24)).Lines(), re = void 0; B && B[0] && (re = new l.LineBasicMaterial({ color: B[0].color.clone() }), 1 > B[0].opacity && (re.transparent = !0), re.opacity = B[0].opacity, re.morphTargets = z, re.vertexColors = B[0].vertexColors); var F = { localTimeEnabled: z, localMorphColour: H }; if (j && (j.createLineSegment(ie, re, F), j.setName(ee), j.anatomicalId = Q, j.setRenderOrder(J), X.addZincObject(j), j.setDuration(y.getDuration()), W && W.levels)) for (var [U, se] of Object.entries(W.levels)) j.addLOD(M, U, se.URL, se.Index, W.preload); --this.toBeDownloaded, ie.dispose(), K != null && typeof K == "function" && K(j); }; this.loadLinesURL = (X, z, H, ee, Q, J, W) => { var K = 0; this.toBeDownloaded += 1; var ie = !!(W && W.isInline) && W.isInline, B = W && W.anatomicalId ? W.anatomicalId : void 0, j = W && W.renderOrder ? W.renderOrder : void 0; H != null && (K = !!H); var re = 0; if (ee != null && (re = !!ee), ie) { var F = M.parse(z); T(X, K, re, Q, B, j, W.lod, J)(F.geometry, F.materials); } else M.load(z, T(X, K, re, Q, B, j, W.lod, J), this.onProgress(z), this.onError(J), W.loaderOptions); }; var x = (X, z, H, ee, Q, J) => { var W = J && J.isInline ? J.isInline : void 0, K = J && J.anatomicalId ? J.anatomicalId : void 0, ie = J && J.displayLabels ? J.displayLabels : void 0, B = J && J.renderOrder ? J.renderOrder : void 0, j = new (c(18)).Glyphset(); j.setDuration(y.getDuration()), j.groupName = ee; var re = () => { --this.toBeDownloaded, Q != null && typeof Q == "function" && Q(j); }; ++this.toBeDownloaded, W ? j.load(z, H, re, W, ie) : j.load(z, h(H), re, W, ie), j.anatomicalId = K, j.setRenderOrder(B), X.addZincObject(j); }, w = (X, z, H, ee, Q, J) => () => { if (z.readyState == 4 && z.status == 200) { var W = JSON.parse(z.responseText); x(X, W, H, ee, Q, J); } }, A = (X, z, H, ee, Q, J, W) => (K, ie) => { var B = new (c(22)).Pointset(), j = new l.PointsMaterial({ alphaTest: 0.5, size: 10, sizeAttenuation: !1 }); ie && ie[0] && (1 > ie[0].opacity && (j.transparent = !0), j.opacity = ie[0].opacity, j.color = ie[0].color, j.morphTargets = z, j.vertexColors = ie[0].vertexColors); var re = {}; re.localTimeEnabled = z, re.localMorphColour = H, B && (B.createMesh(K, j, re), B.setName(ee), B.anatomicalId = Q, X.addZincObject(B), B.setDuration(y.getDuration()), B.setRenderOrder(J)), K.dispose(), --this.toBeDownloaded, W != null && typeof W == "function" && W(B); }; this.loadSTL = (X, z, H, ee) => { this.toBeDownloaded += 1; var Q = c(0).defaultMaterialColor, J = c(0).defaultOpacity, W = new p(); W.crossOrigin = "Anonymous", W.load(h(z), I(X, Q, J, !1, !1, H, void 0, void 0, void 0, ee)); }, this.loadOBJ = (X, z, H, ee) => { this.toBeDownloaded += 1; var Q = c(0).defaultMaterialColor, J = c(0).defaultOpacity, W = new g(); W.crossOrigin = "Anonymous", W.load(h(z), I(X, Q, J, !1, !1, H, void 0, void 0, void 0, ee)); }; var _ = (X, z, H, ee, Q, J, W) => { this.toBeDownloaded += 1; var K = c(0).defaultMaterialColor, ie = c(0).defaultOpacity, B = 0, j = !!(W && W.isInline) && W.isInline, re = W && W.fileFormat ? W.fileFormat : void 0, F = W && W.anatomicalId ? W.anatomicalId : void 0, U = W && W.renderOrder ? W.renderOrder : void 0; H != null && (B = !!H); var se = 0; ee != null && (se = !!ee); var ue = M; if (re !== void 0) { if (re == "STL") ue = new p(); else if (re == "OBJ") return ue = new g(), ue.crossOrigin = "Anonymous", void ue.load(z, objloader(X, K, ie, B, se, Q, F, J), this.onProgress(z), this.onError, W.loaderOptions); } if (j) { var fe = M.parse(z); I(X, K, ie, B, se, Q, F, U, W, J)(fe.geometry, fe.materials); } else ue.crossOrigin = "Anonymous", M.load(z, I(X, K, ie, B, se, Q, F, U, W, J), this.onProgress(z), this.onError(J), W.loaderOptions); }, E = function(X, z, H) { var ee = 0; return (Q) => { if (++ee, Q && z != null && typeof z == "function" && z(Q), ee == X && (f == !1 && y.viewAll(), H != null && typeof H == "function")) { H(); var J = y.getZincCameraControls(); J && J.calculateMaxAllowedDistance(y); } }; }; this.loadPointsetURL = (X, z, H, ee, Q, J, W) => { var K = 0; this.toBeDownloaded += 1, H != null && (K = !!H); var ie = 0; ee != null && (ie = !!ee); var B = !!(W && W.isInline) && W.isInline, j = W && W.anatomicalId ? W.anatomicalId : void 0, re = W && W.renderOrder ? W.renderOrder : void 0; if (B) { var F = M.parse(z); A(X, K, ie, Q, j, re, J)(F.geometry, F.materials); } else M.load(z, A(X, K, ie, Q, j, re, J), this.onProgress(z), this.onError(J), W.loaderOptions); }; var O = (X, z, H, ee, Q, J) => { var W = J && J.isInline ? J.isInline : void 0, K = J && J.anatomicalId ? J.anatomicalId : void 0, ie = J && J.renderOrder ? J.renderOrder : void 0, B = void 0; if (H) { if (z && H.images && H.images.source) for (var j, re = H.images.source, F = 0; F < re.length; F++) j = u(re[F], z), H.images.source[F] = j; if (H.type === "slides" && (B = new (c(27)).TextureSlides()), B) { B.groupName = ee; var U = () => { --this.toBeDownloaded, Q != null && typeof Q == "function" && Q(B); }; ++this.toBeDownloaded, B.load(H, U, W), B.anatomicalId = K, B.setRenderOrder(ie), X.addZincObject(B); } } }, L = (X, z, H, ee, Q) => () => { if (z.readyState == 4 && z.status == 200) { var J = JSON.parse(z.responseText); O(X, z.responseURL, J, H, ee, Q); } }; this.loadTextureURL = (X, z, H, ee, Q) => { var J = !!(Q && Q.isInline) && Q.isInline; if (J) O(X, void 0, z, H, ee, Q); else { var W = new XMLHttpRequest(); W.onreadystatechange = L(X, W, H, ee, Q), W.open("GET", h(z), !0), W.send(); } }, this.loadGlyphsetURL = (X, z, H, ee, Q, J) => { var W = !!(J && J.isInline) && J.isInline; if (W) x(X, z, H, ee, Q, J); else { var K = new XMLHttpRequest(); K.onreadystatechange = w(X, K, H, ee, Q, J), K.open("GET", h(z), !0), K.send(); } }; var C = (X, z, H, ee, Q, J, W, K, ie) => { var B = { colour: H, opacity: ee, localTimeEnabled: Q, localMorphColour: J }, j = new (c(3)).Geometry(); return j.createMesh(z, K, B), j.getMorph() ? (j.setName(ie), X && X.addZincObject(j), j.setDuration(y.getDuration()), j.videoHandler && y.setVideoHandler(j.videoHandler), j) : void 0; }, I = (X, z, H, ee, Q, J, W, K, ie, B) => (j, re) => { var F; re && re[0] && (F = re[0]); var U = C(X, j, z, H, ee, Q, void 0, F, J); if (U.anatomicalId = W, U.setRenderOrder(K), ie.lod && ie.lod.levels) for (var [se, ue] of Object.entries(ie.lod.levels)) U.addLOD(M, se, ue.URL, ue.Index, ie.lod.preload); --this.toBeDownloaded, j.dispose(), B != null && typeof B == "function" && B(U); }, R = (X) => { var z = /P(?:(\d+)Y)?(?:(\d+)M)?(?:(\d+)W)?(?:(\d+)D)?(?:T(?:(\d+)H)?(?:(\d+)M)?(?:(\d+)S)?)?$/, [, H, ee, Q, J, W, K, ie] = X.match(z); return { years: H, months: ee, weeks: Q, days: J, hours: W, mins: K, secs: ie }; }; this.loadSettings = (X) => { if (X) { if (X.Duration) { var z = R(X.Duration); y.setDurationFromObject(z); } if (X.OriginalDuration) { var H = R(X.OriginalDuration); y.setOriginalDurationFromObject(H); } if (X.TimeStamps) for (var ee in X.TimeStamps) { var Q = R(X.TimeStamps[ee]); y.addMetadataTimeStamp(ee, Q); } } }; var b = (X, z, H, ee, Q) => { if (H) { var J = void 0, W = !1; H.URL ? (J = H.URL, z && (J = u(J, z))) : H.Inline && (J = H.Inline.URL, W = !0); var K = {}; if (H.LOD && H.LOD.Levels) { K.preload = !!H.LOD.Preload, K.levels = {}; for (var [ie, B] of Object.entries(H.LOD.Levels)) K.levels[ie] = {}, K.levels[ie].URL = u(B.URL, z), K.levels[ie].Index = B.Index; } var j = H.GroupName; (j === void 0 || j === "") && (j = "_Unnamed"); var re = { loaderOptions: { index: H.Index }, isInline: W, fileFormat: H.FileFormat, anatomicalId: H.AnatomicalId, compression: H.compression, lod: K, renderOrder: ee }; switch (H.Type) { case "Surfaces": _(X, J, H.MorphVertices, H.MorphColours, j, Q, re); break; case "Glyph": var F; W ? F = H.Inline.GlyphGeometriesURL : (F = H.GlyphGeometriesURL, F = u(H.GlyphGeometriesURL, z)), H.DisplayLabels && (re.displayLabels = !0), this.loadGlyphsetURL(X, J, F, j, Q, re); break; case "Points": this.loadPointsetURL(X, J, H.MorphVertices, H.MorphColours, j, Q, re); break; case "Lines": this.loadLinesURL(X, J, H.MorphVertices, H.MorphColours, j, Q, re); break; case "Texture": this.loadTextureURL(X, J, j, Q, re); break; } } }, P = (X, z, H) => { if (z) { var ee = void 0, Q = !1; switch (z.URL ? (ee = z.URL, X && (ee = u(z.URL, X))) : z.Inline && (ee = z.Inline.URL, Q = !0), z.Type) { case "View": Q ? (y.setupMultipleViews("default", { default: ee }), f = !0, H != null && typeof H == "function" && H()) : this.loadViewURL(ee, H); break; case "Settings": this.loadSettings(z); break; } } }; this.loadGLTF = (X, z, H, ee, Q) => { var J = new (c(39)).GLTFToZincJSLoader(); J.load(y, X, z, H, ee, Q); }; var N = (X, z, H, ee) => { if (H.Primitives && H.Primitives.forEach((K) => { var ie = 1; K.Order && (ie = K.Order), b(X, z, K, ie, ee); }), H.Transformation && X.setTransformation(H.Transformation), H.Children) for (var [Q, J] of Object.entries(H.Children)) { var W = X.findOrCreateChildFromPath(Q); W && N(W, z, J, ee); } }, D = (X, z) => { if (Array.isArray(X)) { for (var H = 0, ee = 0; ee < X.length; ee++) X[ee].Type && (z && X[ee].Type === "View" || X[ee].Type === "Surfaces" || X[ee].Type === "Glyph" || X[ee].Type === "Points" || X[ee].Type === "Lines" || X[ee].Type === "Texture") && H++; return H; } return 0; }, k = (X) => { var z = X.Primitives ? D(X.Primitives, !1) : 0; return X.Children && Object.values(X.Children).forEach((H) => { z += k(H); }), z; }, V = (X) => Array.isArray(X) ? D(X, !0) : typeof X == "object" && X !== null && X.Version === "2.0" ? k(X.Regions) : void 0, q = (X, z, H, ee, Q) => { var J = X; H.RegionPath && H.RegionPath !== "" && (J = X.findOrCreateChildFromPath(H.RegionPath)), b(J, z, H, 2 * ee, Q); }, Y = (X, z, H, ee, Q) => { for (var J = V(z), W = new E(J, ee, Q), K = 0; K < z.length; K++) P(H, z[K], W); for (var ie = 0; ie < z.length; ie++) q(X, H, z[ie], ie, W); }, ne = (X, z, H, ee, Q) => { var J = V(z), W = new E(J, ee, Q); z.Settings && this.loadSettings(z.Settings), z.Views && S(H, z.Views), z.Regions && N(X, H, z.Regions, W); }; this.loadMetadataURL = (X, z, H, ee) => { var Q = new XMLHttpRequest(), J = h(z); Q.onreadystatechange = () => { if (Q.readyState == 4 && Q.status == 200) { y.resetMetadata(), y.resetDuration(), f = !1; var W = Q.responseURL; W === void 0 && (W = new URL(J).href); var K = JSON.parse(Q.responseText); Array.isArray(K) ? Y(X, K, W, H, ee) : typeof K == "object" && K !== null && K.Version == "2.0" && ne(X, K, W, H, ee); } }, Q.open("GET", J, !0), Q.send(); }; }; }, /* 36 */ /***/ (a, s, c) => { c.r(s), c.d(s, { /* harmony export */ STLLoader: () => ( /* binding */ h ) /* harmony export */ }); var l = c(4); class h extends l.Loader { constructor(p) { super(p); } load(p, g, m, d) { var y = this, f = new l.FileLoader(this.manager); f.setPath(this.path), f.setResponseType("arraybuffer"), f.setRequestHeader(this.requestHeader), f.setWithCredentials(this.withCredentials), f.load(p, function(v) { try { g(y.parse(v)); } catch (M) { d ? d(M) : console.error(M), y.manager.itemError(p); } }, m, d); } parse(p) { function g(d, y, f) { for (var v = 0, M = d.length; v < M; v++) if (d[v] !== y.getUint8(f + v, !1)) return !1; return !0; } var m = function(d) { if (typeof d == "string") { for (var y = new Uint8Array(d.length), f = 0; f < d.length; f++) y[f] = 255 & d.charCodeAt(f); return y.buffer || y; } return d; }(p); return function(d) { var y = new DataView(d), f = y.getUint32(80, !0); if (84 + f * 50 === y.byteLength) return !0; for (var v = [115, 111, 108, 105, 100], M = 0; 5 > M; M++) if (g(v, y, M)) return !1; return !0; }(m) ? function(d) { for (var y, f, v, M, S, T, x, w, A = new DataView(d), _ = A.getUint32(80, !0), E = !1, O = 0; O < 70; O++) A.getUint32(O, !1) == 1129270351 && A.getUint8(O + 4) == 82 && A.getUint8(O + 5) == 61 && (E = !0, M = new Float32Array(3 * (3 * _)), S = A.getUint8(O + 6) / 255, T = A.getUint8(O + 7) / 255, x = A.getUint8(O + 8) / 255, w = A.getUint8(O + 9) / 255); for (var L = new l.BufferGeometry(), C = new Float32Array(3 * (3 * _)), I = new Float32Array(3 * (3 * _)), R = 0; R < _; R++) { var b = 84 + R * 50, P = A.getFloat32(b, !0), N = A.getFloat32(b + 4, !0), D = A.getFloat32(b + 8, !0); if (E) { var k = A.getUint16(b + 48, !0); 32768 & k ? (y = S, f = T, v = x) : (y = (31 & k) / 31, f = (31 & k >> 5) / 31, v = (31 & k >> 10) / 31); } for (var V = 1; 3 >= V; V++) { var q = b + 12 * V, Y = 3 * (3 * R) + 3 * (V - 1); C[Y] = A.getFloat32(q, !0), C[Y + 1] = A.getFloat32(q + 4, !0), C[Y + 2] = A.getFloat32(q + 8, !0), I[Y] = P, I[Y + 1] = N, I[Y + 2] = D, E && (M[Y] = y, M[Y + 1] = f, M[Y + 2] = v); } } return L.setAttribute("position", new l.BufferAttribute(C, 3)), L.setAttribute("normal", new l.BufferAttribute(I, 3)), E && (L.setAttribute("color", new l.BufferAttribute(M, 3)), L.hasColors = !0, L.alpha = w), L; }(m) : function(d) { for (var y, f = new l.BufferGeometry(), v = /solid([\s\S]*?)endsolid/g, M = /facet([\s\S]*?)endfacet/g, S = 0, T = /[\s]+([+-]?(?:\d*)(?:\.\d*)?(?:[eE][+-]?\d+)?)/.source, x = new RegExp("vertex" + T + T + T, "g"), w = new RegExp("normal" + T + T + T, "g"), A = [], _ = [], E = new l.Vector3(), O = 0, L = 0, C = 0; (y = v.exec(d)) !== null; ) { L = C; for (var I = y[0]; (y = M.exec(I)) !== null; ) { for (var R = 0, b = 0, P = y[0]; (y = w.exec(P)) !== null; ) E.x = parseFloat(y[1]), E.y = parseFloat(y[2]), E.z = parseFloat(y[3]), b++; for (; (y = x.exec(P)) !== null; ) A.push(parseFloat(y[1]), parseFloat(y[2]), parseFloat(y[3])), _.push(E.x, E.y, E.z), R++, C++; b !== 1 && console.error("THREE.STLLoader: Something isn't right with the normal of face number " + S), R !== 3 && console.error("THREE.STLLoader: Something isn't right with the vertices of face number " + S), S++; } var N = L, D = C - L; f.addGroup(N, D, O), O++; } return f.setAttribute("position", new l.Float32BufferAttribute(A, 3)), f.setAttribute("normal", new l.Float32BufferAttribute(_, 3)), f; }(function(d) { return typeof d == "string" ? d : l.LoaderUtils.decodeText(new Uint8Array(d)); }(p)); } } }, /* 37 */ /***/ (a, s, c) => { c.r(s), c.d(s, { /* harmony export */ OBJLoader: () => ( /* binding */ S ) /* harmony export */ }); var l = c(4), h = /^[og]\s*(.+)?/, u = /^mtllib /, p = /^usemtl /, g = /^usemap /, m = new l.Vector3(), d = new l.Vector3(), y = new l.Vector3(), f = new l.Vector3(), v = new l.Vector3(); function M() { var T = { objects: [], object: {}, vertices: [], normals: [], colors: [], uvs: [], materials: {}, materialLibraries: [], startObject: function(x, w) { if (this.object && this.object.fromDeclaration === !1) return this.object.name = x, void (this.object.fromDeclaration = w !== !1); var A = this.object && typeof this.object.currentMaterial == "function" ? this.object.currentMaterial() : void 0; if (this.object && typeof this.object._finalize == "function" && this.object._finalize(!0), this.object = { name: x || "", fromDeclaration: w !== !1, geometry: { vertices: [], normals: [], colors: [], uvs: [], hasUVIndices: !1 }, materials: [], smooth: !0, startMaterial: function(E, O) { var L = this._finalize(!1); L && (L.inherited || 0 >= L.groupCount) && this.materials.splice(L.index, 1); var C = { index: this.materials.length, name: E || "", mtllib: Array.isArray(O) && 0 < O.length ? O[O.length - 1] : "", smooth: L === void 0 ? this.smooth : L.smooth, groupStart: L === void 0 ? 0 : L.groupEnd, groupEnd: -1, groupCount: -1, inherited: !1, clone: function(I) { var R = { index: typeof I == "number" ? I : this.index, name: this.name, mtllib: this.mtllib, smooth: this.smooth, groupStart: 0, groupEnd: -1, groupCount: -1, inherited: !1 }; return R.clone = this.clone.bind(R), R; } }; return this.materials.push(C), C; }, currentMaterial: function() { return 0 < this.materials.length ? this.materials[this.materials.length - 1] : void 0; }, _finalize: function(E) { var O = this.currentMaterial(); if (O && O.groupEnd === -1 && (O.groupEnd = this.geometry.vertices.length / 3, O.groupCount = O.groupEnd - O.groupStart, O.inherited = !1), E && 1 < this.materials.length) for (var L = this.materials.length - 1; 0 <= L; L--) 0 >= this.materials[L].groupCount && this.materials.splice(L, 1); return E && this.materials.length === 0 && this.materials.push({ name: "", smooth: this.smooth }), O; } }, A && A.name && typeof A.clone == "function") { var _ = A.clone(0); _.inherited = !0, this.object.materials.push(_); } this.objects.push(this.object); }, finalize: function() { this.object && typeof this.object._finalize == "function" && this.object._finalize(!0); }, parseVertexIndex: function(x, w) { var A = parseInt(x, 10); return 3 * (0 <= A ? A - 1 : A + w / 3); }, parseNormalIndex: function(x, w) { var A = parseInt(x, 10); return 3 * (0 <= A ? A - 1 : A + w / 3); }, parseUVIndex: function(x, w) { var A = parseInt(x, 10); return 2 * (0 <= A ? A - 1 : A + w / 2); }, addVertex: function(x, w, A) { var _ = this.vertices, E = this.object.geometry.vertices; E.push(_[x + 0], _[x + 1], _[x + 2]), E.push(_[w + 0], _[w + 1], _[w + 2]), E.push(_[A + 0], _[A + 1], _[A + 2]); }, addVertexPoint: function(x) { var w = this.vertices, A = this.object.geometry.vertices; A.push(w[x + 0], w[x + 1], w[x + 2]); }, addVertexLine: function(x) { var w = this.vertices, A = this.object.geometry.vertices; A.push(w[x + 0], w[x + 1], w[x + 2]); }, addNormal: function(x, w, A) { var _ = this.normals, E = this.object.geometry.normals; E.push(_[x + 0], _[x + 1], _[x + 2]), E.push(_[w + 0], _[w + 1], _[w + 2]), E.push(_[A + 0], _[A + 1], _[A + 2]); }, addFaceNormal: function(x, w, A) { var _ = this.vertices, E = this.object.geometry.normals; m.fromArray(_, x), d.fromArray(_, w), y.fromArray(_, A), v.subVectors(y, d), f.subVectors(m, d), v.cross(f), v.normalize(), E.push(v.x, v.y, v.z), E.push(v.x, v.y, v.z), E.push(v.x, v.y, v.z); }, addColor: function(x, w, A) { var _ = this.colors, E = this.object.geometry.colors; _[x] !== void 0 && E.push(_[x + 0], _[x + 1], _[x + 2]), _[w] !== void 0 && E.push(_[w + 0], _[w + 1], _[w + 2]), _[A] !== void 0 && E.push(_[A + 0], _[A + 1], _[A + 2]); }, addUV: function(x, w, A) { var _ = this.uvs, E = this.object.geometry.uvs; E.push(_[x + 0], _[x + 1]), E.push(_[w + 0], _[w + 1]), E.push(_[A + 0], _[A + 1]); }, addDefaultUV: function() { var x = this.object.geometry.uvs; x.push(0, 0), x.push(0, 0), x.push(0, 0); }, addUVLine: function(x) { var w = this.uvs, A = this.object.geometry.uvs; A.push(w[x + 0], w[x + 1]); }, addFace: function(x, w, A, _, E, O, L, C, I) { var R = this.vertices.length, b = this.parseVertexIndex(x, R), P = this.parseVertexIndex(w, R), N = this.parseVertexIndex(A, R); if (this.addVertex(b, P, N), this.addColor(b, P, N), L !== void 0 && L !== "") { var D = this.normals.length; b = this.parseNormalIndex(L, D), P = this.parseNormalIndex(C, D), N = this.parseNormalIndex(I, D), this.addNormal(b, P, N); } else this.addFaceNormal(b, P, N); if (_ !== void 0 && _ !== "") { var k = this.uvs.length; b = this.parseUVIndex(_, k), P = this.parseUVIndex(E, k), N = this.parseUVIndex(O, k), this.addUV(b, P, N), this.object.geometry.hasUVIndices = !0; } else this.addDefaultUV(); }, addPointGeometry: function(x) { this.object.geometry.type = "Points"; for (var w, A = this.vertices.length, _ = 0, E = x.length; _ < E; _++) w = this.parseVertexIndex(x[_], A), this.addVertexPoint(w), this.addColor(w); }, addLineGeometry: function(x, w) { this.object.geometry.type = "Line"; for (var A = this.vertices.length, _ = this.uvs.length, E = 0, O = x.length; E < O; E++) this.addVertexLine(this.parseVertexIndex(x[E], A)); for (var L = 0, C = w.length; L < C; L++) this.addUVLine(this.parseUVIndex(w[L], _)); } }; return T.startObject("", !1), T; } class S extends l.Loader { constructor(x) { super(x), this.materials = null; } load(x, w, A, _) { var E = this, O = new l.FileLoader(this.manager); O.setPath(this.path), O.setRequestHeader(this.requestHeader), O.setWithCredentials(this.withCredentials), O.load(x, function(L) { try { w(E.parse(L)); } catch (C) { _ ? _(C) : console.error(C), E.manager.itemError(x); } }, A, _); } setMaterials(x) { return this.materials = x, this; } parse(x) { var w = new M(); x.indexOf(`\r `) !== -1 && (x = x.replace(/\r\n/g, ` `)), x.indexOf(`\\ `) !== -1 && (x = x.replace(/\\\n/g, "")); for (var A = x.split(` `), _ = "", E = "", O = 0, L = [], C = typeof "".trimLeft == "function", I = 0, R = A.length; I < R; I++) if (_ = A[I], _ = C ? _.trimLeft() : _.trim(), O = _.length, O !== 0 && (E = _.charAt(0), E !== "#")) if (E === "v") { var b = _.split(/\s+/); switch (b[0]) { case "v": w.vertices.push(parseFloat(b[1]), parseFloat(b[2]), parseFloat(b[3])), 7 <= b.length ? w.colors.push(parseFloat(b[4]), parseFloat(b[5]), parseFloat(b[6])) : w.colors.push(void 0, void 0, void 0); break; case "vn": w.normals.push(parseFloat(b[1]), parseFloat(b[2]), parseFloat(b[3])); break; case "vt": w.uvs.push(parseFloat(b[1]), parseFloat(b[2])); } } else if (E === "f") { for (var P, N = _.substr(1).trim(), D = N.split(/\s+/), k = [], V = 0, q = D.length; V < q; V++) if (P = D[V], 0 < P.length) { var Y = P.split("/"); k.push(Y); } for (var ne = k[0], X = 1, z = k.length - 1; X < z; X++) { var H = k[X], ee = k[X + 1]; w.addFace(ne[0], H[0], ee[0], ne[1], H[1], ee[1], ne[2], H[2], ee[2]); } } else if (E === "l") { var Q = _.substring(1).trim().split(" "), J = [], W = []; if (_.indexOf("/") === -1) J = Q; else for (var K, ie = 0, B = Q.length; ie < B; ie++) K = Q[ie].split("/"), K[0] !== "" && J.push(K[0]), K[1] !== "" && W.push(K[1]); w.addLineGeometry(J, W); } else if (E === "p") { var j = _.substr(1).trim(), re = j.split(" "); w.addPointGeometry(re); } else if ((L = h.exec(_)) !== null) { var F = (" " + L[0].substr(1).trim()).substr(1); w.startObject(F); } else if (p.test(_)) w.object.startMaterial(_.substring(7).trim(), w.materialLibraries); else if (u.test(_)) w.materialLibraries.push(_.substring(7).trim()); else if (g.test(_)) console.warn('THREE.OBJLoader: Rendering identifier "usemap" not supported. Textures must be defined in MTL files.'); else if (E === "s") { if (L = _.split(" "), 1 < L.length) { var U = L[1].trim().toLowerCase(); w.object.smooth = U !== "0" && U !== "off"; } else w.object.smooth = !0; var se = w.object.currentMaterial(); se && (se.smooth = w.object.smooth); } else { if (_ === "\0") continue; console.warn('THREE.OBJLoader: Unexpected line: "' + _ + '"'); } w.finalize(); var ue = new l.Group(); ue.materialLibraries = [].concat(w.materialLibraries); var fe = w.objects.length !== 1 || w.objects[0].geometry.vertices.length !== 0; if (fe == !0) for (var ve = 0, _e = w.objects.length; ve < _e; ve++) { var ae = w.objects[ve], Te = ae.geometry, Ee = ae.materials, oe = Te.type === "Line", Me = Te.type === "Points", ye = !1; if (Te.vertices.length !== 0) { var we = new l.BufferGeometry(); we.setAttribute("position", new l.Float32BufferAttribute(Te.vertices, 3)), 0 < Te.normals.length && we.setAttribute("normal", new l.Float32BufferAttribute(Te.normals, 3)), 0 < Te.colors.length && (ye = !0, we.setAttribute("color", new l.Float32BufferAttribute(Te.colors, 3))), Te.hasUVIndices === !0 && we.setAttribute("uv", new l.Float32BufferAttribute(Te.uvs, 2)); for (var Pe = [], ut = 0, mt = Ee.length; ut < mt; ut++) { var Ge = Ee[ut], bt = Ge.name + "_" + Ge.smooth + "_" + ye, ze = w.materials[bt]; if (this.materials !== null) { if (ze = this.materials.create(Ge.name), oe && ze && !(ze instanceof l.LineBasicMaterial)) { var at = new l.LineBasicMaterial(); l.Material.prototype.copy.call(at, ze), at.color.copy(ze.color), ze = at; } else if (Me && ze && !(ze instanceof l.PointsMaterial)) { var et = new l.PointsMaterial({ size: 10, sizeAttenuation: !1 }); l.Material.prototype.copy.call(et, ze), et.color.copy(ze.color), et.map = ze.map, ze = et; } } ze === void 0 && (ze = oe ? new l.LineBasicMaterial() : Me ? new l.PointsMaterial({ size: 1, sizeAttenuation: !1 }) : new l.MeshPhongMaterial(), ze.name = Ge.name, ze.flatShading = !Ge.smooth, ze.vertexColors = ye, w.materials[bt] = ze), Pe.push(ze); } var yt = void 0; if (1 < Pe.length) { for (var dt, kt = 0, Rt = Ee.length; kt < Rt; kt++) dt = Ee[kt], we.addGroup(dt.groupStart, dt.groupCount, kt); yt = oe ? new l.LineSegments(we, Pe) : Me ? new l.Points(we, Pe) : new l.Mesh(we, Pe); } else yt = oe ? new l.LineSegments(we, Pe[0]) : Me ? new l.Points(we, Pe[0]) : new l.Mesh(we, Pe[0]); yt.name = ae.name, ue.add(yt); } } else if (0 < w.vertices.length) { var Ii = new l.PointsMaterial({ size: 1, sizeAttenuation: !1 }), Ui = new l.BufferGeometry(); Ui.setAttribute("position", new l.Float32BufferAttribute(w.vertices, 3)), 0 < w.colors.length && w.colors[0] !== void 0 && (Ui.setAttribute("color", new l.Float32BufferAttribute(w.colors, 3)), Ii.vertexColors = !0); var sr = new l.Points(Ui, Ii); ue.add(sr); } return ue; } } }, /* 38 */ /***/ (a, s, c) => { function l(S, T) { var x = Object.keys(S); if (Object.getOwnPropertySymbols) { var w = Object.getOwnPropertySymbols(S); T && (w = w.filter(function(A) { return Object.getOwnPropertyDescriptor(S, A).enumerable; })), x.push.apply(x, w); } return x; } function h(S) { for (var T, x = 1; x < arguments.length; x++) T = arguments[x] == null ? {} : arguments[x], x % 2 ? l(Object(T), !0).forEach(function(w) { u(S, w, T[w]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(S, Object.getOwnPropertyDescriptors(T)) : l(Object(T)).forEach(function(w) { Object.defineProperty(S, w, Object.getOwnPropertyDescriptor(T, w)); }); return S; } function u(S, T, x) { return T = p(T), T in S ? Object.defineProperty(S, T, { value: x, enumerable: !0, configurable: !0, writable: !0 }) : S[T] = x, S; } function p(S) { var T = g(S, "string"); return typeof T == "symbol" ? T : T + ""; } function g(S, T) { if (typeof S != "object" || !S) return S; var x = S[Symbol.toPrimitive]; if (x !== void 0) { var w = x.call(S, T || "default"); if (typeof w != "object") return w; throw new TypeError("@@toPrimitive must return a primitive value."); } return (T === "string" ? String : Number)(S); } var m = c(19).JSONLoader, d = c(4), y = d.FileLoader, f = (S) => { var T = (w, A) => { w.merge(A); }; if (S && 0 < S.length) { for (; 1 < S.length; ) { var x = S.splice(1, 1); T(S[0], x[0]); } return S[0]; } }, v = function(S, T, x) { var w = new y(), A = new m(); w.crossOrigin = T; var _ = S, E = x, O = void 0, L = !1, C = !1, I = void 0, R = [], b = (k) => { var V = O[k.index]; if (V) { var q = A.parse(V); k.onLoad(q.geometry, q.materials); } else P(k); }, P = (k) => { k.onError && (!I && (I = { responseURL: _ }), k.onError(I)); }; this.downloadCompleted = (k) => { try { O = JSON.parse(k[0]), L = !1, C = !0, Array.isArray(O) ? R.forEach((V) => b(V)) : R.forEach((V) => P(V)); } catch { R.forEach((V) => P(V)); } }; var N = () => (k) => { I = k, C = !0, L = !1, R.forEach((V) => { P(V); }); }, D = () => (k) => { R.forEach((V) => { V.onProgress && V.onProgress(k); }); }; this.load = (k, V, q, Y) => { var ne = { index: k, onLoad: V, onProgress: q, onError: Y }; C ? O ? b(ne) : P(I) : L ? R.push(ne) : (R.push(ne), L = !0, w.load(_, E, D, N)); }; }, M = function(S, T) { var x = [], w = S, A = T, _ = 0; this.itemDownloaded = (E, O) => { if (x[E] = O, _++, _ == w) { for (var L = x[0][1], C = x.map((b) => b[0]), I = f(C), R = 1; R < w; R++) x[E][0].dispose(), x[E][1].forEach((b) => b.dispose()); A(I, L); } }; }; s.PrimitivesLoader = function() { var S = 0, T = 20; this.crossOrigin = "Anonymous"; var x = new m(), w = [], A = {}, _ = (C, I, R, b, P) => { var N = C.length, D = new M(N, I), k = 0; C.forEach((V) => { var q = P ? h({}, P) : {}; q.msHandler = D, q.order = k, k++, O(V, I, R, b, q); }); }, E = (C, I, R, b, P) => { var N = P ? h({}, P) : {}, D = A[C]; if (!D) if (T > S) { var k = new L(void 0, this, N); ++S, D = new v(C, this.crossOrigin, k), A[C] = D; } else w.push({ url: C, onLoad: I, onProgress: R, onError: b, options: P }); D && (N.isHandler = D, D.load(P.index, I, R, b)); }, O = (C, I, R, b, P) => { if (P && P.index !== void 0) E(C, I, R, b, P); else if (T > S) { ++S; var N = new L(I, this, P), D = new L(b, this, P); x.crossOrigin = this.crossOrigin, x.load(C, N, R, D); } else w.push({ url: C, onLoad: I, onProgress: R, onError: b, options: P }); }; this.load = (C, I, R, b, P) => { Array.isArray(C) ? _(C, I, R, b, P) : O(C, I, R, b, P); }, this.loadFromWaitingList = () => { for (; T > S; ) { var C = w.shift(); if (C) this.load(C.url, C.onLoad, C.onProgress, C.onError, C.options); else return; } }, this.itemRemainingCheck = () => { if (w.length === 0 && S == 0) for (var C in A) A.hasOwnProperty(C) && delete A[C]; }; var L = function(C, I, R) { return function() { --S; for (var b = arguments.length, P = Array(b), N = 0; N < b; N++) P[N] = arguments[N]; R != null && R.msHandler ? R.msHandler.itemDownloaded(R.order, P) : R != null && R.isHandler ? R.isHandler.downloadCompleted(P) : C && C(...P), I.loadFromWaitingList(), I.itemRemainingCheck(); }; }; this.parse = (C) => x.parse(C); }; }, /* 39 */ /***/ (a, s, c) => { c(4); var l = c(40).GLTFLoader, h = function() { var u = this; this.parseGLTFObjects = (p, g, m, d) => { var y = g; if (m !== 0) { if (p.type !== "Object3D") { var f; if (p.type === "Mesh" ? f = new (c(3)).Geometry() : p.type === "LineSegments" ? f = new (c(24)).Lines() : p.type === "Points" && (f = new (c(22)).Pointset()), f) { var v = !1, M = !1; p.geometry && p.geometry.morphAttributes && (v = !!p.geometry.morphAttributes.position, M = !!p.geometry.morphAttributes.color), f.setMesh(p.clone(), v, M); var S = f.getMorph(); f.groupName = S.name, S.matrixAutoUpdate = !0, g.addZincObject(f), d != null && typeof d == "function" && d(f); } } else if (p.name !== "" && (g && (y = g.findOrCreateChildFromPath(p.name)), y)) { var T = y.getGroup(); T.position.copy(p.position), T.rotation.copy(p.rotation), T.quaternion.copy(p.quaternion), T.matrixAutoUpdate = !0; } } m++, p.children.forEach((x) => { u.parseGLTFObjects(x, y, m, d); }); }, this.setCamera = (p) => { p.viewAll(); var g = p.getZincCameraControls(), m = g.getCurrentViewport(); g.addViewport("default", m), g.setDefaultViewport("default"); }, this.load = (p, g, m, d, y) => { var f = m.substring(0, m.lastIndexOf("/") + 1), v = m.substring(m.lastIndexOf("/") + 1, m.length), M = new l().setPath(f); M.load(v, function(S) { console.log(S), u.parseGLTFObjects(S.scene, g, 0, d), u.setCamera(p), y != null && typeof y == "function" && y(); }); }; }; s.GLTFToZincJSLoader = h; }, /* 40 */ /***/ (a) => { a.exports = L4; }, /* 41 */ /***/ (a, s, c) => { var l = c(42).GLTFExporter, h = function(u) { var p = u; this.exportGLTF = (g) => { var m = p.getRootRegion(), d = m.getAllObjects(!0), y = []; d.forEach((M) => { M.animationClip && y.push({ clip: M.animationClip[0], mesh: M.getMorph() }); }); var f = new l(), v = { binary: g, animations: y }; return new Promise((M) => { f.parse(p.getThreeJSScene(), function(S) { M(S); }, v); }); }; }; s.SceneExporter = h; }, /* 42 */ /***/ (a, s, c) => { c.r(s), c.d(s, { /* harmony export */ GLTFExporter: () => ( /* binding */ h ) /* harmony export */ }); var l = c(4); class h { constructor() { this.pluginCallbacks = [], this.register(function(b) { return new L(b); }), this.register(function(b) { return new C(b); }), this.register(function(b) { return new I(b); }); } register(b) { return this.pluginCallbacks.indexOf(b) === -1 && this.pluginCallbacks.push(b), this; } unregister(b) { return this.pluginCallbacks.indexOf(b) !== -1 && this.pluginCallbacks.splice(this.pluginCallbacks.indexOf(b), 1), this; } /** * Parse scenes and generate GLTF output * @param {Scene or [THREE.Scenes]} input Scene or Array of THREE.Scenes * @param {Function} onDone Callback on completed * @param {Object} options options */ parse(b, P, N) { for (var D = new O(), k = [], V = 0, q = this.pluginCallbacks.length; V < q; V++) k.push(this.pluginCallbacks[V](D)); D.setPlugins(k), D.write(b, P, N); } } var u = { POINTS: 0, LINES: 1, LINE_LOOP: 2, LINE_STRIP: 3, TRIANGLES: 4, TRIANGLE_STRIP: 5, TRIANGLE_FAN: 6, UNSIGNED_BYTE: 5121, UNSIGNED_SHORT: 5123, FLOAT: 5126, UNSIGNED_INT: 5125, ARRAY_BUFFER: 34962, ELEMENT_ARRAY_BUFFER: 34963, NEAREST: 9728, LINEAR: 9729, NEAREST_MIPMAP_NEAREST: 9984, LINEAR_MIPMAP_NEAREST: 9985, NEAREST_MIPMAP_LINEAR: 9986, LINEAR_MIPMAP_LINEAR: 9987, CLAMP_TO_EDGE: 33071, MIRRORED_REPEAT: 33648, REPEAT: 10497 }, p = {}; p[l.NearestFilter] = u.NEAREST, p[l.NearestMipmapNearestFilter] = u.NEAREST_MIPMAP_NEAREST, p[l.NearestMipmapLinearFilter] = u.NEAREST_MIPMAP_LINEAR, p[l.LinearFilter] = u.LINEAR, p[l.LinearMipmapNearestFilter] = u.LINEAR_MIPMAP_NEAREST, p[l.LinearMipmapLinearFilter] = u.LINEAR_MIPMAP_LINEAR, p[l.ClampToEdgeWrapping] = u.CLAMP_TO_EDGE, p[l.RepeatWrapping] = u.REPEAT, p[l.MirroredRepeatWrapping] = u.MIRRORED_REPEAT; var g = { scale: "scale", position: "translation", quaternion: "rotation", morphTargetInfluences: "weights" }, m = 12, d = 1179937895, y = 2, f = 8, v = 1313821514, M = 5130562; function S(R, b) { return R.length === b.length && R.every(function(P, N) { return P === b[N]; }); } function T(R) { if (window.TextEncoder !== void 0) return new TextEncoder().encode(R).buffer; for (var b, P = new Uint8Array(new ArrayBuffer(R.length)), N = 0, D = R.length; N < D; N++) b = R.charCodeAt(N), P[N] = 255 < b ? 32 : b; return P.buffer; } function x(R) { return S(R.elements, [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1]); } function w(R, b, P) { for (var N = { min: Array(R.itemSize).fill(Number.POSITIVE_INFINITY), max: Array(R.itemSize).fill(Number.NEGATIVE_INFINITY) }, D = b; D < b + P; D++) for (var k, V = 0; V < R.itemSize; V++) k = void 0, 4 < R.itemSize ? k = R.array[D * R.itemSize + V] : V === 0 ? k = R.getX(D) : V === 1 ? k = R.getY(D) : V === 2 ? k = R.getZ(D) : V == 3 && (k = R.getW(D)), N.min[V] = Math.min(N.min[V], k), N.max[V] = Math.max(N.max[V], k); return N; } function A(R) { return 4 * Math.ceil(R / 4); } function _(R) { var b = 1 < arguments.length && arguments[1] !== void 0 ? arguments[1] : 0, P = A(R.byteLength); if (P !== R.byteLength) { var N = new Uint8Array(P); if (N.set(new Uint8Array(R)), b !== 0) for (var D = R.byteLength; D < P; D++) N[D] = b; return N.buffer; } return R; } var E = null; class O { constructor() { this.plugins = [], this.options = {}, this.pending = [], this.buffers = [], this.byteOffset = 0, this.buffers = [], this.nodeMap = /* @__PURE__ */ new Map(), this.skins = [], this.extensionsUsed = {}, this.uids = /* @__PURE__ */ new Map(), this.uid = 0, this.json = { asset: { version: "2.0", generator: "THREE.GLTFExporter" } }, this.cache = { meshes: /* @__PURE__ */ new Map(), attributes: /* @__PURE__ */ new Map(), attributesNormalized: /* @__PURE__ */ new Map(), materials: /* @__PURE__ */ new Map(), textures: /* @__PURE__ */ new Map(), images: /* @__PURE__ */ new Map() }; } setPlugins(b) { this.plugins = b; } /** * Parse scenes and generate GLTF output * @param {Scene or [THREE.Scenes]} input Scene or Array of THREE.Scenes * @param {Function} onDone Callback on completed * @param {Object} options options */ write(b, P, N) { this.options = Object.assign({}, { // default options binary: !1, trs: !1, onlyVisible: !0, truncateDrawRange: !0, embedImages: !0, maxTextureSize: 1 / 0, animations: [], includeCustomExtensions: !1 }, N), 0 < this.options.animations.length && (this.options.trs = !0), this.processInput(b); var D = this; Promise.all(this.pending).then(function() { var k = D.buffers, V = D.json, q = D.options, Y = D.extensionsUsed, ne = new Blob(k, { type: "application/octet-stream" }), X = Object.keys(Y); if (0 < X.length && (V.extensionsUsed = X), V.buffers && 0 < V.buffers.length && (V.buffers[0].byteLength = ne.size), q.binary === !0) { var z = new window.FileReader(); z.readAsArrayBuffer(ne), z.onloadend = function() { var ee = _(z.result), Q = new DataView(new ArrayBuffer(f)); Q.setUint32(0, ee.byteLength, !0), Q.setUint32(4, M, !0); var J = _(T(JSON.stringify(V)), 32), W = new DataView(new ArrayBuffer(f)); W.setUint32(0, J.byteLength, !0), W.setUint32(4, v, !0); var K = new ArrayBuffer(m), ie = new DataView(K); ie.setUint32(0, d, !0), ie.setUint32(4, y, !0); var B = m + W.byteLength + J.byteLength + Q.byteLength + ee.byteLength; ie.setUint32(8, B, !0); var j = new Blob([K, W, J, Q, ee], { type: "application/octet-stream" }), re = new window.FileReader(); re.readAsArrayBuffer(j), re.onloadend = function() { P(re.result); }; }; } else if (V.buffers && 0 < V.buffers.length) { var H = new window.FileReader(); H.readAsDataURL(ne), H.onloadend = function() { var ee = H.result; V.buffers[0].uri = ee, P(V); }; } else P(V); }); } /** * Serializes a userData. * * @param {THREE.Object3D|THREE.Material} object * @param {Object} objectDef */ serializeUserData(b, P) { if (!(b.userData && b.userData.isZincObject) && Object.keys(b.userData).length !== 0) { var N = this.options, D = this.extensionsUsed; try { var k = JSON.parse(JSON.stringify(b.userData)); if (N.includeCustomExtensions && k.gltfExtensions) { for (var V in P.extensions === void 0 && (P.extensions = {}), k.gltfExtensions) P.extensions[V] = k.gltfExtensions[V], D[V] = !0; delete k.gltfExtensions; } 0 < Object.keys(k).length && (P.extras = k); } catch (q) { console.warn("THREE.GLTFExporter: userData of '" + b.name + "' won't be serialized because of JSON.stringify error - " + q.message); } } } /** * Assign and return a temporal unique id for an object * especially which doesn't have .uuid * @param {Object} object * @return {Integer} */ getUID(b) { return this.uids.has(b) || this.uids.set(b, this.uid++), this.uids.get(b); } /** * Checks if normal attribute values are normalized. * * @param {BufferAttribute} normal * @returns {Boolean} */ isNormalizedNormalAttribute(b) { var P = this.cache; if (P.attributesNormalized.has(b)) return !1; for (var N = new l.Vector3(), D = 0, k = b.count; D < k; D++) if (5e-4 < Math.abs(N.fromBufferAttribute(b, D).length() - 1)) return !1; return !0; } /** * Creates normalized normal buffer attribute. * * @param {BufferAttribute} normal * @returns {BufferAttribute} * */ createNormalizedNormalAttribute(b) { var P = this.cache; if (P.attributesNormalized.has(b)) return P.attributesNormalized.get(b); for (var N = b.clone(), D = new l.Vector3(), k = 0, V = N.count; k < V; k++) D.fromBufferAttribute(N, k), D.x === 0 && D.y === 0 && D.z === 0 ? D.setX(1) : D.normalize(), N.setXYZ(k, D.x, D.y, D.z); return P.attributesNormalized.set(b, N), N; } /** * Applies a texture transform, if present, to the map definition. Requires * the KHR_texture_transform extension. * * @param {Object} mapDef * @param {THREE.Texture} texture */ applyTextureTransform(b, P) { var N = !1, D = {}; (P.offset.x !== 0 || P.offset.y !== 0) && (D.offset = P.offset.toArray(), N = !0), P.rotation !== 0 && (D.rotation = P.rotation, N = !0), (P.repeat.x !== 1 || P.repeat.y !== 1) && (D.scale = P.repeat.toArray(), N = !0), N && (b.extensions = b.extensions || {}, b.extensions.KHR_texture_transform = D, this.extensionsUsed.KHR_texture_transform = !0); } /** * Process a buffer to append to the default one. * @param {ArrayBuffer} buffer * @return {Integer} */ processBuffer(b) { var P = this.json, N = this.buffers; return P.buffers || (P.buffers = [{ byteLength: 0 }]), N.push(b), 0; } /** * Process and generate a BufferView * @param {BufferAttribute} attribute * @param {number} componentType * @param {number} start * @param {number} count * @param {number} target (Optional) Target usage of the BufferView * @return {Object} */ processBufferView(b, P, N, D, k) { var V = this.json; V.bufferViews || (V.bufferViews = []); for (var q = P === u.UNSIGNED_BYTE ? 1 : P === u.UNSIGNED_SHORT ? 2 : 4, Y = A(D * b.itemSize * q), ne = new DataView(new ArrayBuffer(Y)), X = 0, z = N; z < N + D; z++) for (var H, ee = 0; ee < b.itemSize; ee++) H = void 0, 4 < b.itemSize ? H = b.array[z * b.itemSize + ee] : ee === 0 ? H = b.getX(z) : ee === 1 ? H = b.getY(z) : ee === 2 ? H = b.getZ(z) : ee == 3 && (H = b.getW(z)), P === u.FLOAT ? ne.setFloat32(X, H, !0) : P === u.UNSIGNED_INT ? ne.setUint32(X, H, !0) : P === u.UNSIGNED_SHORT ? ne.setUint16(X, H, !0) : P === u.UNSIGNED_BYTE && ne.setUint8(X, H), X += q; var Q = { buffer: this.processBuffer(ne.buffer), byteOffset: this.byteOffset, byteLength: Y }; k !== void 0 && (Q.target = k), k === u.ARRAY_BUFFER && (Q.byteStride = b.itemSize * q), this.byteOffset += Y, V.bufferViews.push(Q); var J = { id: V.bufferViews.length - 1, byteLength: 0 }; return J; } /** * Process and generate a BufferView from an image Blob. * @param {Blob} blob * @return {Promise} */ processBufferViewImage(b) { var P = this, N = P.json; return N.bufferViews || (N.bufferViews = []), new Promise(function(D) { var k = new window.FileReader(); k.readAsArrayBuffer(b), k.onloadend = function() { var V = _(k.result), q = { buffer: P.processBuffer(V), byteOffset: P.byteOffset, byteLength: V.byteLength }; P.byteOffset += V.byteLength, D(N.bufferViews.push(q) - 1); }; }); } /** * Process attribute to generate an accessor * @param {BufferAttribute} attribute Attribute to process * @param {THREE.BufferGeometry} geometry (Optional) Geometry used for truncated draw range * @param {Integer} start (Optional) * @param {Integer} count (Optional) * @return {Integer|null} Index of the processed accessor on the "accessors" array */ processAccessor(b, P, N, D) { var k, V = this.options, q = this.json; if (b.array.constructor === Float32Array) k = u.FLOAT; else if (b.array.constructor === Uint32Array) k = u.UNSIGNED_INT; else if (b.array.constructor === Uint16Array) k = u.UNSIGNED_SHORT; else if (b.array.constructor === Uint8Array) k = u.UNSIGNED_BYTE; else throw new Error("THREE.GLTFExporter: Unsupported bufferAttribute component type."); if (N === void 0 && (N = 0), D === void 0 && (D = b.count), V.truncateDrawRange && P !== void 0 && P.index === null) { var Y = N + D, ne = P.drawRange.count === 1 / 0 ? b.count : P.drawRange.start + P.drawRange.count; N = Math.max(N, P.drawRange.start), D = Math.min(Y, ne) - N, 0 > D && (D = 0); } if (D === 0) return null; var X, z = w(b, N, D); P !== void 0 && (X = b === P.index ? u.ELEMENT_ARRAY_BUFFER : u.ARRAY_BUFFER); var H = this.processBufferView(b, k, N, D, X), ee = { bufferView: H.id, byteOffset: H.byteOffset, componentType: k, count: D, max: z.max, min: z.min, type: { 1: "SCALAR", 2: "VEC2", 3: "VEC3", 4: "VEC4", 16: "MAT4" }[b.itemSize] }; return b.normalized === !0 && (ee.normalized = !0), q.accessors || (q.accessors = []), q.accessors.push(ee) - 1; } /** * Process image * @param {Image} image to process * @param {Integer} format of the image (e.g. RGBFormat, RGBAFormat etc) * @param {Boolean} flipY before writing out the image * @return {Integer} Index of the processed texture in the "images" array */ processImage(b, P, N) { var D = this, k = D.cache, V = D.json, q = D.options, Y = D.pending; k.images.has(b) || k.images.set(b, {}); var ne = k.images.get(b), X = P === l.RGBAFormat ? "image/png" : "image/jpeg", z = X + ":flipY/" + N.toString(); if (ne[z] !== void 0) return ne[z]; V.images || (V.images = []); var H = { mimeType: X }; if (q.embedImages) { var ee = E = E || document.createElement("canvas"); ee.width = Math.min(b.width, q.maxTextureSize), ee.height = Math.min(b.height, q.maxTextureSize); var Q = ee.getContext("2d"); if (N === !0 && (Q.translate(0, ee.height), Q.scale(1, -1)), typeof HTMLImageElement < "u" && b instanceof HTMLImageElement || typeof HTMLCanvasElement < "u" && b instanceof HTMLCanvasElement || typeof OffscreenCanvas < "u" && b instanceof OffscreenCanvas || typeof ImageBitmap < "u" && b instanceof ImageBitmap) Q.drawImage(b, 0, 0, ee.width, ee.height); else { P !== l.RGBAFormat && P !== l.RGBFormat && console.error("GLTFExporter: Only RGB and RGBA formats are supported."), (b.width > q.maxTextureSize || b.height > q.maxTextureSize) && console.warn("GLTFExporter: Image size is bigger than maxTextureSize", b); var J = new Uint8ClampedArray(4 * (b.height * b.width)); if (P === l.RGBAFormat) for (var W = 0; W < J.length; W += 4) J[W + 0] = b.data[W + 0], J[W + 1] = b.data[W + 1], J[W + 2] = b.data[W + 2], J[W + 3] = b.data[W + 3]; else for (var K = 0, ie = 0; K < J.length; K += 4, ie += 3) J[K + 0] = b.data[ie + 0], J[K + 1] = b.data[ie + 1], J[K + 2] = b.data[ie + 2], J[K + 3] = 255; Q.putImageData(new ImageData(J, b.width, b.height), 0, 0); } q.binary === !0 ? Y.push(new Promise(function(j) { ee.toBlob(function(re) { D.processBufferViewImage(re).then(function(F) { H.bufferView = F, j(); }); }, X); })) : H.uri = ee.toDataURL(X); } else H.uri = b.src; var B = V.images.push(H) - 1; return ne[z] = B, B; } /** * Process sampler * @param {Texture} map Texture to process * @return {Integer} Index of the processed texture in the "samplers" array */ processSampler(b) { var P = this.json; P.samplers || (P.samplers = []); var N = { magFilter: p[b.magFilter], minFilter: p[b.minFilter], wrapS: p[b.wrapS], wrapT: p[b.wrapT] }; return P.samplers.push(N) - 1; } /** * Process texture * @param {Texture} map Map to process * @return {Integer} Index of the processed texture in the "textures" array */ processTexture(b) { var P = this.cache, N = this.json; if (P.textures.has(b)) return P.textures.get(b); N.textures || (N.textures = []); var D = { sampler: this.processSampler(b), source: this.processImage(b.image, b.format, b.flipY) }; b.name && (D.name = b.name), this._invokeAll(function(V) { V.writeTexture && V.writeTexture(b, D); }); var k = N.textures.push(D) - 1; return P.textures.set(b, k), k; } /** * Process material * @param {THREE.Material} material Material to process * @return {Integer|null} Index of the processed material in the "materials" array */ processMaterial(b) { var P = this.cache, N = this.json; if (P.materials.has(b)) return P.materials.get(b); if (b.isShaderMaterial) return console.warn("GLTFExporter: THREE.ShaderMaterial not supported."), null; N.materials || (N.materials = []); var D = { pbrMetallicRoughness: {} }; b.isMeshStandardMaterial !== !0 && b.isMeshBasicMaterial !== !0 && console.warn("GLTFExporter: Use MeshStandardMaterial or MeshBasicMaterial for best results."); var k = b.color.toArray().concat([b.opacity]); if (S(k, [1, 1, 1, 1]) || (D.pbrMetallicRoughness.baseColorFactor = k), b.isMeshStandardMaterial ? (D.pbrMetallicRoughness.metallicFactor = b.metalness, D.pbrMetallicRoughness.roughnessFactor = b.roughness) : (D.pbrMetallicRoughness.metallicFactor = 0.5, D.pbrMetallicRoughness.roughnessFactor = 0.5), b.metalnessMap || b.roughnessMap) if (b.metalnessMap === b.roughnessMap) { var V = { index: this.processTexture(b.metalnessMap) }; this.applyTextureTransform(V, b.metalnessMap), D.pbrMetallicRoughness.metallicRoughnessTexture = V; } else console.warn("THREE.GLTFExporter: Ignoring metalnessMap and roughnessMap because they are not the same Texture."); if (b.map) { var q = { index: this.processTexture(b.map) }; this.applyTextureTransform(q, b.map), D.pbrMetallicRoughness.baseColorTexture = q; } if (b.emissive) { var Y = b.emissive.clone().multiplyScalar(b.emissiveIntensity), ne = Math.max(Y.r, Y.g, Y.b); if (1 < ne && (Y.multiplyScalar(1 / ne), console.warn("THREE.GLTFExporter: Some emissive components exceed 1; emissive has been limited")), 0 < ne && (D.emissiveFactor = Y.toArray()), b.emissiveMap) { var X = { index: this.processTexture(b.emissiveMap) }; this.applyTextureTransform(X, b.emissiveMap), D.emissiveTexture = X; } } if (b.normalMap) { var z = { index: this.processTexture(b.normalMap) }; b.normalScale && b.normalScale.x !== -1 && (b.normalScale.x !== b.normalScale.y && console.warn("THREE.GLTFExporter: Normal scale components are different, ignoring Y and exporting X."), z.scale = b.normalScale.x), this.applyTextureTransform(z, b.normalMap), D.normalTexture = z; } if (b.aoMap) { var H = { index: this.processTexture(b.aoMap), texCoord: 1 }; b.aoMapIntensity !== 1 && (H.strength = b.aoMapIntensity), this.applyTextureTransform(H, b.aoMap), D.occlusionTexture = H; } b.transparent ? D.alphaMode = "BLEND" : 0 < b.alphaTest && (D.alphaMode = "MASK", D.alphaCutoff = b.alphaTest), b.side === l.DoubleSide && (D.doubleSided = !0), b.name !== "" && (D.name = b.name), this.serializeUserData(b, D), this._invokeAll(function(Q) { Q.writeMaterial && Q.writeMaterial(b, D); }); var ee = N.materials.push(D) - 1; return P.materials.set(b, ee), ee; } /** * Process mesh * @param {THREE.Mesh} mesh Mesh to process * @return {Integer|null} Index of the processed mesh in the "meshes" array */ processMesh(b) { var P = this.cache, N = this.json, D = [b.geometry.uuid]; if (Array.isArray(b.material)) for (var k = 0, V = b.material.length; k < V; k++) D.push(b.material[k].uuid); else D.push(b.material.uuid); var q = D.join(":"); if (P.meshes.has(q)) return P.meshes.get(q); var Y, ne = b.geometry; if (Y = b.isLineSegments ? u.LINES : b.isLineLoop ? u.LINE_LOOP : b.isLine ? u.LINE_STRIP : b.isPoints ? u.POINTS : b.material.wireframe ? u.LINES : u.TRIANGLES, ne.isBufferGeometry !== !0) throw new Error("THREE.GLTFExporter: Geometry is not of type THREE.BufferGeometry."); var X = {}, z = {}, H = [], ee = [], Q = { uv: "TEXCOORD_0", uv2: "TEXCOORD_1", color: "COLOR_0", skinWeight: "WEIGHTS_0", skinIndex: "JOINTS_0" }, J = ne.getAttribute("normal"); J === void 0 || this.isNormalizedNormalAttribute(J) || (console.warn("THREE.GLTFExporter: Creating normalized normal attribute from the non-normalized one."), ne.setAttribute("normal", this.createNormalizedNormalAttribute(J))); var W = null; for (var K in ne.attributes) if (K.substr(0, 5) !== "morph") { var ie = ne.attributes[K]; K = Q[K] || K.toUpperCase(); var B = /^(POSITION|NORMAL|TANGENT|TEXCOORD_\d+|COLOR_\d+|JOINTS_\d+|WEIGHTS_\d+)$/; if (B.test(K) || (K = "_" + K), P.attributes.has(this.getUID(ie))) { z[K] = P.attributes.get(this.getUID(ie)); continue; } W = null; var j = ie.array; K !== "JOINTS_0" || j instanceof Uint16Array || j instanceof Uint8Array || (console.warn('GLTFExporter: Attribute "skinIndex" converted to type UNSIGNED_SHORT.'), W = new l.BufferAttribute(new Uint16Array(j), ie.itemSize, ie.normalized)); var re = this.processAccessor(W || ie, ne); re !== null && (z[K] = re, P.attributes.set(this.getUID(ie), re)); } if (J !== void 0 && ne.setAttribute("normal", J), Object.keys(z).length === 0) return null; if (b.morphTargetInfluences !== void 0 && 0 < b.morphTargetInfluences.length) { var F = [], U = [], se = {}; if (b.morphTargetDictionary !== void 0) for (var ue in b.morphTargetDictionary) se[b.morphTargetDictionary[ue]] = ue; for (var fe = 0; fe < b.morphTargetInfluences.length; ++fe) { var ve = {}, _e = !1; for (var ae in ne.morphAttributes) { if (ae != "position" && ae !== "normal" && ae !== "color") { _e || (console.warn("GLTFExporter: Only POSITION and NORMAL morph are supported."), _e = !0); continue; } var Te = ne.morphAttributes[ae][fe], Ee = ae.toUpperCase(); Q[ae] && (Ee = Q[ae]); var oe = ne.attributes[ae]; if (P.attributes.has(this.getUID(Te))) { ve[Ee] = P.attributes.get(this.getUID(Te)); continue; } var Me = oe.clone(); if (!ne.morphTargetsRelative) if (oe) for (var ye = 0, we = Te.count; ye < we; ye++) oe.count > ye && Me.setXYZ(ye, Te.getX(ye) - oe.getX(ye), Te.getY(ye) - oe.getY(ye), Te.getZ(ye) - oe.getZ(ye)); else for (var Pe = 0, ut = Te.count; Pe < ut; Pe++) Me.setXYZ(Pe, 0, 0, 0); ve[Ee] = this.processAccessor(Me, ne), P.attributes.set(this.getUID(oe), ve[Ee]); } ee.push(ve), F.push(b.morphTargetInfluences[fe]), b.morphTargetDictionary !== void 0 && U.push(se[fe]); } X.weights = F, 0 < U.length && (X.extras = {}, X.extras.targetNames = U); } var mt = Array.isArray(b.material); if (mt && ne.groups.length === 0) return null; for (var Ge, bt = mt ? b.material : [b.material], ze = mt ? ne.groups : [{ materialIndex: 0, start: void 0, count: void 0 }], at = 0, et = ze.length; at < et; at++) { if (Ge = { mode: Y, attributes: z }, this.serializeUserData(ne, Ge), 0 < ee.length && (Ge.targets = ee), ne.index !== null) { var yt = this.getUID(ne.index); (ze[at].start !== void 0 || ze[at].count !== void 0) && (yt += ":" + ze[at].start + ":" + ze[at].count), P.attributes.has(yt) ? Ge.indices = P.attributes.get(yt) : (Ge.indices = this.processAccessor(ne.index, ne, ze[at].start, ze[at].count), P.attributes.set(yt, Ge.indices)), Ge.indices === null && delete Ge.indices; } var dt = this.processMaterial(bt[ze[at].materialIndex]); dt !== null && (Ge.material = dt), H.push(Ge); } X.primitives = H, N.meshes || (N.meshes = []), this._invokeAll(function(Rt) { Rt.writeMesh && Rt.writeMesh(b, X); }); var kt = N.meshes.push(X) - 1; return P.meshes.set(q, kt), kt; } /** * Process camera * @param {THREE.Camera} camera Camera to process * @return {Integer} Index of the processed mesh in the "camera" array */ processCamera(b) { var P = this.json; P.cameras || (P.cameras = []); var N = b.isOrthographicCamera, D = { type: N ? "orthographic" : "perspective" }; return N ? D.orthographic = { xmag: 2 * b.right, ymag: 2 * b.top, zfar: 0 >= b.far ? 1e-3 : b.far, znear: 0 > b.near ? 0 : b.near } : D.perspective = { aspectRatio: b.aspect, yfov: l.MathUtils.degToRad(b.fov), zfar: 0 >= b.far ? 1e-3 : b.far, znear: 0 > b.near ? 0 : b.near }, b.name !== "" && (D.name = b.type), P.cameras.push(D) - 1; } /** * Creates glTF animation entry from AnimationClip object. * * Status: * - Only properties listed in PATH_PROPERTIES may be animated. * * @param {THREE.AnimationClip} clip * @param {THREE.Object3D} root * @return {number|null} */ processAnimation(b, P) { var N = this.json, D = this.nodeMap; N.animations || (N.animations = []), b = h.Utils.mergeMorphTargetTracks(b.clone(), P); for (var k = b.tracks, V = [], q = [], Y = 0; Y < k.length; ++Y) { var ne = k[Y], X = l.PropertyBinding.parseTrackName(ne.name), z = l.PropertyBinding.findNode(P, X.nodeName), H = g[X.propertyName]; if (X.objectName === "bones" && (z.isSkinnedMesh === !0 ? z = z.skeleton.getBoneByName(X.objectIndex) : z = void 0), !z || !H) return console.warn('THREE.GLTFExporter: Could not export animation track "%s".', ne.name), null; var ee = 1, Q = ne.values.length / ne.times.length; H === g.morphTargetInfluences && (Q /= z.morphTargetInfluences.length); var J = void 0; ne.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline === !0 ? (J = "CUBICSPLINE", Q /= 3) : ne.getInterpolation() === l.InterpolateDiscrete ? J = "STEP" : J = "LINEAR", q.push({ input: this.processAccessor(new l.BufferAttribute(ne.times, ee)), output: this.processAccessor(new l.BufferAttribute(ne.values, Q)), interpolation: J }), V.push({ sampler: q.length - 1, target: { node: D.get(z), path: H } }); } return N.animations.push({ name: b.name || "clip_" + N.animations.length, samplers: q, channels: V }), N.animations.length - 1; } /** * @param {THREE.Object3D} object * @return {number|null} */ processSkin(b) { var P = this.json, N = this.nodeMap, D = P.nodes[N.get(b)], k = b.skeleton; if (k === void 0) return null; var V = b.skeleton.bones[0]; if (V === void 0) return null; for (var q = [], Y = new Float32Array(16 * k.bones.length), ne = new l.Matrix4(), X = 0; X < k.bones.length; ++X) q.push(N.get(k.bones[X])), ne.copy(k.boneInverses[X]), ne.multiply(b.bindMatrix).toArray(Y, 16 * X); P.skins === void 0 && (P.skins = []), P.skins.push({ inverseBindMatrices: this.processAccessor(new l.BufferAttribute(Y, 16)), joints: q, skeleton: N.get(V) }); var z = D.skin = P.skins.length - 1; return z; } /** * Process Object3D node * @param {THREE.Object3D} node Object3D to processNode * @return {Integer} Index of the node in the nodes list */ processNode(b) { var P = this.json, N = this.options, D = this.nodeMap; P.nodes || (P.nodes = []); var k = {}; if (N.trs) { var V = b.quaternion.toArray(), q = b.position.toArray(), Y = b.scale.toArray(); S(V, [0, 0, 0, 1]) || (k.rotation = V), S(q, [0, 0, 0]) || (k.translation = q), S(Y, [1, 1, 1]) || (k.scale = Y); } else b.matrixAutoUpdate && b.updateMatrix(), x(b.matrix) === !1 && (k.matrix = b.matrix.elements); if (b.name !== "" && (k.name = b.name + ""), this.serializeUserData(b, k), b.isMesh || b.isLine || b.isPoints) { var ne = this.processMesh(b); ne !== null && (k.mesh = ne); } else b.isCamera && (k.camera = this.processCamera(b)); if (b.isSkinnedMesh && this.skins.push(b), 0 < b.children.length) { for (var X, z = [], H = 0, ee = b.children.length; H < ee; H++) if (X = b.children[H], X.visible || N.onlyVisible === !1) { var Q = this.processNode(X); Q !== null && z.push(Q); } 0 < z.length && (k.children = z); } this._invokeAll(function(W) { W.writeNode && W.writeNode(b, k); }); var J = P.nodes.push(k) - 1; return D.set(b, J), J; } /** * Process Scene * @param {Scene} node Scene to process */ processScene(b) { var P = this.json, N = this.options; P.scenes || (P.scenes = [], P.scene = 0); var D = {}; b.name !== "" && (D.name = b.name), P.scenes.push(D); for (var k, V = [], q = 0, Y = b.children.length; q < Y; q++) if (k = b.children[q], k.visible || N.onlyVisible === !1) { var ne = this.processNode(k); ne !== null && V.push(ne); } 0 < V.length && (D.nodes = V), this.serializeUserData(b, D); } /** * Creates a Scene to hold a list of objects and parse it * @param {Array} objects List of objects to process */ processObjects(b) { var P = new l.Scene(); P.name = "AuxScene"; for (var N = 0; N < b.length; N++) P.children.push(b[N]); this.processScene(P); } /** * @param {THREE.Object3D|Array} input */ processInput(b) { var P = this.options; b = b instanceof Array ? b : [b], this._invokeAll(function(q) { q.beforeParse && q.beforeParse(b); }); for (var N = [], D = 0; D < b.length; D++) b[D] instanceof l.Scene ? this.processScene(b[D]) : N.push(b[D]); 0 < N.length && this.processObjects(N); for (var k = 0; k < this.skins.length; ++k) this.processSkin(this.skins[k]); for (var V = 0; V < P.animations.length; ++V) this.processAnimation(P.animations[V].clip, P.animations[V].mesh); this._invokeAll(function(q) { q.afterParse && q.afterParse(b); }); } _invokeAll(b) { for (var P = 0, N = this.plugins.length; P < N; P++) b(this.plugins[P]); } } class L { constructor(b) { this.writer = b, this.name = "KHR_lights_punctual"; } writeNode(b, P) { if (b.isLight) { if (!b.isDirectionalLight && !b.isPointLight && !b.isSpotLight) return void console.warn("THREE.GLTFExporter: Only directional, point, and spot lights are supported.", b); var N = this.writer, D = N.json, k = N.extensionsUsed, V = {}; b.name && (V.name = b.name), V.color = b.color.toArray(), V.intensity = b.intensity, b.isDirectionalLight ? V.type = "directional" : b.isPointLight ? (V.type = "point", 0 < b.distance && (V.range = b.distance)) : b.isSpotLight && (V.type = "spot", 0 < b.distance && (V.range = b.distance), V.spot = {}, V.spot.innerConeAngle = -1 * ((b.penumbra - 1) * b.angle), V.spot.outerConeAngle = b.angle), b.decay !== void 0 && b.decay !== 2 && console.warn("THREE.GLTFExporter: Light decay may be lost. glTF is physically-based, and expects light.decay=2."), b.target && (b.target.parent !== b || b.target.position.x !== 0 || b.target.position.y !== 0 || b.target.position.z !== -1) && console.warn("THREE.GLTFExporter: Light direction may be lost. For best results, make light.target a child of the light with position 0,0,-1."), k[this.name] || (D.extensions = D.extensions || {}, D.extensions[this.name] = { lights: [] }, k[this.name] = !0); var q = D.extensions[this.name].lights; q.push(V), P.extensions = P.extensions || {}, P.extensions[this.name] = { light: q.length - 1 }; } } } class C { constructor(b) { this.writer = b, this.name = "KHR_materials_unlit"; } writeMaterial(b, P) { if (b.isMeshBasicMaterial) { var N = this.writer, D = N.extensionsUsed; P.extensions = P.extensions || {}, P.extensions[this.name] = {}, D[this.name] = !0, P.pbrMetallicRoughness.metallicFactor = 0, P.pbrMetallicRoughness.roughnessFactor = 0.9; } } } class I { constructor(b) { this.writer = b, this.name = "KHR_materials_pbrSpecularGlossiness"; } writeMaterial(b, P) { if (b.isGLTFSpecularGlossinessMaterial) { var N = this.writer, D = N.extensionsUsed, k = {}; P.pbrMetallicRoughness.baseColorFactor && (k.diffuseFactor = P.pbrMetallicRoughness.baseColorFactor); var V = [1, 1, 1]; if (b.specular.toArray(V, 0), k.specularFactor = V, k.glossinessFactor = b.glossiness, P.pbrMetallicRoughness.baseColorTexture && (k.diffuseTexture = P.pbrMetallicRoughness.baseColorTexture), b.specularMap) { var q = { index: N.processTexture(b.specularMap) }; N.applyTextureTransform(q, b.specularMap), k.specularGlossinessTexture = q; } P.extensions = P.extensions || {}, P.extensions[this.name] = k, D[this.name] = !0; } } } h.Utils = { insertKeyframe: function(R, b) { var P, N = 1e-3, D = R.getValueSize(), k = new R.TimeBufferType(R.times.length + 1), V = new R.ValueBufferType(R.values.length + D), q = R.createInterpolant(new R.ValueBufferType(D)); if (R.times.length === 0) { k[0] = b; for (var Y = 0; Y < D; Y++) V[Y] = 0; P = 0; } else if (b < R.times[0]) { if (Math.abs(R.times[0] - b) < N) return 0; k[0] = b, k.set(R.times, 1), V.set(q.evaluate(b), 0), V.set(R.values, D), P = 0; } else if (b > R.times[R.times.length - 1]) { if (Math.abs(R.times[R.times.length - 1] - b) < N) return R.times.length - 1; k[k.length - 1] = b, k.set(R.times, 0), V.set(R.values, 0), V.set(q.evaluate(b), R.values.length), P = k.length - 1; } else for (var ne = 0; ne < R.times.length; ne++) { if (Math.abs(R.times[ne] - b) < N) return ne; if (R.times[ne] < b && R.times[ne + 1] > b) { k.set(R.times.slice(0, ne + 1), 0), k[ne + 1] = b, k.set(R.times.slice(ne + 1), ne + 2), V.set(R.values.slice(0, (ne + 1) * D), 0), V.set(q.evaluate(b), (ne + 1) * D), V.set(R.values.slice((ne + 1) * D), (ne + 2) * D), P = ne + 1; break; } } return R.times = k, R.values = V, P; }, mergeMorphTargetTracks: function(R, b) { for (var P = [], N = {}, D = R.tracks, k = 0; k < D.length; ++k) { var V = D[k], q = l.PropertyBinding.parseTrackName(V.name), Y = l.PropertyBinding.findNode(b, q.nodeName); if (q.propertyName !== "morphTargetInfluences" || q.propertyIndex === void 0) { P.push(V); continue; } if (V.createInterpolant !== V.InterpolantFactoryMethodDiscrete && V.createInterpolant !== V.InterpolantFactoryMethodLinear) { if (V.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline) throw new Error("THREE.GLTFExporter: Cannot merge tracks with glTF CUBICSPLINE interpolation."); console.warn("THREE.GLTFExporter: Morph target interpolation mode not yet supported. Using LINEAR instead."), V = V.clone(), V.setInterpolation(l.InterpolateLinear); } var ne = Y.morphTargetInfluences.length, X = Y.morphTargetDictionary[q.propertyIndex]; if (X === void 0) throw new Error("THREE.GLTFExporter: Morph target name not found: " + q.propertyIndex); var z = void 0; if (N[Y.uuid] === void 0) { z = V.clone(); for (var H = new z.ValueBufferType(ne * z.times.length), ee = 0; ee < z.times.length; ee++) H[ee * ne + X] = z.values[ee]; z.name = (q.nodeName || "") + ".morphTargetInfluences", z.values = H, N[Y.uuid] = z, P.push(z); continue; } var Q = V.createInterpolant(new V.ValueBufferType(1)); z = N[Y.uuid]; for (var J = 0; J < z.times.length; J++) z.values[J * ne + X] = Q.evaluate(z.times[J]); for (var W, K = 0; K < V.times.length; K++) W = this.insertKeyframe(z, V.times[K]), z.values[W * ne + X] = V.values[K]; } return R.tracks = P, R; } }; }, /* 43 */ /***/ (a, s, c) => { var l = c(4), h = c(5).resolveURL, u = function() { this.nearPlane = 0.168248, this.farPlane = 6.82906, this.eyePosition = [0.5, -2.86496, 0.5], this.targetPosition = [0.5, 0.5, 0.5], this.upVector = [0, 0, 1]; var T = this; this.setFromObject = (x) => { var { nearPlane: w, farPlane: A, eyePosition: _, targetPosition: E, upVector: O } = x; T.nearPlane = w, T.farPlane = A, T.eyePosition = _, T.targetPosition = E, T.upVector = O; }; }, p = function(T, x, w, A) { var _ = { NONE: -1, DEFAULT: 0, PATH: 1, SMOOTH_CAMERA_TRANSITION: 2, AUTO_TUMBLE: 3, ROTATE_TRANSITION: 4, MINIMAP: 5, SYNC_CONTROL: 6 }, E = { NONE: -1, ROTATE: 0, ZOOM: 1, PAN: 2, TOUCH_ROTATE: 3, TOUCH_ZOOM: 4, TOUCH_PAN: 5, SCROLL: 6, KEYBOARD_ZOOM: 7, KEYBOARD_ROTATE: 8, KEYBOARD_PAN: 9 }, O = { NONE: -1, FREE: 1, HORIZONTAL: 2, VERTICAL: 3 }, L = { ARROWLEFT: 37, ARROWUP: 38, ARROWRIGHT: 39, ARROWDOWN: 40, NUMPADADD: 107, NUMPADSUBTRACT: 109, EQUAL: 187, MINUS: 189 }, C = {}; C.MAIN = E.ROTATE, C.AUXILIARY = E.ZOOM, C.SECONDARY = E.PAN, this.cameraObject = T, this.domElement = x === void 0 ? document : x, this.renderer = w, this.scene = A, this.tumble_rate = 1.5, this.pointer_x = 0, this.pointer_y = 0, this.pointer_x_start = 0, this.pointer_y_start = 0, this.previous_pointer_x = 0, this.previous_pointer_y = 0, this.near_plane_fly_debt = 0, this.touchZoomDistanceStart = 0, this.touchZoomDistanceEnd = 0, this.directionalLight = 0, this.zoomRate = 50, this.rotateRate = 50, this.panRate = 100, this.pixelHeight = 1; var I = 6e3, R = !0, b = 0, P = void 0, N = void 0, D = !1, k = 500, V = void 0, q = "default", Y = _.DEFAULT, ne = void 0, X = void 0, z = void 0, H = 0, ee = O.FREE; this._state = E.NONE; var Q; this.targetTouchId = -1; var J = void 0, W = new l.Vector3(), K = new l.Vector3(), ie = new l.Vector3(), B = new l.Vector3(), j = new l.Vector3(), re = new l.Vector3(), F = new l.Vector3(), U = new l.Vector3(), se = new l.Sphere(), ue = new l.Vector3(), fe = !1, ve = void 0, _e = 0, ae = { default: new u() }; ae.default.nearPlane = 0.1, ae.default.farPlane = 2e3, ae.default.eyePosition = [0, 0, 0], ae.default.targetPosition = [0, 0, -1], ae.default.upVector = [0, 1, 0], this.cameraObject.target === void 0 && (this.cameraObject.target = new l.Vector3(...ae.default.targetPosition)), this.calculateMaxAllowedDistance = (te) => { var Se = te.getBoundingBox(); if (Se) { Se.getBoundingSphere(se), _e = 6 * se.radius; var De = 0; this.cameraObject && (De = this.cameraObject.position.distanceTo(se.center)), _e = De > _e ? 1.5 * De : _e; } else _e = 0; }, this.addViewport = (te, Se) => { te && Se && (ae[te] = Se); }, this.setDefaultViewport = (te) => !!(te && te in ae) && (q = te, !0), this.getDefaultViewport = () => q, this.getViewportOfName = (te) => ae[te], this.setCurrentViewport = (te) => te in ae && (this.setCurrentCameraSettings(ae[te]), !0), this.setRotationMode = (te) => { switch (te) { case "none": ee = O.NONE; break; case "horizontal": ee = O.HORIZONTAL; break; case "vertical": ee = O.VERTICAL; break; case "free": default: ee = O.FREE; } }, this.onResize = () => { J && (J = void 0), ve && ve.setCurrentCameraSettings(this.cameraObject, ae[q]); }, this.getVisibleHeightAtZDepth = (te) => { var Se = this.cameraObject.position.distanceTo(this.cameraObject.target); te < Se ? te -= Se : te += Se; var De = this.cameraObject.fov * Math.PI / 180; return 2 * Math.tan(De / 2) * Math.abs(te); }, this.calculateHeightPerPixelAtZeroDepth = (te) => { var Se = this.getVisibleHeightAtZDepth(0); return this.pixelHeight = Se / te, this.pixelHeight; }, this.getNDCFromDocumentCoords = (te, Se, De) => { ze(!1); var We = De || new l.Vector2(), st = 2 * ((te - J.left) / J.width) - 1, $ = 2 * -((Se - J.top) / J.height) + 1; return We.set(st, $); }, this.getRelativeCoordsFromNDC = (te, Se, De) => { ze(!1); var We = De || new l.Vector2(); return We.x = (te + 1) * J.width / 2, We.y = (1 - Se) * J.height / 2, We; }, this.setMouseButtonAction = (te, Se) => { C[te] = E[Se]; }; var Te = (te, Se) => { te instanceof HTMLCanvasElement && (te.tabIndex = Se); }, Ee = () => { if (0 < _e) { var te = ue.distanceTo(se.center); return _e > te || this.cameraObject.position.distanceTo(se.center) > te; } return !0; }, oe = (te) => { ue.copy(this.cameraObject.position).add(te), Ee() && (this.cameraObject.target.add(te), this.cameraObject.position.add(te), this.updateDirectionalLight()); }, Me = (te) => { ze(!1); var Se; if (Y === _.DEFAULT && (Se = this.scene.getNormalisedMinimapCoordinates(this.renderer, te)), !Se) te.button == 0 ? te.ctrlKey ? this._state = C.AUXILIARY : te.shiftKey ? this._state = C.SECONDARY : this._state = C.MAIN : te.button == 1 ? (te.preventDefault(), this._state = C.AUXILIARY) : te.button == 2 && (this._state = C.SECONDARY), this.pointer_x = te.clientX - J.left, this.pointer_y = te.clientY - J.top, this.pointer_x_start = this.pointer_x, this.pointer_y_start = this.pointer_y, this.previous_pointer_x = this.pointer_x, this.previous_pointer_y = this.pointer_y; else { Y = _.MINIMAP; var De = this.scene.getMinimapDiffFromNormalised(Se.x, Se.y); oe(De); } }, ye = (te) => { if (ze(!1), J) if (this.pointer_x = te.clientX - J.left, this.pointer_y = te.clientY - J.top, Y === _.MINIMAP) { var Se = this.scene.getNormalisedMinimapCoordinates(this.renderer, te); if (Se) { var De = this.scene.getMinimapDiffFromNormalised(Se.x, Se.y); oe(De); } } else this._state === E.NONE && Q !== void 0 && Q.move(this, te.clientX, te.clientY, this.renderer); }, we = (te) => { this._state = E.NONE, Y == _.MINIMAP && (Y = _.DEFAULT), Q !== void 0 && this.pointer_x_start == te.clientX - J.left && this.pointer_y_start == te.clientY - J.top && Q.pick(this, te.clientX, te.clientY, this.renderer); }, Pe = (te) => { this._state = E.NONE; }, ut = (te) => { ze(!1); var Se = te.touches.length; if (Se == 1) { var De, We; this._state = E.TOUCH_ROTATE, this.pointer_x = te.touches[0].clientX - ((De = J) === null || De === void 0 ? void 0 : De.left), this.pointer_y = te.touches[0].clientY - ((We = J) === null || We === void 0 ? void 0 : We.top), this.pointer_x_start = this.pointer_x, this.pointer_y_start = this.pointer_y, this.previous_pointer_x = this.pointer_x, this.previous_pointer_y = this.pointer_y; } else if (Se == 2) { this._state = E.TOUCH_ZOOM; var st = te.touches[0].clientX - te.touches[1].clientX, $ = te.touches[0].clientY - te.touches[1].clientY; this.touchZoomDistanceEnd = this.touchZoomDistanceStart = Math.sqrt(st * st + $ * $); } else if (Se == 3) { var pe, de; this._state = E.TOUCH_PAN, this.targetTouchId = te.touches[0].identifier, this.pointer_x = te.touches[0].clientX - ((pe = J) === null || pe === void 0 ? void 0 : pe.left), this.pointer_y = te.touches[0].clientY - ((de = J) === null || de === void 0 ? void 0 : de.top), this.previous_pointer_x = this.pointer_x, this.previous_pointer_y = this.pointer_y; } }, mt = (te) => { te.preventDefault(), te.stopPropagation(); var Se = te.touches.length; if (Se == 1) this.pointer_x = te.touches[0].clientX - J.left, this.pointer_y = te.touches[0].clientY - J.top; else if (Se == 2) { if (this._state === E.TOUCH_ZOOM) { var De = te.touches[0].clientX - te.touches[1].clientX, We = te.touches[0].clientY - te.touches[1].clientY; this.touchZoomDistanceEnd = Math.sqrt(De * De + We * We); } } else if (Se == 3 && this._state === E.TOUCH_PAN) for (var st = 0; 3 > st; st++) te.touches[st].identifier == this.targetTouchId && (this.pointer_x = te.touches[0].clientX - J.left, this.pointer_y = te.touches[0].clientY - J.top); }, Ge = (te) => { var Se = te.touches.length; this.touchZoomDistanceStart = this.touchZoomDistanceEnd = 0, this.targetTouchId = -1, this._state = E.NONE, Se == 1 && Q !== void 0 && this.pointer_x_start == te.touches[0].clientX - J.left && this.pointer_y_start == te.touches[0].clientY - J.top && Q.pick(this.cameraObject, te.touches[0].clientX, te.touches[0].clientY, this.renderer); }, bt = () => { ze(!0); }, ze = (te) => { if (te || J === void 0) { var Se = new IntersectionObserver((De) => { for (var We of De) J = We.boundingClientRect; Se.disconnect(); }); Se.observe(this.domElement); } }, at = (te) => { ze(!1), this._state = E.SCROLL; var Se = 0; 0 < te.deltaY ? Se = this.zoomRate : 0 > te.deltaY && (Se = -1 * this.zoomRate), H += Se, te.preventDefault(), te.stopImmediatePropagation(); }, et = (te) => { ze(!1); var Se = 0; if (te.keyCode === L.EQUAL || te.keyCode === L.MINUS || te.keyCode === L.NUMPADADD || te.keyCode === L.NUMPADSUBTRACT) { this._state = E.KEYBOARD_ZOOM; var De = 1; te.shiftKey && (De *= 2), te.keyCode === L.EQUAL || te.keyCode === L.NUMPADADD ? Se = -1 * (this.zoomRate * De) : (te.keyCode === L.MINUS || te.keyCode === L.NUMPADSUBTRACT) && (Se = this.zoomRate * De), H += Se; } else (te.keyCode === L.ARROWLEFT || te.keyCode === L.ARROWUP || te.keyCode === L.ARROWRIGHT || te.keyCode === L.ARROWDOWN) && (te.shiftKey ? (this._state = E.KEYBOARD_ROTATE, this.pointer_x_start = this.pointer_x, this.pointer_y_start = this.pointer_y, Se = this.rotateRate) : (this._state = E.KEYBOARD_PAN, Se = this.panRate), this.previous_pointer_x = this.pointer_x, this.previous_pointer_y = this.pointer_y, te.keyCode === L.ARROWLEFT ? this.pointer_x -= Se : te.keyCode === L.ARROWUP ? this.pointer_y -= Se : te.keyCode === L.ARROWRIGHT ? this.pointer_x += Se : te.keyCode === L.ARROWDOWN && (this.pointer_y += Se)); te.preventDefault(); }, yt = (te) => { this._state = E.NONE; }, dt = () => { if (typeof this.cameraObject < "u") { var te = J.height, Se = this.cameraObject.position.distanceTo(this.cameraObject.target), De = 0; this.cameraObject.far > this.cameraObject.near && Se >= this.cameraObject.near && Se <= this.cameraObject.far && (De = (Se - this.cameraObject.near) / (this.cameraObject.far - this.cameraObject.near)), K.set(this.previous_pointer_x, te - this.previous_pointer_y, 0), ie.set(this.previous_pointer_x, te - this.previous_pointer_y, 1), B.set(this.pointer_x, te - this.pointer_y, 0), j.set(this.pointer_x, te - this.pointer_y, 1), K.unproject(this.cameraObject), ie.unproject(this.cameraObject), B.unproject(this.cameraObject), j.unproject(this.cameraObject); var We = -2e-3; B.sub(K).multiplyScalar(1 - De), j.sub(ie).multiplyScalar(De), B.add(j).multiplyScalar(We), oe(B); } this.previous_pointer_x = this.pointer_x, this.previous_pointer_y = this.pointer_y; }; this.getVectorsFromRotateAboutLookAtPoints = (te, Se) => { te.normalize(), F.copy(this.cameraObject.position).sub(this.cameraObject.target), U.copy(F), F.normalize(), 0.8 < Math.abs(F.dot(te)) && F.copy(this.cameraObject.up), K.crossVectors(te, F).normalize(), ie.crossVectors(te, K); var De = te.dot(U), We = K.dot(U), st = ie.dot(U), $ = te.dot(this.cameraObject.up), pe = K.dot(this.cameraObject.up), de = ie.dot(this.cameraObject.up), be = Math.cos(Se), Ce = Math.sin(Se); return B.set(be * K.x + Ce * ie.x, be * K.y + Ce * ie.y, be * K.z + Ce * ie.z), j.set(be * ie.x - Ce * K.x, be * ie.y - Ce * K.y, be * ie.z - Ce * K.z), F.copy(this.cameraObject.target), F.x = F.x + te.x * De + B.x * We + j.x * st, F.y = F.y + te.y * De + B.y * We + j.y * st, F.z = F.z + te.z * De + B.z * We + j.z * st, W.set(te.x * $ + B.x * pe + j.x * de, te.y * $ + B.y * pe + j.y * de, te.z * $ + B.z * pe + j.z * de), { position: F, up: W }; }, this.rotateAboutLookAtpoint = (te, Se) => { var De = this.getVectorsFromRotateAboutLookAtPoints(te, Se); this.cameraObject.position.copy(De.position), this.updateDirectionalLight(), this.cameraObject.up.copy(De.up); }; var kt = () => { if (typeof this.cameraObject < "u") { var te, Se, De = (te = J) === null || te === void 0 ? void 0 : te.width, We = (Se = J) === null || Se === void 0 ? void 0 : Se.height; if (0 < De && 0 < We) { var st = 0.25 * (De + We), $ = 0, pe = 0; (ee === O.FREE || ee === O.HORIZONTAL) && ($ = this.pointer_x - this.previous_pointer_x), (ee === O.FREE || ee === O.VERTICAL) && (pe = this.previous_pointer_y - this.pointer_y); var de = Math.sqrt($ * $ + pe * pe); if (0 < de) { var be = 1 * -pe / de, Ce = 1 * $ / de, he = 0; ee === O.FREE && be * (this.pointer_x - 0.5 * (De - 1)) + Ce * (0.5 * (We - 1) - this.pointer_y); var xe = Math.acos(he / st) - 0.5 * Math.PI, Ne = this.tumble_rate * de / st; W.copy(this.cameraObject.position).sub(this.cameraObject.target).normalize(), K.copy(this.cameraObject.up).normalize(), ie.copy(K).cross(W).normalize().multiplyScalar(be), K.multiplyScalar(Ce), re.addVectors(ie, K).multiplyScalar(Math.cos(xe)), W.multiplyScalar(Math.sin(xe)), re.add(W), this.rotateAboutLookAtpoint(re, -Ne); } } } this.previous_pointer_x = this.pointer_x, this.previous_pointer_y = this.pointer_y; }, Rt = () => { var te = 0; return this._state === E.ZOOM ? te = this.previous_pointer_y - this.pointer_y : this._state === E.SCROLL || this._state === E.KEYBOARD_ZOOM ? te = H : (te = -1 * (this.touchZoomDistanceEnd - this.touchZoomDistanceStart), this.touchZoomDistanceStart = this.touchZoomDistanceEnd), te; }; this.changeZoomByScrollRateUnit = (te) => { var Se = te * this.zoomRate; this.changeZoomByValue(Se); }, this.changeZoomByValue = (te) => { if (typeof this.cameraObject < "u") { var Se = J.height, De = this.cameraObject.position.clone(); De.sub(this.cameraObject.target); var We = De.length(), st = 1.5 * te / Se; if (0.01 < We + st * We && (De.normalize(), ue.copy(this.cameraObject.position), ue.x += De.x * st * We, ue.y += De.y * st * We, ue.z += De.z * st * We, Ee())) { this.cameraObject.position.copy(ue), this.updateDirectionalLight(); var $ = 1e-5; if ($ * this.cameraObject.far < this.cameraObject.near + st * We + this.near_plane_fly_debt) this.near_plane_fly_debt != 0 && (this.near_plane_fly_debt += st * We, 0 < this.near_plane_fly_debt ? (this.cameraObject.near += this.near_plane_fly_debt, this.cameraObject.far += this.near_plane_fly_debt, this.near_plane_fly_debt = 0) : (this.cameraObject.near += st * We, this.cameraObject.far += st * We)); else { if (this.near_plane_fly_debt == 0) { var pe = this.cameraObject.near - $ * this.cameraObject.far; this.cameraObject.near = $ * this.cameraObject.far, this.cameraObject.far -= pe, this.near_plane_fly_debt -= $ * this.cameraObject.far; } this.near_plane_fly_debt += st * We; } fe = !0; } } }; var Ii = () => { var te = Rt(); this.changeZoomByValue(te), this._state === E.ZOOM && (this.previous_pointer_x = this.pointer_x, this.previous_pointer_y = this.pointer_y), (this._state === E.SCROLL || this._state === E.KEYBOARD_ZOOM) && (H = 0, this._state = E.NONE); }; this.setDirectionalLight = (te) => { this.directionalLight = te; }, this.updateDirectionalLight = () => { this.directionalLight != 0 && this.directionalLight.position.set(this.cameraObject.position.x, this.cameraObject.position.y, this.cameraObject.position.z); }, this.enable = function() { R = !0, this.domElement && this.domElement.addEventListener && (Te(this.domElement, 0), this.domElement.addEventListener("mousedown", Me, !1), this.domElement.addEventListener("mousemove", ye, !1), this.domElement.addEventListener("mouseup", we, !1), this.domElement.addEventListener("mouseleave", Pe, !1), this.domElement.addEventListener("touchstart", ut, !1), this.domElement.addEventListener("touchmove", mt, !1), this.domElement.addEventListener("touchend", Ge, !1), this.domElement.addEventListener("wheel", at, !1), this.domElement.addEventListener("mouseenter", bt, !1), this.domElement.addEventListener("contextmenu", (te) => { te.preventDefault(); }, !1), this.domElement.addEventListener("keydown", et, !1), this.domElement.addEventListener("keyup", yt, !1)); }, this.disable = function() { R = !1, this.domElement && this.domElement.removeEventListener && (this.domElement.removeEventListener("mousedown", Me, !1), this.domElement.removeEventListener("mousemove", ye, !1), this.domElement.removeEventListener("mouseup", we, !1), this.domElement.removeEventListener("mouseleave", Pe, !1), this.domElement.removeEventListener("touchstart", ut, !1), this.domElement.removeEventListener("touchmove", mt, !1), this.domElement.removeEventListener("touchend", Ge, !1), this.domElement.removeEventListener("wheel", at, !1), this.domElement.removeEventListener("mouseenter", bt, !1), this.domElement.removeEventListener("contextmenu", (te) => { te.preventDefault(); }, !1), this.domElement.removeEventListener("keydown", et, !1), this.domElement.removeEventListener("keyup", yt, !1), Te(this.domElement, -1)); }, this.loadPath = (te) => { P = te.CameraPath, N = te.NumberOfPoints; }, this.loadPathURL = (te, Se) => { var De = new XMLHttpRequest(); De.onreadystatechange = () => { if (De.readyState == 4 && De.status == 200) { var st = JSON.parse(De.responseText); this.loadPath(st), Se != null && typeof Se == "function" && Se(); } }; var We = h(te); De.open("GET", We, !0), De.send(); }, this.setPathDuration = (te) => { I = te, ne && ne.setDuration(I), X && X.setDuration(I); }, this.getPlayRate = () => k, this.setPlayRate = (te) => { k = te; }; var Ui = (te) => { var Se = b + te; Se > I && (Se -= I), b = Se; }; this.getTime = () => b, this.setTime = (te) => { b = te > I ? I : 0 > te ? 0 : te; }, this.getNumberOfTimeFrame = () => N, this.getCurrentTimeFrame = () => { if (2 < N) { var te = b / I * (N - 1), Se = Math.floor(te), De = 1 - (te - Se), We = Math.ceil(te); return Se == We ? Se == N - 1 ? [Se - 1, We, 0] : [Se, We + 1, 1] : [Se, We, De]; } return N == 1 ? [0, 0, 0] : void 0; }, this.setCurrentTimeFrame = (te) => { 2 < N && (b = I * te / (N - 1), 0 > b && (b = 0), b > I && (b = I)); }; var sr = (te) => { if (Y === _.PATH && (Ui(te), P)) { for (var Se = this.getCurrentTimeFrame(), De = Se[0], We = Se[1], st = Se[2], $ = [P[3 * De], P[3 * De + 1], P[3 * De + 2]], pe = [P[3 * We], P[3 * We + 1], P[3 * We + 2]], de = [], be = 0; be < $.length; be++) de.push(st * $[be] + (1 - st) * pe[be]); this.cameraObject.position.set(de[0], de[1], de[2]), this.cameraObject.target.set(pe[0], pe[1], pe[2]), V && this.cameraObject.lookAt(this.cameraObject.target), D && (this.directionalLight.position.set(de[0], de[1], de[2]), this.directionalLight.target.position.set(pe[0], pe[1], pe[2])); } }; this.calculatePathNow = () => { sr(0); }; var oo = () => { this._state === E.ROTATE || this._state === E.TOUCH_ROTATE || this._state === E.KEYBOARD_ROTATE ? kt() : this._state === E.PAN || this._state === E.TOUCH_PAN || this._state === E.KEYBOARD_PAN ? (dt(), ve.triggerCallback()) : (this._state === E.ZOOM || this._state === E.TOUCH_ZOOM || this._state === E.SCROLL || this._state === E.KEYBOARD_ZOOM) && (ve.zoom(Rt()), this.previous_pointer_x = this.pointer_x, this.previous_pointer_y = this.pointer_y, (this._state === E.SCROLL || this._state === E.KEYBOARD_ZOOM) && (this._state = E.NONE), H = 0, ve.triggerCallback()); }; this.update = (te) => { var Se = te * k, De = R, We = !0; return Y === _.PATH ? sr(Se) : Y === _.SMOOTH_CAMERA_TRANSITION && ne ? (ne.update(Se), ne.isTransitionCompleted() && (Y = _.DEFAULT), De = !1) : Y === _.ROTATE_CAMERA_TRANSITION && X ? (X.update(Se), X.isTransitionCompleted() && (Y = _.DEFAULT), De = !1) : Y === _.AUTO_TUMBLE && z ? z.update(Se) : Y === _.SYNC_CONTROL && ve ? (oo(), De = !1) : We = !1, De && (this._state !== E.NONE && (We = !0), this._state === E.ROTATE || this._state === E.TOUCH_ROTATE || this._state === E.KEYBOARD_ROTATE ? kt() : this._state === E.PAN || this._state === E.TOUCH_PAN || this._state === E.KEYBOARD_PAN ? dt() : (this._state === E.ZOOM || this._state === E.TOUCH_ZOOM || this._state === E.SCROLL || this._state === E.KEYBOARD_ZOOM) && Ii(), this._state !== E.NONE && Y === _.AUTO_TUMBLE && z && z.stopOnCameraInput, this._state === E.SCROLL && (this._state = E.NONE)), V ? (We = !0, V.update()) : this.cameraObject.lookAt(this.cameraObject.target), We = We || fe, fe = !1, We; }, this.playPath = () => { Y = _.PATH; }, this.stopPath = () => { Y = _.DEFAULT; }, this.isPlayingPath = () => Y === _.PATH, this.enableDirectionalLightUpdateWithPath = (te) => { D = te; }, this.enableDeviceOrientation = () => { V || (V = new M(this.cameraObject)); }, this.disableDeviceOrientation = () => { V && (V.dispose(), V = void 0); }, this.isDeviceOrientationEnabled = () => !!V, this.resetView = () => { var te = ae[q]; this.cameraObject.near = te.nearPlane, this.cameraObject.far = te.farPlane, this.cameraObject.position.set(te.eyePosition[0], te.eyePosition[1], te.eyePosition[2]), this.cameraObject.target.set(te.targetPosition[0], te.targetPosition[1], te.targetPosition[2]), this.cameraObject.up.set(te.upVector[0], te.upVector[1], te.upVector[2]), this.cameraObject.updateProjectionMatrix(), this.updateDirectionalLight(); }, this.setCurrentCameraSettings = (te) => { te.nearPlane && (this.cameraObject.near = te.nearPlane), te.farPlane && (this.cameraObject.far = te.farPlane), te.eyePosition && this.cameraObject.position.set(te.eyePosition[0], te.eyePosition[1], te.eyePosition[2]), te.targetPosition && this.cameraObject.target.set(te.targetPosition[0], te.targetPosition[1], te.targetPosition[2]), te.upVector && this.cameraObject.up.set(te.upVector[0], te.upVector[1], te.upVector[2]), this.cameraObject.updateProjectionMatrix(), this.updateDirectionalLight(), fe = !0; }, this.getViewportFromCentreAndRadius = (te, Se, De, We, st, $) => { var pe = this.cameraObject.position.x - this.cameraObject.target.x, de = this.cameraObject.position.y - this.cameraObject.target.y, be = this.cameraObject.position.z - this.cameraObject.target.z, Ce = 1 / Math.sqrt(pe * pe + de * de + be * be); pe *= Ce, de *= Ce, be *= Ce; var he = [te, Se, De], xe = We / Math.tan(st * Math.PI / 360), Ne = [te + pe * xe, Se + de * xe, De + be * xe], He = xe + $, Xe = 0, Qe = 0.95; Xe = $ > Qe * xe ? (1 - Qe) * xe : xe - $; var Ye = new u(); return Ye.nearPlane = Xe, Ye.farPlane = He, Ye.eyePosition = Ne, Ye.targetPosition = he, Ye.upVector = [this.cameraObject.up.x, this.cameraObject.up.y, this.cameraObject.up.z], Ye; }, this.getViewportFromBoundingBox = (te, Se) => { var De = te.min.distanceTo(te.max) / 2 * Se, We = (te.min.x + te.max.x) / 2, st = (te.min.y + te.max.y) / 2, $ = (te.min.z + te.max.z) / 2, pe = 4, de = this.getViewportFromCentreAndRadius(We, st, $, De, 40, De * pe); return de; }, this.getCurrentViewport = () => { var te = new u(); return te.nearPlane = this.cameraObject.near, te.farPlane = this.cameraObject.far, te.eyePosition[0] = this.cameraObject.position.x, te.eyePosition[1] = this.cameraObject.position.y, te.eyePosition[2] = this.cameraObject.position.z, te.targetPosition[0] = this.cameraObject.target.x, te.targetPosition[1] = this.cameraObject.target.y, te.targetPosition[2] = this.cameraObject.target.z, te.upVector[0] = this.cameraObject.up.x, te.upVector[1] = this.cameraObject.up.y, te.upVector[2] = this.cameraObject.up.z, te; }, this.getDefaultEyePosition = () => eyePosition, this.getDefaultTargetPosition = () => targetPosition, this.cameraTransition = (te, Se, De) => { X == null && (ne = new g(te, Se, this, De)); }, this.rotateCameraTransition = (te, Se, De) => { ne == null && (X = new m(te, Se, this, De)); }, this.enableCameraTransition = () => { ne && (Y = _.SMOOTH_CAMERA_TRANSITION), X && (Y = _.ROTATE_CAMERA_TRANSITION); }, this.pauseCameraTransition = () => { Y = _.DEFAULT; }, this.stopCameraTransition = () => { Y = _.DEFAULT, ne = void 0, X = void 0; }, this.isTransitioningCamera = () => Y === _.SMOOTH_CAMERA_TRANSITION || Y === _.ROTATE_CAMERA_TRANSITION, this.autoTumble = (te, Se, De) => { z = new y(te, Se, De, this); }, this.enableAutoTumble = () => { Y = _.AUTO_TUMBLE; }, this.stopAutoTumble = () => { Y = _.DEFAULT, z = void 0; }, this.updateAutoTumble = () => { z && (z.requireUpdate = !0); }, this.isAutoTumble = () => Y === _.AUTO_TUMBLE, this.enableRaycaster = (te, Se, De) => { Q == null && (Q = new d(te, this.scene, Se, De, this.renderer)); }, this.disableRaycaster = () => { Q.disable(), Q = void 0; }, this.isSyncControl = () => currentMpde === _.SYNC_CONTROL, this.enableSyncControl = () => (Y = _.SYNC_CONTROL, ve || (ve = new S()), ve.setCurrentCameraSettings(this.cameraObject, ae[q]), ve), this.disableSyncControl = () => { Y = _.DEFAULT, this.cameraObject.zoom = 1, this.cameraObject.updateProjectionMatrix(); }, this.enable(); }, g = function(T, x, w, A) { var _ = T.eyePosition, E = T.targetPosition, O = T.upVector, L = x.eyePosition, C = x.targetPosition, I = x.upVector, R = w, b = A, P = 0, N = !1; R.near = Math.min(T.nearPlane, x.nearPlane), R.far = Math.max(T.farPlane, x.farPlane), R.cameraObject.up.set(x.upVector[0], x.upVector[1], x.upVector[2]), this.setDuration = (V) => { b = V; }; var D = (V) => { var q = P + V; q > b && (q = b), P = q; }, k = () => { var V = P / b, q = [_[0] * (1 - V) + L[0] * V, _[1] * (1 - V) + L[1] * V, _[2] * (1 - V) + L[2] * V], Y = [E[0] * (1 - V) + C[0] * V, E[1] * (1 - V) + C[1] * V, E[2] * (1 - V) + C[2] * V]; O[0] * (1 - V) + I[0] * V, O[1] * (1 - V) + I[1] * V, O[2] * (1 - V) + I[2] * V, R.cameraObject.position.set(q[0], q[1], q[2]), R.cameraObject.target.set(Y[0], Y[1], Y[2]); }; this.update = (V) => { this.enabled === !1 || (D(V), k(), P == b && (N = !0)); }, this.isTransitionCompleted = () => N; }, m = function(T, x, w, A) { var _ = T, E = x, O = w, L = A, C = 0, I = !1; this.setDuration = (b) => { L = b; }; var R = (b) => { var P = C, N = C + b; N > L && (N = L), C = N; var D = C - P, k = D / L, V = k * E; O.rotateAboutLookAtpoint(_, V); }; this.update = (b) => { this.enabled === !1 || (R(b), C == L && (I = !0)); }, this.isTransitionCompleted = () => I; }, d = function(T, x, w, A, _) { var E = T, O = x, L = _, C = w, I = A, R = new l.Raycaster(); R.params.Line.threshold = 0.1, R.params.Points.threshold = 1; var b = new l.Vector2(), P = !1, N = /* @__PURE__ */ new Date(), D = !1, k = 0, V = [], q = { zincCamera: void 0, x: -1, y: -1 }, Y = void 0; this.enable = () => { enable = !0; }, this.disable = () => { enable = !1; }, this.getIntersectsObject = (z) => { if (O !== E) { var H = E.getThreeJSScene(); L.render(H, z.cameraObject); } var ee = Y || E.getPickableThreeJSObjects(); return V.length = 0, R.intersectObjects(ee, !0, V); }, this.setPickableObjects = (z) => { z === void 0 ? Y = void 0 : (Y = [], z.forEach((H) => { H.getGroup() && H.getGroup().visible && Y.push(H.getGroup()); })); }, this.getIntersectsObjectWithOrigin = (z, H, ee) => (R.set(H, ee), this.getIntersectsObject(z)), this.getIntersectsObjectWithCamera = (z, H, ee) => (z.getNDCFromDocumentCoords(H, ee, b), R.setFromCamera(b, z.cameraObject), this.getIntersectsObject(z)), this.pick = (z, H, ee) => { if (L && E && z && C) { this.getIntersectsObjectWithCamera(z, H, ee); for (var Q, J = V.length, W = 0; W < J; W++) if (Q = V[W].object ? V[W].object.userData : void 0, Q && Q.isMarkerCluster && Q.visible && Q.clusterIsVisible(V[W].object.clusterIndex) && Q.zoomToCluster(V[W].object.clusterIndex)) return; C(V, H, ee); } }; var ne = (z, H, ee) => { if (L && E && z && I) { if (this.getIntersectsObjectWithCamera(z, H, ee), N.setTime(Date.now()), V.length === 0) { if (D) return; D = !0; } else D = !1; I(V, H, ee); } }; this.move = (z, H, ee) => { L && E && z && I && (E.displayMarkers ? ne(z, H, ee) : (q.zincCamera = z, q.x = H, q.y = ee, !P && (k = N ? Date.now() - N.getTime() : 250, 250 <= k ? ne(z, H, ee) : (P = !0, setTimeout(X(q), k))))); }; var X = (z) => function() { P = !1, ne(z.zincCamera, z.x, z.y); }; }, y = function(T, x, w, A) { var _ = new l.Vector3(), E = -x, O = A, L = T; this.stopOnCameraInput = w, this.requireUpdate = !0; var C = new l.Vector3(), I = new l.Vector3(), R = (b) => { var P = Math.sqrt(b[0] * b[0] + b[1] * b[1]), N = 4 * Math.abs(b[0]), D = 4 * Math.abs(b[1]), k = 0.25 * (N + D), V = -b[1] / P, q = b[0] / P, Y = V * b[0] + q * -b[1]; Y > k ? Y = k : Y < -k && (Y = -k); var ne = Math.acos(Y / k) - 0.5 * Math.PI; _.copy(O.cameraObject.position).sub(O.cameraObject.target).normalize(), C.copy(O.cameraObject.up).normalize(), I.crossVectors(C, _).normalize().multiplyScalar(V), C.multiplyScalar(q), C.add(I).multiplyScalar(Math.cos(ne)), _.multiplyScalar(Math.sin(ne)).add(C); }; this.update = (b) => { this.enabled === !1 || (this.requireUpdate && (R(L), this.requireUpdate = !1), O.rotateAboutLookAtpoint(_, E * b / 1e3)); }; }, f = function() { this.type = "StereoCamera", this.aspect = 1, this.cameraL = new l.PerspectiveCamera(), this.cameraL.layers.enable(1), this.cameraL.matrixAutoUpdate = !1, this.cameraR = new l.PerspectiveCamera(), this.cameraR.layers.enable(2), this.cameraR.matrixAutoUpdate = !1; }; Object.assign(f.prototype, { update: (() => { var T, x, w, A, _, E, O = new l.Matrix4(), L = new l.Matrix4(); return function(C) { var I = T !== C.focus || x !== C.fov || w !== C.aspect * this.aspect || A !== C.near || _ !== C.far || E !== C.zoom; if (I) { T = C.focus, x = C.fov, w = C.aspect * this.aspect, A = C.near, _ = C.far, E = C.zoom; var R, b, P = C.projectionMatrix.clone(), N = 0.064 / 2, D = N * A / T, k = A * Math.tan(0.5 * (l.Math.DEG2RAD * x)) / C.zoom; L.elements[12] = -N, O.elements[12] = N, R = -k * w + D, b = k * w + D, P.elements[0] = 2 * A / (b - R), P.elements[8] = (b + R) / (b - R), this.cameraL.projectionMatrix.copy(P), R = -k * w - D, b = k * w - D, P.elements[0] = 2 * A / (b - R), P.elements[8] = (b + R) / (b - R), this.cameraR.projectionMatrix.copy(P); } this.cameraL.matrixWorld.copy(C.matrixWorld).multiply(L), this.cameraR.matrixWorld.copy(C.matrixWorld).multiply(O); }; })() }); var v = function(T) { var x = new f(); x.aspect = 0.5, this.setSize = (w, A) => { T.setSize(w, A); }, this.render = (w, A) => { w.updateMatrixWorld(), A.parent === null && A.updateMatrixWorld(), x.update(A); var _ = T.getSize(); T.setScissorTest(!0), T.clear(), T.setScissor(0, 0, _.width / 2, _.height), T.setViewport(0, 0, _.width / 2, _.height), T.render(w, x.cameraL), T.setScissor(_.width / 2, 0, _.width / 2, _.height), T.setViewport(_.width / 2, 0, _.width / 2, _.height), T.render(w, x.cameraR), T.setScissorTest(!1); }; }, M = function(T) { var x = this; this.object = T, this.object.rotation.reorder("YXZ"), this.enabled = !0, this.deviceOrientation = {}, this.screenOrientation = 0; var w = (E) => { x.deviceOrientation = E; }, A = () => { typeof window < "u" && (x.screenOrientation = window.orientation || 0); }, _ = (() => { var E = new l.Vector3(0, 0, 1), O = new l.Euler(), L = new l.Quaternion(), C = new l.Quaternion(-Math.sqrt(0.5), 0, 0, Math.sqrt(0.5)); return (I, R, b, P, N) => { var D = new l.Vector3(0, 0, 1); D.subVectors(I.target, I.position), O.set(b, R, -P, "YXZ"); var k = new l.Quaternion(); k.setFromEuler(O), k.multiply(C), k.multiply(L.setFromAxisAngle(E, -N)), D.applyQuaternion(k), D.addVectors(I.position, D), I.lookAt(D); }; })(); this.connect = () => { A(), typeof window < "u" && (window.addEventListener("orientationchange", A, !1), window.addEventListener("deviceorientation", w, !1)), x.enabled = !0; }, this.disconnect = () => { typeof window < "u" && (window.removeEventListener("orientationchange", A, !1), window.removeEventListener("deviceorientation", w, !1)), x.enabled = !1; }, this.update = () => { if (x.enabled !== !1) { var E = x.deviceOrientation.alpha ? l.Math.degToRad(x.deviceOrientation.alpha) : 0, O = x.deviceOrientation.beta ? l.Math.degToRad(x.deviceOrientation.beta) : 0, L = x.deviceOrientation.gamma ? l.Math.degToRad(x.deviceOrientation.gamma) : 0, C = x.screenOrientation ? l.Math.degToRad(x.screenOrientation) : 0; _(x.object, E, O, L, C); } }, this.dispose = function() { this.disconnect(); }, this.connect(); }, S = function() { var T = void 0, x = void 0, w = void 0, A = new l.Vector3(), _ = new l.Vector3(), E = new l.Vector3(), O = new l.Vector3(), L = void 0; this.setCurrentCameraSettings = (C, I) => { T = C.clone(), x = C, w = I, T.near = w.nearPlane, w.farPlane && (T.far = w.farPlane), w.eyePosition && T.position.set(w.eyePosition[0], w.eyePosition[1], w.eyePosition[2]), w.upVector && T.up.set(w.upVector[0], w.upVector[1], w.upVector[2]), w.targetPosition && (T.target = new l.Vector3(w.targetPosition[0], w.targetPosition[1], w.targetPosition[2]), T.lookAt(T.target)), T.updateProjectionMatrix(), A.copy(T.position).project(T), _.copy(T.target).project(T); }, this.getCurrentPosition = () => (_.copy(x.target).project(T), [_.x, _.y]), this.zoom = (C) => { var I = 2e-3 * C, R = Math.max(x.zoom - I, 1); x.zoom = R, x.updateProjectionMatrix(); }, this.zoomToBox = (C, I) => { C.getCenter(E), E.project(T), this.setCenterZoom([E.x, E.y], I); }, this.getPanZoom = () => ({ target: this.getCurrentPosition(), zoom: x.zoom }), this.setCenterZoom = (C, I) => { E.set(C[0], C[1], _.z).unproject(T), O.copy(E).sub(x.target), x.target.copy(E), x.lookAt(x.target), x.position.add(O), x.zoom = I, x.updateProjectionMatrix(); }, this.setEventCallback = (C) => { (C === void 0 || typeof C == "function") && (L = C); }, this.triggerCallback = () => { L !== void 0 && typeof L == "function" && L(); }; }; s.Viewport = u, s.CameraControls = p, s.SmoothCameraTransition = g, s.RotateCameraTransition = m, s.RayCaster = d, s.CameraAutoTumble = y, s.StereoEffect = v, s.NDCCameraControl = S; }, /* 44 */ /***/ (a, s, c) => { var { Group: l, Matrix4: h } = c(4), u = c(22).Pointset; c(24).Lines; var p = c(45).Lines2, g = c(3).Geometry, m = c(4), d = 0, y = function() { return "re" + d++; }, f = function(v, M) { var S = v, T = new l(); T.matrixAutoUpdate = !1, T.userData = this; var x = [], w = "", A = [], _ = M, E = new h(), O = 3e3; E.set(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1), this.pickableUpdateRequired = !0, this.isRegion = !0, this.uuid = y(), this.hideAllPrimitives = () => { x.forEach((L) => L.hideAllPrimitives()), A.forEach((L) => L.setVisibility(!1)); }, this.showAllPrimitives = () => { x.forEach((L) => L.showAllPrimitives()), A.forEach((L) => L.setVisibility(!0)); }, this.setVisibility = (L) => { L != T.visible && (T.visible = L, this.pickableUpdateRequired = !0); }, this.getVisibility = () => T.visible, this.getGroup = () => T, this.setTransformation = (L) => { E.set(...L), T.matrix.copy(E), T.updateMatrixWorld(); }, this.setName = (L) => { L && L !== "" && (w = L); }, this.getName = () => w, this.getParent = () => S, this.getFullSeparatedPath = () => { var L = []; if (w !== "") { L.push(w); for (var C, I = S; I !== void 0; ) C = I.getName(), C !== "" && L.unshift(C), I = I.getParent(); } return L; }, this.getFullPath = () => { var L = this.getFullSeparatedPath(); if (0 < L.length) { var C = L.shift(); return L.forEach((I) => { C = C.concat("/", I); }), C; } return ""; }, this.createChild = (L) => { var C = new f(this, _); return C.setName(L), x.push(C), T.add(C.getGroup()), C; }, this.getChildWithName = (L) => { if (L) { for (var C = L.toLowerCase(), I = 0; I < x.length; I++) if (x[I].getName().toLowerCase() === C) return x[I]; } }, this.findChildFromSeparatedPath = (L) => { if (L && 0 < L.length && L[0] === "" && L.shift(), L && 0 < L.length) { var C = this.getChildWithName(L[0]); return C ? (L.shift(), C.findChildFromSeparatedPath(L)) : void 0; } return this; }, this.findChildFromPath = (L) => { var C = L.split("/"); return this.findChildFromSeparatedPath(C); }, this.createChildFromSeparatedPath = (L) => { if (0 < L.length && L[0] === "" && L.shift(), 0 < L.length) { var C = this.getChildWithName(L[0]); return C || (C = this.createChild(L[0])), L.shift(), C.createChildFromSeparatedPath(L); } return this; }, this.createChildFromPath = (L) => { var C = L.split("/"); return this.createChildFromSeparatedPath(C); }, this.findOrCreateChildFromPath = (L) => { var C = this.findChildFromPath(L); return C || (C = this.createChildFromPath(L)), C; }, this.addZincObject = (L) => { L && (L.setRegion(this), T.add(L.getGroup()), A.push(L), this.pickableUpdateRequired = !0, _ && _.triggerObjectAddedCallback(L)); }, this.removeZincObject = (L) => { for (var C = 0; C < A.length; C++) if (L === A[C]) return T.remove(L.getGroup()), A.splice(C, 1), _ && _.triggerObjectRemovedCallback(L), L.dispose(), void (this.pickableUpdateRequired = !0); }, this.checkPickableUpdateRequred = (L) => { if (this.pickableUpdateRequired) return !0; if (L) { for (var C = !1, I = 0; I < x.length; I++) if (C = x[I].checkPickableUpdateRequred(L), C) return !0; } return !1; }, this.getPickableThreeJSObjects = (L, C) => (T.visible && (A.forEach((I) => { if (I.getGroup() && I.getGroup().visible) { var R = I.marker; R && R.isEnabled() && L.push(R.getMorph()), L.push(I.getGroup()); } }), C && x.forEach((I) => { I.getPickableThreeJSObjects(L, C); }), this.pickableUpdateRequired = !1), L), this.setDuration = (L) => { O = L, A.forEach((C) => C.setDuration(L)), x.forEach((C) => C.setDuration(L)); }, this.getDuration = () => O, this.getBoundingBox = (L) => { var C, I; return A.forEach((R) => { I = R.getBoundingBox(), I && (C == null ? C = I.clone() : C.union(I)); }), L && x.forEach((R) => { I = R.getBoundingBox(L), I && (C == null ? C = I.clone() : C.union(I)); }), C; }, this.clear = (L) => { L && x.forEach((C) => C.clear(L)), A.forEach((C) => { T.remove(C.getGroup()), C.dispose(); }), x = [], A = []; }, this.objectIsInRegion = (L, C) => { for (var I = 0; I < A.length; I++) if (L === A[I]) return !0; if (C) { for (var R = 0; R < x.length; R++) if (x[R].objectIsInRegion(L, C)) return !0; } return !1; }, this.forEachGeometry = (L, C) => { A.forEach((I) => { I.isGeometry && L(I); }), C && x.forEach((I) => I.forEachGeometry(L, C)); }, this.forEachGlyphset = (L, C) => { A.forEach((I) => { I.isGlyphset && L(I); }), C && x.forEach((I) => I.forEachGlyphset(L, C)); }, this.forEachPointset = (L, C) => { A.forEach((I) => { I.isPointset && L(I); }), C && x.forEach((I) => I.forEachPointset(L, C)); }, this.forEachLine = (L, C) => { A.forEach((I) => { I.isLines && L(I); }), C && x.forEach((I) => I.forEachLine(L, C)); }, this.findObjectsWithAnatomicalId = (L, C) => (A.forEach((I) => { I.anatomicalId === L && objectsArray.push(I); }), C && x.forEach((I) => { var R = I.findObjectsWithAnatomicalId(L, C); objectsArray.push(...R); }), objectsArray), this.findObjectsWithGroupName = (L, C) => { var I = []; return A.forEach((R) => { var b = R.groupName ? R.groupName.toLowerCase() : R.groupName, P = L && L.toLowerCase(); b === P && I.push(R); }), C && x.forEach((R) => { var b = R.findObjectsWithGroupName(L, C); I.push(...b); }), I; }, this.findGeometriesWithGroupName = (L, C) => { var I = this.findObjectsWithGroupName(L, C), R = I.filter((b) => b.isGeometry); return R; }, this.findPointsetsWithGroupName = (L, C) => { var I = this.findObjectsWithGroupName(L, C), R = I.filter((b) => b.isPointset); return R; }, this.findGlyphsetsWithGroupName = (L, C) => { var I = this.findObjectsWithGroupName(L, C), R = I.filter((b) => b.isGlyphset); return R; }, this.findLinesWithGroupName = (L, C) => { var I = this.findObjectsWithGroupName(L, C), R = I.filter((b) => b.isLines); return R; }, this.getAllObjects = (L) => { var C = [...A]; return L && x.forEach((I) => { var R = I.getAllObjects(L); C.push(...R); }), C; }, this.getChildRegions = (L) => { var C = [...x]; return L && x.forEach((I) => { var R = I.getChildRegions(L); C.push(...R); }), C; }, this.getCurrentTime = () => { if (A[0] != null) return A[0].getCurrentTime(); for (var L, C = 0; C < x.length; C++) if (L = x[C].getCurrentTime(), L !== -1) return L; return -1; }, this.setMorphTime = (L, C) => { A.forEach((I) => { I.setMorphTime(L); }), C && x.forEach((I) => { I.setMorphTime(L); }); }, this.isTimeVarying = () => { for (var L = 0; L < A.length; L++) if (A[L].isTimeVarying()) return !0; for (var C = 0; C < x.length; C++) if (x[C].isTimeVarying()) return !0; return !1; }, this.renderGeometries = (L, C, I, R, b, P) => { var N, D = this.getAllObjects(P); D.forEach((k) => { k.render(L * C, I, R, b); }), b && I === !1 && (N = b.markerCluster) !== null && N !== void 0 && N.markerUpdateRequired && b.markerCluster.calculate(); }, this.createPoints = (L, C, I, R) => { var b = !1, P = this.findObjectsWithGroupName(L, !1), N = P.findIndex((k) => k.isPointset), D = -1 < N ? P[N] : new u(); return D.addPoints(C, I, R), N === -1 ? (D.setName(L), this.addZincObject(D), b = !0) : this.pickableUpdateRequired = !0, { zincObject: D, isNew: b }; }, this.createLines = (L, C, I) => { var R = !1, b = this.findObjectsWithGroupName(L, !1), P = b.findIndex((D) => D.isLines), N = -1 < P ? b[P] : new p(); return N.addLines(C, I), P === -1 ? (N.setName(L), this.addZincObject(N), R = !0) : this.pickableUpdateRequired = !0, { zincObject: N, isNew: R }; }, this.createGeometryFromThreeJSGeometry = (L, C, I, R, b, P) => { var N = new g(), D = new m.MeshPhongMaterial({ color: I, morphTargets: !1, morphNormals: !1, transparent: !0, opacity: R, side: m.DoubleSide }); return N.createMesh(C, D, { localTimeEnabled: !1, localMorphColour: !1 }), N.getMorph() ? (N.setVisibility(!1), N.setName(L), N.setRenderOrder(P), this.addZincObject(N), N) : void 0; }; }; s.Region = f; }, /* 45 */ /***/ (a, s, c) => { c(4), c(5).toBufferGeometry; var l = c(46).LineSegments2, h = c(48).LineMaterial, u = c(47).LineSegmentsGeometry, p = function() { c(24).Lines.call(this), this.isLines2 = !0; var g = Array(300); this.createLineSegment = (m, d, y) => { if (m && d) { var f = new u(); f.setPositions(m), f.colorsNeedUpdate = !0; var v = new l(f, d); v.scale.set(1, 1, 1), v.computeLineDistances(), this.setMesh(v, y.localTimeEnabled, y.localMorphColour); } }, this.setWidth = (m) => { this.morph && this.morph.material && (this.morph.material.linewidth = m, this.morph.material.needsUpdate = !0); }, this.addVertices = function(m) { if (m && m.length) { var d = this.getMorph(); d || (this.drawRange = 0); var y = 3 * this.drawRange; if (m.forEach((f) => { g[y++] = f[0], g[y++] = f[1], g[y++] = f[2], this.drawRange++; }), !d) for (; 300 > y; ) g[y++] = m[0][0], g[y++] = m[0][1], g[y++] = m[0][2]; d && (d.geometry.setPositions(g), d.computeLineDistances(), this.boundingBoxUpdateRequired = !0); } return g; }, this.getVerticesByFaceIndex = function(m) { var d = 3 * (2 * m), y = this.getMorph(); if (y && 3 * this.drawRange > d) { var f = y.geometry.getAttribute("instanceStart"); return [[f.data.array[d], f.data.array[++d], f.data.array[++d]], [f.data.array[++d], f.data.array[++d], f.data.array[++d]]]; } return []; }, this.editVertices = function(m, d) { if (m && m.length) { var y = this.getMorph(), f = d + m.length - 1; if (!y || 0 > d || f >= this.drawRange) return; var v = 3 * d; for (m.forEach((M) => { g[v++] = M[0], g[v++] = M[1], g[v++] = M[2]; }), v = 3 * this.drawRange; 300 > v; ) g[v++] = m[0][0], g[v++] = m[0][1], g[v++] = m[0][2]; y.geometry.setPositions(g), y.computeLineDistances(), this.boundingBoxUpdateRequired = !0; } return g; }, this.addLines = (m, d) => { if (m && 0 < m.length) { this.addVertices(m); var y = this.getMorph(); if (!y) { var f = new h({ color: d, linewidth: 1, vertexColors: !1, worldUnits: !1 }); f.resolution.set(window.innerWidth, window.innerHeight), this.createLineSegment(g, f, { localTimeEnabled: !1, localMorphColour: !1 }); } this.region && (this.region.pickableUpdateRequired = !0); } }, this.render = () => { var m = this.getMorph().material; m.resolution.set(window.innerWidth, window.innerHeight); }; }; p.prototype = Object.create(c(24).Lines.prototype), p.prototype.constructor = p, s.Lines2 = p; }, /* 46 */ /***/ (a, s, c) => { c.r(s), c.d(s, { /* harmony export */ LineSegments2: () => ( /* binding */ A ) /* harmony export */ }); var l = c(4), h = c(47), u = c(48), p = new l.Vector3(), g = new l.Vector3(), m = new l.Vector4(), d = new l.Vector4(), y = new l.Vector4(), f = new l.Vector3(), v = new l.Matrix4(), M = new l.Line3(), S = new l.Vector3(), T = new l.Box3(), x = new l.Sphere(), w = new l.Vector4(); class A extends l.Mesh { constructor() { var E = 0 < arguments.length && arguments[0] !== void 0 ? arguments[0] : new h.LineSegmentsGeometry(), O = 1 < arguments.length && arguments[1] !== void 0 ? arguments[1] : new u.LineMaterial({ color: 16777215 * Math.random() }); super(E, O), this.type = "LineSegments2"; } // for backwards-compatability, but could be a method of LineSegmentsGeometry... computeLineDistances() { for (var E = this.geometry, O = E.attributes.instanceStart, L = E.attributes.instanceEnd, C = new Float32Array(2 * O.count), I = 0, R = 0, b = O.count; I < b; I++, R += 2) p.fromBufferAttribute(O, I), g.fromBufferAttribute(L, I), C[R] = R == 0 ? 0 : C[R - 1], C[R + 1] = C[R] + p.distanceTo(g); var P = new l.InstancedInterleavedBuffer(C, 2, 1); return E.setAttribute("instanceDistanceStart", new l.InterleavedBufferAttribute(P, 1, 0)), E.setAttribute("instanceDistanceEnd", new l.InterleavedBufferAttribute(P, 1, 1)), this; } raycast(E, O) { E.camera === null && console.error('LineSegments2: "Raycaster.camera" needs to be set in order to raycast against LineSegments2.'); var L = E.params.Line2 === void 0 ? 0 : E.params.Line2.threshold || 0, C = E.ray, I = E.camera, R = I.projectionMatrix, b = this.matrixWorld, P = this.geometry, N = this.material, D = N.resolution, k = N.linewidth + L, V = P.attributes.instanceStart, q = P.attributes.instanceEnd, Y = -I.near, ne = 2 * Math.max(k / D.width, k / D.height); P.boundingSphere === null && P.computeBoundingSphere(), x.copy(P.boundingSphere).applyMatrix4(b); var X = Math.max(I.near, x.distanceToPoint(C.origin)); w.set(0, 0, -X, 1).applyMatrix4(I.projectionMatrix), w.multiplyScalar(1 / w.w), w.applyMatrix4(I.projectionMatrixInverse); var z = 0.5 * Math.abs(ne / w.w); if (x.radius += z, E.ray.intersectsSphere(x) !== !1) { P.boundingBox === null && P.computeBoundingBox(), T.copy(P.boundingBox).applyMatrix4(b); var H = Math.max(I.near, T.distanceToPoint(C.origin)); w.set(0, 0, -H, 1).applyMatrix4(I.projectionMatrix), w.multiplyScalar(1 / w.w), w.applyMatrix4(I.projectionMatrixInverse); var ee = 0.5 * Math.abs(ne / w.w); if (T.max.x += ee, T.max.y += ee, T.max.z += ee, T.min.x -= ee, T.min.y -= ee, T.min.z -= ee, E.ray.intersectsBox(T) !== !1) { C.at(1, y), y.w = 1, y.applyMatrix4(I.matrixWorldInverse), y.applyMatrix4(R), y.multiplyScalar(1 / y.w), y.x *= D.x / 2, y.y *= D.y / 2, y.z = 0, f.copy(y), v.multiplyMatrices(I.matrixWorldInverse, b); for (var Q = 0, J = V.count; Q < J; Q++) { m.fromBufferAttribute(V, Q), d.fromBufferAttribute(q, Q), m.w = 1, d.w = 1, m.applyMatrix4(v), d.applyMatrix4(v); var W = m.z > Y && d.z > Y; if (!W) { if (m.z > Y) { var K = m.z - d.z, ie = (m.z - Y) / K; m.lerp(d, ie); } else if (d.z > Y) { var B = d.z - m.z, j = (d.z - Y) / B; d.lerp(m, j); } m.applyMatrix4(R), d.applyMatrix4(R), m.multiplyScalar(1 / m.w), d.multiplyScalar(1 / d.w), m.x *= D.x / 2, m.y *= D.y / 2, d.x *= D.x / 2, d.y *= D.y / 2, M.start.copy(m), M.start.z = 0, M.end.copy(d), M.end.z = 0; var re = M.closestPointToPointParameter(f, !0); M.at(re, S); var F = l.MathUtils.lerp(m.z, d.z, re), U = -1 <= F && 1 >= F, se = f.distanceTo(S) < 0.5 * k; if (U && se) { M.start.fromBufferAttribute(V, Q), M.end.fromBufferAttribute(q, Q), M.start.applyMatrix4(b), M.end.applyMatrix4(b); var ue = new l.Vector3(), fe = new l.Vector3(); C.distanceSqToSegment(M.start, M.end, fe, ue), O.push({ point: fe, pointOnLine: ue, distance: C.origin.distanceTo(fe), object: this, face: null, faceIndex: Q, uv: null, uv2: null }); } } } } } } } A.prototype.LineSegments2 = !0; }, /* 47 */ /***/ (a, s, c) => { c.r(s), c.d(s, { /* harmony export */ LineSegmentsGeometry: () => ( /* binding */ p ) /* harmony export */ }); var l = c(4), h = new l.Box3(), u = new l.Vector3(); class p extends l.InstancedBufferGeometry { constructor() { super(), this.type = "LineSegmentsGeometry", this.setIndex([0, 2, 1, 2, 3, 1, 2, 4, 3, 4, 5, 3, 4, 6, 5, 6, 7, 5]), this.setAttribute("position", new l.Float32BufferAttribute([-1, 2, 0, 1, 2, 0, -1, 1, 0, 1, 1, 0, -1, 0, 0, 1, 0, 0, -1, -1, 0, 1, -1, 0], 3)), this.setAttribute("uv", new l.Float32BufferAttribute([-1, 2, 1, 2, -1, 1, 1, 1, -1, -1, 1, -1, -1, -2, 1, -2], 2)); } applyMatrix4(m) { var d = this.attributes.instanceStart, y = this.attributes.instanceEnd; return d !== void 0 && (d.applyMatrix4(m), y.applyMatrix4(m), d.needsUpdate = !0), this.boundingBox !== null && this.computeBoundingBox(), this.boundingSphere !== null && this.computeBoundingSphere(), this; } setPositions(m) { var d; m instanceof Float32Array ? d = m : Array.isArray(m) && (d = new Float32Array(m)); var y = new l.InstancedInterleavedBuffer(d, 6, 1); return this.setAttribute("instanceStart", new l.InterleavedBufferAttribute(y, 3, 0)), this.setAttribute("instanceEnd", new l.InterleavedBufferAttribute(y, 3, 3)), this.computeBoundingBox(), this.computeBoundingSphere(), this; } setColors(m) { var d; m instanceof Float32Array ? d = m : Array.isArray(m) && (d = new Float32Array(m)); var y = new l.InstancedInterleavedBuffer(d, 6, 1); return this.setAttribute("instanceColorStart", new l.InterleavedBufferAttribute(y, 3, 0)), this.setAttribute("instanceColorEnd", new l.InterleavedBufferAttribute(y, 3, 3)), this; } fromWireframeGeometry(m) { return this.setPositions(m.attributes.position.array), this; } fromEdgesGeometry(m) { return this.setPositions(m.attributes.position.array), this; } fromMesh(m) { return this.fromWireframeGeometry(new l.WireframeGeometry(m.geometry)), this; } fromLineSegments(m) { var d = m.geometry; return d.isGeometry ? void console.error("THREE.LineSegmentsGeometry no longer supports Geometry. Use THREE.BufferGeometry instead.") : (d.isBufferGeometry && this.setPositions(d.attributes.position.array), this); } computeBoundingBox() { this.boundingBox === null && (this.boundingBox = new l.Box3()); var m = this.attributes.instanceStart, d = this.attributes.instanceEnd; m !== void 0 && d !== void 0 && (this.boundingBox.setFromBufferAttribute(m), h.setFromBufferAttribute(d), this.boundingBox.union(h)); } computeBoundingSphere() { this.boundingSphere === null && (this.boundingSphere = new l.Sphere()), this.boundingBox === null && this.computeBoundingBox(); var m = this.attributes.instanceStart, d = this.attributes.instanceEnd; if (m !== void 0 && d !== void 0) { var y = this.boundingSphere.center; this.boundingBox.getCenter(y); for (var f = 0, v = 0, M = m.count; v < M; v++) u.fromBufferAttribute(m, v), f = Math.max(f, y.distanceToSquared(u)), u.fromBufferAttribute(d, v), f = Math.max(f, y.distanceToSquared(u)); this.boundingSphere.radius = Math.sqrt(f), isNaN(this.boundingSphere.radius) && console.error("THREE.LineSegmentsGeometry.computeBoundingSphere(): Computed radius is NaN. The instanced position data is likely to have NaN values.", this); } } toJSON() { } applyMatrix(m) { return console.warn("THREE.LineSegmentsGeometry: applyMatrix() has been renamed to applyMatrix4()."), this.applyMatrix4(m); } } p.prototype.isLineSegmentsGeometry = !0; }, /* 48 */ /***/ (a, s, c) => { c.r(s), c.d(s, { /* harmony export */ LineMaterial: () => ( /* binding */ h ) /* harmony export */ }); var l = c(4); l.UniformsLib.line = { linewidth: { value: 1 }, resolution: { value: new l.Vector2(1, 1) }, dashScale: { value: 1 }, dashSize: { value: 1 }, dashOffset: { value: 0 }, gapSize: { value: 1 }, // todo FIX - maybe change to totalSize opacity: { value: 1 } }, l.ShaderLib.line = { uniforms: l.UniformsUtils.merge([l.UniformsLib.common, l.UniformsLib.fog, l.UniformsLib.line]), vertexShader: ( /* glsl */ ` #include #include #include #include #include uniform float linewidth; uniform vec2 resolution; attribute vec3 instanceStart; attribute vec3 instanceEnd; attribute vec3 instanceColorStart; attribute vec3 instanceColorEnd; varying vec2 vUv; #ifdef USE_DASH uniform float dashScale; attribute float instanceDistanceStart; attribute float instanceDistanceEnd; varying float vLineDistance; #endif void trimSegment( const in vec4 start, inout vec4 end ) { // trim end segment so it terminates between the camera plane and the near plane // conservative estimate of the near plane float a = projectionMatrix[ 2 ][ 2 ]; // 3nd entry in 3th column float b = projectionMatrix[ 3 ][ 2 ]; // 3nd entry in 4th column float nearEstimate = - 0.5 * b / a; float alpha = ( nearEstimate - start.z ) / ( end.z - start.z ); end.xyz = mix( start.xyz, end.xyz, alpha ); } void main() { #ifdef USE_COLOR vColor.xyz = ( position.y < 0.5 ) ? instanceColorStart : instanceColorEnd; #endif #ifdef USE_DASH vLineDistance = ( position.y < 0.5 ) ? dashScale * instanceDistanceStart : dashScale * instanceDistanceEnd; #endif float aspect = resolution.x / resolution.y; vUv = uv; // camera space vec4 start = modelViewMatrix * vec4( instanceStart, 1.0 ); vec4 end = modelViewMatrix * vec4( instanceEnd, 1.0 ); // special case for perspective projection, and segments that terminate either in, or behind, the camera plane // clearly the gpu firmware has a way of addressing this issue when projecting into ndc space // but we need to perform ndc-space calculations in the shader, so we must address this issue directly // perhaps there is a more elegant solution -- WestLangley bool perspective = ( projectionMatrix[ 2 ][ 3 ] == - 1.0 ); // 4th entry in the 3rd column if ( perspective ) { if ( start.z < 0.0 && end.z >= 0.0 ) { trimSegment( start, end ); } else if ( end.z < 0.0 && start.z >= 0.0 ) { trimSegment( end, start ); } } // clip space vec4 clipStart = projectionMatrix * start; vec4 clipEnd = projectionMatrix * end; // ndc space vec2 ndcStart = clipStart.xy / clipStart.w; vec2 ndcEnd = clipEnd.xy / clipEnd.w; // direction vec2 dir = ndcEnd - ndcStart; // account for clip-space aspect ratio dir.x *= aspect; dir = normalize( dir ); // perpendicular to dir vec2 offset = vec2( dir.y, - dir.x ); // undo aspect ratio adjustment dir.x /= aspect; offset.x /= aspect; // sign flip if ( position.x < 0.0 ) offset *= - 1.0; // endcaps if ( position.y < 0.0 ) { offset += - dir; } else if ( position.y > 1.0 ) { offset += dir; } // adjust for linewidth offset *= linewidth; // adjust for clip-space to screen-space conversion // maybe resolution should be based on viewport ... offset /= resolution.y; // select end vec4 clip = ( position.y < 0.5 ) ? clipStart : clipEnd; // back to clip space offset *= clip.w; clip.xy += offset; gl_Position = clip; vec4 mvPosition = ( position.y < 0.5 ) ? start : end; // this is an approximation #include #include #include }` ), fragmentShader: ( /* glsl */ ` uniform vec3 diffuse; uniform float opacity; #ifdef USE_DASH uniform float dashSize; uniform float dashOffset; uniform float gapSize; #endif varying float vLineDistance; #include #include #include #include #include varying vec2 vUv; void main() { #include #ifdef USE_DASH if ( vUv.y < - 1.0 || vUv.y > 1.0 ) discard; // discard endcaps if ( mod( vLineDistance + dashOffset, dashSize + gapSize ) > dashSize ) discard; // todo - FIX #endif float alpha = opacity; #ifdef ALPHA_TO_COVERAGE // artifacts appear on some hardware if a derivative is taken within a conditional float a = vUv.x; float b = ( vUv.y > 0.0 ) ? vUv.y - 1.0 : vUv.y + 1.0; float len2 = a * a + b * b; float dlen = fwidth( len2 ); if ( abs( vUv.y ) > 1.0 ) { alpha = 1.0 - smoothstep( 1.0 - dlen, 1.0 + dlen, len2 ); } #else if ( abs( vUv.y ) > 1.0 ) { float a = vUv.x; float b = ( vUv.y > 0.0 ) ? vUv.y - 1.0 : vUv.y + 1.0; float len2 = a * a + b * b; if ( len2 > 1.0 ) discard; } #endif vec4 diffuseColor = vec4( diffuse, alpha ); #include #include gl_FragColor = vec4( diffuseColor.rgb, alpha ); #include #include #include #include }` ) }; class h extends l.ShaderMaterial { constructor(p) { super({ type: "LineMaterial", uniforms: l.UniformsUtils.clone(l.ShaderLib.line.uniforms), vertexShader: l.ShaderLib.line.vertexShader, fragmentShader: l.ShaderLib.line.fragmentShader, clipping: !0 // required for clipping support }), Object.defineProperties(this, { color: { enumerable: !0, get: function() { return this.uniforms.diffuse.value; }, set: function(g) { this.uniforms.diffuse.value = g; } }, linewidth: { enumerable: !0, get: function() { return this.uniforms.linewidth.value; }, set: function(g) { this.uniforms.linewidth.value = g; } }, dashed: { enumerable: !0, get: function() { return "USE_DASH" in this.defines; }, set(g) { !!g != "USE_DASH" in this.defines && (this.needsUpdate = !0), g === !0 ? this.defines.USE_DASH = "" : delete this.defines.USE_DASH; } }, dashScale: { enumerable: !0, get: function() { return this.uniforms.dashScale.value; }, set: function(g) { this.uniforms.dashScale.value = g; } }, dashSize: { enumerable: !0, get: function() { return this.uniforms.dashSize.value; }, set: function(g) { this.uniforms.dashSize.value = g; } }, dashOffset: { enumerable: !0, get: function() { return this.uniforms.dashOffset.value; }, set: function(g) { this.uniforms.dashOffset.value = g; } }, gapSize: { enumerable: !0, get: function() { return this.uniforms.gapSize.value; }, set: function(g) { this.uniforms.gapSize.value = g; } }, opacity: { enumerable: !0, get: function() { return this.uniforms.opacity.value; }, set: function(g) { this.uniforms.opacity.value = g; } }, resolution: { enumerable: !0, get: function() { return this.uniforms.resolution.value; }, set: function(g) { this.uniforms.resolution.value.copy(g); } }, alphaToCoverage: { enumerable: !0, get: function() { return "ALPHA_TO_COVERAGE" in this.defines; }, set: function(g) { !!g != "ALPHA_TO_COVERAGE" in this.defines && (this.needsUpdate = !0), g === !0 ? (this.defines.ALPHA_TO_COVERAGE = "", this.extensions.derivatives = !0) : (delete this.defines.ALPHA_TO_COVERAGE, this.extensions.derivatives = !1); } } }), this.setValues(p); } } h.prototype.isLineMaterial = !0; }, /* 49 */ /***/ (a, s, c) => { var l = c(4); s.Minimap = function(h) { var u = h; this.camera = new l.OrthographicCamera(-0.5, 0.5, 0.5, -0.5, 0.01, 10), this.helper = void 0; var p = new l.BufferGeometry(), g = new Float32Array([-1, -1, 1, 1, -1, 1, 1, 1, 1, 1, 1, 1, -1, 1, 1, -1, -1, 1]), m = new l.BufferAttribute(g, 3); p.setAttribute("position", m); var d = new l.MeshBasicMaterial({ color: 3355443, depthTest: !1, depthWrite: !1, opacity: 0.5, transparent: !0 }); this.mask = new l.Mesh(p, d); var y = new l.Box3(), f = new l.Vector3(); this.getDiffFromNormalised = (M, S) => { y.setFromBufferAttribute(m).getCenter(f); var T = f.clone().project(this.camera), x = new l.Vector3(M, S, T.z).unproject(this.camera); return x.sub(f); }; var v = (M, S) => { u.camera.near && (this.camera.near = u.camera.near), S.farPlane && (this.camera.far = S.farPlane), S.eyePosition && this.camera.position.set(S.eyePosition[0], S.eyePosition[1], S.eyePosition[2]), S.upVector && this.camera.up.set(S.upVector[0], S.upVector[1], S.upVector[2]), S.targetPosition && this.camera.lookAt(new l.Vector3(S.targetPosition[0], S.targetPosition[1], S.targetPosition[2])), this.camera.zoom = 1 / M, this.camera.updateProjectionMatrix(); }; this.getBoundary = () => { var M = new l.Vector3().copy(u.camera.target).project(u.camera), S = new l.Vector3(-1, -1, M.z).unproject(u.camera), T = new l.Vector3(1, -1, M.z).unproject(u.camera), x = new l.Vector3(1, 1, M.z).unproject(u.camera), w = new l.Vector3(-1, 1, M.z).unproject(u.camera); m.copyVector3sArray([S, T, x, x, w, S]), m.needsUpdate = !0; }, this.updateCamera = () => { this.getBoundary(); var M = u.getZincCameraControls(), S = u.getBoundingBox(); if (S) { var T = S.min.distanceTo(S.max), x = T / 2, w = (S.min.x + S.max.x) / 2, A = (S.min.y + S.max.y) / 2, _ = (S.min.z + S.max.z) / 2, E = M.getViewportFromCentreAndRadius(w, A, _, x, 40, x * 4); v(T, E); } }; }; }, /* 50 */ /***/ (a, s, c) => { var l = c(4), h = c(51)(l), u = c(3).Geometry, p = c(52), g = c(53).default, m = l.BufferGeometryLoader, d = function(y) { var f; y && y.isGeometry && (f = y); var v = void 0, M = void 0, S = !1, T = void 0, x = (O) => { var L = f.getMorph().material.clone(); L.morphTargets = !1; var C = new u(), I = new m(), R = I.parse(O), b = new l.Mesh(R.geometry, L); return C.geometry = b.geometry, b.userData = C, C.setMorph(b), C; }, w = (O) => { switch (O.data.action) { case "message": console.log(O.data.message); break; case "result": var L = new d(x(O.data.object)); T && T(L), T = void 0, S = !1; break; default: throw "Cannot handle specified action."; } }, A = (O) => { if (p !== void 0 && (M = p( /*require.resolve*/ 54 )), !M) v = new (c(55)).GeometryCSGInternal(O); else if (O && O.isGeometry) { var L = O.getMorph(), C = L.geometry.clone().applyMatrix(L.matrix).toJSON(); M.addEventListener("message", function(I) { w(I); }), M.postMessage({ action: "initialise", object: C }); } }; this.getHostGeometry = () => { var O = new h(f.getMorph()); return new _(O); }, this.getGeometry = () => f; var _ = (O) => { var L = f.getMorph().material.clone(); L.morphTargets = !1; var C = O.toMesh(L), I = new u(); return I.geometry = C.geometry, C.userData = I, I.setMorph(C), I; }; this.setCSG = (O) => { v.setCSG(O); }; var E = (O, L, C, I) => { if (S) I("On progress"); else { var R = O.getMorph(), b = R.geometry.clone().applyMatrix(R.matrix).toJSON(); T = C, S = !0, M.postMessage({ action: L, object: b }); } }; this.intersect = (O) => new g((L, C) => { if (M) E(O, "intersect", L, C); else { var I = v.intersect(O), R = new d(_(I)); R.setCSG(I), L(R); } }), this.subtract = (O) => new g((L, C) => { if (M) E(O, "intersect", L, C); else { var I = v.subtract(O), R = new d(_(I)); R.setCSG(I), L(R); } }), this.union = (O) => new g((L, C) => { if (M) E(O, "intersect", L, C); else { var I = v.union(O), R = new d(_(I)); R.setCSG(I), L(R); } }), this.terminateWorker = () => { M && M.terminate(); }, A(y); }; s.GeometryCSG = d; }, /* 51 */ /***/ (a) => { var s = 1e-5, c = 0, l = 1, h = 2, u = 3; a.exports = function(p) { var g = function(m) { var d, y, f, v, M, S, T, x = []; if (m.isBufferGeometry && (m = new p.Geometry().fromBufferGeometry(m)), m instanceof p.Geometry) this.matrix = new p.Matrix4(); else if (m.isMesh) m.updateMatrix(), this.matrix = m.matrix.clone(), m = m.geometry, m.isBufferGeometry && (m = new p.Geometry().fromBufferGeometry(m)), m.mergeVertices(), m.computeVertexNormals(!1); else { if (m instanceof g.Node) return this.tree = m, this.matrix = new p.Matrix4(), this; throw "ThreeBSP: Given geometry is unsupported"; } for (d = 0, y = m.faces.length; d < y; d++) f = m.faces[d], M = m.faceVertexUvs[0][d], T = new g.Polygon(), f instanceof p.Face3 ? (v = m.vertices[f.a], S = M ? new p.Vector2(M[0].x, M[0].y) : null, v = new g.Vertex(v.x, v.y, v.z, f.vertexNormals[0], S), v.applyMatrix4(this.matrix), T.vertices.push(v), v = m.vertices[f.b], S = M ? new p.Vector2(M[1].x, M[1].y) : null, v = new g.Vertex(v.x, v.y, v.z, f.vertexNormals[2], S), v.applyMatrix4(this.matrix), T.vertices.push(v), v = m.vertices[f.c], S = M ? new p.Vector2(M[2].x, M[2].y) : null, v = new g.Vertex(v.x, v.y, v.z, f.vertexNormals[2], S), v.applyMatrix4(this.matrix), T.vertices.push(v)) : (p.Face4, v = m.vertices[f.a], S = M ? new p.Vector2(M[0].x, M[0].y) : null, v = new g.Vertex(v.x, v.y, v.z, f.vertexNormals[0], S), v.applyMatrix4(this.matrix), T.vertices.push(v), v = m.vertices[f.b], S = M ? new p.Vector2(M[1].x, M[1].y) : null, v = new g.Vertex(v.x, v.y, v.z, f.vertexNormals[1], S), v.applyMatrix4(this.matrix), T.vertices.push(v), v = m.vertices[f.c], S = M ? new p.Vector2(M[2].x, M[2].y) : null, v = new g.Vertex(v.x, v.y, v.z, f.vertexNormals[2], S), v.applyMatrix4(this.matrix), T.vertices.push(v), v = m.vertices[f.d], S = M ? new p.Vector2(M[3].x, M[3].y) : null, v = new g.Vertex(v.x, v.y, v.z, f.vertexNormals[3], S), v.applyMatrix4(this.matrix), T.vertices.push(v)), T.calculateProperties(), x.push(T); this.tree = new g.Node(x); }; return g.prototype.subtract = function(m) { var d = this.tree.clone(), y = m.tree.clone(); return d.invert(), d.clipTo(y), y.clipTo(d), y.invert(), y.clipTo(d), y.invert(), d.build(y.allPolygons()), d.invert(), d = new g(d), d.matrix = this.matrix, d; }, g.prototype.union = function(m) { var d = this.tree.clone(), y = m.tree.clone(); return d.clipTo(y), y.clipTo(d), y.invert(), y.clipTo(d), y.invert(), d.build(y.allPolygons()), d = new g(d), d.matrix = this.matrix, d; }, g.prototype.intersect = function(m) { var d = this.tree.clone(), y = m.tree.clone(); return d.invert(), y.clipTo(d), y.invert(), d.clipTo(y), y.clipTo(d), d.build(y.allPolygons()), d.invert(), d = new g(d), d.matrix = this.matrix, d; }, g.prototype.toGeometry = function() { var m, d, y, f, v, M, S, T, x, w, A = new p.Matrix4().getInverse(this.matrix), _ = new p.Geometry(), E = this.tree.allPolygons(), O = E.length, L = {}; for (m = 0; m < O; m++) for (y = E[m], f = y.vertices.length, d = 2; d < f; d++) w = [], T = y.vertices[0], w.push(new p.Vector2(T.uv.x, T.uv.y)), T = new p.Vector3(T.x, T.y, T.z), T.applyMatrix4(A), typeof L[T.x + "," + T.y + "," + T.z] > "u" ? (_.vertices.push(T), v = L[T.x + "," + T.y + "," + T.z] = _.vertices.length - 1) : v = L[T.x + "," + T.y + "," + T.z], T = y.vertices[d - 1], w.push(new p.Vector2(T.uv.x, T.uv.y)), T = new p.Vector3(T.x, T.y, T.z), T.applyMatrix4(A), typeof L[T.x + "," + T.y + "," + T.z] > "u" ? (_.vertices.push(T), M = L[T.x + "," + T.y + "," + T.z] = _.vertices.length - 1) : M = L[T.x + "," + T.y + "," + T.z], T = y.vertices[d], w.push(new p.Vector2(T.uv.x, T.uv.y)), T = new p.Vector3(T.x, T.y, T.z), T.applyMatrix4(A), typeof L[T.x + "," + T.y + "," + T.z] > "u" ? (_.vertices.push(T), S = L[T.x + "," + T.y + "," + T.z] = _.vertices.length - 1) : S = L[T.x + "," + T.y + "," + T.z], x = new p.Face3(v, M, S, new p.Vector3(y.normal.x, y.normal.y, y.normal.z)), _.faces.push(x), _.faceVertexUvs[0].push(w); return _; }, g.prototype.toBufferGeometry = function() { var m = this.toGeometry(), d = new p.BufferGeometry().fromGeometry(m); return d; }, g.prototype.toMesh = function(m) { var d = this.toBufferGeometry(), y = new p.Mesh(d, m); return y.position.setFromMatrixPosition(this.matrix), y.rotation.setFromRotationMatrix(this.matrix), y; }, g.Polygon = function(m) { m instanceof Array || (m = []), this.vertices = m, 0 < m.length ? this.calculateProperties() : this.normal = this.w = void 0; }, g.Polygon.prototype.calculateProperties = function() { var m = this.vertices[0], d = this.vertices[1], y = this.vertices[2]; return this.normal = d.clone().subtract(m).cross(y.clone().subtract(m)).normalize(), this.w = this.normal.clone().dot(m), this; }, g.Polygon.prototype.clone = function() { var m, d, y = new g.Polygon(); for (m = 0, d = this.vertices.length; m < d; m++) y.vertices.push(this.vertices[m].clone()); return y.calculateProperties(), y; }, g.Polygon.prototype.flip = function() { var m, d = []; for (this.normal.multiplyScalar(-1), this.w *= -1, m = this.vertices.length - 1; 0 <= m; m--) d.push(this.vertices[m]); return this.vertices = d, this; }, g.Polygon.prototype.classifyVertex = function(m) { var d = this.normal.dot(m) - this.w; return d < -s ? h : d > s ? l : c; }, g.Polygon.prototype.classifySide = function(m) { var d, y, f, v = 0, M = 0, S = m.vertices.length; for (d = 0; d < S; d++) y = m.vertices[d], f = this.classifyVertex(y), f === l ? v++ : f === h && M++; return 0 < v && M === 0 ? l : v === 0 && 0 < M ? h : v === 0 && M === 0 ? c : u; }, g.Polygon.prototype.splitPolygon = function(m, d, y, f, v) { var M = this.classifySide(m); if (M === c) (0 < this.normal.dot(m.normal) ? d : y).push(m); else if (M === l) f.push(m); else if (M === h) v.push(m); else { var S, T, x, w, A, _, E, O, L, C = [], I = []; for (T = 0, S = m.vertices.length; T < S; T++) x = (T + 1) % S, _ = m.vertices[T], E = m.vertices[x], w = this.classifyVertex(_), A = this.classifyVertex(E), w != h && C.push(_), w != l && I.push(_), (w | A) == u && (O = (this.w - this.normal.dot(_)) / this.normal.dot(E.clone().subtract(_)), L = _.interpolate(E, O), C.push(L), I.push(L)); 3 <= C.length && f.push(new g.Polygon(C).calculateProperties()), 3 <= I.length && v.push(new g.Polygon(I).calculateProperties()); } }, g.Vertex = function(m, d, y, f, v) { this.x = m, this.y = d, this.z = y, this.normal = f || new p.Vector3(), this.uv = v || new p.Vector2(); }, g.Vertex.prototype.clone = function() { return new g.Vertex(this.x, this.y, this.z, this.normal.clone(), this.uv.clone()); }, g.Vertex.prototype.add = function(m) { return this.x += m.x, this.y += m.y, this.z += m.z, this; }, g.Vertex.prototype.subtract = function(m) { return this.x -= m.x, this.y -= m.y, this.z -= m.z, this; }, g.Vertex.prototype.multiplyScalar = function(m) { return this.x *= m, this.y *= m, this.z *= m, this; }, g.Vertex.prototype.cross = function(m) { var d = this.x, y = this.y, f = this.z; return this.x = y * m.z - f * m.y, this.y = f * m.x - d * m.z, this.z = d * m.y - y * m.x, this; }, g.Vertex.prototype.normalize = function() { var m = Math.sqrt(this.x * this.x + this.y * this.y + this.z * this.z); return this.x /= m, this.y /= m, this.z /= m, this; }, g.Vertex.prototype.dot = function(m) { return this.x * m.x + this.y * m.y + this.z * m.z; }, g.Vertex.prototype.lerp = function(m, d) { return this.add(m.clone().subtract(this).multiplyScalar(d)), this.normal.add(m.normal.clone().sub(this.normal).multiplyScalar(d)), this.uv.add(m.uv.clone().sub(this.uv).multiplyScalar(d)), this; }, g.Vertex.prototype.interpolate = function(m, d) { return this.clone().lerp(m, d); }, g.Vertex.prototype.applyMatrix4 = function(m) { var d = this.x, y = this.y, f = this.z, v = m.elements; return this.x = v[0] * d + v[4] * y + v[8] * f + v[12], this.y = v[1] * d + v[5] * y + v[9] * f + v[13], this.z = v[2] * d + v[6] * y + v[10] * f + v[14], this; }, g.Node = function(m) { var d, y, f = [], v = []; if (this.polygons = [], this.front = this.back = void 0, m instanceof Array && m.length !== 0) { for (this.divider = m[0].clone(), d = 0, y = m.length; d < y; d++) this.divider.splitPolygon(m[d], this.polygons, this.polygons, f, v); 0 < f.length && (this.front = new g.Node(f)), 0 < v.length && (this.back = new g.Node(v)); } }, g.Node.isConvex = function(m) { var d, y; for (d = 0; d < m.length; d++) for (y = 0; y < m.length; y++) if (d !== y && m[d].classifySide(m[y]) !== h) return !1; return !0; }, g.Node.prototype.build = function(m) { var d, y, f = [], v = []; for (this.divider || (this.divider = m[0].clone()), d = 0, y = m.length; d < y; d++) this.divider.splitPolygon(m[d], this.polygons, this.polygons, f, v); 0 < f.length && (!this.front && (this.front = new g.Node()), this.front.build(f)), 0 < v.length && (!this.back && (this.back = new g.Node()), this.back.build(v)); }, g.Node.prototype.allPolygons = function() { var m = this.polygons.slice(); return this.front && (m = m.concat(this.front.allPolygons())), this.back && (m = m.concat(this.back.allPolygons())), m; }, g.Node.prototype.clone = function() { var m = new g.Node(); return m.divider = this.divider.clone(), m.polygons = this.polygons.map(function(d) { return d.clone(); }), m.front = this.front && this.front.clone(), m.back = this.back && this.back.clone(), m; }, g.Node.prototype.invert = function() { var m, d, y; for (m = 0, d = this.polygons.length; m < d; m++) this.polygons[m].flip(); return this.divider.flip(), this.front && this.front.invert(), this.back && this.back.invert(), y = this.front, this.front = this.back, this.back = y, this; }, g.Node.prototype.clipPolygons = function(m) { var d, y, f, v; if (!this.divider) return m.slice(); for (f = [], v = [], d = 0, y = m.length; d < y; d++) this.divider.splitPolygon(m[d], f, v, f, v); return this.front && (f = this.front.clipPolygons(f)), v = this.back ? this.back.clipPolygons(v) : [], f.concat(v); }, g.Node.prototype.clipTo = function(m) { this.polygons = m.clipPolygons(this.polygons), this.front && this.front.clipTo(m), this.back && this.back.clipTo(m); }, g; }; }, /* 52 */ /***/ (a) => { a.exports = R4(); }, /* 53 */ /***/ (a) => { a.exports = F4; }, /* 54 */ /***/ (a, s, c) => { var l = c(3).Geometry, h = c(4), u = h.BufferGeometryLoader; a.exports = function(p) { var g = void 0, m = function(M) { var S = new u(), T = S.parse(M), x = new h.MeshPhongMaterial(), w = new h.Mesh(T.geometry, x), A = new l(); return A.setMorph(w), A; }, d = function(M) { var S = m(M); g = new (c(55)).GeometryCSGInternal(S), p.postMessage({ action: "message", message: "Initialised" }); }, y = function(M) { if (g) { var S = m(M), T = g.intersect(S), x = T.toBufferGeometry().toJSON(); p.postMessage({ action: "result", object: x }); } }, f = function(M) { if (g) { var S = m(M), T = g.subtract(S), x = T.toBufferGeometry().toJSON(); p.postMessage({ action: "result", object: x }); } }, v = function(M) { if (g) { var S = m(M), T = g.union(S), x = T.toBufferGeometry().toJSON(); p.postMessage({ action: "result", object: x }); } }; p.addEventListener("message", function(M) { switch (M.data.action) { case "initialise": d(M.data.object); break; case "intersect": y(M.data.object); break; case "subtract": f(M.data.object); break; case "union": v(M.data.object); break; default: throw "Cannot handle specified action."; } }); }; }, /* 55 */ /***/ (a, s, c) => { var l = c(4), h = c(51)(l); c(3).Geometry, c(50).GeometryCSG; var u = function(p) { var g; p && p.isGeometry && (g = p); var m; this.setGeometry = (y) => { y && y.isGeometry && (g = y), m = void 0; }, this.setCSG = (y) => { m = y; }; var d = (y) => { if (g && g.morph && y && y.morph) { m === void 0 && (m = new h(g.morph)); var f = new h(y.morph); return f; } }; this.intersect = (y) => { var f = d(y); return m && f ? m.intersect(f) : void 0; }, this.subtract = (y) => { var f = d(y); return m && f ? m.subtract(f) : void 0; }, this.union = (y) => { var f = d(y); return m && f ? m.union(f) : void 0; }; }; s.GeometryCSGInternal = u; }, /* 56 */ /***/ (a, s, c) => { var l = c(4), h = c(51)(l); c(18).Glyphset; var u = function(p) { var g; p && p.isGlyphset && (g = p); var m = []; this.setGlyphset = (f) => { f && f.isGlyphset && (g = f), hostCSG = void 0; }, this.getGlyphset = () => g; var d = () => (f) => { var v = f.getMesh(), M = f.getLabel(); if (v) { var S = new h(v.geometry.clone().applyMatrix(v.matrix)), T = []; T.csg = S, T.label = M, v.material && (T.material = v.material.clone()), m.push(T); } }, y = (f) => { if (g && f && f.getMorph()) { m.length == 0 && g.forEachGlyph(d()); var v = new h(f.getMorph()); return v; } }; this.intersect = (f) => { var v = y(f); if (0 < m.length && v) { for (var M = new (c(18)).Glyphset(), S = 0; S < m.length; S++) { var T = m[S], x = T.csg.intersect(v), w = x.toMesh(); if (w && w.geometry && 0 < w.geometry.vertices.length) { T.material && (w.material = T.material, w.material.side = l.DoubleSide, w.material.clippingPlanes = null); var A = M.addMeshAsGlyph(w, S + 1); A.setLabel(T.label); } } var _ = new u(M); return _; } }; }; s.GlyphsetCSG = u; } /******/ ], r = {}; function n(a) { var s = r[a]; if (s !== void 0) return s.exports; var c = r[a] = { /******/ // no module.id needed /******/ // no module.loaded needed /******/ exports: {} /******/ }; return t[a].call(c.exports, c, c.exports, n), c.exports; } n.n = (a) => { var s = a && a.__esModule ? ( /******/ () => a.default ) : ( /******/ () => a ); return n.d(s, { a: s }), s; }, n.d = (a, s) => { for (var c in s) n.o(s, c) && !n.o(a, c) && Object.defineProperty(a, c, { enumerable: !0, get: s[c] }); }, n.o = (a, s) => Object.prototype.hasOwnProperty.call(a, s), n.r = (a) => { typeof Symbol < "u" && Symbol.toStringTag && Object.defineProperty(a, Symbol.toStringTag, { value: "Module" }), Object.defineProperty(a, "__esModule", { value: !0 }); }; var o = n(0); return o; })() )); })(Dy); var zn = Dy.exports; const Gc = /* @__PURE__ */ sL(zn), $v = (i, e) => { if (i) { let t = ""; i.forEach((r) => { t = r.uuid, r.region && (t = r.region.uuid + "/" + t), r && r.getVisibility() && e.push(t); }); } return e; }, Xd = (i, e) => { const t = i[0] - e[0], r = i[1] - e[1], n = i[2] - e[2]; return Math.sqrt(t * t + r * r + n * n); }, V4 = (i) => { const e = i.zincObjects; if (e.length > 0 && e[0]) { const t = e[0]; if (t.isEditable && t.isLines2) { const r = i.identifiers[0].extraData.intersected; if (r && r.faceIndex > -1) { const n = t.getVerticesByFaceIndex(r.faceIndex), o = i.identifiers[0].extraData.intersected.pointOnLine; if (n.length > 1) { const a = Xd(n[0], [o.x, o.y, o.z]), s = Xd(n[1], [o.x, o.y, o.z]); return a > s ? { zincObject: t, faceIndex: r.faceIndex, vertexIndex: r.faceIndex * 2 + 1, point: n[0] } : { zincObject: t, faceIndex: r.faceIndex, vertexIndex: r.faceIndex * 2, point: n[1] }; } } } } }, U4 = (i) => { const e = i.zincObjects; if (e.length > 0 && e[0]) { const t = e[0]; if (t.isEditable) return t; } }, G4 = (i, e, t) => { if (i != null && i.isEditable && i != null && i.isPointset) { let r = !1; for (let n = 0; n < 3 && !r; n++) t[n] !== 0 && (r = !0); if (r && e > -1) { const n = i.getVerticesByIndex(e); return n && (n[0] = n[0] + t[0], n[1] = n[1] + t[1], n[2] = n[2] + t[2]), i.editVertices([n], e), i.boundingBoxUpdateRequired = !0, !0; } } return !1; }, Oc = (i, e) => { if (i != null && i.isEditable && i != null && i.isLines2 && e > -1) { const t = i.getVerticesByFaceIndex(e); if (t && t.length > 1) return Xd(t[1], t[0]); } return 0; }, Hh = (i, e, t, r) => { if (i && t !== 0 && i.isEditable && i.isLines2 && e > -1) { const n = i.getVerticesByFaceIndex(e); let o = [n[1][0] - n[0][0], n[1][1] - n[0][1], n[1][2] - n[0][2]]; const a = Math.sqrt(o[0] * o[0] + o[1] * o[1] + o[2] * o[2]); for (let s = 0; s < 3; s++) o[s] = o[s] / a * t, r ? n[1][s] = n[0][s] + o[s] : (n[0][s] = n[0][s] + o[s], n[1][s] = n[1][s] + o[s]); return i.editVertices(n, e * 2), i.boundingBoxUpdateRequired = !0, !0; } return !1; }, H4 = (i, e) => { const t = e.getBoundingBox(), r = new zn.THREE.Vector3().subVectors(t.max, t.min), n = new zn.THREE.BoxGeometry(r.x, r.y, r.z); r.addVectors(t.min, t.max).multiplyScalar(0.5); const o = n.getAttribute("position"), a = o.count, s = []; for (let c = 0; c < a; c++) s[c] = [ o.array[c * 3], o.array[c * 3 + 1], o.array[c * 3 + 2] ]; i.editVertices(s, 0), i.setPosition(r.x, r.y, r.z), n.dispose(); }, O1 = (i, e) => { let t = ""; i.isRegion && (t = `__r${i.regionPath}`), i.isPrimitives && (t = `${i.regionPath}/${i.label}`), e.push(t), i.children && i.children.forEach((r) => O1(r, e)); }, Aa = (i, e, t, r) => { let n = i; const o = []; if (t && (n = i.findChildFromPath(t)), n) { const a = Array.isArray(e); let s = e; a || (s = [s]), s.forEach((c) => { const l = n.findObjectsWithGroupName(c, r); o.push(...l); }); } return o; }, Zd = (i, e, t) => { const r = i.findIndex((o) => o.uuid === e); let n; return r > -1 && (n = i[r], t && i.splice(r, 1)), n; }, j4 = (i, e) => { const t = []; if (i && e && e.length > 0) { const r = {}, n = {}, o = [i, ...i.getChildRegions(!0)]; let a, s, c; e.forEach((l) => { const h = l.split("/"); c = h[0], a = Zd(o, c, !1), a && (n[c] || (n[c] = a.getFullPath()), h[1] ? (r[c] || (r[c] = a.getAllObjects(!1)), s = Zd(r[c], h[1], !0), s && t.push(`${n[c]}/${s.groupName}`)) : t.push(`__r/${n[c]}`)); }); } return t; }, W4 = (i) => { if (i) { const e = []; return i.forEach((t) => { t.isZincObject ? e.push(t) : t.isRegion && e.push(...t.getAllObjects(!0)); }), Object.values( e.reduce((t, r) => ({ ...t, [r.uuid]: r }), {}) ); } return []; }, qv = (i, e) => { const t = { label: "Multiple selections", regionPath: "", objects: [] }; if (e && i) { const r = {}, n = i.getRootRegion(); e.length > 0 && (t.regionPath = e[0].data.region, t.label = e[0].data.group), e.forEach((o) => { o.data.region.includes(t.regionPath) || (t.regionPath = ""), t.label !== o.data.group && (t.label = "Multiple selections"); const a = n.findChildFromPath(o.data.region); r[a.uuid] || (r[a.uuid] = a.getAllObjects(!1)); const s = Zd(r[a.uuid], o.data.uuid); s && t.objects.push(s); }); } return t; }, $4 = (i) => { const e = i.getMorph(); let t = "position"; i.isLines2 && (t = "instanceStart"); const r = []; let n = 0; const o = e.geometry.getAttribute(t); for (let a = 0; a < i.drawRange; a++) r.push([ o.array[n++], o.array[n++], o.array[n++] ]); return r; }, q4 = (i, e, t, r, n) => { let o; if (i.isPointset ? o = "MultiPoint" : i.isLines2 && (o = "MultiLineString"), o) { const a = $4(i); let s = e.slice(-1) === "/" ? e : e + "/"; s = s + t; const c = s, l = { resource: r, item: { id: c }, body: { evidence: [], comment: n }, feature: { id: c, properties: { drawn: !0, label: "Drawn annotation" }, geometry: { coordinates: a, type: o } } }; return n === "Deleted" && (l.feature = void 0), l; } }, Xv = (i, e, t, r, n, o, a) => { const s = q4(t, r, n, o, a); if (s) return i && i.currentUser && (s.creator = { ...i.currentUser }, s.creator.orcid || (s.creator.orcid = "0000-0000-0000-0000"), i.addAnnotation(e, s).then((c) => { c.annotationId || console.log("There is a problem with the submission, please try again later"); }).catch(() => { console.log("There is a problem with the submission, please try again later"); })), s; }, Zv = async (i, e, t) => { const r = t; return await i.drawnFeatures(e, r); }, jh = (i, e) => { i && e.forEach((t) => { const r = t.geometry, n = decodeURIComponent(t.id), o = n.lastIndexOf("/"), a = n.substring(0, o), s = n.substring(o + 1); let c; r.type === "MultiPoint" ? c = i.createPoints( a, s, r.coordinates, s, 8942 ) : r.type === "MultiLineString" && (c = i.createLines( a, s, r.coordinates, 60962 )), c && (c.zincObject.isEditable = !0); }); }, xn = (i, e) => { const t = i.__vccOpts || i; for (const [r, n] of e) t[r] = n; return t; }, X4 = { name: "LinesControls", components: { Button: os, Col: _r, Container: Gr, InputNumber: vn, Main: gn, Slider: ar, ElIconArrowLeft: jn, ElIconArrowRight: Wn }, props: { createData: { type: Object } }, data: function() { return { adjust: 0, pAdjust: 0, lengthScale: 0, distance: 0, newDistance: 0, width: 1, currentIndex: 0, ElIconArrowLeft: Ci(jn), ElIconArrowRight: Ci(Wn), edited: !1, zincObject: void 0 }; }, watch: { "createData.faceIndex": { handler: function(i) { var e; (e = this.zincObject) != null && e.isLines2 && (this.currentIndex = i, this.distance = Oc(this.zincObject, this.currentIndex)); }, immediate: !0 } }, methods: { changeIndex: function(i) { i ? Oc(this.zincObject, this.currentIndex + 1) > 0 && (this.currentIndex++, this.reset()) : (this.currentIndex--, this.reset()); }, onLengthInput: function() { this.newDistance !== 0 ? (this.distance = this.newDistance, this.edited = Hh( this.zincObject, this.currentIndex, this.newDistance, !0 ) || this.edited) : this.newDistance = this.distance; }, onLengthSliding: function() { this.newDistance = Math.pow(10, this.lengthScale) * this.distance, this.edited = Hh( this.zincObject, this.currentIndex, this.newDistance, !0 ) || this.edited; }, onMoveSliding: function() { const i = (this.adjust - this.pAdjust) * this.distance; this.edited = Hh( this.zincObject, this.currentIndex, i, !1 ) || this.edited, this.pAdjust = this.adjust; }, reset: function() { this.adjust = 0, this.pAdjust = 0, this.lengthScale = 0, this.distance = Oc(this.zincObject, this.currentIndex), this.newDistance = this.distance, this.edited && (this.$emit("primitivesUpdated", this.zincObject), this.edited = !1); }, setObject: function(i) { this.currentIndex = -1, this.distance = 0, i.isLines2 ? (this.zincObject = Mi(i), this.width = this.zincObject.getMorph().material.linewidth, i.isEditable && (this.currentIndex = 0, this.distance = Oc(i, this.currentIndex))) : (this.zincObject = void 0, this.width = 10); }, modifyWidth: function() { this.zincObject.setWidth(this.width); } } }; function Z4(i, e, t, r, n, o) { const a = _r, s = ar, c = vn, l = Ur, h = os, u = gn, p = Gr; return ge(), Ue(p, { class: "lines-container" }, { default: me(() => [ le(u, { class: "slides-block" }, { default: me(() => [ le(l, null, { default: me(() => [ le(a, { offset: 0, span: 6 }, { default: me(() => [ vt(" Width: ") ]), _: 1 }), le(a, { offset: 0, span: 12 }, { default: me(() => [ le(s, { modelValue: i.width, "onUpdate:modelValue": e[0] || (e[0] = (g) => i.width = g), class: "my-slider", step: 1, min: 1, max: 100, "show-tooltip": !1, onInput: o.modifyWidth }, null, 8, ["modelValue", "onInput"]) ]), _: 1 }), le(a, { offset: 0, span: 4 }, { default: me(() => [ le(c, { modelValue: i.width, "onUpdate:modelValue": e[1] || (e[1] = (g) => i.width = g), step: 1, min: 1, max: 100, controls: !1, class: "input-box number-input" }, null, 8, ["modelValue"]) ]), _: 1 }) ]), _: 1 }), i.currentIndex > -1 && i.distance > 0 ? (ge(), Le(Vt, { key: 0 }, [ le(l, null, { default: me(() => [ le(a, { offset: 0, span: 4 }, { default: me(() => [ le(h, { size: "small", disabled: i.currentIndex === 0, icon: i.ElIconArrowLeft, onClick: e[2] || (e[2] = (g) => o.changeIndex(!1)) }, null, 8, ["disabled", "icon"]) ]), _: 1 }), le(a, { offset: 4, span: 9 }, { default: me(() => [ vt(" Editing Line " + xt(i.currentIndex + 1), 1) ]), _: 1 }), le(a, { offset: 2, span: 2 }, { default: me(() => [ le(h, { size: "small", icon: i.ElIconArrowRight, onClick: e[3] || (e[3] = (g) => o.changeIndex(!0)) }, null, 8, ["icon"]) ]), _: 1 }) ]), _: 1 }), le(l, null, { default: me(() => [ le(a, { offset: 0, span: 6 }, { default: me(() => [ vt(" Move: ") ]), _: 1 }), le(a, { offset: 0, span: 16 }, { default: me(() => [ le(s, { modelValue: i.adjust, "onUpdate:modelValue": e[4] || (e[4] = (g) => i.adjust = g), step: 0.01, min: -3, max: 3, "show-tooltip": !1, onInput: e[5] || (e[5] = (g) => o.onMoveSliding()), onChange: e[6] || (e[6] = (g) => o.reset()) }, null, 8, ["modelValue"]) ]), _: 1 }) ]), _: 1 }), le(l, null, { default: me(() => [ le(a, { offset: 0, span: 6 }, { default: me(() => [ vt(" Length: ") ]), _: 1 }), le(a, { offset: 0, span: 10 }, { default: me(() => [ le(s, { modelValue: i.lengthScale, "onUpdate:modelValue": e[7] || (e[7] = (g) => i.lengthScale = g), step: 0.01, min: -1, max: 1, "show-tooltip": !1, onInput: e[8] || (e[8] = (g) => o.onLengthSliding()), onChange: e[9] || (e[9] = (g) => o.reset()) }, null, 8, ["modelValue"]) ]), _: 1 }), le(a, { offset: 0, span: 6 }, { default: me(() => [ le(c, { modelValue: i.newDistance, "onUpdate:modelValue": e[10] || (e[10] = (g) => i.newDistance = g), controls: !1, class: "input-box number-input", onChange: o.onLengthInput }, null, 8, ["modelValue", "onChange"]) ]), _: 1 }) ]), _: 1 }) ], 64)) : Ve("", !0) ]), _: 1 }) ]), _: 1 }); } const P1 = /* @__PURE__ */ xn(X4, [["render", Z4], ["__scopeId", "data-v-6581aa67"]]), Y4 = { name: "PointsControls", components: { Col: _r, Container: Gr, InputNumber: vn, Main: gn, Select: as, Slider: ar, Row: Ur, Option: ss, ElIconArrowLeft: jn, ElIconArrowRight: Wn }, inject: ["boundingDims"], data: function() { return { attenuation: !1, size: 10, choices: [ { value: !0, label: "On" }, { value: !1, label: "off" } ], min: [0, 0, 0], max: [1, 1, 1], translation: [0, 0, 0], pTranslation: [0, 0, 0], currentIndex: -1, ElIconArrowLeft: Ci(jn), ElIconArrowRight: Ci(Wn), edited: !1, zincObject: void 0 }; }, watch: { boundingDims: { handler: function(i) { const e = i.size; this.min = [ -e[0] / 2, -e[1] / 2, -e[2] / 2 ], this.max = [ e[0] / 2, e[1] / 2, e[2] / 2 ]; }, immediate: !0, deep: !0 } }, methods: { changeIndex: function(i) { i ? this.zincObject.drawRange > this.currentIndex + 1 && (this.currentIndex++, this.reset()) : (this.currentIndex--, this.reset()); }, onMoveSliding: function() { const i = [ this.translation[0] - this.pTranslation[0], this.translation[1] - this.pTranslation[1], this.translation[2] - this.pTranslation[2] ]; this.edited = G4(this.zincObject, this.currentIndex, i) || this.edited; for (let e = 0; e < 3; e++) this.pTranslation[e] = this.translation[e]; }, reset: function() { this.translation = [0, 0, 0], this.pTranslation = [0, 0, 0], this.edited && (this.$emit("primitivesUpdated", this.zincObject), this.edited = !1); }, setObject: function(i) { this.currentIndex = -1, i.isPointset ? (this.zincObject = Mi(i), this.size = this.zincObject.morph.material.size, this.attenuation = this.zincObject.morph.material.sizeAttenuation, i.isEditable && this.zincObject.drawRange > 0 && (this.currentIndex = 0)) : (this.zincObject = void 0, this.size = 10, this.attenuation = !1); }, modifyAttenuation: function(i) { this.attenuation = i, this.zincObject.setSizeAttenuation(i); }, modifySize: function() { this.zincObject.setSize(this.size); } } }; function J4(i, e, t, r, n, o) { const a = _r, s = ar, c = vn, l = Ur, h = ss, u = as, p = os, g = gn, m = Gr; return ge(), Ue(m, { class: "pointset-container" }, { default: me(() => [ le(g, { class: "slides-block" }, { default: me(() => [ le(l, null, { default: me(() => [ le(a, { offset: 0, span: 6 }, { default: me(() => [ vt(" Size: ") ]), _: 1 }), le(a, { offset: 0, span: 10 }, { default: me(() => [ le(s, { modelValue: i.size, "onUpdate:modelValue": e[0] || (e[0] = (d) => i.size = d), class: "my-slider", step: 1, min: 0, max: 100, "show-tooltip": !1, onInput: e[1] || (e[1] = (d) => o.modifySize()) }, null, 8, ["modelValue"]) ]), _: 1 }), le(a, { offset: 0, span: 6 }, { default: me(() => [ le(c, { modelValue: i.size, "onUpdate:modelValue": e[2] || (e[2] = (d) => i.size = d), step: 1, min: 0, max: 100, controls: !1, class: "input-box number-input" }, null, 8, ["modelValue"]) ]), _: 1 }) ]), _: 1 }), le(l, null, { default: me(() => [ le(a, { offset: 0, span: 16 }, { default: me(() => [ vt(" Size attenuation: ") ]), _: 1 }), le(a, { offset: 0, span: 5 }, { default: me(() => [ le(u, { teleported: !1, "model-value": i.attenuation, placeholder: "Select", class: "input-box", "popper-class": "viewer_dropdown", onChange: e[3] || (e[3] = (d) => o.modifyAttenuation(d, i.slide)) }, { default: me(() => [ (ge(!0), Le(Vt, null, tr(i.choices, (d) => (ge(), Ue(h, { key: d.value, label: d.label, value: d.value }, null, 8, ["label", "value"]))), 128)) ]), _: 1 }, 8, ["model-value"]) ]), _: 1 }) ]), _: 1 }), i.currentIndex > -1 ? (ge(), Le(Vt, { key: 0 }, [ le(l, null, { default: me(() => [ le(a, { offset: 0, span: 4 }, { default: me(() => [ le(p, { size: "small", disabled: i.currentIndex === 0, icon: i.ElIconArrowLeft, onClick: e[4] || (e[4] = (d) => o.changeIndex(!1)) }, null, 8, ["disabled", "icon"]) ]), _: 1 }), le(a, { offset: 4, span: 9 }, { default: me(() => [ vt(" Editing Point " + xt(i.currentIndex + 1), 1) ]), _: 1 }), le(a, { offset: 2, span: 2 }, { default: me(() => [ le(p, { size: "small", icon: i.ElIconArrowRight, onClick: e[5] || (e[5] = (d) => o.changeIndex(!0)) }, null, 8, ["icon"]) ]), _: 1 }) ]), _: 1 }), le(l, null, { default: me(() => [ le(a, { offset: 0, span: 6 }, { default: me(() => [ vt(" x: ") ]), _: 1 }), le(a, { offset: 0, span: 16 }, { default: me(() => [ le(s, { modelValue: i.translation[0], "onUpdate:modelValue": e[6] || (e[6] = (d) => i.translation[0] = d), step: 0.01, min: i.min[0], max: i.max[0], "show-tooltip": !1, onInput: e[7] || (e[7] = (d) => o.onMoveSliding()), onChange: e[8] || (e[8] = (d) => o.reset()) }, null, 8, ["modelValue", "min", "max"]) ]), _: 1 }) ]), _: 1 }), le(l, null, { default: me(() => [ le(a, { offset: 0, span: 6 }, { default: me(() => [ vt(" y: ") ]), _: 1 }), le(a, { offset: 0, span: 16 }, { default: me(() => [ le(s, { modelValue: i.translation[1], "onUpdate:modelValue": e[9] || (e[9] = (d) => i.translation[1] = d), step: 0.01, min: i.min[1], max: i.max[1], "show-tooltip": !1, onInput: e[10] || (e[10] = (d) => o.onMoveSliding()), onChange: e[11] || (e[11] = (d) => o.reset()) }, null, 8, ["modelValue", "min", "max"]) ]), _: 1 }) ]), _: 1 }), le(l, null, { default: me(() => [ le(a, { offset: 0, span: 6 }, { default: me(() => [ vt(" z: ") ]), _: 1 }), le(a, { offset: 0, span: 16 }, { default: me(() => [ le(s, { modelValue: i.translation[2], "onUpdate:modelValue": e[12] || (e[12] = (d) => i.translation[2] = d), step: 0.01, min: i.min[2], max: i.max[2], "show-tooltip": !1, onInput: e[13] || (e[13] = (d) => o.onMoveSliding()), onChange: e[14] || (e[14] = (d) => o.reset()) }, null, 8, ["modelValue", "min", "max"]) ]), _: 1 }) ]), _: 1 }) ], 64)) : Ve("", !0) ]), _: 1 }) ]), _: 1 }); } const I1 = /* @__PURE__ */ xn(Y4, [["render", J4], ["__scopeId", "data-v-d1de9c65"]]), K4 = { name: "TextureSlidesControls", components: { Col: _r, Container: Gr, Footer: Ty, Icon: Dt, InputNumber: vn, Main: gn, Row: Ur, Select: as, Slider: ar, Option: ss, ElIconDelete: Xc, ElIconPlus: pu }, data: function() { return { settings: [], directions: [ { value: "x", label: "x" }, { value: "y", label: "y" }, { value: "z", label: "z" } ], zincObject: void 0 }; }, methods: { setObject: function(i) { i.isTextureSlides ? (this.zincObject = Mi(i), this.settings = this.zincObject.getTextureSettings()) : (this.zincObject = void 0, this.settings = []); }, addNewSlide: function() { const i = { direction: "x", value: 0 }, e = this.zincObject.createSlide(i); this.settings.push(e); }, modifyDirection: function(i, e) { e && (e.direction = i, this.zincObject.modifySlideSettings(e)); }, modifySlide: function(i) { i && this.zincObject.modifySlideSettings(i); }, removeSlide: function(i, e) { this.zincObject.removeSlideWithId(e.id), this.settings.splice(i, 1); } } }; function Q4(i, e, t, r, n, o) { const a = ss, s = as, c = _r, l = ar, h = vn, u = Xc, p = Dt, g = Ur, m = gn, d = pu, y = Ty, f = Gr; return ge(), Ue(f, { class: "t-slides-container" }, { default: me(() => [ le(m, { class: "slides-block" }, { default: me(() => [ (ge(!0), Le(Vt, null, tr(i.settings, (v, M) => (ge(), Ue(g, { key: v.id, class: "slide-row" }, { default: me(() => [ le(c, { offset: 0, span: 6 }, { default: me(() => [ le(s, { teleported: !1, "model-value": v.direction, placeholder: "Select", class: "input-box", "popper-class": "viewer_dropdown", onChange: (S) => o.modifyDirection(S, v) }, { default: me(() => [ (ge(!0), Le(Vt, null, tr(i.directions, (S) => (ge(), Ue(a, { key: S.value, label: S.label, value: S.value }, null, 8, ["label", "value"]))), 128)) ]), _: 2 }, 1032, ["model-value", "onChange"]) ]), _: 2 }, 1024), le(c, { offset: 0, span: 10 }, { default: me(() => [ le(l, { modelValue: v.value, "onUpdate:modelValue": (S) => v.value = S, class: "my-slider", step: 0.01, min: 0, max: 1, "show-tooltip": !1, onInput: (S) => o.modifySlide(v) }, null, 8, ["modelValue", "onUpdate:modelValue", "onInput"]) ]), _: 2 }, 1024), le(c, { offset: 0, span: 6 }, { default: me(() => [ le(h, { modelValue: v.value, "onUpdate:modelValue": (S) => v.value = S, step: 0.01, min: 0, max: 1, controls: !1, class: "input-box number-input" }, null, 8, ["modelValue", "onUpdate:modelValue"]) ]), _: 2 }, 1024), le(c, { offset: 0, span: 2 }, { default: me(() => [ le(p, { class: "delete-icon", onClick: (S) => o.removeSlide(M, v) }, { default: me(() => [ le(u) ]), _: 2 }, 1032, ["onClick"]) ]), _: 2 }, 1024) ]), _: 2 }, 1024))), 128)) ]), _: 1 }), le(y, { height: "30px", class: "add-slides-text", onClick: o.addNewSlide }, { default: me(() => [ le(g, null, { default: me(() => [ le(c, { span: 2 }, { default: me(() => [ le(p, null, { default: me(() => [ le(d) ]), _: 1 }) ]), _: 1 }), le(c, { span: 20 }, { default: me(() => [ vt(" Add a new slide ") ]), _: 1 }) ]), _: 1 }) ]), _: 1 }, 8, ["onClick"]) ]), _: 1 }); } const D1 = /* @__PURE__ */ xn(K4, [["render", Q4], ["__scopeId", "data-v-12185b7f"]]), ez = { name: "TransformationControls", components: { Col: _r, Container: Gr, InputNumber: vn, Main: gn, Slider: ar }, inject: ["boundingDims"], data: function() { return { x: 0, y: 0, z: 0, scale: 1, min: [0, 0, 0], max: [1, 1, 1], zincObject: void 0 }; }, watch: { boundingDims: { handler: function(i) { const e = i.centre, t = i.size; this.min = [ e[0] - t[0], e[1] - t[1], e[2] - t[2] ], this.max = [ e[0] + t[0], e[1] + t[1], e[2] + t[2] ]; }, immediate: !0, deep: !0 } }, methods: { setObject: function(i) { if (i.isZincObject) { this.zincObject = Mi(i); const e = this.zincObject.getGroup(); e && e.position && (this.x = e.position.x, this.y = e.position.y, this.z = e.position.z, this.scale = e.scale.x); } else this.zincObject = void 0, this.x = 0, this.y = 0, this.z = 0, this.scale = 1; }, modifyPosition: function() { this.zincObject.setPosition(this.x, this.y, this.z); }, modifyScale: function() { this.zincObject.setScaleAll(this.scale); } } }; function tz(i, e, t, r, n, o) { const a = _r, s = ar, c = vn, l = Ur, h = gn, u = Gr; return ge(), Ue(u, { class: "transformation-container" }, { default: me(() => [ le(h, { class: "slides-block" }, { default: me(() => [ le(l, { class: "tool-row" }, { default: me(() => [ le(a, { offset: 0, span: 6 }, { default: me(() => [ vt(" x: ") ]), _: 1 }), le(a, { offset: 0, span: 10 }, { default: me(() => [ le(s, { modelValue: i.x, "onUpdate:modelValue": e[0] || (e[0] = (p) => i.x = p), step: 0.01, min: i.min[0], max: i.max[0], "show-tooltip": !1, onInput: e[1] || (e[1] = (p) => o.modifyPosition()) }, null, 8, ["modelValue", "min", "max"]) ]), _: 1 }), le(a, { offset: 0, span: 6 }, { default: me(() => [ le(c, { modelValue: i.x, "onUpdate:modelValue": e[2] || (e[2] = (p) => i.x = p), step: 0.01, min: i.min[0], max: i.max[0], controls: !1, class: "input-box number-input", onChange: e[3] || (e[3] = (p) => o.modifyPosition()) }, null, 8, ["modelValue", "min", "max"]) ]), _: 1 }) ]), _: 1 }), le(l, { class: "tool-row" }, { default: me(() => [ le(a, { offset: 0, span: 6 }, { default: me(() => [ vt(" y: ") ]), _: 1 }), le(a, { offset: 0, span: 10 }, { default: me(() => [ le(s, { modelValue: i.y, "onUpdate:modelValue": e[4] || (e[4] = (p) => i.y = p), step: 0.01, min: i.min[1], max: i.max[1], "show-tooltip": !1, onInput: e[5] || (e[5] = (p) => o.modifyPosition()) }, null, 8, ["modelValue", "min", "max"]) ]), _: 1 }), le(a, { offset: 0, span: 6 }, { default: me(() => [ le(c, { modelValue: i.y, "onUpdate:modelValue": e[6] || (e[6] = (p) => i.y = p), step: 0.01, min: i.min[1], max: i.max[1], controls: !1, class: "input-box number-input", onChange: e[7] || (e[7] = (p) => o.modifyPosition()) }, null, 8, ["modelValue", "min", "max"]) ]), _: 1 }) ]), _: 1 }), le(l, { class: "tool-row" }, { default: me(() => [ le(a, { offset: 0, span: 6 }, { default: me(() => [ vt(" z: ") ]), _: 1 }), le(a, { offset: 0, span: 10 }, { default: me(() => [ le(s, { modelValue: i.z, "onUpdate:modelValue": e[8] || (e[8] = (p) => i.z = p), step: 0.01, min: i.min[2], max: i.max[2], "show-tooltip": !1, onInput: e[9] || (e[9] = (p) => o.modifyPosition()) }, null, 8, ["modelValue", "min", "max"]) ]), _: 1 }), le(a, { offset: 0, span: 6 }, { default: me(() => [ le(c, { modelValue: i.z, "onUpdate:modelValue": e[10] || (e[10] = (p) => i.z = p), step: 0.01, min: i.min[2], max: i.max[2], controls: !1, class: "input-box number-input", onChange: e[11] || (e[11] = (p) => o.modifyPosition()) }, null, 8, ["modelValue", "min", "max"]) ]), _: 1 }) ]), _: 1 }), le(l, { class: "tool-row" }, { default: me(() => [ le(a, { offset: 0, span: 6 }, { default: me(() => [ vt(" Scale: ") ]), _: 1 }), le(a, { offset: 0, span: 10 }, { default: me(() => [ le(s, { modelValue: i.scale, "onUpdate:modelValue": e[12] || (e[12] = (p) => i.scale = p), step: 0.01, min: 0, max: 5, "show-tooltip": !1, onInput: e[13] || (e[13] = (p) => o.modifyScale()) }, null, 8, ["modelValue"]) ]), _: 1 }), le(a, { offset: 0, span: 6 }, { default: me(() => [ le(c, { modelValue: i.scale, "onUpdate:modelValue": e[14] || (e[14] = (p) => i.scale = p), step: 0.01, min: 0, max: 5, controls: !1, class: "input-box number-input", onChange: e[15] || (e[15] = (p) => o.modifyScale()) }, null, 8, ["modelValue"]) ]), _: 1 }) ]), _: 1 }) ]), _: 1 }) ]), _: 1 }); } const N1 = /* @__PURE__ */ xn(ez, [["render", tz], ["__scopeId", "data-v-6b3997b7"]]), iz = { name: "OpacityControls", components: { Container: Gr, Header: QL, Main: gn, Slider: ar }, props: { material: void 0, zincObject: void 0 }, data: function() { return { displayString: "100%" }; }, watch: { "material.opacity": function() { this.material && this.zincObject && this.zincObject.setAlpha(this.material.opacity); } }, methods: { formatTooltip(i) { return this.displayString = Math.floor(100 * i + 0.5) + "%", this.displayString; } } }, rz = { class: "block" }, nz = { class: "display" }; function oz(i, e, t, r, n, o) { const a = ar, s = Gr; return t.material ? (ge(), Ue(s, { key: 0, class: "opacity-container" }, { default: me(() => [ ke("div", rz, [ ke("span", nz, xt(i.displayString), 1), le(a, { modelValue: t.material.opacity, "onUpdate:modelValue": e[0] || (e[0] = (c) => t.material.opacity = c), class: "my-slider", step: 0.01, min: 0, max: 1, "format-tooltip": o.formatTooltip, "show-tooltip": !1 }, null, 8, ["modelValue", "format-tooltip"]) ]) ]), _: 1 })) : Ve("", !0); } const B1 = /* @__PURE__ */ xn(iz, [["render", oz], ["__scopeId", "data-v-cbfc46a5"]]), az = { name: "PrimitiveControls", components: { Collapse: by, CollapseItem: xy, LinesControls: P1, OpacityControls: B1, PointsControls: I1, TextureSlidesControls: D1, TransformationControls: N1, ElIconArrowRight: Wn }, props: { createData: { type: Object } }, data: function() { return { activeName: "oControls", material: void 0, isTextureSlides: !1, isPointset: !1, isLines: !1, drawerOpen: !0, zincObject: void 0, isEditable: !1, displayString: "100%" }; }, methods: { formatTooltip: function(i) { return this.displayString = Math.floor(100 * i + 0.5) + "%", this.displayString; }, toggleDrawer: function() { this.drawerOpen = !this.drawerOpen; }, setObject: function(i) { var e; i ? this.zincObject = Mi(i) : this.zincObject = void 0, this.isEditable = !!((e = this.zincObject) != null && e.isEditable), this.isPointset = !1, this.isTextureSlides = !1, this.isLines = !1, this.activeName = "trControls", i && (i.isTextureSlides ? (this.isTextureSlides = !0, this.$refs.tSlidesControls.setObject(i), this.activeName = "tsControls") : i.isPointset ? (this.isPointset = !0, this.$refs.pointsetControls.setObject(i), this.activeName = "pControls") : i.isLines2 && (this.isLines = !0, this.$refs.linesControls.setObject(i), this.activeName = "lControls"), i.isTextureSlides || this.$refs.transformationControls.setObject(i)), i && i.getMorph() ? this.material = i.getMorph().material : this.material = void 0; } } }; function sz(i, e, t, r, n, o) { const a = B1, s = xy, c = N1, l = D1, h = I1, u = P1, p = by, g = Wn, m = Dt; return It((ge(), Le("div", { class: Re(["primitive-controls", { open: i.drawerOpen, close: !i.drawerOpen }]) }, [ ke("div", { class: Re(["my-drawer", { open: i.drawerOpen, close: !i.drawerOpen }]) }, [ le(p, { class: "collapse", modelValue: i.activeName, "onUpdate:modelValue": e[2] || (e[2] = (d) => i.activeName = d), accordion: "" }, { default: me(() => [ It(le(s, { title: "Opacity", name: "oControls" }, { default: me(() => [ le(a, { material: i.material, zincObject: i.zincObject, ref: "opacityControls" }, null, 8, ["material", "zincObject"]) ]), _: 1 }, 512), [ [fi, !i.isTextureSlides] ]), It(le(s, { title: "Transformation", name: "trControls" }, { default: me(() => [ le(c, { class: "transformation-controls", ref: "transformationControls" }, null, 512) ]), _: 1 }, 512), [ [fi, !i.isEditable] ]), It(le(s, { title: "Texture Slides", name: "tsControls" }, { default: me(() => [ le(l, { class: "texture-controls", ref: "tSlidesControls" }, null, 512) ]), _: 1 }, 512), [ [fi, i.isTextureSlides] ]), It(le(s, { title: "Points", name: "pControls" }, { default: me(() => [ le(h, { class: "pointset-controls", ref: "pointsetControls", onPrimitivesUpdated: e[0] || (e[0] = (d) => i.$emit("primitivesUpdated", d)) }, null, 512) ]), _: 1 }, 512), [ [fi, i.isPointset] ]), It(le(s, { title: "Lines", name: "lControls" }, { default: me(() => [ le(u, { class: "lines-controls", ref: "linesControls", createData: t.createData, onPrimitivesUpdated: e[1] || (e[1] = (d) => i.$emit("primitivesUpdated", d)) }, null, 8, ["createData"]) ]), _: 1 }, 512), [ [fi, i.isLines] ]) ]), _: 1 }, 8, ["modelValue"]) ], 2), ke("div", { class: Re(["drawer-button", { open: i.drawerOpen, close: !i.drawerOpen }]), onClick: e[3] || (e[3] = (...d) => o.toggleDrawer && o.toggleDrawer(...d)) }, [ le(m, null, { default: me(() => [ le(g) ]), _: 1 }) ], 2) ], 2)), [ [fi, i.material || i.isTextureSlides] ]); } const k1 = /* @__PURE__ */ xn(az, [["render", sz], ["__scopeId", "data-v-764a8efa"]]), lz = (i, e) => { const t = i.label.toUpperCase(), r = e.label.toUpperCase(); return t < r ? -1 : t > r ? 1 : 0; }, cz = { name: "ScaffoldTreeControls", components: { ElIconArrowLeft: jn, TreeControls: rw }, props: { /** * Enable/disable colour picker */ showColourPicker: Boolean, isReady: Boolean }, data: function() { return { treeData: [ { label: "Root", regionPath: "", id: void 0, children: [] } ], active: [], hover: [], drawerOpen: !0, nodeNumbers: 0, module: void 0 }; }, computed: { treeDataEntry: function() { return this.treeData[0].children; } }, watch: { treeDataEntry: { deep: !0, handler: function(i) { this.isReady && this.setColourField(i); } } }, methods: { addTreeItem: function(i, e, t) { i.some((r) => r.label === e.label) || (Object.assign(e, { activeColour: this.getColour(e) }), i.push(e), i.sort((r, n) => lz(r, n)), this.nodeNumbers++, this.$nextTick(() => { !this.$refs.treeControls.$refs.regionTree.getCheckedKeys().includes(e.id) && t.getVisibility() && this.$refs.treeControls.$refs.regionTree.setChecked(e.id, !0); })); }, // find or create new region, region id is always prefixed with // '__r/' findOrCreateRegion: function(i, e, t) { if (this.module && this.module.scene && (this.treeData[0].id = this.module.scene.getRootRegion().uuid, this.treeData[0].isRegion = !0), e.length > 0) { const r = [...e]; let n = i.children.find( (s) => s.label == r[0] ); const o = t + "/" + e[0], a = this.module.scene.getRootRegion().findChildFromPath(o); return n || (n = { label: r[0], id: a.uuid, children: [], regionPath: o, isRegion: !0 }, this.addTreeItem(i.children, n, a), o === "/_helper" && this.$nextTick(() => { this.$refs.treeControls.$refs.regionTree.setChecked(n.id, !1); })), r.shift(), this.findOrCreateRegion(n, r, o); } else return i; }, /** * This is called when a new zinc object is read into the scene. */ zincObjectAdded: function(i) { const e = i.region; if (e) { const t = e.getFullSeparatedPath(), r = this.findOrCreateRegion(this.treeData[0], t, ""); if (i.groupName && r) { r.children || (r.children = []); const n = { label: i.groupName, id: e.uuid + "/" + i.uuid, isPrimitives: !0, regionPath: i.region.getFullPath(), isTextureSlides: !!i.isTextureSlides }; this.addTreeItem(r.children, n, i); } } }, zincObjectRemoved: function(i) { const e = i.groupName; if (i.region.findObjectsWithGroupName(e, !1).length === 0) { const t = i.region.getFullSeparatedPath(), r = this.findOrCreateRegion(this.treeData[0], t, ""); if (r.children) { for (let n = 0; n < r.children.length; n++) if (r.children[n].label === e) { r.children.splice(n, 1), this.nodeNumbers--; return; } } } }, checkChanged: function(i, e) { const t = i.isRegion, r = i.isPrimitives, n = e.checkedKeys.includes(i.id), o = this.module.scene.getRootRegion().findChildFromPath(i.regionPath); t && (n ? o.showAllPrimitives() : o.hideAllPrimitives()), r && o.findObjectsWithGroupName(i.label).forEach((a) => { a.setVisibility(n); }); }, updateActiveUI: function(i) { this.active.length = 0, $v(i, this.active); }, changeActiveByPrimitives: function(i, e) { i && i.length > 0 ? (this.updateActiveUI(i), this.$emit("object-selected", i, e)) : this.removeActive(e), this.removeHover(e); }, updateHoverUI: function(i) { this.hover.length = 0, $v(i, this.hover); }, changeHoverByPrimitives: function(i, e) { i && i.length > 0 ? (this.updateHoverUI(i), this.$emit("object-hovered", i, e)) : this.removeHover(e); }, /** * Select a region by its name. */ changeActiveByNames: function(i, e, t) { const r = this.module.scene.getRootRegion(), n = Aa( r, i, e, !0 ); this.changeActiveByPrimitives(n, t); }, /** * Hover a region by its name. */ changeHoverByNames: function(i, e, t) { const r = this.module.scene.getRootRegion(), n = Aa( r, i, e, !0 ); this.changeHoverByPrimitives(n, t); }, changeActiveByNode: function(i, e) { if (i.isPrimitives || i.isRegion) { const t = !!i.isRegion, r = this.getZincObjectsFromNode(i, t); this.changeActiveByPrimitives(r, e); } }, changeHoverByNode: function(i, e) { if (i.isPrimitives) { const t = this.getZincObjectsFromNode(i, !1); this.changeHoverByPrimitives(t, e); } }, /** * Unselect the current selected region. */ removeActive: function(i) { this.active = [], this.$emit("object-selected", [], i); }, /** * Unselect the current hover region. */ removeHover: function(i) { this.hover = [], this.$emit("object-hovered", [], i); }, /** * Reset the controls. */ clear: function() { this.active.length = 0, this.hover.length = 0, this.nodeNumbers = 0, this.$refs.treeControls.$refs.regionTree.updateKeyChildren( this.treeData[0].id, [] ), this.treeData[0].children.length = 0, this.treeData[0].id = void 0, this.$emit("object-selected", []); }, getColour: function(i) { if (i) { let e = this.getZincObjectsFromNode(i, !1)[0]; if (e) { let t = e.getColourHex(); if (t) return "#" + t; } } return "#FFFFFF"; }, getZincObjectsFromNode: function(i, e) { const t = this.module.scene.getRootRegion(); if (i.isPrimitives) return Aa( t, i.label, i.regionPath, e ); if (i.isRegion && i.regionPath) { let r = t.findChildFromPath(i.regionPath); if (r) return r.getAllObjects(e); } return []; }, //Set this right at the beginning. setModule: function(i) { this.module = Mi(i), this.nodeNumbers = 0, this.module.scene.getRootRegion().getAllObjects(!0).forEach((e) => { this.zincObjectAdded(e); }), this.module.addOrganPartAddedCallback(this.zincObjectAdded), this.module.addOrganPartRemovedCallback(this.zincObjectRemoved); }, setColourField: function(i, e = void 0) { i.filter((t) => e && !t.children ? t.id === e.id : !0).map((t) => { if (t.children) this.setColourField(t.children, e); else { const r = this.getColour(t); t.defaultColour || (t.defaultColour = r), t.activeColour = r; } }); }, setColour: function(i, e) { i && i.isPrimitives && this.getZincObjectsFromNode(i, !1).forEach((t) => { let r = (e || i.defaultColour).replace("#", "0x"); t.setColourHex(r), this.setColourField(this.treeData[0].children, i); }); }, visibilityToggle: function(i, e) { this.module.changeOrganPartsVisibility(i, e), e == !1 && (this.activeRegion === i && this.removeActive(!0), this.hoverRegion === i && this.removeHover(!0)); }, toggleDrawer: function() { this.drawerOpen = !this.drawerOpen, this.$emit("drawer-toggled", this.drawerOpen); }, //Set visibility using full paths and add found id to the ids list //and remove item from list if remove is set to true. setTreeVisibilityWithFullPaths: function(i, e, t, r) { let n = !1, o = ""; i.isRegion && (o = `__r${i.regionPath}`), i.isPrimitives && (o = `${i.regionPath}/${i.label}`); const a = e.indexOf(o); a > -1 && (n = !0, e.splice(a, 1), t.push(i.id)); const s = this.module.scene.getRootRegion().findChildFromPath(i.regionPath); o && o !== "__r" && i.isPrimitives && s.findObjectsWithGroupName(i.label).forEach((c) => c.setVisibility(n)), i.children && i.children.forEach((c) => { this.setTreeVisibilityWithFullPaths(c, e, t, !0); }); }, checkAllKeys: function() { const i = [], e = []; O1(this.treeData[0], i), this.setTreeVisibilityWithFullPaths( this.treeData[0], i, e, !0 ), this.$refs.treeControls.$refs.regionTree.setCheckedKeys(e); }, getState: function() { let i = this.$refs.treeControls.$refs.regionTree.getCheckedKeys(); return i.length === this.nodeNumbers ? { checkAll: !0, version: "2.0" } : { checkedItems: j4( this.module.scene.getRootRegion(), i ), version: "2.0" }; }, setState: function(i) { if (i) { if (i.checkAll) this.checkAllKeys(); else if (i.checkedItems) { let e = []; i.version !== "2.0" ? (e = i.checkedItems.map((r) => "/" + r), e.shift("__r/")) : e.push(...i.checkedItems); const t = []; this.setTreeVisibilityWithFullPaths( this.treeData[0], e, t, !0 ), this.$refs.treeControls.$refs.regionTree.setCheckedKeys(t); } } } } }, uz = { class: "traditional-container" }; function hz(i, e, t, r, n, o) { const a = Ei("TreeControls"), s = jn, c = Dt; return ge(), Le("div", { class: Re(["tree-controls", { open: i.drawerOpen, close: !i.drawerOpen }]) }, [ ke("div", uz, [ le(a, { mapType: "scaffold", title: "Regions", isReady: t.isReady, treeData: o.treeDataEntry, active: i.active, hover: i.hover, showColourPicker: t.showColourPicker, onSetColour: o.setColour, onCheckChanged: o.checkChanged, onChangeActive: o.changeActiveByNode, onChangeHover: o.changeHoverByNode, ref: "treeControls" }, null, 8, ["isReady", "treeData", "active", "hover", "showColourPicker", "onSetColour", "onCheckChanged", "onChangeActive", "onChangeHover"]) ]), ke("div", { class: Re(["drawer-button", { open: i.drawerOpen, close: !i.drawerOpen }]), onClick: e[0] || (e[0] = (...l) => o.toggleDrawer && o.toggleDrawer(...l)) }, [ le(c, null, { default: me(() => [ le(s) ]), _: 1 }) ], 2) ], 2); } const z1 = /* @__PURE__ */ xn(cz, [["render", hz], ["__scopeId", "data-v-13a8c030"]]); var dz = !1; function Pc(i, e, t) { return Array.isArray(i) ? (i.length = Math.max(i.length, e), i.splice(e, 1, t), t) : (i[e] = t, t); } function Wh(i, e) { if (Array.isArray(i)) { i.splice(e, 1); return; } delete i[e]; } /*! * pinia v2.2.1 * (c) 2024 Eduardo San Martin Morote * @license MIT */ let Ns; const nu = (i) => Ns = i, pz = process.env.NODE_ENV !== "production" ? Symbol("pinia") : ( /* istanbul ignore next */ Symbol() ); function Vo(i) { return i && typeof i == "object" && Object.prototype.toString.call(i) === "[object Object]" && typeof i.toJSON != "function"; } var js; (function(i) { i.direct = "direct", i.patchObject = "patch object", i.patchFunction = "patch function"; })(js || (js = {})); const Bs = typeof window < "u"; function F1(i, e) { for (const t in e) { const r = e[t]; if (!(t in i)) continue; const n = i[t]; Vo(n) && Vo(r) && !Ro(r) && !op(r) ? i[t] = F1(n, r) : i[t] = r; } return i; } const V1 = () => { }; function Yv(i, e, t, r = V1) { i.push(e); const n = () => { const o = i.indexOf(e); o > -1 && (i.splice(o, 1), r()); }; return !t && c0() && u0(n), n; } function va(i, ...e) { i.slice().forEach((t) => { t(...e); }); } const fz = (i) => i(), Jv = Symbol(), $h = Symbol(); function Yd(i, e) { i instanceof Map && e instanceof Map ? e.forEach((t, r) => i.set(r, t)) : i instanceof Set && e instanceof Set && e.forEach(i.add, i); for (const t in e) { if (!e.hasOwnProperty(t)) continue; const r = e[t], n = i[t]; Vo(n) && Vo(r) && i.hasOwnProperty(t) && !Ro(r) && !op(r) ? i[t] = Yd(n, r) : i[t] = r; } return i; } const mz = process.env.NODE_ENV !== "production" ? Symbol("pinia:skipHydration") : ( /* istanbul ignore next */ Symbol() ); function gz(i) { return !Vo(i) || !i.hasOwnProperty(mz); } const { assign: Qi } = Object; function Kv(i) { return !!(Ro(i) && i.effect); } function Qv(i, e, t, r) { const { state: n, actions: o, getters: a } = e, s = t.state.value[i]; let c; function l() { !s && (process.env.NODE_ENV === "production" || !r) && (t.state.value[i] = n ? n() : {}); const h = process.env.NODE_ENV !== "production" && r ? ( // use ref() to unwrap refs inside state TODO: check if this is still necessary ln(Ae(n ? n() : {}).value) ) : ln(t.state.value[i]); return Qi(h, o, Object.keys(a || {}).reduce((u, p) => (process.env.NODE_ENV !== "production" && p in h && console.warn(`[🍍]: A getter cannot have the same name as another state property. Rename one of them. Found with "${p}" in store "${i}".`), u[p] = Mi(ce(() => { nu(t); const g = t._s.get(i); return a[p].call(g, g); })), u), {})); } return c = Jd(i, l, e, t, r, !0), c; } function Jd(i, e, t = {}, r, n, o) { let a; const s = Qi({ actions: {} }, t); if (process.env.NODE_ENV !== "production" && !r._e.active) throw new Error("Pinia destroyed"); const c = { deep: !0 }; process.env.NODE_ENV !== "production" && !dz && (c.onTrigger = (_) => { l ? g = _ : l == !1 && !w._hotUpdating && (Array.isArray(g) ? g.push(_) : console.error("🍍 debuggerEvents should be an array. This is most likely an internal Pinia bug.")); }); let l, h, u = [], p = [], g; const m = r.state.value[i]; !o && !m && (process.env.NODE_ENV === "production" || !n) && (r.state.value[i] = {}); const d = Ae({}); let y; function f(_) { let E; l = h = !1, process.env.NODE_ENV !== "production" && (g = []), typeof _ == "function" ? (_(r.state.value[i]), E = { type: js.patchFunction, storeId: i, events: g }) : (Yd(r.state.value[i], _), E = { type: js.patchObject, payload: _, storeId: i, events: g }); const O = y = Symbol(); wt().then(() => { y === O && (l = !0); }), h = !0, va(u, E, r.state.value[i]); } const v = o ? function() { const { state: _ } = t, E = _ ? _() : {}; this.$patch((O) => { Qi(O, E); }); } : ( /* istanbul ignore next */ process.env.NODE_ENV !== "production" ? () => { throw new Error(`🍍: Store "${i}" is built using the setup syntax and does not implement $reset().`); } : V1 ); function M() { a.stop(), u = [], p = [], r._s.delete(i); } const S = (_, E = "") => { if (Jv in _) return _[$h] = E, _; const O = function() { nu(r); const L = Array.from(arguments), C = [], I = []; function R(N) { C.push(N); } function b(N) { I.push(N); } va(p, { args: L, name: O[$h], store: w, after: R, onError: b }); let P; try { P = _.apply(this && this.$id === i ? this : w, L); } catch (N) { throw va(I, N), N; } return P instanceof Promise ? P.then((N) => (va(C, N), N)).catch((N) => (va(I, N), Promise.reject(N))) : (va(C, P), P); }; return O[Jv] = !0, O[$h] = E, O; }, T = /* @__PURE__ */ Mi({ actions: {}, getters: {}, state: [], hotState: d }), x = { _p: r, // _s: scope, $id: i, $onAction: Yv.bind(null, p), $patch: f, $reset: v, $subscribe(_, E = {}) { const O = Yv(u, _, E.detached, () => L()), L = a.run(() => Ke(() => r.state.value[i], (C) => { (E.flush === "sync" ? h : l) && _({ storeId: i, type: js.direct, events: g }, C); }, Qi({}, c, E))); return O; }, $dispose: M }, w = Xi(process.env.NODE_ENV !== "production" || process.env.NODE_ENV !== "production" && process.env.NODE_ENV !== "test" && Bs ? Qi( { _hmrPayload: T, _customProperties: Mi(/* @__PURE__ */ new Set()) // devtools custom properties }, x // must be added later // setupStore ) : x); r._s.set(i, w); const A = (r._a && r._a.runWithContext || fz)(() => r._e.run(() => (a = _w()).run(() => e({ action: S })))); for (const _ in A) { const E = A[_]; if (Ro(E) && !Kv(E) || op(E)) process.env.NODE_ENV !== "production" && n ? Pc(d.value, _, Di(A, _)) : o || (m && gz(E) && (Ro(E) ? E.value = m[_] : Yd(E, m[_])), r.state.value[i][_] = E), process.env.NODE_ENV !== "production" && T.state.push(_); else if (typeof E == "function") { const O = process.env.NODE_ENV !== "production" && n ? E : S(E, _); A[_] = O, process.env.NODE_ENV !== "production" && (T.actions[_] = E), s.actions[_] = E; } else process.env.NODE_ENV !== "production" && Kv(E) && (T.getters[_] = o ? ( // @ts-expect-error t.getters[_] ) : E, Bs && (A._getters || // @ts-expect-error: same (A._getters = Mi([]))).push(_)); } if (Qi(w, A), Qi(np(w), A), Object.defineProperty(w, "$state", { get: () => process.env.NODE_ENV !== "production" && n ? d.value : r.state.value[i], set: (_) => { if (process.env.NODE_ENV !== "production" && n) throw new Error("cannot set hotState"); f((E) => { Qi(E, _); }); } }), process.env.NODE_ENV !== "production" && (w._hotUpdate = Mi((_) => { w._hotUpdating = !0, _._hmrPayload.state.forEach((E) => { if (E in w.$state) { const O = _.$state[E], L = w.$state[E]; typeof O == "object" && Vo(O) && Vo(L) ? F1(O, L) : _.$state[E] = L; } Pc(w, E, Di(_.$state, E)); }), Object.keys(w.$state).forEach((E) => { E in _.$state || Wh(w, E); }), l = !1, h = !1, r.state.value[i] = Di(_._hmrPayload, "hotState"), h = !0, wt().then(() => { l = !0; }); for (const E in _._hmrPayload.actions) { const O = _[E]; Pc(w, E, S(O, E)); } for (const E in _._hmrPayload.getters) { const O = _._hmrPayload.getters[E], L = o ? ( // special handling of options api ce(() => (nu(r), O.call(w, w))) ) : O; Pc(w, E, L); } Object.keys(w._hmrPayload.getters).forEach((E) => { E in _._hmrPayload.getters || Wh(w, E); }), Object.keys(w._hmrPayload.actions).forEach((E) => { E in _._hmrPayload.actions || Wh(w, E); }), w._hmrPayload = _._hmrPayload, w._getters = _._getters, w._hotUpdating = !1; })), process.env.NODE_ENV !== "production" && process.env.NODE_ENV !== "test" && Bs) { const _ = { writable: !0, configurable: !0, // avoid warning on devtools trying to display this property enumerable: !1 }; ["_p", "_hmrPayload", "_getters", "_customProperties"].forEach((E) => { Object.defineProperty(w, E, Qi({ value: w[E] }, _)); }); } return r._p.forEach((_) => { if (process.env.NODE_ENV !== "production" && process.env.NODE_ENV !== "test" && Bs) { const E = a.run(() => _({ store: w, app: r._a, pinia: r, options: s })); Object.keys(E || {}).forEach((O) => w._customProperties.add(O)), Qi(w, E); } else Qi(w, a.run(() => _({ store: w, app: r._a, pinia: r, options: s }))); }), process.env.NODE_ENV !== "production" && w.$state && typeof w.$state == "object" && typeof w.$state.constructor == "function" && !w.$state.constructor.toString().includes("[native code]") && console.warn(`[🍍]: The "state" must be a plain object. It cannot be state: () => new MyClass() Found in store "${w.$id}".`), m && o && t.hydrate && t.hydrate(w.$state, m), l = !0, h = !0, w; } function vz(i, e, t) { let r, n; const o = typeof e == "function"; r = i, n = o ? t : e; function a(s, c) { const l = ww(); if (s = // in test mode, ignore the argument provided as we can always retrieve a // pinia instance with getActivePinia() (process.env.NODE_ENV === "test" && Ns && Ns._testing ? null : s) || (l ? ct(pz, null) : null), s && nu(s), process.env.NODE_ENV !== "production" && !Ns) throw new Error(`[🍍]: "getActivePinia()" was called but there was no active Pinia. Are you trying to use a store before calling "app.use(pinia)"? See https://pinia.vuejs.org/core-concepts/outside-component-usage.html for help. This will fail in production.`); s = Ns, s._s.has(r) || (o ? Jd(r, e, n, s) : Qv(r, n, s), process.env.NODE_ENV !== "production" && (a._pinia = s)); const h = s._s.get(r); if (process.env.NODE_ENV !== "production" && c) { const u = "__hot:" + r, p = o ? Jd(u, e, n, s, !0) : Qv(u, Qi({}, n), s, !0); c._hotUpdate(p), delete s.state.value[u], s._s.delete(u); } if (process.env.NODE_ENV !== "production" && Bs) { const u = ri(); if (u && u.proxy && // avoid adding stores that are just built for hot module replacement !c) { const p = u.proxy, g = "_pStores" in p ? p._pStores : p._pStores = {}; g[r] = h; } } return h; } return a.$id = r, a; } function U1(i, e) { return Array.isArray(e) ? e.reduce((t, r) => (t[r] = function() { return i(this.$pinia)[r]; }, t), {}) : Object.keys(e).reduce((t, r) => (t[r] = function() { const n = i(this.$pinia), o = e[r]; return typeof o == "function" ? o.call(this, n) : n[o]; }, t), {}); } const G1 = vz("main", { state: () => ({ userProfile: { token: "" } }), getters: { userToken(i) { return i.userProfile.token; } }, actions: { setUserToken(i) { this.userProfile.token = i; } } }), yz = { name: "ScaffoldTooltip", components: { Col: _r, CreateTooltipContent: K1, ElIconDelete: Xc, Icon: Dt, Popover: _u, Row: Ur, Tooltip: Q1 }, props: { createData: { type: Object, default: { toBeConfirmed: !1, points: [], shape: "", x: 0, y: 0 } }, label: { type: String, default: "" }, annotationDisplay: { type: Boolean, default: !1 }, region: { type: String, default: "" }, visible: { type: Boolean, default: !1 }, x: { type: Number, default: 200 }, y: { type: Number, default: 200 } }, inject: ["scaffoldUrl"], provide() { return { userApiKey: this.userToken }; }, data: function() { return { display: !1, annotationEntry: {}, ElIconDelete: Ci(Xc) }; }, computed: { ...U1(G1, ["userToken"]), position: function() { let i = 40; return this.region && (i = 55), { left: this.x - 40 + "px", top: this.y - i + "px" }; } }, methods: { checkForDisplay: function() { if (this.visible && this.label && this.label !== "") { if (this.display = !0, this.annotationDisplay) { const i = this.region ? this.region + "/" : ""; this.annotationEntry = { featureId: i + this.label, resourceId: this.scaffoldUrl, resource: this.scaffoldUrl }; } } else this.display = !1, this.annotationEntry = {}; }, hideTriggered: function() { this.$emit("tooltip-hide"); } }, watch: { label: { handler: function() { this.checkForDisplay(); }, immediate: !0 }, visible: { handler: function() { this.checkForDisplay(); }, immediate: !0 }, annotationDisplay: { handler: function() { this.checkForDisplay(); }, immediate: !0 } } }, bz = { class: "tooltip-text" }, xz = { key: 0, class: "tooltip-text" }, wz = { key: 1, class: "delete-container" }; function _z(i, e, t, r, n, o) { const a = Ei("CreateTooltipContent"), s = Ei("Tooltip"), c = _r, l = os, h = Ur, u = _u; return ge(), Le("div", { style: Ot(o.position), class: "region-tooltip" }, [ le(u, { ref: "tooltip", visible: t.visible, placement: "top", "show-arrow": !1, teleported: !1, trigger: "manual", "popper-class": "tooltip-popper non-selectable", "virtual-triggering": "", onHide: o.hideTriggered }, { default: me(() => [ ke("div", bz, xt(t.label), 1), t.region ? (ge(), Le("div", xz, "Region: " + xt(t.region), 1)) : Ve("", !0), It(le(a, { createData: t.createData, onConfirmCreate: e[0] || (e[0] = (p) => i.$emit("confirm-create", p)), onCancelCreate: e[1] || (e[1] = (p) => i.$emit("cancel-create")) }, null, 8, ["createData"]), [ [fi, t.createData.toBeConfirmed] ]), It(le(s, { class: "p-tooltip", ref: "annotationTooltip", annotationDisplay: !0, annotationEntry: i.annotationEntry }, null, 8, ["annotationEntry"]), [ [fi, t.annotationDisplay && !t.createData.toBeConfirmed] ]), t.createData.toBeDeleted ? (ge(), Le("div", wz, [ le(h, null, { default: me(() => [ le(c, { span: 10 }, { default: me(() => [ vt("Delete this feature?") ]), _: 1 }), le(c, { span: 7 }, { default: me(() => [ le(l, { class: "delete-button", icon: i.ElIconDelete, onClick: e[2] || (e[2] = (p) => i.$emit("confirm-delete")) }, { default: me(() => [ vt(" Delete ") ]), _: 1 }, 8, ["icon"]) ]), _: 1 }), le(c, { span: 6 }, { default: me(() => [ le(l, { class: "delete-button", onClick: e[3] || (e[3] = (p) => i.$emit("cancel-create")) }, { default: me(() => [ vt(" Dismiss ") ]), _: 1 }) ]), _: 1 }) ]), _: 1 }) ])) : Ve("", !0) ]), _: 1 }, 8, ["visible", "onHide"]) ], 4); } const H1 = /* @__PURE__ */ xn(yz, [["render", _z], ["__scopeId", "data-v-e665391a"]]); /*! js-cookie v3.0.5 | MIT */ function Ic(i) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) i[r] = t[r]; } return i; } var Mz = { read: function(i) { return i[0] === '"' && (i = i.slice(1, -1)), i.replace(/(%[\dA-F]{2})+/gi, decodeURIComponent); }, write: function(i) { return encodeURIComponent(i).replace( /%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g, decodeURIComponent ); } }; function Kd(i, e) { function t(n, o, a) { if (!(typeof document > "u")) { a = Ic({}, e, a), typeof a.expires == "number" && (a.expires = new Date(Date.now() + a.expires * 864e5)), a.expires && (a.expires = a.expires.toUTCString()), n = encodeURIComponent(n).replace(/%(2[346B]|5E|60|7C)/g, decodeURIComponent).replace(/[()]/g, escape); var s = ""; for (var c in a) a[c] && (s += "; " + c, a[c] !== !0 && (s += "=" + a[c].split(";")[0])); return document.cookie = n + "=" + i.write(o, n) + s; } } function r(n) { if (!(typeof document > "u" || arguments.length && !n)) { for (var o = document.cookie ? document.cookie.split("; ") : [], a = {}, s = 0; s < o.length; s++) { var c = o[s].split("="), l = c.slice(1).join("="); try { var h = decodeURIComponent(c[0]); if (a[h] = i.read(l, h), n === h) break; } catch { } } return n ? a[n] : a; } } return Object.create( { set: t, get: r, remove: function(n, o) { t( n, "", Ic({}, o, { expires: -1 }) ); }, withAttributes: function(n) { return Kd(this.converter, Ic({}, this.attributes, n)); }, withConverter: function(n) { return Kd(Ic({}, this.converter, n), this.attributes); } }, { attributes: { value: Object.freeze(e) }, converter: { value: Object.freeze(i) } } ); } var Qd = Kd(Mz, { path: "/" }), Sr = function(i, e, t, r, n) { if (typeof e == "function" ? i !== e || !n : !e.has(i)) throw new TypeError("Cannot write private member to an object whose class did not declare it"); return e.set(i, t), t; }, Ft = function(i, e, t, r) { if (t === "a" && !r) throw new TypeError("Private accessor was defined without a getter"); if (typeof e == "function" ? i !== e || !r : !e.has(i)) throw new TypeError("Cannot read private member from an object whose class did not declare it"); return t === "m" ? r : t === "a" ? r.call(i) : r ? r.value : e.get(i); }, Yr, Ws, Tr, _i, In; const Sz = 1e4; class Tz { /** * @param serverEndpoint The URL of a map annotation service. */ constructor(e) { Yr.add(this), Ws.set(this, void 0), Tr.set(this, null), _i.set( this, null /** * @param serverEndpoint The URL of a map annotation service. */ ), e.slice(-1) === "/" ? Sr(this, Ws, e.slice(0, -1)) : Sr(this, Ws, e); } /** * Get information about the logged-in SPARC user. * * Requires {@linkcode authenticate} to first be called. */ get currentUser() { return Ft(this, Tr, "f"); } /** * Get information about any error from the last call * to {@linkcode authenticate}. */ get currentError() { return Ft(this, _i, "f"); } /** * Authenticate the logged-in SPARC user. * * @param userApiKey The Api token of the logged-in Pennsieve user * @return A Promise resolving to either data about a valid user * or a reason why the user is invalid. */ async authenticate(e) { Sr(this, _i, null), Sr(this, Tr, null); const t = await Ft(this, Yr, "m", In).call(this, e, "authenticate"); return "error" in t ? (Qd.remove("annotation-key"), Promise.resolve(Ft(this, _i, "f"))) : (Qd.set("annotation-key", t.session, { secure: !0, expires: 1 }), Sr(this, Tr, t.data), Promise.resolve(Ft(this, Tr, "f"))); } /** * Unauthenticate with the annotation service. * * @param userApiKey The Api token of the logged-in Pennsieve user * @return A Promise with data about the call. */ async unauthenticate(e) { Sr(this, _i, null), Sr(this, Tr, null); const t = await Ft(this, Yr, "m", In).call(this, e, "unauthenticate"); return "success" in t ? Promise.resolve(t) : Promise.resolve(Ft(this, _i, "f")); } /** * Get identifiers of all annotated items in a resource. * * @param userApiKey The Api token of the logged-in Pennsieve user * @param resourceId The resource's identifier * @param userId A user identifier (ORCID). Optional * @param participated Get items the user was involved in annotating or not. * Optional, default ``true`` * @return A Promise resolving to either a list of identifiers of annotated * items or a reason why identifiers couldn't be retrieved. */ async annotatedItemIds(e, t, r, n) { const o = { resource: t }; r !== void 0 && (o.user = r), n !== void 0 && (o.participated = n); const a = await Ft(this, Yr, "m", In).call(this, e, "items/", "GET", o); return "error" in a ? Promise.resolve(Ft(this, _i, "f")) : Promise.resolve(a); } /** * Get all annotated features drawn on a resource. * * @param userApiKey The Api token of the logged-in Pennsieve user * @param resourceId The resource's identifier * @return A Promise resolving to either a list of annotated * features drawn on the resource or a reason why * features couldn't be retrieved. */ async drawnFeatures(e, t, r) { const n = { resource: t }; r !== void 0 && (n.items = r); const o = await Ft(this, Yr, "m", In).call(this, e, "features/", "GET", n); return "error" in o ? Promise.resolve(Ft(this, _i, "f")) : Promise.resolve(o); } /** * Get all annotations about a specific item in a resource. * * @param userApiKey The Api token of the logged-in Pennsieve user * @param resourceId The resource's identifier * @param itemId The item's identifier within the resource * @return A Promise resolving to either a list of * annotations about the item or a reason * why annotations couldn't be retrieved. */ async itemAnnotations(e, t, r) { const n = await Ft(this, Yr, "m", In).call(this, e, "annotations/", "GET", { resource: t, item: r }); return "error" in n ? Promise.resolve(Ft(this, _i, "f")) : Promise.resolve(n); } /** * Get details of a specific annotation. * * @param userApiKey The Api token of the logged-in Pennsieve user * @param annotationId The annotation's URI * @return A Promise resolving to either an annotation * with the given URI or a reason why the * annotation couldn't be retrieved. */ async annotation(e, t) { const r = await Ft(this, Yr, "m", In).call(this, e, "annotation/", "GET", { annotation: t }); return "error" in r ? Promise.resolve(Ft(this, _i, "f")) : Promise.resolve(r); } /** * Add an annotation about a specific item in a resource. * * @param userApiKey The Api token of the logged-in Pennsieve user * @param annotation Annotation about the feature * @return A Promise resolving to either the resulting * full annotation or a reason why the * annotation couldn't be added */ async addAnnotation(e, t) { if (Ft(this, Tr, "f") && Ft(this, Tr, "f").canUpdate) { const r = Object.assign({ creator: Ft(this, Tr, "f"), created: (/* @__PURE__ */ new Date()).toISOString() }, t), n = await Ft(this, Yr, "m", In).call(this, e, "annotation/", "POST", { data: r }); if (!("error" in n)) return Promise.resolve(n); Sr(this, _i, n); } else Sr(this, _i, { error: "user cannot add annotation" }); return Promise.resolve(Ft(this, _i, "f")); } } Ws = /* @__PURE__ */ new WeakMap(), Tr = /* @__PURE__ */ new WeakMap(), _i = /* @__PURE__ */ new WeakMap(), Yr = /* @__PURE__ */ new WeakSet(), In = async function(i, e, t = "GET", r = {}) { let n = !0; const o = new AbortController(); setTimeout(() => { n && (console.log("Annotation server timeout..."), o.abort()); }, Sz); const a = { method: t, signal: o.signal }; let s = `${Ft(this, Ws, "f")}/${e}`; const c = Qd.get("annotation-key") || ""; if (t === "GET") { const h = []; for (const [u, p] of Object.entries(r)) h.push(`${u}=${encodeURIComponent(JSON.stringify(p))}`); h.push(`key=${encodeURIComponent(i)}`), h.push(`session=${encodeURIComponent(c)}`), s += "?" + h.join("&"), a.headers = { Accept: "application/json; charset=utf-8", "Cache-Control": "no-store" }; } else if (t === "POST") { const h = Object.assign({ key: i, session: c }, r); a.body = JSON.stringify(h), a.headers = { Accept: "application/json; charset=utf-8", "Content-Type": "application/json; charset=utf-8", "Cache-Control": "no-store" }; } const l = await fetch(s, a); return n = !1, l.ok ? Promise.resolve(await l.json()) : (Sr(this, _i, { error: `${l.status} ${l.statusText}` }), Promise.resolve(Ft(this, _i, "f"))); }; const ul = { ALL: 0, SELECTED: 1, HIGHLIGHTED: 2, MOVE: 3 }, Ez = function(i, e, t) { this.eventType = i, this.identifiers = e, this.zincObjects = t; }, Az = function(i, e, t) { this.targetedID = []; const r = i, n = e; this.targetEventType = t; const o = this; t === void 0 && (this.targetEventType = ul.ALL), this.getEventType = function() { return t; }, this.notify = function(a, s, c, l) { if (a !== r && (o.targetEventType === ul.ALL || o.targetEventType === s)) { const h = new Ez(s, c, l); n(h); } }; }, Cz = function() { const i = []; this.publish = function(e, t, r, n) { for (let o = 0; o < i.length; o++) i[o].notify(e, t, r, n); }, this.subscribe = function(e, t, r) { if (typeof t == "function") { const n = new Az(e, t, r); return i.push(n), n; } }, this.unsubscribe = function(e) { for (let t = 0; t < i.length; t++) if (e === i[t]) { i.splice(t, 1); return; } }; }, e0 = { isWebGLAvailable: function() { try { var i = document.createElement("canvas"); return !!(window.WebGLRenderingContext && (i.getContext("webgl") || i.getContext("experimental-webgl"))); } catch { return !1; } }, isWebGL2Available: function() { try { var i = document.createElement("canvas"); return !!(window.WebGL2RenderingContext && i.getContext("webgl2")); } catch { return !1; } }, getWebGLErrorMessage: function() { return this.getErrorMessage(1); }, getWebGL2ErrorMessage: function() { return this.getErrorMessage(2); }, getErrorMessage: function(i) { var e = { 1: "WebGL", 2: "WebGL 2" }, t = { 1: window.WebGLRenderingContext, 2: window.WebGL2RenderingContext }, r = 'This module requires $1 support but your $0 does not seem to support it.', n = document.createElement("div"); return n.id = "webglmessage", n.style.fontFamily = "monospace", n.style.fontSize = "20px", n.style.fontWeight = "normal", n.style.textAlign = "center", n.style.background = "#fff", n.style.color = "#000", n.style.padding = "1.5em", n.style.width = "400px", n.style.margin = "5em auto 0", t[i] ? r = r.replace("$0", "graphics card") : r = r.replace("$0", "browser"), r = r.replace("$1", e[i]), n.innerHTML = r, n; } }, Bf = { ALL: 0, DESTROYED: 1, NAME_CHANGED: 2, SETTINGS_CHANGED: 3 }, Ji = function() { this.typeName = "Base Module", this.instanceName = "default", this.onChangedCallbacks = [], this.eventNotifiers = []; }; Ji.prototype.setName = function(i) { if (i && this.instanceName !== i) { this.instanceName = i; const e = this.onChangedCallbacks.slice(); for (let t = 0; t < e.length; t++) e[t](this, Bf.NAME_CHANGED); } }; Ji.prototype.settingsChanged = function() { const i = this.onChangedCallbacks.slice(); for (let e = 0; e < i.length; e++) i[e](this, Bf.SETTINGS_CHANGED); }; Ji.prototype.exportSettings = function() { const i = {}; return i.dialog = this.typeName, i.name = this.instanceName, i; }; Ji.prototype.importSettings = function(i) { return i.dialog == this.typeName ? (this.setName(i.name), !0) : !1; }; Ji.prototype.publishChanges = function(i, e, t) { for (let r = 0; r < this.eventNotifiers.length; r++) this.eventNotifiers[r].publish(this, e, i, t); }; Ji.prototype.getName = function() { return this.instanceName; }; Ji.prototype.destroy = function() { const i = this.onChangedCallbacks.slice(); for (let e = 0; e < i.length; e++) i[e](this, Bf.DESTROYED); delete this; }; Ji.prototype.addChangedCallback = function(i) { this.onChangedCallbacks.includes(i) == !1 && this.onChangedCallbacks.push(i); }; Ji.prototype.removeChangedCallback = function(i) { const e = this.onChangedCallbacks.indexOf(i); e > -1 && this.onChangedCallbacks.splice(e, 1); }; Ji.prototype.addNotifier = function(i) { this.eventNotifiers.push(i); }; const Dc = (i, e, t) => { for (let r = 0; r < i.length; r++) if (i[r] && i[r].material && i[r].material.emissive) { let n = i[r].userData; n && n.isZincObject ? n.setEmissiveRGB(e) : i[r].material && i[r].material.emissive && i[r].material.emissive.setRGB(...e), t && i[r].material.depthFunc && (i[r].material.depthFunc = zn.THREE.LessEqualDepth), i[r].children.forEach((o) => { const a = o.userData; a && a.isZincObject && o.material && o.material.emissive && o.material.emissive.setRGB(...e); }); } }, Lz = function() { let i = [], e = []; this.highlightColour = [1, 0, 0], this.selectColour = [0, 1, 0], this.originalColour = [0, 0, 0]; const t = [], r = [], n = this, o = function(c, l) { if (c.length == 0 && l.length == 0) return !1; for (let h = 0; h < c.length; h++) { let u = !1; for (let p = 0; p < l.length; p++) c[h] === l[p] && (u = !0); if (!u) return !0; } for (let h = 0; h < l.length; h++) { let u = !1; for (let p = 0; p < c.length; p++) l[h] === c[p] && (u = !0); if (!u) return !0; } return !1; }, a = function(c, l) { if (t.length = 0, l.length == 0) return c; for (let h = 0; h < c.length; h++) { let u = !1; for (let p = 0; p < l.length; p++) c[h] === l[p] && (u = !0); u || t.push(c[h]); } return t; }; this.setHighlighted = function(c) { const l = [...i]; n.resetHighlighted(); const h = a(c, e), u = s(h); return Dc(u, n.highlightColour, !1), i = h, o(i, l); }, this.setSelected = function(c) { const l = [...e]; n.resetHighlighted(), n.resetSelected(); const h = s(c); return Dc(h, n.selectColour, !1), e = c, o(e, l); }; const s = function(c) { r.length = 0; for (let l = 0; l < c.length; l++) c[l].material && r.push(c[l]); return r; }; this.resetHighlighted = function() { const c = s(i); Dc(c, n.originalColour, !0), i = []; }, this.resetSelected = function() { const c = s(e); Dc(c, n.originalColour, !0), e = []; }, this.getSelected = function() { return e; }, this.reset = function() { n.resetSelected(), n.resetHighlighted(); }; }, kf = Gc.THREE, Rz = function() { const i = document.createElement("div"); let e; if (i.style.height = "100%", e0.isWebGLAvailable()) e = new Gc.Renderer(i, window), Gc.defaultMaterialColor = 16777116, e.initialiseVisualisation(), e.playAnimation = !1; else { const t = e0.getWebGLErrorMessage(); i.appendChild(t); } return { Zinc: Gc, renderer: e, container: i }; }, Gt = function() { Ji.call(this), this.scene = void 0, this.rendererContainer = void 0, this.displayArea = void 0, this.graphicsHighlight = new Lz(), this.selectObjectOnPick = !0, this.zincRenderer = null, this.selectedScreenCoordinates = new kf.Vector3(), this.selectedCenter = void 0, this.liveUpdatesObjects = void 0, this.ignorePreviousSelected = !1; }; Gt.prototype = Object.create(Ji.prototype); Gt.prototype.getIntersectedObject = function(i) { if (i) { const e = i.map((r) => { if (r && r.object && r.object.userData) { if (r.object.userData.isMarker) return 1; if (r.object.name && r.object.userData.isZincObject) return 2; } return 0; }); let t = e.indexOf(1); return t = t > -1 ? t : e.indexOf(2), i[t]; } }; Gt.prototype.getAnnotationsFromObjects = function(i) { const e = []; for (var t = 0; t < i.length; t++) { const r = i[t].userData; let n; if (r) { if (r.isGlyph || r.isGlyphset) { let o = r; r.isGlyph && (o = r.getGlyphset()), n = o.userData ? o.userData.annotation : void 0, n && n.data && (i[t].name && i[t].name != "" ? n.data.id = i[t].name : n.data.id = o.groupName); } else n = r.userData ? r.userData.annotation : void 0, n && n.data && (n.data.id = i[t].name); n && (n.data.zincObject = r); } n && e.push(n); } return e; }; Gt.prototype.setHighlightedByObjects = function(i, e, t, r) { const n = this.graphicsHighlight.setHighlighted(i), o = this.objectsToZincObjects(i); if (r) { let a = ul.MOVE; n && (a = ul.HIGHLIGHTED); const s = this.getAnnotationsFromObjects(i); s.length > 0 && (s[0].coords = e, s[0].extraData = t), this.publishChanges(s, a, o); } return n; }; Gt.prototype.setHighlightedByZincObjects = function(i, e, t, r) { let n = []; return i && i.forEach((o) => { o && o.getMorph() && n.push(o.getMorph()); }), this.setHighlightedByObjects(n, e, t, r); }; Gt.prototype.setupLiveCoordinates = function(i) { if (this.liveUpdatesObjects = i, i && i.length > 0) { const e = this.scene.getBoundingBoxOfZincObjects(i); let t = new kf.Vector3(); e ? (e.getCenter(t), this.selectedCenter == null ? this.selectedCenter = t : this.selectedCenter.copy(t)) : this.selectedCenter = void 0; } else this.selectedCenter = void 0; }; Gt.prototype.objectsToZincObjects = function(i) { const e = []; for (let t = 0; t < i.length; t++) { let r = i[t].userData; if (r) if (r.isGlyph || r.isGlyphset) { let n = r; r.isGlyph && (n = r.getGlyphset()), e.push(n); } else e.push(r); } return e; }; Gt.prototype.setSelectedByObjects = function(i, e, t, r) { let n = !1; if (this.selectObjectOnPick ? n = this.graphicsHighlight.setSelected(i) : n = !0, n || this.ignorePreviousSelected) { const o = this.objectsToZincObjects(i); if (this.selectObjectOnPick && this.setupLiveCoordinates(o), r) { const a = ul.SELECTED, s = this.getAnnotationsFromObjects(i); s.length > 0 && (s[0].coords = e, s[0].extraData = t), this.publishChanges(s, a, o); } } return n; }; Gt.prototype.setSelectedByZincObjects = function(i, e, t, r) { let n = []; return i && i.forEach((o) => { if (o) { const a = o.getMorph(); a && n.push(a); } }), this.setSelectedByObjects(n, e, t, r); }; Gt.prototype.findObjectsByGroupName = function(i) { return this.scene.findObjectsWithGroupName(i); }; Gt.prototype.setHighlightedByGroupName = function(i, e) { const t = this.findObjectsByGroupName(i); return this.setHighlightedByObjects(t, void 0, {}, e); }; Gt.prototype.setSelectedByGroupName = function(i, e) { const t = this.findObjectsByGroupName(i); return this.setSelectedByObjects(t, void 0, {}, e); }; Gt.prototype.changeBackgroundColour = function(i) { const e = new kf.Color(i); this.zincRenderer && this.zincRenderer.getThreeJSRenderer().setClearColor(e, 1); }; Gt.prototype.resetView = function() { this.zincRenderer && this.zincRenderer.resetView(); }; Gt.prototype.viewAll = function() { this.zincRenderer && this.zincRenderer.viewAll(); }; Gt.prototype.playAnimation = function(i) { this.zincRenderer && (this.zincRenderer.playAnimation = i); }; Gt.prototype.setPlayRate = function(i) { this.zincRenderer && this.zincRenderer.setPlayRate(i); }; Gt.prototype.getPlayRate = function(i) { return this.zincRenderer ? this.zincRenderer.getPlayRate() : 0; }; Gt.prototype.initialiseRenderer = function(i) { if (this.zincRenderer === void 0 || this.rendererContainer === void 0) { let e = Rz(); this.Zinc = e.Zinc, this.zincRenderer = e.renderer, this.rendererContainer = e.container; } i && (this.displayArea = i, this.displayArea.appendChild(this.rendererContainer), this.zincRenderer && this.zincRenderer.animate()); }; Gt.prototype.destroy = function() { this.zincRenderer && (this.zincRenderer.dispose(), this.zincRenderer.getThreeJSRenderer().dispose(), this.zincRenderer = void 0), Ji.prototype.destroy.call(this); }; const Oz = function() { this.type = "anatomical", this.data = void 0, this.isAnnotation = !0; }, Pz = function() { this.currentName = "", this.currentSystem = "", this.currentPart = "", this.currentSpecies = "", this.metaURL = "", this.viewURL = "", this.timeVarying = !1, this.currentTime = 0; }, j1 = function(i) { Gt.call(this); const e = this; let t; this.sceneData = new Pz(); const r = new Array(), n = new Array(), o = new Array(), a = new Array(); let s, c; const l = i; this.NDCCameraControl = void 0, e.typeName = "Organ Viewer", this.getSceneData = function() { return e.sceneData; }, this.updateTime = function(_) { let E = 6e3; e.scene && (E = e.scene.getDuration()); const O = _ / 100 * E; e.sceneData.nerveMapIsActive || e.scene && e.scene.setMorphsTime(O), e.sceneData.currentTime = _; }; const h = function() { let _ = 3e3; e.scene && (_ = e.scene.getDuration()); const E = e.zincRenderer.getCurrentTime(); for (let O = 0; O < r.length; O++) r[O](E); !e.sceneData.nerveMapIsActive && t && t.setMorphsTime(E), e.sceneData.nerveMap && e.sceneData.nerveMap.additionalReader && e.sceneData.nerveMap.additionalReader.setTime(E / _), e.sceneData.currentTime = E / _ * 100; }; this.getCurrentTime = function() { return e.sceneData.currentTime; }, this.toggleSyncControl = (_, E) => { let O = this.scene.getZincCameraControls(); _ ? (O.resetView(), this.NDCCameraControl = O.enableSyncControl(), O.setRotationMode(E)) : (O.disableSyncControl(), this.NDCCameraControl = void 0, O.setRotationMode("free")); }, this.isSyncControl = () => this.NDCCameraControl !== void 0, this.setSyncControlZoomToBox = (_) => { this.NDCCameraControl && this.NDCCameraControl.zoomToBox(_, 2); }, this.setSyncControlCallback = (_) => { this.NDCCameraControl && this.NDCCameraControl.setEventCallback(_); }, this.setSyncControlCenterZoom = (_, E) => { this.NDCCameraControl && this.NDCCameraControl.setCenterZoom(_, E); }; const u = function() { if (e.zincRenderer.playAnimation && e.liveUpdatesObjects && e.setupLiveCoordinates(e.liveUpdatesObjects), e.selectedCenter) { const _ = new zn.THREE.Vector3(); _.copy(e.selectedCenter); const E = e.scene.vectorToScreenXY(_); e.selectedScreenCoordinates.x = E.x, e.selectedScreenCoordinates.y = E.y; } }, p = function() { return function() { h(); }; }, g = function() { return function() { u(); }; }; this.addTimeChangedCallback = function(_) { r.push(_); }, this.setTexturePos = function(_) { e.sceneData.nerveMap && e.sceneData.nerveMap.additionalReader && e.sceneData.nerveMap.additionalReader.setSliderPos(_); }, this.addSceneChangedCallback = function(_) { n.push(_); }, this.addOrganPartAddedCallback = function(_) { o.push(_); }, this.addOrganPartRemovedCallback = function(_) { a.push(_); }, this.setFinishDownloadCallback = function(_) { s = _; }, this.unsetFinishDownloadCallback = function() { s = void 0; }, this.setDownloadErrorCallback = function(_) { c = _; }, this.unsetDownloadErrorCallback = function() { c = void 0; }, this.getNamedObjectsToScreenCoordinates = function(_, E) { const O = new zn.THREE.Vector3(); O.setFromMatrixPosition(obj.matrixWorld); const L = width / 2, C = height / 2; return O.project(E), O.x = O.x * L + L, O.y = -(O.y * C) + C, O; }; const m = function(_) { let E, O; if (_ !== void 0) { let L = !1; _.object.userData && _.object.userData.isMarker ? (L = !0, O = _.object.userData.parent.getMorph()) : O = _.object; try { O.userData.userData.annotation.data.lastActionOnMarker = L; } finally { } if (O) if (O.name) E = O.name; else { const C = e.getAnnotationsFromObjects( [O] ); C && C[0] && (E = C[0].data.group); } } return { id: E, object: O }; }, d = function() { return function(_, E, O) { var L; const C = e.getIntersectedObject(_), I = m(C), R = { worldCoords: [ C ? C.point.x : 0, C ? C.point.y : 0, C ? C.point.z : 0 ], intersected: C, intersects: _ }, b = { x: E, y: O }; if (I.id) { R.threeID = (L = I.object) == null ? void 0 : L.id, I.object.userData.isGlyph ? I.object.name ? e.setSelectedByObjects( [I.object], b, R, !0 ) : e.setSelectedByZincObjects( I.object.userData.getGlyphset(), b, R, !0 ) : e.setSelectedByObjects([I.object], b, R, !0); return; } else e.setSelectedByObjects([], b, R, !0); }; }, y = function() { return function(_, E, O) { var L; const C = e.getIntersectedObject(_), I = m(C), R = { worldCoords: [ C ? C.point.x : 0, C ? C.point.y : 0, C ? C.point.z : 0 ] }, b = { x: E, y: O }; if (I.id) { R.threeID = (L = I.object) == null ? void 0 : L.id, e.displayArea.style.cursor = "pointer", e.setHighlightedByObjects([I.object], b, R, !0); return; } else e.displayArea.style.cursor = "auto", e.setHighlightedByObjects([], b, R, !0); }; }, f = function(_, E, O, L) { if (L == "all" || L == "geometries") { const C = _.findGeometriesWithGroupName(E); for (let I = 0; I < C.length; I++) C[I].setVisibility(O); } if (L == "all" || L == "glyphsets") { const C = _.findGlyphsetsWithGroupName(E); for (let I = 0; I < C.length; I++) C[I].setVisibility(O); } if (L == "all" || L == "pointsets") { const C = _.findPointsetsWithGroupName(E); for (let I = 0; I < C.length; I++) C[I].setVisibility(O); } if (L == "all" || L == "lines") { const C = _.findLinesWithGroupName(E); for (let I = 0; I < C.length; I++) C[I].setVisibility(O); } }; this.changeGeometriesVisibility = function(_, E) { f(e.scene, _, E, "geometries"); }, this.changeGlyphsetsVisibility = function(_, E) { f(e.scene, _, E, "glyphsets"); }, this.changeLinesVisibility = function(_, E) { f(e.scene, _, E, "lines"); }, this.changePointsetsVisibility = function(_, E) { f(e.scene, _, E, "pointsets"); }, this.changeOrganPartsVisibility = function(_, E, O) { let L = "all"; O !== void 0 && (L = O), f(e.scene, _, E, L); }, this.changeOrganPartsVisibilityCallback = function(_) { return function(E) { e.changeOrganPartsVisibility(_, E); }; }, this.changeBackgroundColour = function(_) { const E = new zn.THREE.Color(_); e.zincRenderer && e.zincRenderer.getThreeJSRenderer().setClearColor(E, 1); }; const v = function(_, E, O, L) { for (let R = 0; R < o.length; R++) o[R](L, e.scene.isTimeVarying()); const C = new Oz(), I = L.region.getFullPath(); C.data = { species: e.sceneData.currentSpecies, system: _, part: E, group: L.groupName, region: I, uuid: L.uuid, lastActionOnMarker: !1 }, L.userData.annotation = C; }, M = function(_, E, O, L) { for (let C = 0; C < a.length; C++) a[C](L); }, S = function(_, E, O) { return function(L) { v(_, E, O, L); }; }, T = function(_, E, O) { return function(L) { M(_, E, O, L); }; }, x = function() { return function() { e.settingsChanged(), e.sceneData.timeVarying = e.scene.isTimeVarying(), s && s(); }; }, w = function() { return function(_) { if ((_ == null ? void 0 : _.type) === "Error" && c) { const E = { xhr: _.xhr, type: "download-error" }; c(E); } }; }; this.updateFieldvisibility = function(_, E) { for (let O = 0; O < _.length; O++) if (E != O) { const L = _[O].PartName; e.changeOrganPartsVisibility(L, !1); } if (E > -1) { const O = _[E].PartName; if (e.scene.findGeometriesWithGroupName(O).length > 0 || e.scene.findGlyphsetsWithGroupName(O).length > 0) e.changeOrganPartsVisibility(O, !0); else { const L = getOrganDetails(_[E].SystemName, O); L != null && e.scene.loadMetadataURL(l.getOrgansDirectoryPrefix() + "/" + L.meta); } } }, this.getAvailableSpecies = function(_, E, O) { const L = new Array(); L.push("none"); const C = Object.keys(organsFileMap); for (index in C) { const I = C[index]; I != _ && organsFileMap[I].hasOwnProperty(E) && organsFileMap[I][E].hasOwnProperty(O) && L.push(I); } return L; }, this.getCentreAndSize = function() { const _ = new zn.THREE.Vector3(), E = this.scene.getBoundingBox(); E.getCenter(_); const O = [_.x, _.y, _.z]; E.getSize(_); const L = [_.x, _.y, _.z]; return { centre: O, size: L }; }; const A = function(_, E, O, L) { e.sceneData.nerveMapIsActive = !1, e.sceneData.nerveMap = void 0, e.sceneData.metaURL = "", e.sceneData.viewURL = "", e.sceneData.currentSpecies = _, e.sceneData.currentSystem = E, e.sceneData.currentPart = O, e.sceneData.currentTime = 0, e.sceneData.timeVarying = !1; let C = ""; _ && (C = _ + "/"), E && (C = E + "/"), O && (C = O), e.sceneData.currentName = C; }; this.loadOrgansFromURL = function(_, E, O, L, C, I) { if (e.zincRenderer && L && e.sceneData.metaURL !== _) { A(E, O, L); const R = e.sceneData.currentName; let b = e.zincRenderer.getSceneByName(R); b ? I && b.clearAll() : b = e.zincRenderer.createScene(R), e.selectObjectOnPick = !0; for (let N = 0; N < n.length; N++) n[N](e.sceneData); C && C != "" ? (e.sceneData.viewURL = C, b.loadViewURL(e.sceneData.viewURL)) : e.sceneData.viewURL = void 0, e.sceneData.metaURL = _, b.addZincObjectAddedCallbacks(S(O, L, !1)), b.addZincObjectRemovedCallbacks(T(void 0, L, !1)), b.loadMetadataURL(_, w(), x()), e.scene = b, e.zincRenderer.setCurrentScene(b), e.graphicsHighlight.reset(); const P = b.getZincCameraControls(); P.enableRaycaster(b, d(), y()), P.setMouseButtonAction("AUXILIARY", "ZOOM"), P.setMouseButtonAction("SECONDARY", "PAN"); } }, this.loadGLTFFromURL = function(_, E, O) { if (e.zincRenderer && E && e.sceneData.metaURL !== _) { A(void 0, void 0, E); const L = e.sceneData.currentName; let C = e.zincRenderer.getSceneByName(L); C ? O && C.clearAll() : C = e.zincRenderer.createScene(L); for (let R = 0; R < n.length; R++) n[R](e.sceneData); e.sceneData.viewURL = void 0, e.sceneData.metaURL = _, C.addZincObjectAddedCallbacks(S(void 0, E, !1)), C.addZincObjectRemovedCallbacks(T(void 0, E, !1)), C.loadGLTF(_, void 0, x()), e.scene = C, e.zincRenderer.setCurrentScene(C), e.graphicsHighlight.reset(); const I = C.getZincCameraControls(); I.enableRaycaster(C, d(), y()), I.setMouseButtonAction("AUXILIARY", "ZOOM"), I.setMouseButtonAction("SECONDARY", "PAN"); } }, this.alignCameraWithSelectedObject = function(_) { const E = e.graphicsHighlight.getSelected(); E && E[0] && E[0].userData && e.scene.alignObjectToCameraView(E[0].userData, _); }, this.exportSettings = function() { const _ = {}; return _.name = e.instanceName, e.sceneData.currentSystem && (_.system = e.sceneData.currentSystem), e.sceneData.currentSpecies && (_.species = e.sceneData.currentSpecies), e.sceneData.currentPart && (_.part = e.sceneData.currentPart), _.metaURL = e.sceneData.metaURL, e.sceneData.viewURL && (_.viewURL = e.sceneData.viewURL), _.dialog = "Organ Viewer", _; }, this.importSettings = function(_) { return _ && _.dialog == this.typeName ? (e.setName(_.name), _.metaURL !== void 0 && _.metaURL != "" ? e.loadOrgansFromURL( _.metaURL, _.species, _.system, _.part, _.viewURL, !0 ) : e.loadOrgans(_.species, _.system, _.part), !0) : !1; }, function() { e.initialiseRenderer(void 0), e.zincRenderer && (e.zincRenderer.addPreRenderCallbackFunction(p()), e.zincRenderer.addPostRenderCallbackFunction(g())); }(); }; j1.prototype = Object.create(Gt.prototype); var Et = function() { return Et = Object.assign || function(i) { for (var e, t = 1, r = arguments.length; t < r; t++) { e = arguments[t]; for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && (i[n] = e[n]); } return i; }, Et.apply(this, arguments); }; function Iz(i, e, t, r) { function n(o) { return o instanceof t ? o : new t(function(a) { a(o); }); } return new (t || (t = Promise))(function(o, a) { function s(h) { try { l(r.next(h)); } catch (u) { a(u); } } function c(h) { try { l(r.throw(h)); } catch (u) { a(u); } } function l(h) { h.done ? o(h.value) : n(h.value).then(s, c); } l((r = r.apply(i, [])).next()); }); } function Dz(i, e) { var t = { label: 0, sent: function() { if (o[0] & 1) throw o[1]; return o[1]; }, trys: [], ops: [] }, r, n, o, a; return a = { next: s(0), throw: s(1), return: s(2) }, typeof Symbol == "function" && (a[Symbol.iterator] = function() { return this; }), a; function s(l) { return function(h) { return c([l, h]); }; } function c(l) { if (r) throw new TypeError("Generator is already executing."); for (; a && (a = 0, l[0] && (t = 0)), t; ) try { if (r = 1, n && (o = l[0] & 2 ? n.return : l[0] ? n.throw || ((o = n.return) && o.call(n), 0) : n.next) && !(o = o.call(n, l[1])).done) return o; switch (n = 0, o && (l = [l[0] & 2, o.value]), l[0]) { case 0: case 1: o = l; break; case 4: return t.label++, { value: l[1], done: !1 }; case 5: t.label++, n = l[1], l = [0]; continue; case 7: l = t.ops.pop(), t.trys.pop(); continue; default: if (o = t.trys, !(o = o.length > 0 && o[o.length - 1]) && (l[0] === 6 || l[0] === 2)) { t = 0; continue; } if (l[0] === 3 && (!o || l[1] > o[0] && l[1] < o[3])) { t.label = l[1]; break; } if (l[0] === 6 && t.label < o[1]) { t.label = o[1], o = l; break; } if (o && t.label < o[2]) { t.label = o[2], t.ops.push(l); break; } o[2] && t.ops.pop(), t.trys.pop(); continue; } l = e.call(i, t); } catch (h) { l = [6, h], n = 0; } finally { r = o = 0; } if (l[0] & 5) throw l[1]; return { value: l[0] ? l[1] : void 0, done: !0 }; } } function rt(i) { var e = typeof Symbol == "function" && Symbol.iterator, t = e && i[e], r = 0; if (t) return t.call(i); if (i && typeof i.length == "number") return { next: function() { return i && r >= i.length && (i = void 0), { value: i && i[r++], done: !i }; } }; throw new TypeError(e ? "Object is not iterable." : "Symbol.iterator is not defined."); } function Wt(i, e) { var t = typeof Symbol == "function" && i[Symbol.iterator]; if (!t) return i; var r = t.call(i), n, o = [], a; try { for (; (e === void 0 || e-- > 0) && !(n = r.next()).done; ) o.push(n.value); } catch (s) { a = { error: s }; } finally { try { n && !n.done && (t = r.return) && t.call(r); } finally { if (a) throw a.error; } } return o; } var Nz = "ENTRIES", W1 = "KEYS", $1 = "VALUES", pi = "", qh = ( /** @class */ function() { function i(e, t) { var r = e._tree, n = Array.from(r.keys()); this.set = e, this._type = t, this._path = n.length > 0 ? [{ node: r, keys: n }] : []; } return i.prototype.next = function() { var e = this.dive(); return this.backtrack(), e; }, i.prototype.dive = function() { if (this._path.length === 0) return { done: !0, value: void 0 }; var e = ya(this._path), t = e.node, r = e.keys; if (ya(r) === pi) return { done: !1, value: this.result() }; var n = t.get(ya(r)); return this._path.push({ node: n, keys: Array.from(n.keys()) }), this.dive(); }, i.prototype.backtrack = function() { if (this._path.length !== 0) { var e = ya(this._path).keys; e.pop(), !(e.length > 0) && (this._path.pop(), this.backtrack()); } }, i.prototype.key = function() { return this.set._prefix + this._path.map(function(e) { var t = e.keys; return ya(t); }).filter(function(e) { return e !== pi; }).join(""); }, i.prototype.value = function() { return ya(this._path).node.get(pi); }, i.prototype.result = function() { switch (this._type) { case $1: return this.value(); case W1: return this.key(); default: return [this.key(), this.value()]; } }, i.prototype[Symbol.iterator] = function() { return this; }, i; }() ), ya = function(i) { return i[i.length - 1]; }, Bz = function(i, e, t) { var r = /* @__PURE__ */ new Map(); if (e === void 0) return r; for (var n = e.length + 1, o = n + t, a = new Uint8Array(o * n).fill(t + 1), s = 0; s < n; ++s) a[s] = s; for (var c = 1; c < o; ++c) a[c * n] = c; return q1(i, e, t, r, a, 1, n, ""), r; }, q1 = function(i, e, t, r, n, o, a, s) { var c, l, h = o * a; try { e: for (var u = rt(i.keys()), p = u.next(); !p.done; p = u.next()) { var g = p.value; if (g === pi) { var m = n[h - 1]; m <= t && r.set(s, [i.get(g), m]); } else { for (var d = o, y = 0; y < g.length; ++y, ++d) { for (var f = g[y], v = a * d, M = v - a, S = n[v], T = Math.max(0, d - t - 1), x = Math.min(a - 1, d + t), w = T; w < x; ++w) { var A = f !== e[w], _ = n[M + w] + +A, E = n[M + w + 1] + 1, O = n[v + w] + 1, L = n[v + w + 1] = Math.min(_, E, O); L < S && (S = L); } if (S > t) continue e; } q1(i.get(g), e, t, r, n, d, a, s + g); } } } catch (C) { c = { error: C }; } finally { try { p && !p.done && (l = u.return) && l.call(u); } finally { if (c) throw c.error; } } }, Xh = ( /** @class */ function() { function i(e, t) { e === void 0 && (e = /* @__PURE__ */ new Map()), t === void 0 && (t = ""), this._size = void 0, this._tree = e, this._prefix = t; } return i.prototype.atPrefix = function(e) { var t, r; if (!e.startsWith(this._prefix)) throw new Error("Mismatched prefix"); var n = Wt(ou(this._tree, e.slice(this._prefix.length)), 2), o = n[0], a = n[1]; if (o === void 0) { var s = Wt(zf(a), 2), c = s[0], l = s[1]; try { for (var h = rt(c.keys()), u = h.next(); !u.done; u = h.next()) { var p = u.value; if (p !== pi && p.startsWith(l)) { var g = /* @__PURE__ */ new Map(); return g.set(p.slice(l.length), c.get(p)), new i(g, e); } } } catch (m) { t = { error: m }; } finally { try { u && !u.done && (r = h.return) && r.call(h); } finally { if (t) throw t.error; } } } return new i(o, e); }, i.prototype.clear = function() { this._size = void 0, this._tree.clear(); }, i.prototype.delete = function(e) { return this._size = void 0, kz(this._tree, e); }, i.prototype.entries = function() { return new qh(this, Nz); }, i.prototype.forEach = function(e) { var t, r; try { for (var n = rt(this), o = n.next(); !o.done; o = n.next()) { var a = Wt(o.value, 2), s = a[0], c = a[1]; e(s, c, this); } } catch (l) { t = { error: l }; } finally { try { o && !o.done && (r = n.return) && r.call(n); } finally { if (t) throw t.error; } } }, i.prototype.fuzzyGet = function(e, t) { return Bz(this._tree, e, t); }, i.prototype.get = function(e) { var t = ep(this._tree, e); return t !== void 0 ? t.get(pi) : void 0; }, i.prototype.has = function(e) { var t = ep(this._tree, e); return t !== void 0 && t.has(pi); }, i.prototype.keys = function() { return new qh(this, W1); }, i.prototype.set = function(e, t) { if (typeof e != "string") throw new Error("key must be a string"); this._size = void 0; var r = Zh(this._tree, e); return r.set(pi, t), this; }, Object.defineProperty(i.prototype, "size", { /** * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map/size */ get: function() { if (this._size) return this._size; this._size = 0; for (var e = this.entries(); !e.next().done; ) this._size += 1; return this._size; }, enumerable: !1, configurable: !0 }), i.prototype.update = function(e, t) { if (typeof e != "string") throw new Error("key must be a string"); this._size = void 0; var r = Zh(this._tree, e); return r.set(pi, t(r.get(pi))), this; }, i.prototype.fetch = function(e, t) { if (typeof e != "string") throw new Error("key must be a string"); this._size = void 0; var r = Zh(this._tree, e), n = r.get(pi); return n === void 0 && r.set(pi, n = t()), n; }, i.prototype.values = function() { return new qh(this, $1); }, i.prototype[Symbol.iterator] = function() { return this.entries(); }, i.from = function(e) { var t, r, n = new i(); try { for (var o = rt(e), a = o.next(); !a.done; a = o.next()) { var s = Wt(a.value, 2), c = s[0], l = s[1]; n.set(c, l); } } catch (h) { t = { error: h }; } finally { try { a && !a.done && (r = o.return) && r.call(o); } finally { if (t) throw t.error; } } return n; }, i.fromObject = function(e) { return i.from(Object.entries(e)); }, i; }() ), ou = function(i, e, t) { var r, n; if (t === void 0 && (t = []), e.length === 0 || i == null) return [i, t]; try { for (var o = rt(i.keys()), a = o.next(); !a.done; a = o.next()) { var s = a.value; if (s !== pi && e.startsWith(s)) return t.push([i, s]), ou(i.get(s), e.slice(s.length), t); } } catch (c) { r = { error: c }; } finally { try { a && !a.done && (n = o.return) && n.call(o); } finally { if (r) throw r.error; } } return t.push([i, e]), ou(void 0, "", t); }, ep = function(i, e) { var t, r; if (e.length === 0 || i == null) return i; try { for (var n = rt(i.keys()), o = n.next(); !o.done; o = n.next()) { var a = o.value; if (a !== pi && e.startsWith(a)) return ep(i.get(a), e.slice(a.length)); } } catch (s) { t = { error: s }; } finally { try { o && !o.done && (r = n.return) && r.call(n); } finally { if (t) throw t.error; } } }, Zh = function(i, e) { var t, r, n = e.length; e: for (var o = 0; i && o < n; ) { try { for (var a = (t = void 0, rt(i.keys())), s = a.next(); !s.done; s = a.next()) { var c = s.value; if (c !== pi && e[o] === c[0]) { for (var l = Math.min(n - o, c.length), h = 1; h < l && e[o + h] === c[h]; ) ++h; var u = i.get(c); if (h === c.length) i = u; else { var p = /* @__PURE__ */ new Map(); p.set(c.slice(h), u), i.set(e.slice(o, o + h), p), i.delete(c), i = p; } o += h; continue e; } } } catch (m) { t = { error: m }; } finally { try { s && !s.done && (r = a.return) && r.call(a); } finally { if (t) throw t.error; } } var g = /* @__PURE__ */ new Map(); return i.set(e.slice(o), g), g; } return i; }, kz = function(i, e) { var t = Wt(ou(i, e), 2), r = t[0], n = t[1]; if (r !== void 0) { if (r.delete(pi), r.size === 0) X1(n); else if (r.size === 1) { var o = Wt(r.entries().next().value, 2), a = o[0], s = o[1]; Z1(n, a, s); } } }, X1 = function(i) { if (i.length !== 0) { var e = Wt(zf(i), 2), t = e[0], r = e[1]; if (t.delete(r), t.size === 0) X1(i.slice(0, -1)); else if (t.size === 1) { var n = Wt(t.entries().next().value, 2), o = n[0], a = n[1]; o !== pi && Z1(i.slice(0, -1), o, a); } } }, Z1 = function(i, e, t) { if (i.length !== 0) { var r = Wt(zf(i), 2), n = r[0], o = r[1]; n.set(o + e, t), n.delete(o); } }, zf = function(i) { return i[i.length - 1]; }, Is, Ff = "or", Y1 = "and", zz = "and_not", Fz = ( /** @class */ function() { function i(e) { if ((e == null ? void 0 : e.fields) == null) throw new Error('MiniSearch: option "fields" must be provided'); var t = e.autoVacuum == null || e.autoVacuum === !0 ? Kh : e.autoVacuum; this._options = Et(Et(Et({}, Jh), e), { autoVacuum: t, searchOptions: Et(Et({}, t0), e.searchOptions || {}), autoSuggestOptions: Et(Et({}, jz), e.autoSuggestOptions || {}) }), this._index = new Xh(), this._documentCount = 0, this._documentIds = /* @__PURE__ */ new Map(), this._idToShortId = /* @__PURE__ */ new Map(), this._fieldIds = {}, this._fieldLength = /* @__PURE__ */ new Map(), this._avgFieldLength = [], this._nextId = 0, this._storedFields = /* @__PURE__ */ new Map(), this._dirtCount = 0, this._currentVacuum = null, this._enqueuedVacuum = null, this._enqueuedVacuumConditions = ip, this.addFields(this._options.fields); } return i.prototype.add = function(e) { var t, r, n, o, a, s, c = this._options, l = c.extractField, h = c.tokenize, u = c.processTerm, p = c.fields, g = c.idField, m = l(e, g); if (m == null) throw new Error('MiniSearch: document does not have ID field "'.concat(g, '"')); if (this._idToShortId.has(m)) throw new Error("MiniSearch: duplicate ID ".concat(m)); var d = this.addDocumentId(m); this.saveStoredFields(d, e); try { for (var y = rt(p), f = y.next(); !f.done; f = y.next()) { var v = f.value, M = l(e, v); if (M != null) { var S = h(M.toString(), v), T = this._fieldIds[v], x = new Set(S).size; this.addFieldLength(d, T, this._documentCount - 1, x); try { for (var w = (n = void 0, rt(S)), A = w.next(); !A.done; A = w.next()) { var _ = A.value, E = u(_, v); if (Array.isArray(E)) try { for (var O = (a = void 0, rt(E)), L = O.next(); !L.done; L = O.next()) { var C = L.value; this.addTerm(T, d, C); } } catch (I) { a = { error: I }; } finally { try { L && !L.done && (s = O.return) && s.call(O); } finally { if (a) throw a.error; } } else E && this.addTerm(T, d, E); } } catch (I) { n = { error: I }; } finally { try { A && !A.done && (o = w.return) && o.call(w); } finally { if (n) throw n.error; } } } } } catch (I) { t = { error: I }; } finally { try { f && !f.done && (r = y.return) && r.call(y); } finally { if (t) throw t.error; } } }, i.prototype.addAll = function(e) { var t, r; try { for (var n = rt(e), o = n.next(); !o.done; o = n.next()) { var a = o.value; this.add(a); } } catch (s) { t = { error: s }; } finally { try { o && !o.done && (r = n.return) && r.call(n); } finally { if (t) throw t.error; } } }, i.prototype.addAllAsync = function(e, t) { var r = this; t === void 0 && (t = {}); var n = t.chunkSize, o = n === void 0 ? 10 : n, a = { chunk: [], promise: Promise.resolve() }, s = e.reduce(function(h, u, p) { var g = h.chunk, m = h.promise; return g.push(u), (p + 1) % o === 0 ? { chunk: [], promise: m.then(function() { return new Promise(function(d) { return setTimeout(d, 0); }); }).then(function() { return r.addAll(g); }) } : { chunk: g, promise: m }; }, a), c = s.chunk, l = s.promise; return l.then(function() { return r.addAll(c); }); }, i.prototype.remove = function(e) { var t, r, n, o, a, s, c = this._options, l = c.tokenize, h = c.processTerm, u = c.extractField, p = c.fields, g = c.idField, m = u(e, g); if (m == null) throw new Error('MiniSearch: document does not have ID field "'.concat(g, '"')); var d = this._idToShortId.get(m); if (d == null) throw new Error("MiniSearch: cannot remove document with ID ".concat(m, ": it is not in the index")); try { for (var y = rt(p), f = y.next(); !f.done; f = y.next()) { var v = f.value, M = u(e, v); if (M != null) { var S = l(M.toString(), v), T = this._fieldIds[v], x = new Set(S).size; this.removeFieldLength(d, T, this._documentCount, x); try { for (var w = (n = void 0, rt(S)), A = w.next(); !A.done; A = w.next()) { var _ = A.value, E = h(_, v); if (Array.isArray(E)) try { for (var O = (a = void 0, rt(E)), L = O.next(); !L.done; L = O.next()) { var C = L.value; this.removeTerm(T, d, C); } } catch (I) { a = { error: I }; } finally { try { L && !L.done && (s = O.return) && s.call(O); } finally { if (a) throw a.error; } } else E && this.removeTerm(T, d, E); } } catch (I) { n = { error: I }; } finally { try { A && !A.done && (o = w.return) && o.call(w); } finally { if (n) throw n.error; } } } } } catch (I) { t = { error: I }; } finally { try { f && !f.done && (r = y.return) && r.call(y); } finally { if (t) throw t.error; } } this._storedFields.delete(d), this._documentIds.delete(d), this._idToShortId.delete(m), this._fieldLength.delete(d), this._documentCount -= 1; }, i.prototype.removeAll = function(e) { var t, r; if (e) try { for (var n = rt(e), o = n.next(); !o.done; o = n.next()) { var a = o.value; this.remove(a); } } catch (s) { t = { error: s }; } finally { try { o && !o.done && (r = n.return) && r.call(n); } finally { if (t) throw t.error; } } else { if (arguments.length > 0) throw new Error("Expected documents to be present. Omit the argument to remove all documents."); this._index = new Xh(), this._documentCount = 0, this._documentIds = /* @__PURE__ */ new Map(), this._idToShortId = /* @__PURE__ */ new Map(), this._fieldLength = /* @__PURE__ */ new Map(), this._avgFieldLength = [], this._storedFields = /* @__PURE__ */ new Map(), this._nextId = 0; } }, i.prototype.discard = function(e) { var t = this, r = this._idToShortId.get(e); if (r == null) throw new Error("MiniSearch: cannot discard document with ID ".concat(e, ": it is not in the index")); this._idToShortId.delete(e), this._documentIds.delete(r), this._storedFields.delete(r), (this._fieldLength.get(r) || []).forEach(function(n, o) { t.removeFieldLength(r, o, t._documentCount, n); }), this._fieldLength.delete(r), this._documentCount -= 1, this._dirtCount += 1, this.maybeAutoVacuum(); }, i.prototype.maybeAutoVacuum = function() { if (this._options.autoVacuum !== !1) { var e = this._options.autoVacuum, t = e.minDirtFactor, r = e.minDirtCount, n = e.batchSize, o = e.batchWait; this.conditionalVacuum({ batchSize: n, batchWait: o }, { minDirtCount: r, minDirtFactor: t }); } }, i.prototype.discardAll = function(e) { var t, r, n = this._options.autoVacuum; try { this._options.autoVacuum = !1; try { for (var o = rt(e), a = o.next(); !a.done; a = o.next()) { var s = a.value; this.discard(s); } } catch (c) { t = { error: c }; } finally { try { a && !a.done && (r = o.return) && r.call(o); } finally { if (t) throw t.error; } } } finally { this._options.autoVacuum = n; } this.maybeAutoVacuum(); }, i.prototype.replace = function(e) { var t = this._options, r = t.idField, n = t.extractField, o = n(e, r); this.discard(o), this.add(e); }, i.prototype.vacuum = function(e) { return e === void 0 && (e = {}), this.conditionalVacuum(e); }, i.prototype.conditionalVacuum = function(e, t) { var r = this; return this._currentVacuum ? (this._enqueuedVacuumConditions = this._enqueuedVacuumConditions && t, this._enqueuedVacuum != null ? this._enqueuedVacuum : (this._enqueuedVacuum = this._currentVacuum.then(function() { var n = r._enqueuedVacuumConditions; return r._enqueuedVacuumConditions = ip, r.performVacuuming(e, n); }), this._enqueuedVacuum)) : this.vacuumConditionsMet(t) === !1 ? Promise.resolve() : (this._currentVacuum = this.performVacuuming(e), this._currentVacuum); }, i.prototype.performVacuuming = function(e, t) { return Iz(this, void 0, void 0, function() { var r, n, o, a, s, c, l, h, u, p, g, m, d, y, f, v, M, S, T, x, w, A, _, E, O; return Dz(this, function(L) { switch (L.label) { case 0: if (r = this._dirtCount, !this.vacuumConditionsMet(t)) return [3, 10]; n = e.batchSize || tp.batchSize, o = e.batchWait || tp.batchWait, a = 1, L.label = 1; case 1: L.trys.push([1, 7, 8, 9]), s = rt(this._index), c = s.next(), L.label = 2; case 2: if (c.done) return [3, 6]; l = Wt(c.value, 2), h = l[0], u = l[1]; try { for (p = (A = void 0, rt(u)), g = p.next(); !g.done; g = p.next()) { m = Wt(g.value, 2), d = m[0], y = m[1]; try { for (f = (E = void 0, rt(y)), v = f.next(); !v.done; v = f.next()) M = Wt(v.value, 1), S = M[0], !this._documentIds.has(S) && (y.size <= 1 ? u.delete(d) : y.delete(S)); } catch (C) { E = { error: C }; } finally { try { v && !v.done && (O = f.return) && O.call(f); } finally { if (E) throw E.error; } } } } catch (C) { A = { error: C }; } finally { try { g && !g.done && (_ = p.return) && _.call(p); } finally { if (A) throw A.error; } } return this._index.get(h).size === 0 && this._index.delete(h), a % n !== 0 ? [3, 4] : [4, new Promise(function(C) { return setTimeout(C, o); })]; case 3: L.sent(), L.label = 4; case 4: a += 1, L.label = 5; case 5: return c = s.next(), [3, 2]; case 6: return [3, 9]; case 7: return T = L.sent(), x = { error: T }, [3, 9]; case 8: try { c && !c.done && (w = s.return) && w.call(s); } finally { if (x) throw x.error; } return [ 7 /*endfinally*/ ]; case 9: this._dirtCount -= r, L.label = 10; case 10: return [4, null]; case 11: return L.sent(), this._currentVacuum = this._enqueuedVacuum, this._enqueuedVacuum = null, [ 2 /*return*/ ]; } }); }); }, i.prototype.vacuumConditionsMet = function(e) { if (e == null) return !0; var t = e.minDirtCount, r = e.minDirtFactor; return t = t || Kh.minDirtCount, r = r || Kh.minDirtFactor, this.dirtCount >= t && this.dirtFactor >= r; }, Object.defineProperty(i.prototype, "isVacuuming", { /** * Is `true` if a vacuuming operation is ongoing, `false` otherwise */ get: function() { return this._currentVacuum != null; }, enumerable: !1, configurable: !0 }), Object.defineProperty(i.prototype, "dirtCount", { /** * The number of documents discarded since the most recent vacuuming */ get: function() { return this._dirtCount; }, enumerable: !1, configurable: !0 }), Object.defineProperty(i.prototype, "dirtFactor", { /** * A number between 0 and 1 giving an indication about the proportion of * documents that are discarded, and can therefore be cleaned up by vacuuming. * A value close to 0 means that the index is relatively clean, while a higher * value means that the index is relatively dirty, and vacuuming could release * memory. */ get: function() { return this._dirtCount / (1 + this._documentCount + this._dirtCount); }, enumerable: !1, configurable: !0 }), i.prototype.has = function(e) { return this._idToShortId.has(e); }, i.prototype.getStoredFields = function(e) { var t = this._idToShortId.get(e); if (t != null) return this._storedFields.get(t); }, i.prototype.search = function(e, t) { var r, n; t === void 0 && (t = {}); var o = this.executeQuery(e, t), a = []; try { for (var s = rt(o), c = s.next(); !c.done; c = s.next()) { var l = Wt(c.value, 2), h = l[0], u = l[1], p = u.score, g = u.terms, m = u.match, d = g.length || 1, y = { id: this._documentIds.get(h), score: p * d, terms: Object.keys(m), queryTerms: g, match: m }; Object.assign(y, this._storedFields.get(h)), (t.filter == null || t.filter(y)) && a.push(y); } } catch (f) { r = { error: f }; } finally { try { c && !c.done && (n = s.return) && n.call(s); } finally { if (r) throw r.error; } } return e === i.wildcard && t.boostDocument == null && this._options.searchOptions.boostDocument == null || a.sort(r0), a; }, i.prototype.autoSuggest = function(e, t) { var r, n, o, a; t === void 0 && (t = {}), t = Et(Et({}, this._options.autoSuggestOptions), t); var s = /* @__PURE__ */ new Map(); try { for (var c = rt(this.search(e, t)), l = c.next(); !l.done; l = c.next()) { var h = l.value, u = h.score, p = h.terms, g = p.join(" "), m = s.get(g); m != null ? (m.score += u, m.count += 1) : s.set(g, { score: u, terms: p, count: 1 }); } } catch (T) { r = { error: T }; } finally { try { l && !l.done && (n = c.return) && n.call(c); } finally { if (r) throw r.error; } } var d = []; try { for (var y = rt(s), f = y.next(); !f.done; f = y.next()) { var v = Wt(f.value, 2), m = v[0], M = v[1], u = M.score, p = M.terms, S = M.count; d.push({ suggestion: m, terms: p, score: u / S }); } } catch (T) { o = { error: T }; } finally { try { f && !f.done && (a = y.return) && a.call(y); } finally { if (o) throw o.error; } } return d.sort(r0), d; }, Object.defineProperty(i.prototype, "documentCount", { /** * Total number of documents available to search */ get: function() { return this._documentCount; }, enumerable: !1, configurable: !0 }), Object.defineProperty(i.prototype, "termCount", { /** * Number of terms in the index */ get: function() { return this._index.size; }, enumerable: !1, configurable: !0 }), i.loadJSON = function(e, t) { if (t == null) throw new Error("MiniSearch: loadJSON should be given the same options used when serializing the index"); return this.loadJS(JSON.parse(e), t); }, i.getDefault = function(e) { if (Jh.hasOwnProperty(e)) return Yh(Jh, e); throw new Error('MiniSearch: unknown option "'.concat(e, '"')); }, i.loadJS = function(e, t) { var r, n, o, a, s, c, l = e.index, h = e.documentCount, u = e.nextId, p = e.documentIds, g = e.fieldIds, m = e.fieldLength, d = e.averageFieldLength, y = e.storedFields, f = e.dirtCount, v = e.serializationVersion; if (v !== 1 && v !== 2) throw new Error("MiniSearch: cannot deserialize an index created with an incompatible version"); var M = new i(t); M._documentCount = h, M._nextId = u, M._documentIds = Nc(p), M._idToShortId = /* @__PURE__ */ new Map(), M._fieldIds = g, M._fieldLength = Nc(m), M._avgFieldLength = d, M._storedFields = Nc(y), M._dirtCount = f || 0, M._index = new Xh(); try { for (var S = rt(M._documentIds), T = S.next(); !T.done; T = S.next()) { var x = Wt(T.value, 2), w = x[0], A = x[1]; M._idToShortId.set(A, w); } } catch (D) { r = { error: D }; } finally { try { T && !T.done && (n = S.return) && n.call(S); } finally { if (r) throw r.error; } } try { for (var _ = rt(l), E = _.next(); !E.done; E = _.next()) { var O = Wt(E.value, 2), L = O[0], C = O[1], I = /* @__PURE__ */ new Map(); try { for (var R = (s = void 0, rt(Object.keys(C))), b = R.next(); !b.done; b = R.next()) { var P = b.value, N = C[P]; v === 1 && (N = N.ds), I.set(parseInt(P, 10), Nc(N)); } } catch (D) { s = { error: D }; } finally { try { b && !b.done && (c = R.return) && c.call(R); } finally { if (s) throw s.error; } } M._index.set(L, I); } } catch (D) { o = { error: D }; } finally { try { E && !E.done && (a = _.return) && a.call(_); } finally { if (o) throw o.error; } } return M; }, i.prototype.executeQuery = function(e, t) { var r = this; if (t === void 0 && (t = {}), e === i.wildcard) return this.executeWildcardQuery(t); if (typeof e != "string") { var n = Et(Et(Et({}, t), e), { queries: void 0 }), o = e.queries.map(function(y) { return r.executeQuery(y, n); }); return this.combineResults(o, n.combineWith); } var a = this._options, s = a.tokenize, c = a.processTerm, l = a.searchOptions, h = Et(Et({ tokenize: s, processTerm: c }, l), t), u = h.tokenize, p = h.processTerm, g = u(e).flatMap(function(y) { return p(y); }).filter(function(y) { return !!y; }), m = g.map(Hz(h)), d = m.map(function(y) { return r.executeQuerySpec(y, h); }); return this.combineResults(d, h.combineWith); }, i.prototype.executeQuerySpec = function(e, t) { var r, n, o, a, s = Et(Et({}, this._options.searchOptions), t), c = (s.fields || this._options.fields).reduce(function(P, N) { var D; return Et(Et({}, P), (D = {}, D[N] = Yh(s.boost, N) || 1, D)); }, {}), l = s.boostDocument, h = s.weights, u = s.maxFuzzy, p = s.bm25, g = Et(Et({}, t0.weights), h), m = g.fuzzy, d = g.prefix, y = this._index.get(e.term), f = this.termResults(e.term, e.term, 1, y, c, l, p), v, M; if (e.prefix && (v = this._index.atPrefix(e.term)), e.fuzzy) { var S = e.fuzzy === !0 ? 0.2 : e.fuzzy, T = S < 1 ? Math.min(u, Math.round(e.term.length * S)) : S; T && (M = this._index.fuzzyGet(e.term, T)); } if (v) try { for (var x = rt(v), w = x.next(); !w.done; w = x.next()) { var A = Wt(w.value, 2), _ = A[0], E = A[1], O = _.length - e.term.length; if (O) { M == null || M.delete(_); var L = d * _.length / (_.length + 0.3 * O); this.termResults(e.term, _, L, E, c, l, p, f); } } } catch (P) { r = { error: P }; } finally { try { w && !w.done && (n = x.return) && n.call(x); } finally { if (r) throw r.error; } } if (M) try { for (var C = rt(M.keys()), I = C.next(); !I.done; I = C.next()) { var _ = I.value, R = Wt(M.get(_), 2), b = R[0], O = R[1]; if (O) { var L = m * _.length / (_.length + O); this.termResults(e.term, _, L, b, c, l, p, f); } } } catch (P) { o = { error: P }; } finally { try { I && !I.done && (a = C.return) && a.call(C); } finally { if (o) throw o.error; } } return f; }, i.prototype.executeWildcardQuery = function(e) { var t, r, n = /* @__PURE__ */ new Map(), o = Et(Et({}, this._options.searchOptions), e); try { for (var a = rt(this._documentIds), s = a.next(); !s.done; s = a.next()) { var c = Wt(s.value, 2), l = c[0], h = c[1], u = o.boostDocument ? o.boostDocument(h, "", this._storedFields.get(l)) : 1; n.set(l, { score: u, terms: [], match: {} }); } } catch (p) { t = { error: p }; } finally { try { s && !s.done && (r = a.return) && r.call(a); } finally { if (t) throw t.error; } } return n; }, i.prototype.combineResults = function(e, t) { if (t === void 0 && (t = Ff), e.length === 0) return /* @__PURE__ */ new Map(); var r = t.toLowerCase(); return e.reduce(Vz[r]) || /* @__PURE__ */ new Map(); }, i.prototype.toJSON = function() { var e, t, r, n, o = []; try { for (var a = rt(this._index), s = a.next(); !s.done; s = a.next()) { var c = Wt(s.value, 2), l = c[0], h = c[1], u = {}; try { for (var p = (r = void 0, rt(h)), g = p.next(); !g.done; g = p.next()) { var m = Wt(g.value, 2), d = m[0], y = m[1]; u[d] = Object.fromEntries(y); } } catch (f) { r = { error: f }; } finally { try { g && !g.done && (n = p.return) && n.call(p); } finally { if (r) throw r.error; } } o.push([l, u]); } } catch (f) { e = { error: f }; } finally { try { s && !s.done && (t = a.return) && t.call(a); } finally { if (e) throw e.error; } } return { documentCount: this._documentCount, nextId: this._nextId, documentIds: Object.fromEntries(this._documentIds), fieldIds: this._fieldIds, fieldLength: Object.fromEntries(this._fieldLength), averageFieldLength: this._avgFieldLength, storedFields: Object.fromEntries(this._storedFields), dirtCount: this._dirtCount, index: o, serializationVersion: 2 }; }, i.prototype.termResults = function(e, t, r, n, o, a, s, c) { var l, h, u, p, g; if (c === void 0 && (c = /* @__PURE__ */ new Map()), n == null) return c; try { for (var m = rt(Object.keys(o)), d = m.next(); !d.done; d = m.next()) { var y = d.value, f = o[y], v = this._fieldIds[y], M = n.get(v); if (M != null) { var S = M.size, T = this._avgFieldLength[v]; try { for (var x = (u = void 0, rt(M.keys())), w = x.next(); !w.done; w = x.next()) { var A = w.value; if (!this._documentIds.has(A)) { this.removeTerm(v, A, t), S -= 1; continue; } var _ = a ? a(this._documentIds.get(A), t, this._storedFields.get(A)) : 1; if (_) { var E = M.get(A), O = this._fieldLength.get(A)[v], L = Gz(E, S, this._documentCount, O, T, s), C = r * f * _ * L, I = c.get(A); if (I) { I.score += C, Wz(I.terms, e); var R = Yh(I.match, t); R ? R.push(y) : I.match[t] = [y]; } else c.set(A, { score: C, terms: [e], match: (g = {}, g[t] = [y], g) }); } } } catch (b) { u = { error: b }; } finally { try { w && !w.done && (p = x.return) && p.call(x); } finally { if (u) throw u.error; } } } } } catch (b) { l = { error: b }; } finally { try { d && !d.done && (h = m.return) && h.call(m); } finally { if (l) throw l.error; } } return c; }, i.prototype.addTerm = function(e, t, r) { var n = this._index.fetch(r, n0), o = n.get(e); if (o == null) o = /* @__PURE__ */ new Map(), o.set(t, 1), n.set(e, o); else { var a = o.get(t); o.set(t, (a || 0) + 1); } }, i.prototype.removeTerm = function(e, t, r) { if (!this._index.has(r)) { this.warnDocumentChanged(t, e, r); return; } var n = this._index.fetch(r, n0), o = n.get(e); o == null || o.get(t) == null ? this.warnDocumentChanged(t, e, r) : o.get(t) <= 1 ? o.size <= 1 ? n.delete(e) : o.delete(t) : o.set(t, o.get(t) - 1), this._index.get(r).size === 0 && this._index.delete(r); }, i.prototype.warnDocumentChanged = function(e, t, r) { var n, o; try { for (var a = rt(Object.keys(this._fieldIds)), s = a.next(); !s.done; s = a.next()) { var c = s.value; if (this._fieldIds[c] === t) { this._options.logger("warn", "MiniSearch: document with ID ".concat(this._documentIds.get(e), ' has changed before removal: term "').concat(r, '" was not present in field "').concat(c, '". Removing a document after it has changed can corrupt the index!'), "version_conflict"); return; } } } catch (l) { n = { error: l }; } finally { try { s && !s.done && (o = a.return) && o.call(a); } finally { if (n) throw n.error; } } }, i.prototype.addDocumentId = function(e) { var t = this._nextId; return this._idToShortId.set(e, t), this._documentIds.set(t, e), this._documentCount += 1, this._nextId += 1, t; }, i.prototype.addFields = function(e) { for (var t = 0; t < e.length; t++) this._fieldIds[e[t]] = t; }, i.prototype.addFieldLength = function(e, t, r, n) { var o = this._fieldLength.get(e); o == null && this._fieldLength.set(e, o = []), o[t] = n; var a = this._avgFieldLength[t] || 0, s = a * r + n; this._avgFieldLength[t] = s / (r + 1); }, i.prototype.removeFieldLength = function(e, t, r, n) { if (r === 1) { this._avgFieldLength[t] = 0; return; } var o = this._avgFieldLength[t] * r - n; this._avgFieldLength[t] = o / (r - 1); }, i.prototype.saveStoredFields = function(e, t) { var r, n, o = this._options, a = o.storeFields, s = o.extractField; if (!(a == null || a.length === 0)) { var c = this._storedFields.get(e); c == null && this._storedFields.set(e, c = {}); try { for (var l = rt(a), h = l.next(); !h.done; h = l.next()) { var u = h.value, p = s(t, u); p !== void 0 && (c[u] = p); } } catch (g) { r = { error: g }; } finally { try { h && !h.done && (n = l.return) && n.call(l); } finally { if (r) throw r.error; } } } }, i.wildcard = Symbol("*"), i; }() ), Yh = function(i, e) { return Object.prototype.hasOwnProperty.call(i, e) ? i[e] : void 0; }, Vz = (Is = {}, Is[Ff] = function(i, e) { var t, r; try { for (var n = rt(e.keys()), o = n.next(); !o.done; o = n.next()) { var a = o.value, s = i.get(a); if (s == null) i.set(a, e.get(a)); else { var c = e.get(a), l = c.score, h = c.terms, u = c.match; s.score = s.score + l, s.match = Object.assign(s.match, u), i0(s.terms, h); } } } catch (p) { t = { error: p }; } finally { try { o && !o.done && (r = n.return) && r.call(n); } finally { if (t) throw t.error; } } return i; }, Is[Y1] = function(i, e) { var t, r, n = /* @__PURE__ */ new Map(); try { for (var o = rt(e.keys()), a = o.next(); !a.done; a = o.next()) { var s = a.value, c = i.get(s); if (c != null) { var l = e.get(s), h = l.score, u = l.terms, p = l.match; i0(c.terms, u), n.set(s, { score: c.score + h, terms: c.terms, match: Object.assign(c.match, p) }); } } } catch (g) { t = { error: g }; } finally { try { a && !a.done && (r = o.return) && r.call(o); } finally { if (t) throw t.error; } } return n; }, Is[zz] = function(i, e) { var t, r; try { for (var n = rt(e.keys()), o = n.next(); !o.done; o = n.next()) { var a = o.value; i.delete(a); } } catch (s) { t = { error: s }; } finally { try { o && !o.done && (r = n.return) && r.call(n); } finally { if (t) throw t.error; } } return i; }, Is), Uz = { k: 1.2, b: 0.7, d: 0.5 }, Gz = function(i, e, t, r, n, o) { var a = o.k, s = o.b, c = o.d, l = Math.log(1 + (t - e + 0.5) / (e + 0.5)); return l * (c + i * (a + 1) / (i + a * (1 - s + s * r / n))); }, Hz = function(i) { return function(e, t, r) { var n = typeof i.fuzzy == "function" ? i.fuzzy(e, t, r) : i.fuzzy || !1, o = typeof i.prefix == "function" ? i.prefix(e, t, r) : i.prefix === !0; return { term: e, fuzzy: n, prefix: o }; }; }, Jh = { idField: "id", extractField: function(i, e) { return i[e]; }, tokenize: function(i) { return i.split($z); }, processTerm: function(i) { return i.toLowerCase(); }, fields: void 0, searchOptions: void 0, storeFields: [], logger: function(i, e) { typeof (console == null ? void 0 : console[i]) == "function" && console[i](e); }, autoVacuum: !0 }, t0 = { combineWith: Ff, prefix: !1, fuzzy: !1, maxFuzzy: 6, boost: {}, weights: { fuzzy: 0.45, prefix: 0.375 }, bm25: Uz }, jz = { combineWith: Y1, prefix: function(i, e, t) { return e === t.length - 1; } }, tp = { batchSize: 1e3, batchWait: 10 }, ip = { minDirtFactor: 0.1, minDirtCount: 20 }, Kh = Et(Et({}, tp), ip), Wz = function(i, e) { i.includes(e) || i.push(e); }, i0 = function(i, e) { var t, r; try { for (var n = rt(e), o = n.next(); !o.done; o = n.next()) { var a = o.value; i.includes(a) || i.push(a); } } catch (s) { t = { error: s }; } finally { try { o && !o.done && (r = n.return) && r.call(n); } finally { if (t) throw t.error; } } }, r0 = function(i, e) { var t = i.score, r = e.score; return r - t; }, n0 = function() { return /* @__PURE__ */ new Map(); }, Nc = function(i) { var e, t, r = /* @__PURE__ */ new Map(); try { for (var n = rt(Object.keys(i)), o = n.next(); !o.done; o = n.next()) { var a = o.value; r.set(parseInt(a, 10), i[a]); } } catch (s) { e = { error: s }; } finally { try { o && !o.done && (t = n.return) && t.call(n); } finally { if (e) throw e.error; } } return r; }, $z = /[\n\r -#%-*,-/:;?@[-\]_{}\u00A0\u00A1\u00A7\u00AB\u00B6\u00B7\u00BB\u00BF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061E\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u09FD\u0A76\u0AF0\u0C77\u0C84\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166E\u1680\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2000-\u200A\u2010-\u2029\u202F-\u2043\u2045-\u2051\u2053-\u205F\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E4F\u3000-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]+/u; class qz { constructor() { this._searchEngine = new Fz({ fields: ["path", "name"], storeFields: ["path"], tokenize: (e, t) => e.split(/[\s/]+/) // indexing tokenizer }), this.idMaps = {}; } addZincObject(e, t) { const r = e.getRegion().getFullPath(); let n = e.groupName, o = r ? `${r}/${e.groupName}` : e.groupName; n = n.replaceAll('"', ""), o = o.replaceAll('"', ""); const a = { path: o, name: n, id: t }; this._searchEngine.add(a), this.idMaps[t] = { path: o, zincObject: e }; } removeZincObject(e, t) { const r = e.getRegion().getFullPath(); let n = e.groupName, o = r ? `${r}/${e.groupName}` : e.groupName; n = n.replaceAll('"', ""), o = o.replaceAll('"', ""); const a = { path: o, name: n, id: t }; this._searchEngine.remove(a), delete this.idMaps[t]; } addRegion(e, t) { let r = e.getFullPath(), n = e.getName(); r = r.replaceAll('"', ""), n = n.replaceAll('"', ""); const o = { path: r, name: n, id: t }; this._searchEngine.add(o), this.idMaps[t] = { path: r, zincObject: e }; } clearResults() { this._; } removeAll() { this._searchEngine.removeAll(), this.idMaps = {}; } auto_suggest(e) { let t = []; e.length > 2 && ["'", '"'].includes(e.slice(0, 1)) ? (e = e.replaceAll(e.slice(0, 1), ""), t = this._searchEngine.search(e, { prefix: !0, combineWith: "AND" })) : e.length > 1 && (t = this._searchEngine.search(e, { prefix: !0 })); const r = []; t.forEach((a) => { a.id in this.idMaps && r.push(this.idMaps[a.id].path); }); const n = [...new Set(r)], o = []; return n.forEach((a) => o.push({ suggestion: '"' + a + '"' })), o; } processResults(e, t) { const r = { regionPath: void 0, label: 'Search Results for "' }; return Array.isArray(t) ? r.label += ",".join(t) : r.label += t, r.label += '"', e.length === 1 && (e[0].isRegion ? r.regionPath = e[0].getFullPath() : e[0].isZincObject && (r.regionPath = e[0].getRegion().getFullPath(), r.label = e[0].groupName)), r.zincObjects = W4(e), r; } search(e) { let t; e.length > 2 && ["'", '"'].includes(e.slice(0, 1)) ? (e = e.replaceAll(e.slice(0, 1), ""), t = this._searchEngine.search(e, { prefix: !0, combineWith: "AND" })) : e.length > 1 && (t = this._searchEngine.search(e, { prefix: !0 })); const r = []; return t.forEach((n) => { n.id in this.idMaps && r.push(this.idMaps[n.id].zincObject); }), r; } searchTerms(e) { let t = []; return e.forEach((r) => { const n = this.search(r); t.push(...n); }), t; } searchAndProcessResult(e) { let t = []; return Array.isArray(e) ? t = this.searchTerms(e) : t = this.search(e), this.processResults(t, e); } } const Xz = { name: "ScaffoldVuer", components: { Button: os, Col: _r, Loading: E3, Option: ss, Popover: _u, Row: Ur, Select: as, Slider: ar, TabPane: Iy, Tabs: Py, MapSvgIcon: ew, MapSvgSpriteColor: tw, PrimitiveControls: k1, ScaffoldTooltip: H1, ElIconWarningFilled: P0, ElIconArrowDown: mp, ElIconArrowLeft: jn, DrawToolbar: iw, ScaffoldTreeControls: z1 }, setup(i) { let e = ct("$annotator"); return e || (e = Mi(new Tz(`${i.flatmapAPI}annotator`)), ci("$annotator", e)), { annotator: e }; }, props: { /** * The option to show annotation information in sidebar */ annotationSidebar: { type: Boolean, default: !1 }, /** * URL of the zincjs metadata. This value will be ignored if a valid * state prop is also provided. * If the url needs to be updated with state present, please use * the setURL method. */ url: { type: String, default: "" }, /** * Show the colour control of set to true. */ showColourPicker: { type: Boolean, default: !1 }, /** * Flag to show/hide the UI. */ displayUI: { type: Boolean, default: !0 }, /** * Display all graphics at start. * * This setting only works when traditional is set to false. */ displayAtStartUp: { type: Boolean, default: !0 }, /** * Use for toggling the help tooltips. */ helpMode: { type: Boolean, default: !1 }, /** * The active item index of help mode. */ helpModeActiveItem: { type: Number, default: 0 }, /** * The option to use helpModeDialog. * On default, `false`, clicking help will show all tooltips. * If `true`, clicking help will show the help-mode-dialog. */ helpModeDialog: { type: Boolean, default: !1 }, /** * The last item of help mode. */ helpModeLastItem: { type: Boolean, default: !1 }, /** * The initial index number for help mode tooltips. * Set negative (e.g. -1) if there are other tooltips outside of `hoverVisibilities`. */ helpModeInitialIndex: { type: Number, default: 0 }, /** * Use for show/display beta warning icon. */ displayWarning: { type: Boolean, default: !0 }, /** * Warning message for the hovered over text * on the warning icon. */ warningMessage: { type: String, default: "Beta feature - under active development" }, displayLatestChanges: { type: Boolean, default: !1 }, latestChangesMessage: { type: String, default: "New feature - Local search is now available" }, /** * Show/hide pickable markers for regions. */ displayMarkers: { type: Boolean, default: !1 }, /** * Display adjacent markers with a cluster marker. */ markerCluster: { type: Boolean, default: !1 }, /** * GroupName to value pair. * The value can be a single number or and object in the following * form: * * { * number: Number, * imgURL: String * } * * When imgURL is specified, scaffoldvuer will attempt to render * the image in imgURL as marker instead. * */ markerLabels: { type: Object, default: function() { return {}; } }, /** * Show/hide minimap. */ displayMinimap: { type: Boolean, default: !1 }, /** * Format of the input URL */ format: { type: String, default: "metadata" }, /** * Settings for minimap position, size and alignment. */ minimapSettings: { type: Object, default: function() { return { x_offset: 16, y_offset: 16, width: 128, height: 128, align: "top-right" }; } }, /** * Flag to determine rather the open map UI icon and popup * should be shown or not. */ enableOpenMapUI: { type: Boolean, default: !1 }, /** * This array populate the the openMapOptions popup. * Each entry contains a pair of display and key. */ openMapOptions: { type: Array, default: function() { return [ { display: "Open AC Map", key: "AC" }, { display: "Open FC Map", key: "FC" }, { display: "Open 3D Human Map", key: "3D" } ]; } }, /** * State containing state of the scaffold. */ state: { type: Object, default: void 0 }, /** * Optional prop for the name of the region to focus on, * this option is ignored if state or viewURL is also provided. */ region: { type: String, default: "" }, /** * Optional prop for an URL of containing information of a viewport. * This option is ignored if state is also provided. * It will use the provided URL as base if a relative parth is provided. */ viewURL: { type: String, default: "" }, /** * Settings for turning on/off rendering */ render: { type: Boolean, default: !0 }, /** * Specify the endpoint of the flatmap server. * This is used by annotation service included in * third party flatmapvuer library. */ flatmapAPI: { type: String, default: "https://mapcore-demo.org/current/flatmap/v3/" }, /** * Enable local annotations */ enableLocalAnnotations: { type: Boolean, default: !1 } }, provide() { return { flatmapAPI: this.flatmapAPI, scaffoldUrl: this.url, boundingDims: this.boundingDims }; }, data: function() { return { annotator: void 0, createData: { drawingBox: !1, toBeConfirmed: !1, points: [], shape: "", x: 0, y: 0, editingIndex: -1, faceIndex: -1, toBeDeleted: !1 }, currentTime: 0, timeVarying: !1, isPlaying: !1, isReady: !1, /** * This is set when scene is transitioning. */ isTransitioning: !1, tooltipAppendToBody: !1, hoverVisibilities: [ { value: !1, ref: "zoomInPopover" }, // 0 { value: !1, ref: "zoomOutPopover" }, // 1 { value: !1, ref: "zoomFitPopover" }, // 2 { value: !1, ref: "openMapPopover" }, // 3 { value: !1, ref: "settingsPopover" }, // 4 { value: !1, ref: "sliderPopover" }, // 5 { value: !1, ref: "regionVisibilityPopover" }, // 6 { value: !1, ref: "warningPopover" }, // 7 { value: !1, ref: "whatsNewPopover" }, // 8 { value: !1, refs: "toolbarPopover", ref: "editPopover" }, // 9 { value: !1, refs: "toolbarPopover", ref: "pointPopover" }, // 10 { value: !1, refs: "toolbarPopover", ref: "lineStringPopover" }, // 11 { value: !1, refs: "toolbarPopover", ref: "deletePopover" } // 11 ], inHelp: !1, helpModeActiveIndex: this.helpModeInitialIndex, loading: !1, duration: 3e3, drawerOpen: !0, currentBackground: "white", availableBackground: ["white", "lightskyblue", "black"], minimisedSlider: !1, sliderPosition: "", timeMax: 100, orginalDuration: "", animateDuration: "6secs", playSpeed: [ { value: 0.1, label: "0.1x" }, { value: 0.5, label: "0.5x" }, { value: 1, label: "1x" }, { value: 2, label: "2x" }, { value: 5, label: "5x" }, { value: 10, label: "10x" } ], currentSpeed: 1, timeStamps: {}, defaultCheckedKeys: [], tData: { label: "", region: "", visible: !1, x: 200, y: 200, active: !1 }, fileFormat: "metadata", previousMarkerLabels: Mi({}), viewingMode: "Exploration", viewingModes: { Exploration: "View and explore detailed visualization of 3D scaffolds", Annotation: ["View feature annotations", "Add, comment on and view feature annotations"] }, openMapRef: void 0, backgroundIconRef: void 0, userInformation: void 0, toolbarOptions: [ "Delete", "Edit", "Point", "LineString" ], activeDrawTool: void 0, activeDrawMode: void 0, localAnnotationsList: Mi([]), boundingDims: { centre: [0, 0, 0], size: [1, 1, 1] }, lastSelected: Mi({ region: "", group: "", isSearch: !1 }) }; }, watch: { format: { handler: function(i) { this.fileFormat = i; }, immediate: !0 }, url: { handler: function(i) { (this.state === void 0 || this.state.url === void 0) && this.setURL(i); }, immediate: !0 }, region: { handler: function(i) { this.state || this.viewURL || this.setFocusedRegion(i); }, immediate: !0 }, state: { handler: function(i) { this.setState(i); }, immediate: !0, deep: !0 }, viewURL: { handler: function(i) { this.updateViewURL(i); }, immediate: !0 }, helpMode: function(i, e) { i !== e && this.setHelpMode(i); }, helpModeActiveItem: function() { this.helpMode && (this.helpModeActiveIndex += 1, this.setHelpMode(this.helpMode)); }, displayMarkers: function(i) { this.$module.scene.displayMarkers = i, this.$module.scene.forcePickableObjectsUpdate = !0; }, displayMinimap: function(i) { this.$module.scene.displayMinimap = i; }, currentTime: { handler: function() { this.$emit("timeChanged", this.currentTime); } }, duration: function() { this.$module.scene.setDuration(this.duration); }, minimapSettings: { deep: !0, handler: "updateMinimapScissor" }, render: function(i) { this.toggleRendering(i); }, markerCluster: { handler: function(i) { this.$module.scene.enableMarkerCluster(i); }, immediate: !0 }, markerLabels: function(i) { for (const [e, t] of Object.entries(this.previousMarkerLabels)) this.setMarkerModeForObjectsWithName(e, t, "off"); for (const [e, t] of Object.entries(i)) this.setMarkerModeForObjectsWithName(e, t, "on"); this.previousMarkerLabels = Mi({ ...i }); } }, beforeCreate: function() { this.$module = new j1(), this.selectedObjects = [], this.hoveredObjects = [], this.currentBackground = "white", this._currentURL = void 0, this.availableBackground = ["white", "black", "lightskyblue"], this.$_searchIndex = new qz(); }, mounted: function() { this.openMapRef = Ci(this.$refs.openMapRef), this.backgroundIconRef = Ci(this.$refs.backgroundIconRef), this.$refs.scaffoldTreeControls.setModule(this.$module); let i = new Cz(); i.subscribe(this, this.eventNotifierCallback), this.$module.addNotifier(i), this.$module.addOrganPartAddedCallback(this.zincObjectAdded), this.$module.addOrganPartRemovedCallback(this.zincObjectRemoved), this.$module.initialiseRenderer(this.$refs.display), this.toggleRendering(this.render), this.ro = new ResizeObserver(this.adjustLayout).observe( this.$refs.scaffoldContainer ), this.helpTextWait = [], this.helpTextWait.length = this.hoverVisibilities.length, this.defaultRate = this.$module.getPlayRate(), this.$module.zincRenderer.addPreRenderCallbackFunction(() => { this.currentTime = this.$module.getCurrentTime(); }); }, beforeUnmount: function() { this.ro && this.ro.disconnect(), this.$module.destroy(), this.$module = void 0; }, computed: { ...U1(G1, ["userToken"]), annotationDisplay: function() { return this.viewingMode === "Annotation" && this.tData.active === !0 && this.activeDrawMode !== "Point" && this.activeDrawMode !== "LineString"; }, modeDescription: function() { let i = this.viewingModes[this.viewingMode]; return this.viewingMode === "Annotation" ? this.userInformation ? i[1] : i[0] : i; } }, methods: { /** * @public * Call this to manually add a zinc object into the current scene. * This will subsequently trigger a zincObjectAdded * @arg {Object} "ZincObject object to be added" */ addZincObject: function(i) { this.$module.scene && this.$module.scene.addZincObject(i); }, /** * Internal only. * This is called when a new zinc object is read into the scene. */ zincObjectAdded: function(i) { this.loading = !1, this.$_searchIndex.addZincObject(i, i.uuid), this.timeVarying === !1 && i.isTimeVarying() && (this.timeVarying = !0), this.$emit("zinc-object-added", i); }, /** * Internal only. * Remove an entry matching region and group from * local annotation list. */ removeFromLocalAnnotationList: function(i, e) { for (let t = 0; t < this.localAnnotationsList.length; t++) { const r = this.localAnnotationsList[t]; if (r.region === i && r.group === e) { this.localAnnotationsList.splice(t, 1); return; } } }, /** * Internal only. * This is called when a zinc object is removed. */ zincObjectRemoved: function(i) { if (this.$module.scene) { const e = i.region.getFullPath(), t = i.groupName; i.region.findObjectsWithGroupName(t, !1).length === 0 && (this.$_searchIndex.removeZincObject(i, i.uuid), this.removeFromLocalAnnotationList(e, t)); } }, /** * Internal only. * Add regions to search index. */ addRegionsToSearchIndex: function() { this.$module.scene.getRootRegion().getChildRegions(!0).forEach((i) => { this.$_searchIndex.addRegion(i, i.uuid); }); }, /** * Internal only. * This is called when Change backgspeedround colour button * is pressed an causes the backgrouColornd colour to be changed * to one of the three preset colour: white, black and * lightskyblue. */ backgroundChangeCallback: function(i) { this.currentBackground = i, this.$module.zincRenderer.getThreeJSRenderer().setClearColor(this.currentBackground, 1); }, /** * Internal only. * This is called by captueeScreenshot and after the last render * loop, it download a screenshot of the current scene with no UI. */ captureScreenshotCallback: function() { this.$module.zincRenderer.removePostRenderCallbackFunction( this.captureID ); let i = this.$module.zincRenderer.getThreeJSRenderer().domElement.toDataURL("image/png"), e = document.createElement("a"); document.body.append(e), this.captureFilename ? e.download = this.captureFilename : e.download = "screenshot.png", e.href = i, e.click(), e.remove(); }, /** * @public * Function for capturing a screenshot of the current rendering. * * @arg {String} "filename given to the screenshot." */ captureScreenshot: function(i) { this.captureFilename = i, this.captureID = this.$module.zincRenderer.addPostRenderCallbackFunction( this.captureScreenshotCallback ); }, /** * @public * Function to clear current scene, the tree controls and the search index. */ clearScene: function() { this.$refs.scaffoldTreeControls && this.$refs.scaffoldTreeControls.clear(), this.$_searchIndex && this.$_searchIndex.removeAll(), this.$module.scene && this.$module.scene.clearAll(); }, /** * @public * Add and edit local annotations * @arg `region`, * @arg `group`, * @arg `zincObject`, * @arg `comment` */ addAndEditAnnotations: function(i, e, t, r) { const n = Xv( this.annotator, this.userToken, t, i, e, this.url, r ); if (this.enableLocalAnnotations) { n.group = e; let o = i; o.slice(-1) === "/" && (o = o.slice(0, -1)), n.region = o, this.removeFromLocalAnnotationList(o, e), this.localAnnotationsList.push(n); } this.$emit("userPrimitivesUpdated", { region: i, group: e, zincObject: t }); }, /** * @public * Callback for when primitives have been update using primitive controls. * This is only called from callback. * @arg `object` */ primitivesUpdated: function(i) { if (i.isZincObject && i.isEditable) { const e = i.groupName, t = i.region.getFullPath(); this.addAndEditAnnotations(t, e, i, "Position Updated"); } }, /** * @public * Confirm creation of new primitive. This is only called from callback. * @arg `payload` */ confirmCreate: function(i) { if (i) { let e; if (i.shape === "Point") e = this.$module.scene.createPoints( i.region, i.group, this.createData.points, i.group, 8942 ); else if (i.shape === "LineString") e = this.$module.scene.createLines( i.region, i.group, [this.createData.points[0], this.createData.points[1]], 60962 ); else if (i.editingIndex > -1 && this._editingZincObject) { this._editingZincObject.editVertices( [this.createData.points[1]], i.editingIndex ); const t = this._editingZincObject.region.getFullPath() + "/", r = this._editingZincObject.groupName; this.addAndEditAnnotations(t, r, this._editingZincObject, "Position Updated"); } e && (this.addAndEditAnnotations(i.region, i.group, e.zincObject, "Create"), e.zincObject.isEditable = !0, this.tData.region = i.region, this.tData.label = i.group, this.changeActiveByName([i.group], i.region, !1)); } this.cancelCreate(); }, /** * Internal only. * Cancel create workflows. Reset all relevant UIs and data. */ cancelCreate: function() { this.createData.points.length = 0, this.createData.toBeConfirmed = !1, this._editingZincObject = void 0, this.createData.editingIndex = -1, this.createData.faceIndex = -1, this.tData.visible = !1, this.createData.toBeDeleted = !1, this._tempLine && (this.$module.scene.removeTemporaryPrimitive(this._tempLine), this._tempLine = void 0), this._tempPoint && (this.$module.scene.removeTemporaryPrimitive(this._tempPoint), this._tempPoint = void 0), this.annotationSidebar && this.$emit("annotation-close"); }, /** * Internal only. * Confirm delete of user created primitive. * This is only called from callback. */ confirmDelete: function() { var i; if ((i = this._editingZincObject) != null && i.isEditable) { const e = this._editingZincObject.region.getFullPath() + "/", t = this._editingZincObject.groupName; Xv( this.annotator, this.userToken, this._editingZincObject, e, t, this.url, "Deleted" ) && this.$module.scene.getRootRegion().findChildFromPath(e).removeZincObject(this._editingZincObject); } this.cancelCreate(); }, /** * Internal only. * This is triggered when tooltip is hidden */ onTooltipHide: function() { this.createData.toBeConfirmed && !this.annotationSidebar && this.cancelCreate(); }, formatTooltip(i) { if (this.timeMax >= 1e3 && i) { let e = (i % 6e4 / 1e3).toFixed(2) + "s"; return (i > 6e4 ? (i / 6e4).toFixed(0) + "m " : "") + e; } return i ? i.toFixed(2) + " ms" : "0 ms"; }, /** * @public * Function to reset the view to default. * Also called when the associated button is pressed. */ fitWindow: function() { if (this.$module.scene) { let i = !1; this._boundingBoxGeo && (i = this._boundingBoxGeo.getVisibility(), this._boundingBoxGeo.setVisibility(!1)), this.$module.scene.viewAll(), this._boundingBoxGeo && (H4(this._boundingBoxGeo, this.$module.scene), this._boundingBoxGeo.setVisibility(i)); } }, /** * @public * Function to zoom in. * Also called when the associated button is pressed. */ zoomIn: function() { this.$module.scene && this.$module.scene.changeZoomByScrollRateUnit(-1); }, /** * Function to zoom out. * Also called when the associated button is pressed. * * @public */ zoomOut: function() { this.$module.scene && this.$module.scene.changeZoomByScrollRateUnit(1); }, /** * Function to change the current play speed. * * @public * @arg `speed` */ speedChanged: function(i) { this.currentSpeed = i, this.$module.setPlayRate(this.defaultRate * this.currentSpeed); }, /** * Function used to stop the free spin * * @public */ stopFreeSpin: function() { this.$module.scene.getZincCameraControls().stopAutoTumble(), this.isTransitioning = !1; }, /** * Return a list of obejcts with the provided name. * @arg "Group name to search." * * @public */ findObjectsWithGroupName: function(i) { let e = []; return i && i != "" && this.$module.scene && (e = this.$module.scene.findObjectsWithGroupName(i)), e; }, /** * @public * Switch active drawing type * @arg {String} `type` * @arg {String} `icon` */ toggleDrawing: function(i, e) { if (this.createData.toBeDeleted = !1, i === "mode") this.cancelCreate(), this.activeDrawMode = e, this.createData.shape = "", this.$module.selectObjectOnPick = !0; else if (i === "tool") { if (this.annotationDisplay) return; this.activeDrawTool = e, this.createData.shape = this.activeDrawTool ? this.activeDrawTool : "", this.$module.selectObjectOnPick = !1; } }, /** * Toggle the drawing box which aid the drawing * * @public */ toggleDrawingBox: function() { this.createData.drawingBox = !this.createData.drawingBox; }, /** * Find and and zoom into objects with the provided list of names. * @arg "List of names" * * @public */ viewRegion: function(i) { const e = this.$module.scene.getRootRegion(), t = Array.isArray(i) ? i : [i], r = Aa(e, t, "", !0); let n = this.$module.scene.getBoundingBoxOfZincObjects(r); if (n) { if (this.$module.isSyncControl()) this.$module.setSyncControlZoomToBox(n); else { const o = this.$module.scene.camera.far - this.$module.scene.camera.near; this.$module.scene.viewAllWithBoundingBox(n), this.$module.scene.camera.far = this.$module.scene.camera.near + o, this.$module.scene.camera.updateProjectionMatrix(); } return !0; } return !1; }, setFocusedRegion: function(i) { i && (this.isReady ? this.viewRegion(i) : this.$module.setFinishDownloadCallback( this.setURLFinishCallback({ region: i }) )); }, updateViewURL: function(i) { if (i) if (this.isReady) { const e = new URL(i, this.url); this.$module.scene.loadViewURL(e); } else this.$module.setFinishDownloadCallback( this.setURLFinishCallback({ viewURL: i }) ); }, createEditTemporaryLines: function(i) { const e = i[0].extraData.worldCoords; if (e && (this.createData.shape === "LineString" || this.createData.editingIndex > -1) && this.createData.points.length === 1) if (this.showRegionTooltipWithAnnotations(i, !0, !1), this.tData.x = 50, this.tData.y = 200, this._tempLine) { const t = this._tempLine.geometry.getAttribute("position"); t.setXYZ(1, e[0], e[1], e[2]), t.needsUpdate = !0; } else this._tempLine = this.$module.scene.addTemporaryLines( [this.createData.points[0], e], 65535 ); }, draw: function(i) { i && i.length > 0 && i[0].data.group && i[0].extraData.worldCoords && (this.createData.shape === "Point" ? this.drawPoint(i[0].extraData.worldCoords, i) : (this.createData.shape === "LineString" || this.createData.editingIndex > -1) && this.drawLine(i[0].extraData.worldCoords, i)); }, drawPoint: function(i, e) { this.createData.toBeConfirmed === !1 && (this.createData.points.length = 0, this.createData.points.push(i), this.createData.toBeConfirmed = !0, this.showRegionTooltipWithAnnotations(e, !0, !1), this.tData.x = 50, this.tData.y = 200, this._tempPoint = this.$module.scene.addTemporaryPoints([i], 16776960)); }, drawLine: function(i, e) { this.createData.toBeConfirmed === !1 && (this.createData.points.length === 1 ? (this.createData.points.push(i), this.createData.toBeConfirmed = !0, this.showRegionTooltipWithAnnotations(e, !0, !1), this.tData.x = 50, this.tData.y = 200) : (this._tempPoint = this.$module.scene.addTemporaryPoints([i], 16776960), this.createData.points.push(i))); }, /** * Return renderer information * * @public */ getRendererInfo: function() { if (this.$module.zincRenderer) return this.$module.zincRenderer.getThreeJSRenderer().info; }, /** * Function used to rotate the scene. * Also called when the associated button is pressed. * * @public */ freeSpin: function() { if (this.$module.scene) { let i = this.$module.scene.getZincCameraControls(); this.isTransitioning = !0, i.enableAutoTumble(), i.autoTumble([1, 0], Math.PI, !0), setTimeout(this.stopFreeSpin, 4e3); } }, activateAnnotationMode: function(i, e) { if (this.userInformation || this.enableLocalAnnotations) if (this.createData.toBeDeleted = !1, this.createData.shape !== "" || this.createData.editingIndex > -1) i.length > 0 && e.identifiers[0].coords && (this.createData.x = e.identifiers[0].coords.x, this.createData.y = e.identifiers[0].coords.y, this.draw(e.identifiers)); else { if (this.activeDrawMode === "Edit") { const t = V4(e); t && this.activateEditingMode( t.zincObject, t.faceIndex, t.vertexIndex, t.point ); } else if (this.activeDrawMode === "Delete") { const t = U4(e); t && (this.createData.toBeDeleted = !0, this._editingZincObject = t); } this.activeDrawMode !== "Point" && this.activeDrawMode !== "LineString" ? this.showRegionTooltipWithAnnotations(e.identifiers, !0, !1) : this.showRegionTooltipWithAnnotations(e.identifiers, !0, !0); } else this.showRegionTooltipWithAnnotations(e.identifiers, !0, !0); }, activateEditingMode: function(i, e, t, r) { this._editingZincObject = i, this.createData.faceIndex = e, this.createData.editingIndex = t, this.drawLine(r, void 0); }, /** * Callback when a region is selected/highlighted. * It will also update other controls. * */ eventNotifierCallback: function(i) { if (!(this.createData.toBeConfirmed || this.createData.toBeDeleted)) { const e = []; let t = []; (i.eventType == 1 || i.eventType == 2) && (i.identifiers.forEach((o) => { if (o) { let a = o.data.id ? o.data.id : o.data.group; e.push(a); } }), t = i.zincObjects); let r, n; if (i.identifiers.length > 0 && i.identifiers[0] && (r = i.identifiers[0].data.id ? i.identifiers[0].data.id : i.identifiers[0].data.group, i.identifiers[0].data.region && (n = i.identifiers[0].data.region)), i.eventType == 1) this.viewingMode === "Annotation" ? (this.tData.label = r, this.tData.region = n, this.activateAnnotationMode(e, i)) : (this.$refs.scaffoldTreeControls && (e.length > 0 ? (this.$refs.scaffoldTreeControls.updateActiveUI(t), this.updatePrimitiveControls(t)) : (this.hideRegionTooltip(), this.$refs.scaffoldTreeControls.removeActive(!1))), i.identifiers.length === 1 ? (this.lastSelected.isSearch = !1, this.lastSelected.region = n, this.lastSelected.group = i.identifiers[0].data.group) : i.identifiers.length === 0 && (this.lastSelected.isSearch = !1, this.lastSelected.region = "", this.lastSelected.group = ""), this.$emit("scaffold-selected", i.identifiers)); else if (i.eventType == 2) this.selectedObjects.length === 0 && (this.hideRegionTooltip(), this.$refs.scaffoldTreeControls && (e.length > 0 ? this.$refs.scaffoldTreeControls.updateHoverUI(t) : this.$refs.scaffoldTreeControls.removeHover(!0)), i.identifiers.length > 0 && i.identifiers[0] && i.identifiers[0].coords && (this.tData.active = !1, (this.viewingMode !== "Annotation" || !this.annotationSidebar) && (this.tData.visible = !0), this.tData.label = r, this.tData.region = n, this.tData.x = i.identifiers[0].coords.x, this.tData.y = i.identifiers[0].coords.y, this.createEditTemporaryLines(i.identifiers)), this.$emit("scaffold-highlighted", i.identifiers)); else if (i.eventType == 3 && i.identifiers.length > 0 && i.identifiers[0]) { if (i.identifiers[0].coords) { const o = this.$refs.scaffoldContainer.getBoundingClientRect(); this.tData.x = i.identifiers[0].coords.x - o.left, this.tData.y = i.identifiers[0].coords.y - o.top; } this.createEditTemporaryLines(i.identifiers); } } }, /** * Get the coordinates of the current selected region. * * @public */ getCoordinatesOfSelected: function() { if (this.selectedObjects && this.selectedObjects.length > 0) return this.$module.scene.getObjectsScreenXY(this.selectedObjects); }, /** * Return an object containing the window coordinates of the * current selected region which will be updated after each render * loop. * * @public */ getDynamicSelectedCoordinates: function() { return this.$module.selectedScreenCoordinates; }, /** * Callback when time is changed through the UI. */ timeChange: function(i) { let e = i / this.timeMax * 100; e != this.currentTime && this.$module.updateTime(e); }, /** * Update primitive controls UI with the specified objects * * @arg objects objects to be set for the selected */ updatePrimitiveControls: function(i) { this.selectedObjects = i, this.selectedObjects && this.selectedObjects.length > 0 ? this.$refs.primitiveControls.setObject(this.selectedObjects[0]) : this.$refs.primitiveControls.setObject(void 0); }, /** * A callback used by children components. Set the selected zinc object * * @arg Selected zinc objects * @arg Flag to determine if callback should be triggered when new selection * is made */ objectSelected: function(i, e) { this.updatePrimitiveControls(i), this.$module.setSelectedByZincObjects(i, void 0, {}, e); }, /** * A callback used by children components. Set the highlighted zinc object * * @arg Hovered zinc objects * @arg Flag to determine if callback should be triggered when new selection * is made */ objectHovered: function(i, e) { this.hoveredObjects = i, this.$module.setHighlightedByZincObjects(i, void 0, {}, e); }, /** * Set the selected by name. * * @param {} name Name of the group */ changeActiveByName: function(i, e, t) { const r = Array.isArray(i); if (i === void 0 || r && i.length === 0) this.$refs.scaffoldTreeControls.removeActive(t); else { let n = i; r || (n = [n]), this.$refs.scaffoldTreeControls.changeActiveByNames(n, e, t); } }, /** * Set the highlighted by name. * * @param {name} name Name of the group */ changeHighlightedByName: function(i, e, t) { const r = Array.isArray(i); if (i === void 0 || r && i.length === 0) this.$refs.scaffoldTreeControls.removeHover(t); else { let n = i; r || (n = [n]), this.$refs.scaffoldTreeControls.changeHoverByNames(n, e, t); } }, /** * @public * Start the animation. * * @arg "flag to turn the animation on/off" */ play: function(i) { this.$module.playAnimation(i), this.isPlaying = i; }, /** * @public * Function to toggle on/off overlay help. */ setHelpMode: function(i) { const e = this.hoverVisibilities.length, t = e - 1, r = this.hoverVisibilities[this.helpModeActiveIndex]; if (r) { const n = r == null ? void 0 : r.refs, o = r == null ? void 0 : r.ref; this.$refs[n || o] || (this.helpModeActiveIndex += 1); } i || (this.helpModeActiveIndex = this.helpModeInitialIndex), i && this.helpModeActiveIndex >= t && this.$emit("help-mode-last-item", !0), i && !this.helpModeDialog ? (this.inHelp = !0, this.hoverVisibilities.forEach((n) => { n.value = !0; })) : i && this.helpModeDialog && e > this.helpModeActiveIndex ? this.helpModeActiveIndex > -1 && setTimeout(() => { this.inHelp = !1, this.hoverVisibilities.forEach((n) => { n.value = !1; }), this.showHelpText(this.helpModeActiveIndex, 200); }, 300) : (this.inHelp = !1, this.hoverVisibilities.forEach((n) => { n.value = !1; })); }, /** * Callback function used by showRegionTooltip in the case when the tooltip * is out of view. */ displayTooltipOfObjectsCallback: function(i, e, t, r, n) { const o = this; return function() { o.$module.zincRenderer.removePostRenderCallbackFunction( o.$_regionTooltipCallback ), o.$_regionTooltipCallback = void 0, o.displayTooltipOfObjects(i, e, t, r, n); }; }, liveUpdateTooltipPosition: function() { this.$module.selectedCenter && (this.tData.x = this.$module.selectedScreenCoordinates.x, this.tData.y = this.$module.selectedScreenCoordinates.y); }, displayTooltipOfObjects: function(i, e, t, r, n) { if (e.length > 0) { let o = e[0].getClosestVertexDOMElementCoords( this.$module.scene ); if (o) return o.inView ? (i.includes("Search Results for") ? this.tData.active = !1 : this.tData.active = !0, this.tData.visible = !0, this.tData.label = i, this.tData.x = o.position.x, this.tData.y = o.position.y, this.tData.region = t, this.$_liveCoordinatesUpdated && this.$module.zincRenderer.removePostRenderCallbackFunction( this.$_liveCoordinatesUpdated ), n && (this.$module.setupLiveCoordinates(e), this.$_liveCoordinatesUpdated = this.$module.zincRenderer.addPostRenderCallbackFunction( this.liveUpdateTooltipPosition ))) : (this.hideRegionTooltip(), r && (this.$module.scene.viewAll(), this.$_regionTooltipCallback && this.$module.zincRenderer.removePostRenderCallbackFunction( this.$_regionTooltipCallback ), this.$_regionTooltipCallback = this.$module.zincRenderer.addPostRenderCallbackFunction( this.displayTooltipOfObjectsCallback( i, e, t, r, n ) ))), !0; } return this.hideRegionTooltip(), !1; }, /** * Display the tooltip used for displaying search result. * When resetView is set to true, it will * reset view if the tooltip is not in view. * Setting liveUpdates to true will update the tooltip location * at every rendering loop. */ showRegionTooltipWithObjects: function(i, e, t, r, n) { return i && e && e.length > 0 && this.$module.scene ? this.displayTooltipOfObjects( i, e, t, r, n ) : (this.hideRegionTooltip(), !1); }, /** * Display the tooltip. When resetView is set to true, it will * reset view if the tooltip is not in view. * Setting liveUpdates to true will update the tooltip location * at every rendering loop. */ showRegionTooltip: function(i, e, t) { if (i && this.$module.scene) { const r = this.$module.scene.getRootRegion(), n = Aa(r, [i], "", !0); let o; return n && n.length > 0 && (o = n[0].getRegion().getFullPath()), this.showRegionTooltipWithObjects( i, n, o, e, t ); } return this.hideRegionTooltip(), !1; }, /** * Display the tooltip using the list of annotations. * When resetView is set to true, it will * reset view if the tooltip is not in view. * Setting liveUpdates to true will update the tooltip location * at every rendering loop. */ showRegionTooltipWithAnnotations: function(i, e, t) { if (this.$module.scene) { const r = qv(this.$module.scene, i); if (r && r.objects.length > 0) if (this.annotationSidebar) { const n = { featureId: (this.tData.region ? this.tData.region + "/" : "") + this.tData.label, resourceId: this.url, resource: this.url }; this.$emit("annotation-open", { annotationEntry: n, createData: this.createData, confirmCreate: this.confirmCreate, cancelCreate: this.cancelCreate, confirmDelete: this.confirmDelete }); return; } else return this.showRegionTooltipWithObjects( r.label, r.objects, r.regionPath, e, t ); } return this.hideRegionTooltip(), !1; }, /** * Callback on viewing mode change * Optional, can be used to update the view mode. */ changeViewingMode: function(i) { if (this.$module) { if (i && (this.viewingMode = i), this.viewingMode === "Annotation") { let e = !1; this.userInformation && (e = !0), this.userInformation = void 0, this.annotator.authenticate(this.userToken).then((t) => { t.name && t.email && t.canUpdate && (this.userInformation = t, e || (Zv(this.annotator, this.userToken, this.url).then((r) => { r && r.features && jh(this.$module.scene, r.features); }), Zv(this.annotator, this.userToken, encodeURIComponent(this.url)).then((r) => { r && r.features && jh(this.$module.scene, r.features); }))); }); } else this.viewingMode === "Exploration" && (this.activeDrawTool = void 0, this.activeDrawMode = void 0, this.createData.shape = ""); this.viewingMode === "Exploration" || this.viewingMode === "Annotation" && this.createData.shape === "" ? this.$module.selectObjectOnPick = !0 : this.$module.selectObjectOnPick = !1, this.cancelCreate(); } }, /** * @public * Hide the tooltip */ hideRegionTooltip: function() { this.$_liveCoordinatesUpdated && (this.$module.zincRenderer.removePostRenderCallbackFunction( this.$_liveCoordinatesUpdated ), this.$module.setupLiveCoordinates(void 0)), this.tData.active = !1, this.tData.visible = !1, this.tData.region = void 0; }, /** * Set the marker modes for objects with the provided name, mode can * be "on", "off" or "inherited". * Value can either be number or an object containing number and * imgURL. */ setMarkerModeForObjectsWithName: function(i, e, t) { if (i && this.$module.scene) { let r = e; typeof e == "number" && (r = { number: e, imgURL: void 0 }); const n = this.$module.scene.getRootRegion(); Aa(n, [i], "", !0).forEach((o) => o.setMarkerMode(t, r)); } }, /** * @public * Set the marker modes for objects specified by the list of annotations * @arg `annotations` * @arg `mode` */ setMarkerModeWithAnnotations: function(i, e) { if (this.$module.scene) { const t = qv(this.$module.scene, i); t && t.objects.length > 0 && t.objects.forEach((r) => r.setMarkerMode(e)); } }, /** * This is called when mouse cursor enters supported elements * with help tootltips. */ showHelpText: function(i, e = 500) { this.inHelp || (clearTimeout(this.helpTextWait[i]), this.helpTextWait[i] = setTimeout(() => { this.hoverVisibilities[i].value = !0, this.$emit("shown-tooltip"); }, e)); }, /** * This is called when mouse cursor exits supported element.. */ hideHelpText: function(i, e = 500) { this.inHelp || (clearTimeout(this.helpTextWait[i]), this.helpTextWait[i] = setTimeout(() => { this.hoverVisibilities[i].value = !1; }, e)); }, /** * @public * * Search a object and display the tooltip * @arg "text to search across" * @arg "toggle the tooltip if this is set" */ search: function(i, e) { if (this.$_searchIndex) { if (i === void 0 || i === "" || Array.isArray(i) && i.length === 0) return this.lastSelected.region = "", this.lastSelected.group = "", this.lastSelected.isSearch = !0, this.objectSelected([], !0), !1; { this.lastSelected.region = "", this.lastSelected.group = i, this.lastSelected.isSearch = !0; const t = this.$_searchIndex.searchAndProcessResult(i), r = t.zincObjects; if (r.length > 0) { if (this.objectSelected(r, !0), e) for (let n = 0; n < r.length; n++) r[n] && r[n].groupName && this.showRegionTooltipWithObjects( t.label, r, t.regionPath, !0, !0 ); return !0; } else this.objectSelected([], !0); } } return !1; }, /** * @public * * Get the list of suggested terms based on the provided term. * This can be used for autocomplete. * @arg `term` */ fetchSuggestions: function(i) { return this.$_searchIndex === void 0 ? [] : this.$_searchIndex.auto_suggest(i); }, /** * Called when minimap settings has changed. Pass the * parameters to ZincJS and marked it for update. */ updateMinimapScissor: function() { Object.keys(this.minimapSettings).forEach((i) => { this.$module.scene.minimapScissor[i] = this.minimapSettings[i]; }), this.$module.scene.minimapScissor.updateRequired = !0; }, updateSettingsfromScene: function() { this.currentSpeed = 1, this.$module.setPlayRate(this.defaultRate), this.orginalDuration = this.$module.scene.getMetadataTag("OriginalDuration"), this.animateDuration = this.$module.scene.getMetadataTag("Duration"); let i = this.$module.scene.getMetadataTag("TimeStamps"); this.timeStamps = {}; for (const e in i) this.timeStamps[i[e]] = e; this.timeMax = this.$module.scene.getDuration(); }, restoreSettings: function(i) { if (i) { if (i.viewport) this.$module.scene.getZincCameraControls().setCurrentCameraSettings(i.viewport); else if (i.viewURL && i.viewURL !== "") { const t = new URL(i.viewURL, this.url); this.$module.scene.loadViewURL(t); } else i.region && i.region !== "" && this.viewRegion(i.region); i.visibility && this.$nextTick(() => { this.$refs.scaffoldTreeControls.setState(i.visibility); }), i.background && this.backgroundChangeCallback(i.background), i.viewingMode && this.changeViewingMode(i.viewingMode); const e = i.search; e && e.group && (e.isSearch ? this.search(e.group, !0) : this.changeActiveByName(e.group, e.region, !0)); } }, downloadErrorCallback: function() { return (i) => { this.$emit("on-error", i); }; }, setURLFinishCallback: function(i) { return () => { this.localAnnotationsList.length = 0, this.updateSettingsfromScene(), this.$module.updateTime(0.01), this.$module.updateTime(0), this.$module.unsetFinishDownloadCallback(), this.addRegionsToSearchIndex(), this.$emit("on-ready"), this.setMarkers(), this._boundingBoxGeo = this.$module.scene.addBoundingBoxPrimitive( "_helper", "boundingBox", 4251856, 0.15 ), this._slides = this.$module.scene.addSlicesPrimitive( "_helper", ["x-plane", "y-plane", "z-plane"], [16733525, 5635925, 5592575], 0.5 ); const { centre: e, size: t } = this.$module.getCentreAndSize(); this.boundingDims.centre = e, this.boundingDims.size = t, this.$nextTick(() => this.restoreSettings(i)), this.isReady = !0; }; }, /** * Function used for getting the current states of the scene. This exported states * can be imported using the importStates method. * * @public */ getState: function() { let i = { format: this.fileFormat, url: this._currentURL, viewport: void 0, visibility: void 0, background: this.currentBackground, viewingMode: this.viewingMode }; if (this.$refs.scaffoldTreeControls && (i.visibility = this.$refs.scaffoldTreeControls.getState()), this.$module.scene) { let e = this.$module.scene.getZincCameraControls(); i.viewport = e.getCurrentViewport(); } return this.lastSelected && this.lastSelected.group && (i.search = { ...this.lastSelected }), i; }, /** * Function used for importing the states of the scene. This exported states * can be imported using the read states method. * * @public * @arg `state` */ setState: function(i) { i && (i.url && i.url !== this._currentURL ? this.setURLAndState(i.url, { fileFormat: i.fileFormat, viewport: i.viewport, visibility: i.visibility, background: i.background, viewingMode: this.viewingMode, search: i.search }) : (i.background || i.search || i.viewport || i.viewingMode || i.visibility) && (this.isReady && this.$module.scene ? this.restoreSettings(i) : this.$module.setFinishDownloadCallback( this.setURLFinishCallback({ background: i.background, viewingMode: i.viewingMode, viewport: i.viewport, visibility: i.visibility, search: i.search }) ))); }, /** * export current scene in GLTF. * @arg "Return in binary form when set to true" * * @public */ exportGLTF: function(i) { return this.$module.scene.exportGLTF(i); }, /** * Return a copy of the local annotations list. * This list is used for storing user created annotation * when enableLocalAnnotations is set to true. * * @public */ getLocalAnnotations: function() { return [...this.localAnnotationsList]; }, /** * Import local annotations. The annotations will only * be imported when enableLocalAnnotations is set to * true; * * @public * @arg {Array} `annotationsList` */ importLocalAnnotations: function(i) { if (this.enableLocalAnnotations) { i.forEach((t) => { const r = t.group, n = t.region; let o = n.slice(-1) === "/" ? n : n + "/"; const a = o.slice(0, -1); t.region = a, o = o + r; const s = o; t.item.id = s, t.feature.id = s; }); const e = i.map((t) => t.feature); jh(this.$module.scene, e), i.forEach((t) => { this.localAnnotationsList.push({ ...t }); }); } }, /** * Function used for reading in new scaffold metadata and a custom * viewport. This function will ignore the state prop and * read in the new url. * * @public * @arg `newValue` * @arg `state` */ setURLAndState: function(i, e) { i != this._currentURL && (e != null && e.format && (this.fileFormat = e.format), this._currentURL = i, this.$refs.scaffoldTreeControls && this.$refs.scaffoldTreeControls.clear(), this.loading = !0, this.timeVarying = !1, this.isReady = !1, this.$_searchIndex.removeAll(), this.hideRegionTooltip(), this.$module.setDownloadErrorCallback( this.downloadErrorCallback() ), this.$module.setFinishDownloadCallback( this.setURLFinishCallback({ background: e == null ? void 0 : e.background, region: this.region, search: e == null ? void 0 : e.search, viewingMode: e == null ? void 0 : e.viewingMode, viewURL: this.viewURL, viewport: e == null ? void 0 : e.viewport, visibility: e == null ? void 0 : e.visibility }) ), this.fileFormat === "gltf" ? this.$module.loadGLTFFromURL(i, "scene", !0) : this.$module.loadOrgansFromURL( i, void 0, void 0, "scene", void 0, !0 ), this.$module && this.$module.scene && (this.$module.scene.displayMarkers = this.displayMarkers, this.$module.scene.forcePickableObjectsUpdate = !0, this.$module.scene.displayMinimap = this.displayMinimap, this.updateMinimapScissor())); }, /** * Function used for reading in new scaffold metadata. This function will ignore * the state prop and read in the new url. * * @public * @arg `newValue` */ setURL: function(i) { this.setURLAndState(i, void 0); }, /** * Callback when drawer is toggled. */ drawerToggled: function(i) { this.drawerOpen = i, this.adjustLayout(); }, /** * Callback using ResizeObserver. */ adjustLayout: function() { if (this.$refs.scaffoldContainer) { let i = this.$refs.scaffoldContainer.clientWidth; this.minimisedSlider = i < 812, this.minimisedSlider ? this.sliderPosition = this.drawerOpen ? "right" : "left" : this.sliderPosition = ""; } }, toggleRendering: function(i) { this.$module.zincRenderer && (i ? this.$module.zincRenderer.animate() : this.$module.zincRenderer.stopAnimate()); }, /** * @public * * Force the renderer to resize */ forceResize: function() { this.$module.zincRenderer && this.$module.zincRenderer.onWindowResize(); }, syncControlCallback: function() { const i = this.$module.NDCCameraControl.getPanZoom(); this.tData.visible && this.showRegionTooltip(this.tData.label, !0, !0), this.$emit("scaffold-navigated", i); }, /** * Rotate mode - "none", "horizontal", "vertical", "free" but * it will be ignored if flag is set to false. */ toggleSyncControl: function(i, e) { this.$module.toggleSyncControl(i, e), this.$module.setSyncControlCallback(this.syncControlCallback); }, /** * Set the markers for the scene. */ setMarkers: function() { for (const [i, e] of Object.entries(this.markerLabels)) this.setMarkerModeForObjectsWithName(i, e, "on"); } } }, Vf = (i) => (Mw("data-v-3f6a68de"), i = i(), Sw(), i), Zz = { ref: "scaffoldContainer", class: "scaffold-container", "element-loading-text": "Loading...", "element-loading-background": "rgba(0, 0, 0, 0.3)" }, Yz = /* @__PURE__ */ Vf(() => /* @__PURE__ */ ke("span", { class: "message-text" }, "Beta", -1)), Jz = /* @__PURE__ */ Vf(() => /* @__PURE__ */ ke("span", { class: "message-text" }, "What's new?", -1)), Kz = { class: "primitive-controls-box" }, Qz = { class: "animation-data" }, eF = { class: "purple" }, tF = { class: "animation-data" }, iF = { class: "purple" }, rF = { class: "animation-data" }, nF = { class: "bottom-right-control" }, oF = /* @__PURE__ */ Vf(() => /* @__PURE__ */ ke("div", null, [ /* @__PURE__ */ vt(" Fit to "), /* @__PURE__ */ ke("br"), /* @__PURE__ */ vt(" window ") ], -1)), aF = { style: { "margin-bottom": "2px" } }, sF = { key: 0, class: "viewing-mode-title" }, lF = ["onClick"], cF = ["onClick"]; function uF(i, e, t, r, n, o) { const a = Ei("map-svg-sprite-color"), s = H1, c = Ei("DrawToolbar"), l = P0, h = Dt, u = _u, p = z1, g = k1, m = Ei("map-svg-icon"), d = ar, y = Ur, f = Iy, v = ss, M = as, S = Py, T = os, x = gd; return It((ge(), Le("div", Zz, [ le(a), le(s, { createData: i.createData, label: i.tData.label, region: i.tData.region, visible: i.tData.visible, x: i.tData.x, y: i.tData.y, annotationDisplay: o.annotationDisplay, onConfirmCreate: e[0] || (e[0] = (w) => o.confirmCreate(w)), onCancelCreate: e[1] || (e[1] = (w) => o.cancelCreate()), onConfirmDelete: e[2] || (e[2] = (w) => o.confirmDelete()), onTooltipHide: e[3] || (e[3] = (w) => o.onTooltipHide()) }, null, 8, ["createData", "label", "region", "visible", "x", "y", "annotationDisplay"]), ke("div", { id: "organsDisplayArea", ref: "display", tabindex: "-1", style: { height: "100%", width: "100%" }, onKeydown: e[4] || (e[4] = mr((...w) => o.backgroundChangeCallback && o.backgroundChangeCallback(...w), ["66"])) }, null, 544), It(ke("div", null, [ i.viewingMode === "Annotation" && (i.userInformation || t.enableLocalAnnotations) ? (ge(), Ue(c, { key: 0, toolbarOptions: i.toolbarOptions, activeDrawTool: i.activeDrawTool, activeDrawMode: i.activeDrawMode, hoverVisibilities: i.hoverVisibilities, onClickToolbar: o.toggleDrawing, onShowTooltip: o.showHelpText, onHideTooltip: o.hideHelpText, ref: "toolbarPopover" }, null, 8, ["toolbarOptions", "activeDrawTool", "activeDrawMode", "hoverVisibilities", "onClickToolbar", "onShowTooltip", "onHideTooltip"])) : Ve("", !0), t.displayWarning ? (ge(), Ue(u, { key: 1, ref: "warningPopover", visible: i.hoverVisibilities[7].value, content: t.warningMessage, placement: "right", width: "max-content", teleported: !1, "popper-class": "scaffold-popper message-popper right-popper non-selectable" }, { reference: me(() => [ t.displayWarning ? (ge(), Le("div", { key: 0, class: "message-icon warning-icon", onMouseover: e[5] || (e[5] = (w) => o.showHelpText(7)), onMouseout: e[6] || (e[6] = (w) => o.hideHelpText(7)) }, [ le(h, null, { default: me(() => [ le(l) ]), _: 1 }), Yz ], 32)) : Ve("", !0) ]), _: 1 }, 8, ["visible", "content"])) : Ve("", !0), t.displayLatestChanges ? (ge(), Ue(u, { key: 2, visible: i.hoverVisibilities[8].value, content: t.latestChangesMessage, placement: "right", teleported: !1, trigger: "manual", "popper-class": "scaffold-popper message-popper right-popper non-selectable", ref: "whatsNewPopover" }, { reference: me(() => [ t.displayLatestChanges && t.latestChangesMessage ? (ge(), Le("div", { key: 0, class: "el-icon-warning message-icon latest-changesicon", onMouseover: e[7] || (e[7] = (w) => o.showHelpText(8)), onMouseout: e[8] || (e[8] = (w) => o.hideHelpText(8)) }, [ le(h, null, { default: me(() => [ le(l) ]), _: 1 }), Jz ], 32)) : Ve("", !0) ]), _: 1 }, 8, ["visible", "content"])) : Ve("", !0), le(u, { visible: i.hoverVisibilities[6].value, content: "Change region visibility", placement: "right", width: "max-content", teleported: !1, trigger: "manual", "popper-class": "scaffold-popper right-popper non-selectable", ref: "regionVisibilityPopover" }, { reference: me(() => [ le(p, { ref: "scaffoldTreeControls", isReady: i.isReady, "show-colour-picker": t.showColourPicker, onObjectSelected: o.objectSelected, onObjectHovered: o.objectHovered, onDrawerToggled: o.drawerToggled }, null, 8, ["isReady", "show-colour-picker", "onObjectSelected", "onObjectHovered", "onDrawerToggled"]) ]), _: 1 }, 8, ["visible"]), ke("div", Kz, [ le(g, { ref: "primitiveControls", createData: i.createData, onPrimitivesUpdated: o.primitivesUpdated }, null, 8, ["createData", "onPrimitivesUpdated"]) ]), i.timeVarying ? (ge(), Ue(u, { key: 3, ref: "sliderPopover", width: "max-content", visible: i.hoverVisibilities[5].value, content: "Move the slider to animate the region", placement: "top", teleported: !1, trigger: "manual", "popper-class": "scaffold-popper top-popper non-selectable" }, { reference: me(() => [ i.timeVarying ? (ge(), Le("div", { key: 0, class: Re(["time-slider-container", [i.minimisedSlider ? "minimised" : "", i.sliderPosition]]) }, [ le(S, { type: "card" }, { default: me(() => [ le(f, { label: "Animate scaffold" }, { default: me(() => [ le(y, { class: "tab-content" }, { default: me(() => [ i.isPlaying ? (ge(), Ue(m, { key: 0, icon: "pause", class: "icon-button video-button", onClick: e[9] || (e[9] = (w) => o.play(!1)) })) : (ge(), Ue(m, { key: 1, icon: "play", class: "video-button icon-button", onClick: e[10] || (e[10] = (w) => o.play(!0)) })), le(d, { min: 0, max: i.timeMax, "model-value": i.currentTime / 100 * i.timeMax, step: 0.1, "tooltip-class": "time-slider-tooltip", class: "slider", "format-tooltip": o.formatTooltip, marks: i.timeStamps, onInput: e[11] || (e[11] = (w) => o.timeChange(w)) }, null, 8, ["max", "model-value", "format-tooltip", "marks"]) ]), _: 1 }) ]), _: 1 }), le(f, { label: "Animation data" }, { default: me(() => [ le(y, { class: "tab-content" }, { default: me(() => [ ke("div", Qz, [ vt(" Original duration: "), ke("div", eF, xt(i.orginalDuration), 1) ]), ke("div", tF, [ vt(" Animation duration: "), ke("div", iF, xt(i.animateDuration), 1) ]), ke("div", rF, [ vt(" Playback speed "), le(M, { teleported: !0, "model-value": i.currentSpeed, placeholder: "Select", class: "scaffold-select-box speed", "popper-class": "scaffold_viewer_dropdown", onChange: e[12] || (e[12] = (w) => o.speedChanged(w)) }, { default: me(() => [ (ge(!0), Le(Vt, null, tr(i.playSpeed, (w) => (ge(), Ue(v, { key: w.value, label: w.label, value: w.value }, null, 8, ["label", "value"]))), 128)) ]), _: 1 }, 8, ["model-value"]) ]) ]), _: 1 }) ]), _: 1 }) ]), _: 1 }) ], 2)) : Ve("", !0) ]), _: 1 }, 8, ["visible"])) : Ve("", !0), ke("div", nF, [ le(u, { visible: i.hoverVisibilities[0].value, content: "Zoom in", width: "max-content", placement: "left", teleported: !1, trigger: "manual", "popper-class": "scaffold-popper left-popper non-selectable", ref: "zoomInPopover" }, { reference: me(() => [ le(m, { icon: "zoomIn", class: "icon-button zoomIn", onClick: e[13] || (e[13] = (w) => o.zoomIn()), onMouseover: e[14] || (e[14] = (w) => o.showHelpText(0)), onMouseout: e[15] || (e[15] = (w) => o.hideHelpText(0)) }) ]), _: 1 }, 8, ["visible"]), le(u, { visible: i.hoverVisibilities[1].value, content: "Zoom out", placement: "top-end", width: "max-content", teleported: !1, trigger: "manual", "popper-class": "scaffold-popper popper-zoomout non-selectable", ref: "zoomOutPopover" }, { reference: me(() => [ le(m, { icon: "zoomOut", class: "icon-button zoomOut", onClick: e[16] || (e[16] = (w) => o.zoomOut()), onMouseover: e[17] || (e[17] = (w) => o.showHelpText(1)), onMouseout: e[18] || (e[18] = (w) => o.hideHelpText(1)) }) ]), _: 1 }, 8, ["visible"]), le(u, { visible: i.hoverVisibilities[2].value, placement: "top", teleported: !1, trigger: "manual", width: "max-content", "popper-class": "scaffold-popper non-selectable", ref: "zoomFitPopover" }, { reference: me(() => [ le(m, { icon: "fitWindow", class: "icon-button fitWindow", onClick: e[19] || (e[19] = (w) => o.fitWindow()), onMouseover: e[20] || (e[20] = (w) => o.showHelpText(2)), onMouseout: e[21] || (e[21] = (w) => o.hideHelpText(2)) }) ]), default: me(() => [ oF ]), _: 1 }, 8, ["visible"]) ]), i.openMapRef ? (ge(), Ue(u, { key: 4, ref: "open-map-popover", "virtual-ref": i.openMapRef, placement: "top-start", width: "128", teleported: !1, trigger: "click", "popper-class": "open-map-popper", "virtual-triggering": "" }, { default: me(() => [ (ge(!0), Le(Vt, null, tr(t.openMapOptions, (w) => (ge(), Ue(y, { key: w.key }, { default: me(() => [ le(T, { type: "primary", plain: "", onClick: (A) => i.$emit("open-map", w.key) }, { default: me(() => [ vt(xt(w.display), 1) ]), _: 2 }, 1032, ["onClick"]) ]), _: 2 }, 1024))), 128)) ]), _: 1 }, 8, ["virtual-ref"])) : Ve("", !0), le(u, { ref: "backgroundPopover", "virtual-ref": i.backgroundIconRef, placement: "top-start", width: "128", teleported: !1, trigger: "click", "popper-class": "background-popper non-selectable h-auto", "virtual-triggering": "" }, { default: me(() => [ ke("div", null, [ le(y, { class: "backgroundText" }, { default: me(() => [ vt("Viewing Mode") ]), _: 1 }), le(y, { class: "backgroundControl" }, { default: me(() => [ ke("div", aF, [ (ge(!0), Le(Vt, null, tr(i.viewingModes, (w, A, _) => (ge(), Le(Vt, { key: A }, [ A === i.viewingMode ? (ge(), Le("span", sF, [ ke("b", null, xt(A), 1) ])) : (ge(), Le("span", { key: 1, class: "viewing-mode-unselected", onClick: (E) => o.changeViewingMode(A) }, xt(A), 9, lF)) ], 64))), 128)) ]), le(y, { class: "viewing-mode-description" }, { default: me(() => [ vt(xt(o.modeDescription), 1) ]), _: 1 }) ]), _: 1 }), le(y, { class: "backgroundSpacer" }), le(y, { class: "backgroundText" }, { default: me(() => [ vt(" Change background ") ]), _: 1 }), le(y, { class: "backgroundChooser" }, { default: me(() => [ (ge(!0), Le(Vt, null, tr(i.availableBackground, (w) => (ge(), Le("div", { key: w, class: Re([ "backgroundChoice", w, w == i.currentBackground ? "active" : "" ]), onClick: (A) => o.backgroundChangeCallback(w) }, null, 10, cF))), 128)) ]), _: 1 }) ]) ]), _: 1 }, 8, ["virtual-ref"]), ke("div", { class: Re(["settings-group", { open: i.drawerOpen, close: !i.drawerOpen }]) }, [ le(y, null, { default: me(() => [ le(u, { visible: i.hoverVisibilities[3].value, content: "Open new map", placement: "right", teleported: !1, trigger: "manual", width: "max-content", "popper-class": "scaffold-popper right-popper non-selectable", ref: "openMapPopover" }, { reference: me(() => [ t.enableOpenMapUI && t.openMapOptions.length > 0 ? (ge(), Ue(m, { key: 0, ref: "openMapRef", icon: "openMap", class: "icon-button open-map-button", onMouseover: e[22] || (e[22] = (w) => o.showHelpText(3)), onMouseout: e[23] || (e[23] = (w) => o.hideHelpText(3)) }, null, 512)) : Ve("", !0) ]), _: 1 }, 8, ["visible"]) ]), _: 1 }), le(y, null, { default: me(() => [ le(u, { visible: i.hoverVisibilities[4].value, content: "Change background color", placement: "right", width: "max-content", teleported: !1, trigger: "manual", "popper-class": "scaffold-popper right-popper non-selectable", ref: "settingsPopover" }, { reference: me(() => [ le(m, { ref: "backgroundIconRef", icon: "changeBckgd", class: "icon-button", onMouseover: e[24] || (e[24] = (w) => o.showHelpText(4)), onMouseout: e[25] || (e[25] = (w) => o.hideHelpText(4)) }, null, 512) ]), _: 1 }, 8, ["visible"]) ]), _: 1 }) ], 2) ], 512), [ [fi, t.displayUI && !i.isTransitioning] ]) ])), [ [x, i.loading] ]); } const hF = /* @__PURE__ */ xn(Xz, [["render", uF], ["__scopeId", "data-v-3f6a68de"]]), dF = { name: "Scaffold", mixins: [aw], components: { ScaffoldVuer: hF, HelpModeDialog: ow }, methods: { onResize: function() { this.scaffoldCamera.onResize(); }, getState: function() { return this.$refs.scaffold.getState(); }, /** * Perform a local search on this contentvuer */ search: function(i) { return this.$refs.scaffold.search(i, !0); }, searchSuggestions: function(i, e) { if (i === "" || !this.$refs.scaffold) return e; this.$refs.scaffold.fetchSuggestions(i).forEach((r) => { r.suggestion && e.push(r.suggestion); }); }, /** * Handle sync pan zoom event */ handleSyncPanZoomEvent: function(i) { if (!this.mouseHovered && i.type !== this.entry.type) { const e = i.payload.origin, t = i.payload.size, r = [e[0] + t[0] / 2, e[1] + t[1] / 2], n = [ (r[0] - 0.5) * 2, (0.5 - r[1]) * 2 ], o = 1 / Math.max(t[0], t[1]); this.$refs.scaffold.$module.setSyncControlCenterZoom( n, o ); } }, displayTooltip: function(i) { let e; i && (e = i.name), e ? this.$refs.scaffold.search(e, !0) : this.$refs.scaffold.hideRegionTooltip(); }, zoomToFeatures: function(i, e) { let t; Array.isArray(i) ? t = i : t = [i.name], e && this.$refs.scaffold.changeActiveByName(t, "", !1), this.$refs.scaffold.viewRegion(t); }, highlightFeatures: function(i) { let e; Array.isArray(i) ? e = i : e = [i.name], this.$refs.scaffold.changeHighlightedByName(e, "", !1); }, scaffoldIsReady: function() { if (this.scaffoldLoaded = !0, this.$refs.scaffold.$module.graphicsHighlight.highlightColour = [1, 0, 1], this.isVisible()) { let i = "free"; this.entry.rotation && (i = this.entry.rotation), this.$refs.scaffold.toggleSyncControl(this.splitFlowStore.globalCallback, i), this.splitFlowStore.syncMode && this.$refs.scaffold.fitWindow(); } Wu.emit("mapLoaded", this.$refs.scaffold); }, requestSynchronisedEvent: function(i) { if (this.scaffoldLoaded) { let e = "free"; this.entry.rotation && (e = this.entry.rotation), this.$refs.scaffold.toggleSyncControl(i, e); } }, /** * Callback when the vuers emit a selected event. */ scaffoldHighlighted: function(i, e) { var r, n, o; const t = { paneIndex: this.entry.id, type: i, resource: e, internalName: void 0 }; e && e[0] && ((((r = e[0].data) == null ? void 0 : r.id) === void 0 || ((n = e[0].data) == null ? void 0 : n.id) === "") && (e[0].data.id = (o = e[0].data) == null ? void 0 : o.group), t.internalName = e[0].data.id, t.eventType = "highlighted"), this.$emit("resource-selected", t); }, /** * Callback when the vuers emit a selected event. */ scaffoldNavigated: function(i, e) { if (this.mouseHovered) { const t = { paneIndex: this.entry.id, eventType: "panZoom", payload: e, type: i }; this.$emit("resource-selected", t); } }, updateWithViewUrl: function(i) { this.$refs.scaffold.updateViewURL(i); }, /** * Change the view mode of the current scaffold */ changeViewingMode: function(i) { this.$refs.scaffold.changeViewingMode(i); } }, computed: { warningMessage: function() { return this.entry.isBodyScaffold ? "This map displays the anatomical location and connectivity of nerves, through which the neuron populations from the ApiNATOMY models available in SCKAN can be routed." : "Under active development"; }, markerLabels: function() { return this.settingsStore.numberOfDatasetsForFacets; } }, data: function() { return { apiLocation: process.env.VUE_APP_API_LOCATION, scaffoldCamera: void 0, scaffoldLoaded: !1 }; }, mounted: function() { this.scaffoldCamera = this.$refs.scaffold.$module.scene.getZincCameraControls(), Wu.on("startHelp", () => { this.startHelp(); }), Wu.on("hoverUpdate", () => { this.scaffoldLoaded && this.mapHoverHighlight(this.$refs.scaffold); }); } }, pF = { class: "viewer-container" }; function fF(i, e, t, r, n, o) { const a = Ei("ScaffoldVuer"), s = Ei("HelpModeDialog"); return ge(), Le("div", pF, [ le(a, { state: i.entry.state, url: i.entry.resource, region: i.entry.region, onScaffoldSelected: e[0] || (e[0] = (c) => i.resourceSelected(i.entry.type, c, !0)), onScaffoldHighlighted: e[1] || (e[1] = (c) => o.scaffoldHighlighted(i.entry.type, c)), onScaffoldNavigated: e[2] || (e[2] = (c) => o.scaffoldNavigated(i.entry.type, c)), onOnReady: o.scaffoldIsReady, onOpenMap: i.openMap, ref: "scaffold", "background-toggle": !0, traditional: !0, helpMode: i.helpMode, helpModeActiveItem: i.helpModeActiveItem, helpModeDialog: i.useHelpModeDialog, onAnnotationOpen: i.onAnnotationOpen, onAnnotationClose: i.onAnnotationClose, annotationSidebar: i.annotationSidebar, onHelpModeLastItem: i.onHelpModeLastItem, onShownTooltip: i.onTooltipShown, onShownMapTooltip: i.onMapTooltipShown, render: i.visible, "display-latest-message": !0, "warning-message": o.warningMessage, "display-minimap": !1, "display-markers": !1, enableOpenMapUI: !0, "view-u-r-l": i.entry.viewUrl, markerCluster: !0, markerLabels: o.markerLabels, flatmapAPI: i.flatmapAPI }, null, 8, ["state", "url", "region", "onOnReady", "onOpenMap", "helpMode", "helpModeActiveItem", "helpModeDialog", "onAnnotationOpen", "onAnnotationClose", "annotationSidebar", "onHelpModeLastItem", "onShownTooltip", "onShownMapTooltip", "render", "warning-message", "view-u-r-l", "markerLabels", "flatmapAPI"]), i.helpMode && i.useHelpModeDialog ? (ge(), Ue(s, { key: 0, ref: "scaffoldHelp", scaffoldRef: i.scaffoldRef, lastItem: i.helpModeLastItem, onShowNext: i.onHelpModeShowNext, onFinishHelpMode: i.onFinishHelpMode }, null, 8, ["scaffoldRef", "lastItem", "onShowNext", "onFinishHelpMode"])) : Ve("", !0) ]); } const yF = /* @__PURE__ */ nw(dF, [["render", fF], ["__scopeId", "data-v-343030f1"]]); export { yF as default };