PageSourceSearch

https://www.sevres-pratique.com/web/js/canvas.js

js sevres-pratique.com collected 2026-10-02 14:21:17 UTC 863,664 bytes, 24,707 lines download raw bytes

1/**
2 * Created by yuanweihai on 2017/6/20.
3 */
4!(function (a, b) {
5  'object' == typeof exports && 'undefined' != typeof module
6    ? b(exports)
7    : 'function' == typeof define && define.amd
8    ? define(['exports'], b)
9    : b((a.THREE = a.THREE || {}))
10})(this, function (a) {
11  'use strict'
12  function b() {}
13  function ub(a, b) {
14    ;(this.x = a || 0), (this.y = b || 0)
15  }
16  function wb(a, b, c, d, e, f, g, h, i, j) {
17    Object.defineProperty(this, 'id', { value: vb++ }),
18      (this.uuid = tb.generateUUID()),
19      (this.name = ''),
20      (this.image = void 0 !== a ? a : wb.DEFAULT_IMAGE),
21      (this.mipmaps = []),
22      (this.mapping = void 0 !== b ? b : wb.DEFAULT_MAPPING),
23      (this.wrapS = void 0 !== c ? c : oa),
24      (this.wrapT = void 0 !== d ? d : oa),
25      (this.magFilter = void 0 !== e ? e : ta),
26      (this.minFilter = void 0 !== f ? f : va),
27      (this.anisotropy = void 0 !== i ? i : 1),
28      (this.format = void 0 !== g ? g : Ka),
29      (this.type = void 0 !== h ? h : wa),
30      (this.offset = new ub(0, 0)),
31      (this.repeat = new ub(1, 1)),
32      (this.generateMipmaps = !0),
33      (this.premultiplyAlpha = !1),
34      (this.flipY = !0),
35      (this.unpackAlignment = 4),
36      (this.encoding = void 0 !== j ? j : jb),
37      (this.version = 0),
38      (this.onUpdate = null)
39  }
40  function xb(a, b, c, d) {
41    ;(this.x = a || 0),
42      (this.y = b || 0),
43      (this.z = c || 0),
44      (this.w = void 0 !== d ? d : 1)
45  }
46  function yb(a, b, c) {
47    ;(this.uuid = tb.generateUUID()),
48      (this.width = a),
49      (this.height = b),
50      (this.scissor = new xb(0, 0, a, b)),
51      (this.scissorTest = !1),
52      (this.viewport = new xb(0, 0, a, b)),
53      (c = c || {}),
54      void 0 === c.minFilter && (c.minFilter = ta),
55      (this.texture = new wb(
56        void 0,
57        void 0,
58        c.wrapS,
59        c.wrapT,
60        c.magFilter,
61        c.minFilter,
62        c.format,
63        c.type,
64        c.anisotropy,
65        c.encoding
66      )),
67      (this.depthBuffer = void 0 === c.depthBuffer || c.depthBuffer),
68      (this.stencilBuffer = void 0 === c.stencilBuffer || c.stencilBuffer),
69      (this.depthTexture = void 0 !== c.depthTexture ? c.depthTexture : null)
70  }
71  function zb(a, b, c) {
72    yb.call(this, a, b, c),
73      (this.activeCubeFace = 0),
74      (this.activeMipMapLevel = 0)
75  }
76  function Ab(a, b, c, d) {
77    ;(this._x = a || 0),
78      (this._y = b || 0),
79      (this._z = c || 0),
80      (this._w = void 0 !== d ? d : 1)
81  }
82  function Bb(a, b, c) {
83    ;(this.x = a || 0), (this.y = b || 0), (this.z = c || 0)
84  }
85  function Cb() {
86    ;(this.elements = new Float32Array([
87      1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1
88    ])),
89      arguments.length > 0 &&
90        console.error(
91          'THREE.Matrix4: the constructor no longer reads arguments. use .set() instead.'
92        )
93  }
94  function Db(a, b, c, d, e, f, g, h, i, j) {
95    ;(a = void 0 !== a ? a : []),
96      (b = void 0 !== b ? b : ga),
97      wb.call(this, a, b, c, d, e, f, g, h, i, j),
98      (this.flipY = !1)
99  }
100  function Gb() {
101    ;(this.seq = []), (this.map = {})
102  }
103  function Jb(a, b, c) {
104    var d = a[0]
105    if (d <= 0 || d > 0) return a
106    var e = b * c,
107      f = Hb[e]
108    if ((void 0 === f && ((f = new Float32Array(e)), (Hb[e] = f)), 0 !== b)) {
109      d.toArray(f, 0)
110      for (var g = 1, h = 0; g !== b; ++g) (h += c), a[g].toArray(f, h)
111    }
112    return f
113  }
114  function Kb(a, b) {
115    var c = Ib[b]
116    void 0 === c && ((c = new Int32Array(b)), (Ib[b] = c))
117    for (var d = 0; d !== b; ++d) c[d] = a.allocTextureUnit()
118    return c
119  }
120  function Lb(a, b) {
121    a.uniform1f(this.addr, b)
122  }
123  function Mb(a, b) {
124    a.uniform1i(this.addr, b)
125  }
126  function Nb(a, b) {
127    void 0 === b.x
128      ? a.uniform2fv(this.addr, b)
129      : a.uniform2f(this.addr, b.x, b.y)
130  }
131  function Ob(a, b) {
132    void 0 !== b.x
133      ? a.uniform3f(this.addr, b.x, b.y, b.z)
134      : void 0 !== b.r
135      ? a.uniform3f(this.addr, b.r, b.g, b.b)
136      : a.uniform3fv(this.addr, b)
137  }
138  function Pb(a, b) {
139    void 0 === b.x
140      ? a.uniform4fv(this.addr, b)
141      : a.uniform4f(this.addr, b.x, b.y, b.z, b.w)
142  }
143  function Qb(a, b) {
144    a.uniformMatrix2fv(this.addr, !1, b.elements || b)
145  }
146  function Rb(a, b) {
147    a.uniformMatrix3fv(this.addr, !1, b.elements || b)
148  }
149  function Sb(a, b) {
150    a.uniformMatrix4fv(this.addr, !1, b.elements || b)
151  }
152  function Tb(a, b, c) {
153    var d = c.allocTextureUnit()
154    a.uniform1i(this.addr, d), c.setTexture2D(b || Eb, d)
155  }
156  function Ub(a, b, c) {
157    var d = c.allocTextureUnit()
158    a.uniform1i(this.addr, d), c.setTextureCube(b || Fb, d)
159  }
160  function Vb(a, b) {
161    a.uniform2iv(this.addr, b)
162  }
163  function Wb(a, b) {
164    a.uniform3iv(this.addr, b)
165  }
166  function Xb(a, b) {
167    a.uniform4iv(this.addr, b)
168  }
169  function Yb(a) {
170    switch (a) {
171      case 5126:
172        return Lb
173      case 35664:
174        return Nb
175      case 35665:
176        return Ob
177      case 35666:
178        return Pb
179      case 35674:
180        return Qb
181      case 35675:
182        return Rb
183      case 35676:
184        return Sb
185      case 35678:
186        return Tb
187      case 35680:
188        return Ub
189      case 5124:
190      case 35670:
191        return Mb
192      case 35667:
193      case 35671:
194        return Vb
195      case 35668:
196      case 35672:
197        return Wb
198      case 35669:
199      case 35673:
200        return Xb
201    }
202  }
203  function Zb(a, b) {
204    a.uniform1fv(this.addr, b)
205  }
206  function $b(a, b) {
207    a.uniform1iv(this.addr, b)
208  }
209  function _b(a, b) {
210    a.uniform2fv(this.addr, Jb(b, this.size, 2))
211  }
212  function ac(a, b) {
213    a.uniform3fv(this.addr, Jb(b, this.size, 3))
214  }
215  function bc(a, b) {
216    a.uniform4fv(this.addr, Jb(b, this.size, 4))
217  }
218  function cc(a, b) {
219    a.uniformMatrix2fv(this.addr, !1, Jb(b, this.size, 4))
220  }
221  function dc(a, b) {
222    a.uniformMatrix3fv(this.addr, !1, Jb(b, this.size, 9))
223  }
224  function ec(a, b) {
225    a.uniformMatrix4fv(this.addr, !1, Jb(b, this.size, 16))
226  }
227  function fc(a, b, c) {
228    var d = b.length,
229      e = Kb(c, d)
230    a.uniform1iv(this.addr, e)
231    for (var f = 0; f !== d; ++f) c.setTexture2D(b[f] || Eb, e[f])
232  }
233  function gc(a, b, c) {
234    var d = b.length,
235      e = Kb(c, d)
236    a.uniform1iv(this.addr, e)
237    for (var f = 0; f !== d; ++f) c.setTextureCube(b[f] || Fb, e[f])
238  }
239  function hc(a) {
240    switch (a) {
241      case 5126:
242        return Zb
243      case 35664:
244        return _b
245      case 35665:
246        return ac
247      case 35666:
248        return bc
249      case 35674:
250        return cc
251      case 35675:
252        return dc
253      case 35676:
254        return ec
255      case 35678:
256        return fc
257      case 35680:
258        return gc
259      case 5124:
260      case 35670:
261        return $b
262      case 35667:
263      case 35671:
264        return Vb
265      case 35668:
266      case 35672:
267        return Wb
268      case 35669:
269      case 35673:
270        return Xb
271    }
272  }
273  function ic(a, b, c) {
274    ;(this.id = a), (this.addr = c), (this.setValue = Yb(b.type))
275  }
276  function jc(a, b, c) {
277    ;(this.id = a),
278      (this.addr = c),
279      (this.size = b.size),
280      (this.setValue = hc(b.type))
281  }
282  function kc(a) {
283    ;(this.id = a), Gb.call(this)
284  }
285  function mc(a, b) {
286    a.seq.push(b), (a.map[b.id] = b)
287  }
288  function nc(a, b, c) {
289    var d = a.name,
290      e = d.length
291    for (lc.lastIndex = 0; ; ) {
292      var f = lc.exec(d),
293        g = lc.lastIndex,
294        h = f[1],
295        i = ']' === f[2],
296        j = f[3]
297      if ((i && (h |= 0), void 0 === j || ('[' === j && g + 2 === e))) {
298        mc(c, void 0 === j ? new ic(h, a, b) : new jc(h, a, b))
299        break
300      }
301      var k = c.map,
302        l = k[h]
303      void 0 === l && ((l = new kc(h)), mc(c, l)), (c = l)
304    }
305  }
306  function oc(a, b, c) {
307    Gb.call(this), (this.renderer = c)
308    for (
309      var d = a.getProgramParameter(b, a.ACTIVE_UNIFORMS), e = 0;
310      e < d;
311      ++e
312    ) {
313      var f = a.getActiveUniform(b, e),
314        g = f.name,
315        h = a.getUniformLocation(b, g)
316      nc(f, h, this)
317    }
318  }
319  function re(a, b, c) {
320    return void 0 === b && void 0 === c ? this.set(a) : this.setRGB(a, b, c)
321  }
322  function te(a, b, c, d, e, f, g, h, i, j, k, l) {
323    wb.call(this, null, f, g, h, i, j, d, e, k, l),
324      (this.image = { data: a, width: b, height: c }),
325      (this.magFilter = void 0 !== i ? i : qa),
326      (this.minFilter = void 0 !== j ? j : qa),
327      (this.generateMipmaps = !1),
328      (this.flipY = !1),
329      (this.unpackAlignment = 1)
330  }
331  function we(a, b) {
332    ;(this.min = void 0 !== a ? a : new ub(+(1 / 0), +(1 / 0))),
333      (this.max = void 0 !== b ? b : new ub(-(1 / 0), -(1 / 0)))
334  }
335  function xe(a, b) {
336    function m() {
337      var a = new Float32Array([
338          -1, -1, 0, 0, 1, -1, 1, 0, 1, 1, 1, 1, -1, 1, 0, 1
339        ]),
340        b = new Uint16Array([0, 1, 2, 0, 2, 3])
341      ;(e = c.createBuffer()),
342        (f = c.createBuffer()),
343        c.bindBuffer(c.ARRAY_BUFFER, e),
344        c.bufferData(c.ARRAY_BUFFER, a, c.STATIC_DRAW),
345        c.bindBuffer(c.ELEMENT_ARRAY_BUFFER, f),
346        c.bufferData(c.ELEMENT_ARRAY_BUFFER, b, c.STATIC_DRAW),
347        (k = c.createTexture()),
348        (l = c.createTexture()),
349        d.bindTexture(c.TEXTURE_2D, k),
350        c.texImage2D(
351          c.TEXTURE_2D,
352          0,
353          c.RGB,
354          16,
355          16,
356          0,
357          c.RGB,
358          c.UNSIGNED_BYTE,
359          null
360        ),
361        c.texParameteri(c.TEXTURE_2D, c.TEXTURE_WRAP_S, c.CLAMP_TO_EDGE),
362        c.texParameteri(c.TEXTURE_2D, c.TEXTURE_WRAP_T, c.CLAMP_TO_EDGE),
363        c.texParameteri(c.TEXTURE_2D, c.TEXTURE_MAG_FILTER, c.NEAREST),
364        c.texParameteri(c.TEXTURE_2D, c.TEXTURE_MIN_FILTER, c.NEAREST),
365        d.bindTexture(c.TEXTURE_2D, l),
366        c.texImage2D(
367          c.TEXTURE_2D,
368          0,
369          c.RGBA,
370          16,
371          16,
372          0,
373          c.RGBA,
374          c.UNSIGNED_BYTE,
375          null
376        ),
377        c.texParameteri(c.TEXTURE_2D, c.TEXTURE_WRAP_S, c.CLAMP_TO_EDGE),
378        c.texParameteri(c.TEXTURE_2D, c.TEXTURE_WRAP_T, c.CLAMP_TO_EDGE),
379        c.texParameteri(c.TEXTURE_2D, c.TEXTURE_MAG_FILTER, c.NEAREST),
380        c.texParameteri(c.TEXTURE_2D, c.TEXTURE_MIN_FILTER, c.NEAREST),
381        (g = {
382          vertexShader: [
383            'uniform lowp int renderType;',
384            'uniform vec3 screenPosition;',
385            'uniform vec2 scale;',
386            'uniform float rotation;',
387            'uniform sampler2D occlusionMap;',
388            'attribute vec2 position;',
389            'attribute vec2 uv;',
390            'varying vec2 vUV;',
391            'varying float vVisibility;',
392            'void main() {',
393            'vUV = uv;',
394            'vec2 pos = position;',
395            'if ( renderType == 2 ) {',
396            'vec4 visibility = texture2D( occlusionMap, vec2( 0.1, 0.1 ) );',
397            'visibility += texture2D( occlusionMap, vec2( 0.5, 0.1 ) );',
398            'visibility += texture2D( occlusionMap, vec2( 0.9, 0.1 ) );',
399            'visibility += texture2D( occlusionMap, vec2( 0.9, 0.5 ) );',
400            'visibility += texture2D( occlusionMap, vec2( 0.9, 0.9 ) );',
401            'visibility += texture2D( occlusionMap, vec2( 0.5, 0.9 ) );',
402            'visibility += texture2D( occlusionMap, vec2( 0.1, 0.9 ) );',
403            'visibility += texture2D( occlusionMap, vec2( 0.1, 0.5 ) );',
404            'visibility += texture2D( occlusionMap, vec2( 0.5, 0.5 ) );',
405            'vVisibility =        visibility.r / 9.0;',
406            'vVisibility *= 1.0 - visibility.g / 9.0;',
407            'vVisibility *=       visibility.b / 9.0;',
408            'vVisibility *= 1.0 - visibility.a / 9.0;',
409            'pos.x = cos( rotation ) * position.x - sin( rotation ) * position.y;',
410            'pos.y = sin( rotation ) * position.x + cos( rotation ) * position.y;',
411            '}',
412            'gl_Position = vec4( ( pos * scale + screenPosition.xy ).xy, screenPosition.z, 1.0 );',
413            '}'
414          ].join('\n'),
415          fragmentShader: [
416            'uniform lowp int renderType;',
417            'uniform sampler2D map;',
418            'uniform float opacity;',
419            'uniform vec3 color;',
420            'varying vec2 vUV;',
421            'varying float vVisibility;',
422            'void main() {',
423            'if ( renderType == 0 ) {',
424            'gl_FragColor = vec4( 1.0, 0.0, 1.0, 0.0 );',
425            '} else if ( renderType == 1 ) {',
426            'gl_FragColor = texture2D( map, vUV );',
427            '} else {',
428            'vec4 texture = texture2D( map, vUV );',
429            'texture.a *= opacity * vVisibility;',
430            'gl_FragColor = texture;',
431            'gl_FragColor.rgb *= color;',
432            '}',
433            '}'
434          ].join('\n')
435        }),
436        (h = n(g)),
437        (i = {
438          vertex: c.getAttribLocation(h, 'position'),
439          uv: c.getAttribLocation(h, 'uv')
440        }),
441        (j = {
442          renderType: c.getUniformLocation(h, 'renderType'),
443          map: c.getUniformLocation(h, 'map'),
444          occlusionMap: c.getUniformLocation(h, 'occlusionMap'),
445          opacity: c.getUniformLocation(h, 'opacity'),
446          color: c.getUniformLocation(h, 'color'),
447          scale: c.getUniformLocation(h, 'scale'),
448          rotation: c.getUniformLocation(h, 'rotation'),
449          screenPosition: c.getUniformLocation(h, 'screenPosition')
450        })
451    }
452    function n(b) {
453      var d = c.createProgram(),
454        e = c.createShader(c.FRAGMENT_SHADER),
455        f = c.createShader(c.VERTEX_SHADER),
456        g = 'precision ' + a.getPrecision() + ' float;\n'
457      return (
458        c.shaderSource(e, g + b.fragmentShader),
459        c.shaderSource(f, g + b.vertexShader),
460        c.compileShader(e),
461        c.compileShader(f),
462        c.attachShader(d, e),
463        c.attachShader(d, f),
464        c.linkProgram(d),
465        d
466      )
467    }
468    var e,
469      f,
470      g,
471      h,
472      i,
473      j,
474      k,
475      l,
476      c = a.context,
477      d = a.state
478    this.render = function (g, n, o) {
479      if (0 !== b.length) {
480        var p = new Bb(),
481          q = o.w / o.z,
482          r = 0.5 * o.z,
483          s = 0.5 * o.w,
484          t = 16 / o.w,
485          u = new ub(t * q, t),
486          v = new Bb(1, 1, 0),
487          w = new ub(1, 1),
488          x = new we()
489        x.min.set(o.x, o.y),
490          x.max.set(o.x + (o.z - 16), o.y + (o.w - 16)),
491          void 0 === h && m(),
492          c.useProgram(h),
493          d.initAttributes(),
494          d.enableAttribute(i.vertex),
495          d.enableAttribute(i.uv),
496          d.disableUnusedAttributes(),
497          c.uniform1i(j.occlusionMap, 0),
498          c.uniform1i(j.map, 1),
499          c.bindBuffer(c.ARRAY_BUFFER, e),
500          c.vertexAttribPointer(i.vertex, 2, c.FLOAT, !1, 16, 0),
501          c.vertexAttribPointer(i.uv, 2, c.FLOAT, !1, 16, 8),
502          c.bindBuffer(c.ELEMENT_ARRAY_BUFFER, f),
503          d.disable(c.CULL_FACE),
504          d.setDepthWrite(!1)
505        for (var y = 0, z = b.length; y < z; y++) {
506          ;(t = 16 / o.w), u.set(t * q, t)
507          var A = b[y]
508          if (
509            (p.set(
510              A.matrixWorld.elements[12],
511              A.matrixWorld.elements[13],
512              A.matrixWorld.elements[14]
513            ),
514            p.applyMatrix4(n.matrixWorldInverse),
515            p.applyMatrix4(n.projectionMatrix),
516            v.copy(p),
517            (w.x = o.x + v.x * r + r - 8),
518            (w.y = o.y + v.y * s + s - 8),
519            x.containsPoint(w) === !0)
520          ) {
521            d.activeTexture(c.TEXTURE0),
522              d.bindTexture(c.TEXTURE_2D, null),
523              d.activeTexture(c.TEXTURE1),
524              d.bindTexture(c.TEXTURE_2D, k),
525              c.copyTexImage2D(c.TEXTURE_2D, 0, c.RGB, w.x, w.y, 16, 16, 0),
526              c.uniform1i(j.renderType, 0),
527              c.uniform2f(j.scale, u.x, u.y),
528              c.uniform3f(j.screenPosition, v.x, v.y, v.z),
529              d.disable(c.BLEND),
530              d.enable(c.DEPTH_TEST),
531              c.drawElements(c.TRIANGLES, 6, c.UNSIGNED_SHORT, 0),
532              d.activeTexture(c.TEXTURE0),
533              d.bindTexture(c.TEXTURE_2D, l),
534              c.copyTexImage2D(c.TEXTURE_2D, 0, c.RGBA, w.x, w.y, 16, 16, 0),
535              c.uniform1i(j.renderType, 1),
536              d.disable(c.DEPTH_TEST),
537              d.activeTexture(c.TEXTURE1),
538              d.bindTexture(c.TEXTURE_2D, k),
539              c.drawElements(c.TRIANGLES, 6, c.UNSIGNED_SHORT, 0),
540              A.positionScreen.copy(v),
541              A.customUpdateCallback
542                ? A.customUpdateCallback(A)
543                : A.updateLensFlares(),
544              c.uniform1i(j.renderType, 2),
545              d.enable(c.BLEND)
546            for (var B = 0, C = A.lensFlares.length; B < C; B++) {
547              var D = A.lensFlares[B]
548              D.opacity > 0.001 &&
549                D.scale > 0.001 &&
550                ((v.x = D.x),
551                (v.y = D.y),
552                (v.z = D.z),
553                (t = (D.size * D.scale) / o.w),
554                (u.x = t * q),
555                (u.y = t),
556                c.uniform3f(j.screenPosition, v.x, v.y, v.z),
557                c.uniform2f(j.scale, u.x, u.y),
558                c.uniform1f(j.rotation, D.rotation),
559                c.uniform1f(j.opacity, D.opacity),
560                c.uniform3f(j.color, D.color.r, D.color.g, D.color.b),
561                d.setBlending(
562                  D.blending,
563                  D.blendEquation,
564                  D.blendSrc,
565                  D.blendDst
566                ),
567                a.setTexture2D(D.texture, 1),
568                c.drawElements(c.TRIANGLES, 6, c.UNSIGNED_SHORT, 0))
569            }
570          }
571        }
572        d.enable(c.CULL_FACE),
573          d.enable(c.DEPTH_TEST),
574          d.setDepthWrite(!0),
575          a.resetGLState()
576      }
577    }
578  }
579  function ye(a, b) {
580    function n() {
581      var a = new Float32Array([
582          -0.5, -0.5, 0, 0, 0.5, -0.5, 1, 0, 0.5, 0.5, 1, 1, -0.5, 0.5, 0, 1
583        ]),
584        b = new Uint16Array([0, 1, 2, 0, 2, 3])
585      ;(e = c.createBuffer()),
586        (f = c.createBuffer()),
587        c.bindBuffer(c.ARRAY_BUFFER, e),
588        c.bufferData(c.ARRAY_BUFFER, a, c.STATIC_DRAW),
589        c.bindBuffer(c.ELEMENT_ARRAY_BUFFER, f),
590        c.bufferData(c.ELEMENT_ARRAY_BUFFER, b, c.STATIC_DRAW),
591        (g = o()),
592        (h = {
593          position: c.getAttribLocation(g, 'position'),
594          uv: c.getAttribLocation(g, 'uv')
595        }),
596        (i = {
597          uvOffset: c.getUniformLocation(g, 'uvOffset'),
598          uvScale: c.getUniformLocation(g, 'uvScale'),
599          rotation: c.getUniformLocation(g, 'rotation'),
600          scale: c.getUniformLocation(g, 'scale'),
601          color: c.getUniformLocation(g, 'color'),
602          map: c.getUniformLocation(g, 'map'),
603          opacity: c.getUniformLocation(g, 'opacity'),
604          modelViewMatrix: c.getUniformLocation(g, 'modelViewMatrix'),
605          projectionMatrix: c.getUniformLocation(g, 'projectionMatrix'),
606          fogType: c.getUniformLocation(g, 'fogType'),
607          fogDensity: c.getUniformLocation(g, 'fogDensity'),
608          fogNear: c.getUniformLocation(g, 'fogNear'),
609          fogFar: c.getUniformLocation(g, 'fogFar'),
610          fogColor: c.getUniformLocation(g, 'fogColor'),
611          alphaTest: c.getUniformLocation(g, 'alphaTest')
612        })
613      var d = document.createElementNS('http://www.w3.org/1999/xhtml', 'canvas')
614      ;(d.width = 8), (d.height = 8)
615      var k = d.getContext('2d')
616      ;(k.fillStyle = 'white'),
617        k.fillRect(0, 0, 8, 8),
618        (j = new wb(d)),
619        (j.needsUpdate = !0)
620    }
621    function o() {
622      var b = c.createProgram(),
623        d = c.createShader(c.VERTEX_SHADER),
624        e = c.createShader(c.FRAGMENT_SHADER)
625      return (
626        c.shaderSource(
627          d,
628          [
629            'precision ' + a.getPrecision() + ' float;',
630            'uniform mat4 modelViewMatrix;',
631            'uniform mat4 projectionMatrix;',
632            'uniform float rotation;',
633            'uniform vec2 scale;',
634            'uniform vec2 uvOffset;',
635            'uniform vec2 uvScale;',
636            'attribute vec2 position;',
637            'attribute vec2 uv;',
638            'varying vec2 vUV;',
639            'void main() {',
640            'vUV = uvOffset + uv * uvScale;',
641            'vec2 alignedPosition = position * scale;',
642            'vec2 rotatedPosition;',
643            'rotatedPosition.x = cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y;',
644            'rotatedPosition.y = sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y;',
645            'vec4 finalPosition;',
646            'finalPosition = modelViewMatrix * vec4( 0.0, 0.0, 0.0, 1.0 );',
647            'finalPosition.xy += rotatedPosition;',
648            'finalPosition = projectionMatrix * finalPosition;',
649            'gl_Position = finalPosition;',
650            '}'
651          ].join('\n')
652        ),
653        c.shaderSource(
654          e,
655          [
656            'precision ' + a.getPrecision() + ' float;',
657            'uniform vec3 color;',
658            'uniform sampler2D map;',
659            'uniform float opacity;',
660            'uniform int fogType;',
661            'uniform vec3 fogColor;',
662            'uniform float fogDensity;',
663            'uniform float fogNear;',
664            'uniform float fogFar;',
665            'uniform float alphaTest;',
666            'varying vec2 vUV;',
667            'void main() {',
668            'vec4 texture = texture2D( map, vUV );',
669            'if ( texture.a < alphaTest ) discard;',
670            'gl_FragColor = vec4( color * texture.xyz, texture.a * opacity );',
671            'if ( fogType > 0 ) {',
672            'float depth = gl_FragCoord.z / gl_FragCoord.w;',
673            'float fogFactor = 0.0;',
674            'if ( fogType == 1 ) {',
675            'fogFactor = smoothstep( fogNear, fogFar, depth );',
676            '} else {',
677            'const float LOG2 = 1.442695;',
678            'fogFactor = exp2( - fogDensity * fogDensity * depth * depth * LOG2 );',
679            'fogFactor = 1.0 - clamp( fogFactor, 0.0, 1.0 );',
680            '}',
681            'gl_FragColor = mix( gl_FragColor, vec4( fogColor, gl_FragColor.w ), fogFactor );',
682            '}',
683            '}'
684          ].join('\n')
685        ),
686        c.compileShader(d),
687        c.compileShader(e),
688        c.attachShader(b, d),
689        c.attachShader(b, e),
690        c.linkProgram(b),
691        b
692      )
693    }
694    function p(a, b) {
695      return a.renderOrder !== b.renderOrder
696        ? a.renderOrder - b.renderOrder
697        : a.z !== b.z
698        ? b.z - a.z
699        : b.id - a.id
700    }
701    var e,
702      f,
703      g,
704      h,
705      i,
706      j,
707      c = a.context,
708      d = a.state,
709      k = new Bb(),
710      l = new Ab(),
711      m = new Bb()
712    this.render = function (o, q) {
713      if (0 !== b.length) {
714        void 0 === g && n(),
715          c.useProgram(g),
716          d.initAttributes(),
717          d.enableAttribute(h.position),
718          d.enableAttribute(h.uv),
719          d.disableUnusedAttributes(),
720          d.disable(c.CULL_FACE),
721          d.enable(c.BLEND),
722          c.bindBuffer(c.ARRAY_BUFFER, e),
723          c.vertexAttribPointer(h.position, 2, c.FLOAT, !1, 16, 0),
724          c.vertexAttribPointer(h.uv, 2, c.FLOAT, !1, 16, 8),
725          c.bindBuffer(c.ELEMENT_ARRAY_BUFFER, f),
726          c.uniformMatrix4fv(
727            i.projectionMatrix,
728            !1,
729            q.projectionMatrix.elements
730          ),
731          d.activeTexture(c.TEXTURE0),
732          c.uniform1i(i.map, 0)
733        var r = 0,
734          s = 0,
735          t = o.fog
736        t
737          ? (c.uniform3f(i.fogColor, t.color.r, t.color.g, t.color.b),
738            t.isFog
739              ? (c.uniform1f(i.fogNear, t.near),
740                c.uniform1f(i.fogFar, t.far),
741                c.uniform1i(i.fogType, 1),
742                (r = 1),
743                (s = 1))
744              : t.isFogExp2 &&
745                (c.uniform1f(i.fogDensity, t.density),
746                c.uniform1i(i.fogType, 2),
747                (r = 2),
748                (s = 2)))
749          : (c.uniform1i(i.fogType, 0), (r = 0), (s = 0))
750        for (var u = 0, v = b.length; u < v; u++) {
751          var w = b[u]
752          w.modelViewMatrix.multiplyMatrices(
753            q.matrixWorldInverse,
754            w.matrixWorld
755          ),
756            (w.z = -w.modelViewMatrix.elements[14])
757        }
758        b.sort(p)
759        for (var x = [], u = 0, v = b.length; u < v; u++) {
760          var w = b[u],
761            y = w.material
762          if (y.visible !== !1) {
763            c.uniform1f(i.alphaTest, y.alphaTest),
764              c.uniformMatrix4fv(
765                i.modelViewMatrix,
766                !1,
767                w.modelViewMatrix.elements
768              ),
769              w.matrixWorld.decompose(k, l, m),
770              (x[0] = m.x),
771              (x[1] = m.y)
772            var z = 0
773            o.fog && y.fog && (z = s),
774              r !== z && (c.uniform1i(i.fogType, z), (r = z)),
775              null !== y.map
776                ? (c.uniform2f(i.uvOffset, y.map.offset.x, y.map.offset.y),
777                  c.uniform2f(i.uvScale, y.map.repeat.x, y.map.repeat.y))
778                : (c.uniform2f(i.uvOffset, 0, 0), c.uniform2f(i.uvScale, 1, 1)),
779              c.uniform1f(i.opacity, y.opacity),
780              c.uniform3f(i.color, y.color.r, y.color.g, y.color.b),
781              c.uniform1f(i.rotation, y.rotation),
782              c.uniform2fv(i.scale, x),
783              d.setBlending(
784                y.blending,
785                y.blendEquation,
786                y.blendSrc,
787                y.blendDst
788              ),
789              d.setDepthTest(y.depthTest),
790              d.setDepthWrite(y.depthWrite),
791              y.map ? a.setTexture2D(y.map, 0) : a.setTexture2D(j, 0),
792              c.drawElements(c.TRIANGLES, 6, c.UNSIGNED_SHORT, 0)
793          }
794        }
795        d.enable(c.CULL_FACE), a.resetGLState()
796      }
797    }
798  }
799  function Ae() {
800    Object.defineProperty(this, 'id', { value: ze++ }),
801      (this.uuid = tb.generateUUID()),
802      (this.name = ''),
803      (this.type = 'Material'),
804      (this.fog = !0),
805      (this.lights = !0),
806      (this.blending = w),
807      (this.side = n),
808      (this.shading = r),
809      (this.vertexColors = s),
810      (this.opacity = 1),
811      (this.transparent = !1),
812      (this.blendSrc = K),
813      (this.blendDst = L),
814      (this.blendEquation = B),
815      (this.blendSrcAlpha = null),
816      (this.blendDstAlpha = null),
817      (this.blendEquationAlpha = null),
818      (this.depthFunc = U),
819      (this.depthTest = !0),
820      (this.depthWrite = !0),
821      (this.clippingPlanes = null),
822      (this.clipIntersection = !1),
823      (this.clipShadows = !1),
824      (this.colorWrite = !0),
825      (this.precision = null),
826      (this.polygonOffset = !1),
827      (this.polygonOffsetFactor = 0),
828      (this.polygonOffsetUnits = 0),
829      (this.alphaTest = 0),
830      (this.premultipliedAlpha = !1),
831      (this.overdraw = 0),
832      (this.visible = !0),
833      (this._needsUpdate = !0)
834  }
835  function Be(a) {
836    Ae.call(this),
837      (this.type = 'ShaderMaterial'),
838      (this.defines = {}),
839      (this.uniforms = {}),
840      (this.vertexShader =
841        'void main() {\n\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}'),
842      (this.fragmentShader =
843        'void main() {\n\tgl_FragColor = vec4( 1.0, 0.0, 0.0, 1.0 );\n}'),
844      (this.linewidth = 1),
845      (this.wireframe = !1),
846      (this.wireframeLinewidth = 1),
847      (this.fog = !1),
848      (this.lights = !1),
849      (this.clipping = !1),
850      (this.skinning = !1),
851      (this.morphTargets = !1),
852      (this.morphNormals = !1),
853      (this.extensions = {
854        derivatives: !1,
855        fragDepth: !1,
856        drawBuffers: !1,
857        shaderTextureLOD: !1
858      }),
859      (this.defaultAttributeValues = {
860        color: [1, 1, 1],
861        uv: [0, 0],
862        uv2: [0, 0]
863      }),
864      (this.index0AttributeName = void 0),
865      void 0 !== a &&
866        (void 0 !== a.attributes &&
867          console.error(
868            'THREE.ShaderMaterial: attributes should now be defined in THREE.BufferGeometry instead.'
869          ),
870        this.setValues(a))
871  }
872  function Ce(a) {
873    Ae.call(this),
874      (this.type = 'MeshDepthMaterial'),
875      (this.depthPacking = rb),
876      (this.skinning = !1),
877      (this.morphTargets = !1),
878      (this.map = null),
879      (this.alphaMap = null),
880      (this.displacementMap = null),
881      (this.displacementScale = 1),
882      (this.displacementBias = 0),
883      (this.wireframe = !1),
884      (this.wireframeLinewidth = 1),
885      (this.fog = !1),
886      (this.lights = !1),
887      this.setValues(a)
888  }
889  function De(a, b) {
890    ;(this.min = void 0 !== a ? a : new Bb(+(1 / 0), +(1 / 0), +(1 / 0))),
891      (this.max = void 0 !== b ? b : new Bb(-(1 / 0), -(1 / 0), -(1 / 0)))
892  }
893  function Ee(a, b) {
894    ;(this.center = void 0 !== a ? a : new Bb()),
895      (this.radius = void 0 !== b ? b : 0)
896  }
897  function Fe() {
898    ;(this.elements = new Float32Array([1, 0, 0, 0, 1, 0, 0, 0, 1])),
899      arguments.length > 0 &&
900        console.error(
901          'THREE.Matrix3: the constructor no longer reads arguments. use .set() instead.'
902        )
903  }
904  function Ge(a, b) {
905    ;(this.normal = void 0 !== a ? a : new Bb(1, 0, 0)),
906      (this.constant = void 0 !== b ? b : 0)
907  }
908  function He(a, b, c, d, e, f) {
909    this.planes = [
910      void 0 !== a ? a : new Ge(),
911      void 0 !== b ? b : new Ge(),
912      void 0 !== c ? c : new Ge(),
913      void 0 !== d ? d : new Ge(),
914      void 0 !== e ? e : new Ge(),
915      void 0 !== f ? f : new Ge()
916    ]
917  }
918  function Ie(a, b, c, d) {
919    function K(b, c, d, e) {
920      var f = b.geometry,
921        g = null,
922        h = v,
923        i = b.customDepthMaterial
924      if ((d && ((h = w), (i = b.customDistanceMaterial)), i)) g = i
925      else {
926        var j = !1
927        c.morphTargets &&
928          (f && f.isBufferGeometry
929            ? (j =
930                f.morphAttributes &&
931                f.morphAttributes.position &&
932                f.morphAttributes.position.length > 0)
933            : f &&
934              f.isGeometry &&
935              (j = f.morphTargets && f.morphTargets.length > 0))
936        var k = b.isSkinnedMesh && c.skinning,
937          l = 0
938        j && (l |= s), k && (l |= t), (g = h[l])
939      }
940      if (
941        a.localClippingEnabled &&
942        c.clipShadows === !0 &&
943        0 !== c.clippingPlanes.length
944      ) {
945        var m = g.uuid,
946          q = c.uuid,
947          r = x[m]
948        void 0 === r && ((r = {}), (x[m] = r))
949        var u = r[q]
950        void 0 === u && ((u = g.clone()), (r[q] = u)), (g = u)
951      }
952      ;(g.visible = c.visible), (g.wireframe = c.wireframe)
953      var y = c.side
954      return (
955        J.renderSingleSided && y == p && (y = n),
956        J.renderReverseSided && (y === n ? (y = o) : y === o && (y = n)),
957        (g.side = y),
958        (g.clipShadows = c.clipShadows),
959        (g.clippingPlanes = c.clippingPlanes),
960        (g.wireframeLinewidth = c.wireframeLinewidth),
961        (g.linewidth = c.linewidth),
962        d &&
963          void 0 !== g.uniforms.lightPos &&
964          g.uniforms.lightPos.value.copy(e),
965        g
966      )
967    }
968    function L(a, b, c) {
969      if (a.visible !== !1) {
970        var d = 0 !== (a.layers.mask & b.layers.mask)
971        if (
972          d &&
973          (a.isMesh || a.isLine || a.isPoints) &&
974          a.castShadow &&
975          (a.frustumCulled === !1 || g.intersectsObject(a) === !0)
976        ) {
977          var e = a.material
978          e.visible === !0 &&
979            (a.modelViewMatrix.multiplyMatrices(
980              c.matrixWorldInverse,
981              a.matrixWorld
982            ),
983            r.push(a))
984        }
985        for (var f = a.children, h = 0, i = f.length; h < i; h++) L(f[h], b, c)
986      }
987    }
988    var e = a.context,
989      f = a.state,
990      g = new He(),
991      h = new Cb(),
992      i = b.shadows,
993      j = new ub(),
994      k = new ub(d.maxTextureSize, d.maxTextureSize),
995      m = new Bb(),
996      q = new Bb(),
997      r = [],
998      s = 1,
999      t = 2,
1000      u = (s | t) + 1,
1001      v = new Array(u),
1002      w = new Array(u),
1003      x = {},
1004      y = [
1005        new Bb(1, 0, 0),
1006        new Bb(-1, 0, 0),
1007        new Bb(0, 0, 1),
1008        new Bb(0, 0, -1),
1009        new Bb(0, 1, 0),
1010        new Bb(0, -1, 0)
1011      ],
1012      z = [
1013        new Bb(0, 1, 0),
1014        new Bb(0, 1, 0),
1015        new Bb(0, 1, 0),
1016        new Bb(0, 1, 0),
1017        new Bb(0, 0, 1),
1018        new Bb(0, 0, -1)
1019      ],
1020      A = [new xb(), new xb(), new xb(), new xb(), new xb(), new xb()],
1021      B = new Ce()
1022    ;(B.depthPacking = sb), (B.clipping = !0)
1023    for (
1024      var C = ve.distanceRGBA, D = pc.clone(C.uniforms), E = 0;
1025      E !== u;
1026      ++E
1027    ) {
1028      var F = 0 !== (E & s),
1029        G = 0 !== (E & t),
1030        H = B.clone()
1031      ;(H.morphTargets = F), (H.skinning = G), (v[E] = H)
1032      var I = new Be({
1033        defines: { USE_SHADOWMAP: '' },
1034        uniforms: D,
1035        vertexShader: C.vertexShader,
1036        fragmentShader: C.fragmentShader,
1037        morphTargets: F,
1038        skinning: G,
1039        clipping: !0
1040      })
1041      w[E] = I
1042    }
1043    var J = this
1044    ;(this.enabled = !1),
1045      (this.autoUpdate = !0),
1046      (this.needsUpdate = !1),
1047      (this.type = l),
1048      (this.renderReverseSided = !0),
1049      (this.renderSingleSided = !0),
1050      (this.render = function (b, d) {
1051        if (
1052          J.enabled !== !1 &&
1053          (J.autoUpdate !== !1 || J.needsUpdate !== !1) &&
1054          0 !== i.length
1055        ) {
1056          f.buffers.color.setClear(1, 1, 1, 1),
1057            f.disable(e.BLEND),
1058            f.setDepthTest(!0),
1059            f.setScissorTest(!1)
1060          for (var l, n, o = 0, p = i.length; o < p; o++) {
1061            var s = i[o],
1062              t = s.shadow
1063            if (void 0 !== t) {
1064              var u = t.camera
1065              if ((j.copy(t.mapSize), j.min(k), s && s.isPointLight)) {
1066                ;(l = 6), (n = !0)
1067                var v = j.x,
1068                  w = j.y
1069                A[0].set(2 * v, w, v, w),
1070                  A[1].set(0, w, v, w),
1071                  A[2].set(3 * v, w, v, w),
1072                  A[3].set(v, w, v, w),
1073                  A[4].set(3 * v, 0, v, w),
1074                  A[5].set(v, 0, v, w),
1075                  (j.x *= 4),
1076                  (j.y *= 2)
1077              } else (l = 1), (n = !1)
1078              if (null === t.map) {
1079                var x = { minFilter: qa, magFilter: qa, format: Ka }
1080                ;(t.map = new yb(j.x, j.y, x)), u.updateProjectionMatrix()
1081              }
1082              t.isSpotLightShadow && t.update(s),
1083                t && t.isRectAreaLightShadow && t.update(s)
1084              var B = t.map,
1085                C = t.matrix
1086              q.setFromMatrixPosition(s.matrixWorld),
1087                u.position.copy(q),
1088                a.setRenderTarget(B),
1089                a.clear()
1090              for (var D = 0; D < l; D++) {
1091                if (n) {
1092                  m.copy(u.position), m.add(y[D]), u.up.copy(z[D]), u.lookAt(m)
1093                  var E = A[D]
1094                  f.viewport(E)
1095                } else
1096                  m.setFromMatrixPosition(s.target.matrixWorld), u.lookAt(m)
1097                u.updateMatrixWorld(),
1098                  u.matrixWorldInverse.getInverse(u.matrixWorld),
1099                  C.set(
1100                    0.5,
1101                    0,
1102                    0,
1103                    0.5,
1104                    0,
1105                    0.5,
1106                    0,
1107                    0.5,
1108                    0,
1109                    0,
1110                    0.5,
1111                    0.5,
1112                    0,
1113                    0,
1114                    0,
1115                    1
1116                  ),
1117                  C.multiply(u.projectionMatrix),
1118                  C.multiply(u.matrixWorldInverse),
1119                  h.multiplyMatrices(u.projectionMatrix, u.matrixWorldInverse),
1120                  g.setFromMatrix(h),
1121                  (r.length = 0),
1122                  L(b, d, u)
1123                for (var F = 0, G = r.length; F < G; F++) {
1124                  var H = r[F],
1125                    I = c.update(H),
1126                    M = H.material
1127                  if (M && M.isMultiMaterial)
1128                    for (
1129                      var N = I.groups, O = M.materials, P = 0, Q = N.length;
1130                      P < Q;
1131                      P++
1132                    ) {
1133                      var R = N[P],
1134                        S = O[R.materialIndex]
1135                      if (S.visible === !0) {
1136                        var T = K(H, S, n, q)
1137                        a.renderBufferDirect(u, null, I, T, H, R)
1138                      }
1139                    }
1140                  else {
1141                    var T = K(H, M, n, q)
1142                    a.renderBufferDirect(u, null, I, T, H, null)
1143                  }
1144                }
1145              }
1146            } else console.warn('THREE.WebGLShadowMap:', s, 'has no shadow.')
1147          }
1148          var U = a.getClearColor(),
1149            V = a.getClearAlpha()
1150          a.setClearColor(U, V), (J.needsUpdate = !1)
1151        }
1152      })
1153  }
1154  function Je(a, b) {
1155    ;(this.origin = void 0 !== a ? a : new Bb()),
1156      (this.direction = void 0 !== b ? b : new Bb())
1157  }
1158  function Ke(a, b, c, d) {
1159    ;(this._x = a || 0),
1160      (this._y = b || 0),
1161      (this._z = c || 0),
1162      (this._order = d || Ke.DefaultOrder)
1163  }
1164  function Le() {
1165    this.mask = 1
1166  }
1167  function Ne() {
1168    function e() {
1169      c.setFromEuler(b, !1)
1170    }
1171    function f() {
1172      b.setFromQuaternion(c, void 0, !1)
1173    }
1174    Object.defineProperty(this, 'id', { value: Me++ }),
1175      (this.uuid = tb.generateUUID()),
1176      (this.name = ''),
1177      (this.type = 'Object3D'),
1178      (this.parent = null),
1179      (this.children = []),
1180      (this.up = Ne.DefaultUp.clone())
1181    var a = new Bb(),
1182      b = new Ke(),
1183      c = new Ab(),
1184      d = new Bb(1, 1, 1)
1185    b.onChange(e),
1186      c.onChange(f),
1187      Object.defineProperties(this, {
1188        position: { enumerable: !0, value: a },
1189        rotation: { enumerable: !0, value: b },
1190        quaternion: { enumerable: !0, value: c },
1191        scale: { enumerable: !0, value: d },
1192        modelViewMatrix: { value: new Cb() },
1193        normalMatrix: { value: new Fe() }
1194      }),
1195      (this.matrix = new Cb()),
1196      (this.matrixWorld = new Cb()),
1197      (this.matrixAutoUpdate = Ne.DefaultMatrixAutoUpdate),
1198      (this.matrixWorldNeedsUpdate = !1),
1199      (this.layers = new Le()),
1200      (this.visible = !0),
1201      (this.castShadow = !1),
1202      (this.receiveShadow = !1),
1203      (this.frustumCulled = !0),
1204      (this.renderOrder = 0),
1205      (this.userData = {}),
1206      (this.onBeforeRender = function () {}),
1207      (this.onAfterRender = function () {})
1208  }
1209  function Oe(a, b) {
1210    ;(this.start = void 0 !== a ? a : new Bb()),
1211      (this.end = void 0 !== b ? b : new Bb())
1212  }
1213  function Pe(a, b, c) {
1214    ;(this.a = void 0 !== a ? a : new Bb()),
1215      (this.b = void 0 !== b ? b : new Bb()),
1216      (this.c = void 0 !== c ? c : new Bb())
1217  }
1218  function Qe(a, b, c, d, e, f) {
1219    ;(this.a = a),
1220      (this.b = b),
1221      (this.c = c),
1222      (this.normal = d && d.isVector3 ? d : new Bb()),
1223      (this.vertexNormals = Array.isArray(d) ? d : []),
1224      (this.color = e && e.isColor ? e : new re()),
1225      (this.vertexColors = Array.isArray(e) ? e : []),
1226      (this.materialIndex = void 0 !== f ? f : 0)
1227  }
1228  function Re(a) {
1229    Ae.call(this),
1230      (this.type = 'MeshBasicMaterial'),
1231      (this.color = new re(16777215)),
1232      (this.map = null),
1233      (this.lightMap = null),
1234      (this.lightMapIntensity = 1),
1235      (this.aoMap = null),
1236      (this.aoMapIntensity = 1),
1237      (this.specularMap = null),
1238      (this.alphaMap = null),
1239      (this.envMap = null),
1240      (this.combine = Z),
1241      (this.reflectivity = 1),
1242      (this.refractionRatio = 0.98),
1243      (this.wireframe = !1),
1244      (this.wireframeLinewidth = 1),
1245      (this.wireframeLinecap = 'round'),
1246      (this.wireframeLinejoin = 'round'),
1247      (this.skinning = !1),
1248      (this.morphTargets = !1),
1249      (this.lights = !1),
1250      this.setValues(a)
1251  }
1252  function Se(a, b, c) {
1253    if (Array.isArray(a))
1254      throw new TypeError(
1255        'THREE.BufferAttribute: array should be a Typed Array.'
1256      )
1257    ;(this.uuid = tb.generateUUID()),
1258      (this.array = a),
1259      (this.itemSize = b),
1260      (this.count = void 0 !== a ? a.length / b : 0),
1261      (this.normalized = c === !0),
1262      (this.dynamic = !1),
1263      (this.updateRange = { offset: 0, count: -1 }),
1264      (this.onUploadCallback = function () {}),
1265      (this.version = 0)
1266  }
1267  function Te(a, b) {
1268    Se.call(this, new Int8Array(a), b)
1269  }
1270  function Ue(a, b) {
1271    Se.call(this, new Uint8Array(a), b)
1272  }
1273  function Ve(a, b) {
1274    Se.call(this, new Uint8ClampedArray(a), b)
1275  }
1276  function We(a, b) {
1277    Se.call(this, new Int16Array(a), b)
1278  }
1279  function Xe(a, b) {
1280    Se.call(this, new Uint16Array(a), b)
1281  }
1282  function Ye(a, b) {
1283    Se.call(this, new Int32Array(a), b)
1284  }
1285  function Ze(a, b) {
1286    Se.call(this, new Uint32Array(a), b)
1287  }
1288  function $e(a, b) {
1289    Se.call(this, new Float32Array(a), b)
1290  }
1291  function _e(a, b) {
1292    Se.call(this, new Float64Array(a), b)
1293  }
1294  function af() {
1295    ;(this.indices = []),
1296      (this.vertices = []),
1297      (this.normals = []),
1298      (this.colors = []),
1299      (this.uvs = []),
1300      (this.uvs2 = []),
1301      (this.groups = []),
1302      (this.morphTargets = {}),
1303      (this.skinWeights = []),
1304      (this.skinIndices = []),
1305      (this.boundingBox = null),
1306      (this.boundingSphere = null),
1307      (this.verticesNeedUpdate = !1),
1308      (this.normalsNeedUpdate = !1),
1309      (this.colorsNeedUpdate = !1),
1310      (this.uvsNeedUpdate = !1),
1311      (this.groupsNeedUpdate = !1)
1312  }
1313  function bf(a) {
1314    for (var b = a.length, c = -(1 / 0); b--; ) a[b] > c && (c = a[b])
1315    return c
1316  }
1317  function df() {
1318    return cf++
1319  }
1320  function ef() {
1321    Object.defineProperty(this, 'id', { value: df() }),
1322      (this.uuid = tb.generateUUID()),
1323      (this.name = ''),
1324      (this.type = 'Geometry'),
1325      (this.vertices = []),
1326      (this.colors = []),
1327      (this.faces = []),
1328      (this.faceVertexUvs = [[]]),
1329      (this.morphTargets = []),
1330      (this.morphNormals = []),
1331      (this.skinWeights = []),
1332      (this.skinIndices = []),
1333      (this.lineDistances = []),
1334      (this.boundingBox = null),
1335      (this.boundingSphere = null),
1336      (this.elementsNeedUpdate = !1),
1337      (this.verticesNeedUpdate = !1),
1338      (this.uvsNeedUpdate = !1),
1339      (this.normalsNeedUpdate = !1),
1340      (this.colorsNeedUpdate = !1),
1341      (this.lineDistancesNeedUpdate = !1),
1342      (this.groupsNeedUpdate = !1)
1343  }
1344  function ff() {
1345    Object.defineProperty(this, 'id', { value: df() }),
1346      (this.uuid = tb.generateUUID()),
1347      (this.name = ''),
1348      (this.type = 'BufferGeometry'),
1349      (this.index = null),
1350      (this.attributes = {}),
1351      (this.morphAttributes = {}),
1352      (this.groups = []),
1353      (this.boundingBox = null),
1354      (this.boundingSphere = null),
1355      (this.drawRange = { start: 0, count: 1 / 0 })
1356  }
1357  function gf(a, b) {
1358    Ne.call(this),
1359      (this.type = 'Mesh'),
1360      (this.geometry = void 0 !== a ? a : new ff()),
1361      (this.material =
1362        void 0 !== b ? b : new Re({ color: 16777215 * Math.random() })),
1363      (this.drawMode = gb),
1364      this.updateMorphTargets()
1365  }
1366  function hf(a, b, c, d, e, f) {
1367    ef.call(this),
1368      (this.type = 'BoxGeometry'),
1369      (this.parameters = {
1370        width: a,
1371        height: b,
1372        depth: c,
1373        widthSegments: d,
1374        heightSegments: e,
1375        depthSegments: f
1376      }),
1377      this.fromBufferGeometry(new jf(a, b, c, d, e, f)),
1378      this.mergeVertices()
1379  }
1380  function jf(a, b, c, d, e, f) {
1381    function n(a, b, c, d, e, f, n, o, p, q, r) {
1382      var B,
1383        C,
1384        s = f / p,
1385        t = n / q,
1386        u = f / 2,
1387        v = n / 2,
1388        w = o / 2,
1389        x = p + 1,
1390        y = q + 1,
1391        z = 0,
1392        A = 0,
1393        D = new Bb()
1394      for (C = 0; C < y; C++) {
1395        var E = C * t - v
1396        for (B = 0; B < x; B++) {
1397          var F = B * s - u
1398          ;(D[a] = F * d),
1399            (D[b] = E * e),
1400            (D[c] = w),
1401            i.push(D.x, D.y, D.z),
1402            (D[a] = 0),
1403            (D[b] = 0),
1404            (D[c] = o > 0 ? 1 : -1),
1405            j.push(D.x, D.y, D.z),
1406            k.push(B / p),
1407            k.push(1 - C / q),
1408            (z += 1)
1409        }
1410      }
1411      for (C = 0; C < q; C++)
1412        for (B = 0; B < p; B++) {
1413          var G = l + B + x * C,
1414            H = l + B + x * (C + 1),
1415            I = l + (B + 1) + x * (C + 1),
1416            J = l + (B + 1) + x * C
1417          h.push(G, H, J), h.push(H, I, J), (A += 6)
1418        }
1419      g.addGroup(m, A, r), (m += A), (l += z)
1420    }
1421    ff.call(this),
1422      (this.type = 'BoxBufferGeometry'),
1423      (this.parameters = {
1424        width: a,
1425        height: b,
1426        depth: c,
1427        widthSegments: d,
1428        heightSegments: e,
1429        depthSegments: f
1430      })
1431    var g = this
1432    ;(d = Math.floor(d) || 1),
1433      (e = Math.floor(e) || 1),
1434      (f = Math.floor(f) || 1)
1435    var h = [],
1436      i = [],
1437      j = [],
1438      k = [],
1439      l = 0,
1440      m = 0
1441    n('z', 'y', 'x', -1, -1, c, b, a, f, e, 0),
1442      n('z', 'y', 'x', 1, -1, c, b, -a, f, e, 1),
1443      n('x', 'z', 'y', 1, 1, a, c, b, d, f, 2),
1444      n('x', 'z', 'y', 1, -1, a, c, -b, d, f, 3),
1445      n('x', 'y', 'z', 1, -1, a, b, c, d, e, 4),
1446      n('x', 'y', 'z', -1, -1, a, b, -c, d, e, 5),
1447      this.setIndex(h),
1448      this.addAttribute('position', new $e(i, 3)),
1449      this.addAttribute('normal', new $e(j, 3)),
1450      this.addAttribute('uv', new $e(k, 2))
1451  }
1452  function kf(a, b, c, d) {
1453    ef.call(this),
1454      (this.type = 'PlaneGeometry'),
1455      (this.parameters = {
1456        width: a,
1457        height: b,
1458        widthSegments: c,
1459        heightSegments: d
1460      }),
1461      this.fromBufferGeometry(new lf(a, b, c, d))
1462  }
1463  function lf(a, b, c, d) {
1464    ff.call(this),
1465      (this.type = 'PlaneBufferGeometry'),
1466      (this.parameters = {
1467        width: a,
1468        height: b,
1469        widthSegments: c,
1470        heightSegments: d
1471      })
1472    var m,
1473      n,
1474      e = a / 2,
1475      f = b / 2,
1476      g = Math.floor(c) || 1,
1477      h = Math.floor(d) || 1,
1478      i = g + 1,
1479      j = h + 1,
1480      k = a / g,
1481      l = b / h,
1482      o = [],
1483      p = [],
1484      q = [],
1485      r = []
1486    for (n = 0; n < j; n++) {
1487      var s = n * l - f
1488      for (m = 0; m < i; m++) {
1489        var t = m * k - e
1490        p.push(t, -s, 0), q.push(0, 0, 1), r.push(m / g), r.push(1 - n / h)
1491      }
1492    }
1493    for (n = 0; n < h; n++)
1494      for (m = 0; m < g; m++) {
1495        var u = m + i * n,
1496          v = m + i * (n + 1),
1497          w = m + 1 + i * (n + 1),
1498          x = m + 1 + i * n
1499        o.push(u, v, x), o.push(v, w, x)
1500      }
1501    this.setIndex(o),
1502      this.addAttribute('position', new $e(p, 3)),
1503      this.addAttribute('normal', new $e(q, 3)),
1504      this.addAttribute('uv', new $e(r, 2))
1505  }
1506  function mf() {
1507    Ne.call(this),
1508      (this.type = 'Camera'),
1509      (this.matrixWorldInverse = new Cb()),
1510      (this.projectionMatrix = new Cb())
1511  }
1512  function nf(a, b, c, d) {
1513    mf.call(this),
1514      (this.type = 'PerspectiveCamera'),
1515      (this.fov = void 0 !== a ? a : 50),
1516      (this.zoom = 1),
1517      (this.near = void 0 !== c ? c : 0.1),
1518      (this.far = void 0 !== d ? d : 2e3),
1519      (this.focus = 10),
1520      (this.aspect = void 0 !== b ? b : 1),
1521      (this.view = null),
1522      (this.filmGauge = 35),
1523      (this.filmOffset = 0),
1524      this.updateProjectionMatrix()
1525  }
1526  function of(a, b, c, d, e, f) {
1527    mf.call(this),
1528      (this.type = 'OrthographicCamera'),
1529      (this.zoom = 1),
1530      (this.view = null),
1531      (this.left = a),
1532      (this.right = b),
1533      (this.top = c),
1534      (this.bottom = d),
1535      (this.near = void 0 !== e ? e : 0.1),
1536      (this.far = void 0 !== f ? f : 2e3),
1537      this.updateProjectionMatrix()
1538  }
1539  function pf(a, b, c) {
1540    function e(a) {
1541      d = a
1542    }
1543    function h(c) {
1544      c.array instanceof Uint32Array && b.get('OES_element_index_uint')
1545        ? ((f = a.UNSIGNED_INT), (g = 4))
1546        : c.array instanceof Uint16Array
1547        ? ((f = a.UNSIGNED_SHORT), (g = 2))
1548        : ((f = a.UNSIGNED_BYTE), (g = 1))
1549    }
1550    function i(b, e) {
1551      a.drawElements(d, e, f, b * g),
1552        c.calls++,
1553        (c.vertices += e),
1554        d === a.TRIANGLES && (c.faces += e / 3)
1555    }
1556    function j(e, h, i) {
1557      var j = b.get('ANGLE_instanced_arrays')
1558      return null === j
1559        ? void console.error(
1560            'THREE.WebGLBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.'
1561          )
1562        : (j.drawElementsInstancedANGLE(d, i, f, h * g, e.maxInstancedCount),
1563          c.calls++,
1564          (c.vertices += i * e.maxInstancedCount),
1565          void (
1566            d === a.TRIANGLES && (c.faces += (e.maxInstancedCount * i) / 3)
1567          ))
1568    }
1569    var d, f, g
1570    return { setMode: e, setIndex: h, render: i, renderInstances: j }
1571  }
1572  function qf(a, b, c) {
1573    function e(a) {
1574      d = a
1575    }
1576    function f(b, e) {
1577      a.drawArrays(d, b, e),
1578        c.calls++,
1579        (c.vertices += e),
1580        d === a.TRIANGLES && (c.faces += e / 3)
1581    }
1582    function g(e) {
1583      var f = b.get('ANGLE_instanced_arrays')
1584      if (null === f)
1585        return void console.error(
1586          'THREE.WebGLBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.'
1587        )
1588      var g = e.attributes.position,
1589        h = 0
1590      g.isInterleavedBufferAttribute
1591        ? ((h = g.data.count),
1592          f.drawArraysInstancedANGLE(d, 0, h, e.maxInstancedCount))
1593        : ((h = g.count),
1594          f.drawArraysInstancedANGLE(d, 0, h, e.maxInstancedCount)),
1595        c.calls++,
1596        (c.vertices += h * e.maxInstancedCount),
1597        d === a.TRIANGLES && (c.faces += (e.maxInstancedCount * h) / 3)
1598    }
1599    var d
1600    return { setMode: e, render: f, renderInstances: g }
1601  }
1602  function rf() {
1603    var a = {}
1604    return {
1605      get: function (b) {
1606        if (void 0 !== a[b.id]) return a[b.id]
1607        var c
1608        switch (b.type) {
1609          case 'DirectionalLight':
1610            c = {
1611              direction: new Bb(),
1612              color: new re(),
1613              shadow: !1,
1614              shadowBias: 0,
1615              shadowRadius: 1,
1616              shadowMapSize: new ub()
1617            }
1618            break
1619          case 'SpotLight':
1620            c = {
1621              position: new Bb(),
1622              direction: new Bb(),
1623              color: new re(),
1624              distance: 0,
1625              coneCos: 0,
1626              penumbraCos: 0,
1627              decay: 0,
1628              shadow: !1,
1629              shadowBias: 0,
1630              shadowRadius: 1,
1631              shadowMapSize: new ub()
1632            }
1633            break
1634          case 'PointLight':
1635            c = {
1636              position: new Bb(),
1637              color: new re(),
1638              distance: 0,
1639              decay: 0,
1640              shadow: !1,
1641              shadowBias: 0,
1642              shadowRadius: 1,
1643              shadowMapSize: new ub()
1644            }
1645            break
1646          case 'HemisphereLight':
1647            c = {
1648              direction: new Bb(),
1649              skyColor: new re(),
1650              groundColor: new re()
1651            }
1652            break
1653          case 'RectAreaLight':
1654            c = {
1655              color: new re(),
1656              position: new Bb(),
1657              halfWidth: new Bb(),
1658              halfHeight: new Bb()
1659            }
1660        }
1661        return (a[b.id] = c), c
1662      }
1663    }
1664  }
1665  function sf(a) {
1666    for (var b = a.split('\n'), c = 0; c < b.length; c++)
1667      b[c] = c + 1 + ': ' + b[c]
1668    return b.join('\n')
1669  }
1670  function tf(a, b, c) {
1671    var d = a.createShader(b)
1672    return (
1673      a.shaderSource(d, c),
1674      a.compileShader(d),
1675      a.getShaderParameter(d, a.COMPILE_STATUS) === !1 &&
1676        console.error("THREE.WebGLShader: Shader couldn't compile."),
1677      '' !== a.getShaderInfoLog(d) &&
1678        console.warn(
1679          'THREE.WebGLShader: gl.getShaderInfoLog()',
1680          b === a.VERTEX_SHADER ? 'vertex' : 'fragment',
1681          a.getShaderInfoLog(d),
1682          sf(c)
1683        ),
1684      d
1685    )
1686  }
1687  function vf(a) {
1688    switch (a) {
1689      case jb:
1690        return ['Linear', '( value )']
1691      case kb:
1692        return ['sRGB', '( value )']
1693      case mb:
1694        return ['RGBE', '( value )']
1695      case ob:
1696        return ['RGBM', '( value, 7.0 )']
1697      case pb:
1698        return ['RGBM', '( value, 16.0 )']
1699      case qb:
1700        return ['RGBD', '( value, 256.0 )']
1701      case lb:
1702        return ['Gamma', '( value, float( GAMMA_FACTOR ) )']
1703      default:
1704        throw new Error('unsupported encoding: ' + a)
1705    }
1706  }
1707  function wf(a, b) {
1708    var c = vf(b)
1709    return (
1710      'vec4 ' +
1711      a +
1712      '( vec4 value ) { return ' +
1713      c[0] +
1714      'ToLinear' +
1715      c[1] +
1716      '; }'
1717    )
1718  }
1719  function xf(a, b) {
1720    var c = vf(b)
1721    return (
1722      'vec4 ' + a + '( vec4 value ) { return LinearTo' + c[0] + c[1] + '; }'
1723    )
1724  }
1725  function yf(a, b) {
1726    var c
1727    switch (b) {
1728      case ba:
1729        c = 'Linear'
1730        break
1731      case ca:
1732        c = 'Reinhard'
1733        break
1734      case da:
1735        c = 'Uncharted2'
1736        break
1737      case ea:
1738        c = 'OptimizedCineon'
1739        break
1740      default:
1741        throw new Error('unsupported toneMapping: ' + b)
1742    }
1743    return (
1744      'vec3 ' + a + '( vec3 color ) { return ' + c + 'ToneMapping( color ); }'
1745    )
1746  }
1747  function zf(a, b, c) {
1748    a = a || {}
1749    var d = [
1750      a.derivatives ||
1751      b.envMapCubeUV ||
1752      b.bumpMap ||
1753      b.normalMap ||
1754      b.flatShading
1755        ? '#extension GL_OES_standard_derivatives : enable'
1756        : '',
1757      (a.fragDepth || b.logarithmicDepthBuffer) && c.get('EXT_frag_depth')
1758        ? '#extension GL_EXT_frag_depth : enable'
1759        : '',
1760      a.drawBuffers && c.get('WEBGL_draw_buffers')
1761        ? '#extension GL_EXT_draw_buffers : require'
1762        : '',
1763      (a.shaderTextureLOD || b.envMap) && c.get('EXT_shader_texture_lod')
1764        ? '#extension GL_EXT_shader_texture_lod : enable'
1765        : ''
1766    ]
1767    return d.filter(Cf).join('\n')
1768  }
1769  function Af(a) {
1770    var b = []
1771    for (var c in a) {
1772      var d = a[c]
1773      d !== !1 && b.push('#define ' + c + ' ' + d)
1774    }
1775    return b.join('\n')
1776  }
1777  function Bf(a, b, c) {
1778    for (
1779      var d = {}, e = a.getProgramParameter(b, a.ACTIVE_ATTRIBUTES), f = 0;
1780      f < e;
1781      f++
1782    ) {
1783      var g = a.getActiveAttrib(b, f),
1784        h = g.name
1785      d[h] = a.getAttribLocation(b, h)
1786    }
1787    return d
1788  }
1789  function Cf(a) {
1790    return '' !== a
1791  }
1792  function Df(a, b) {
1793    return a
1794      .replace(/NUM_DIR_LIGHTS/g, b.numDirLights)
1795      .replace(/NUM_SPOT_LIGHTS/g, b.numSpotLights)
1796      .replace(/NUM_RECT_AREA_LIGHTS/g, b.numRectAreaLights)
1797      .replace(/NUM_POINT_LIGHTS/g, b.numPointLights)
1798      .replace(/NUM_HEMI_LIGHTS/g, b.numHemiLights)
1799  }
1800  function Ef(a) {
1801    function c(a, b) {
1802      var c = qe[b]
1803      if (void 0 === c) throw new Error('Can not resolve #include <' + b + '>')
1804      return Ef(c)
1805    }
1806    var b = /#include +<([\w\d.]+)>/g
1807    return a.replace(b, c)
1808  }
1809  function Ff(a) {
1810    function c(a, b, c, d) {
1811      for (var e = '', f = parseInt(b); f < parseInt(c); f++)
1812        e += d.replace(/\[ i \]/g, '[ ' + f + ' ]')
1813      return e
1814    }
1815    var b =
1816      /for \( int i \= (\d+)\; i < (\d+)\; i \+\+ \) \{([\s\S]+?)(?=\})\}/g
1817    return a.replace(b, c)
1818  }
1819  function Gf(a, b, c, d) {
1820    var e = a.context,
1821      f = c.extensions,
1822      g = c.defines,
1823      h = c.__webglShader.vertexShader,
1824      i = c.__webglShader.fragmentShader,
1825      j = 'SHADOWMAP_TYPE_BASIC'
1826    d.shadowMapType === l
1827      ? (j = 'SHADOWMAP_TYPE_PCF')
1828      : d.shadowMapType === m && (j = 'SHADOWMAP_TYPE_PCF_SOFT')
1829    var k = 'ENVMAP_TYPE_CUBE',
1830      n = 'ENVMAP_MODE_REFLECTION',
1831      o = 'ENVMAP_BLENDING_MULTIPLY'
1832    if (d.envMap) {
1833      switch (c.envMap.mapping) {
1834        case ga:
1835        case ha:
1836          k = 'ENVMAP_TYPE_CUBE'
1837          break
1838        case la:
1839        case ma:
1840          k = 'ENVMAP_TYPE_CUBE_UV'
1841          break
1842        case ia:
1843        case ja:
1844          k = 'ENVMAP_TYPE_EQUIREC'
1845          break
1846        case ka:
1847          k = 'ENVMAP_TYPE_SPHERE'
1848      }
1849      switch (c.envMap.mapping) {
1850        case ha:
1851        case ja:
1852          n = 'ENVMAP_MODE_REFRACTION'
1853      }
1854      switch (c.combine) {
1855        case Z:
1856          o = 'ENVMAP_BLENDING_MULTIPLY'
1857          break
1858        case $:
1859          o = 'ENVMAP_BLENDING_MIX'
1860          break
1861        case _:
1862          o = 'ENVMAP_BLENDING_ADD'
1863      }
1864    }
1865    var t,
1866      u,
1867      p = a.gammaFactor > 0 ? a.gammaFactor : 1,
1868      q = zf(f, d, a.extensions),
1869      r = Af(g),
1870      s = e.createProgram()
1871    c.isRawShaderMaterial
1872      ? ((t = [r, '\n'].filter(Cf).join('\n')),
1873        (u = [q, r, '\n'].filter(Cf).join('\n')))
1874      : ((t = [
1875          'precision ' + d.precision + ' float;',
1876          'precision ' + d.precision + ' int;',
1877          '#define SHADER_NAME ' + c.__webglShader.name,
1878          r,
1879          d.supportsVertexTextures ? '#define VERTEX_TEXTURES' : '',
1880          '#define GAMMA_FACTOR ' + p,
1881          '#define MAX_BONES ' + d.maxBones,
1882          d.useFog && d.fog ? '#define USE_FOG' : '',
1883          d.useFog && d.fogExp ? '#define FOG_EXP2' : '',
1884          d.map ? '#define USE_MAP' : '',
1885          d.envMap ? '#define USE_ENVMAP' : '',
1886          d.envMap ? '#define ' + n : '',
1887          d.lightMap ? '#define USE_LIGHTMAP' : '',
1888          d.aoMap ? '#define USE_AOMAP' : '',
1889          d.emissiveMap ? '#define USE_EMISSIVEMAP' : '',
1890          d.bumpMap ? '#define USE_BUMPMAP' : '',
1891          d.normalMap ? '#define USE_NORMALMAP' : '',
1892          d.displacementMap && d.supportsVertexTextures
1893            ? '#define USE_DISPLACEMENTMAP'
1894            : '',
1895          d.specularMap ? '#define USE_SPECULARMAP' : '',
1896          d.roughnessMap ? '#define USE_ROUGHNESSMAP' : '',
1897          d.metalnessMap ? '#define USE_METALNESSMAP' : '',
1898          d.alphaMap ? '#define USE_ALPHAMAP' : '',
1899          d.vertexColors ? '#define USE_COLOR' : '',
1900          d.flatShading ? '#define FLAT_SHADED' : '',
1901          d.skinning ? '#define USE_SKINNING' : '',
1902          d.useVertexTexture ? '#define BONE_TEXTURE' : '',
1903          d.morphTargets ? '#define USE_MORPHTARGETS' : '',
1904          d.morphNormals && d.flatShading === !1
1905            ? '#define USE_MORPHNORMALS'
1906            : '',
1907          d.doubleSided ? '#define DOUBLE_SIDED' : '',
1908          d.flipSided ? '#define FLIP_SIDED' : '',
1909          '#define NUM_CLIPPING_PLANES ' + d.numClippingPlanes,
1910          d.shadowMapEnabled ? '#define USE_SHADOWMAP' : '',
1911          d.shadowMapEnabled ? '#define ' + j : '',
1912          d.sizeAttenuation ? '#define USE_SIZEATTENUATION' : '',
1913          d.logarithmicDepthBuffer ? '#define USE_LOGDEPTHBUF' : '',
1914          d.logarithmicDepthBuffer && a.extensions.get('EXT_frag_depth')
1915            ? '#define USE_LOGDEPTHBUF_EXT'
1916            : '',
1917          'uniform mat4 modelMatrix;',
1918          'uniform mat4 modelViewMatrix;',
1919          'uniform mat4 projectionMatrix;',
1920          'uniform mat4 viewMatrix;',
1921          'uniform mat3 normalMatrix;',
1922          'uniform vec3 cameraPosition;',
1923          'attribute vec3 position;',
1924          'attribute vec3 normal;',
1925          'attribute vec2 uv;',
1926          '#ifdef USE_COLOR',
1927          '\tattribute vec3 color;',
1928          '#endif',
1929          '#ifdef USE_MORPHTARGETS',
1930          '\tattribute vec3 morphTarget0;',
1931          '\tattribute vec3 morphTarget1;',
1932          '\tattribute vec3 morphTarget2;',
1933          '\tattribute vec3 morphTarget3;',
1934          '\t#ifdef USE_MORPHNORMALS',
1935          '\t\tattribute vec3 morphNormal0;',
1936          '\t\tattribute vec3 morphNormal1;',
1937          '\t\tattribute vec3 morphNormal2;',
1938          '\t\tattribute vec3 morphNormal3;',
1939          '\t#else',
1940          '\t\tattribute vec3 morphTarget4;',
1941          '\t\tattribute vec3 morphTarget5;',
1942          '\t\tattribute vec3 morphTarget6;',
1943          '\t\tattribute vec3 morphTarget7;',
1944          '\t#endif',
1945          '#endif',
1946          '#ifdef USE_SKINNING',
1947          '\tattribute vec4 skinIndex;',
1948          '\tattribute vec4 skinWeight;',
1949          '#endif',
1950          '\n'
1951        ]
1952          .filter(Cf)
1953          .join('\n')),
1954        (u = [
1955          q,
1956          'precision ' + d.precision + ' float;',
1957          'precision ' + d.precision + ' int;',
1958          '#define SHADER_NAME ' + c.__webglShader.name,
1959          r,
1960          d.alphaTest ? '#define ALPHATEST ' + d.alphaTest : '',
1961          '#define GAMMA_FACTOR ' + p,
1962          d.useFog && d.fog ? '#define USE_FOG' : '',
1963          d.useFog && d.fogExp ? '#define FOG_EXP2' : '',
1964          d.map ? '#define USE_MAP' : '',
1965          d.envMap ? '#define USE_ENVMAP' : '',
1966          d.envMap ? '#define ' + k : '',
1967          d.envMap ? '#define ' + n : '',
1968          d.envMap ? '#define ' + o : '',
1969          d.lightMap ? '#define USE_LIGHTMAP' : '',
1970          d.aoMap ? '#define USE_AOMAP' : '',
1971          d.emissiveMap ? '#define USE_EMISSIVEMAP' : '',
1972          d.bumpMap ? '#define USE_BUMPMAP' : '',
1973          d.normalMap ? '#define USE_NORMALMAP' : '',
1974          d.specularMap ? '#define USE_SPECULARMAP' : '',
1975          d.roughnessMap ? '#define USE_ROUGHNESSMAP' : '',
1976          d.metalnessMap ? '#define USE_METALNESSMAP' : '',
1977          d.alphaMap ? '#define USE_ALPHAMAP' : '',
1978          d.vertexColors ? '#define USE_COLOR' : '',
1979          d.gradientMap ? '#define USE_GRADIENTMAP' : '',
1980          d.flatShading ? '#define FLAT_SHADED' : '',
1981          d.doubleSided ? '#define DOUBLE_SIDED' : '',
1982          d.flipSided ? '#define FLIP_SIDED' : '',
1983          '#define NUM_CLIPPING_PLANES ' + d.numClippingPlanes,
1984          '#define UNION_CLIPPING_PLANES ' +
1985            (d.numClippingPlanes - d.numClipIntersection),
1986          d.shadowMapEnabled ? '#define USE_SHADOWMAP' : '',
1987          d.shadowMapEnabled ? '#define ' + j : '',
1988          d.premultipliedAlpha ? '#define PREMULTIPLIED_ALPHA' : '',
1989          d.physicallyCorrectLights ? '#define PHYSICALLY_CORRECT_LIGHTS' : '',
1990          d.logarithmicDepthBuffer ? '#define USE_LOGDEPTHBUF' : '',
1991          d.logarithmicDepthBuffer && a.extensions.get('EXT_frag_depth')
1992            ? '#define USE_LOGDEPTHBUF_EXT'
1993            : '',
1994          d.envMap && a.extensions.get('EXT_shader_texture_lod')
1995            ? '#define TEXTURE_LOD_EXT'
1996            : '',
1997          'uniform mat4 viewMatrix;',
1998          'uniform vec3 cameraPosition;',
1999          d.toneMapping !== aa ? '#define TONE_MAPPING' : '',
2000          d.toneMapping !== aa ? qe.tonemapping_pars_fragment : '',
2001          d.toneMapping !== aa ? yf('toneMapping', d.toneMapping) : '',
2002          d.outputEncoding ||
2003          d.mapEncoding ||
2004          d.envMapEncoding ||
2005          d.emissiveMapEncoding
2006            ? qe.encodings_pars_fragment
2007            : '',
2008          d.mapEncoding ? wf('mapTexelToLinear', d.mapEncoding) : '',
2009          d.envMapEncoding ? wf('envMapTexelToLinear', d.envMapEncoding) : '',
2010          d.emissiveMapEncoding
2011            ? wf('emissiveMapTexelToLinear', d.emissiveMapEncoding)
2012            : '',
2013          d.outputEncoding ? xf('linearToOutputTexel', d.outputEncoding) : '',
2014          d.depthPacking ? '#define DEPTH_PACKING ' + c.depthPacking : '',
2015          '\n'
2016        ]
2017          .filter(Cf)
2018          .join('\n'))),
2019      (h = Ef(h, d)),
2020      (h = Df(h, d)),
2021      (i = Ef(i, d)),
2022      (i = Df(i, d)),
2023      c.isShaderMaterial || ((h = Ff(h)), (i = Ff(i)))
2024    var v = t + h,
2025      w = u + i,
2026      x = tf(e, e.VERTEX_SHADER, v),
2027      y = tf(e, e.FRAGMENT_SHADER, w)
2028    e.attachShader(s, x),
2029      e.attachShader(s, y),
2030      void 0 !== c.index0AttributeName
2031        ? e.bindAttribLocation(s, 0, c.index0AttributeName)
2032        : d.morphTargets === !0 && e.bindAttribLocation(s, 0, 'position'),
2033      e.linkProgram(s)
2034    var z = e.getProgramInfoLog(s),
2035      A = e.getShaderInfoLog(x),
2036      B = e.getShaderInfoLog(y),
2037      C = !0,
2038      D = !0
2039    e.getProgramParameter(s, e.LINK_STATUS) === !1
2040      ? ((C = !1),
2041        console.error(
2042          'THREE.WebGLProgram: shader error: ',
2043          e.getError(),
2044          'gl.VALIDATE_STATUS',
2045          e.getProgramParameter(s, e.VALIDATE_STATUS),
2046          'gl.getProgramInfoLog',
2047          z,
2048          A,
2049          B
2050        ))
2051      : '' !== z
2052      ? console.warn('THREE.WebGLProgram: gl.getProgramInfoLog()', z)
2053      : ('' !== A && '' !== B) || (D = !1),
2054      D &&
2055        (this.diagnostics = {
2056          runnable: C,
2057          material: c,
2058          programLog: z,
2059          vertexShader: { log: A, prefix: t },
2060          fragmentShader: { log: B, prefix: u }
2061        }),
2062      e.deleteShader(x),
2063      e.deleteShader(y)
2064    var E
2065    this.getUniforms = function () {
2066      return void 0 === E && (E = new oc(e, s, a)), E
2067    }
2068    var F
2069    return (
2070      (this.getAttributes = function () {
2071        return void 0 === F && (F = Bf(e, s)), F
2072      }),
2073      (this.destroy = function () {
2074        e.deleteProgram(s), (this.program = void 0)
2075      }),
2076      Object.defineProperties(this, {
2077        uniforms: {
2078          get: function () {
2079            return (
2080              console.warn(
2081                'THREE.WebGLProgram: .uniforms is now .getUniforms().'
2082              ),
2083              this.getUniforms()
2084            )
2085          }
2086        },
2087        attributes: {
2088          get: function () {
2089            return (
2090              console.warn(
2091                'THREE.WebGLProgram: .attributes is now .getAttributes().'
2092              ),
2093              this.getAttributes()
2094            )
2095          }
2096        }
2097      }),
2098      (this.id = uf++),
2099      (this.code = b),
2100      (this.usedTimes = 1),
2101      (this.program = s),
2102      (this.vertexShader = x),
2103      (this.fragmentShader = y),
2104      this
2105    )
2106  }
2107  function Hf(a, b) {
2108    function f(a) {
2109      if (
2110        b.floatVertexTextures &&
2111        a &&
2112        a.skeleton &&
2113        a.skeleton.useVertexTexture
2114      )
2115        return 1024
2116      var c = b.maxVertexUniforms,
2117        d = Math.floor((c - 20) / 4),
2118        e = d
2119      return (
2120        void 0 !== a &&
2121          a &&
2122          a.isSkinnedMesh &&
2123          ((e = Math.min(a.skeleton.bones.length, e)),
2124          e < a.skeleton.bones.length &&
2125            console.warn(
2126              'WebGLRenderer: too many bones - ' +
2127                a.skeleton.bones.length +
2128                ', this GPU supports just ' +
2129                e +
2130                ' (try OpenGL instead of ANGLE)'
2131            )),
2132        e
2133      )
2134    }
2135    function g(a, b) {
2136      var c
2137      return (
2138        a
2139          ? a.isTexture
2140            ? (c = a.encoding)
2141            : a.isWebGLRenderTarget &&
2142              (console.warn(
2143                "THREE.WebGLPrograms.getTextureEncodingFromMap: don't use render targets as textures. Use their .texture property instead."
2144              ),
2145              (c = a.texture.encoding))
2146          : (c = jb),
2147        c === jb && b && (c = lb),
2148        c
2149      )
2150    }
2151    var c = [],
2152      d = {
2153        MeshDepthMaterial: 'depth',
2154        MeshNormalMaterial: 'normal',
2155        MeshBasicMaterial: 'basic',
2156        MeshLambertMaterial: 'lambert',
2157        MeshPhongMaterial: 'phong',
2158        MeshToonMaterial: 'phong',
2159        MeshStandardMaterial: 'physical',
2160        MeshPhysicalMaterial: 'physical',
2161        LineBasicMaterial: 'basic',
2162        LineDashedMaterial: 'dashed',
2163        PointsMaterial: 'points'
2164      },
2165      e = [
2166        'precision',
2167        'supportsVertexTextures',
2168        'map',
2169        'mapEncoding',
2170        'envMap',
2171        'envMapMode',
2172        'envMapEncoding',
2173        'lightMap',
2174        'aoMap',
2175        'emissiveMap',
2176        'emissiveMapEncoding',
2177        'bumpMap',
2178        'normalMap',
2179        'displacementMap',
2180        'specularMap',
2181        'roughnessMap',
2182        'metalnessMap',
2183        'gradientMap',
2184        'alphaMap',
2185        'combine',
2186        'vertexColors',
2187        'fog',
2188        'useFog',
2189        'fogExp',
2190        'flatShading',
2191        'sizeAttenuation',
2192        'logarithmicDepthBuffer',
2193        'skinning',
2194        'maxBones',
2195        'useVertexTexture',
2196        'morphTargets',
2197        'morphNormals',
2198        'maxMorphTargets',
2199        'maxMorphNormals',
2200        'premultipliedAlpha',
2201        'numDirLights',
2202        'numPointLights',
2203        'numSpotLights',
2204        'numHemiLights',
2205        'numRectAreaLights',
2206        'shadowMapEnabled',
2207        'shadowMapType',
2208        'toneMapping',
2209        'physicallyCorrectLights',
2210        'alphaTest',
2211        'doubleSided',
2212        'flipSided',
2213        'numClippingPlanes',
2214        'numClipIntersection',
2215        'depthPacking'
2216      ]
2217    ;(this.getParameters = function (c, e, h, i, j, k) {
2218      var l = d[c.type],
2219        m = f(k),
2220        n = a.getPrecision()
2221      null !== c.precision &&
2222        ((n = b.getMaxPrecision(c.precision)),
2223        n !== c.precision &&
2224          console.warn(
2225            'THREE.WebGLProgram.getParameters:',
2226            c.precision,
2227            'not supported, using',
2228            n,
2229            'instead.'
2230          ))
2231      var r = a.getCurrentRenderTarget(),
2232        s = {
2233          shaderID: l,
2234          precision: n,
2235          supportsVertexTextures: b.vertexTextures,
2236          outputEncoding: g(r ? r.texture : null, a.gammaOutput),
2237          map: !!c.map,
2238          mapEncoding: g(c.map, a.gammaInput),
2239          envMap: !!c.envMap,
2240          envMapMode: c.envMap && c.envMap.mapping,
2241          envMapEncoding: g(c.envMap, a.gammaInput),
2242          envMapCubeUV:
2243            !!c.envMap && (c.envMap.mapping === la || c.envMap.mapping === ma),
2244          lightMap: !!c.lightMap,
2245          aoMap: !!c.aoMap,
2246          emissiveMap: !!c.emissiveMap,
2247          emissiveMapEncoding: g(c.emissiveMap, a.gammaInput),
2248          bumpMap: !!c.bumpMap,
2249          normalMap: !!c.normalMap,
2250          displacementMap: !!c.displacementMap,
2251          roughnessMap: !!c.roughnessMap,
2252          metalnessMap: !!c.metalnessMap,
2253          specularMap: !!c.specularMap,
2254          alphaMap: !!c.alphaMap,
2255          gradientMap: !!c.gradientMap,
2256          combine: c.combine,
2257          vertexColors: c.vertexColors,
2258          fog: !!h,
2259          useFog: c.fog,
2260          fogExp: h && h.isFogExp2,
2261          flatShading: c.shading === q,
2262          sizeAttenuation: c.sizeAttenuation,
2263          logarithmicDepthBuffer: b.logarithmicDepthBuffer,
2264          skinning: c.skinning,
2265          maxBones: m,
2266          useVertexTexture:
2267            b.floatVertexTextures &&
2268            k &&
2269            k.skeleton &&
2270            k.skeleton.useVertexTexture,
2271          morphTargets: c.morphTargets,
2272          morphNormals: c.morphNormals,
2273          maxMorphTargets: a.maxMorphTargets,
2274          maxMorphNormals: a.maxMorphNormals,
2275          numDirLights: e.directional.length,
2276          numPointLights: e.point.length,
2277          numSpotLights: e.spot.length,
2278          numRectAreaLights: e.rectArea.length,
2279          numHemiLights: e.hemi.length,
2280          numClippingPlanes: i,
2281          numClipIntersection: j,
2282          shadowMapEnabled:
2283            a.shadowMap.enabled && k.receiveShadow && e.shadows.length > 0,
2284          shadowMapType: a.shadowMap.type,
2285          toneMapping: a.toneMapping,
2286          physicallyCorrectLights: a.physicallyCorrectLights,
2287          premultipliedAlpha: c.premultipliedAlpha,
2288          alphaTest: c.alphaTest,
2289          doubleSided: c.side === p,
2290          flipSided: c.side === o,
2291          depthPacking: void 0 !== c.depthPacking && c.depthPacking
2292        }
2293      return s
2294    }),
2295      (this.getProgramCode = function (a, b) {
2296        var c = []
2297        if (
2298          (b.shaderID
2299            ? c.push(b.shaderID)
2300            : (c.push(a.fragmentShader), c.push(a.vertexShader)),
2301          void 0 !== a.defines)
2302        )
2303          for (var d in a.defines) c.push(d), c.push(a.defines[d])
2304        for (var f = 0; f < e.length; f++) c.push(b[e[f]])
2305        return c.join()
2306      }),
2307      (this.acquireProgram = function (b, d, e) {
2308        for (var f, g = 0, h = c.length; g < h; g++) {
2309          var i = c[g]
2310          if (i.code === e) {
2311            ;(f = i), ++f.usedTimes
2312            break
2313          }
2314        }
2315        return void 0 === f && ((f = new Gf(a, e, b, d)), c.push(f)), f
2316      }),
2317      (this.releaseProgram = function (a) {
2318        if (0 === --a.usedTimes) {
2319          var b = c.indexOf(a)
2320          ;(c[b] = c[c.length - 1]), c.pop(), a.destroy()
2321        }
2322      }),
2323      (this.programs = c)
2324  }
2325  function If(a, b, c) {
2326    function e(a) {
2327      var f = a.target,
2328        i = d[f.id]
2329      null !== i.index && g(i.index),
2330        h(i.attributes),
2331        f.removeEventListener('dispose', e),
2332        delete d[f.id]
2333      var j = b.get(f)
2334      j.wireframe && g(j.wireframe), b.delete(f)
2335      var k = b.get(i)
2336      k.wireframe && g(k.wireframe), b.delete(i), c.memory.geometries--
2337    }
2338    function f(a) {
2339      return a.isInterleavedBufferAttribute
2340        ? b.get(a.data).__webglBuffer
2341        : b.get(a).__webglBuffer
2342    }
2343    function g(b) {
2344      var c = f(b)
2345      void 0 !== c && (a.deleteBuffer(c), i(b))
2346    }
2347    function h(a) {
2348      for (var b in a) g(a[b])
2349    }
2350    function i(a) {
2351      a.isInterleavedBufferAttribute ? b.delete(a.data) : b.delete(a)
2352    }
2353    var d = {}
2354    return {
2355      get: function (a) {
2356        var b = a.geometry
2357        if (void 0 !== d[b.id]) return d[b.id]
2358        b.addEventListener('dispose', e)
2359        var f
2360        return (
2361          b.isBufferGeometry
2362            ? (f = b)
2363            : b.isGeometry &&
2364              (void 0 === b._bufferGeometry &&
2365                (b._bufferGeometry = new ff().setFromObject(a)),
2366              (f = b._bufferGeometry)),
2367          (d[b.id] = f),
2368          c.memory.geometries++,
2369          f
2370        )
2371      }
2372    }
2373  }
2374  function Jf(a, b, c) {
2375    function e(b) {
2376      var c = d.get(b)
2377      b.geometry.isGeometry && c.updateFromObject(b)
2378      var e = c.index,
2379        g = c.attributes
2380      null !== e && f(e, a.ELEMENT_ARRAY_BUFFER)
2381      for (var h in g) f(g[h], a.ARRAY_BUFFER)
2382      var i = c.morphAttributes
2383      for (var h in i)
2384        for (var j = i[h], k = 0, l = j.length; k < l; k++)
2385          f(j[k], a.ARRAY_BUFFER)
2386      return c
2387    }
2388    function f(a, c) {
2389      var d = a.isInterleavedBufferAttribute ? a.data : a,
2390        e = b.get(d)
2391      void 0 === e.__webglBuffer
2392        ? g(e, d, c)
2393        : e.version !== d.version && h(e, d, c)
2394    }
2395    function g(b, c, d) {
2396      ;(b.__webglBuffer = a.createBuffer()), a.bindBuffer(d, b.__webglBuffer)
2397      var e = c.dynamic ? a.DYNAMIC_DRAW : a.STATIC_DRAW
2398      a.bufferData(d, c.array, e)
2399      var f = a.FLOAT,
2400        g = c.array
2401      g instanceof Float32Array
2402        ? (f = a.FLOAT)
2403        : g instanceof Float64Array
2404        ? console.warn('Unsupported data buffer format: Float64Array')
2405        : g instanceof Uint16Array
2406        ? (f = a.UNSIGNED_SHORT)
2407        : g instanceof Int16Array
2408        ? (f = a.SHORT)
2409        : g instanceof Uint32Array
2410        ? (f = a.UNSIGNED_INT)
2411        : g instanceof Int32Array
2412        ? (f = a.INT)
2413        : g instanceof Int8Array
2414        ? (f = a.BYTE)
2415        : g instanceof Uint8Array && (f = a.UNSIGNED_BYTE),
2416        (b.bytesPerElement = g.BYTES_PER_ELEMENT),
2417        (b.type = f),
2418        (b.version = c.version),
2419        c.onUploadCallback()
2420    }
2421    function h(b, c, d) {
2422      a.bindBuffer(d, b.__webglBuffer),
2423        c.dynamic === !1
2424          ? a.bufferData(d, c.array, a.STATIC_DRAW)
2425          : c.updateRange.count === -1
2426          ? a.bufferSubData(d, 0, c.array)
2427          : 0 === c.updateRange.count
2428          ? console.error(
2429              'THREE.WebGLObjects.updateBuffer: dynamic THREE.BufferAttribute marked as 
2429needsUpdate but updateRange.count is 0, ensure you are using set methods or updating manually.'
2430            )
2431          : (a.bufferSubData(
2432              d,
2433              c.updateRange.offset * c.array.BYTES_PER_ELEMENT,
2434              c.array.subarray(
2435                c.updateRange.offset,
2436                c.updateRange.offset + c.updateRange.count
2437              )
2438            ),
2439            (c.updateRange.count = 0)),
2440        (b.version = c.version)
2441    }
2442    function i(a) {
2443      return a.isInterleavedBufferAttribute
2444        ? b.get(a.data).__webglBuffer
2445        : b.get(a).__webglBuffer
2446    }
2447    function j(a) {
2448      return a.isInterleavedBufferAttribute ? b.get(a.data) : b.get(a)
2449    }
2450    function k(c) {
2451      var d = b.get(c)
2452      if (void 0 !== d.wireframe) return d.wireframe
2453      var e = [],
2454        g = c.index,
2455        h = c.attributes
2456      if (null !== g)
2457        for (var i = g.array, j = 0, k = i.length; j < k; j += 3) {
2458          var l = i[j + 0],
2459            m = i[j + 1],
2460            n = i[j + 2]
2461          e.push(l, m, m, n, n, l)
2462        }
2463      else
2464        for (
2465          var i = h.position.array, j = 0, k = i.length / 3 - 1;
2466          j < k;
2467          j += 3
2468        ) {
2469          var l = j + 0,
2470            m = j + 1,
2471            n = j + 2
2472          e.push(l, m, m, n, n, l)
2473        }
2474      var o = new (bf(e) > 65535 ? Ze : Xe)(e, 1)
2475      return f(o, a.ELEMENT_ARRAY_BUFFER), (d.wireframe = o), o
2476    }
2477    var d = new If(a, b, c)
2478    return {
2479      getAttributeBuffer: i,
2480      getAttributeProperties: j,
2481      getWireframeAttribute: k,
2482      update: e
2483    }
2484  }
2485  function Kf(a, b, c, d, e, f, g) {
2486    function j(a, b) {
2487      if (a.width > b || a.height > b) {
2488        var c = b / Math.max(a.width, a.height),
2489          d = document.createElementNS('http://www.w3.org/1999/xhtml', 'canvas')
2490        ;(d.width = Math.floor(a.width * c)),
2491          (d.height = Math.floor(a.height * c))
2492        var e = d.getContext('2d')
2493        return (
2494          e.drawImage(a, 0, 0, a.width, a.height, 0, 0, d.width, d.height),
2495          console.warn(
2496            'THREE.WebGLRenderer: image is too big (' +
2497              a.width +
2498              'x' +
2499              a.height +
2500              '). Resized to ' +
2501              d.width +
2502              'x' +
2503              d.height,
2504            a
2505          ),
2506          d
2507        )
2508      }
2509      return a
2510    }
2511    function k(a) {
2512      return tb.isPowerOfTwo(a.width) && tb.isPowerOfTwo(a.height)
2513    }
2514    function l(a) {
2515      if (a instanceof HTMLImageElement || a instanceof HTMLCanvasElement) {
2516        var b = document.createElementNS(
2517          'http://www.w3.org/1999/xhtml',
2518          'canvas'
2519        )
2520        ;(b.width = tb.nearestPowerOfTwo(a.width)),
2521          (b.height = tb.nearestPowerOfTwo(a.height))
2522        var c = b.getContext('2d')
2523        return (
2524          c.drawImage(a, 0, 0, b.width, b.height),
2525          console.warn(
2526            'THREE.WebGLRenderer: image is not power of two (' +
2527              a.width +
2528              'x' +
2529              a.height +
2530              '). Resized to ' +
2531              b.width +
2532              'x' +
2533              b.height,
2534            a
2535          ),
2536          b
2537        )
2538      }
2539      return a
2540    }
2541    function m(a) {
2542      return (
2543        a.wrapS !== oa ||
2544        a.wrapT !== oa ||
2545        (a.minFilter !== qa && a.minFilter !== ta)
2546      )
2547    }
2548    function n(b) {
2549      return b === qa || b === ra || b === sa ? a.NEAREST : a.LINEAR
2550    }
2551    function o(a) {
2552      var b = a.target
2553      b.removeEventListener('dispose', o), q(b), h.textures--
2554    }
2555    function p(a) {
2556      var b = a.target
2557      b.removeEventListener('dispose', p), r(b), h.textures--
2558    }
2559    function q(b) {
2560      var c = d.get(b)
2561      if (b.image && c.__image__webglTextureCube)
2562        a.deleteTexture(c.__image__webglTextureCube)
2563      else {
2564        if (void 0 === c.__webglInit) return
2565        a.deleteTexture(c.__webglTexture)
2566      }
2567      d.delete(b)
2568    }
2569    function r(b) {
2570      var c = d.get(b),
2571        e = d.get(b.texture)
2572      if (b) {
2573        if (
2574          (void 0 !== e.__webglTexture && a.deleteTexture(e.__webglTexture),
2575          b.depthTexture && b.depthTexture.dispose(),
2576          b.isWebGLRenderTargetCube)
2577        )
2578          for (var f = 0; f < 6; f++)
2579            a.deleteFramebuffer(c.__webglFramebuffer[f]),
2580              c.__webglDepthbuffer &&
2581                a.deleteRenderbuffer(c.__webglDepthbuffer[f])
2582        else
2583          a.deleteFramebuffer(c.__webglFramebuffer),
2584            c.__webglDepthbuffer && a.deleteRenderbuffer(c.__webglDepthbuffer)
2585        d.delete(b.texture), d.delete(b)
2586      }
2587    }
2588    function s(b, e) {
2589      var f = d.get(b)
2590      if (b.version > 0 && f.__version !== b.version) {
2591        var g = b.image
2592        if (void 0 === g)
2593          console.warn(
2594            'THREE.WebGLRenderer: Texture marked for update but image is undefined',
2595            b
2596          )
2597        else {
2598          if (g.complete !== !1) return void w(f, b, e)
2599          console.warn(
2600            'THREE.WebGLRenderer: Texture marked for update but image is incomplete',
2601            b
2602          )
2603        }
2604      }
2605      c.activeTexture(a.TEXTURE0 + e),
2606        c.bindTexture(a.TEXTURE_2D, f.__webglTexture)
2607    }
2608    function t(b, g) {
2609      var i = d.get(b)
2610      if (6 === b.image.length)
2611        if (b.version > 0 && i.__version !== b.version) {
2612          i.__image__webglTextureCube ||
2613            (b.addEventListener('dispose', o),
2614            (i.__image__webglTextureCube = a.createTexture()),
2615            h.textures++),
2616            c.activeTexture(a.TEXTURE0 + g),
2617            c.bindTexture(a.TEXTURE_CUBE_MAP, i.__image__webglTextureCube),
2618            a.pixelStorei(a.UNPACK_FLIP_Y_WEBGL, b.flipY)
2619          for (
2620            var l = b && b.isCompressedTexture,
2621              m = b.image[0] && b.image[0].isDataTexture,
2622              n = [],
2623              p = 0;
2624            p < 6;
2625            p++
2626          )
2627            l || m
2628              ? (n[p] = m ? b.image[p].image : b.image[p])
2629              : (n[p] = j(b.image[p], e.maxCubemapSize))
2630          var q = n[0],
2631            r = k(q),
2632            s = f(b.format),
2633            t = f(b.type)
2634          v(a.TEXTURE_CUBE_MAP, b, r)
2635          for (var p = 0; p < 6; p++)
2636            if (l)
2637              for (var u, w = n[p].mipmaps, x = 0, y = w.length; x < y; x++)
2638                (u = w[x]),
2639                  b.format !== Ka && b.format !== Ja
2640                    ? c.getCompressedTextureFormats().indexOf(s) > -1
2641                      ? c.compressedTexImage2D(
2642                          a.TEXTURE_CUBE_MAP_POSITIVE_X + p,
2643                          x,
2644                          s,
2645                          u.width,
2646                          u.height,
2647                          0,
2648                          u.data
2649                        )
2650                      : console.warn(
2651                          'THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .setTextureCube()'
2652                        )
2653                    : c.texImage2D(
2654                        a.TEXTURE_CUBE_MAP_POSITIVE_X + p,
2655                        x,
2656                        s,
2657                        u.width,
2658                        u.height,
2659                        0,
2660                        s,
2661                        t,
2662                        u.data
2663                      )
2664            else
2665              m
2666                ? c.texImage2D(
2667                    a.TEXTURE_CUBE_MAP_POSITIVE_X + p,
2668                    0,
2669                    s,
2670                    n[p].width,
2671                    n[p].height,
2672                    0,
2673                    s,
2674                    t,
2675                    n[p].data
2676                  )
2677                : c.texImage2D(
2678                    a.TEXTURE_CUBE_MAP_POSITIVE_X + p,
2679                    0,
2680                    s,
2681                    s,
2682                    t,
2683                    n[p]
2684                  )
2685          b.generateMipmaps && r && a.generateMipmap(a.TEXTURE_CUBE_MAP),
2686            (i.__version = b.version),
2687            b.onUpdate && b.onUpdate(b)
2688        } else
2689          c.activeTexture(a.TEXTURE0 + g),
2690            c.bindTexture(a.TEXTURE_CUBE_MAP, i.__image__webglTextureCube)
2691    }
2692    function u(b, e) {
2693      c.activeTexture(a.TEXTURE0 + e),
2694        c.bindTexture(a.TEXTURE_CUBE_MAP, d.get(b).__webglTexture)
2695    }
2696    function v(c, g, h) {
2697      var i
2698      if (
2699        (h
2700          ? (a.texParameteri(c, a.TEXTURE_WRAP_S, f(g.wrapS)),
2701            a.texParameteri(c, a.TEXTURE_WRAP_T, f(g.wrapT)),
2702            a.texParameteri(c, a.TEXTURE_MAG_FILTER, f(g.magFilter)),
2703            a.texParameteri(c, a.TEXTURE_MIN_FILTER, f(g.minFilter)))
2704          : (a.texParameteri(c, a.TEXTURE_WRAP_S, a.CLAMP_TO_EDGE),
2705            a.texParameteri(c, a.TEXTURE_WRAP_T, a.CLAMP_TO_EDGE),
2706            (g.wrapS === oa && g.wrapT === oa) ||
2707              console.warn(
2708                'THREE.WebGLRenderer: Texture is not power of two. Texture.wrapS and Texture.wrapT should be set to THREE.ClampToEdgeWrapping.',
2709                g
2710              ),
2711            a.texParameteri(c, a.TEXTURE_MAG_FILTER, n(g.magFilter)),
2712            a.texParameteri(c, a.TEXTURE_MIN_FILTER, n(g.minFilter)),
2713            g.minFilter !== qa &&
2714              g.minFilter !== ta &&
2715              console.warn(
2716                'THREE.WebGLRenderer: Texture is not power of two. Texture.minFilter should be set to THREE.NearestFilter or THREE.LinearFilter.',
2717                g
2718              )),
2719        (i = b.get('EXT_texture_filter_anisotropic')))
2720      ) {
2721        if (g.type === Ca && null === b.get('OES_texture_float_linear')) return
2722        if (g.type === Da && null === b.get('OES_texture_half_float_linear'))
2723          return
2724        ;(g.anisotropy > 1 || d.get(g).__currentAnisotropy) &&
2725          (a.texParameterf(
2726            c,
2727            i.TEXTURE_MAX_ANISOTROPY_EXT,
2728            Math.min(g.anisotropy, e.getMaxAnisotropy())
2729          ),
2730          (d.get(g).__currentAnisotropy = g.anisotropy))
2731      }
2732    }
2733    function w(b, d, g) {
2734      void 0 === b.__webglInit &&
2735        ((b.__webglInit = !0),
2736        d.addEventListener('dispose', o),
2737        (b.__webglTexture = a.createTexture()),
2738        h.textures++),
2739        c.activeTexture(a.TEXTURE0 + g),
2740        c.bindTexture(a.TEXTURE_2D, b.__webglTexture),
2741        a.pixelStorei(a.UNPACK_FLIP_Y_WEBGL, d.flipY),
2742        a.pixelStorei(a.UNPACK_PREMULTIPLY_ALPHA_WEBGL, d.premultiplyAlpha),
2743        a.pixelStorei(a.UNPACK_ALIGNMENT, d.unpackAlignment)
2744      var n = j(d.image, e.maxTextureSize)
2745      m(d) && k(n) === !1 && (n = l(n))
2746      var p = k(n),
2747        q = f(d.format),
2748        r = f(d.type)
2749      v(a.TEXTURE_2D, d, p)
2750      var s,
2751        t = d.mipmaps
2752      if (d.isDepthTexture) {
2753        var u = a.DEPTH_COMPONENT
2754        if (d.type === Ca) {
2755          if (!i)
2756            throw new Error('Float Depth Texture only supported in WebGL2.0')
2757          u = a.DEPTH_COMPONENT32F
2758        } else i && (u = a.DEPTH_COMPONENT16)
2759        d.format === Oa &&
2760          u === a.DEPTH_COMPONENT &&
2761          d.type !== za &&
2762          d.type !== Ba &&
2763          (console.warn(
2764            'THREE.WebGLRenderer: Use UnsignedShortType or UnsignedIntType for DepthFormat DepthTexture.'
2765          ),
2766          (d.type = za),
2767          (r = f(d.type))),
2768          d.format === Pa &&
2769            ((u = a.DEPTH_STENCIL),
2770            d.type !== Ha &&
2771              (console.warn(
2772                'THREE.WebGLRenderer: Use UnsignedInt248Type for DepthStencilFormat DepthTexture.'
2773              ),
2774              (d.type = Ha),
2775              (r = f(d.type)))),
2776          c.texImage2D(a.TEXTURE_2D, 0, u, n.width, n.height, 0, q, r, null)
2777      } else if (d.isDataTexture)
2778        if (t.length > 0 && p) {
2779          for (var w = 0, x = t.length; w < x; w++)
2780            (s = t[w]),
2781              c.texImage2D(
2782                a.TEXTURE_2D,
2783                w,
2784                q,
2785                s.width,
2786                s.height,
2787                0,
2788                q,
2789                r,
2790                s.data
2791              )
2792          d.generateMipmaps = !1
2793        } else
2794          c.texImage2D(a.TEXTURE_2D, 0, q, n.width, n.height, 0, q, r, n.data)
2795      else if (d.isCompressedTexture)
2796        for (var w = 0, x = t.length; w < x; w++)
2797          (s = t[w]),
2798            d.format !== Ka && d.format !== Ja
2799              ? c.getCompressedTextureFormats().indexOf(q) > -1
2800                ? c.compressedTexImage2D(
2801                    a.TEXTURE_2D,
2802                    w,
2803                    q,
2804                    s.width,
2805                    s.height,
2806                    0,
2807                    s.data
2808                  )
2809                : console.warn(
2810                    'THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()'
2811                  )
2812              : c.texImage2D(
2813                  a.TEXTURE_2D,
2814                  w,
2815                  q,
2816                  s.width,
2817                  s.height,
2818                  0,
2819                  q,
2820                  r,
2821                  s.data
2822                )
2823      else if (t.length > 0 && p) {
2824        for (var w = 0, x = t.length; w < x; w++)
2825          (s = t[w]), c.texImage2D(a.TEXTURE_2D, w, q, q, r, s)
2826        d.generateMipmaps = !1
2827      } else c.texImage2D(a.TEXTURE_2D, 0, q, q, r, n)
2828      d.generateMipmaps && p && a.generateMipmap(a.TEXTURE_2D),
2829        (b.__version = d.version),
2830        d.onUpdate && d.onUpdate(d)
2831    }
2832    function x(b, e, g, h) {
2833      var i = f(e.texture.format),
2834        j = f(e.texture.type)
2835      c.texImage2D(h, 0, i, e.width, e.height, 0, i, j, null),
2836        a.bindFramebuffer(a.FRAMEBUFFER, b),
2837        a.framebufferTexture2D(
2838          a.FRAMEBUFFER,
2839          g,
2840          h,
2841          d.get(e.texture).__webglTexture,
2842          0
2843        ),
2844        a.bindFramebuffer(a.FRAMEBUFFER, null)
2845    }
2846    function y(b, c) {
2847      a.bindRenderbuffer(a.RENDERBUFFER, b),
2848        c.depthBuffer && !c.stencilBuffer
2849          ? (a.renderbufferStorage(
2850              a.RENDERBUFFER,
2851              a.DEPTH_COMPONENT16,
2852              c.width,
2853              c.height
2854            ),
2855            a.framebufferRenderbuffer(
2856              a.FRAMEBUFFER,
2857              a.DEPTH_ATTACHMENT,
2858              a.RENDERBUFFER,
2859              b
2860            ))
2861          : c.depthBuffer && c.stencilBuffer
2862          ? (a.renderbufferStorage(
2863              a.RENDERBUFFER,
2864              a.DEPTH_STENCIL,
2865              c.width,
2866              c.height
2867            ),
2868            a.framebufferRenderbuffer(
2869              a.FRAMEBUFFER,
2870              a.DEPTH_STENCIL_ATTACHMENT,
2871              a.RENDERBUFFER,
2872              b
2873            ))
2874          : a.renderbufferStorage(a.RENDERBUFFER, a.RGBA4, c.width, c.height),
2875        a.bindRenderbuffer(a.RENDERBUFFER, null)
2876    }
2877    function z(b, c) {
2878      var e = c && c.isWebGLRenderTargetCube
2879      if (e)
2880        throw new Error(
2881          'Depth Texture with cube render targets is not supported!'
2882        )
2883      if (
2884        (a.bindFramebuffer(a.FRAMEBUFFER, b),
2885        !c.depthTexture || !c.depthTexture.isDepthTexture)
2886      )
2887        throw new Error(
2888          'renderTarget.depthTexture must be an instance of THREE.DepthTexture'
2889        )
2890      ;(d.get(c.depthTexture).__webglTexture &&
2891        c.depthTexture.image.width === c.width &&
2892        c.depthTexture.image.height === c.height) ||
2893        ((c.depthTexture.image.width = c.width),
2894        (c.depthTexture.image.height = c.height),
2895        (c.depthTexture.needsUpdate = !0)),
2896        s(c.depthTexture, 0)
2897      var f = d.get(c.depthTexture).__webglTexture
2898      if (c.depthTexture.format === Oa)
2899        a.framebufferTexture2D(
2900          a.FRAMEBUFFER,
2901          a.DEPTH_ATTACHMENT,
2902          a.TEXTURE_2D,
2903          f,
2904          0
2905        )
2906      else {
2907        if (c.depthTexture.format !== Pa)
2908          throw new Error('Unknown depthTexture format')
2909        a.framebufferTexture2D(
2910          a.FRAMEBUFFER,
2911          a.DEPTH_STENCIL_ATTACHMENT,
2912          a.TEXTURE_2D,
2913          f,
2914          0
2915        )
2916      }
2917    }
2918    function A(b) {
2919      var c = d.get(b),
2920        e = b.isWebGLRenderTargetCube === !0
2921      if (b.depthTexture) {
2922        if (e)
2923          throw new Error(
2924            'target.depthTexture not supported in Cube render targets'
2925          )
2926        z(c.__webglFramebuffer, b)
2927      } else if (e) {
2928        c.__webglDepthbuffer = []
2929        for (var f = 0; f < 6; f++)
2930          a.bindFramebuffer(a.FRAMEBUFFER, c.__webglFramebuffer[f]),
2931            (c.__webglDepthbuffer[f] = a.createRenderbuffer()),
2932            y(c.__webglDepthbuffer[f], b)
2933      } else
2934        a.bindFramebuffer(a.FRAMEBUFFER, c.__webglFramebuffer),
2935          (c.__webglDepthbuffer = a.createRenderbuffer()),
2936          y(c.__webglDepthbuffer, b)
2937      a.bindFramebuffer(a.FRAMEBUFFER, null)
2938    }
2939    function B(b) {
2940      var e = d.get(b),
2941        f = d.get(b.texture)
2942      b.addEventListener('dispose', p),
2943        (f.__webglTexture = a.createTexture()),
2944        h.textures++
2945      var g = b.isWebGLRenderTargetCube === !0,
2946        i = k(b)
2947      if (g) {
2948        e.__webglFramebuffer = []
2949        for (var j = 0; j < 6; j++)
2950          e.__webglFramebuffer[j] = a.createFramebuffer()
2951      } else e.__webglFramebuffer = a.createFramebuffer()
2952      if (g) {
2953        c.bindTexture(a.TEXTURE_CUBE_MAP, f.__webglTexture),
2954          v(a.TEXTURE_CUBE_MAP, b.texture, i)
2955        for (var j = 0; j < 6; j++)
2956          x(
2957            e.__webglFramebuffer[j],
2958            b,
2959            a.COLOR_ATTACHMENT0,
2960            a.TEXTURE_CUBE_MAP_POSITIVE_X + j
2961          )
2962        b.texture.generateMipmaps && i && a.generateMipmap(a.TEXTURE_CUBE_MAP),
2963          c.bindTexture(a.TEXTURE_CUBE_MAP, null)
2964      } else c.bindTexture(a.TEXTURE_2D, f.__webglTexture), v(a.TEXTURE_2D, b.texture, i), x(e.__webglFramebuffer, b, a.COLOR_ATTACHMENT0, a.TEXTURE_2D), b.texture.generateMipmaps && i && a.generateMipmap(a.TEXTURE_2D), c.bindTexture(a.TEXTURE_2D, null)
2965      b.depthBuffer && A(b)
2966    }
2967    function C(b) {
2968      var e = b.texture
2969      if (
2970        e.generateMipmaps &&
2971        k(b) &&
2972        e.minFilter !== qa &&
2973        e.minFilter !== ta
2974      ) {
2975        var f =
2976            b && b.isWebGLRenderTargetCube ? a.TEXTURE_CUBE_MAP : a.TEXTURE_2D,
2977          g = d.get(e).__webglTexture
2978        c.bindTexture(f, g), a.generateMipmap(f), c.bindTexture(f, null)
2979      }
2980    }
2981    var h = g.memory,
2982      i =
2983        'undefined' != typeof WebGL2RenderingContext &&
2984        a instanceof WebGL2RenderingContext
2985    ;(this.setTexture2D = s),
2986      (this.setTextureCube = t),
2987      (this.setTextureCubeDynamic = u),
2988      (this.setupRenderTarget = B),
2989      (this.updateRenderTargetMipmap = C)
2990  }
2991  function Lf() {
2992    var a = {}
2993    return {
2994      get: function (b) {
2995        var c = b.uuid,
2996          d = a[c]
2997        return void 0 === d && ((d = {}), (a[c] = d)), d
2998      },
2999      delete: function (b) {
3000        delete a[b.uuid]
3001      },
3002      clear: function () {
3003        a = {}
3004      }
3005    }
3006  }
3007  function Mf(a, b, c) {
3008    function d() {
3009      var b = !1,
3010        c = new xb(),
3011        d = null,
3012        e = new xb()
3013      return {
3014        setMask: function (c) {
3015          d === c || b || (a.colorMask(c, c, c, c), (d = c))
3016        },
3017        setLocked: function (a) {
3018          b = a
3019        },
3020        setClear: function (b, d, f, g, h) {
3021          h === !0 && ((b *= g), (d *= g), (f *= g)),
3022            c.set(b, d, f, g),
3023            e.equals(c) === !1 && (a.clearColor(b, d, f, g), e.copy(c))
3024        },
3025        reset: function () {
3026          ;(b = !1), (d = null), e.set(0, 0, 0, 1)
3027        }
3028      }
3029    }
3030    function h() {
3031      var b = !1,
3032        c = null,
3033        d = null,
3034        e = null
3035      return {
3036        setTest: function (b) {
3037          b ? ga(a.DEPTH_TEST) : ha(a.DEPTH_TEST)
3038        },
3039        setMask: function (d) {
3040          c === d || b || (a.depthMask(d), (c = d))
3041        },
3042        setFunc: function (b) {
3043          if (d !== b) {
3044            if (b)
3045              switch (b) {
3046                case R:
3047                  a.depthFunc(a.NEVER)
3048                  break
3049                case S:
3050                  a.depthFunc(a.ALWAYS)
3051                  break
3052                case T:
3053                  a.depthFunc(a.LESS)
3054                  break
3055                case U:
3056                  a.depthFunc(a.LEQUAL)
3057                  break
3058                case V:
3059                  a.depthFunc(a.EQUAL)
3060                  break
3061                case W:
3062                  a.depthFunc(a.GEQUAL)
3063                  break
3064                case X:
3065                  a.depthFunc(a.GREATER)
3066                  break
3067                case Y:
3068                  a.depthFunc(a.NOTEQUAL)
3069                  break
3070                default:
3071                  a.depthFunc(a.LEQUAL)
3072              }
3073            else a.depthFunc(a.LEQUAL)
3074            d = b
3075          }
3076        },
3077        setLocked: function (a) {
3078          b = a
3079        },
3080        setClear: function (b) {
3081          e !== b && (a.clearDepth(b), (e = b))
3082        },
3083        reset: function () {
3084          ;(b = !1), (c = null), (d = null), (e = null)
3085        }
3086      }
3087    }
3088    function i() {
3089      var b = !1,
3090        c = null,
3091        d = null,
3092        e = null,
3093        f = null,
3094        g = null,
3095        h = null,
3096        i = null,
3097        j = null
3098      return {
3099        setTest: function (b) {
3100          b ? ga(a.STENCIL_TEST) : ha(a.STENCIL_TEST)
3101        },
3102        setMask: function (d) {
3103          c === d || b || (a.stencilMask(d), (c = d))
3104        },
3105        setFunc: function (b, c, g) {
3106          ;(d === b && e === c && f === g) ||
3107            (a.stencilFunc(b, c, g), (d = b), (e = c), (f = g))
3108        },
3109        setOp: function (b, c, d) {
3110          ;(g === b && h === c && i === d) ||
3111            (a.stencilOp(b, c, d), (g = b), (h = c), (i = d))
3112        },
3113        setLocked: function (a) {
3114          b = a
3115        },
3116        setClear: function (b) {
3117          j !== b && (a.clearStencil(b), (j = b))
3118        },
3119        reset: function () {
3120          ;(b = !1),
3121            (c = null),
3122            (d = null),
3123            (e = null),
3124            (f = null),
3125            (g = null),
3126            (h = null),
3127            (i = null),
3128            (j = null)
3129        }
3130      }
3131    }
3132    function _(b, c, d) {
3133      var e = new Uint8Array(4),
3134        f = a.createTexture()
3135      a.bindTexture(b, f),
3136        a.texParameteri(b, a.TEXTURE_MIN_FILTER, a.NEAREST),
3137        a.texParameteri(b, a.TEXTURE_MAG_FILTER, a.NEAREST)
3138      for (var g = 0; g < d; g++)
3139        a.texImage2D(c + g, 0, a.RGBA, 1, 1, 0, a.RGBA, a.UNSIGNED_BYTE, e)
3140      return f
3141    }
3142    function ba() {
3143      j.setClear(0, 0, 0, 1),
3144        k.setClear(1),
3145        l.setClear(0),
3146        ga(a.DEPTH_TEST),
3147        na(U),
3148        sa(!1),
3149        ta(f),
3150        ga(a.CULL_FACE),
3151        ga(a.BLEND),
3152        ja(w)
3153    }
3154    function ca() {
3155      for (var a = 0, b = n.length; a < b; a++) n[a] = 0
3156    }
3157    function da(c) {
3158      if (
3159        ((n[c] = 1),
3160        0 === o[c] && (a.enableVertexAttribArray(c), (o[c] = 1)),
3161        0 !== p[c])
3162      ) {
3163        var d = b.get('ANGLE_instanced_arrays')
3164        d.vertexAttribDivisorANGLE(c, 0), (p[c] = 0)
3165      }
3166    }
3167    function ea(b, c, d) {
3168      ;(n[b] = 1),
3169        0 === o[b] && (a.enableVertexAttribArray(b), (o[b] = 1)),
3170        p[b] !== c && (d.vertexAttribDivisorANGLE(b, c), (p[b] = c))
3171    }
3172    function fa() {
3173      for (var b = 0, c = o.length; b !== c; ++b)
3174        o[b] !== n[b] && (a.disableVertexAttribArray(b), (o[b] = 0))
3175    }
3176    function ga(b) {
3177      q[b] !== !0 && (a.enable(b), (q[b] = !0))
3178    }
3179    function ha(b) {
3180      q[b] !== !1 && (a.disable(b), (q[b] = !1))
3181    }
3182    function ia() {
3183      if (
3184        null === r &&
3185        ((r = []),
3186        b.get('WEBGL_compressed_texture_pvrtc') ||
3187          b.get('WEBGL_compressed_texture_s3tc') ||
3188          b.get('WEBGL_compressed_texture_etc1'))
3189      )
3190        for (
3191          var c = a.getParameter(a.COMPRESSED_TEXTURE_FORMATS), d = 0;
3192          d < c.length;
3193          d++
3194        )
3195          r.push(c[d])
3196      return r
3197    }
3198    function ja(b, d, e, f, g, h, i, j) {
3199      b !== v ? ga(a.BLEND) : ha(a.BLEND),
3200        (b === s && j === F) ||
3201          (b === x
3202            ? j
3203              ? (a.blendEquationSeparate(a.FUNC_ADD, a.FUNC_ADD),
3204                a.blendFuncSeparate(a.ONE, a.ONE, a.ONE, a.ONE))
3205              : (a.blendEquation(a.FUNC_ADD), a.blendFunc(a.SRC_ALPHA, a.ONE))
3206            : b === y
3207            ? j
3208              ? (a.blendEquationSeparate(a.FUNC_ADD, a.FUNC_ADD),
3209                a.blendFuncSeparate(
3210                  a.ZERO,
3211                  a.ZERO,
3212                  a.ONE_MINUS_SRC_COLOR,
3213                  a.ONE_MINUS_SRC_ALPHA
3214                ))
3215              : (a.blendEquation(a.FUNC_ADD),
3216                a.blendFunc(a.ZERO, a.ONE_MINUS_SRC_COLOR))
3217            : b === z
3218            ? j
3219              ? (a.blendEquationSeparate(a.FUNC_ADD, a.FUNC_ADD),
3220                a.blendFuncSeparate(a.ZERO, a.SRC_COLOR, a.ZERO, a.SRC_ALPHA))
3221              : (a.blendEquation(a.FUNC_ADD), a.blendFunc(a.ZERO, a.SRC_COLOR))
3222            : j
3223            ? (a.blendEquationSeparate(a.FUNC_ADD, a.FUNC_ADD),
3224              a.blendFuncSeparate(
3225                a.ONE,
3226                a.ONE_MINUS_SRC_ALPHA,
3227                a.ONE,
3228                a.ONE_MINUS_SRC_ALPHA
3229              ))
3230            : (a.blendEquationSeparate(a.FUNC_ADD, a.FUNC_ADD),
3231              a.blendFuncSeparate(
3232                a.SRC_ALPHA,
3233                a.ONE_MINUS_SRC_ALPHA,
3234                a.ONE,
3235                a.ONE_MINUS_SRC_ALPHA
3236              )),
3237          (s = b),
3238          (F = j)),
3239        b === A
3240          ? ((g = g || d),
3241            (h = h || e),
3242            (i = i || f),
3243            (d === t && g === C) ||
3244              (a.blendEquationSeparate(c(d), c(g)), (t = d), (C = g)),
3245            (e === u && f === B && h === D && i === E) ||
3246              (a.blendFuncSeparate(c(e), c(f), c(h), c(i)),
3247              (u = e),
3248              (B = f),
3249              (D = h),
3250              (E = i)))
3251          : ((t = null),
3252            (u = null),
3253            (B = null),
3254            (C = null),
3255            (D = null),
3256            (E = null))
3257    }
3258    function ka(a) {
3259      j.setMask(a)
3260    }
3261    function la(a) {
3262      k.setTest(a)
3263    }
3264    function ma(a) {
3265      k.setMask(a)
3266    }
3267    function na(a) {
3268      k.setFunc(a)
3269    }
3270    function oa(a) {
3271      l.setTest(a)
3272    }
3273    function pa(a) {
3274      l.setMask(a)
3275    }
3276    function qa(a, b, c) {
3277      l.setFunc(a, b, c)
3278    }
3279    function ra(a, b, c) {
3280      l.setOp(a, b, c)
3281    }
3282    function sa(b) {
3283      G !== b && (b ? a.frontFace(a.CW) : a.frontFace(a.CCW), (G = b))
3284    }
3285    function ta(b) {
3286      b !== e
3287        ? (ga(a.CULL_FACE),
3288          b !== H &&
3289            (b === f
3290              ? a.cullFace(a.BACK)
3291              : b === g
3292              ? a.cullFace(a.FRONT)
3293              : a.cullFace(a.FRONT_AND_BACK)))
3294        : ha(a.CULL_FACE),
3295        (H = b)
3296    }
3297    function ua(b) {
3298      b !== I && (O && a.lineWidth(b), (I = b))
3299    }
3300    function va(b, c, d) {
3301      b
3302        ? (ga(a.POLYGON_OFFSET_FILL),
3303          (J === c && K === d) || (a.polygonOffset(c, d), (J = c), (K = d)))
3304        : ha(a.POLYGON_OFFSET_FILL)
3305    }
3306    function wa() {
3307      return L
3308    }
3309    function xa(b) {
3310      ;(L = b), b ? ga(a.SCISSOR_TEST) : ha(a.SCISSOR_TEST)
3311    }
3312    function ya(b) {
3313      void 0 === b && (b = a.TEXTURE0 + M - 1),
3314        P !== b && (a.activeTexture(b), (P = b))
3315    }
3316    function za(b, c) {
3317      null === P && ya()
3318      var d = Q[P]
3319      void 0 === d && ((d = { type: void 0, texture: void 0 }), (Q[P] = d)),
3320        (d.type === b && d.texture === c) ||
3321          (a.bindTexture(b, c || aa[b]), (d.type = b), (d.texture = c))
3322    }
3323    function Aa() {
3324      try {
3325        a.compressedTexImage2D.apply(a, arguments)
3326      } catch (a) {
3327        console.error(a)
3328      }
3329    }
3330    function Ba() {
3331      try {
3332        a.texImage2D.apply(a, arguments)
3333      } catch (a) {
3334        console.error(a)
3335      }
3336    }
3337    function Ca(b) {
3338      Z.equals(b) === !1 && (a.scissor(b.x, b.y, b.z, b.w), Z.copy(b))
3339    }
3340    function Da(b) {
3341      $.equals(b) === !1 && (a.viewport(b.x, b.y, b.z, b.w), $.copy(b))
3342    }
3343    function Ea() {
3344      for (var b = 0; b < o.length; b++)
3345        1 === o[b] && (a.disableVertexAttribArray(b), (o[b] = 0))
3346      ;(q = {}),
3347        (r = null),
3348        (P = null),
3349        (Q = {}),
3350        (s = null),
3351        (G = null),
3352        (H = null),
3353        j.reset(),
3354        k.reset(),
3355        l.reset()
3356    }
3357    var j = new d(),
3358      k = new h(),
3359      l = new i(),
3360      m = a.getParameter(a.MAX_VERTEX_ATTRIBS),
3361      n = new Uint8Array(m),
3362      o = new Uint8Array(m),
3363      p = new Uint8Array(m),
3364      q = {},
3365      r = null,
3366      s = null,
3367      t = null,
3368      u = null,
3369      B = null,
3370      C = null,
3371      D = null,
3372      E = null,
3373      F = !1,
3374      G = null,
3375      H = null,
3376      I = null,
3377      J = null,
3378      K = null,
3379      L = null,
3380      M = a.getParameter(a.MAX_TEXTURE_IMAGE_UNITS),
3381      N = parseFloat(/^WebGL\ ([0-9])/.exec(a.getParameter(a.VERSION))[1]),
3382      O = parseFloat(N) >= 1,
3383      P = null,
3384      Q = {},
3385      Z = new xb(),
3386      $ = new xb(),
3387      aa = {}
3388    return (
3389      (aa[a.TEXTURE_2D] = _(a.TEXTURE_2D, a.TEXTURE_2D, 1)),
3390      (aa[a.TEXTURE_CUBE_MAP] = _(
3391        a.TEXTURE_CUBE_MAP,
3392        a.TEXTURE_CUBE_MAP_POSITIVE_X,
3393        6
3394      )),
3395      {
3396        buffers: { color: j, depth: k, stencil: l },
3397        init: ba,
3398        initAttributes: ca,
3399        enableAttribute: da,
3400        enableAttributeAndDivisor: ea,
3401        disableUnusedAttributes: fa,
3402        enable: ga,
3403        disable: ha,
3404        getCompressedTextureFormats: ia,
3405        setBlending: ja,
3406        setColorWrite: ka,
3407        setDepthTest: la,
3408        setDepthWrite: ma,
3409        setDepthFunc: na,
3410        setStencilTest: oa,
3411        setStencilWrite: pa,
3412        setStencilFunc: qa,
3413        setStencilOp: ra,
3414        setFlipSided: sa,
3415        setCullFace: ta,
3416        setLineWidth: ua,
3417        setPolygonOffset: va,
3418        getScissorTest: wa,
3419        setScissorTest: xa,
3420        activeTexture: ya,
3421        bindTexture: za,
3422        compressedTexImage2D: Aa,
3423        texImage2D: Ba,
3424        scissor: Ca,
3425        viewport: Da,
3426        reset: Ea
3427      }
3428    )
3429  }
3430  function Nf(a, b, c) {
3431    function e() {
3432      if (void 0 !== d) return d
3433      var c = b.get('EXT_texture_filter_anisotropic')
3434      return (d =
3435        null !== c ? a.getParameter(c.MAX_TEXTURE_MAX_ANISOTROPY_EXT) : 0)
3436    }
3437    function f(b) {
3438      if ('highp' === b) {
3439        if (
3440          a.getShaderPrecisionFormat(a.VERTEX_SHADER, a.HIGH_FLOAT).precision >
3441            0 &&
3442          a.getShaderPrecisionFormat(a.FRAGMENT_SHADER, a.HIGH_FLOAT)
3443            .precision > 0
3444        )
3445          return 'highp'
3446        b = 'mediump'
3447      }
3448      return 'mediump' === b &&
3449        a.getShaderPrecisionFormat(a.VERTEX_SHADER, a.MEDIUM_FLOAT).precision >
3450          0 &&
3451        a.getShaderPrecisionFormat(a.FRAGMENT_SHADER, a.MEDIUM_FLOAT)
3452          .precision > 0
3453        ? 'mediump'
3454        : 'lowp'
3455    }
3456    var d,
3457      g = void 0 !== c.precision ? c.precision : 'highp',
3458      h = f(g)
3459    h !== g &&
3460      (console.warn(
3461        'THREE.WebGLRenderer:',
3462        g,
3463        'not supported, using',
3464        h,
3465        'instead.'
3466      ),
3467      (g = h))
3468    var i = c.logarithmicDepthBuffer === !0 && !!b.get('EXT_frag_depth'),
3469      j = a.getParameter(a.MAX_TEXTURE_IMAGE_UNITS),
3470      k = a.getParameter(a.MAX_VERTEX_TEXTURE_IMAGE_UNITS),
3471      l = a.getParameter(a.MAX_TEXTURE_SIZE),
3472      m = a.getParameter(a.MAX_CUBE_MAP_TEXTURE_SIZE),
3473      n = a.getParameter(a.MAX_VERTEX_ATTRIBS),
3474      o = a.getParameter(a.MAX_VERTEX_UNIFORM_VECTORS),
3475      p = a.getParameter(a.MAX_VARYING_VECTORS),
3476      q = a.getParameter(a.MAX_FRAGMENT_UNIFORM_VECTORS),
3477      r = k > 0,
3478      s = !!b.get('OES_texture_float'),
3479      t = r && s
3480    return {
3481      getMaxAnisotropy: e,
3482      getMaxPrecision: f,
3483      precision: g,
3484      logarithmicDepthBuffer: i,
3485      maxTextures: j,
3486      maxVertexTextures: k,
3487      maxTextureSize: l,
3488      maxCubemapSize: m,
3489      maxAttributes: n,
3490      maxVertexUniforms: o,
3491      maxVaryings: p,
3492      maxFragmentUniforms: q,
3493      vertexTextures: r,
3494      floatFragmentTextures: s,
3495      floatVertexTextures: t
3496    }
3497  }
3498  function Of(a) {
3499    var b = {}
3500    return {
3501      get: function (c) {
3502        if (void 0 !== b[c]) return b[c]
3503        var d
3504        switch (c) {
3505          case 'WEBGL_depth_texture':
3506            d =
3507              a.getExtension('WEBGL_depth_texture') ||
3508              a.getExtension('MOZ_WEBGL_depth_texture') ||
3509              a.getExtension('WEBKIT_WEBGL_depth_texture')
3510            break
3511          case 'EXT_texture_filter_anisotropic':
3512            d =
3513              a.getExtension('EXT_texture_filter_anisotropic') ||
3514              a.getExtension('MOZ_EXT_texture_filter_anisotropic') ||
3515              a.getExtension('WEBKIT_EXT_texture_filter_anisotropic')
3516            break
3517          case 'WEBGL_compressed_texture_s3tc':
3518            d =
3519              a.getExtension('WEBGL_compressed_texture_s3tc') ||
3520              a.getExtension('MOZ_WEBGL_compressed_texture_s3tc') ||
3521              a.getExtension('WEBKIT_WEBGL_compressed_texture_s3tc')
3522            break
3523          case 'WEBGL_compressed_texture_pvrtc':
3524            d =
3525              a.getExtension('WEBGL_compressed_texture_pvrtc') ||
3526              a.getExtension('WEBKIT_WEBGL_compressed_texture_pvrtc')
3527            break
3528          case 'WEBGL_compressed_texture_etc1':
3529            d = a.getExtension('WEBGL_compressed_texture_etc1')
3530            break
3531          default:
3532            d = a.getExtension(c)
3533        }
3534        return (
3535          null === d &&
3536            console.warn(
3537              'THREE.WebGLRenderer: ' + c + ' extension not supported.'
3538            ),
3539          (b[c] = d),
3540          d
3541        )
3542      }
3543    }
3544  }
3545  function Pf() {
3546    function i() {
3547      h.value !== b && ((h.value = b), (h.needsUpdate = c > 0)),
3548        (a.numPlanes = c),
3549        (a.numIntersection = 0)
3550    }
3551    function j(b, c, d, e) {
3552      var i = null !== b ? b.length : 0,
3553        j = null
3554      if (0 !== i) {
3555        if (((j = h.value), e !== !0 || null === j)) {
3556          var k = d + 4 * i,
3557            l = c.matrixWorldInverse
3558          g.getNormalMatrix(l),
3559            (null === j || j.length < k) && (j = new Float32Array(k))
3560          for (var m = 0, n = d; m !== i; ++m, n += 4)
3561            f.copy(b[m]).applyMatrix4(l, g),
3562              f.normal.toArray(j, n),
3563              (j[n + 3] = f.constant)
3564        }
3565        ;(h.value = j), (h.needsUpdate = !0)
3566      }
3567      return (a.numPlanes = i), j
3568    }
3569    var a = this,
3570      b = null,
3571      c = 0,
3572      d = !1,
3573      e = !1,
3574      f = new Ge(),
3575      g = new Fe(),
3576      h = { value: null, needsUpdate: !1 }
3577    ;(this.uniform = h),
3578      (this.numPlanes = 0),
3579      (this.numIntersection = 0),
3580      (this.init = function (a, e, f) {
3581        var g = 0 !== a.length || e || 0 !== c || d
3582        return (d = e), (b = j(a, f, 0)), (c = a.length), g
3583      }),
3584      (this.beginShadows = function () {
3585        ;(e = !0), j(null)
3586      }),
3587      (this.endShadows = function () {
3588        ;(e = !1), i()
3589      }),
3590      (this.setState = function (a, f, g, k, l, m) {
3591        if (!d || null === a || 0 === a.length || (e && !g)) e ? j(null) : i()
3592        else {
3593          var n = e ? 0 : c,
3594            o = 4 * n,
3595            p = l.clippingState || null
3596          ;(h.value = p), (p = j(a, k, o, m))
3597          for (var q = 0; q !== o; ++q) p[q] = b[q]
3598          ;(l.clippingState = p),
3599            (this.numIntersection = f ? this.numPlanes : 0),
3600            (this.numPlanes += n)
3601        }
3602      })
3603  }
3604  function Qf(a) {
3605    function tb() {
3606      return null === A ? ca : 1
3607    }
3608    function ub() {
3609      eb.init(),
3610        eb.scissor(V.copy(da).multiplyScalar(ca)),
3611        eb.viewport(X.copy(fa).multiplyScalar(ca)),
3612        eb.buffers.color.setClear(Z.r, Z.g, Z.b, $, j)
3613    }
3614    function vb() {
3615      ;(z = null), (U = null), (T = ''), (S = -1), eb.reset()
3616    }
3617    function Ab(a) {
3618      a.preventDefault(), vb(), ub(), fb.clear()
3619    }
3620    function Db(a) {
3621      var b = a.target
3622      b.removeEventListener('dispose', Db), Eb(b)
3623    }
3624    function Eb(a) {
3625      Fb(a), fb.delete(a)
3626    }
3627    function Fb(a) {
3628      var b = fb.get(a).program
3629      ;(a.program = void 0), void 0 !== b && lb.releaseProgram(b)
3630    }
3631    function Gb(a, b, c, d) {
3632      var e
3633      if (
3634        c &&
3635        c.isInstancedBufferGeometry &&
3636        ((e = cb.get('ANGLE_instanced_arrays')), null === e)
3637      )
3638        return void console.error(
3639          'THREE.WebGLRenderer.setupVertexAttributes: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_
3639instanced_arrays.'
3640        )
3641      void 0 === d && (d = 0), eb.initAttributes()
3642      var f = c.attributes,
3643        g = b.getAttributes(),
3644        h = a.defaultAttributeValues
3645      for (var i in g) {
3646        var j = g[i]
3647        if (j >= 0) {
3648          var k = f[i]
3649          if (void 0 !== k) {
3650            var l = k.normalized,
3651              m = k.itemSize,
3652              n = kb.getAttributeProperties(k),
3653              o = n.__webglBuffer,
3654              p = n.type,
3655              q = n.bytesPerElement
3656            if (k.isInterleavedBufferAttribute) {
3657              var r = k.data,
3658                s = r.stride,
3659                t = k.offset
3660              r && r.isInstancedInterleavedBuffer
3661                ? (eb.enableAttributeAndDivisor(j, r.meshPerAttribute, e),
3662                  void 0 === c.maxInstancedCount &&
3663                    (c.maxInstancedCount = r.meshPerAttribute * r.count))
3664                : eb.enableAttribute(j),
3665                ab.bindBuffer(ab.ARRAY_BUFFER, o),
3666                ab.vertexAttribPointer(j, m, p, l, s * q, (d * s + t) * q)
3667            } else
3668              k.isInstancedBufferAttribute
3669                ? (eb.enableAttributeAndDivisor(j, k.meshPerAttribute, e),
3670                  void 0 === c.maxInstancedCount &&
3671                    (c.maxInstancedCount = k.meshPerAttribute * k.count))
3672                : eb.enableAttribute(j),
3673                ab.bindBuffer(ab.ARRAY_BUFFER, o),
3674                ab.vertexAttribPointer(j, m, p, l, 0, d * m * q)
3675          } else if (void 0 !== h) {
3676            var u = h[i]
3677            if (void 0 !== u)
3678              switch (u.length) {
3679                case 2:
3680                  ab.vertexAttrib2fv(j, u)
3681                  break
3682                case 3:
3683                  ab.vertexAttrib3fv(j, u)
3684                  break
3685                case 4:
3686                  ab.vertexAttrib4fv(j, u)
3687                  break
3688                default:
3689                  ab.vertexAttrib1fv(j, u)
3690              }
3691          }
3692        }
3693      }
3694      eb.disableUnusedAttributes()
3695    }
3696    function Hb(a, b) {
3697      return Math.abs(b[0]) - Math.abs(a[0])
3698    }
3699    function Ib(a, b) {
3700      return a.object.renderOrder !== b.object.renderOrder
3701        ? a.object.renderOrder - b.object.renderOrder
3702        : a.material.program &&
3703          b.material.program &&
3704          a.material.program !== b.material.program
3705        ? a.material.program.id - b.material.program.id
3706        : a.material.id !== b.material.id
3707        ? a.material.id - b.material.id
3708        : a.z !== b.z
3709        ? a.z - b.z
3710        : a.id - b.id
3711    }
3712    function Jb(a, b) {
3713      return a.object.renderOrder !== b.object.renderOrder
3714        ? a.object.renderOrder - b.object.renderOrder
3715        : a.z !== b.z
3716        ? b.z - a.z
3717        : a.id - b.id
3718    }
3719    function Kb(a, b, c, d, e) {
3720      var f, g
3721      c.transparent ? ((f = r), (g = ++t)) : ((f = m), (g = ++n))
3722      var h = f[g]
3723      void 0 !== h
3724        ? ((h.id = a.id),
3725          (h.object = a),
3726          (h.geometry = b),
3727          (h.material = c),
3728          (h.z = ma.z),
3729          (h.group = e))
3730        : ((h = {
3731            id: a.id,
3732            object: a,
3733            geometry: b,
3734            material: c,
3735            z: ma.z,
3736            group: e
3737          }),
3738          f.push(h))
3739    }
3740    function Lb(a) {
3741      var b = a.geometry
3742      return (
3743        null === b.boundingSphere && b.computeBoundingSphere(),
3744        ka.copy(b.boundingSphere).applyMatrix4(a.matrixWorld),
3745        Nb(ka)
3746      )
3747    }
3748    function Mb(a) {
3749      return (
3750        ka.center.set(0, 0, 0),
3751        (ka.radius = 0.7071067811865476),
3752        ka.applyMatrix4(a.matrixWorld),
3753        Nb(ka)
3754      )
3755    }
3756    function Nb(a) {
3757      if (!ga.intersectsSphere(a)) return !1
3758      var b = ha.numPlanes
3759      if (0 === b) return !0
3760      var c = y.clippingPlanes,
3761        d = a.center,
3762        e = -a.radius,
3763        f = 0
3764      do if (c[f].distanceToPoint(d) < e) return !1
3765      while (++f !== b)
3766      return !0
3767    }
3768    function Ob(a, b) {
3769      if (a.visible !== !1) {
3770        var c = 0 !== (a.layers.mask & b.layers.mask)
3771        if (c)
3772          if (a.isLight) l.push(a)
3773          else if (a.isSprite)
3774            (a.frustumCulled !== !1 && Mb(a) !== !0) || w.push(a)
3775          else if (a.isLensFlare) x.push(a)
3776          else if (a.isImmediateRenderObject)
3777            y.sortObjects === !0 &&
3778              (ma.setFromMatrixPosition(a.matrixWorld), ma.applyMatrix4(la)),
3779              Kb(a, null, a.material, ma.z, null)
3780          else if (
3781            (a.isMesh || a.isLine || a.isPoints) &&
3782            (a.isSkinnedMesh && a.skeleton.update(),
3783            a.frustumCulled === !1 || Lb(a) === !0)
3784          ) {
3785            var d = a.material
3786            if (d.visible === !0) {
3787              y.sortObjects === !0 &&
3788                (ma.setFromMatrixPosition(a.matrixWorld), ma.applyMatrix4(la))
3789              var e = kb.update(a)
3790              if (d.isMultiMaterial)
3791                for (
3792                  var f = e.groups, g = d.materials, h = 0, i = f.length;
3793                  h < i;
3794                  h++
3795                ) {
3796                  var j = f[h],
3797                    k = g[j.materialIndex]
3798                  k.visible === !0 && Kb(a, e, k, ma.z, j)
3799                }
3800              else Kb(a, e, d, ma.z, null)
3801            }
3802          }
3803        for (var m = a.children, h = 0, i = m.length; h < i; h++) Ob(m[h], b)
3804      }
3805    }
3806    function Pb(a, b, c, d) {
3807      for (var e = 0, f = a.length; e < f; e++) {
3808        var g = a[e],
3809          h = g.object,
3810          i = g.geometry,
3811          j = void 0 === d ? g.material : d,
3812          k = g.group
3813        if (
3814          (h.modelViewMatrix.multiplyMatrices(
3815            c.matrixWorldInverse,
3816            h.matrixWorld
3817          ),
3818          h.normalMatrix.getNormalMatrix(h.modelViewMatrix),
3819          h.onBeforeRender(y, b, c, i, j, k),
3820          h.isImmediateRenderObject)
3821        ) {
3822          Rb(j)
3823          var l = Sb(c, b.fog, j, h)
3824          ;(T = ''),
3825            h.render(function (a) {
3826              y.renderBufferImmediate(a, l, j)
3827            })
3828        } else y.renderBufferDirect(c, b.fog, i, j, h, k)
3829        h.onAfterRender(y, b, c, i, j, k)
3830      }
3831    }
3832    function Qb(a, b, c) {
3833      var d = fb.get(a),
3834        e = lb.getParameters(a, $a, b, ha.numPlanes, ha.numIntersection, c),
3835        f = lb.getProgramCode(a, e),
3836        g = d.program,
3837        h = !0
3838      if (void 0 === g) a.addEventListener('dispose', Db)
3839      else if (g.code !== f) Fb(a)
3840      else {
3841        if (void 0 !== e.shaderID) return
3842        h = !1
3843      }
3844      if (h) {
3845        if (e.shaderID) {
3846          var i = ve[e.shaderID]
3847          d.__webglShader = {
3848            name: a.type,
3849            uniforms: pc.clone(i.uniforms),
3850            vertexShader: i.vertexShader,
3851            fragmentShader: i.fragmentShader
3852          }
3853        } else
3854          d.__webglShader = {
3855            name: a.type,
3856            uniforms: a.uniforms,
3857            vertexShader: a.vertexShader,
3858            fragmentShader: a.fragmentShader
3859          }
3860        ;(a.__webglShader = d.__webglShader),
3861          (g = lb.acquireProgram(a, e, f)),
3862          (d.program = g),
3863          (a.program = g)
3864      }
3865      var j = g.getAttributes()
3866      if (a.morphTargets) {
3867        a.numSupportedMorphTargets = 0
3868        for (var k = 0; k < y.maxMorphTargets; k++)
3869          j['morphTarget' + k] >= 0 && a.numSupportedMorphTargets++
3870      }
3871      if (a.morphNormals) {
3872        a.numSupportedMorphNormals = 0
3873        for (var k = 0; k < y.maxMorphNormals; k++)
3874          j['morphNormal' + k] >= 0 && a.numSupportedMorphNormals++
3875      }
3876      var l = d.__webglShader.uniforms
3877      ;((a.isShaderMaterial || a.isRawShaderMaterial) && a.clipping !== !0) ||
3878        ((d.numClippingPlanes = ha.numPlanes),
3879        (d.numIntersection = ha.numIntersection),
3880        (l.clippingPlanes = ha.uniform)),
3881        (d.fog = b),
3882        (d.lightsHash = $a.hash),
3883        a.lights &&
3884          ((l.ambientLightColor.value = $a.ambient),
3885          (l.directionalLights.value = $a.directional),
3886          (l.spotLights.value = $a.spot),
3887          (l.rectAreaLights.value = $a.rectArea),
3888          (l.pointLights.value = $a.point),
3889          (l.hemisphereLights.value = $a.hemi),
3890          (l.directionalShadowMap.value = $a.directionalShadowMap),
3891          (l.directionalShadowMatrix.value = $a.directionalShadowMatrix),
3892          (l.spotShadowMap.value = $a.spotShadowMap),
3893          (l.spotShadowMatrix.value = $a.spotShadowMatrix),
3894          (l.pointShadowMap.value = $a.pointShadowMap),
3895          (l.pointShadowMatrix.value = $a.pointShadowMatrix))
3896      var m = d.program.getUniforms(),
3897        n = oc.seqWithValue(m.seq, l)
3898      d.uniformsList = n
3899    }
3900    function Rb(a) {
3901      a.side === p ? eb.disable(ab.CULL_FACE) : eb.enable(ab.CULL_FACE),
3902        eb.setFlipSided(a.side === o),
3903        a.transparent === !0
3904          ? eb.setBlending(
3905              a.blending,
3906              a.blendEquation,
3907              a.blendSrc,
3908              a.blendDst,
3909              a.blendEquationAlpha,
3910              a.blendSrcAlpha,
3911              a.blendDstAlpha,
3912              a.premultipliedAlpha
3913            )
3914          : eb.setBlending(v),
3915        eb.setDepthFunc(a.depthFunc),
3916        eb.setDepthTest(a.depthTest),
3917        eb.setDepthWrite(a.depthWrite),
3918        eb.setColorWrite(a.colorWrite),
3919        eb.setPolygonOffset(
3920          a.polygonOffset,
3921          a.polygonOffsetFactor,
3922          a.polygonOffsetUnits
3923        )
3924    }
3925    function Sb(a, b, c, d) {
3926      Y = 0
3927      var e = fb.get(c)
3928      if (ia && (ja || a !== U)) {
3929        var f = a === U && c.id === S
3930        ha.setState(
3931          c.clippingPlanes,
3932          c.clipIntersection,
3933          c.clipShadows,
3934          a,
3935          e,
3936          f
3937        )
3938      }
3939      c.needsUpdate === !1 &&
3940        (void 0 === e.program
3941          ? (c.needsUpdate = !0)
3942          : c.fog && e.fog !== b
3943          ? (c.needsUpdate = !0)
3944          : c.lights && e.lightsHash !== $a.hash
3945          ? (c.needsUpdate = !0)
3946          : void 0 === e.numClippingPlanes ||
3947            (e.numClippingPlanes === ha.numPlanes &&
3948              e.numIntersection === ha.numIntersection) ||
3949            (c.needsUpdate = !0)),
3950        c.needsUpdate && (Qb(c, b, d), (c.needsUpdate = !1))
3951      var g = !1,
3952        h = !1,
3953        i = !1,
3954        j = e.program,
3955        k = j.getUniforms(),
3956        l = e.__webglShader.uniforms
3957      if (
3958        (j.id !== z &&
3959          (ab.useProgram(j.program), (z = j.id), (g = !0), (h = !0), (i = !0)),
3960        c.id !== S && ((S = c.id), (h = !0)),
3961        g || a !== U)
3962      ) {
3963        if (
3964          (k.set(ab, a, 'projectionMatrix'),
3965          db.logarithmicDepthBuffer &&
3966            k.setValue(
3967              ab,
3968              'logDepthBufFC',
3969              2 / (Math.log(a.far + 1) / Math.LN2)
3970            ),
3971          a !== U && ((U = a), (h = !0), (i = !0)),
3972          c.isShaderMaterial ||
3973            c.isMeshPhongMaterial ||
3974            c.isMeshStandardMaterial ||
3975            c.envMap)
3976        ) {
3977          var m = k.map.cameraPosition
3978          void 0 !== m &&
3979            m.setValue(ab, ma.setFromMatrixPosition(a.matrixWorld))
3980        }
3981        ;(c.isMeshPhongMaterial ||
3982          c.isMeshLambertMaterial ||
3983          c.isMeshBasicMaterial ||
3984          c.isMeshStandardMaterial ||
3985          c.isShaderMaterial ||
3986          c.skinning) &&
3987          k.setValue(ab, 'viewMatrix', a.matrixWorldInverse),
3988          k.set(ab, y, 'toneMappingExposure'),
3989          k.set(ab, y, 'toneMappingWhitePoint')
3990      }
3991      if (c.skinning) {
3992        k.setOptional(ab, d, 'bindMatrix'),
3993          k.setOptional(ab, d, 'bindMatrixInverse')
3994        var n = d.skeleton
3995        n &&
3996          (db.floatVertexTextures && n.useVertexTexture
3997            ? (k.set(ab, n, 'boneTexture'),
3998              k.set(ab, n, 'boneTextureWidth'),
3999              k.set(ab, n, 'boneTextureHeight'))
4000            : k.setOptional(ab, n, 'boneMatrices'))
4001      }
4002      return (
4003        h &&
4004          (c.lights && cc(l, i),
4005          b && c.fog && Xb(l, b),
4006          (c.isMeshBasicMaterial ||
4007            c.isMeshLambertMaterial ||
4008            c.isMeshPhongMaterial ||
4009            c.isMeshStandardMaterial ||
4010            c.isMeshNormalMaterial ||
4011            c.isMeshDepthMaterial) &&
4012            Tb(l, c),
4013          c.isLineBasicMaterial
4014            ? Ub(l, c)
4015            : c.isLineDashedMaterial
4016            ? (Ub(l, c), Vb(l, c))
4017            : c.isPointsMaterial
4018            ? Wb(l, c)
4019            : c.isMeshLambertMaterial
4020            ? Yb(l, c)
4021            : c.isMeshToonMaterial
4022            ? $b(l, c)
4023            : c.isMeshPhongMaterial
4024            ? Zb(l, c)
4025            : c.isMeshPhysicalMaterial
4026            ? ac(l, c)
4027            : c.isMeshStandardMaterial
4028            ? _b(l, c)
4029            : c.isMeshDepthMaterial
4030            ? c.displacementMap &&
4031              ((l.displacementMap.value = c.displacementMap),
4032              (l.displacementScale.value = c.displacementScale),
4033              (l.displacementBias.value = c.displacementBias))
4034            : c.isMeshNormalMaterial && bc(l, c),
4035          void 0 !== l.ltcMat &&
4036            (l.ltcMat.value = THREE.UniformsLib.LTC_MAT_TEXTURE),
4037          void 0 !== l.ltcMag &&
4038            (l.ltcMag.value = THREE.UniformsLib.LTC_MAG_TEXTURE),
4039          oc.upload(ab, e.uniformsList, l, y)),
4040        k.set(ab, d, 'modelViewMatrix'),
4041        k.set(ab, d, 'normalMatrix'),
4042        k.setValue(ab, 'modelMatrix', d.matrixWorld),
4043        j
4044      )
4045    }
4046    function Tb(a, b) {
4047      ;(a.opacity.value = b.opacity),
4048        (a.diffuse.value = b.color),
4049        b.emissive &&
4050          a.emissive.value.copy(b.emissive).multiplyScalar(b.emissiveIntensity),
4051        (a.map.value = b.map),
4052        (a.specularMap.value = b.specularMap),
4053        (a.alphaMap.value = b.alphaMap),
4054        b.lightMap &&
4055          ((a.lightMap.value = b.lightMap),
4056          (a.lightMapIntensity.value = b.lightMapIntensity)),
4057        b.aoMap &&
4058          ((a.aoMap.value = b.aoMap),
4059          (a.aoMapIntensity.value = b.aoMapIntensity))
4060      var c
4061      if (
4062        (b.map
4063          ? (c = b.map)
4064          : b.specularMap
4065          ? (c = b.specularMap)
4066          : b.displacementMap
4067          ? (c = b.displacementMap)
4068          : b.normalMap
4069          ? (c = b.normalMap)
4070          : b.bumpMap
4071          ? (c = b.bumpMap)
4072          : b.roughnessMap
4073          ? (c = b.roughnessMap)
4074          : b.metalnessMap
4075          ? (c = b.metalnessMap)
4076          : b.alphaMap
4077          ? (c = b.alphaMap)
4078          : b.emissiveMap && (c = b.emissiveMap),
4079        void 0 !== c)
4080      ) {
4081        c.isWebGLRenderTarget && (c = c.texture)
4082        var d = c.offset,
4083          e = c.repeat
4084        a.offsetRepeat.value.set(d.x, d.y, e.x, e.y)
4085      }
4086      ;(a.envMap.value = b.envMap),
4087        (a.flipEnvMap.value = b.envMap && b.envMap.isCubeTexture ? -1 : 1),
4088        (a.reflectivity.value = b.reflectivity),
4089        (a.refractionRatio.value = b.refractionRatio)
4090    }
4091    function Ub(a, b) {
4092      ;(a.diffuse.value = b.color), (a.opacity.value = b.opacity)
4093    }
4094    function Vb(a, b) {
4095      ;(a.dashSize.value = b.dashSize),
4096        (a.totalSize.value = b.dashSize + b.gapSize),
4097        (a.scale.value = b.scale)
4098    }
4099    function Wb(a, b) {
4100      if (
4101        ((a.diffuse.value = b.color),
4102        (a.opacity.value = b.opacity),
4103        (a.size.value = b.size * ca),
4104        (a.scale.value = 0.5 * aa),
4105        (a.map.value = b.map),
4106        null !== b.map)
4107      ) {
4108        var c = b.map.offset,
4109          d = b.map.repeat
4110        a.offsetRepeat.value.set(c.x, c.y, d.x, d.y)
4111      }
4112    }
4113    function Xb(a, b) {
4114      ;(a.fogColor.value = b.color),
4115        b.isFog
4116          ? ((a.fogNear.value = b.near), (a.fogFar.value = b.far))
4117          : b.isFogExp2 && (a.fogDensity.value = b.density)
4118    }
4119    function Yb(a, b) {
4120      b.emissiveMap && (a.emissiveMap.value = b.emissiveMap)
4121    }
4122    function Zb(a, b) {
4123      ;(a.specular.value = b.specular),
4124        (a.shininess.value = Math.max(b.shininess, 1e-4)),
4125        b.emissiveMap && (a.emissiveMap.value = b.emissiveMap),
4126        b.bumpMap &&
4127          ((a.bumpMap.value = b.bumpMap), (a.bumpScale.value = b.bumpScale)),
4128        b.normalMap &&
4129          ((a.normalMap.value = b.normalMap),
4130          a.normalScale.value.copy(b.normalScale)),
4131        b.displacementMap &&
4132          ((a.displacementMap.value = b.displacementMap),
4133          (a.displacementScale.value = b.displacementScale),
4134          (a.displacementBias.value = b.displacementBias))
4135    }
4136    function $b(a, b) {
4137      Zb(a, b), b.gradientMap && (a.gradientMap.value = b.gradientMap)
4138    }
4139    function _b(a, b) {
4140      ;(a.roughness.value = b.roughness),
4141        (a.metalness.value = b.metalness),
4142        b.roughnessMap && (a.roughnessMap.value = b.roughnessMap),
4143        b.metalnessMap && (a.metalnessMap.value = b.metalnessMap),
4144        b.emissiveMap && (a.emissiveMap.value = b.emissiveMap),
4145        b.bumpMap &&
4146          ((a.bumpMap.value = b.bumpMap), (a.bumpScale.value = b.bumpScale)),
4147        b.normalMap &&
4148          ((a.normalMap.value = b.normalMap),
4149          a.normalScale.value.copy(b.normalScale)),
4150        b.displacementMap &&
4151          ((a.displacementMap.value = b.displacementMap),
4152          (a.displacementScale.value = b.displacementScale),
4153          (a.displacementBias.value = b.displacementBias)),
4154        b.envMap && (a.envMapIntensity.value = b.envMapIntensity)
4155    }
4156    function ac(a, b) {
4157      ;(a.clearCoat.value = b.clearCoat),
4158        (a.clearCoatRoughness.value = b.clearCoatRoughness),
4159        _b(a, b)
4160    }
4161    function bc(a, b) {
4162      b.bumpMap &&
4163        ((a.bumpMap.value = b.bumpMap), (a.bumpScale.value = b.bumpScale)),
4164        b.normalMap &&
4165          ((a.normalMap.value = b.normalMap),
4166          a.normalScale.value.copy(b.normalScale)),
4167        b.displacementMap &&
4168          ((a.displacementMap.value = b.displacementMap),
4169          (a.displacementScale.value = b.displacementScale),
4170          (a.displacementBias.value = b.displacementBias))
4171    }
4172    function cc(a, b) {
4173      ;(a.ambientLightColor.needsUpdate = b),
4174        (a.directionalLights.needsUpdate = b),
4175        (a.pointLights.needsUpdate = b),
4176        (a.spotLights.needsUpdate = b),
4177        (a.rectAreaLights.needsUpdate = b),
4178        (a.hemisphereLights.needsUpdate = b)
4179    }
4180    function dc(a) {
4181      for (var b = 0, c = 0, d = a.length; c < d; c++) {
4182        var e = a[c]
4183        e.castShadow && ($a.shadows[b++] = e)
4184      }
4185      $a.shadows.length = b
4186    }
4187    function ec(a, b) {
4188      var c,
4189        d,
4190        e,
4191        i,
4192        j,
4193        k,
4194        l,
4195        f = 0,
4196        g = 0,
4197        h = 0,
4198        m = b.matrixWorldInverse,
4199        n = 0,
4200        o = 0,
4201        p = 0,
4202        q = 0,
4203        r = 0
4204      for (c = 0, d = a.length; c < d; c++)
4205        if (
4206          ((e = a[c]),
4207          (i = e.color),
4208          (j = e.intensity),
4209          (k = e.distance),
4210          (l = e.shadow && e.shadow.map ? e.shadow.map.texture : null),
4211          e.isAmbientLight)
4212        )
4213          (f += i.r * j), (g += i.g * j), (h += i.b * j)
4214        else if (e.isDirectionalLight) {
4215          var s = mb.get(e)
4216          s.color.copy(e.color).multiplyScalar(e.intensity),
4217            s.direction.setFromMatrixPosition(e.matrixWorld),
4218            ma.setFromMatrixPosition(e.target.matrixWorld),
4219            s.direction.sub(ma),
4220            s.direction.transformDirection(m),
4221            (s.shadow = e.castShadow),
4222            e.castShadow &&
4223              ((s.shadowBias = e.shadow.bias),
4224              (s.shadowRadius = e.shadow.radius),
4225              (s.shadowMapSize = e.shadow.mapSize)),
4226            ($a.directionalShadowMap[n] = l),
4227            ($a.directionalShadowMatrix[n] = e.shadow.matrix),
4228            ($a.directional[n++] = s)
4229        } else if (e.isSpotLight) {
4230          var s = mb.get(e)
4231          s.position.setFromMatrixPosition(e.matrixWorld),
4232            s.position.applyMatrix4(m),
4233            s.color.copy(i).multiplyScalar(j),
4234            (s.distance = k),
4235            s.direction.setFromMatrixPosition(e.matrixWorld),
4236            ma.setFromMatrixPosition(e.target.matrixWorld),
4237            s.direction.sub(ma),
4238            s.direction.transformDirection(m),
4239            (s.coneCos = Math.cos(e.angle)),
4240            (s.penumbraCos = Math.cos(e.angle * (1 - e.penumbra))),
4241            (s.decay = 0 === e.distance ? 0 : e.decay),
4242            (s.shadow = e.castShadow),
4243            e.castShadow &&
4244              ((s.shadowBias = e.shadow.bias),
4245              (s.shadowRadius = e.shadow.radius),
4246              (s.shadowMapSize = e.shadow.mapSize)),
4247            ($a.spotShadowMap[p] = l),
4248            ($a.spotShadowMatrix[p] = e.shadow.matrix),
4249            ($a.spot[p++] = s)
4250        } else if (e.isRectAreaLight) {
4251          var s = mb.get(e)
4252          s.color.copy(i).multiplyScalar(j / (e.width * e.height)),
4253            s.position.setFromMatrixPosition(e.matrixWorld),
4254            s.position.applyMatrix4(m),
4255            Za.identity(),
4256            Na.copy(e.matrixWorld),
4257            Na.premultiply(m),
4258            Za.extractRotation(Na),
4259            s.halfWidth.set(0.5 * e.width, 0, 0),
4260            s.halfHeight.set(0, 0.5 * e.height, 0),
4261            s.halfWidth.applyMatrix4(Za),
4262            s.halfHeight.applyMatrix4(Za),
4263            ($a.rectArea[q++] = s)
4264        } else if (e.isPointLight) {
4265          var s = mb.get(e)
4266          s.position.setFromMatrixPosition(e.matrixWorld),
4267            s.position.applyMatrix4(m),
4268            s.color.copy(e.color).multiplyScalar(e.intensity),
4269            (s.distance = e.distance),
4270            (s.decay = 0 === e.distance ? 0 : e.decay),
4271            (s.shadow = e.castShadow),
4272            e.castShadow &&
4273              ((s.shadowBias = e.shadow.bias),
4274              (s.shadowRadius = e.shadow.radius),
4275              (s.shadowMapSize = e.shadow.mapSize)),
4276            ($a.pointShadowMap[o] = l),
4277            void 0 === $a.pointShadowMatrix[o] &&
4278              ($a.pointShadowMatrix[o] = new Cb()),
4279            ma.setFromMatrixPosition(e.matrixWorld).negate(),
4280            $a.pointShadowMatrix[o].identity().setPosition(ma),
4281            ($a.point[o++] = s)
4282        } else if (e.isHemisphereLight) {
4283          var s = mb.get(e)
4284          s.direction.setFromMatrixPosition(e.matrixWorld),
4285            s.direction.transformDirection(m),
4286            s.direction.normalize(),
4287            s.skyColor.copy(e.color).multiplyScalar(j),
4288            s.groundColor.copy(e.groundColor).multiplyScalar(j),
4289            ($a.hemi[r++] = s)
4290        }
4291      ;($a.ambient[0] = f),
4292        ($a.ambient[1] = g),
4293        ($a.ambient[2] = h),
4294        ($a.directional.length = n),
4295        ($a.spot.length = p),
4296        ($a.rectArea.length = q),
4297        ($a.point.length = o),
4298        ($a.hemi.length = r),
4299        ($a.hash =
4300          n + ',' + o + ',' + p + ',' + q + ',' + r + ',' + $a.shadows.length)
4301    }
4302    function fc() {
4303      var a = Y
4304      return (
4305        a >= db.maxTextures &&
4306          console.warn(
4307            'WebGLRenderer: trying to use ' +
4308              a +
4309              ' texture units while this GPU supports only ' +
4310              db.maxTextures
4311          ),
4312        (Y += 1),
4313        a
4314      )
4315    }
4316    function gc(a) {
4317      var b
4318      if (a === na) return ab.REPEAT
4319      if (a === oa) return ab.CLAMP_TO_EDGE
4320      if (a === pa) return ab.MIRRORED_REPEAT
4321      if (a === qa) return ab.NEAREST
4322      if (a === ra) return ab.NEAREST_MIPMAP_NEAREST
4323      if (a === sa) return ab.NEAREST_MIPMAP_LINEAR
4324      if (a === ta) return ab.LINEAR
4325      if (a === ua) return ab.LINEAR_MIPMAP_NEAREST
4326      if (a === va) return ab.LINEAR_MIPMAP_LINEAR
4327      if (a === wa) return ab.UNSIGNED_BYTE
4328      if (a === Ea) return ab.UNSIGNED_SHORT_4_4_4_4
4329      if (a === Fa) return ab.UNSIGNED_SHORT_5_5_5_1
4330      if (a === Ga) return ab.UNSIGNED_SHORT_5_6_5
4331      if (a === xa) return ab.BYTE
4332      if (a === ya) return ab.SHORT
4333      if (a === za) return ab.UNSIGNED_SHORT
4334      if (a === Aa) return ab.INT
4335      if (a === Ba) return ab.UNSIGNED_INT
4336      if (a === Ca) return ab.FLOAT
4337      if (a === Da && ((b = cb.get('OES_texture_half_float')), null !== b))
4338        return b.HALF_FLOAT_OES
4339      if (a === Ia) return ab.ALPHA
4340      if (a === Ja) return ab.RGB
4341      if (a === Ka) return ab.RGBA
4342      if (a === La) return ab.LUMINANCE
4343      if (a === Ma) return ab.LUMINANCE_ALPHA
4344      if (a === Oa) return ab.DEPTH_COMPONENT
4345      if (a === Pa) return ab.DEPTH_STENCIL
4346      if (a === B) return ab.FUNC_ADD
4347      if (a === C) return ab.FUNC_SUBTRACT
4348      if (a === D) return ab.FUNC_REVERSE_SUBTRACT
4349      if (a === G) return ab.ZERO
4350      if (a === H) return ab.ONE
4351      if (a === I) return ab.SRC_COLOR
4352      if (a === J) return ab.ONE_MINUS_SRC_COLOR
4353      if (a === K) return ab.SRC_ALPHA
4354      if (a === L) return ab.ONE_MINUS_SRC_ALPHA
4355      if (a === M) return ab.DST_ALPHA
4356      if (a === N) return ab.ONE_MINUS_DST_ALPHA
4357      if (a === O) return ab.DST_COLOR
4358      if (a === P) return ab.ONE_MINUS_DST_COLOR
4359      if (a === Q) return ab.SRC_ALPHA_SATURATE
4360      if (
4361        (a === Qa || a === Ra || a === Sa || a === Ta) &&
4362        ((b = cb.get('WEBGL_compressed_texture_s3tc')), null !== b)
4363      ) {
4364        if (a === Qa) return b.COMPRESSED_RGB_S3TC_DXT1_EXT
4365        if (a === Ra) return b.COMPRESSED_RGBA_S3TC_DXT1_EXT
4366        if (a === Sa) return b.COMPRESSED_RGBA_S3TC_DXT3_EXT
4367        if (a === Ta) return b.COMPRESSED_RGBA_S3TC_DXT5_EXT
4368      }
4369      if (
4370        (a === Ua || a === Va || a === Wa || a === Xa) &&
4371        ((b = cb.get('WEBGL_compressed_texture_pvrtc')), null !== b)
4372      ) {
4373        if (a === Ua) return b.COMPRESSED_RGB_PVRTC_4BPPV1_IMG
4374        if (a === Va) return b.COMPRESSED_RGB_PVRTC_2BPPV1_IMG
4375        if (a === Wa) return b.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG
4376        if (a === Xa) return b.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG
4377      }
4378      if (
4379        a === Ya &&
4380        ((b = cb.get('WEBGL_compressed_texture_etc1')), null !== b)
4381      )
4382        return b.COMPRESSED_RGB_ETC1_WEBGL
4383      if (
4384        (a === E || a === F) &&
4385        ((b = cb.get('EXT_blend_minmax')), null !== b)
4386      ) {
4387        if (a === E) return b.MIN_EXT
4388        if (a === F) return b.MAX_EXT
4389      }
4390      return a === Ha && ((b = cb.get('WEBGL_depth_texture')), null !== b)
4391        ? b.UNSIGNED_INT_24_8_WEBGL
4392        : 0
4393    }
4394    console.log('THREE.WebGLRenderer', c), (a = a || {})
4395    var b =
4396        void 0 !== a.canvas
4397          ? a.canvas
4398          : document.createElementNS('http://www.w3.org/1999/xhtml', 'canvas'),
4399      d = void 0 !== a.context ? a.context : null,
4400      e = void 0 !== a.alpha && a.alpha,
4401      f = void 0 === a.depth || a.depth,
4402      g = void 0 === a.stencil || a.stencil,
4403      h = void 0 !== a.antialias && a.antialias,
4404      j = void 0 === a.premultipliedAlpha || a.premultipliedAlpha,
4405      k = void 0 !== a.preserveDrawingBuffer && a.preserveDrawingBuffer,
4406      l = [],
4407      m = [],
4408      n = -1,
4409      r = [],
4410      t = -1,
4411      u = new Float32Array(8),
4412      w = [],
4413      x = []
4414    ;(this.domElement = b),
4415      (this.context = null),
4416      (this.autoClear = !0),
4417      (this.autoClearColor = !0),
4418      (this.autoClearDepth = !0),
4419      (this.autoClearStencil = !0),
4420      (this.sortObjects = !0),
4421      (this.clippingPlanes = []),
4422      (this.localClippingEnabled = !1),
4423      (this.gammaFactor = 2),
4424      (this.gammaInput = !1),
4425      (this.gammaOutput = !1),
4426      (this.physicallyCorrectLights = !1),
4427      (this.toneMapping = ba),
4428      (this.toneMappingExposure = 1),
4429      (this.toneMappingWhitePoint = 1),
4430      (this.maxMorphTargets = 8),
4431      (this.maxMorphNormals = 4)
4432    var y = this,
4433      z = null,
4434      A = null,
4435      R = null,
4436      S = -1,
4437      T = '',
4438      U = null,
4439      V = new xb(),
4440      W = null,
4441      X = new xb(),
4442      Y = 0,
4443      Z = new re(0),
4444      $ = 0,
4445      _ = b.width,
4446      aa = b.height,
4447      ca = 1,
4448      da = new xb(0, 0, _, aa),
4449      ea = !1,
4450      fa = new xb(0, 0, _, aa),
4451      ga = new He(),
4452      ha = new Pf(),
4453      ia = !1,
4454      ja = !1,
4455      ka = new Ee(),
4456      la = new Cb(),
4457      ma = new Bb(),
4458      Na = new Cb(),
4459      Za = new Cb(),
4460      $a = {
4461        hash: '',
4462        ambient: [0, 0, 0],
4463        directional: [],
4464        directionalShadowMap: [],
4465        directionalShadowMatrix: [],
4466        spot: [],
4467        spotShadowMap: [],
4468        spotShadowMatrix: [],
4469        rectArea: [],
4470        point: [],
4471        pointShadowMap: [],
4472        pointShadowMatrix: [],
4473        hemi: [],
4474        shadows: []
4475      },
4476      _a = { calls: 0, vertices: 0, faces: 0, points: 0 }
4477    this.info = {
4478      render: _a,
4479      memory: { geometries: 0, textures: 0 },
4480      programs: null
4481    }
4482    var ab
4483    try {
4484      var bb = {
4485        alpha: e,
4486        depth: f,
4487        stencil: g,
4488        antialias: h,
4489        premultipliedAlpha: j,
4490        preserveDrawingBuffer: k
4491      }
4492      if (
4493        ((ab =
4494          d ||
4495          b.getContext('webgl', bb) ||
4496          b.getContext('experimental-webgl', bb)),
4497        null === ab)
4498      )
4499        throw null !== b.getContext('webgl')
4500          ? 'Error creating WebGL context with your selected attributes.'
4501          : 'Error creating WebGL context.'
4502      void 0 === ab.getShaderPrecisionFormat &&
4503        (ab.getShaderPrecisionFormat = function () {
4504          return { rangeMin: 1, rangeMax: 1, precision: 1 }
4505        }),
4506        b.addEventListener('webglcontextlost', Ab, !1)
4507    } catch (a) {
4508      console.error('THREE.WebGLRenderer: ' + a)
4509    }
4510    var cb = new Of(ab)
4511    cb.get('WEBGL_depth_texture'),
4512      cb.get('OES_texture_float'),
4513      cb.get('OES_texture_float_linear'),
4514      cb.get('OES_texture_half_float'),
4515      cb.get('OES_texture_half_float_linear'),
4516      cb.get('OES_standard_derivatives'),
4517      cb.get('ANGLE_instanced_arrays'),
4518      cb.get('OES_element_index_uint') && (ff.MaxIndex = 4294967296)
4519    var db = new Nf(ab, cb, a),
4520      eb = new Mf(ab, cb, gc),
4521      fb = new Lf(),
4522      jb = new Kf(ab, cb, eb, fb, db, gc, this.info),
4523      kb = new Jf(ab, fb, this.info),
4524      lb = new Hf(this, db),
4525      mb = new rf()
4526    this.info.programs = lb.programs
4527    var pb,
4528      qb,
4529      rb,
4530      sb,
4531      nb = new qf(ab, cb, _a),
4532      ob = new pf(ab, cb, _a)
4533    ub(),
4534      (this.context = ab),
4535      (this.capabilities = db),
4536      (this.extensions = cb),
4537      (this.properties = fb),
4538      (this.state = eb)
4539    var wb = new Ie(this, $a, kb, db)
4540    this.shadowMap = wb
4541    var yb = new ye(this, w),
4542      zb = new xe(this, x)
4543    ;(this.getContext = function () {
4544      return ab
4545    }),
4546      (this.getContextAttributes = function () {
4547        return ab.getContextAttributes()
4548      }),
4549      (this.forceContextLoss = function () {
4550        cb.get('WEBGL_lose_context').loseContext()
4551      }),
4552      (this.getMaxAnisotropy = function () {
4553        return db.getMaxAnisotropy()
4554      }),
4555      (this.getPrecision = function () {
4556        return db.precision
4557      }),
4558      (this.getPixelRatio = function () {
4559        return ca
4560      }),
4561      (this.setPixelRatio = function (a) {
4562        void 0 !== a && ((ca = a), this.setSize(fa.z, fa.w, !1))
4563      }),
4564      (this.getSize = function () {
4565        return { width: _, height: aa }
4566      }),
4567      (this.setSize = function (a, c, d) {
4568        ;(_ = a),
4569          (aa = c),
4570          (b.width = a * ca),
4571          (b.height = c * ca),
4572          d !== !1 && ((b.style.width = a + 'px'), (b.style.height = c + 'px')),
4573          this.setViewport(0, 0, a, c)
4574      }),
4575      (this.setViewport = function (a, b, c, d) {
4576        eb.viewport(fa.set(a, b, c, d))
4577      }),
4578      (this.setScissor = function (a, b, c, d) {
4579        eb.scissor(da.set(a, b, c, d))
4580      }),
4581      (this.setScissorTest = function (a) {
4582        eb.setScissorTest((ea = a))
4583      }),
4584      (this.getClearColor = function () {
4585        return Z
4586      }),
4587      (this.setClearColor = function (a, b) {
4588        Z.set(a),
4589          ($ = void 0 !== b ? b : 1),
4590          eb.buffers.color.setClear(Z.r, Z.g, Z.b, $, j)
4591      }),
4592      (this.getClearAlpha = function () {
4593        return $
4594      }),
4595      (this.setClearAlpha = function (a) {
4596        ;($ = a), eb.buffers.color.setClear(Z.r, Z.g, Z.b, $, j)
4597      }),
4598      (this.clear = function (a, b, c) {
4599        var d = 0
4600        ;(void 0 === a || a) && (d |= ab.COLOR_BUFFER_BIT),
4601          (void 0 === b || b) && (d |= ab.DEPTH_BUFFER_BIT),
4602          (void 0 === c || c) && (d |= ab.STENCIL_BUFFER_BIT),
4603          ab.clear(d)
4604      }),
4605      (this.clearColor = function () {
4606        this.clear(!0, !1, !1)
4607      }),
4608      (this.clearDepth = function () {
4609        this.clear(!1, !0, !1)
4610      }),
4611      (this.clearStencil = function () {
4612        this.clear(!1, !1, !0)
4613      }),
4614      (this.clearTarget = function (a, b, c, d) {
4615        this.setRenderTarget(a), this.clear(b, c, d)
4616      }),
4617      (this.resetGLState = vb),
4618      (this.dispose = function () {
4619        ;(r = []),
4620          (t = -1),
4621          (m = []),
4622          (n = -1),
4623          b.removeEventListener('webglcontextlost', Ab, !1)
4624      }),
4625      (this.renderBufferImmediate = function (a, b, c) {
4626        eb.initAttributes()
4627        var d = fb.get(a)
4628        a.hasPositions && !d.position && (d.position = ab.createBuffer()),
4629          a.hasNormals && !d.normal && (d.normal = ab.createBuffer()),
4630          a.hasUvs && !d.uv && (d.uv = ab.createBuffer()),
4631          a.hasColors && !d.color && (d.color = ab.createBuffer())
4632        var e = b.getAttributes()
4633        if (
4634          (a.hasPositions &&
4635            (ab.bindBuffer(ab.ARRAY_BUFFER, d.position),
4636            ab.bufferData(ab.ARRAY_BUFFER, a.positionArray, ab.DYNAMIC_DRAW),
4637            eb.enableAttribute(e.position),
4638            ab.vertexAttribPointer(e.position, 3, ab.FLOAT, !1, 0, 0)),
4639          a.hasNormals)
4640        ) {
4641          if (
4642            (ab.bindBuffer(ab.ARRAY_BUFFER, d.normal),
4643            !c.isMeshPhongMaterial &&
4644              !c.isMeshStandardMaterial &&
4645              !c.isMeshNormalMaterial &&
4646              c.shading === q)
4647          )
4648            for (var f = 0, g = 3 * a.count; f < g; f += 9) {
4649              var h = a.normalArray,
4650                i = (h[f + 0] + h[f + 3] + h[f + 6]) / 3,
4651                j = (h[f + 1] + h[f + 4] + h[f + 7]) / 3,
4652                k = (h[f + 2] + h[f + 5] + h[f + 8]) / 3
4653              ;(h[f + 0] = i),
4654                (h[f + 1] = j),
4655                (h[f + 2] = k),
4656                (h[f + 3] = i),
4657                (h[f + 4] = j),
4658                (h[f + 5] = k),
4659                (h[f + 6] = i),
4660                (h[f + 7] = j),
4661                (h[f + 8] = k)
4662            }
4663          ab.bufferData(ab.ARRAY_BUFFER, a.normalArray, ab.DYNAMIC_DRAW),
4664            eb.enableAttribute(e.normal),
4665            ab.vertexAttribPointer(e.normal, 3, ab.FLOAT, !1, 0, 0)
4666        }
4667        a.hasUvs &&
4668          c.map &&
4669          (ab.bindBuffer(ab.ARRAY_BUFFER, d.uv),
4670          ab.bufferData(ab.ARRAY_BUFFER, a.uvArray, ab.DYNAMIC_DRAW),
4671          eb.enableAttribute(e.uv),
4672          ab.vertexAttribPointer(e.uv, 2, ab.FLOAT, !1, 0, 0)),
4673          a.hasColors &&
4674            c.vertexColors !== s &&
4675            (ab.bindBuffer(ab.ARRAY_BUFFER, d.color),
4676            ab.bufferData(ab.ARRAY_BUFFER, a.colorArray, ab.DYNAMIC_DRAW),
4677            eb.enableAttribute(e.color),
4678            ab.vertexAttribPointer(e.color, 3, ab.FLOAT, !1, 0, 0)),
4679          eb.disableUnusedAttributes(),
4680          ab.drawArrays(ab.TRIANGLES, 0, a.count),
4681          (a.count = 0)
4682      }),
4683      (this.renderBufferDirect = function (a, b, c, d, e, f) {
4684        Rb(d)
4685        var g = Sb(a, b, d, e),
4686          h = !1,
4687          i = c.id + '_' + g.id + '_' + d.wireframe
4688        i !== T && ((T = i), (h = !0))
4689        var j = e.morphTargetInfluences
4690        if (void 0 !== j) {
4691          for (var k = [], l = 0, m = j.length; l < m; l++) {
4692            var n = j[l]
4693            k.push([n, l])
4694          }
4695          k.sort(Hb), k.length > 8 && (k.length = 8)
4696          for (var o = c.morphAttributes, l = 0, m = k.length; l < m; l++) {
4697            var n = k[l]
4698            if (((u[l] = n[0]), 0 !== n[0])) {
4699              var p = n[1]
4700              d.morphTargets === !0 &&
4701                o.position &&
4702                c.addAttribute('morphTarget' + l, o.position[p]),
4703                d.morphNormals === !0 &&
4704                  o.normal &&
4705                  c.addAttribute('morphNormal' + l, o.normal[p])
4706            } else
4707              d.morphTargets === !0 && c.removeAttribute('morphTarget' + l),
4708                d.morphNormals === !0 && c.removeAttribute('morphNormal' + l)
4709          }
4710          for (var l = k.length, q = u.length; l < q; l++) u[l] = 0
4711          g.getUniforms().setValue(ab, 'morphTargetInfluences', u), (h = !0)
4712        }
4713        var p = c.index,
4714          r = c.attributes.position,
4715          s = 1
4716        d.wireframe === !0 && ((p = kb.getWireframeAttribute(c)), (s = 2))
4717        var t
4718        null !== p ? ((t = ob), t.setIndex(p)) : (t = nb),
4719          h &&
4720            (Gb(d, g, c),
4721            null !== p &&
4722              ab.bindBuffer(ab.ELEMENT_ARRAY_BUFFER, kb.getAttributeBuffer(p)))
4723        var v = 0
4724        null !== p ? (v = p.count) : void 0 !== r && (v = r.count)
4725        var w = c.drawRange.start * s,
4726          x = c.drawRange.count * s,
4727          y = null !== f ? f.start * s : 0,
4728          z = null !== f ? f.count * s : 1 / 0,
4729          A = Math.max(w, y),
4730          B = Math.min(v, w + x, y + z) - 1,
4731          C = Math.max(0, B - A + 1)
4732        if (0 !== C) {
4733          if (e.isMesh)
4734            if (d.wireframe === !0)
4735              eb.setLineWidth(d.wireframeLinewidth * tb()), t.setMode(ab.LINES)
4736            else
4737              switch (e.drawMode) {
4738                case gb:
4739                  t.setMode(ab.TRIANGLES)
4740                  break
4741                case hb:
4742                  t.setMode(ab.TRIANGLE_STRIP)
4743                  break
4744                case ib:
4745                  t.setMode(ab.TRIANGLE_FAN)
4746              }
4747          else if (e.isLine) {
4748            var D = d.linewidth
4749            void 0 === D && (D = 1),
4750              eb.setLineWidth(D * tb()),
4751              e.isLineSegments ? t.setMode(ab.LINES) : t.setMode(ab.LINE_STRIP)
4752          } else e.isPoints && t.setMode(ab.POINTS)
4753          c && c.isInstancedBufferGeometry
4754            ? c.maxInstancedCount > 0 && t.renderInstances(c, A, C)
4755            : t.render(A, C)
4756        }
4757      }),
4758      (this.render = function (a, b, c, d) {
4759        if (void 0 !== b && b.isCamera !== !0)
4760          return void console.error(
4761            'THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.'
4762          )
4763        ;(T = ''),
4764          (S = -1),
4765          (U = null),
4766          a.autoUpdate === !0 && a.updateMatrixWorld(),
4767          null === b.parent && b.updateMatrixWorld(),
4768          b.matrixWorldInverse.getInverse(b.matrixWorld),
4769          la.multiplyMatrices(b.projectionMatrix, b.matrixWorldInverse),
4770          ga.setFromMatrix(la),
4771          (l.length = 0),
4772          (n = -1),
4773          (t = -1),
4774          (w.length = 0),
4775          (x.length = 0),
4776          (ja = this.localClippingEnabled),
4777          (ia = ha.init(this.clippingPlanes, ja, b)),
4778          Ob(a, b),
4779          (m.length = n + 1),
4780          (r.length = t + 1),
4781          y.sortObjects === !0 && (m.sort(Ib), r.sort(Jb)),
4782          ia && ha.beginShadows(),
4783          dc(l),
4784          wb.render(a, b),
4785          ec(l, b),
4786          ia && ha.endShadows(),
4787          (_a.calls = 0),
4788          (_a.vertices = 0),
4789          (_a.faces = 0),
4790          (_a.points = 0),
4791          void 0 === c && (c = null),
4792          this.setRenderTarget(c)
4793        var e = a.background
4794        if (
4795          (null === e
4796            ? eb.buffers.color.setClear(Z.r, Z.g, Z.b, $, j)
4797            : e &&
4798              e.isColor &&
4799              (eb.buffers.color.setClear(e.r, e.g, e.b, 1, j), (d = !0)),
4800          (this.autoClear || d) &&
4801            this.clear(
4802              this.autoClearColor,
4803              this.autoClearDepth,
4804              this.autoClearStencil
4805            ),
4806          e && e.isCubeTexture
4807            ? (void 0 === rb &&
4808                ((rb = new nf()),
4809                (sb = new gf(
4810                  new jf(5, 5, 5),
4811                  new Be({
4812                    uniforms: ve.cube.uniforms,
4813                    vertexShader: ve.cube.vertexShader,
4814                    fragmentShader: ve.cube.fragmentShader,
4815                    side: o,
4816                    depthTest: !1,
4817                    depthWrite: !1,
4818                    fog: !1
4819                  })
4820                ))),
4821              rb.projectionMatrix.copy(b.projectionMatrix),
4822              rb.matrixWorld.extractRotation(b.matrixWorld),
4823              rb.matrixWorldInverse.getInverse(rb.matrixWorld),
4824              (sb.material.uniforms.tCube.value = e),
4825              sb.modelViewMatrix.multiplyMatrices(
4826                rb.matrixWorldInverse,
4827                sb.matrixWorld
4828              ),
4829              kb.update(sb),
4830              y.renderBufferDirect(
4831                rb,
4832                null,
4833                sb.geometry,
4834                sb.material,
4835                sb,
4836                null
4837              ))
4838            : e &&
4839              e.isTexture &&
4840              (void 0 === pb &&
4841                ((pb = new of(-1, 1, 1, -1, 0, 1)),
4842                (qb = new gf(
4843                  new lf(2, 2),
4844                  new Re({ depthTest: !1, depthWrite: !1, fog: !1 })
4845                ))),
4846              (qb.material.map = e),
4847              kb.update(qb),
4848              y.renderBufferDirect(
4849                pb,
4850                null,
4851                qb.geometry,
4852                qb.material,
4853                qb,
4854                null
4855              )),
4856          a.overrideMaterial)
4857        ) {
4858          var f = a.overrideMaterial
4859          Pb(m, a, b, f), Pb(r, a, b, f)
4860        } else eb.setBlending(v), Pb(m, a, b), Pb(r, a, b)
4861        yb.render(a, b),
4862          zb.render(a, b, X),
4863          c && jb.updateRenderTargetMipmap(c),
4864          eb.setDepthTest(!0),
4865          eb.setDepthWrite(!0),
4866          eb.setColorWrite(!0)
4867      }),
4868      (this.setFaceCulling = function (a, b) {
4869        eb.setCullFace(a), eb.setFlipSided(b === i)
4870      }),
4871      (this.allocTextureUnit = fc),
4872      (this.setTexture2D = (function () {
4873        var a = !1
4874        return function (c, d) {
4875          c &&
4876            c.isWebGLRenderTarget &&
4877            (a ||
4878              (console.warn(
4879                "THREE.WebGLRenderer.setTexture2D: don't use render targets as textures. Use their .texture property instead."
4880              ),
4881              (a = !0)),
4882            (c = c.texture)),
4883            jb.setTexture2D(c, d)
4884        }
4885      })()),
4886      (this.setTexture = (function () {
4887        var a = !1
4888        return function (c, d) {
4889          a ||
4890            (console.warn(
4891              'THREE.WebGLRenderer: .setTexture is deprecated, use setTexture2D instead.'
4892            ),
4893            (a = !0)),
4894            jb.setTexture2D(c, d)
4895        }
4896      })()),
4897      (this.setTextureCube = (function () {
4898        var a = !1
4899        return function (c, d) {
4900          c &&
4901            c.isWebGLRenderTargetCube &&
4902            (a ||
4903              (console.warn(
4904                "THREE.WebGLRenderer.setTextureCube: don't use cube render targets as textures. Use their .texture property instead."
4905              ),
4906              (a = !0)),
4907            (c = c.texture)),
4908            (c && c.isCubeTexture) ||
4909            (Array.isArray(c.image) && 6 === c.image.length)
4910              ? jb.setTextureCube(c, d)
4911              : jb.setTextureCubeDynamic(c, d)
4912        }
4913      })()),
4914      (this.getCurrentRenderTarget = function () {
4915        return A
4916      }),
4917      (this.setRenderTarget = function (a) {
4918        ;(A = a),
4919          a &&
4920            void 0 === fb.get(a).__webglFramebuffer &&
4921            jb.setupRenderTarget(a)
4922        var c,
4923          b = a && a.isWebGLRenderTargetCube
4924        if (a) {
4925          var d = fb.get(a)
4926          ;(c = b
4927            ? d.__webglFramebuffer[a.activeCubeFace]
4928            : d.__webglFramebuffer),
4929            V.copy(a.scissor),
4930            (W = a.scissorTest),
4931            X.copy(a.viewport)
4932        } else
4933          (c = null),
4934            V.copy(da).multiplyScalar(ca),
4935            (W = ea),
4936            X.copy(fa).multiplyScalar(ca)
4937        if (
4938          (R !== c && (ab.bindFramebuffer(ab.FRAMEBUFFER, c), (R = c)),
4939          eb.scissor(V),
4940          eb.setScissorTest(W),
4941          eb.viewport(X),
4942          b)
4943        ) {
4944          var e = fb.get(a.texture)
4945          ab.framebufferTexture2D(
4946            ab.FRAMEBUFFER,
4947            ab.COLOR_ATTACHMENT0,
4948            ab.TEXTURE_CUBE_MAP_POSITIVE_X + a.activeCubeFace,
4949            e.__webglTexture,
4950            a.activeMipMapLevel
4951          )
4952        }
4953      }),
4954      (this.readRenderTargetPixels = function (a, b, c, d, e, f) {
4955        if ((a && a.isWebGLRenderTarget) === !1)
4956          return void console.error(
4957            'THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.'
4958          )
4959        var g = fb.get(a).__webglFramebuffer
4960        if (g) {
4961          var h = !1
4962          g !== R && (ab.bindFramebuffer(ab.FRAMEBUFFER, g), (h = !0))
4963          try {
4964            var i = a.texture,
4965              j = i.format,
4966              k = i.type
4967            if (
4968              j !== Ka &&
4969              gc(j) !== ab.getParameter(ab.IMPLEMENTATION_COLOR_READ_FORMAT)
4970            )
4971              return void console.error(
4972                'THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.'
4973              )
4974            if (
4975              !(
4976                k === wa ||
4977                gc(k) === ab.getParameter(ab.IMPLEMENTATION_COLOR_READ_TYPE) ||
4978                (k === Ca &&
4979                  (cb.get('OES_texture_float') ||
4980                    cb.get('WEBGL_color_buffer_float'))) ||
4981                (k === Da && cb.get('EXT_color_buffer_half_float'))
4982              )
4983            )
4984              return void console.error(
4985                'THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.'
4986              )
4987            ab.checkFramebufferStatus(ab.FRAMEBUFFER) ===
4988            ab.FRAMEBUFFER_COMPLETE
4989              ? b >= 0 &&
4990                b <= a.width - d &&
4991                c >= 0 &&
4992                c <= a.height - e &&
4993                ab.readPixels(b, c, d, e, gc(j), gc(k), f)
4994              : console.error(
4995                  'THREE.WebGLRenderer.readRenderTargetPixels: readPixels from renderTarget failed. Framebuffer not complete.'
4996                )
4997          } finally {
4998            h && ab.bindFramebuffer(ab.FRAMEBUFFER, R)
4999          }
5000        }
5001      })
5002  }
5003  function Rf(a, b) {
5004    ;(this.name = ''),
5005      (this.color = new re(a)),
5006      (this.density = void 0 !== b ? b : 25e-5)
5007  }
5008  function Sf(a, b, c) {
5009    ;(this.name = ''),
5010      (this.color = new re(a)),
5011      (this.near = void 0 !== b ? b : 1),
5012      (this.far = void 0 !== c ? c : 1e3)
5013  }
5014  function Tf() {
5015    Ne.call(this),
5016      (this.type = 'Scene'),
5017      (this.background = null),
5018      (this.fog = null),
5019      (this.overrideMaterial = null),
5020      (this.autoUpdate = !0)
5021  }
5022  function Uf(a, b, c, d, e) {
5023    Ne.call(this),
5024      (this.lensFlares = []),
5025      (this.positionScreen = new Bb()),
5026      (this.customUpdateCallback = void 0),
5027      void 0 !== a && this.add(a, b, c, d, e)
5028  }
5029  function Vf(a) {
5030    Ae.call(this),
5031      (this.type = 'SpriteMaterial'),
5032      (this.color = new re(16777215)),
5033      (this.map = null),
5034      (this.rotation = 0),
5035      (this.fog = !1),
5036      (this.lights = !1),
5037      this.setValues(a)
5038  }
5039  function Wf(a) {
5040    Ne.call(this),
5041      (this.type = 'Sprite'),
5042      (this.material = void 0 !== a ? a : new Vf())
5043  }
5044  function Xf() {
5045    Ne.call(this),
5046      (this.type = 'LOD'),
5047      Object.defineProperties(this, { levels: { enumerable: !0, value: [] } })
5048  }
5049  function Yf(a, b, c) {
5050    if (
5051      ((this.useVertexTexture = void 0 === c || c),
5052      (this.identityMatrix = new Cb()),
5053      (a = a || []),
5054      (this.bones = a.slice(0)),
5055      this.useVertexTexture)
5056    ) {
5057      var d = Math.sqrt(4 * this.bones.length)
5058      ;(d = tb.nextPowerOfTwo(Math.ceil(d))),
5059        (d = Math.max(d, 4)),
5060        (this.boneTextureWidth = d),
5061        (this.boneTextureHeight = d),
5062        (this.boneMatrices = new Float32Array(
5063          this.boneTextureWidth * this.boneTextureHeight * 4
5064        )),
5065        (this.boneTexture = new te(
5066          this.boneMatrices,
5067          this.boneTextureWidth,
5068          this.boneTextureHeight,
5069          Ka,
5070          Ca
5071        ))
5072    } else this.boneMatrices = new Float32Array(16 * this.bones.length)
5073    if (void 0 === b) this.calculateInverses()
5074    else if (this.bones.length === b.length) this.boneInverses = b.slice(0)
5075    else {
5076      console.warn('THREE.Skeleton bonInverses is the wrong length.'),
5077        (this.boneInverses = [])
5078      for (var e = 0, f = this.bones.length; e < f; e++)
5079        this.boneInverses.push(new Cb())
5080    }
5081  }
5082  function Zf() {
5083    Ne.call(this), (this.type = 'Bone')
5084  }
5085  function $f(a, b, c) {
5086    gf.call(this, a, b),
5087      (this.type = 'SkinnedMesh'),
5088      (this.bindMode = 'attached'),
5089      (this.bindMatrix = new Cb()),
5090      (this.bindMatrixInverse = new Cb())
5091    var d = []
5092    if (this.geometry && void 0 !== this.geometry.bones) {
5093      for (var e, f, g = 0, h = this.geometry.bones.length; g < h; ++g)
5094        (f = this.geometry.bones[g]),
5095          (e = new Zf()),
5096          d.push(e),
5097          (e.name = f.name),
5098          e.position.fromArray(f.pos),
5099          e.quaternion.fromArray(f.rotq),
5100          void 0 !== f.scl && e.scale.fromArray(f.scl)
5101      for (var g = 0, h = this.geometry.bones.length; g < h; ++g)
5102        (f = this.geometry.bones[g]),
5103          f.parent !== -1 && null !== f.parent && void 0 !== d[f.parent]
5104            ? d[f.parent].add(d[g])
5105            : this.add(d[g])
5106    }
5107    this.normalizeSkinWeights(),
5108      this.updateMatrixWorld(!0),
5109      this.bind(new Yf(d, void 0, c), this.matrixWorld)
5110  }
5111  function _f(a) {
5112    Ae.call(this),
5113      (this.type = 'LineBasicMaterial'),
5114      (this.color = new re(16777215)),
5115      (this.linewidth = 1),
5116      (this.linecap = 'round'),
5117      (this.linejoin = 'round'),
5118      (this.lights = !1),
5119      this.setValues(a)
5120  }
5121  function ag(a, b, c) {
5122    return 1 === c
5123      ? (console.warn(
5124          'THREE.Line: parameter THREE.LinePieces no longer supported. Created THREE.LineSegments instead.'
5125        ),
5126        new bg(a, b))
5127      : (Ne.call(this),
5128        (this.type = 'Line'),
5129        (this.geometry = void 0 !== a ? a : new ff()),
5130        void (this.material =
5131          void 0 !== b ? b : new _f({ color: 16777215 * Math.random() })))
5132  }
5133  function bg(a, b) {
5134    ag.call(this, a, b), (this.type = 'LineSegments')
5135  }
5136  function cg(a) {
5137    Ae.call(this),
5138      (this.type = 'PointsMaterial'),
5139      (this.color = new re(16777215)),
5140      (this.map = null),
5141      (this.size = 1),
5142      (this.sizeAttenuation = !0),
5143      (this.lights = !1),
5144      this.setValues(a)
5145  }
5146  function dg(a, b) {
5147    Ne.call(this),
5148      (this.type = 'Points'),
5149      (this.geometry = void 0 !== a ? a : new ff()),
5150      (this.material =
5151        void 0 !== b ? b : new cg({ color: 16777215 * Math.random() }))
5152  }
5153  function eg() {
5154    Ne.call(this), (this.type = 'Group')
5155  }
5156  function fg(a, b, c, d, e, f, g, h, i) {
5157    function k() {
5158      requestAnimationFrame(k),
5159        a.readyState >= a.HAVE_CURRENT_DATA && (j.needsUpdate = !0)
5160    }
5161    wb.call(this, a, b, c, d, e, f, g, h, i), (this.generateMipmaps = !1)
5162    var j = this
5163    k()
5164  }
5165  function gg(a, b, c, d, e, f, g, h, i, j, k, l) {
5166    wb.call(this, null, f, g, h, i, j, d, e, k, l),
5167      (this.image = { width: b, height: c }),
5168      (this.mipmaps = a),
5169      (this.flipY = !1),
5170      (this.generateMipmaps = !1)
5171  }
5172  function hg(a, b, c, d, e, f, g, h, i) {
5173    wb.call(this, a, b, c, d, e, f, g, h, i), (this.needsUpdate = !0)
5174  }
5175  function ig(a, b, c, d, e, f, g, h, i, j) {
5176    if (((j = void 0 !== j ? j : Oa), j !== Oa && j !== Pa))
5177      throw new Error(
5178        'DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat'
5179      )
5180    void 0 === c && j === Oa && (c = za),
5181      void 0 === c && j === Pa && (c = Ha),
5182      wb.call(this, null, d, e, f, g, h, j, c, i),
5183      (this.image = { width: a, height: b }),
5184      (this.magFilter = void 0 !== g ? g : qa),
5185      (this.minFilter = void 0 !== h ? h : qa),
5186      (this.flipY = !1),
5187      (this.generateMipmaps = !1)
5188  }
5189  function jg(a) {
5190    function x(a, b) {
5191      return a - b
5192    }
5193    ff.call(this), (this.type = 'WireframeGeometry')
5194    var c,
5195      d,
5196      e,
5197      f,
5198      g,
5199      j,
5200      k,
5201      m,
5202      b = [],
5203      h = [0, 0],
5204      i = {},
5205      l = ['a', 'b', 'c']
5206    if (a && a.isGeometry) {
5207      var n = a.faces
5208      for (c = 0, e = n.length; c < e; c++) {
5209        var o = n[c]
5210        for (d = 0; d < 3; d++)
5211          (h[0] = o[l[d]]),
5212            (h[1] = o[l[(d + 1) % 3]]),
5213            h.sort(x),
5214            (k = h.toString()),
5215            void 0 === i[k] && (i[k] = { index1: h[0], index2: h[1] })
5216      }
5217      for (k in i)
5218        (j = i[k]),
5219          (m = a.vertices[j.index1]),
5220          b.push(m.x, m.y, m.z),
5221          (m = a.vertices[j.index2]),
5222          b.push(m.x, m.y, m.z)
5223    } else if (a && a.isBufferGeometry) {
5224      var p, q, r, s, t, u, v, w
5225      if (((m = new Bb()), null !== a.index)) {
5226        for (
5227          p = a.attributes.position,
5228            q = a.index,
5229            r = a.groups,
5230            0 === r.length && a.addGroup(0, q.count),
5231            f = 0,
5232            g = r.length;
5233          f < g;
5234          ++f
5235        )
5236          for (
5237            s = r[f], t = s.start, u = s.count, c = t, e = t + u;
5238            c < e;
5239            c += 3
5240          )
5241            for (d = 0; d < 3; d++)
5242              (h[0] = q.getX(c + d)),
5243                (h[1] = q.getX(c + ((d + 1) % 3))),
5244                h.sort(x),
5245                (k = h.toString()),
5246                void 0 === i[k] && (i[k] = { index1: h[0], index2: h[1] })
5247        for (k in i)
5248          (j = i[k]),
5249            m.fromBufferAttribute(p, j.index1),
5250            b.push(m.x, m.y, m.z),
5251            m.fromBufferAttribute(p, j.index2),
5252            b.push(m.x, m.y, m.z)
5253      } else
5254        for (p = a.attributes.position, c = 0, e = p.count / 3; c < e; c++)
5255          for (d = 0; d < 3; d++)
5256            (v = 3 * c + d),
5257              m.fromBufferAttribute(p, v),
5258              b.push(m.x, m.y, m.z),
5259              (w = 3 * c + ((d + 1) % 3)),
5260              m.fromBufferAttribute(p, w),
5261              b.push(m.x, m.y, m.z)
5262    }
5263    this.addAttribute('position', new $e(b, 3))
5264  }
5265  function kg(a, b, c) {
5266    ef.call(this),
5267      (this.type = 'ParametricGeometry'),
5268      (this.parameters = { func: a, slices: b, stacks: c }),
5269      this.fromBufferGeometry(new lg(a, b, c)),
5270      this.mergeVertices()
5271  }
5272  function lg(a, b, c) {
5273    ff.call(this),
5274      (this.type = 'ParametricBufferGeometry'),
5275      (this.parameters = { func: a, slices: b, stacks: c })
5276    var g,
5277      h,
5278      d = [],
5279      e = [],
5280      f = [],
5281      i = b + 1
5282    for (g = 0; g <= c; g++) {
5283      var j = g / c
5284      for (h = 0; h <= b; h++) {
5285        var k = h / b,
5286          l = a(k, j)
5287        e.push(l.x, l.y, l.z), f.push(k, j)
5288      }
5289    }
5290    for (g = 0; g < c; g++)
5291      for (h = 0; h < b; h++) {
5292        var m = g * i + h,
5293          n = g * i + h + 1,
5294          o = (g + 1) * i + h + 1,
5295          p = (g + 1) * i + h
5296        d.push(m, n, p), d.push(n, o, p)
5297      }
5298    this.setIndex(d),
5299      this.addAttribute('position', new $e(e, 3)),
5300      this.addAttribute('uv', new $e(f, 2)),
5301      this.computeVertexNormals()
5302  }
5303  function mg(a, b, c, d) {
5304    ef.call(this),
5305      (this.type = 'PolyhedronGeometry'),
5306      (this.parameters = { vertices: a, indices: b, radius: c, detail: d }),
5307      this.fromBufferGeometry(new ng(a, b, c, d)),
5308      this.mergeVertices()
5309  }
5310  function ng(a, b, c, d) {
5311    function g(a) {
5312      for (
5313        var c = new Bb(), d = new Bb(), e = new Bb(), f = 0;
5314        f < b.length;
5315        f += 3
5316      )
5317        m(b[f + 0], c), m(b[f + 1], d), m(b[f + 2], e), h(c, d, e, a)
5318    }
5319    function h(a, b, c, d) {
5320      var g,
5321        h,
5322        e = Math.pow(2, d),
5323        f = []
5324      for (g = 0; g <= e; g++) {
5325        f[g] = []
5326        var i = a.clone().lerp(c, g / e),
5327          j = b.clone().lerp(c, g / e),
5328          k = e - g
5329        for (h = 0; h <= k; h++)
5330          0 === h && g === e
5331            ? (f[g][h] = i)
5332            : (f[g][h] = i.clone().lerp(j, h / k))
5333      }
5334      for (g = 0; g < e; g++)
5335        for (h = 0; h < 2 * (e - g) - 1; h++) {
5336          var m = Math.floor(h / 2)
5337          h % 2 === 0
5338            ? (l(f[g][m + 1]), l(f[g + 1][m]), l(f[g][m]))
5339            : (l(f[g][m + 1]), l(f[g + 1][m + 1]), l(f[g + 1][m]))
5340        }
5341    }
5342    function i(a) {
5343      for (var b = new Bb(), c = 0; c < e.length; c += 3)
5344        (b.x = e[c + 0]),
5345          (b.y = e[c + 1]),
5346          (b.z = e[c + 2]),
5347          b.normalize().multiplyScalar(a),
5348          (e[c + 0] = b.x),
5349          (e[c + 1] = b.y),
5350          (e[c + 2] = b.z)
5351    }
5352    function j() {
5353      for (var a = new Bb(), b = 0; b < e.length; b += 3) {
5354        ;(a.x = e[b + 0]), (a.y = e[b + 1]), (a.z = e[b + 2])
5355        var c = p(a) / 2 / Math.PI + 0.5,
5356          d = q(a) / Math.PI + 0.5
5357        f.push(c, 1 - d)
5358      }
5359      n(), k()
5360    }
5361    function k() {
5362      for (var a = 0; a < f.length; a += 6) {
5363        var b = f[a + 0],
5364          c = f[a + 2],
5365          d = f[a + 4],
5366          e = Math.max(b, c, d),
5367          g = Math.min(b, c, d)
5368        e > 0.9 &&
5369          g < 0.1 &&
5370          (b < 0.2 && (f[a + 0] += 1),
5371          c < 0.2 && (f[a + 2] += 1),
5372          d < 0.2 && (f[a + 4] += 1))
5373      }
5374    }
5375    function l(a) {
5376      e.push(a.x, a.y, a.z)
5377    }
5378    function m(b, c) {
5379      var d = 3 * b
5380      ;(c.x = a[d + 0]), (c.y = a[d + 1]), (c.z = a[d + 2])
5381    }
5382    function n() {
5383      for (
5384        var a = new Bb(),
5385          b = new Bb(),
5386          c = new Bb(),
5387          d = new Bb(),
5388          g = new ub(),
5389          h = new ub(),
5390          i = new ub(),
5391          j = 0,
5392          k = 0;
5393        j < e.length;
5394        j += 9, k += 6
5395      ) {
5396        a.set(e[j + 0], e[j + 1], e[j + 2]),
5397          b.set(e[j + 3], e[j + 4], e[j + 5]),
5398          c.set(e[j + 6], e[j + 7], e[j + 8]),
5399          g.set(f[k + 0], f[k + 1]),
5400          h.set(f[k + 2], f[k + 3]),
5401          i.set(f[k + 4], f[k + 5]),
5402          d.copy(a).add(b).add(c).divideScalar(3)
5403        var l = p(d)
5404        o(g, k + 0, a, l), o(h, k + 2, b, l), o(i, k + 4, c, l)
5405      }
5406    }
5407    function o(a, b, c, d) {
5408      d < 0 && 1 === a.x && (f[b] = a.x - 1),
5409        0 === c.x && 0 === c.z && (f[b] = d / 2 / Math.PI + 0.5)
5410    }
5411    function p(a) {
5412      return Math.atan2(a.z, -a.x)
5413    }
5414    function q(a) {
5415      return Math.atan2(-a.y, Math.sqrt(a.x * a.x + a.z * a.z))
5416    }
5417    ff.call(this),
5418      (this.type = 'PolyhedronBufferGeometry'),
5419      (this.parameters = { vertices: a, indices: b, radius: c, detail: d }),
5420      (c = c || 1),
5421      (d = d || 0)
5422    var e = [],
5423      f = []
5424    g(d),
5425      i(c),
5426      j(),
5427      this.addAttribute('position', new $e(e, 3)),
5428      this.addAttribute('normal', new $e(e.slice(), 3)),
5429      this.addAttribute('uv', new $e(f, 2)),
5430      this.normalizeNormals()
5431  }
5432  function og(a, b) {
5433    ef.call(this),
5434      (this.type = 'TetrahedronGeometry'),
5435      (this.parameters = { radius: a, detail: b }),
5436      this.fromBufferGeometry(new pg(a, b)),
5437      this.mergeVertices()
5438  }
5439  function pg(a, b) {
5440    var c = [1, 1, 1, -1, -1, 1, -1, 1, -1, 1, -1, -1],
5441      d = [2, 1, 0, 0, 3, 2, 1, 3, 0, 2, 3, 1]
5442    ng.call(this, c, d, a, b),
5443      (this.type = 'TetrahedronBufferGeometry'),
5444      (this.parameters = { radius: a, detail: b })
5445  }
5446  function qg(a, b) {
5447    ef.call(this),
5448      (this.type = 'OctahedronGeometry'),
5449      (this.parameters = { radius: a, detail: b }),
5450      this.fromBufferGeometry(new rg(a, b)),
5451      this.mergeVertices()
5452  }
5453  function rg(a, b) {
5454    var c = [1, 0, 0, -1, 0, 0, 0, 1, 0, 0, -1, 0, 0, 0, 1, 0, 0, -1],
5455      d = [
5456        0, 2, 4, 0, 4, 3, 0, 3, 5, 0, 5, 2, 1, 2, 5, 1, 5, 3, 1, 3, 4, 1, 4, 2
5457      ]
5458    ng.call(this, c, d, a, b),
5459      (this.type = 'OctahedronBufferGeometry'),
5460      (this.parameters = { radius: a, detail: b })
5461  }
5462  function sg(a, b) {
5463    ef.call(this),
5464      (this.type = 'IcosahedronGeometry'),
5465      (this.parameters = { radius: a, detail: b }),
5466      this.fromBufferGeometry(new tg(a, b)),
5467      this.mergeVertices()
5468  }
5469  function tg(a, b) {
5470    var c = (1 + Math.sqrt(5)) / 2,
5471      d = [
5472        -1,
5473        c,
5474        0,
5475        1,
5476        c,
5477        0,
5478        -1,
5479        -c,
5480        0,
5481        1,
5482        -c,
5483        0,
5484        0,
5485        -1,
5486        c,
5487        0,
5488        1,
5489        c,
5490        0,
5491        -1,
5492        -c,
5493        0,
5494        1,
5495        -c,
5496        c,
5497        0,
5498        -1,
5499        c,
5500        0,
5501        1,
5502        -c,
5503        0,
5504        -1,
5505        -c,
5506        0,
5507        1
5508      ],
5509      e = [
5510        0, 11, 5, 0, 5, 1, 0, 1, 7, 0, 7, 10, 0, 10, 11, 1, 5, 9, 5, 11, 4, 11,
5511        10, 2, 10, 7, 6, 7, 1, 8, 3, 9, 4, 3, 4, 2, 3, 2, 6, 3, 6, 8, 3, 8, 9,
5512        4, 9, 5, 2, 4, 11, 6, 2, 10, 8, 6, 7, 9, 8, 1
5513      ]
5514    ng.call(this, d, e, a, b),
5515      (this.type = 'IcosahedronBufferGeometry'),
5516      (this.parameters = { radius: a, detail: b })
5517  }
5518  function ug(a, b) {
5519    ef.call(this),
5520      (this.type = 'DodecahedronGeometry'),
5521      (this.parameters = { radius: a, detail: b }),
5522      this.fromBufferGeometry(new vg(a, b)),
5523      this.mergeVertices()
5524  }
5525  function vg(a, b) {
5526    var c = (1 + Math.sqrt(5)) / 2,
5527      d = 1 / c,
5528      e = [
5529        -1,
5530        -1,
5531        -1,
5532        -1,
5533        -1,
5534        1,
5535        -1,
5536        1,
5537        -1,
5538        -1,
5539        1,
5540        1,
5541        1,
5542        -1,
5543        -1,
5544        1,
5545        -1,
5546        1,
5547        1,
5548        1,
5549        -1,
5550        1,
5551        1,
5552        1,
5553        0,
5554        -d,
5555        -c,
5556        0,
5557        -d,
5558        c,
5559        0,
5560        d,
5561        -c,
5562        0,
5563        d,
5564        c,
5565        -d,
5566        -c,
5567        0,
5568        -d,
5569        c,
5570        0,
5571        d,
5572        -c,
5573        0,
5574        d,
5575        c,
5576        0,
5577        -c,
5578        0,
5579        -d,
5580        c,
5581        0,
5582        -d,
5583        -c,
5584        0,
5585        d,
5586        c,
5587        0,
5588        d
5589      ],
5590      f = [
5591        3, 11, 7, 3, 7, 15, 3, 15, 13, 7, 19, 17, 7, 17, 6, 7, 6, 15, 17, 4, 8,
5592        17, 8, 10, 17, 10, 6, 8, 0, 16, 8, 16, 2, 8, 2, 10, 0, 12, 1, 0, 1, 18,
5593        0, 18, 16, 6, 10, 2, 6, 2, 13, 6, 13, 15, 2, 16, 18, 2, 18, 3, 2, 3, 13,
5594        18, 1, 9, 18, 9, 11, 18, 11, 3, 4, 14, 12, 4, 12, 0, 4, 0, 8, 11, 9, 5,
5595        11, 5, 19, 11, 19, 7, 19, 5, 14, 19, 14, 4, 19, 4, 17, 1, 12, 14, 1, 14,
5596        5, 1, 5, 9
5597      ]
5598    ng.call(this, e, f, a, b),
5599      (this.type = 'DodecahedronBufferGeometry'),
5600      (this.parameters = { radius: a, detail: b })
5601  }
5602  function wg(a, b, c, d, e, f) {
5603    ef.call(this),
5604      (this.type = 'TubeGeometry'),
5605      (this.parameters = {
5606        path: a,
5607        tubularSegments: b,
5608        radius: c,
5609        radialSegments: d,
5610        closed: e
5611      }),
5612      void 0 !== f &&
5613        console.warn('THREE.TubeGeometry: taper has been removed.')
5614    var g = new xg(a, b, c, d, e)
5615    ;(this.tangents = g.tangents),
5616      (this.normals = g.normals),
5617      (this.binormals = g.binormals),
5618      this.fromBufferGeometry(g),
5619      this.mergeVertices()
5620  }
5621  function xg(a, b, c, d, e) {
5622    function p() {
5623      for (j = 0; j < b; j++) q(j)
5624      q(e === !1 ? b : 0), s(), r()
5625    }
5626    function q(e) {
5627      var i = a.getPointAt(e / b),
5628        j = f.normals[e],
5629        n = f.binormals[e]
5630      for (k = 0; k <= d; k++) {
5631        var o = (k / d) * Math.PI * 2,
5632          p = Math.sin(o),
5633          q = -Math.cos(o)
5634        ;(h.x = q * j.x + p * n.x),
5635          (h.y = q * j.y + p * n.y),
5636          (h.z = q * j.z + p * n.z),
5637          h.normalize(),
5638          m.push(h.x, h.y, h.z),
5639          (g.x = i.x + c * h.x),
5640          (g.y = i.y + c * h.y),
5641          (g.z = i.z + c * h.z),
5642          l.push(g.x, g.y, g.z)
5643      }
5644    }
5645    function r() {
5646      for (k = 1; k <= b; k++)
5647        for (j = 1; j <= d; j++) {
5648          var a = (d + 1) * (k - 1) + (j - 1),
5649            c = (d + 1) * k + (j - 1),
5650            e = (d + 1) * k + j,
5651            f = (d + 1) * (k - 1) + j
5652          o.push(a, c, f), o.push(c, e, f)
5653        }
5654    }
5655    function s() {
5656      for (j = 0; j <= b; j++)
5657        for (k = 0; k <= d; k++) (i.x = j / b), (i.y = k / d), n.push(i.x, i.y)
5658    }
5659    ff.call(this),
5660      (this.type = 'TubeBufferGeometry'),
5661      (this.parameters = {
5662        path: a,
5663        tubularSegments: b,
5664        radius: c,
5665        radialSegments: d,
5666        closed: e
5667      }),
5668      (b = b || 64),
5669      (c = c || 1),
5670      (d = d || 8),
5671      (e = e || !1)
5672    var f = a.computeFrenetFrames(b, e)
5673    ;(this.tangents = f.tangents),
5674      (this.normals = f.normals),
5675      (this.binormals = f.binormals)
5676    var j,
5677      k,
5678      g = new Bb(),
5679      h = new Bb(),
5680      i = new ub(),
5681      l = [],
5682      m = [],
5683      n = [],
5684      o = []
5685    p(),
5686      this.setIndex(o),
5687      this.addAttribute('position', new $e(l, 3)),
5688      this.addAttribute('normal', new $e(m, 3)),
5689      this.addAttribute('uv', new $e(n, 2))
5690  }
5691  function yg(a, b, c, d, e, f, g) {
5692    ef.call(this),
5693      (this.type = 'TorusKnotGeometry'),
5694      (this.parameters = {
5695        radius: a,
5696        tube: b,
5697        tubularSegments: c,
5698        radialSegments: d,
5699        p: e,
5700        q: f
5701      }),
5702      void 0 !== g &&
5703        console.warn(
5704          'THREE.TorusKnotGeometry: heightScale has been deprecated. Use .scale( x, y, z ) instead.'
5705        ),
5706      this.fromBufferGeometry(new zg(a, b, c, d, e, f)),
5707      this.mergeVertices()
5708  }
5709  function zg(a, b, c, d, e, f) {
5710    function C(a, b, c, d, e) {
5711      var f = Math.cos(a),
5712        g = Math.sin(a),
5713        h = (c / b) * a,
5714        i = Math.cos(h)
5715      ;(e.x = d * (2 + i) * 0.5 * f),
5716        (e.y = d * (2 + i) * g * 0.5),
5717        (e.z = d * Math.sin(h) * 0.5)
5718    }
5719    ff.call(this),
5720      (this.type = 'TorusKnotBufferGeometry'),
5721      (this.parameters = {
5722        radius: a,
5723        tube: b,
5724        tubularSegments: c,
5725        radialSegments: d,
5726        p: e,
5727        q: f
5728      }),
5729      (a = a || 100),
5730      (b = b || 40),
5731      (c = Math.floor(c) || 64),
5732      (d = Math.floor(d) || 8),
5733      (e = e || 2),
5734      (f = f || 3)
5735    var k,
5736      l,
5737      g = [],
5738      h = [],
5739      i = [],
5740      j = [],
5741      m = new Bb(),
5742      n = new Bb(),
5743      p = (new ub(), new Bb()),
5744      q = new Bb(),
5745      r = new Bb(),
5746      s = new Bb(),
5747      t = new Bb()
5748    for (k = 0; k <= c; ++k) {
5749      var u = (k / c) * e * Math.PI * 2
5750      for (
5751        C(u, e, f, a, p),
5752          C(u + 0.01, e, f, a, q),
5753          s.subVectors(q, p),
5754          t.addVectors(q, p),
5755          r.crossVectors(s, t),
5756          t.crossVectors(r, s),
5757          r.normalize(),
5758          t.normalize(),
5759          l = 0;
5760        l <= d;
5761        ++l
5762      ) {
5763        var v = (l / d) * Math.PI * 2,
5764          w = -b * Math.cos(v),
5765          x = b * Math.sin(v)
5766        ;(m.x = p.x + (w * t.x + x * r.x)),
5767          (m.y = p.y + (w * t.y + x * r.y)),
5768          (m.z = p.z + (w * t.z + x * r.z)),
5769          h.push(m.x, m.y, m.z),
5770          n.subVectors(m, p).normalize(),
5771          i.push(n.x, n.y, n.z),
5772          j.push(k / c),
5773          j.push(l / d)
5774      }
5775    }
5776    for (l = 1; l <= c; l++)
5777      for (k = 1; k <= d; k++) {
5778        var y = (d + 1) * (l - 1) + (k - 1),
5779          z = (d + 1) * l + (k - 1),
5780          A = (d + 1) * l + k,
5781          B = (d + 1) * (l - 1) + k
5782        g.push(y, z, B), g.push(z, A, B)
5783      }
5784    this.setIndex(g),
5785      this.addAttribute('position', new $e(h, 3)),
5786      this.addAttribute('normal', new $e(i, 3)),
5787      this.addAttribute('uv', new $e(j, 2))
5788  }
5789  function Ag(a, b, c, d, e) {
5790    ef.call(this),
5791      (this.type = 'TorusGeometry'),
5792      (this.parameters = {
5793        radius: a,
5794        tube: b,
5795        radialSegments: c,
5796        tubularSegments: d,
5797        arc: e
5798      }),
5799      this.fromBufferGeometry(new Bg(a, b, c, d, e))
5800  }
5801  function Bg(a, b, c, d, e) {
5802    ff.call(this),
5803      (this.type = 'TorusBufferGeometry'),
5804      (this.parameters = {
5805        radius: a,
5806        tube: b,
5807        radialSegments: c,
5808        tubularSegments: d,
5809        arc: e
5810      }),
5811      (a = a || 100),
5812      (b = b || 40),
5813      (c = Math.floor(c) || 8),
5814      (d = Math.floor(d) || 6),
5815      (e = e || 2 * Math.PI)
5816    var m,
5817      n,
5818      f = [],
5819      g = [],
5820      h = [],
5821      i = [],
5822      j = new Bb(),
5823      k = new Bb(),
5824      l = new Bb()
5825    for (m = 0; m <= c; m++)
5826      for (n = 0; n <= d; n++) {
5827        var o = (n / d) * e,
5828          p = (m / c) * Math.PI * 2
5829        ;(k.x = (a + b * Math.cos(p)) * Math.cos(o)),
5830          (k.y = (a + b * Math.cos(p)) * Math.sin(o)),
5831          (k.z = b * Math.sin(p)),
5832          g.push(k.x, k.y, k.z),
5833          (j.x = a * Math.cos(o)),
5834          (j.y = a * Math.sin(o)),
5835          l.subVectors(k, j).normalize(),
5836          h.push(l.x, l.y, l.z),
5837          i.push(n / d),
5838          i.push(m / c)
5839      }
5840    for (m = 1; m <= c; m++)
5841      for (n = 1; n <= d; n++) {
5842        var q = (d + 1) * m + n - 1,
5843          r = (d + 1) * (m - 1) + n - 1,
5844          s = (d + 1) * (m - 1) + n,
5845          t = (d + 1) * m + n
5846        f.push(q, r, t), f.push(r, s, t)
5847      }
5848    this.setIndex(f),
5849      this.addAttribute('position', new $e(g, 3)),
5850      this.addAttribute('normal', new $e(h, 3)),
5851      this.addAttribute('uv', new $e(i, 2))
5852  }
5853  function Dg(a, b) {
5854    return 'undefined' == typeof a
5855      ? void (a = [])
5856      : (ef.call(this),
5857        (this.type = 'ExtrudeGeometry'),
5858        (a = Array.isArray(a) ? a : [a]),
5859        this.addShapeList(a, b),
5860        void this.computeFaceNormals())
5861  }
5862  function Eg(a, b) {
5863    b = b || {}
5864    var c = b.font
5865    if ((c && c.isFont) === !1)
5866      return (
5867        console.error(
5868          'THREE.TextGeometry: font parameter is not an instance of THREE.Font.'
5869        ),
5870        new ef()
5871      )
5872    var d = c.generateShapes(a, b.size, b.curveSegments)
5873    ;(b.amount = void 0 !== b.height ? b.height : 50),
5874      void 0 === b.bevelThickness && (b.bevelThickness = 10),
5875      void 0 === b.bevelSize && (b.bevelSize = 8),
5876      void 0 === b.bevelEnabled && (b.bevelEnabled = !1),
5877      Dg.call(this, d, b),
5878      (this.type = 'TextGeometry')
5879  }
5880  function Fg(a, b, c, d, e, f, g) {
5881    ef.call(this),
5882      (this.type = 'SphereGeometry'),
5883      (this.parameters = {
5884        radius: a,
5885        widthSegments: b,
5886        heightSegments: c,
5887        phiStart: d,
5888        phiLength: e,
5889        thetaStart: f,
5890        thetaLength: g
5891      }),
5892      this.fromBufferGeometry(new Gg(a, b, c, d, e, f, g))
5893  }
5894  function Gg(a, b, c, d, e, f, g) {
5895    ff.call(this),
5896      (this.type = 'SphereBufferGeometry'),
5897      (this.parameters = {
5898        radius: a,
5899        widthSegments: b,
5900        heightSegments: c,
5901        phiStart: d,
5902        phiLength: e,
5903        thetaStart: f,
5904        thetaLength: g
5905      }),
5906      (a = a || 50),
5907      (b = Math.max(3, Math.floor(b) || 8)),
5908      (c = Math.max(2, Math.floor(c) || 6)),
5909      (d = void 0 !== d ? d : 0),
5910      (e = void 0 !== e ? e : 2 * Math.PI),
5911      (f = void 0 !== f ? f : 0),
5912      (g = void 0 !== g ? g : Math.PI)
5913    var i,
5914      j,
5915      h = f + g,
5916      k = 0,
5917      l = [],
5918      m = new Bb(),
5919      n = new Bb(),
5920      o = [],
5921      p = [],
5922      q = [],
5923      r = []
5924    for (j = 0; j <= c; j++) {
5925      var s = [],
5926        t = j / c
5927      for (i = 0; i <= b; i++) {
5928        var u = i / b
5929        ;(m.x = -a * Math.cos(d + u * e) * Math.sin(f + t * g)),
5930          (m.y = a * Math.cos(f + t * g)),
5931          (m.z = a * Math.sin(d + u * e) * Math.sin(f + t * g)),
5932          p.push(m.x, m.y, m.z),
5933          n.set(m.x, m.y, m.z).normalize(),
5934          q.push(n.x, n.y, n.z),
5935          r.push(u, 1 - t),
5936          s.push(k++)
5937      }
5938      l.push(s)
5939    }
5940    for (j = 0; j < c; j++)
5941      for (i = 0; i < b; i++) {
5942        var v = l[j][i + 1],
5943          w = l[j][i],
5944          x = l[j + 1][i],
5945          y = l[j + 1][i + 1]
5946        ;(0 !== j || f > 0) && o.push(v, w, y),
5947          (j !== c - 1 || h < Math.PI) && o.push(w, x, y)
5948      }
5949    this.setIndex(o),
5950      this.addAttribute('position', new $e(p, 3)),
5951      this.addAttribute('normal', new $e(q, 3)),
5952      this.addAttribute('uv', new $e(r, 2))
5953  }
5954  function Hg(a, b, c, d, e, f) {
5955    ef.call(this),
5956      (this.type = 'RingGeometry'),
5957      (this.parameters = {
5958        innerRadius: a,
5959        outerRadius: b,
5960        thetaSegments: c,
5961        phiSegments: d,
5962        thetaStart: e,
5963        thetaLength: f
5964      }),
5965      this.fromBufferGeometry(new Ig(a, b, c, d, e, f))
5966  }
5967  function Ig(a, b, c, d, e, f) {
5968    ff.call(this),
5969      (this.type = 'RingBufferGeometry'),
5970      (this.parameters = {
5971        innerRadius: a,
5972        outerRadius: b,
5973        thetaSegments: c,
5974        phiSegments: d,
5975        thetaStart: e,
5976        thetaLength: f
5977      }),
5978      (a = a || 20),
5979      (b = b || 50),
5980      (e = void 0 !== e ? e : 0),
5981      (f = void 0 !== f ? f : 2 * Math.PI),
5982      (c = void 0 !== c ? Math.max(3, c) : 8),
5983      (d = void 0 !== d ? Math.max(1, d) : 1)
5984    var k,
5985      p,
5986      q,
5987      g = [],
5988      h = [],
5989      i = [],
5990      j = [],
5991      l = a,
5992      m = (b - a) / d,
5993      n = new Bb(),
5994      o = new ub()
5995    for (p = 0; p <= d; p++) {
5996      for (q = 0; q <= c; q++)
5997        (k = e + (q / c) * f),
5998          (n.x = l * Math.cos(k)),
5999          (n.y = l * Math.sin(k)),
6000          h.push(n.x, n.y, n.z),
6001          i.push(0, 0, 1),
6002          (o.x = (n.x / b + 1) / 2),
6003          (o.y = (n.y / b + 1) / 2),
6004          j.push(o.x, o.y)
6005      l += m
6006    }
6007    for (p = 0; p < d; p++) {
6008      var r = p * (c + 1)
6009      for (q = 0; q < c; q++) {
6010        k = q + r
6011        var s = k,
6012          t = k + c + 1,
6013          u = k + c + 2,
6014          v = k + 1
6015        g.push(s, t, v), g.push(t, u, v)
6016      }
6017    }
6018    this.setIndex(g),
6019      this.addAttribute('position', new $e(h, 3)),
6020      this.addAttribute('normal', new $e(i, 3)),
6021      this.addAttribute('uv', new $e(j, 2))
6022  }
6023  function Jg(a, b, c, d) {
6024    ef.call(this),
6025      (this.type = 'LatheGeometry'),
6026      (this.parameters = { points: a, segments: b, phiStart: c, phiLength: d }),
6027      this.fromBufferGeometry(new Kg(a, b, c, d)),
6028      this.mergeVertices()
6029  }
6030  function Kg(a, b, c, d) {
6031    ff.call(this),
6032      (this.type = 'LatheBufferGeometry'),
6033      (this.parameters = { points: a, segments: b, phiStart: c, phiLength: d }),
6034      (b = Math.floor(b) || 12),
6035      (c = c || 0),
6036      (d = d || 2 * Math.PI),
6037      (d = tb.clamp(d, 0, 2 * Math.PI))
6038    var h,
6039      l,
6040      m,
6041      e = [],
6042      f = [],
6043      g = [],
6044      i = 1 / b,
6045      j = new Bb(),
6046      k = new ub()
6047    for (l = 0; l <= b; l++) {
6048      var n = c + l * i * d,
6049        o = Math.sin(n),
6050        p = Math.cos(n)
6051      for (m = 0; m <= a.length - 1; m++)
6052        (j.x = a[m].x * o),
6053          (j.y = a[m].y),
6054          (j.z = a[m].x * p),
6055          f.push(j.x, j.y, j.z),
6056          (k.x = l / b),
6057          (k.y = m / (a.length - 1)),
6058          g.push(k.x, k.y)
6059    }
6060    for (l = 0; l < b; l++)
6061      for (m = 0; m < a.length - 1; m++) {
6062        h = m + l * a.length
6063        var q = h,
6064          r = h + a.length,
6065          s = h + a.length + 1,
6066          t = h + 1
6067        e.push(q, r, t), e.push(r, s, t)
6068      }
6069    if (
6070      (this.setIndex(e),
6071      this.addAttribute('position', new $e(f, 3)),
6072      this.addAttribute('uv', new $e(g, 2)),
6073      this.computeVertexNormals(),
6074      d === 2 * Math.PI)
6075    ) {
6076      var u = this.attributes.normal.array,
6077        v = new Bb(),
6078        w = new Bb(),
6079        x = new Bb()
6080      for (h = b * a.length * 3, l = 0, m = 0; l < a.length; l++, m += 3)
6081        (v.x = u[m + 0]),
6082          (v.y = u[m + 1]),
6083          (v.z = u[m + 2]),
6084          (w.x = u[h + m + 0]),
6085          (w.y = u[h + m + 1]),
6086          (w.z = u[h + m + 2]),
6087          x.addVectors(v, w).normalize(),
6088          (u[m + 0] = u[h + m + 0] = x.x),
6089          (u[m + 1] = u[h + m + 1] = x.y),
6090          (u[m + 2] = u[h + m + 2] = x.z)
6091    }
6092  }
6093  function Lg(a, b) {
6094    ef.call(this),
6095      (this.type = 'ShapeGeometry'),
6096      'object' == typeof b &&
6097        (console.warn(
6098          'THREE.ShapeGeometry: Options parameter has been removed.'
6099        ),
6100        (b = b.curveSegments)),
6101      (this.parameters = { shapes: a, curveSegments: b }),
6102      this.fromBufferGeometry(new Mg(a, b)),
6103      this.mergeVertices()
6104  }
6105  function Mg(a, b) {
6106    function j(a) {
6107      var g,
6108        i,
6109        j,
6110        k = d.length / 3,
6111        l = a.extractPoints(b),
6112        m = l.shape,
6113        n = l.holes
6114      if (Cg.isClockWise(m) === !1)
6115        for (m = m.reverse(), g = 0, i = n.length; g < i; g++)
6116          (j = n[g]), Cg.isClockWise(j) === !0 && (n[g] = j.reverse())
6117      var o = Cg.triangulateShape(m, n)
6118      for (g = 0, i = n.length; g < i; g++) (j = n[g]), (m = m.concat(j))
6119      for (g = 0, i = m.length; g < i; g++) {
6120        var p = m[g]
6121        d.push(p.x, p.y, 0), e.push(0, 0, 1), f.push(p.x, p.y)
6122      }
6123      for (g = 0, i = o.length; g < i; g++) {
6124        var q = o[g],
6125          r = q[0] + k,
6126          s = q[1] + k,
6127          t = q[2] + k
6128        c.push(r, s, t), (h += 3)
6129      }
6130    }
6131    ff.call(this),
6132      (this.type = 'ShapeBufferGeometry'),
6133      (this.parameters = { shapes: a, curveSegments: b }),
6134      (b = b || 12)
6135    var c = [],
6136      d = [],
6137      e = [],
6138      f = [],
6139      g = 0,
6140      h = 0
6141    if (Array.isArray(a) === !1) j(a)
6142    else
6143      for (var i = 0; i < a.length; i++)
6144        j(a[i]), this.addGroup(g, h, i), (g += h), (h = 0)
6145    this.setIndex(c),
6146      this.addAttribute('position', new $e(d, 3)),
6147      this.addAttribute('normal', new $e(e, 3)),
6148      this.addAttribute('uv', new $e(f, 2))
6149  }
6150  function Ng(a, b) {
6151    function r(a, b) {
6152      return a - b
6153    }
6154    ff.call(this),
6155      (this.type = 'EdgesGeometry'),
6156      (this.parameters = { thresholdAngle: b }),
6157      (b = void 0 !== b ? b : 1)
6158    var g,
6159      i,
6160      c = [],
6161      d = Math.cos(tb.DEG2RAD * b),
6162      e = [0, 0],
6163      f = {},
6164      h = ['a', 'b', 'c']
6165    a.isBufferGeometry
6166      ? ((i = new ef()), i.fromBufferGeometry(a))
6167      : (i = a.clone()),
6168      i.mergeVertices(),
6169      i.computeFaceNormals()
6170    for (var j = i.vertices, k = i.faces, l = 0, m = k.length; l < m; l++)
6171      for (var n = k[l], o = 0; o < 3; o++)
6172        (e[0] = n[h[o]]),
6173          (e[1] = n[h[(o + 1) % 3]]),
6174          e.sort(r),
6175          (g = e.toString()),
6176          void 0 === f[g]
6177            ? (f[g] = { index1: e[0], index2: e[1], face1: l, face2: void 0 })
6178            : (f[g].face2 = l)
6179    for (g in f) {
6180      var p = f[g]
6181      if (void 0 === p.face2 || k[p.face1].normal.dot(k[p.face2].normal) <= d) {
6182        var q = j[p.index1]
6183        c.push(q.x, q.y, q.z), (q = j[p.index2]), c.push(q.x, q.y, q.z)
6184      }
6185    }
6186    this.addAttribute('position', new $e(c, 3))
6187  }
6188  function Og(a, b, c, d, e, f, g, h) {
6189    ef.call(this),
6190      (this.type = 'CylinderGeometry'),
6191      (this.parameters = {
6192        radiusTop: a,
6193        radiusBottom: b,
6194        height: c,
6195        radialSegments: d,
6196        heightSegments: e,
6197        openEnded: f,
6198        thetaStart: g,
6199        thetaLength: h
6200      }),
6201      this.fromBufferGeometry(new Pg(a, b, c, d, e, f, g, h)),
6202      this.mergeVertices()
6203  }
6204  function Pg(a, b, c, d, e, f, g, h) {
6205    function s() {
6206      var f,
6207        o,
6208        s = new Bb(),
6209        t = new Bb(),
6210        u = 0,
6211        v = (b - a) / c
6212      for (o = 0; o <= e; o++) {
6213        var w = [],
6214          x = o / e,
6215          y = x * (b - a) + a
6216        for (f = 0; f <= d; f++) {
6217          var z = f / d,
6218            A = z * h + g,
6219            B = Math.sin(A),
6220            C = Math.cos(A)
6221          ;(t.x = y * B),
6222            (t.y = -x * c + q),
6223            (t.z = y * C),
6224            k.push(t.x, t.y, t.z),
6225            s.set(B, v, C).normalize(),
6226            l.push(s.x, s.y, s.z),
6227            m.push(z, 1 - x),
6228            w.push(n++)
6229        }
6230        p.push(w)
6231      }
6232      for (f = 0; f < d; f++)
6233        for (o = 0; o < e; o++) {
6234          var D = p[o][f],
6235            E = p[o + 1][f],
6236            F = p[o + 1][f + 1],
6237            G = p[o][f + 1]
6238          j.push(D, E, G), j.push(E, F, G), (u += 6)
6239        }
6240      i.addGroup(r, u, 0), (r += u)
6241    }
6242    function t(c) {
6243      var e,
6244        f,
6245        o,
6246        p = new ub(),
6247        s = new Bb(),
6248        t = 0,
6249        u = c === !0 ? a : b,
6250        v = c === !0 ? 1 : -1
6251      for (f = n, e = 1; e <= d; e++)
6252        k.push(0, q * v, 0), l.push(0, v, 0), m.push(0.5, 0.5), n++
6253      for (o = n, e = 0; e <= d; e++) {
6254        var w = e / d,
6255          x = w * h + g,
6256          y = Math.cos(x),
6257          z = Math.sin(x)
6258        ;(s.x = u * z),
6259          (s.y = q * v),
6260          (s.z = u * y),
6261          k.push(s.x, s.y, s.z),
6262          l.push(0, v, 0),
6263          (p.x = 0.5 * y + 0.5),
6264          (p.y = 0.5 * z * v + 0.5),
6265          m.push(p.x, p.y),
6266          n++
6267      }
6268      for (e = 0; e < d; e++) {
6269        var A = f + e,
6270          B = o + e
6271        c === !0 ? j.push(B, B + 1, A) : j.push(B + 1, B, A), (t += 3)
6272      }
6273      i.addGroup(r, t, c === !0 ? 1 : 2), (r += t)
6274    }
6275    ff.call(this),
6276      (this.type = 'CylinderBufferGeometry'),
6277      (this.parameters = {
6278        radiusTop: a,
6279        radiusBottom: b,
6280        height: c,
6281        radialSegments: d,
6282        heightSegments: e,
6283        openEnded: f,
6284        thetaStart: g,
6285        thetaLength: h
6286      })
6287    var i = this
6288    ;(a = void 0 !== a ? a : 20),
6289      (b = void 0 !== b ? b : 20),
6290      (c = void 0 !== c ? c : 100),
6291      (d = Math.floor(d) || 8),
6292      (e = Math.floor(e) || 1),
6293      (f = void 0 !== f && f),
6294      (g = void 0 !== g ? g : 0),
6295      (h = void 0 !== h ? h : 2 * Math.PI)
6296    var j = [],
6297      k = [],
6298      l = [],
6299      m = [],
6300      n = 0,
6301      p = [],
6302      q = c / 2,
6303      r = 0
6304    s(),
6305      f === !1 && (a > 0 && t(!0), b > 0 && t(!1)),
6306      this.setIndex(j),
6307      this.addAttribute('position', new $e(k, 3)),
6308      this.addAttribute('normal', new $e(l, 3)),
6309      this.addAttribute('uv', new $e(m, 2))
6310  }
6311  function Qg(a, b, c, d, e, f, g) {
6312    Og.call(this, 0, a, b, c, d, e, f, g),
6313      (this.type = 'ConeGeometry'),
6314      (this.parameters = {
6315        radius: a,
6316        height: b,
6317        radialSegments: c,
6318        heightSegments: d,
6319        openEnded: e,
6320        thetaStart: f,
6321        thetaLength: g
6322      })
6323  }
6324  function Rg(a, b, c, d, e, f, g) {
6325    Pg.call(this, 0, a, b, c, d, e, f, g),
6326      (this.type = 'ConeBufferGeometry'),
6327      (this.parameters = {
6328        radius: a,
6329        height: b,
6330        radialSegments: c,
6331        heightSegments: d,
6332        openEnded: e,
6333        thetaStart: f,
6334        thetaLength: g
6335      })
6336  }
6337  function Sg(a, b, c, d) {
6338    ef.call(this),
6339      (this.type = 'CircleGeometry'),
6340      (this.parameters = {
6341        radius: a,
6342        segments: b,
6343        thetaStart: c,
6344        thetaLength: d
6345      }),
6346      this.fromBufferGeometry(new Tg(a, b, c, d))
6347  }
6348  function Tg(a, b, c, d) {
6349    ff.call(this),
6350      (this.type = 'CircleBufferGeometry'),
6351      (this.parameters = {
6352        radius: a,
6353        segments: b,
6354        thetaStart: c,
6355        thetaLength: d
6356      }),
6357      (a = a || 50),
6358      (b = void 0 !== b ? Math.max(3, b) : 8),
6359      (c = void 0 !== c ? c : 0),
6360      (d = void 0 !== d ? d : 2 * Math.PI)
6361    var i,
6362      j,
6363      e = [],
6364      f = [],
6365      g = [],
6366      h = [],
6367      k = new Bb(),
6368      l = new ub()
6369    for (
6370      f.push(0, 0, 0), g.push(0, 0, 1), h.push(0.5, 0.5), j = 0, i = 3;
6371      j <= b;
6372      j++, i += 3
6373    ) {
6374      var m = c + (j / b) * d
6375      ;(k.x = a * Math.cos(m)),
6376        (k.y = a * Math.sin(m)),
6377        f.push(k.x, k.y, k.z),
6378        g.push(0, 0, 1),
6379        (l.x = (f[i] / a + 1) / 2),
6380        (l.y = (f[i + 1] / a + 1) / 2),
6381        h.push(l.x, l.y)
6382    }
6383    for (i = 1; i <= b; i++) e.push(i, i + 1, 0)
6384    this.setIndex(e),
6385      this.addAttribute('position', new $e(f, 3)),
6386      this.addAttribute('normal', new $e(g, 3)),
6387      this.addAttribute('uv', new $e(h, 2))
6388  }
6389  function Vg() {
6390    Be.call(this, {
6391      uniforms: pc.merge([ue.lights, { opacity: { value: 1 } }]),
6392      vertexShader: qe.shadow_vert,
6393      fragmentShader: qe.shadow_frag
6394    }),
6395      (this.lights = !0),
6396      (this.transparent = !0),
6397      Object.defineProperties(this, {
6398        opacity: {
6399          enumerable: !0,
6400          get: function () {
6401            return this.uniforms.opacity.value
6402          },
6403          set: function (a) {
6404            this.uniforms.opacity.value = a
6405          }
6406        }
6407      })
6408  }
6409  function Wg(a) {
6410    Be.call(this, a), (this.type = 'RawShaderMaterial')
6411  }
6412  function Xg(a) {
6413    ;(this.uuid = tb.generateUUID()),
6414      (this.type = 'MultiMaterial'),
6415      (this.materials = Array.isArray(a) ? a : []),
6416      (this.visible = !0)
6417  }
6418  function Yg(a) {
6419    Ae.call(this),
6420      (this.defines = { STANDARD: '' }),
6421      (this.type = 'MeshStandardMaterial'),
6422      (this.color = new re(16777215)),
6423      (this.roughness = 0.5),
6424      (this.metalness = 0.5),
6425      (this.map = null),
6426      (this.lightMap = null),
6427      (this.lightMapIntensity = 1),
6428      (this.aoMap = null),
6429      (this.aoMapIntensity = 1),
6430      (this.emissive = new re(0)),
6431      (this.emissiveIntensity = 1),
6432      (this.emissiveMap = null),
6433      (this.bumpMap = null),
6434      (this.bumpScale = 1),
6435      (this.normalMap = null),
6436      (this.normalScale = new ub(1, 1)),
6437      (this.displacementMap = null),
6438      (this.displacementScale = 1),
6439      (this.displacementBias = 0),
6440      (this.roughnessMap = null),
6441      (this.metalnessMap = null),
6442      (this.alphaMap = null),
6443      (this.envMap = null),
6444      (this.envMapIntensity = 1),
6445      (this.refractionRatio = 0.98),
6446      (this.wireframe = !1),
6447      (this.wireframeLinewidth = 1),
6448      (this.wireframeLinecap = 'round'),
6449      (this.wireframeLinejoin = 'round'),
6450      (this.skinning = !1),
6451      (this.morphTargets = !1),
6452      (this.morphNormals = !1),
6453      this.setValues(a)
6454  }
6455  function Zg(a) {
6456    Yg.call(this),
6457      (this.defines = { PHYSICAL: '' }),
6458      (this.type = 'MeshPhysicalMaterial'),
6459      (this.reflectivity = 0.5),
6460      (this.clearCoat = 0),
6461      (this.clearCoatRoughness = 0),
6462      this.setValues(a)
6463  }
6464  function $g(a) {
6465    Ae.call(this),
6466      (this.type = 'MeshPhongMaterial'),
6467      (this.color = new re(16777215)),
6468      (this.specular = new re(1118481)),
6469      (this.shininess = 30),
6470      (this.map = null),
6471      (this.lightMap = null),
6472      (this.lightMapIntensity = 1),
6473      (this.aoMap = null),
6474      (this.aoMapIntensity = 1),
6475      (this.emissive = new re(0)),
6476      (this.emissiveIntensity = 1),
6477      (this.emissiveMap = null),
6478      (this.bumpMap = null),
6479      (this.bumpScale = 1),
6480      (this.normalMap = null),
6481      (this.normalScale = new ub(1, 1)),
6482      (this.displacementMap = null),
6483      (this.displacementScale = 1),
6484      (this.displacementBias = 0),
6485      (this.specularMap = null),
6486      (this.alphaMap = null),
6487      (this.envMap = null),
6488      (this.combine = Z),
6489      (this.reflectivity = 1),
6490      (this.refractionRatio = 0.98),
6491      (this.wireframe = !1),
6492      (this.wireframeLinewidth = 1),
6493      (this.wireframeLinecap = 'round'),
6494      (this.wireframeLinejoin = 'round'),
6495      (this.skinning = !1),
6496      (this.morphTargets = !1),
6497      (this.morphNormals = !1),
6498      this.setValues(a)
6499  }
6500  function _g(a) {
6501    $g.call(this),
6502      (this.defines = { TOON: '' }),
6503      (this.type = 'MeshToonMaterial'),
6504      (this.gradientMap = null),
6505      this.setValues(a)
6506  }
6507  function ah(a) {
6508    Ae.call(this, a),
6509      (this.type = 'MeshNormalMaterial'),
6510      (this.bumpMap = null),
6511      (this.bumpScale = 1),
6512      (this.normalMap = null),
6513      (this.normalScale = new ub(1, 1)),
6514      (this.displacementMap = null),
6515      (this.displacementScale = 1),
6516      (this.displacementBias = 0),
6517      (this.wireframe = !1),
6518      (this.wireframeLinewidth = 1),
6519      (this.fog = !1),
6520      (this.lights = !1),
6521      (this.skinning = !1),
6522      (this.morphTargets = !1),
6523      (this.morphNormals = !1),
6524      this.setValues(a)
6525  }
6526  function bh(a) {
6527    Ae.call(this),
6528      (this.type = 'MeshLambertMaterial'),
6529      (this.color = new re(16777215)),
6530      (this.map = null),
6531      (this.lightMap = null),
6532      (this.lightMapIntensity = 1),
6533      (this.aoMap = null),
6534      (this.aoMapIntensity = 1),
6535      (this.emissive = new re(0)),
6536      (this.emissiveIntensity = 1),
6537      (this.emissiveMap = null),
6538      (this.specularMap = null),
6539      (this.alphaMap = null),
6540      (this.envMap = null),
6541      (this.combine = Z),
6542      (this.reflectivity = 1),
6543      (this.refractionRatio = 0.98),
6544      (this.wireframe = !1),
6545      (this.wireframeLinewidth = 1),
6546      (this.wireframeLinecap = 'round'),
6547      (this.wireframeLinejoin = 'round'),
6548      (this.skinning = !1),
6549      (this.morphTargets = !1),
6550      (this.morphNormals = !1),
6551      this.setValues(a)
6552  }
6553  function ch(a) {
6554    Ae.call(this),
6555      (this.type = 'LineDashedMaterial'),
6556      (this.color = new re(16777215)),
6557      (this.linewidth = 1),
6558      (this.scale = 1),
6559      (this.dashSize = 3),
6560      (this.gapSize = 1),
6561      (this.lights = !1),
6562      this.setValues(a)
6563  }
6564  function fh(a, b, c) {
6565    var d = this,
6566      e = !1,
6567      f = 0,
6568      g = 0
6569    ;(this.onStart = void 0),
6570      (this.onLoad = a),
6571      (this.onProgress = b),
6572      (this.onError = c),
6573      (this.itemStart = function (a) {
6574        g++, e === !1 && void 0 !== d.onStart && d.onStart(a, f, g), (e = !0)
6575      }),
6576      (this.itemEnd = function (a) {
6577        f++,
6578          void 0 !== d.onProgress && d.onProgress(a, f, g),
6579          f === g && ((e = !1), void 0 !== d.onLoad && d.onLoad())
6580      }),
6581      (this.itemError = function (a) {
6582        void 0 !== d.onError && d.onError(a)
6583      })
6584  }
6585  function hh(a) {
6586    this.manager = void 0 !== a ? a : gh
6587  }
6588  function ih(a) {
6589    ;(this.manager = void 0 !== a ? a : gh), (this._parser = null)
6590  }
6591  function jh(a) {
6592    ;(this.manager = void 0 !== a ? a : gh), (this._parser = null)
6593  }
6594  function kh(a) {
6595    this.manager = void 0 !== a ? a : gh
6596  }
6597  function lh(a) {
6598    this.manager = void 0 !== a ? a : gh
6599  }
6600  function mh(a) {
6601    this.manager = void 0 !== a ? a : gh
6602  }
6603  function nh(a, b) {
6604    Ne.call(this),
6605      (this.type = 'Light'),
6606      (this.color = new re(a)),
6607      (this.intensity = void 0 !== b ? b : 1),
6608      (this.receiveShadow = void 0)
6609  }
6610  function oh(a, b, c) {
6611    nh.call(this, a, c),
6612      (this.type = 'HemisphereLight'),
6613      (this.castShadow = void 0),
6614      this.position.copy(Ne.DefaultUp),
6615      this.updateMatrix(),
6616      (this.groundColor = new re(b))
6617  }
6618  function ph(a) {
6619    ;(this.camera = a),
6620      (this.bias = 0),
6621      (this.radius = 1),
6622      (this.mapSize = new ub(512, 512)),
6623      (this.map = null),
6624      (this.matrix = new Cb())
6625  }
6626  function qh() {
6627    ph.call(this, new nf(50, 1, 0.5, 500))
6628  }
6629  function rh(a, b, c, d, e, f) {
6630    nh.call(this, a, b),
6631      (this.type = 'SpotLight'),
6632      this.position.copy(Ne.DefaultUp),
6633      this.updateMatrix(),
6634      (this.target = new Ne()),
6635      Object.defineProperty(this, 'power', {
6636        get: function () {
6637          return this.intensity * Math.PI
6638        },
6639        set: function (a) {
6640          this.intensity = a / Math.PI
6641        }
6642      }),
6643      (this.distance = void 0 !== c ? c : 0),
6644      (this.angle = void 0 !== d ? d : Math.PI / 3),
6645      (this.penumbra = void 0 !== e ? e : 0),
6646      (this.decay = void 0 !== f ? f : 1),
6647      (this.shadow = new qh())
6648  }
6649  function sh(a, b, c, d) {
6650    nh.call(this, a, b),
6651      (this.type = 'PointLight'),
6652      Object.defineProperty(this, 'power', {
6653        get: function () {
6654          return 4 * this.intensity * Math.PI
6655        },
6656        set: function (a) {
6657          this.intensity = a / (4 * Math.PI)
6658        }
6659      }),
6660      (this.distance = void 0 !== c ? c : 0),
6661      (this.decay = void 0 !== d ? d : 1),
6662      (this.shadow = new ph(new nf(90, 1, 0.5, 500)))
6663  }
6664  function th() {
6665    ph.call(this, new of(-5, 5, 5, -5, 0.5, 500))
6666  }
6667  function uh(a, b) {
6668    nh.call(this, a, b),
6669      (this.type = 'DirectionalLight'),
6670      this.position.copy(Ne.DefaultUp),
6671      this.updateMatrix(),
6672      (this.target = new Ne()),
6673      (this.shadow = new th())
6674  }
6675  function vh(a, b) {
6676    nh.call(this, a, b),
6677      (this.type = 'AmbientLight'),
6678      (this.castShadow = void 0)
6679  }
6680  function xh(a, b, c, d) {
6681    ;(this.parameterPositions = a),
6682      (this._cachedIndex = 0),
6683      (this.resultBuffer = void 0 !== d ? d : new b.constructor(c)),
6684      (this.sampleValues = b),
6685      (this.valueSize = c)
6686  }
6687  function yh(a, b, c, d) {
6688    xh.call(this, a, b, c, d),
6689      (this._weightPrev = -0),
6690      (this._offsetPrev = -0),
6691      (this._weightNext = -0),
6692      (this._offsetNext = -0)
6693  }
6694  function zh(a, b, c, d) {
6695    xh.call(this, a, b, c, d)
6696  }
6697  function Ah(a, b, c, d) {
6698    xh.call(this, a, b, c, d)
6699  }
6700  function Ch(a, b, c, d) {
6701    if (void 0 === a) throw new Error('track name is undefined')
6702    if (void 0 === b || 0 === b.length)
6703      throw new Error('no keyframes in track named ' + a)
6704    ;(this.name = a),
6705      (this.times = wh.convertArray(b, this.TimeBufferType)),
6706      (this.values = wh.convertArray(c, this.ValueBufferType)),
6707      this.setInterpolation(d || this.DefaultInterpolation),
6708      this.validate(),
6709      this.optimize()
6710  }
6711  function Dh(a, b, c, d) {
6712    Ch.call(this, a, b, c, d)
6713  }
6714  function Eh(a, b, c, d) {
6715    xh.call(this, a, b, c, d)
6716  }
6717  function Fh(a, b, c, d) {
6718    Ch.call(this, a, b, c, d)
6719  }
6720  function Gh(a, b, c, d) {
6721    Ch.call(this, a, b, c, d)
6722  }
6723  function Hh(a, b, c, d) {
6724    Ch.call(this, a, b, c, d)
6725  }
6726  function Ih(a, b, c) {
6727    Ch.call(this, a, b, c)
6728  }
6729  function Jh(a, b, c, d) {
6730    Ch.call(this, a, b, c, d)
6731  }
6732  function Kh(a, b, c, d) {
6733    Ch.apply(this, arguments)
6734  }
6735  function Lh(a, b, c) {
6736    ;(this.name = a),
6737      (this.tracks = c),
6738      (this.duration = void 0 !== b ? b : -1),
6739      (this.uuid = tb.generateUUID()),
6740      this.duration < 0 && this.resetDuration(),
6741      this.optimize()
6742  }
6743  function Mh(a) {
6744    ;(this.manager = void 0 !== a ? a : gh), (this.textures = {})
6745  }
6746  function Nh(a) {
6747    this.manager = void 0 !== a ? a : gh
6748  }
6749  function Oh() {
6750    ;(this.onLoadStart = function () {}),
6751      (this.onLoadProgress = function () {}),
6752      (this.onLoadComplete = function () {})
6753  }
6754  function Ph(a) {
6755    'boolean' == typeof a &&
6756      (console.warn(
6757        'THREE.JSONLoader: showStatus parameter has been removed from constructor.'
6758      ),
6759      (a = void 0)),
6760      (this.manager = void 0 !== a ? a : gh),
6761      (this.withCredentials = !1)
6762  }
6763  function Qh(a) {
6764    ;(this.manager = void 0 !== a ? a : gh), (this.texturePath = '')
6765  }
6766  function Rh(a, b, c, d, e) {
6767    var f = 0.5 * (d - b),
6768      g = 0.5 * (e - c),
6769      h = a * a,
6770      i = a * h
6771    return (
6772      (2 * c - 2 * d + f + g) * i + (-3 * c + 3 * d - 2 * f - g) * h + f * a + c
6773    )
6774  }
6775  function Sh(a, b) {
6776    var c = 1 - a
6777    return c * c * b
6778  }
6779  function Th(a, b) {
6780    return 2 * (1 - a) * a * b
6781  }
6782  function Uh(a, b) {
6783    return a * a * b
6784  }
6785  function Vh(a, b, c, d) {
6786    return Sh(a, b) + Th(a, c) + Uh(a, d)
6787  }
6788  function Wh(a, b) {
6789    var c = 1 - a
6790    return c * c * c * b
6791  }
6792  function Xh(a, b) {
6793    var c = 1 - a
6794    return 3 * c * c * a * b
6795  }
6796  function Yh(a, b) {
6797    return 3 * (1 - a) * a * a * b
6798  }
6799  function Zh(a, b) {
6800    return a * a * a * b
6801  }
6802  function $h(a, b, c, d, e) {
6803    return Wh(a, b) + Xh(a, c) + Yh(a, d) + Zh(a, e)
6804  }
6805  function _h() {}
6806  function ai(a, b) {
6807    ;(this.v1 = a), (this.v2 = b)
6808  }
6809  function bi() {
6810    ;(this.curves = []), (this.autoClose = !1)
6811  }
6812  function ci(a, b, c, d, e, f, g, h) {
6813    ;(this.aX = a),
6814      (this.aY = b),
6815      (this.xRadius = c),
6816      (this.yRadius = d),
6817      (this.aStartAngle = e),
6818      (this.aEndAngle = f),
6819      (this.aClockwise = g),
6820      (this.aRotation = h || 0)
6821  }
6822  function di(a) {
6823    this.points = void 0 === a ? [] : a
6824  }
6825  function ei(a, b, c, d) {
6826    ;(this.v0 = a), (this.v1 = b), (this.v2 = c), (this.v3 = d)
6827  }
6828  function fi(a, b, c) {
6829    ;(this.v0 = a), (this.v1 = b), (this.v2 = c)
6830  }
6831  function hi(a) {
6832    bi.call(this), (this.currentPoint = new ub()), a && this.fromPoints(a)
6833  }
6834  function ii() {
6835    hi.apply(this, arguments), (this.holes = [])
6836  }
6837  function ji() {
6838    ;(this.subPaths = []), (this.currentPath = null)
6839  }
6840  function ki(a) {
6841    this.data = a
6842  }
6843  function li(a) {
6844    this.manager = void 0 !== a ? a : gh
6845  }
6846  function oi(a) {
6847    this.manager = void 0 !== a ? a : gh
6848  }
6849  function pi(a, b, c, d) {
6850    nh.call(this, a, b),
6851      (this.type = 'RectAreaLight'),
6852      this.position.set(0, 1, 0),
6853      this.updateMatrix(),
6854      (this.width = void 0 !== c ? c : 10),
6855      (this.height = void 0 !== d ? d : 10)
6856  }
6857  function qi() {
6858    ;(this.type = 'StereoCamera'),
6859      (this.aspect = 1),
6860      (this.eyeSep = 0.064),
6861      (this.cameraL = new nf()),
6862      this.cameraL.layers.enable(1),
6863      (this.cameraL.matrixAutoUpdate = !1),
6864      (this.cameraR = new nf()),
6865      this.cameraR.layers.enable(2),
6866      (this.cameraR.matrixAutoUpdate = !1)
6867  }
6868  function ri(a, b, c) {
6869    Ne.call(this), (this.type = 'CubeCamera')
6870    var d = 90,
6871      e = 1,
6872      f = new nf(d, e, a, b)
6873    f.up.set(0, -1, 0), f.lookAt(new Bb(1, 0, 0)), this.add(f)
6874    var g = new nf(d, e, a, b)
6875    g.up.set(0, -1, 0), g.lookAt(new Bb(-1, 0, 0)), this.add(g)
6876    var h = new nf(d, e, a, b)
6877    h.up.set(0, 0, 1), h.lookAt(new Bb(0, 1, 0)), this.add(h)
6878    var i = new nf(d, e, a, b)
6879    i.up.set(0, 0, -1), i.lookAt(new Bb(0, -1, 0)), this.add(i)
6880    var j = new nf(d, e, a, b)
6881    j.up.set(0, -1, 0), j.lookAt(new Bb(0, 0, 1)), this.add(j)
6882    var k = new nf(d, e, a, b)
6883    k.up.set(0, -1, 0), k.lookAt(new Bb(0, 0, -1)), this.add(k)
6884    var l = { format: Ja, magFilter: ta, minFilter: ta }
6885    ;(this.renderTarget = new zb(c, c, l)),
6886      (this.updateCubeMap = function (a, b) {
6887        null === this.parent && this.updateMatrixWorld()
6888        var c = this.renderTarget,
6889          d = c.texture.generateMipmaps
6890        ;(c.texture.generateMipmaps = !1),
6891          (c.activeCubeFace = 0),
6892          a.render(b, f, c),
6893          (c.activeCubeFace = 1),
6894          a.render(b, g, c),
6895          (c.activeCubeFace = 2),
6896          a.render(b, h, c),
6897          (c.activeCubeFace = 3),
6898          a.render(b, i, c),
6899          (c.activeCubeFace = 4),
6900          a.render(b, j, c),
6901          (c.texture.generateMipmaps = d),
6902          (c.activeCubeFace = 5),
6903          a.render(b, k, c),
6904          a.setRenderTarget(null)
6905      })
6906  }
6907  function si() {
6908    Ne.call(this),
6909      (this.type = 'AudioListener'),
6910      (this.context = ni.getContext()),
6911      (this.gain = this.context.createGain()),
6912      this.gain.connect(this.context.destination),
6913      (this.filter = null)
6914  }
6915  function ti(a) {
6916    Ne.call(this),
6917      (this.type = 'Audio'),
6918      (this.context = a.context),
6919      (this.gain = this.context.createGain()),
6920      this.gain.connect(a.getInput()),
6921      (this.autoplay = !1),
6922      (this.buffer = null),
6923      (this.loop = !1),
6924      (this.startTime = 0),
6925      (this.playbackRate = 1),
6926      (this.isPlaying = !1),
6927      (this.hasPlaybackControl = !0),
6928      (this.sourceType = 'empty'),
6929      (this.filters = [])
6930  }
6931  function ui(a) {
6932    ti.call(this, a),
6933      (this.panner = this.context.createPanner()),
6934      this.panner.connect(this.gain)
6935  }
6936  function vi(a, b) {
6937    ;(this.analyser = a.context.createAnalyser()),
6938      (this.analyser.fftSize = void 0 !== b ? b : 2048),
6939      (this.data = new Uint8Array(this.analyser.frequencyBinCount)),
6940      a.getOutput().connect(this.analyser)
6941  }
6942  function wi(a, b, c) {
6943    ;(this.binding = a), (this.valueSize = c)
6944    var e,
6945      d = Float64Array
6946    switch (b) {
6947      case 'quaternion':
6948        e = this._slerp
6949        break
6950      case 'string':
6951      case 'bool':
6952        ;(d = Array), (e = this._select)
6953        break
6954      default:
6955        e = this._lerp
6956    }
6957    ;(this.buffer = new d(4 * c)),
6958      (this._mixBufferRegion = e),
6959      (this.cumulativeWeight = 0),
6960      (this.useCount = 0),
6961      (this.referenceCount = 0)
6962  }
6963  function xi(a, b, c) {
6964    ;(this.path = b),
6965      (this.parsedPath = c || xi.parseTrackName(b)),
6966      (this.node = xi.findNode(a, this.parsedPath.nodeName) || a),
6967      (this.rootNode = a)
6968  }
6969  function yi(a) {
6970    ;(this.uuid = tb.generateUUID()),
6971      (this._objects = Array.prototype.slice.call(arguments)),
6972      (this.nCachedObjects_ = 0)
6973    var b = {}
6974    this._indicesByUUID = b
6975    for (var c = 0, d = arguments.length; c !== d; ++c) b[arguments[c].uuid] = c
6976    ;(this._paths = []),
6977      (this._parsedPaths = []),
6978      (this._bindings = []),
6979      (this._bindingsIndicesByPath = {})
6980    var e = this
6981    this.stats = {
6982      objects: {
6983        get total() {
6984          return e._objects.length
6985        },
6986        get inUse() {
6987          return this.total - e.nCachedObjects_
6988        }
6989      },
6990      get bindingsPerObject() {
6991        return e._bindings.length
6992      }
6993    }
6994  }
6995  function zi(a, b, c) {
6996    ;(this._mixer = a), (this._clip = b), (this._localRoot = c || null)
6997    for (
6998      var d = b.tracks,
6999        e = d.length,
7000        f = new Array(e),
7001        g = { endingStart: db, endingEnd: db },
7002        h = 0;
7003      h !== e;
7004      ++h
7005    ) {
7006      var i = d[h].createInterpolant(null)
7007      ;(f[h] = i), (i.settings = g)
7008    }
7009    ;(this._interpolantSettings = g),
7010      (this._interpolants = f),
7011      (this._propertyBindings = new Array(e)),
7012      (this._cacheIndex = null),
7013      (this._byClipCacheIndex = null),
7014      (this._timeScaleInterpolant = null),
7015      (this._weightInterpolant = null),
7016      (this.loop = $a),
7017      (this._loopCount = -1),
7018      (this._startTime = null),
7019      (this.time = 0),
7020      (this.timeScale = 1),
7021      (this._effectiveTimeScale = 1),
7022      (this.weight = 1),
7023      (this._effectiveWeight = 1),
7024      (this.repetitions = 1 / 0),
7025      (this.paused = !1),
7026      (this.enabled = !0),
7027      (this.clampWhenFinished = !1),
7028      (this.zeroSlopeAtStart = !0),
7029      (this.zeroSlopeAtEnd = !0)
7030  }
7031  function Ai(a) {
7032    ;(this._root = a),
7033      this._initMemoryManager(),
7034      (this._accuIndex = 0),
7035      (this.time = 0),
7036      (this.timeScale = 1)
7037  }
7038  function Bi(a) {
7039    'string' == typeof a &&
7040      (console.warn('THREE.Uniform: Type parameter is no longer needed.'),
7041      (a = arguments[1])),
7042      (this.value = a)
7043  }
7044  function Ci() {
7045    ff.call(this),
7046      (this.type = 'InstancedBufferGeometry'),
7047      (this.maxInstancedCount = void 0)
7048  }
7049  function Di(a, b, c, d) {
7050    ;(this.uuid = tb.generateUUID()),
7051      (this.data = a),
7052      (this.itemSize = b),
7053      (this.offset = c),
7054      (this.normalized = d === !0)
7055  }
7056  function Ei(a, b) {
7057    ;(this.uuid = tb.generateUUID()),
7058      (this.array = a),
7059      (this.stride = b),
7060      (this.count = void 0 !== a ? a.length / b : 0),
7061      (this.dynamic = !1),
7062      (this.updateRange = { offset: 0, count: -1 }),
7063      (this.onUploadCallback = function () {}),
7064      (this.version = 0)
7065  }
7066  function Fi(a, b, c) {
7067    Ei.call(this, a, b), (this.meshPerAttribute = c || 1)
7068  }
7069  function Gi(a, b, c) {
7070    Se.call(this, a, b), (this.meshPerAttribute = c || 1)
7071  }
7072  function Hi(a, b, c, d) {
7073    ;(this.ray = new Je(a, b)),
7074      (this.near = c || 0),
7075      (this.far = d || 1 / 0),
7076      (this.params = {
7077        Mesh: {},
7078        Line: {},
7079        LOD: {},
7080        Points: { threshold: 1 },
7081        Sprite: {}
7082      }),
7083      Object.defineProperties(this.params, {
7084        PointCloud: {
7085          get: function () {
7086            return (
7087              console.warn(
7088                'THREE.Raycaster: params.PointCloud has been renamed to params.Points.'
7089              ),
7090              this.Points
7091            )
7092          }
7093        }
7094      })
7095  }
7096  function Ii(a, b) {
7097    return a.distance - b.distance
7098  }
7099  function Ji(a, b, c, d) {
7100    if (a.visible !== !1 && (a.raycast(b, c), d === !0))
7101      for (var e = a.children, f = 0, g = e.length; f < g; f++)
7102        Ji(e[f], b, c, !0)
7103  }
7104  function Ki(a) {
7105    ;(this.autoStart = void 0 === a || a),
7106      (this.startTime = 0),
7107      (this.oldTime = 0),
7108      (this.elapsedTime = 0),
7109      (this.running = !1)
7110  }
7111  function Li(a, b, c) {
7112    return (
7113      (this.radius = void 0 !== a ? a : 1),
7114      (this.phi = void 0 !== b ? b : 0),
7115      (this.theta = void 0 !== c ? c : 0),
7116      this
7117    )
7118  }
7119  function Mi(a, b, c) {
7120    return (
7121      (this.radius = void 0 !== a ? a : 1),
7122      (this.theta = void 0 !== b ? b : 0),
7123      (this.y = void 0 !== c ? c : 0),
7124      this
7125    )
7126  }
7127  function Ni(a, b) {
7128    gf.call(this, a, b), (this.animationsMap = {}), (this.animationsList = [])
7129    var c = this.geometry.morphTargets.length,
7130      d = '__default',
7131      e = 0,
7132      f = c - 1,
7133      g = c / 1
7134    this.createAnimation(d, e, f, g), this.setAnimationWeight(d, 1)
7135  }
7136  function Oi(a) {
7137    Ne.call(this), (this.material = a), (this.render = function (a) {})
7138  }
7139  function Pi(a, b, c, d) {
7140    ;(this.object = a), (this.size = void 0 !== b ? b : 1)
7141    var e = void 0 !== c ? c : 16711680,
7142      f = void 0 !== d ? d : 1,
7143      g = 0,
7144      h = this.object.geometry
7145    h && h.isGeometry
7146      ? (g = 3 * h.faces.length)
7147      : h && h.isBufferGeometry && (g = h.attributes.normal.count)
7148    var i = new ff(),
7149      j = new $e(2 * g * 3, 3)
7150    i.addAttribute('position', j),
7151      bg.call(this, i, new _f({ color: e, linewidth: f })),
7152      (this.matrixAutoUpdate = !1),
7153      this.update()
7154  }
7155  function Qi(a) {
7156    Ne.call(this),
7157      (this.light = a),
7158      this.light.updateMatrixWorld(),
7159      (this.matrix = a.matrixWorld),
7160      (this.matrixAutoUpdate = !1)
7161    for (
7162      var b = new ff(),
7163        c = [
7164          0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 0, 0, 0, -1, 0, 1, 0, 0, 0, 0, 1,
7165          1, 0, 0, 0, 0, -1, 1
7166        ],
7167        d = 0,
7168        e = 1,
7169        f = 32;
7170      d < f;
7171      d++, e++
7172    ) {
7173      var g = (d / f) * Math.PI * 2,
7174        h = (e / f) * Math.PI * 2
7175      c.push(Math.cos(g), Math.sin(g), 1, Math.cos(h), Math.sin(h), 1)
7176    }
7177    b.addAttribute('position', new $e(c, 3))
7178    var i = new _f({ fog: !1 })
7179    ;(this.cone = new bg(b, i)), this.add(this.cone), this.update()
7180  }
7181  function Ri(a) {
7182    this.bones = this.getBoneList(a)
7183    for (
7184      var b = new ff(),
7185        c = [],
7186        d = [],
7187        e = new re(0, 0, 1),
7188        f = new re(0, 1, 0),
7189        g = 0;
7190      g < this.bones.length;
7191      g++
7192    ) {
7193      var h = this.bones[g]
7194      h.parent &&
7195        h.parent.isBone &&
7196        (c.push(0, 0, 0),
7197        c.push(0, 0, 0),
7198        d.push(e.r, e.g, e.b),
7199        d.push(f.r, f.g, f.b))
7200    }
7201    b.addAttribute('position', new $e(c, 3)),
7202      b.addAttribute('color', new $e(d, 3))
7203    var i = new _f({
7204      vertexColors: u,
7205      depthTest: !1,
7206      depthWrite: !1,
7207      transparent: !0
7208    })
7209    bg.call(this, b, i),
7210      (this.root = a),
7211      (this.matrix = a.matrixWorld),
7212      (this.matrixAutoUpdate = !1),
7213      this.update()
7214  }
7215  function Si(a, b) {
7216    ;(this.light = a), this.light.updateMatrixWorld()
7217    var c = new Gg(b, 4, 2),
7218      d = new Re({ wireframe: !0, fog: !1 })
7219    d.color.copy(this.light.color).multiplyScalar(this.light.intensity),
7220      gf.call(this, c, d),
7221      (this.matrix = this.light.matrixWorld),
7222      (this.matrixAutoUpdate = !1)
7223  }
7224  function Ti(a) {
7225    Ne.call(this), (this.light = a), this.light.updateMatrixWorld()
7226    var b = new Re({ color: a.color, fog: !1 }),
7227      c = new Re({ color: a.color, fog: !1, wireframe: !0 }),
7228      d = new ff()
7229    d.addAttribute('position', new Se(new Float32Array(18), 3)),
7230      this.add(new gf(d, b)),
7231      this.add(new gf(d, c)),
7232      this.update()
7233  }
7234  function Ui(a, b) {
7235    Ne.call(this),
7236      (this.light = a),
7237      this.light.updateMatrixWorld(),
7238      (this.matrix = a.matrixWorld),
7239      (this.matrixAutoUpdate = !1)
7240    var c = new rg(b)
7241    c.rotateY(0.5 * Math.PI)
7242    var d = new Re({ vertexColors: u, wireframe: !0 }),
7243      e = c.getAttribute('position'),
7244      f = new Float32Array(3 * e.count)
7245    c.addAttribute('color', new Se(f, 3)), this.add(new gf(c, d)), this.update()
7246  }
7247  function Vi(a, b, c, d) {
7248    ;(a = a || 10),
7249      (b = b || 10),
7250      (c = new re(void 0 !== c ? c : 4473924)),
7251      (d = new re(void 0 !== d ? d : 8947848))
7252    for (
7253      var e = b / 2, f = a / b, g = a / 2, h = [], i = [], j = 0, k = 0, l = -g;
7254      j <= b;
7255      j++, l += f
7256    ) {
7257      h.push(-g, 0, l, g, 0, l), h.push(l, 0, -g, l, 0, g)
7258      var m = j === e ? c : d
7259      m.toArray(i, k),
7260        (k += 3),
7261        m.toArray(i, k),
7262        (k += 3),
7263        m.toArray(i, k),
7264        (k += 3),
7265        m.toArray(i, k),
7266        (k += 3)
7267    }
7268    var n = new ff()
7269    n.addAttribute('position', new $e(h, 3)),
7270      n.addAttribute('color', new $e(i, 3))
7271    var o = new _f({ vertexColors: u })
7272    bg.call(this, n, o)
7273  }
7274  function Wi(a, b, c, d, e, f) {
7275    ;(a = a || 10),
7276      (b = b || 16),
7277      (c = c || 8),
7278      (d = d || 64),
7279      (e = new re(void 0 !== e ? e : 4473924)),
7280      (f = new re(void 0 !== f ? f : 8947848))
7281    var i,
7282      j,
7283      k,
7284      l,
7285      m,
7286      n,
7287      o,
7288      g = [],
7289      h = []
7290    for (l = 0; l <= b; l++)
7291      (k = (l / b) * (2 * Math.PI)),
7292        (i = Math.sin(k) * a),
7293        (j = Math.cos(k) * a),
7294        g.push(0, 0, 0),
7295        g.push(i, 0, j),
7296        (o = 1 & l ? e : f),
7297        h.push(o.r, o.g, o.b),
7298        h.push(o.r, o.g, o.b)
7299    for (l = 0; l <= c; l++)
7300      for (o = 1 & l ? e : f, n = a - (a / c) * l, m = 0; m < d; m++)
7301        (k = (m / d) * (2 * Math.PI)),
7302          (i = Math.sin(k) * n),
7303          (j = Math.cos(k) * n),
7304          g.push(i, 0, j),
7305          h.push(o.r, o.g, o.b),
7306          (k = ((m + 1) / d) * (2 * Math.PI)),
7307          (i = Math.sin(k) * n),
7308          (j = Math.cos(k) * n),
7309          g.push(i, 0, j),
7310          h.push(o.r, o.g, o.b)
7311    var p = new ff()
7312    p.addAttribute('position', new $e(g, 3)),
7313      p.addAttribute('color', new $e(h, 3))
7314    var q = new _f({ vertexColors: u })
7315    bg.call(this, p, q)
7316  }
7317  function Xi(a, b, c, d) {
7318    ;(this.object = a), (this.size = void 0 !== b ? b : 1)
7319    var e = void 0 !== c ? c : 16776960,
7320      f = void 0 !== d ? d : 1,
7321      g = 0,
7322      h = this.object.geometry
7323    h && h.isGeometry
7324      ? (g = h.faces.length)
7325      : console.warn(
7326          'THREE.FaceNormalsHelper: only THREE.Geometry is supported. Use THREE.VertexNormalsHelper, instead.'
7327        )
7328    var i = new ff(),
7329      j = new $e(2 * g * 3, 3)
7330    i.addAttribute('position', j),
7331      bg.call(this, i, new _f({ color: e, linewidth: f })),
7332      (this.matrixAutoUpdate = !1),
7333      this.update()
7334  }
7335  function Yi(a, b) {
7336    Ne.call(this),
7337      (this.light = a),
7338      this.light.updateMatrixWorld(),
7339      (this.matrix = a.matrixWorld),
7340      (this.matrixAutoUpdate = !1),
7341      void 0 === b && (b = 1)
7342    var c = new ff()
7343    c.addAttribute(
7344      'position',
7345      new $e([-b, b, 0, b, b, 0, b, -b, 0, -b, -b, 0, -b, b, 0], 3)
7346    )
7347    var d = new _f({ fog: !1 })
7348    this.add(new ag(c, d)),
7349      (c = new ff()),
7350      c.addAttribute('position', new $e([0, 0, 0, 0, 0, 1], 3)),
7351      this.add(new ag(c, d)),
7352      this.update()
7353  }
7354  function Zi(a) {
7355    function l(a, b, c) {
7356      m(a, c), m(b, c)
7357    }
7358    function m(a, b) {
7359      d.push(0, 0, 0),
7360        e.push(b.r, b.g, b.b),
7361        void 0 === f[a] && (f[a] = []),
7362        f[a].push(d.length / 3 - 1)
7363    }
7364    var b = new ff(),
7365      c = new _f({ color: 16777215, vertexColors: t }),
7366      d = [],
7367      e = [],
7368      f = {},
7369      g = new re(16755200),
7370      h = new re(16711680),
7371      i = new re(43775),
7372      j = new re(16777215),
7373      k = new re(3355443)
7374    l('n1', 'n2', g),
7375      l('n2', 'n4', g),
7376      l('n4', 'n3', g),
7377      l('n3', 'n1', g),
7378      l('f1', 'f2', g),
7379      l('f2', 'f4', g),
7380      l('f4', 'f3', g),
7381      l('f3', 'f1', g),
7382      l('n1', 'f1', g),
7383      l('n2', 'f2', g),
7384      l('n3', 'f3', g),
7385      l('n4', 'f4', g),
7386      l('p', 'n1', h),
7387      l('p', 'n2', h),
7388      l('p', 'n3', h),
7389      l('p', 'n4', h),
7390      l('u1', 'u2', i),
7391      l('u2', 'u3', i),
7392      l('u3', 'u1', i),
7393      l('c', 't', j),
7394      l('p', 'c', k),
7395      l('cn1', 'cn2', k),
7396      l('cn3', 'cn4', k),
7397      l('cf1', 'cf2', k),
7398      l('cf3', 'cf4', k),
7399      b.addAttribute('position', new $e(d, 3)),
7400      b.addAttribute('color', new $e(e, 3)),
7401      bg.call(this, b, c),
7402      (this.camera = a),
7403      this.camera.updateProjectionMatrix &&
7404        this.camera.updateProjectionMatrix(),
7405      (this.matrix = a.matrixWorld),
7406      (this.matrixAutoUpdate = !1),
7407      (this.pointMap = f),
7408      this.update()
7409  }
7410  function $i(a, b) {
7411    void 0 === b && (b = 16776960)
7412    var c = new Uint16Array([
7413        0, 1, 1, 2, 2, 3, 3, 0, 4, 5, 5, 6, 6, 7, 7, 4, 0, 4, 1, 5, 2, 6, 3, 7
7414      ]),
7415      d = new Float32Array(24),
7416      e = new ff()
7417    e.setIndex(new Se(c, 1)),
7418      e.addAttribute('position', new Se(d, 3)),
7419      bg.call(this, e, new _f({ color: b })),
7420      void 0 !== a && this.update(a)
7421  }
7422  function bj(a, b, c, d, e, f) {
7423    Ne.call(this),
7424      void 0 === d && (d = 16776960),
7425      void 0 === c && (c = 1),
7426      void 0 === e && (e = 0.2 * c),
7427      void 0 === f && (f = 0.2 * e),
7428      void 0 === _i &&
7429        ((_i = new ff()),
7430        _i.addAttribute('position', new $e([0, 0, 0, 0, 1, 0], 3)),
7431        (aj = new Pg(0, 0.5, 1, 5, 1)),
7432        aj.translate(0, -0.5, 0)),
7433      this.position.copy(b),
7434      (this.line = new ag(_i, new _f({ color: d }))),
7435      (this.line.matrixAutoUpdate = !1),
7436      this.add(this.line),
7437      (this.cone = new gf(aj, new Re({ color: d }))),
7438      (this.cone.matrixAutoUpdate = !1),
7439      this.add(this.cone),
7440      this.setDirection(a),
7441      this.setLength(c, e, f)
7442  }
7443  function cj(a) {
7444    a = a || 1
7445    var b = [0, 0, 0, a, 0, 0, 0, 0, 0, 0, a, 0, 0, 0, 0, 0, 0, a],
7446      c = [1, 0, 0, 1, 0.6, 0, 0, 1, 0, 0.6, 1, 0, 0, 0, 1, 0, 0.6, 1],
7447      d = new ff()
7448    d.addAttribute('position', new $e(b, 3)),
7449      d.addAttribute('color', new $e(c, 3))
7450    var e = new _f({ vertexColors: u })
7451    bg.call(this, d, e)
7452  }
7453  function dj() {
7454    function e(e, f, g, h) {
7455      ;(a = e),
7456        (b = g),
7457        (c = -3 * e + 3 * f - 2 * g - h),
7458        (d = 2 * e - 2 * f + g + h)
7459    }
7460    var a = 0,
7461      b = 0,
7462      c = 0,
7463      d = 0
7464    return {
7465      initCatmullRom: function (a, b, c, d, f) {
7466        e(b, c, f * (c - a), f * (d - b))
7467      },
7468      initNonuniformCatmullRom: function (a, b, c, d, f, g, h) {
7469        var i = (b - a) / f - (c - a) / (f + g) + (c - b) / g,
7470          j = (c - b) / g - (d - b) / (g + h) + (d - c) / h
7471        ;(i *= g), (j *= g), e(b, c, i, j)
7472      },
7473      calc: function (e) {
7474        var f = e * e,
7475          g = f * e
7476        return a + b * e + c * f + d * g
7477      }
7478    }
7479  }
7480  function ij(a) {
7481    ;(this.points = a || []), (this.closed = !1)
7482  }
7483  function jj(a, b, c, d) {
7484    ;(this.v0 = a), (this.v1 = b), (this.v2 = c), (this.v3 = d)
7485  }
7486  function kj(a, b, c) {
7487    ;(this.v0 = a), (this.v1 = b), (this.v2 = c)
7488  }
7489  function lj(a, b) {
7490    ;(this.v1 = a), (this.v2 = b)
7491  }
7492  function mj(a, b, c, d, e, f) {
7493    ci.call(this, a, b, c, c, d, e, f)
7494  }
7495  function oj(a, b, c, d, e, f, g) {
7496    return (
7497      console.warn(
7498        'THREE.Face4 has been removed. A THREE.Face3 will be created instead.'
7499      ),
7500      new Qe(a, b, c, e, f, g)
7501    )
7502  }
7503  function rj(a) {
7504    return (
7505      console.warn(
7506        'THREE.MeshFaceMaterial has been renamed to THREE.MultiMaterial.'
7507      ),
7508      new Xg(a)
7509    )
7510  }
7511  function sj(a, b) {
7512    return (
7513      console.warn('THREE.PointCloud has been renamed to THREE.Points.'),
7514      new dg(a, b)
7515    )
7516  }
7517  function tj(a) {
7518    return (
7519      console.warn('THREE.Particle has been renamed to THREE.Sprite.'),
7520      new Wf(a)
7521    )
7522  }
7523  function uj(a, b) {
7524    return (
7525      console.warn('THREE.ParticleSystem has been renamed to THREE.Points.'),
7526      new dg(a, b)
7527    )
7528  }
7529  function vj(a) {
7530    return (
7531      console.warn(
7532        'THREE.PointCloudMaterial has been renamed to THREE.PointsMaterial.'
7533      ),
7534      new cg(a)
7535    )
7536  }
7537  function wj(a) {
7538    return (
7539      console.warn(
7540        'THREE.ParticleBasicMaterial has been renamed to THREE.PointsMaterial.'
7541      ),
7542      new cg(a)
7543    )
7544  }
7545  function xj(a) {
7546    return (
7547      console.warn(
7548        'THREE.ParticleSystemMaterial has been renamed to THREE.PointsMaterial.'
7549      ),
7550      new cg(a)
7551    )
7552  }
7553  function yj(a, b, c) {
7554    return (
7555      console.warn('THREE.Vertex has been removed. Use THREE.Vector3 instead.'),
7556      new Bb(a, b, c)
7557    )
7558  }
7559  function zj(a, b) {
7560    return (
7561      console.warn(
7562        'THREE.DynamicBufferAttribute has been removed. Use new THREE.BufferAttribute().setDynamic( true ) instead.'
7563      ),
7564      new Se(a, b).setDynamic(!0)
7565    )
7566  }
7567  function Aj(a, b) {
7568    return (
7569      console.warn(
7570        'THREE.Int8Attribute has been removed. Use new THREE.Int8BufferAttribute() instead.'
7571      ),
7572      new Te(a, b)
7573    )
7574  }
7575  function Bj(a, b) {
7576    return (
7577      console.warn(
7578        'THREE.Uint8Attribute has been removed. Use new THREE.Uint8BufferAttribute() instead.'
7579      ),
7580      new Ue(a, b)
7581    )
7582  }
7583  function Cj(a, b) {
7584    return (
7585      console.warn(
7586        'THREE.Uint8ClampedAttribute has been removed. Use new THREE.Uint8ClampedBufferAttribute() instead.'
7587      ),
7588      new Ve(a, b)
7589    )
7590  }
7591  function Dj(a, b) {
7592    return (
7593      console.warn(
7594        'THREE.Int16Attribute has been removed. Use new THREE.Int16BufferAttribute() instead.'
7595      ),
7596      new We(a, b)
7597    )
7598  }
7599  function Ej(a, b) {
7600    return (
7601      console.warn(
7602        'THREE.Uint16Attribute has been removed. Use new THREE.Uint16BufferAttribute() instead.'
7603      ),
7604      new Xe(a, b)
7605    )
7606  }
7607  function Fj(a, b) {
7608    return (
7609      console.warn(
7610        'THREE.Int32Attribute has been removed. Use new THREE.Int32BufferAttribute() instead.'
7611      ),
7612      new Ye(a, b)
7613    )
7614  }
7615  function Gj(a, b) {
7616    return (
7617      console.warn(
7618        'THREE.Uint32Attribute has been removed. Use new THREE.Uint32BufferAttribute() instead.'
7619      ),
7620      new Ze(a, b)
7621    )
7622  }
7623  function Hj(a, b) {
7624    return (
7625      console.warn(
7626        'THREE.Float32Attribute has been removed. Use new THREE.Float32BufferAttribute() instead.'
7627      ),
7628      new $e(a, b)
7629    )
7630  }
7631  function Ij(a, b) {
7632    return (
7633      console.warn(
7634        'THREE.Float64Attribute has been removed. Use new THREE.Float64BufferAttribute() instead.'
7635      ),
7636      new _e(a, b)
7637    )
7638  }
7639  function Jj(a) {
7640    console.warn(
7641      'THREE.ClosedSplineCurve3 has been deprecated. Use THREE.CatmullRomCurve3 instead.'
7642    ),
7643      ij.call(this, a),
7644      (this.type = 'catmullrom'),
7645      (this.closed = !0)
7646  }
7647  function Kj(a) {
7648    console.warn(
7649      'THREE.SplineCurve3 has been deprecated. Use THREE.CatmullRomCurve3 instead.'
7650    ),
7651      ij.call(this, a),
7652      (this.type = 'catmullrom')
7653  }
7654  function Lj(a) {
7655    console.warn(
7656      'THREE.Spline has been removed. Use THREE.CatmullRomCurve3 instead.'
7657    ),
7658      ij.call(this, a),
7659      (this.type = 'catmullrom')
7660  }
7661  function Mj(a, b) {
7662    return (
7663      console.warn(
7664        'THREE.BoundingBoxHelper has been deprecated. Creating a THREE.BoxHelper instead.'
7665      ),
7666      new $i(a, b)
7667    )
7668  }
7669  function Nj(a, b) {
7670    return (
7671      console.warn(
7672        'THREE.EdgesHelper has been removed. Use THREE.EdgesGeometry instead.'
7673      ),
7674      new bg(new Ng(a.geometry), new _f({ color: void 0 !== b ? b : 16777215 }))
7675    )
7676  }
7677  function Oj(a, b) {
7678    return (
7679      console.warn(
7680        'THREE.WireframeHelper has been removed. Use THREE.WireframeGeometry instead.'
7681      ),
7682      new bg(new jg(a.geometry), new _f({ color: void 0 !== b ? b : 16777215 }))
7683    )
7684  }
7685  function Pj(a) {
7686    return (
7687      console.warn('THREE.XHRLoader has been renamed to THREE.FileLoader.'),
7688      new hh(a)
7689    )
7690  }
7691  function Qj(a) {
7692    return (
7693      console.warn(
7694        'THREE.BinaryTextureLoader has been renamed to THREE.DataTextureLoader.'
7695      ),
7696      new jh(a)
7697    )
7698  }
7699  function Tj() {
7700    console.error(
7701      'THREE.Projector has been moved to /examples/js/renderers/Projector.js.'
7702    ),
7703      (this.projectVector = function (a, b) {
7704        console.warn(
7705          'THREE.Projector: .projectVector() is now vector.project().'
7706        ),
7707          a.project(b)
7708      }),
7709      (this.unprojectVector = function (a, b) {
7710        console.warn(
7711          'THREE.Projector: .unprojectVector() is now vector.unproject().'
7712        ),
7713          a.unproject(b)
7714      }),
7715      (this.pickingRay = function () {
7716        console.error(
7717          'THREE.Projector: .pickingRay() is now raycaster.setFromCamera().'
7718        )
7719      })
7720  }
7721  function Uj() {
7722    console.error(
7723      'THREE.CanvasRenderer has been moved to /examples/js/renderers/CanvasRenderer.js'
7724    ),
7725      (this.domElement = document.createElementNS(
7726        'http://www.w3.org/1999/xhtml',
7727        'canvas'
7728      )),
7729      (this.clear = function () {}),
7730      (this.render = function () {}),
7731      (this.setClearColor = function () {}),
7732      (this.setSize = function () {})
7733  }
7734  void 0 === Number.EPSILON && (Number.EPSILON = Math.pow(2, -52)),
7735    void 0 === Math.sign &&
7736      (Math.sign = function (a) {
7737        return a < 0 ? -1 : a > 0 ? 1 : +a
7738      }),
7739    void 0 === Function.prototype.name &&
7740      Object.defineProperty(Function.prototype, 'name', {
7741        get: function () {
7742          return this.toString().match(/^\s*function\s*([^\(\s]*)/)[1]
7743        }
7744      }),
7745    void 0 === Object.assign &&
7746      !(function () {
7747        Object.assign = function (a) {
7748          if (void 0 === a || null === a)
7749            throw new TypeError('Cannot convert undefined or null to object')
7750          for (var b = Object(a), c = 1; c < arguments.length; c++) {
7751            var d = arguments[c]
7752            if (void 0 !== d && null !== d)
7753              for (var e in d)
7754                Object.prototype.hasOwnProperty.call(d, e) && (b[e] = d[e])
7755          }
7756          return b
7757        }
7758      })(),
7759    (b.prototype = {
7760      addEventListener: function (a, b) {
7761        void 0 === this._listeners && (this._listeners = {})
7762        var c = this._listeners
7763        void 0 === c[a] && (c[a] = []), c[a].indexOf(b) === -1 && c[a].push(b)
7764      },
7765      hasEventListener: function (a, b) {
7766        if (void 0 === this._listeners) return !1
7767        var c = this._listeners
7768        return void 0 !== c[a] && c[a].indexOf(b) !== -1
7769      },
7770      removeEventListener: function (a, b) {
7771        if (void 0 !== this._listeners) {
7772          var c = this._listeners,
7773            d = c[a]
7774          if (void 0 !== d) {
7775            var e = d.indexOf(b)
7776            e !== -1 && d.splice(e, 1)
7777          }
7778        }
7779      },
7780      dispatchEvent: function (a) {
7781        if (void 0 !== this._listeners) {
7782          var b = this._listeners,
7783            c = b[a.type]
7784          if (void 0 !== c) {
7785            a.target = this
7786            var d = [],
7787              e = 0,
7788              f = c.length
7789            for (e = 0; e < f;
7789 e++) d[e] = c[e]
7790            for (e = 0; e < f; e++) d[e].call(this, a)
7791          }
7792        }
7793      }
7794    })
7795  var c = '84',
7796    d = { LEFT: 0, MIDDLE: 1, RIGHT: 2 },
7797    e = 0,
7798    f = 1,
7799    g = 2,
7800    h = 3,
7801    i = 0,
7802    j = 1,
7803    k = 0,
7804    l = 1,
7805    m = 2,
7806    n = 0,
7807    o = 1,
7808    p = 2,
7809    q = 1,
7810    r = 2,
7811    s = 0,
7812    t = 1,
7813    u = 2,
7814    v = 0,
7815    w = 1,
7816    x = 2,
7817    y = 3,
7818    z = 4,
7819    A = 5,
7820    B = 100,
7821    C = 101,
7822    D = 102,
7823    E = 103,
7824    F = 104,
7825    G = 200,
7826    H = 201,
7827    I = 202,
7828    J = 203,
7829    K = 204,
7830    L = 205,
7831    M = 206,
7832    N = 207,
7833    O = 208,
7834    P = 209,
7835    Q = 210,
7836    R = 0,
7837    S = 1,
7838    T = 2,
7839    U = 3,
7840    V = 4,
7841    W = 5,
7842    X = 6,
7843    Y = 7,
7844    Z = 0,
7845    $ = 1,
7846    _ = 2,
7847    aa = 0,
7848    ba = 1,
7849    ca = 2,
7850    da = 3,
7851    ea = 4,
7852    fa = 300,
7853    ga = 301,
7854    ha = 302,
7855    ia = 303,
7856    ja = 304,
7857    ka = 305,
7858    la = 306,
7859    ma = 307,
7860    na = 1e3,
7861    oa = 1001,
7862    pa = 1002,
7863    qa = 1003,
7864    ra = 1004,
7865    sa = 1005,
7866    ta = 1006,
7867    ua = 1007,
7868    va = 1008,
7869    wa = 1009,
7870    xa = 1010,
7871    ya = 1011,
7872    za = 1012,
7873    Aa = 1013,
7874    Ba = 1014,
7875    Ca = 1015,
7876    Da = 1016,
7877    Ea = 1017,
7878    Fa = 1018,
7879    Ga = 1019,
7880    Ha = 1020,
7881    Ia = 1021,
7882    Ja = 1022,
7883    Ka = 1023,
7884    La = 1024,
7885    Ma = 1025,
7886    Na = Ka,
7887    Oa = 1026,
7888    Pa = 1027,
7889    Qa = 2001,
7890    Ra = 2002,
7891    Sa = 2003,
7892    Ta = 2004,
7893    Ua = 2100,
7894    Va = 2101,
7895    Wa = 2102,
7896    Xa = 2103,
7897    Ya = 2151,
7898    Za = 2200,
7899    $a = 2201,
7900    _a = 2202,
7901    ab = 2300,
7902    bb = 2301,
7903    cb = 2302,
7904    db = 2400,
7905    eb = 2401,
7906    fb = 2402,
7907    gb = 0,
7908    hb = 1,
7909    ib = 2,
7910    jb = 3e3,
7911    kb = 3001,
7912    lb = 3007,
7913    mb = 3002,
7914    nb = 3003,
7915    ob = 3004,
7916    pb = 3005,
7917    qb = 3006,
7918    rb = 3200,
7919    sb = 3201,
7920    tb = {
7921      DEG2RAD: Math.PI / 180,
7922      RAD2DEG: 180 / Math.PI,
7923      generateUUID: (function () {
7924        var d,
7925          a =
7926            '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz'.split(
7927              ''
7928            ),
7929          b = new Array(36),
7930          c = 0
7931        return function () {
7932          for (var f = 0; f < 36; f++)
7933            8 === f || 13 === f || 18 === f || 23 === f
7934              ? (b[f] = '-')
7935              : 14 === f
7936              ? (b[f] = '4')
7937              : (c <= 2 && (c = (33554432 + 16777216 * Math.random()) | 0),
7938                (d = 15 & c),
7939                (c >>= 4),
7940                (b[f] = a[19 === f ? (3 & d) | 8 : d]))
7941          return b.join('')
7942        }
7943      })(),
7944      clamp: function (a, b, c) {
7945        return Math.max(b, Math.min(c, a))
7946      },
7947      euclideanModulo: function (a, b) {
7948        return ((a % b) + b) % b
7949      },
7950      mapLinear: function (a, b, c, d, e) {
7951        return d + ((a - b) * (e - d)) / (c - b)
7952      },
7953      lerp: function (a, b, c) {
7954        return (1 - c) * a + c * b
7955      },
7956      smoothstep: function (a, b, c) {
7957        return a <= b
7958          ? 0
7959          : a >= c
7960          ? 1
7961          : ((a = (a - b) / (c - b)), a * a * (3 - 2 * a))
7962      },
7963      smootherstep: function (a, b, c) {
7964        return a <= b
7965          ? 0
7966          : a >= c
7967          ? 1
7968          : ((a = (a - b) / (c - b)), a * a * a * (a * (6 * a - 15) + 10))
7969      },
7970      randInt: function (a, b) {
7971        return a + Math.floor(Math.random() * (b - a + 1))
7972      },
7973      randFloat: function (a, b) {
7974        return a + Math.random() * (b - a)
7975      },
7976      randFloatSpread: function (a) {
7977        return a * (0.5 - Math.random())
7978      },
7979      degToRad: function (a) {
7980        return a * tb.DEG2RAD
7981      },
7982      radToDeg: function (a) {
7983        return a * tb.RAD2DEG
7984      },
7985      isPowerOfTwo: function (a) {
7986        return 0 === (a & (a - 1)) && 0 !== a
7987      },
7988      nearestPowerOfTwo: function (a) {
7989        return Math.pow(2, Math.round(Math.log(a) / Math.LN2))
7990      },
7991      nextPowerOfTwo: function (a) {
7992        return (
7993          a--,
7994          (a |= a >> 1),
7995          (a |= a >> 2),
7996          (a |= a >> 4),
7997          (a |= a >> 8),
7998          (a |= a >> 16),
7999          a++,
8000          a
8001        )
8002      }
8003    }
8004  ub.prototype = {
8005    constructor: ub,
8006    isVector2: !0,
8007    get width() {
8008      return this.x
8009    },
8010    set width(a) {
8011      this.x = a
8012    },
8013    get height() {
8014      return this.y
8015    },
8016    set height(a) {
8017      this.y = a
8018    },
8019    set: function (a, b) {
8020      return (this.x = a), (this.y = b), this
8021    },
8022    setScalar: function (a) {
8023      return (this.x = a), (this.y = a), this
8024    },
8025    setX: function (a) {
8026      return (this.x = a), this
8027    },
8028    setY: function (a) {
8029      return (this.y = a), this
8030    },
8031    setComponent: function (a, b) {
8032      switch (a) {
8033        case 0:
8034          this.x = b
8035          break
8036        case 1:
8037          this.y = b
8038          break
8039        default:
8040          throw new Error('index is out of range: ' + a)
8041      }
8042      return this
8043    },
8044    getComponent: function (a) {
8045      switch (a) {
8046        case 0:
8047          return this.x
8048        case 1:
8049          return this.y
8050        default:
8051          throw new Error('index is out of range: ' + a)
8052      }
8053    },
8054    clone: function () {
8055      return new this.constructor(this.x, this.y)
8056    },
8057    copy: function (a) {
8058      return (this.x = a.x), (this.y = a.y), this
8059    },
8060    add: function (a, b) {
8061      return void 0 !== b
8062        ? (console.warn(
8063            'THREE.Vector2: .add() now only accepts one argument. Use .addVectors( a, b ) instead.'
8064          ),
8065          this.addVectors(a, b))
8066        : ((this.x += a.x), (this.y += a.y), this)
8067    },
8068    addScalar: function (a) {
8069      return (this.x += a), (this.y += a), this
8070    },
8071    addVectors: function (a, b) {
8072      return (this.x = a.x + b.x), (this.y = a.y + b.y), this
8073    },
8074    addScaledVector: function (a, b) {
8075      return (this.x += a.x * b), (this.y += a.y * b), this
8076    },
8077    sub: function (a, b) {
8078      return void 0 !== b
8079        ? (console.warn(
8080            'THREE.Vector2: .sub() now only accepts one argument. Use .subVectors( a, b ) instead.'
8081          ),
8082          this.subVectors(a, b))
8083        : ((this.x -= a.x), (this.y -= a.y), this)
8084    },
8085    subScalar: function (a) {
8086      return (this.x -= a), (this.y -= a), this
8087    },
8088    subVectors: function (a, b) {
8089      return (this.x = a.x - b.x), (this.y = a.y - b.y), this
8090    },
8091    multiply: function (a) {
8092      return (this.x *= a.x), (this.y *= a.y), this
8093    },
8094    multiplyScalar: function (a) {
8095      return (
8096        isFinite(a)
8097          ? ((this.x *= a), (this.y *= a))
8098          : ((this.x = 0), (this.y = 0)),
8099        this
8100      )
8101    },
8102    divide: function (a) {
8103      return (this.x /= a.x), (this.y /= a.y), this
8104    },
8105    divideScalar: function (a) {
8106      return this.multiplyScalar(1 / a)
8107    },
8108    min: function (a) {
8109      return (
8110        (this.x = Math.min(this.x, a.x)), (this.y = Math.min(this.y, a.y)), this
8111      )
8112    },
8113    max: function (a) {
8114      return (
8115        (this.x = Math.max(this.x, a.x)), (this.y = Math.max(this.y, a.y)), this
8116      )
8117    },
8118    clamp: function (a, b) {
8119      return (
8120        (this.x = Math.max(a.x, Math.min(b.x, this.x))),
8121        (this.y = Math.max(a.y, Math.min(b.y, this.y))),
8122        this
8123      )
8124    },
8125    clampScalar: (function () {
8126      var a, b
8127      return function (d, e) {
8128        return (
8129          void 0 === a && ((a = new ub()), (b = new ub())),
8130          a.set(d, d),
8131          b.set(e, e),
8132          this.clamp(a, b)
8133        )
8134      }
8135    })(),
8136    clampLength: function (a, b) {
8137      var c = this.length()
8138      return this.multiplyScalar(Math.max(a, Math.min(b, c)) / c)
8139    },
8140    floor: function () {
8141      return (this.x = Math.floor(this.x)), (this.y = Math.floor(this.y)), this
8142    },
8143    ceil: function () {
8144      return (this.x = Math.ceil(this.x)), (this.y = Math.ceil(this.y)), this
8145    },
8146    round: function () {
8147      return (this.x = Math.round(this.x)), (this.y = Math.round(this.y)), this
8148    },
8149    roundToZero: function () {
8150      return (
8151        (this.x = this.x < 0 ? Math.ceil(this.x) : Math.floor(this.x)),
8152        (this.y = this.y < 0 ? Math.ceil(this.y) : Math.floor(this.y)),
8153        this
8154      )
8155    },
8156    negate: function () {
8157      return (this.x = -this.x), (this.y = -this.y), this
8158    },
8159    dot: function (a) {
8160      return this.x * a.x + this.y * a.y
8161    },
8162    lengthSq: function () {
8163      return this.x * this.x + this.y * this.y
8164    },
8165    length: function () {
8166      return Math.sqrt(this.x * this.x + this.y * this.y)
8167    },
8168    lengthManhattan: function () {
8169      return Math.abs(this.x) + Math.abs(this.y)
8170    },
8171    normalize: function () {
8172      return this.divideScalar(this.length())
8173    },
8174    angle: function () {
8175      var a = Math.atan2(this.y, this.x)
8176      return a < 0 && (a += 2 * Math.PI), a
8177    },
8178    distanceTo: function (a) {
8179      return Math.sqrt(this.distanceToSquared(a))
8180    },
8181    distanceToSquared: function (a) {
8182      var b = this.x - a.x,
8183        c = this.y - a.y
8184      return b * b + c * c
8185    },
8186    distanceToManhattan: function (a) {
8187      return Math.abs(this.x - a.x) + Math.abs(this.y - a.y)
8188    },
8189    setLength: function (a) {
8190      return this.multiplyScalar(a / this.length())
8191    },
8192    lerp: function (a, b) {
8193      return (
8194        (this.x += (a.x - this.x) * b), (this.y += (a.y - this.y) * b), this
8195      )
8196    },
8197    lerpVectors: function (a, b, c) {
8198      return this.subVectors(b, a).multiplyScalar(c).add(a)
8199    },
8200    equals: function (a) {
8201      return a.x === this.x && a.y === this.y
8202    },
8203    fromArray: function (a, b) {
8204      return void 0 === b && (b = 0), (this.x = a[b]), (this.y = a[b + 1]), this
8205    },
8206    toArray: function (a, b) {
8207      return (
8208        void 0 === a && (a = []),
8209        void 0 === b && (b = 0),
8210        (a[b] = this.x),
8211        (a[b + 1] = this.y),
8212        a
8213      )
8214    },
8215    fromBufferAttribute: function (a, b, c) {
8216      return (
8217        void 0 !== c &&
8218          console.warn(
8219            'THREE.Vector2: offset has been removed from .fromBufferAttribute().'
8220          ),
8221        (this.x = a.getX(b)),
8222        (this.y = a.getY(b)),
8223        this
8224      )
8225    },
8226    rotateAround: function (a, b) {
8227      var c = Math.cos(b),
8228        d = Math.sin(b),
8229        e = this.x - a.x,
8230        f = this.y - a.y
8231      return (
8232        (this.x = e * c - f * d + a.x), (this.y = e * d + f * c + a.y), this
8233      )
8234    }
8235  }
8236  var vb = 0
8237  ;(wb.DEFAULT_IMAGE = void 0),
8238    (wb.DEFAULT_MAPPING = fa),
8239    (wb.prototype = {
8240      constructor: wb,
8241      isTexture: !0,
8242      set needsUpdate(a) {
8243        a === !0 && this.version++
8244      },
8245      clone: function () {
8246        return new this.constructor().copy(this)
8247      },
8248      copy: function (a) {
8249        return (
8250          (this.image = a.image),
8251          (this.mipmaps = a.mipmaps.slice(0)),
8252          (this.mapping = a.mapping),
8253          (this.wrapS = a.wrapS),
8254          (this.wrapT = a.wrapT),
8255          (this.magFilter = a.magFilter),
8256          (this.minFilter = a.minFilter),
8257          (this.anisotropy = a.anisotropy),
8258          (this.format = a.format),
8259          (this.type = a.type),
8260          this.offset.copy(a.offset),
8261          this.repeat.copy(a.repeat),
8262          (this.generateMipmaps = a.generateMipmaps),
8263          (this.premultiplyAlpha = a.premultiplyAlpha),
8264          (this.flipY = a.flipY),
8265          (this.unpackAlignment = a.unpackAlignment),
8266          (this.encoding = a.encoding),
8267          this
8268        )
8269      },
8270      toJSON: function (a) {
8271        function b(a) {
8272          var b
8273          return (
8274            void 0 !== a.toDataURL
8275              ? (b = a)
8276              : ((b = document.createElementNS(
8277                  'http://www.w3.org/1999/xhtml',
8278                  'canvas'
8279                )),
8280                (b.width = a.width),
8281                (b.height = a.height),
8282                b.getContext('2d').drawImage(a, 0, 0, a.width, a.height)),
8283            b.width > 2048 || b.height > 2048
8284              ? b.toDataURL('image/jpeg', 0.6)
8285              : b.toDataURL('image/png')
8286          )
8287        }
8288        if (void 0 !== a.textures[this.uuid]) return a.textures[this.uuid]
8289        var c = {
8290          metadata: {
8291            version: 4.4,
8292            type: 'Texture',
8293            generator: 'Texture.toJSON'
8294          },
8295          uuid: this.uuid,
8296          name: this.name,
8297          mapping: this.mapping,
8298          repeat: [this.repeat.x, this.repeat.y],
8299          offset: [this.offset.x, this.offset.y],
8300          wrap: [this.wrapS, this.wrapT],
8301          minFilter: this.minFilter,
8302          magFilter: this.magFilter,
8303          anisotropy: this.anisotropy,
8304          flipY: this.flipY
8305        }
8306        if (void 0 !== this.image) {
8307          var d = this.image
8308          void 0 === d.uuid && (d.uuid = tb.generateUUID()),
8309            void 0 === a.images[d.uuid] &&
8310              (a.images[d.uuid] = { uuid: d.uuid, url: b(d) }),
8311            (c.image = d.uuid)
8312        }
8313        return (a.textures[this.uuid] = c), c
8314      },
8315      dispose: function () {
8316        this.dispatchEvent({ type: 'dispose' })
8317      },
8318      transformUv: function (a) {
8319        if (this.mapping === fa) {
8320          if ((a.multiply(this.repeat), a.add(this.offset), a.x < 0 || a.x > 1))
8321            switch (this.wrapS) {
8322              case na:
8323                a.x = a.x - Math.floor(a.x)
8324                break
8325              case oa:
8326                a.x = a.x < 0 ? 0 : 1
8327                break
8328              case pa:
8329                1 === Math.abs(Math.floor(a.x) % 2)
8330                  ? (a.x = Math.ceil(a.x) - a.x)
8331                  : (a.x = a.x - Math.floor(a.x))
8332            }
8333          if (a.y < 0 || a.y > 1)
8334            switch (this.wrapT) {
8335              case na:
8336                a.y = a.y - Math.floor(a.y)
8337                break
8338              case oa:
8339                a.y = a.y < 0 ? 0 : 1
8340                break
8341              case pa:
8342                1 === Math.abs(Math.floor(a.y) % 2)
8343                  ? (a.y = Math.ceil(a.y) - a.y)
8344                  : (a.y = a.y - Math.floor(a.y))
8345            }
8346          this.flipY && (a.y = 1 - a.y)
8347        }
8348      }
8349    }),
8350    Object.assign(wb.prototype, b.prototype),
8351    (xb.prototype = {
8352      constructor: xb,
8353      isVector4: !0,
8354      set: function (a, b, c, d) {
8355        return (this.x = a), (this.y = b), (this.z = c), (this.w = d), this
8356      },
8357      setScalar: function (a) {
8358        return (this.x = a), (this.y = a), (this.z = a), (this.w = a), this
8359      },
8360      setX: function (a) {
8361        return (this.x = a), this
8362      },
8363      setY: function (a) {
8364        return (this.y = a), this
8365      },
8366      setZ: function (a) {
8367        return (this.z = a), this
8368      },
8369      setW: function (a) {
8370        return (this.w = a), this
8371      },
8372      setComponent: function (a, b) {
8373        switch (a) {
8374          case 0:
8375            this.x = b
8376            break
8377          case 1:
8378            this.y = b
8379            break
8380          case 2:
8381            this.z = b
8382            break
8383          case 3:
8384            this.w = b
8385            break
8386          default:
8387            throw new Error('index is out of range: ' + a)
8388        }
8389        return this
8390      },
8391      getComponent: function (a) {
8392        switch (a) {
8393          case 0:
8394            return this.x
8395          case 1:
8396            return this.y
8397          case 2:
8398            return this.z
8399          case 3:
8400            return this.w
8401          default:
8402            throw new Error('index is out of range: ' + a)
8403        }
8404      },
8405      clone: function () {
8406        return new this.constructor(this.x, this.y, this.z, this.w)
8407      },
8408      copy: function (a) {
8409        return (
8410          (this.x = a.x),
8411          (this.y = a.y),
8412          (this.z = a.z),
8413          (this.w = void 0 !== a.w ? a.w : 1),
8414          this
8415        )
8416      },
8417      add: function (a, b) {
8418        return void 0 !== b
8419          ? (console.warn(
8420              'THREE.Vector4: .add() now only accepts one argument. Use .addVectors( a, b ) instead.'
8421            ),
8422            this.addVectors(a, b))
8423          : ((this.x += a.x),
8424            (this.y += a.y),
8425            (this.z += a.z),
8426            (this.w += a.w),
8427            this)
8428      },
8429      addScalar: function (a) {
8430        return (this.x += a), (this.y += a), (this.z += a), (this.w += a), this
8431      },
8432      addVectors: function (a, b) {
8433        return (
8434          (this.x = a.x + b.x),
8435          (this.y = a.y + b.y),
8436          (this.z = a.z + b.z),
8437          (this.w = a.w + b.w),
8438          this
8439        )
8440      },
8441      addScaledVector: function (a, b) {
8442        return (
8443          (this.x += a.x * b),
8444          (this.y += a.y * b),
8445          (this.z += a.z * b),
8446          (this.w += a.w * b),
8447          this
8448        )
8449      },
8450      sub: function (a, b) {
8451        return void 0 !== b
8452          ? (console.warn(
8453              'THREE.Vector4: .sub() now only accepts one argument. Use .subVectors( a, b ) instead.'
8454            ),
8455            this.subVectors(a, b))
8456          : ((this.x -= a.x),
8457            (this.y -= a.y),
8458            (this.z -= a.z),
8459            (this.w -= a.w),
8460            this)
8461      },
8462      subScalar: function (a) {
8463        return (this.x -= a), (this.y -= a), (this.z -= a), (this.w -= a), this
8464      },
8465      subVectors: function (a, b) {
8466        return (
8467          (this.x = a.x - b.x),
8468          (this.y = a.y - b.y),
8469          (this.z = a.z - b.z),
8470          (this.w = a.w - b.w),
8471          this
8472        )
8473      },
8474      multiplyScalar: function (a) {
8475        return (
8476          isFinite(a)
8477            ? ((this.x *= a), (this.y *= a), (this.z *= a), (this.w *= a))
8478            : ((this.x = 0), (this.y = 0), (this.z = 0), (this.w = 0)),
8479          this
8480        )
8481      },
8482      applyMatrix4: function (a) {
8483        var b = this.x,
8484          c = this.y,
8485          d = this.z,
8486          e = this.w,
8487          f = a.elements
8488        return (
8489          (this.x = f[0] * b + f[4] * c + f[8] * d + f[12] * e),
8490          (this.y = f[1] * b + f[5] * c + f[9] * d + f[13] * e),
8491          (this.z = f[2] * b + f[6] * c + f[10] * d + f[14] * e),
8492          (this.w = f[3] * b + f[7] * c + f[11] * d + f[15] * e),
8493          this
8494        )
8495      },
8496      divideScalar: function (a) {
8497        return this.multiplyScalar(1 / a)
8498      },
8499      setAxisAngleFromQuaternion: function (a) {
8500        this.w = 2 * Math.acos(a.w)
8501        var b = Math.sqrt(1 - a.w * a.w)
8502        return (
8503          b < 1e-4
8504            ? ((this.x = 1), (this.y = 0), (this.z = 0))
8505            : ((this.x = a.x / b), (this.y = a.y / b), (this.z = a.z / b)),
8506          this
8507        )
8508      },
8509      setAxisAngleFromRotationMatrix: function (a) {
8510        var b,
8511          c,
8512          d,
8513          e,
8514          f = 0.01,
8515          g = 0.1,
8516          h = a.elements,
8517          i = h[0],
8518          j = h[4],
8519          k = h[8],
8520          l = h[1],
8521          m = h[5],
8522          n = h[9],
8523          o = h[2],
8524          p = h[6],
8525          q = h[10]
8526        if (Math.abs(j - l) < f && Math.abs(k - o) < f && Math.abs(n - p) < f) {
8527          if (
8528            Math.abs(j + l) < g &&
8529            Math.abs(k + o) < g &&
8530            Math.abs(n + p) < g &&
8531            Math.abs(i + m + q - 3) < g
8532          )
8533            return this.set(1, 0, 0, 0), this
8534          b = Math.PI
8535          var r = (i + 1) / 2,
8536            s = (m + 1) / 2,
8537            t = (q + 1) / 2,
8538            u = (j + l) / 4,
8539            v = (k + o) / 4,
8540            w = (n + p) / 4
8541          return (
8542            r > s && r > t
8543              ? r < f
8544                ? ((c = 0), (d = 0.707106781), (e = 0.707106781))
8545                : ((c = Math.sqrt(r)), (d = u / c), (e = v / c))
8546              : s > t
8547              ? s < f
8548                ? ((c = 0.707106781), (d = 0), (e = 0.707106781))
8549                : ((d = Math.sqrt(s)), (c = u / d), (e = w / d))
8550              : t < f
8551              ? ((c = 0.707106781), (d = 0.707106781), (e = 0))
8552              : ((e = Math.sqrt(t)), (c = v / e), (d = w / e)),
8553            this.set(c, d, e, b),
8554            this
8555          )
8556        }
8557        var x = Math.sqrt(
8558          (p - n) * (p - n) + (k - o) * (k - o) + (l - j) * (l - j)
8559        )
8560        return (
8561          Math.abs(x) < 0.001 && (x = 1),
8562          (this.x = (p - n) / x),
8563          (this.y = (k - o) / x),
8564          (this.z = (l - j) / x),
8565          (this.w = Math.acos((i + m + q - 1) / 2)),
8566          this
8567        )
8568      },
8569      min: function (a) {
8570        return (
8571          (this.x = Math.min(this.x, a.x)),
8572          (this.y = Math.min(this.y, a.y)),
8573          (this.z = Math.min(this.z, a.z)),
8574          (this.w = Math.min(this.w, a.w)),
8575          this
8576        )
8577      },
8578      max: function (a) {
8579        return (
8580          (this.x = Math.max(this.x, a.x)),
8581          (this.y = Math.max(this.y, a.y)),
8582          (this.z = Math.max(this.z, a.z)),
8583          (this.w = Math.max(this.w, a.w)),
8584          this
8585        )
8586      },
8587      clamp: function (a, b) {
8588        return (
8589          (this.x = Math.max(a.x, Math.min(b.x, this.x))),
8590          (this.y = Math.max(a.y, Math.min(b.y, this.y))),
8591          (this.z = Math.max(a.z, Math.min(b.z, this.z))),
8592          (this.w = Math.max(a.w, Math.min(b.w, this.w))),
8593          this
8594        )
8595      },
8596      clampScalar: (function () {
8597        var a, b
8598        return function (d, e) {
8599          return (
8600            void 0 === a && ((a = new xb()), (b = new xb())),
8601            a.set(d, d, d, d),
8602            b.set(e, e, e, e),
8603            this.clamp(a, b)
8604          )
8605        }
8606      })(),
8607      floor: function () {
8608        return (
8609          (this.x = Math.floor(this.x)),
8610          (this.y = Math.floor(this.y)),
8611          (this.z = Math.floor(this.z)),
8612          (this.w = Math.floor(this.w)),
8613          this
8614        )
8615      },
8616      ceil: function () {
8617        return (
8618          (this.x = Math.ceil(this.x)),
8619          (this.y = Math.ceil(this.y)),
8620          (this.z = Math.ceil(this.z)),
8621          (this.w = Math.ceil(this.w)),
8622          this
8623        )
8624      },
8625      round: function () {
8626        return (
8627          (this.x = Math.round(this.x)),
8628          (this.y = Math.round(this.y)),
8629          (this.z = Math.round(this.z)),
8630          (this.w = Math.round(this.w)),
8631          this
8632        )
8633      },
8634      roundToZero: function () {
8635        return (
8636          (this.x = this.x < 0 ? Math.ceil(this.x) : Math.floor(this.x)),
8637          (this.y = this.y < 0 ? Math.ceil(this.y) : Math.floor(this.y)),
8638          (this.z = this.z < 0 ? Math.ceil(this.z) : Math.floor(this.z)),
8639          (this.w = this.w < 0 ? Math.ceil(this.w) : Math.floor(this.w)),
8640          this
8641        )
8642      },
8643      negate: function () {
8644        return (
8645          (this.x = -this.x),
8646          (this.y = -this.y),
8647          (this.z = -this.z),
8648          (this.w = -this.w),
8649          this
8650        )
8651      },
8652      dot: function (a) {
8653        return this.x * a.x + this.y * a.y + this.z * a.z + this.w * a.w
8654      },
8655      lengthSq: function () {
8656        return (
8657          this.x * this.x + this.y * this.y + this.z * this.z + this.w * this.w
8658        )
8659      },
8660      length: function () {
8661        return Math.sqrt(
8662          this.x * this.x + this.y * this.y + this.z * this.z + this.w * this.w
8663        )
8664      },
8665      lengthManhattan: function () {
8666        return (
8667          Math.abs(this.x) +
8668          Math.abs(this.y) +
8669          Math.abs(this.z) +
8670          Math.abs(this.w)
8671        )
8672      },
8673      normalize: function () {
8674        return this.divideScalar(this.length())
8675      },
8676      setLength: function (a) {
8677        return this.multiplyScalar(a / this.length())
8678      },
8679      lerp: function (a, b) {
8680        return (
8681          (this.x += (a.x - this.x) * b),
8682          (this.y += (a.y - this.y) * b),
8683          (this.z += (a.z - this.z) * b),
8684          (this.w += (a.w - this.w) * b),
8685          this
8686        )
8687      },
8688      lerpVectors: function (a, b, c) {
8689        return this.subVectors(b, a).multiplyScalar(c).add(a)
8690      },
8691      equals: function (a) {
8692        return (
8693          a.x === this.x && a.y === this.y && a.z === this.z && a.w === this.w
8694        )
8695      },
8696      fromArray: function (a, b) {
8697        return (
8698          void 0 === b && (b = 0),
8699          (this.x = a[b]),
8700          (this.y = a[b + 1]),
8701          (this.z = a[b + 2]),
8702          (this.w = a[b + 3]),
8703          this
8704        )
8705      },
8706      toArray: function (a, b) {
8707        return (
8708          void 0 === a && (a = []),
8709          void 0 === b && (b = 0),
8710          (a[b] = this.x),
8711          (a[b + 1] = this.y),
8712          (a[b + 2] = this.z),
8713          (a[b + 3] = this.w),
8714          a
8715        )
8716      },
8717      fromBufferAttribute: function (a, b, c) {
8718        return (
8719          void 0 !== c &&
8720            console.warn(
8721              'THREE.Vector4: offset has been removed from .fromBufferAttribute().'
8722            ),
8723          (this.x = a.getX(b)),
8724          (this.y = a.getY(b)),
8725          (this.z = a.getZ(b)),
8726          (this.w = a.getW(b)),
8727          this
8728        )
8729      }
8730    }),
8731    (yb.prototype = {
8732      constructor: yb,
8733      isWebGLRenderTarget: !0,
8734      setSize: function (a, b) {
8735        ;(this.width === a && this.height === b) ||
8736          ((this.width = a), (this.height = b), this.dispose()),
8737          this.viewport.set(0, 0, a, b),
8738          this.scissor.set(0, 0, a, b)
8739      },
8740      clone: function () {
8741        return new this.constructor().copy(this)
8742      },
8743      copy: function (a) {
8744        return (
8745          (this.width = a.width),
8746          (this.height = a.height),
8747          this.viewport.copy(a.viewport),
8748          (this.texture = a.texture.clone()),
8749          (this.depthBuffer = a.depthBuffer),
8750          (this.stencilBuffer = a.stencilBuffer),
8751          (this.depthTexture = a.depthTexture),
8752          this
8753        )
8754      },
8755      dispose: function () {
8756        this.dispatchEvent({ type: 'dispose' })
8757      }
8758    }),
8759    Object.assign(yb.prototype, b.prototype),
8760    (zb.prototype = Object.create(yb.prototype)),
8761    (zb.prototype.constructor = zb),
8762    (zb.prototype.isWebGLRenderTargetCube = !0),
8763    (Ab.prototype = {
8764      constructor: Ab,
8765      get x() {
8766        return this._x
8767      },
8768      set x(a) {
8769        ;(this._x = a), this.onChangeCallback()
8770      },
8771      get y() {
8772        return this._y
8773      },
8774      set y(a) {
8775        ;(this._y = a), this.onChangeCallback()
8776      },
8777      get z() {
8778        return this._z
8779      },
8780      set z(a) {
8781        ;(this._z = a), this.onChangeCallback()
8782      },
8783      get w() {
8784        return this._w
8785      },
8786      set w(a) {
8787        ;(this._w = a), this.onChangeCallback()
8788      },
8789      set: function (a, b, c, d) {
8790        return (
8791          (this._x = a),
8792          (this._y = b),
8793          (this._z = c),
8794          (this._w = d),
8795          this.onChangeCallback(),
8796          this
8797        )
8798      },
8799      clone: function () {
8800        return new this.constructor(this._x, this._y, this._z, this._w)
8801      },
8802      copy: function (a) {
8803        return (
8804          (this._x = a.x),
8805          (this._y = a.y),
8806          (this._z = a.z),
8807          (this._w = a.w),
8808          this.onChangeCallback(),
8809          this
8810        )
8811      },
8812      setFromEuler: function (a, b) {
8813        if ((a && a.isEuler) === !1)
8814          throw new Error(
8815            'THREE.Quaternion: .setFromEuler() now expects an Euler rotation rather than a Vector3 and order.'
8816          )
8817        var c = Math.cos(a._x / 2),
8818          d = Math.cos(a._y / 2),
8819          e = Math.cos(a._z / 2),
8820          f = Math.sin(a._x / 2),
8821          g = Math.sin(a._y / 2),
8822          h = Math.sin(a._z / 2),
8823          i = a.order
8824        return (
8825          'XYZ' === i
8826            ? ((this._x = f * d * e + c * g * h),
8827              (this._y = c * g * e - f * d * h),
8828              (this._z = c * d * h + f * g * e),
8829              (this._w = c * d * e - f * g * h))
8830            : 'YXZ' === i
8831            ? ((this._x = f * d * e + c * g * h),
8832              (this._y = c * g * e - f * d * h),
8833              (this._z = c * d * h - f * g * e),
8834              (this._w = c * d * e + f * g * h))
8835            : 'ZXY' === i
8836            ? ((this._x = f * d * e - c * g * h),
8837              (this._y = c * g * e + f * d * h),
8838              (this._z = c * d * h + f * g * e),
8839              (this._w = c * d * e - f * g * h))
8840            : 'ZYX' === i
8841            ? ((this._x = f * d * e - c * g * h),
8842              (this._y = c * g * e + f * d * h),
8843              (this._z = c * d * h - f * g * e),
8844              (this._w = c * d * e + f * g * h))
8845            : 'YZX' === i
8846            ? ((this._x = f * d * e + c * g * h),
8847              (this._y = c * g * e + f * d * h),
8848              (this._z = c * d * h - f * g * e),
8849              (this._w = c * d * e - f * g * h))
8850            : 'XZY' === i &&
8851              ((this._x = f * d * e - c * g * h),
8852              (this._y = c * g * e - f * d * h),
8853              (this._z = c * d * h + f * g * e),
8854              (this._w = c * d * e + f * g * h)),
8855          b !== !1 && this.onChangeCallback(),
8856          this
8857        )
8858      },
8859      setFromAxisAngle: function (a, b) {
8860        var c = b / 2,
8861          d = Math.sin(c)
8862        return (
8863          (this._x = a.x * d),
8864          (this._y = a.y * d),
8865          (this._z = a.z * d),
8866          (this._w = Math.cos(c)),
8867          this.onChangeCallback(),
8868          this
8869        )
8870      },
8871      setFromRotationMatrix: function (a) {
8872        var m,
8873          b = a.elements,
8874          c = b[0],
8875          d = b[4],
8876          e = b[8],
8877          f = b[1],
8878          g = b[5],
8879          h = b[9],
8880          i = b[2],
8881          j = b[6],
8882          k = b[10],
8883          l = c + g + k
8884        return (
8885          l > 0
8886            ? ((m = 0.5 / Math.sqrt(l + 1)),
8887              (this._w = 0.25 / m),
8888              (this._x = (j - h) * m),
8889              (this._y = (e - i) * m),
8890              (this._z = (f - d) * m))
8891            : c > g && c > k
8892            ? ((m = 2 * Math.sqrt(1 + c - g - k)),
8893              (this._w = (j - h) / m),
8894              (this._x = 0.25 * m),
8895              (this._y = (d + f) / m),
8896              (this._z = (e + i) / m))
8897            : g > k
8898            ? ((m = 2 * Math.sqrt(1 + g - c - k)),
8899              (this._w = (e - i) / m),
8900              (this._x = (d + f) / m),
8901              (this._y = 0.25 * m),
8902              (this._z = (h + j) / m))
8903            : ((m = 2 * Math.sqrt(1 + k - c - g)),
8904              (this._w = (f - d) / m),
8905              (this._x = (e + i) / m),
8906              (this._y = (h + j) / m),
8907              (this._z = 0.25 * m)),
8908          this.onChangeCallback(),
8909          this
8910        )
8911      },
8912      setFromUnitVectors: (function () {
8913        var a,
8914          b,
8915          c = 1e-6
8916        return function (e, f) {
8917          return (
8918            void 0 === a && (a = new Bb()),
8919            (b = e.dot(f) + 1),
8920            b < c
8921              ? ((b = 0),
8922                Math.abs(e.x) > Math.abs(e.z)
8923                  ? a.set(-e.y, e.x, 0)
8924                  : a.set(0, -e.z, e.y))
8925              : a.crossVectors(e, f),
8926            (this._x = a.x),
8927            (this._y = a.y),
8928            (this._z = a.z),
8929            (this._w = b),
8930            this.normalize()
8931          )
8932        }
8933      })(),
8934      inverse: function () {
8935        return this.conjugate().normalize()
8936      },
8937      conjugate: function () {
8938        return (
8939          (this._x *= -1),
8940          (this._y *= -1),
8941          (this._z *= -1),
8942          this.onChangeCallback(),
8943          this
8944        )
8945      },
8946      dot: function (a) {
8947        return this._x * a._x + this._y * a._y + this._z * a._z + this._w * a._w
8948      },
8949      lengthSq: function () {
8950        return (
8951          this._x * this._x +
8952          this._y * this._y +
8953          this._z * this._z +
8954          this._w * this._w
8955        )
8956      },
8957      length: function () {
8958        return Math.sqrt(
8959          this._x * this._x +
8960            this._y * this._y +
8961            this._z * this._z +
8962            this._w * this._w
8963        )
8964      },
8965      normalize: function () {
8966        var a = this.length()
8967        return (
8968          0 === a
8969            ? ((this._x = 0), (this._y = 0), (this._z = 0), (this._w = 1))
8970            : ((a = 1 / a),
8971              (this._x = this._x * a),
8972              (this._y = this._y * a),
8973              (this._z = this._z * a),
8974              (this._w = this._w * a)),
8975          this.onChangeCallback(),
8976          this
8977        )
8978      },
8979      multiply: function (a, b) {
8980        return void 0 !== b
8981          ? (console.warn(
8982              'THREE.Quaternion: .multiply() now only accepts one argument. Use .multiplyQuaternions( a, b ) instead.'
8983            ),
8984            this.multiplyQuaternions(a, b))
8985          : this.multiplyQuaternions(this, a)
8986      },
8987      premultiply: function (a) {
8988        return this.multiplyQuaternions(a, this)
8989      },
8990      multiplyQuaternions: function (a, b) {
8991        var c = a._x,
8992          d = a._y,
8993          e = a._z,
8994          f = a._w,
8995          g = b._x,
8996          h = b._y,
8997          i = b._z,
8998          j = b._w
8999        return (
9000          (this._x = c * j + f * g + d * i - e * h),
9001          (this._y = d * j + f * h + e * g - c * i),
9002          (this._z = e * j + f * i + c * h - d * g),
9003          (this._w = f * j - c * g - d * h - e * i),
9004          this.onChangeCallback(),
9005          this
9006        )
9007      },
9008      slerp: function (a, b) {
9009        if (0 === b) return this
9010        if (1 === b) return this.copy(a)
9011        var c = this._x,
9012          d = this._y,
9013          e = this._z,
9014          f = this._w,
9015          g = f * a._w + c * a._x + d * a._y + e * a._z
9016        if (
9017          (g < 0
9018            ? ((this._w = -a._w),
9019              (this._x = -a._x),
9020              (this._y = -a._y),
9021              (this._z = -a._z),
9022              (g = -g))
9023            : this.copy(a),
9024          g >= 1)
9025        )
9026          return (
9027            (this._w = f), (this._x = c), (this._y = d), (this._z = e), this
9028          )
9029        var h = Math.sqrt(1 - g * g)
9030        if (Math.abs(h) < 0.001)
9031          return (
9032            (this._w = 0.5 * (f + this._w)),
9033            (this._x = 0.5 * (c + this._x)),
9034            (this._y = 0.5 * (d + this._y)),
9035            (this._z = 0.5 * (e + this._z)),
9036            this
9037          )
9038        var i = Math.atan2(h, g),
9039          j = Math.sin((1 - b) * i) / h,
9040          k = Math.sin(b * i) / h
9041        return (
9042          (this._w = f * j + this._w * k),
9043          (this._x = c * j + this._x * k),
9044          (this._y = d * j + this._y * k),
9045          (this._z = e * j + this._z * k),
9046          this.onChangeCallback(),
9047          this
9048        )
9049      },
9050      equals: function (a) {
9051        return (
9052          a._x === this._x &&
9053          a._y === this._y &&
9054          a._z === this._z &&
9055          a._w === this._w
9056        )
9057      },
9058      fromArray: function (a, b) {
9059        return (
9060          void 0 === b && (b = 0),
9061          (this._x = a[b]),
9062          (this._y = a[b + 1]),
9063          (this._z = a[b + 2]),
9064          (this._w = a[b + 3]),
9065          this.onChangeCallback(),
9066          this
9067        )
9068      },
9069      toArray: function (a, b) {
9070        return (
9071          void 0 === a && (a = []),
9072          void 0 === b && (b = 0),
9073          (a[b] = this._x),
9074          (a[b + 1] = this._y),
9075          (a[b + 2] = this._z),
9076          (a[b + 3] = this._w),
9077          a
9078        )
9079      },
9080      onChange: function (a) {
9081        return (this.onChangeCallback = a), this
9082      },
9083      onChangeCallback: function () {}
9084    }),
9085    Object.assign(Ab, {
9086      slerp: function (a, b, c, d) {
9087        return c.copy(a).slerp(b, d)
9088      },
9089      slerpFlat: function (a, b, c, d, e, f, g) {
9090        var h = c[d + 0],
9091          i = c[d + 1],
9092          j = c[d + 2],
9093          k = c[d + 3],
9094          l = e[f + 0],
9095          m = e[f + 1],
9096          n = e[f + 2],
9097          o = e[f + 3]
9098        if (k !== o || h !== l || i !== m || j !== n) {
9099          var p = 1 - g,
9100            q = h * l + i * m + j * n + k * o,
9101            r = q >= 0 ? 1 : -1,
9102            s = 1 - q * q
9103          if (s > Number.EPSILON) {
9104            var t = Math.sqrt(s),
9105              u = Math.atan2(t, q * r)
9106            ;(p = Math.sin(p * u) / t), (g = Math.sin(g * u) / t)
9107          }
9108          var v = g * r
9109          if (
9110            ((h = h * p + l * v),
9111            (i = i * p + m * v),
9112            (j = j * p + n * v),
9113            (k = k * p + o * v),
9114            p === 1 - g)
9115          ) {
9116            var w = 1 / Math.sqrt(h * h + i * i + j * j + k * k)
9117            ;(h *= w), (i *= w), (j *= w), (k *= w)
9118          }
9119        }
9120        ;(a[b] = h), (a[b + 1] = i), (a[b + 2] = j), (a[b + 3] = k)
9121      }
9122    }),
9123    (Bb.prototype = {
9124      constructor: Bb,
9125      isVector3: !0,
9126      set: function (a, b, c) {
9127        return (this.x = a), (this.y = b), (this.z = c), this
9128      },
9129      setScalar: function (a) {
9130        return (this.x = a), (this.y = a), (this.z = a), this
9131      },
9132      setX: function (a) {
9133        return (this.x = a), this
9134      },
9135      setY: function (a) {
9136        return (this.y = a), this
9137      },
9138      setZ: function (a) {
9139        return (this.z = a), this
9140      },
9141      setComponent: function (a, b) {
9142        switch (a) {
9143          case 0:
9144            this.x = b
9145            break
9146          case 1:
9147            this.y = b
9148            break
9149          case 2:
9150            this.z = b
9151            break
9152          default:
9153            throw new Error('index is out of range: ' + a)
9154        }
9155        return this
9156      },
9157      getComponent: function (a) {
9158        switch (a) {
9159          case 0:
9160            return this.x
9161          case 1:
9162            return this.y
9163          case 2:
9164            return this.z
9165          default:
9166            throw new Error('index is out of range: ' + a)
9167        }
9168      },
9169      clone: function () {
9170        return new this.constructor(this.x, this.y, this.z)
9171      },
9172      copy: function (a) {
9173        return (this.x = a.x), (this.y = a.y), (this.z = a.z), this
9174      },
9175      add: function (a, b) {
9176        return void 0 !== b
9177          ? (console.warn(
9178              'THREE.Vector3: .add() now only accepts one argument. Use .addVectors( a, b ) instead.'
9179            ),
9180            this.addVectors(a, b))
9181          : ((this.x += a.x), (this.y += a.y), (this.z += a.z), this)
9182      },
9183      addScalar: function (a) {
9184        return (this.x += a), (this.y += a), (this.z += a), this
9185      },
9186      addVectors: function (a, b) {
9187        return (
9188          (this.x = a.x + b.x), (this.y = a.y + b.y), (this.z = a.z + b.z), this
9189        )
9190      },
9191      addScaledVector: function (a, b) {
9192        return (
9193          (this.x += a.x * b), (this.y += a.y * b), (this.z += a.z * b), this
9194        )
9195      },
9196      sub: function (a, b) {
9197        return void 0 !== b
9198          ? (console.warn(
9199              'THREE.Vector3: .sub() now only accepts one argument. Use .subVectors( a, b ) instead.'
9200            ),
9201            this.subVectors(a, b))
9202          : ((this.x -= a.x), (this.y -= a.y), (this.z -= a.z), this)
9203      },
9204      subScalar: function (a) {
9205        return (this.x -= a), (this.y -= a), (this.z -= a), this
9206      },
9207      subVectors: function (a, b) {
9208        return (
9209          (this.x = a.x - b.x), (this.y = a.y - b.y), (this.z = a.z - b.z), this
9210        )
9211      },
9212      multiply: function (a, b) {
9213        return void 0 !== b
9214          ? (console.warn(
9215              'THREE.Vector3: .multiply() now only accepts one argument. Use .multiplyVectors( a, b ) instead.'
9216            ),
9217            this.multiplyVectors(a, b))
9218          : ((this.x *= a.x), (this.y *= a.y), (this.z *= a.z), this)
9219      },
9220      multiplyScalar: function (a) {
9221        return (
9222          isFinite(a)
9223            ? ((this.x *= a), (this.y *= a), (this.z *= a))
9224            : ((this.x = 0), (this.y = 0), (this.z = 0)),
9225          this
9226        )
9227      },
9228      multiplyVectors: function (a, b) {
9229        return (
9230          (this.x = a.x * b.x), (this.y = a.y * b.y), (this.z = a.z * b.z), this
9231        )
9232      },
9233      applyEuler: (function () {
9234        var a
9235        return function (c) {
9236          return (
9237            (c && c.isEuler) === !1 &&
9238              console.error(
9239                'THREE.Vector3: .applyEuler() now expects an Euler rotation rather than a Vector3 and order.'
9240              ),
9241            void 0 === a && (a = new Ab()),
9242            this.applyQuaternion(a.setFromEuler(c))
9243          )
9244        }
9245      })(),
9246      applyAxisAngle: (function () {
9247        var a
9248        return function (c, d) {
9249          return (
9250            void 0 === a && (a = new Ab()),
9251            this.applyQuaternion(a.setFromAxisAngle(c, d))
9252          )
9253        }
9254      })(),
9255      applyMatrix3: function (a) {
9256        var b = this.x,
9257          c = this.y,
9258          d = this.z,
9259          e = a.elements
9260        return (
9261          (this.x = e[0] * b + e[3] * c + e[6] * d),
9262          (this.y = e[1] * b + e[4] * c + e[7] * d),
9263          (this.z = e[2] * b + e[5] * c + e[8] * d),
9264          this
9265        )
9266      },
9267      applyMatrix4: function (a) {
9268        var b = this.x,
9269          c = this.y,
9270          d = this.z,
9271          e = a.elements
9272        ;(this.x = e[0] * b + e[4] * c + e[8] * d + e[12]),
9273          (this.y = e[1] * b + e[5] * c + e[9] * d + e[13]),
9274          (this.z = e[2] * b + e[6] * c + e[10] * d + e[14])
9275        var f = e[3] * b + e[7] * c + e[11] * d + e[15]
9276        return this.divideScalar(f)
9277      },
9278      applyQuaternion: function (a) {
9279        var b = this.x,
9280          c = this.y,
9281          d = this.z,
9282          e = a.x,
9283          f = a.y,
9284          g = a.z,
9285          h = a.w,
9286          i = h * b + f * d - g * c,
9287          j = h * c + g * b - e * d,
9288          k = h * d + e * c - f * b,
9289          l = -e * b - f * c - g * d
9290        return (
9291          (this.x = i * h + l * -e + j * -g - k * -f),
9292          (this.y = j * h + l * -f + k * -e - i * -g),
9293          (this.z = k * h + l * -g + i * -f - j * -e),
9294          this
9295        )
9296      },
9297      project: (function () {
9298        var a
9299        return function (c) {
9300          return (
9301            void 0 === a && (a = new Cb()),
9302            a.multiplyMatrices(c.projectionMatrix, a.getInverse(c.matrixWorld)),
9303            this.applyMatrix4(a)
9304          )
9305        }
9306      })(),
9307      unproject: (function () {
9308        var a
9309        return function (c) {
9310          return (
9311            void 0 === a && (a = new Cb()),
9312            a.multiplyMatrices(c.matrixWorld, a.getInverse(c.projectionMatrix)),
9313            this.applyMatrix4(a)
9314          )
9315        }
9316      })(),
9317      transformDirection: function (a) {
9318        var b = this.x,
9319          c = this.y,
9320          d = this.z,
9321          e = a.elements
9322        return (
9323          (this.x = e[0] * b + e[4] * c + e[8] * d),
9324          (this.y = e[1] * b + e[5] * c + e[9] * d),
9325          (this.z = e[2] * b + e[6] * c + e[10] * d),
9326          this.normalize()
9327        )
9328      },
9329      divide: function (a) {
9330        return (this.x /= a.x), (this.y /= a.y), (this.z /= a.z), this
9331      },
9332      divideScalar: function (a) {
9333        return this.multiplyScalar(1 / a)
9334      },
9335      min: function (a) {
9336        return (
9337          (this.x = Math.min(this.x, a.x)),
9338          (this.y = Math.min(this.y, a.y)),
9339          (this.z = Math.min(this.z, a.z)),
9340          this
9341        )
9342      },
9343      max: function (a) {
9344        return (
9345          (this.x = Math.max(this.x, a.x)),
9346          (this.y = Math.max(this.y, a.y)),
9347          (this.z = Math.max(this.z, a.z)),
9348          this
9349        )
9350      },
9351      clamp: function (a, b) {
9352        return (
9353          (this.x = Math.max(a.x, Math.min(b.x, this.x))),
9354          (this.y = Math.max(a.y, Math.min(b.y, this.y))),
9355          (this.z = Math.max(a.z, Math.min(b.z, this.z))),
9356          this
9357        )
9358      },
9359      clampScalar: (function () {
9360        var a, b
9361        return function (d, e) {
9362          return (
9363            void 0 === a && ((a = new Bb()), (b = new Bb())),
9364            a.set(d, d, d),
9365            b.set(e, e, e),
9366            this.clamp(a, b)
9367          )
9368        }
9369      })(),
9370      clampLength: function (a, b) {
9371        var c = this.length()
9372        return this.multiplyScalar(Math.max(a, Math.min(b, c)) / c)
9373      },
9374      floor: function () {
9375        return (
9376          (this.x = Math.floor(this.x)),
9377          (this.y = Math.floor(this.y)),
9378          (this.z = Math.floor(this.z)),
9379          this
9380        )
9381      },
9382      ceil: function () {
9383        return (
9384          (this.x = Math.ceil(this.x)),
9385          (this.y = Math.ceil(this.y)),
9386          (this.z = Math.ceil(this.z)),
9387          this
9388        )
9389      },
9390      round: function () {
9391        return (
9392          (this.x = Math.round(this.x)),
9393          (this.y = Math.round(this.y)),
9394          (this.z = Math.round(this.z)),
9395          this
9396        )
9397      },
9398      roundToZero: function () {
9399        return (
9400          (this.x = this.x < 0 ? Math.ceil(this.x) : Math.floor(this.x)),
9401          (this.y = this.y < 0 ? Math.ceil(this.y) : Math.floor(this.y)),
9402          (this.z = this.z < 0 ? Math.ceil(this.z) : Math.floor(this.z)),
9403          this
9404        )
9405      },
9406      negate: function () {
9407        return (this.x = -this.x), (this.y = -this.y), (this.z = -this.z), this
9408      },
9409      dot: function (a) {
9410        return this.x * a.x + this.y * a.y + this.z * a.z
9411      },
9412      lengthSq: function () {
9413        return this.x * this.x + this.y * this.y + this.z * this.z
9414      },
9415      length: function () {
9416        return Math.sqrt(this.x * this.x + this.y * this.y + this.z * this.z)
9417      },
9418      lengthManhattan: function () {
9419        return Math.abs(this.x) + Math.abs(this.y) + Math.abs(this.z)
9420      },
9421      normalize: function () {
9422        return this.divideScalar(this.length())
9423      },
9424      setLength: function (a) {
9425        return this.multiplyScalar(a / this.length())
9426      },
9427      lerp: function (a, b) {
9428        return (
9429          (this.x += (a.x - this.x) * b),
9430          (this.y += (a.y - this.y) * b),
9431          (this.z += (a.z - this.z) * b),
9432          this
9433        )
9434      },
9435      lerpVectors: function (a, b, c) {
9436        return this.subVectors(b, a).multiplyScalar(c).add(a)
9437      },
9438      cross: function (a, b) {
9439        if (void 0 !== b)
9440          return (
9441            console.warn(
9442              'THREE.Vector3: .cross() now only accepts one argument. Use .crossVectors( a, b ) instead.'
9443            ),
9444            this.crossVectors(a, b)
9445          )
9446        var c = this.x,
9447          d = this.y,
9448          e = this.z
9449        return (
9450          (this.x = d * a.z - e * a.y),
9451          (this.y = e * a.x - c * a.z),
9452          (this.z = c * a.y - d * a.x),
9453          this
9454        )
9455      },
9456      crossVectors: function (a, b) {
9457        var c = a.x,
9458          d = a.y,
9459          e = a.z,
9460          f = b.x,
9461          g = b.y,
9462          h = b.z
9463        return (
9464          (this.x = d * h - e * g),
9465          (this.y = e * f - c * h),
9466          (this.z = c * g - d * f),
9467          this
9468        )
9469      },
9470      projectOnVector: function (a) {
9471        var b = a.dot(this) / a.lengthSq()
9472        return this.copy(a).multiplyScalar(b)
9473      },
9474      projectOnPlane: (function () {
9475        var a
9476        return function (c) {
9477          return (
9478            void 0 === a && (a = new Bb()),
9479            a.copy(this).projectOnVector(c),
9480            this.sub(a)
9481          )
9482        }
9483      })(),
9484      reflect: (function () {
9485        var a
9486        return function (c) {
9487          return (
9488            void 0 === a && (a = new Bb()),
9489            this.sub(a.copy(c).multiplyScalar(2 * this.dot(c)))
9490          )
9491        }
9492      })(),
9493      angleTo: function (a) {
9494        var b = this.dot(a) / Math.sqrt(this.lengthSq() * a.lengthSq())
9495        return Math.acos(tb.clamp(b, -1, 1))
9496      },
9497      distanceTo: function (a) {
9498        return Math.sqrt(this.distanceToSquared(a))
9499      },
9500      distanceToSquared: function (a) {
9501        var b = this.x - a.x,
9502          c = this.y - a.y,
9503          d = this.z - a.z
9504        return b * b + c * c + d * d
9505      },
9506      distanceToManhattan: function (a) {
9507        return (
9508          Math.abs(this.x - a.x) +
9509          Math.abs(this.y - a.y) +
9510          Math.abs(this.z - a.z)
9511        )
9512      },
9513      setFromSpherical: function (a) {
9514        var b = Math.sin(a.phi) * a.radius
9515        return (
9516          (this.x = b * Math.sin(a.theta)),
9517          (this.y = Math.cos(a.phi) * a.radius),
9518          (this.z = b * Math.cos(a.theta)),
9519          this
9520        )
9521      },
9522      setFromCylindrical: function (a) {
9523        return (
9524          (this.x = a.radius * Math.sin(a.theta)),
9525          (this.y = a.y),
9526          (this.z = a.radius * Math.cos(a.theta)),
9527          this
9528        )
9529      },
9530      setFromMatrixPosition: function (a) {
9531        return this.setFromMatrixColumn(a, 3)
9532      },
9533      setFromMatrixScale: function (a) {
9534        var b = this.setFromMatrixColumn(a, 0).length(),
9535          c = this.setFromMatrixColumn(a, 1).length(),
9536          d = this.setFromMatrixColumn(a, 2).length()
9537        return (this.x = b), (this.y = c), (this.z = d), this
9538      },
9539      setFromMatrixColumn: function (a, b) {
9540        if ('number' == typeof a) {
9541          console.warn(
9542            'THREE.Vector3: setFromMatrixColumn now expects ( matrix, index ).'
9543          )
9544          var c = a
9545          ;(a = b), (b = c)
9546        }
9547        return this.fromArray(a.elements, 4 * b)
9548      },
9549      equals: function (a) {
9550        return a.x === this.x && a.y === this.y && a.z === this.z
9551      },
9552      fromArray: function (a, b) {
9553        return (
9554          void 0 === b && (b = 0),
9555          (this.x = a[b]),
9556          (this.y = a[b + 1]),
9557          (this.z = a[b + 2]),
9558          this
9559        )
9560      },
9561      toArray: function (a, b) {
9562        return (
9563          void 0 === a && (a = []),
9564          void 0 === b && (b = 0),
9565          (a[b] = this.x),
9566          (a[b + 1] = this.y),
9567          (a[b + 2] = this.z),
9568          a
9569        )
9570      },
9571      fromBufferAttribute: function (a, b, c) {
9572        return (
9573          void 0 !== c &&
9574            console.warn(
9575              'THREE.Vector3: offset has been removed from .fromBufferAttribute().'
9576            ),
9577          (this.x = a.getX(b)),
9578          (this.y = a.getY(b)),
9579          (this.z = a.getZ(b)),
9580          this
9581        )
9582      }
9583    }),
9584    (Cb.prototype = {
9585      constructor: Cb,
9586      isMatrix4: !0,
9587      set: function (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p) {
9588        var q = this.elements
9589        return (
9590          (q[0] = a),
9591          (q[4] = b),
9592          (q[8] = c),
9593          (q[12] = d),
9594          (q[1] = e),
9595          (q[5] = f),
9596          (q[9] = g),
9597          (q[13] = h),
9598          (q[2] = i),
9599          (q[6] = j),
9600          (q[10] = k),
9601          (q[14] = l),
9602          (q[3] = m),
9603          (q[7] = n),
9604          (q[11] = o),
9605          (q[15] = p),
9606          this
9607        )
9608      },
9609      identity: function () {
9610        return this.set(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1), this
9611      },
9612      clone: function () {
9613        return new Cb().fromArray(this.elements)
9614      },
9615      copy: function (a) {
9616        return this.elements.set(a.elements), this
9617      },
9618      copyPosition: function (a) {
9619        var b = this.elements,
9620          c = a.elements
9621        return (b[12] = c[12]), (b[13] = c[13]), (b[14] = c[14]), this
9622      },
9623      extractBasis: function (a, b, c) {
9624        return (
9625          a.setFromMatrixColumn(this, 0),
9626          b.setFromMatrixColumn(this, 1),
9627          c.setFromMatrixColumn(this, 2),
9628          this
9629        )
9630      },
9631      makeBasis: function (a, b, c) {
9632        return (
9633          this.set(
9634            a.x,
9635            b.x,
9636            c.x,
9637            0,
9638            a.y,
9639            b.y,
9640            c.y,
9641            0,
9642            a.z,
9643            b.z,
9644            c.z,
9645            0,
9646            0,
9647            0,
9648            0,
9649            1
9650          ),
9651          this
9652        )
9653      },
9654      extractRotation: (function () {
9655        var a
9656        return function (c) {
9657          void 0 === a && (a = new Bb())
9658          var d = this.elements,
9659            e = c.elements,
9660            f = 1 / a.setFromMatrixColumn(c, 0).length(),
9661            g = 1 / a.setFromMatrixColumn(c, 1).length(),
9662            h = 1 / a.setFromMatrixColumn(c, 2).length()
9663          return (
9664            (d[0] = e[0] * f),
9665            (d[1] = e[1] * f),
9666            (d[2] = e[2] * f),
9667            (d[4] = e[4] * g),
9668            (d[5] = e[5] * g),
9669            (d[6] = e[6] * g),
9670            (d[8] = e[8] * h),
9671            (d[9] = e[9] * h),
9672            (d[10] = e[10] * h),
9673            this
9674          )
9675        }
9676      })(),
9677      makeRotationFromEuler: function (a) {
9678        ;
9678(a && a.isEuler) === !1 &&
9679          console.error(
9680            'THREE.Matrix: .makeRotationFromEuler() now expects a Euler rotation rather than a Vector3 and order.'
9681          )
9682        var b = this.elements,
9683          c = a.x,
9684          d = a.y,
9685          e = a.z,
9686          f = Math.cos(c),
9687          g = Math.sin(c),
9688          h = Math.cos(d),
9689          i = Math.sin(d),
9690          j = Math.cos(e),
9691          k = Math.sin(e)
9692        if ('XYZ' === a.order) {
9693          var l = f * j,
9694            m = f * k,
9695            n = g * j,
9696            o = g * k
9697          ;(b[0] = h * j),
9698            (b[4] = -h * k),
9699            (b[8] = i),
9700            (b[1] = m + n * i),
9701            (b[5] = l - o * i),
9702            (b[9] = -g * h),
9703            (b[2] = o - l * i),
9704            (b[6] = n + m * i),
9705            (b[10] = f * h)
9706        } else if ('YXZ' === a.order) {
9707          var p = h * j,
9708            q = h * k,
9709            r = i * j,
9710            s = i * k
9711          ;(b[0] = p + s * g),
9712            (b[4] = r * g - q),
9713            (b[8] = f * i),
9714            (b[1] = f * k),
9715            (b[5] = f * j),
9716            (b[9] = -g),
9717            (b[2] = q * g - r),
9718            (b[6] = s + p * g),
9719            (b[10] = f * h)
9720        } else if ('ZXY' === a.order) {
9721          var p = h * j,
9722            q = h * k,
9723            r = i * j,
9724            s = i * k
9725          ;(b[0] = p - s * g),
9726            (b[4] = -f * k),
9727            (b[8] = r + q * g),
9728            (b[1] = q + r * g),
9729            (b[5] = f * j),
9730            (b[9] = s - p * g),
9731            (b[2] = -f * i),
9732            (b[6] = g),
9733            (b[10] = f * h)
9734        } else if ('ZYX' === a.order) {
9735          var l = f * j,
9736            m = f * k,
9737            n = g * j,
9738            o = g * k
9739          ;(b[0] = h * j),
9740            (b[4] = n * i - m),
9741            (b[8] = l * i + o),
9742            (b[1] = h * k),
9743            (b[5] = o * i + l),
9744            (b[9] = m * i - n),
9745            (b[2] = -i),
9746            (b[6] = g * h),
9747            (b[10] = f * h)
9748        } else if ('YZX' === a.order) {
9749          var t = f * h,
9750            u = f * i,
9751            v = g * h,
9752            w = g * i
9753          ;(b[0] = h * j),
9754            (b[4] = w - t * k),
9755            (b[8] = v * k + u),
9756            (b[1] = k),
9757            (b[5] = f * j),
9758            (b[9] = -g * j),
9759            (b[2] = -i * j),
9760            (b[6] = u * k + v),
9761            (b[10] = t - w * k)
9762        } else if ('XZY' === a.order) {
9763          var t = f * h,
9764            u = f * i,
9765            v = g * h,
9766            w = g * i
9767          ;(b[0] = h * j),
9768            (b[4] = -k),
9769            (b[8] = i * j),
9770            (b[1] = t * k + w),
9771            (b[5] = f * j),
9772            (b[9] = u * k - v),
9773            (b[2] = v * k - u),
9774            (b[6] = g * j),
9775            (b[10] = w * k + t)
9776        }
9777        return (
9778          (b[3] = 0),
9779          (b[7] = 0),
9780          (b[11] = 0),
9781          (b[12] = 0),
9782          (b[13] = 0),
9783          (b[14] = 0),
9784          (b[15] = 1),
9785          this
9786        )
9787      },
9788      makeRotationFromQuaternion: function (a) {
9789        var b = this.elements,
9790          c = a.x,
9791          d = a.y,
9792          e = a.z,
9793          f = a.w,
9794          g = c + c,
9795          h = d + d,
9796          i = e + e,
9797          j = c * g,
9798          k = c * h,
9799          l = c * i,
9800          m = d * h,
9801          n = d * i,
9802          o = e * i,
9803          p = f * g,
9804          q = f * h,
9805          r = f * i
9806        return (
9807          (b[0] = 1 - (m + o)),
9808          (b[4] = k - r),
9809          (b[8] = l + q),
9810          (b[1] = k + r),
9811          (b[5] = 1 - (j + o)),
9812          (b[9] = n - p),
9813          (b[2] = l - q),
9814          (b[6] = n + p),
9815          (b[10] = 1 - (j + m)),
9816          (b[3] = 0),
9817          (b[7] = 0),
9818          (b[11] = 0),
9819          (b[12] = 0),
9820          (b[13] = 0),
9821          (b[14] = 0),
9822          (b[15] = 1),
9823          this
9824        )
9825      },
9826      lookAt: (function () {
9827        var a, b, c
9828        return function (e, f, g) {
9829          void 0 === a && ((a = new Bb()), (b = new Bb()), (c = new Bb()))
9830          var h = this.elements
9831          return (
9832            c.subVectors(e, f).normalize(),
9833            0 === c.lengthSq() && (c.z = 1),
9834            a.crossVectors(g, c).normalize(),
9835            0 === a.lengthSq() &&
9836              ((c.z += 1e-4), a.crossVectors(g, c).normalize()),
9837            b.crossVectors(c, a),
9838            (h[0] = a.x),
9839            (h[4] = b.x),
9840            (h[8] = c.x),
9841            (h[1] = a.y),
9842            (h[5] = b.y),
9843            (h[9] = c.y),
9844            (h[2] = a.z),
9845            (h[6] = b.z),
9846            (h[10] = c.z),
9847            this
9848          )
9849        }
9850      })(),
9851      multiply: function (a, b) {
9852        return void 0 !== b
9853          ? (console.warn(
9854              'THREE.Matrix4: .multiply() now only accepts one argument. Use .multiplyMatrices( a, b ) instead.'
9855            ),
9856            this.multiplyMatrices(a, b))
9857          : this.multiplyMatrices(this, a)
9858      },
9859      premultiply: function (a) {
9860        return this.multiplyMatrices(a, this)
9861      },
9862      multiplyMatrices: function (a, b) {
9863        var c = a.elements,
9864          d = b.elements,
9865          e = this.elements,
9866          f = c[0],
9867          g = c[4],
9868          h = c[8],
9869          i = c[12],
9870          j = c[1],
9871          k = c[5],
9872          l = c[9],
9873          m = c[13],
9874          n = c[2],
9875          o = c[6],
9876          p = c[10],
9877          q = c[14],
9878          r = c[3],
9879          s = c[7],
9880          t = c[11],
9881          u = c[15],
9882          v = d[0],
9883          w = d[4],
9884          x = d[8],
9885          y = d[12],
9886          z = d[1],
9887          A = d[5],
9888          B = d[9],
9889          C = d[13],
9890          D = d[2],
9891          E = d[6],
9892          F = d[10],
9893          G = d[14],
9894          H = d[3],
9895          I = d[7],
9896          J = d[11],
9897          K = d[15]
9898        return (
9899          (e[0] = f * v + g * z + h * D + i * H),
9900          (e[4] = f * w + g * A + h * E + i * I),
9901          (e[8] = f * x + g * B + h * F + i * J),
9902          (e[12] = f * y + g * C + h * G + i * K),
9903          (e[1] = j * v + k * z + l * D + m * H),
9904          (e[5] = j * w + k * A + l * E + m * I),
9905          (e[9] = j * x + k * B + l * F + m * J),
9906          (e[13] = j * y + k * C + l * G + m * K),
9907          (e[2] = n * v + o * z + p * D + q * H),
9908          (e[6] = n * w + o * A + p * E + q * I),
9909          (e[10] = n * x + o * B + p * F + q * J),
9910          (e[14] = n * y + o * C + p * G + q * K),
9911          (e[3] = r * v + s * z + t * D + u * H),
9912          (e[7] = r * w + s * A + t * E + u * I),
9913          (e[11] = r * x + s * B + t * F + u * J),
9914          (e[15] = r * y + s * C + t * G + u * K),
9915          this
9916        )
9917      },
9918      multiplyToArray: function (a, b, c) {
9919        var d = this.elements
9920        return (
9921          this.multiplyMatrices(a, b),
9922          (c[0] = d[0]),
9923          (c[1] = d[1]),
9924          (c[2] = d[2]),
9925          (c[3] = d[3]),
9926          (c[4] = d[4]),
9927          (c[5] = d[5]),
9928          (c[6] = d[6]),
9929          (c[7] = d[7]),
9930          (c[8] = d[8]),
9931          (c[9] = d[9]),
9932          (c[10] = d[10]),
9933          (c[11] = d[11]),
9934          (c[12] = d[12]),
9935          (c[13] = d[13]),
9936          (c[14] = d[14]),
9937          (c[15] = d[15]),
9938          this
9939        )
9940      },
9941      multiplyScalar: function (a) {
9942        var b = this.elements
9943        return (
9944          (b[0] *= a),
9945          (b[4] *= a),
9946          (b[8] *= a),
9947          (b[12] *= a),
9948          (b[1] *= a),
9949          (b[5] *= a),
9950          (b[9] *= a),
9951          (b[13] *= a),
9952          (b[2] *= a),
9953          (b[6] *= a),
9954          (b[10] *= a),
9955          (b[14] *= a),
9956          (b[3] *= a),
9957          (b[7] *= a),
9958          (b[11] *= a),
9959          (b[15] *= a),
9960          this
9961        )
9962      },
9963      applyToBufferAttribute: (function () {
9964        var a
9965        return function (c) {
9966          void 0 === a && (a = new Bb())
9967          for (var d = 0, e = c.count; d < e; d++)
9968            (a.x = c.getX(d)),
9969              (a.y = c.getY(d)),
9970              (a.z = c.getZ(d)),
9971              a.applyMatrix4(this),
9972              c.setXYZ(d, a.x, a.y, a.z)
9973          return c
9974        }
9975      })(),
9976      determinant: function () {
9977        var a = this.elements,
9978          b = a[0],
9979          c = a[4],
9980          d = a[8],
9981          e = a[12],
9982          f = a[1],
9983          g = a[5],
9984          h = a[9],
9985          i = a[13],
9986          j = a[2],
9987          k = a[6],
9988          l = a[10],
9989          m = a[14],
9990          n = a[3],
9991          o = a[7],
9992          p = a[11],
9993          q = a[15]
9994        return (
9995          n *
9996            (+e * h * k -
9997              d * i * k -
9998              e * g * l +
9999              c * i * l +
10000              d * g * m -
10001              c * h * m) +
10002          o *
10003            (+b * h * m -
10004              b * i * l +
10005              e * f * l -
10006              d * f * m +
10007              d * i * j -
10008              e * h * j) +
10009          p *
10010            (+b * i * k -
10011              b * g * m -
10012              e * f * k +
10013              c * f * m +
10014              e * g * j -
10015              c * i * j) +
10016          q *
10017            (-d * g * j -
10018              b * h * k +
10019              b * g * l +
10020              d * f * k -
10021              c * f * l +
10022              c * h * j)
10023        )
10024      },
10025      transpose: function () {
10026        var b,
10027          a = this.elements
10028        return (
10029          (b = a[1]),
10030          (a[1] = a[4]),
10031          (a[4] = b),
10032          (b = a[2]),
10033          (a[2] = a[8]),
10034          (a[8] = b),
10035          (b = a[6]),
10036          (a[6] = a[9]),
10037          (a[9] = b),
10038          (b = a[3]),
10039          (a[3] = a[12]),
10040          (a[12] = b),
10041          (b = a[7]),
10042          (a[7] = a[13]),
10043          (a[13] = b),
10044          (b = a[11]),
10045          (a[11] = a[14]),
10046          (a[14] = b),
10047          this
10048        )
10049      },
10050      setPosition: function (a) {
10051        var b = this.elements
10052        return (b[12] = a.x), (b[13] = a.y), (b[14] = a.z), this
10053      },
10054      getInverse: function (a, b) {
10055        var c = this.elements,
10056          d = a.elements,
10057          e = d[0],
10058          f = d[1],
10059          g = d[2],
10060          h = d[3],
10061          i = d[4],
10062          j = d[5],
10063          k = d[6],
10064          l = d[7],
10065          m = d[8],
10066          n = d[9],
10067          o = d[10],
10068          p = d[11],
10069          q = d[12],
10070          r = d[13],
10071          s = d[14],
10072          t = d[15],
10073          u =
10074            n * s * l -
10075            r * o * l +
10076            r * k * p -
10077            j * s * p -
10078            n * k * t +
10079            j * o * t,
10080          v =
10081            q * o * l -
10082            m * s * l -
10083            q * k * p +
10084            i * s * p +
10085            m * k * t -
10086            i * o * t,
10087          w =
10088            m * r * l -
10089            q * n * l +
10090            q * j * p -
10091            i * r * p -
10092            m * j * t +
10093            i * n * t,
10094          x =
10095            q * n * k -
10096            m * r * k -
10097            q * j * o +
10098            i * r * o +
10099            m * j * s -
10100            i * n * s,
10101          y = e * u + f * v + g * w + h * x
10102        if (0 === y) {
10103          var z =
10104            "THREE.Matrix4.getInverse(): can't invert matrix, determinant is 0"
10105          if (b === !0) throw new Error(z)
10106          return console.warn(z), this.identity()
10107        }
10108        var A = 1 / y
10109        return (
10110          (c[0] = u * A),
10111          (c[1] =
10112            (r * o * h -
10113              n * s * h -
10114              r * g * p +
10115              f * s * p +
10116              n * g * t -
10117              f * o * t) *
10118            A),
10119          (c[2] =
10120            (j * s * h -
10121              r * k * h +
10122              r * g * l -
10123              f * s * l -
10124              j * g * t +
10125              f * k * t) *
10126            A),
10127          (c[3] =
10128            (n * k * h -
10129              j * o * h -
10130              n * g * l +
10131              f * o * l +
10132              j * g * p -
10133              f * k * p) *
10134            A),
10135          (c[4] = v * A),
10136          (c[5] =
10137            (m * s * h -
10138              q * o * h +
10139              q * g * p -
10140              e * s * p -
10141              m * g * t +
10142              e * o * t) *
10143            A),
10144          (c[6] =
10145            (q * k * h -
10146              i * s * h -
10147              q * g * l +
10148              e * s * l +
10149              i * g * t -
10150              e * k * t) *
10151            A),
10152          (c[7] =
10153            (i * o * h -
10154              m * k * h +
10155              m * g * l -
10156              e * o * l -
10157              i * g * p +
10158              e * k * p) *
10159            A),
10160          (c[8] = w * A),
10161          (c[9] =
10162            (q * n * h -
10163              m * r * h -
10164              q * f * p +
10165              e * r * p +
10166              m * f * t -
10167              e * n * t) *
10168            A),
10169          (c[10] =
10170            (i * r * h -
10171              q * j * h +
10172              q * f * l -
10173              e * r * l -
10174              i * f * t +
10175              e * j * t) *
10176            A),
10177          (c[11] =
10178            (m * j * h -
10179              i * n * h -
10180              m * f * l +
10181              e * n * l +
10182              i * f * p -
10183              e * j * p) *
10184            A),
10185          (c[12] = x * A),
10186          (c[13] =
10187            (m * r * g -
10188              q * n * g +
10189              q * f * o -
10190              e * r * o -
10191              m * f * s +
10192              e * n * s) *
10193            A),
10194          (c[14] =
10195            (q * j * g -
10196              i * r * g -
10197              q * f * k +
10198              e * r * k +
10199              i * f * s -
10200              e * j * s) *
10201            A),
10202          (c[15] =
10203            (i * n * g -
10204              m * j * g +
10205              m * f * k -
10206              e * n * k -
10207              i * f * o +
10208              e * j * o) *
10209            A),
10210          this
10211        )
10212      },
10213      scale: function (a) {
10214        var b = this.elements,
10215          c = a.x,
10216          d = a.y,
10217          e = a.z
10218        return (
10219          (b[0] *= c),
10220          (b[4] *= d),
10221          (b[8] *= e),
10222          (b[1] *= c),
10223          (b[5] *= d),
10224          (b[9] *= e),
10225          (b[2] *= c),
10226          (b[6] *= d),
10227          (b[10] *= e),
10228          (b[3] *= c),
10229          (b[7] *= d),
10230          (b[11] *= e),
10231          this
10232        )
10233      },
10234      getMaxScaleOnAxis: function () {
10235        var a = this.elements,
10236          b = a[0] * a[0] + a[1] * a[1] + a[2] * a[2],
10237          c = a[4] * a[4] + a[5] * a[5] + a[6] * a[6],
10238          d = a[8] * a[8] + a[9] * a[9] + a[10] * a[10]
10239        return Math.sqrt(Math.max(b, c, d))
10240      },
10241      makeTranslation: function (a, b, c) {
10242        return this.set(1, 0, 0, a, 0, 1, 0, b, 0, 0, 1, c, 0, 0, 0, 1), this
10243      },
10244      makeRotationX: function (a) {
10245        var b = Math.cos(a),
10246          c = Math.sin(a)
10247        return this.set(1, 0, 0, 0, 0, b, -c, 0, 0, c, b, 0, 0, 0, 0, 1), this
10248      },
10249      makeRotationY: function (a) {
10250        var b = Math.cos(a),
10251          c = Math.sin(a)
10252        return this.set(b, 0, c, 0, 0, 1, 0, 0, -c, 0, b, 0, 0, 0, 0, 1), this
10253      },
10254      makeRotationZ: function (a) {
10255        var b = Math.cos(a),
10256          c = Math.sin(a)
10257        return this.set(b, -c, 0, 0, c, b, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1), this
10258      },
10259      makeRotationAxis: function (a, b) {
10260        var c = Math.cos(b),
10261          d = Math.sin(b),
10262          e = 1 - c,
10263          f = a.x,
10264          g = a.y,
10265          h = a.z,
10266          i = e * f,
10267          j = e * g
10268        return (
10269          this.set(
10270            i * f + c,
10271            i * g - d * h,
10272            i * h + d * g,
10273            0,
10274            i * g + d * h,
10275            j * g + c,
10276            j * h - d * f,
10277            0,
10278            i * h - d * g,
10279            j * h + d * f,
10280            e * h * h + c,
10281            0,
10282            0,
10283            0,
10284            0,
10285            1
10286          ),
10287          this
10288        )
10289      },
10290      makeScale: function (a, b, c) {
10291        return this.set(a, 0, 0, 0, 0, b, 0, 0, 0, 0, c, 0, 0, 0, 0, 1), this
10292      },
10293      makeShear: function (a, b, c) {
10294        return this.set(1, b, c, 0, a, 1, c, 0, a, b, 1, 0, 0, 0, 0, 1), this
10295      },
10296      compose: function (a, b, c) {
10297        return (
10298          this.makeRotationFromQuaternion(b),
10299          this.scale(c),
10300          this.setPosition(a),
10301          this
10302        )
10303      },
10304      decompose: (function () {
10305        var a, b
10306        return function (d, e, f) {
10307          void 0 === a && ((a = new Bb()), (b = new Cb()))
10308          var g = this.elements,
10309            h = a.set(g[0], g[1], g[2]).length(),
10310            i = a.set(g[4], g[5], g[6]).length(),
10311            j = a.set(g[8], g[9], g[10]).length(),
10312            k = this.determinant()
10313          k < 0 && (h = -h),
10314            (d.x = g[12]),
10315            (d.y = g[13]),
10316            (d.z = g[14]),
10317            b.elements.set(this.elements)
10318          var l = 1 / h,
10319            m = 1 / i,
10320            n = 1 / j
10321          return (
10322            (b.elements[0] *= l),
10323            (b.elements[1] *= l),
10324            (b.elements[2] *= l),
10325            (b.elements[4] *= m),
10326            (b.elements[5] *= m),
10327            (b.elements[6] *= m),
10328            (b.elements[8] *= n),
10329            (b.elements[9] *= n),
10330            (b.elements[10] *= n),
10331            e.setFromRotationMatrix(b),
10332            (f.x = h),
10333            (f.y = i),
10334            (f.z = j),
10335            this
10336          )
10337        }
10338      })(),
10339      makePerspective: function (a, b, c, d, e, f) {
10340        void 0 === f &&
10341          console.warn(
10342            'THREE.Matrix4: .makePerspective() has been redefined and has a new signature. Please check the docs.'
10343          )
10344        var g = this.elements,
10345          h = (2 * e) / (b - a),
10346          i = (2 * e) / (c - d),
10347          j = (b + a) / (b - a),
10348          k = (c + d) / (c - d),
10349          l = -(f + e) / (f - e),
10350          m = (-2 * f * e) / (f - e)
10351        return (
10352          (g[0] = h),
10353          (g[4] = 0),
10354          (g[8] = j),
10355          (g[12] = 0),
10356          (g[1] = 0),
10357          (g[5] = i),
10358          (g[9] = k),
10359          (g[13] = 0),
10360          (g[2] = 0),
10361          (g[6] = 0),
10362          (g[10] = l),
10363          (g[14] = m),
10364          (g[3] = 0),
10365          (g[7] = 0),
10366          (g[11] = -1),
10367          (g[15] = 0),
10368          this
10369        )
10370      },
10371      makeOrthographic: function (a, b, c, d, e, f) {
10372        var g = this.elements,
10373          h = 1 / (b - a),
10374          i = 1 / (c - d),
10375          j = 1 / (f - e),
10376          k = (b + a) * h,
10377          l = (c + d) * i,
10378          m = (f + e) * j
10379        return (
10380          (g[0] = 2 * h),
10381          (g[4] = 0),
10382          (g[8] = 0),
10383          (g[12] = -k),
10384          (g[1] = 0),
10385          (g[5] = 2 * i),
10386          (g[9] = 0),
10387          (g[13] = -l),
10388          (g[2] = 0),
10389          (g[6] = 0),
10390          (g[10] = -2 * j),
10391          (g[14] = -m),
10392          (g[3] = 0),
10393          (g[7] = 0),
10394          (g[11] = 0),
10395          (g[15] = 1),
10396          this
10397        )
10398      },
10399      equals: function (a) {
10400        for (var b = this.elements, c = a.elements, d = 0; d < 16; d++)
10401          if (b[d] !== c[d]) return !1
10402        return !0
10403      },
10404      fromArray: function (a, b) {
10405        void 0 === b && (b = 0)
10406        for (var c = 0; c < 16; c++) this.elements[c] = a[c + b]
10407        return this
10408      },
10409      toArray: function (a, b) {
10410        void 0 === a && (a = []), void 0 === b && (b = 0)
10411        var c = this.elements
10412        return (
10413          (a[b] = c[0]),
10414          (a[b + 1] = c[1]),
10415          (a[b + 2] = c[2]),
10416          (a[b + 3] = c[3]),
10417          (a[b + 4] = c[4]),
10418          (a[b + 5] = c[5]),
10419          (a[b + 6] = c[6]),
10420          (a[b + 7] = c[7]),
10421          (a[b + 8] = c[8]),
10422          (a[b + 9] = c[9]),
10423          (a[b + 10] = c[10]),
10424          (a[b + 11] = c[11]),
10425          (a[b + 12] = c[12]),
10426          (a[b + 13] = c[13]),
10427          (a[b + 14] = c[14]),
10428          (a[b + 15] = c[15]),
10429          a
10430        )
10431      }
10432    }),
10433    (Db.prototype = Object.create(wb.prototype)),
10434    (Db.prototype.constructor = Db),
10435    (Db.prototype.isCubeTexture = !0),
10436    Object.defineProperty(Db.prototype, 'images', {
10437      get: function () {
10438        return this.image
10439      },
10440      set: function (a) {
10441        this.image = a
10442      }
10443    })
10444  var Eb = new wb(),
10445    Fb = new Db(),
10446    Hb = [],
10447    Ib = []
10448  kc.prototype.setValue = function (a, b) {
10449    for (var c = this.seq, d = 0, e = c.length; d !== e; ++d) {
10450      var f = c[d]
10451      f.setValue(a, b[f.id])
10452    }
10453  }
10454  var lc = /([\w\d_]+)(\])?(\[|\.)?/g
10455  ;(oc.prototype.setValue = function (a, b, c) {
10456    var d = this.map[b]
10457    void 0 !== d && d.setValue(a, c, this.renderer)
10458  }),
10459    (oc.prototype.set = function (a, b, c) {
10460      var d = this.map[c]
10461      void 0 !== d && d.setValue(a, b[c], this.renderer)
10462    }),
10463    (oc.prototype.setOptional = function (a, b, c) {
10464      var d = b[c]
10465      void 0 !== d && this.setValue(a, c, d)
10466    }),
10467    (oc.upload = function (a, b, c, d) {
10468      for (var e = 0, f = b.length; e !== f; ++e) {
10469        var g = b[e],
10470          h = c[g.id]
10471        h.needsUpdate !== !1 && g.setValue(a, h.value, d)
10472      }
10473    }),
10474    (oc.seqWithValue = function (a, b) {
10475      for (var c = [], d = 0, e = a.length; d !== e; ++d) {
10476        var f = a[d]
10477        f.id in b && c.push(f)
10478      }
10479      return c
10480    })
10481  var pc = {
10482      merge: function (a) {
10483        for (var b = {}, c = 0; c < a.length; c++) {
10484          var d = this.clone(a[c])
10485          for (var e in d) b[e] = d[e]
10486        }
10487        return b
10488      },
10489      clone: function (a) {
10490        var b = {}
10491        for (var c in a) {
10492          b[c] = {}
10493          for (var d in a[c]) {
10494            var e = a[c][d]
10495            e &&
10496            (e.isColor ||
10497              e.isMatrix3 ||
10498              e.isMatrix4 ||
10499              e.isVector2 ||
10500              e.isVector3 ||
10501              e.isVector4 ||
10502              e.isTexture)
10503              ? (b[c][d] = e.clone())
10504              : Array.isArray(e)
10505              ? (b[c][d] = e.slice())
10506              : (b[c][d] = e)
10507          }
10508        }
10509        return b
10510      }
10511    },
10512    qc =
10513      '#ifdef USE_ALPHAMAP\n\tdiffuseColor.a *= texture2D( alphaMap, vUv ).g;\n#endif\n',
10514    rc = '#ifdef USE_ALPHAMAP\n\tuniform sampler2D alphaMap;\n#endif\n',
10515    sc =
10516      '#ifdef ALPHATEST\n\tif ( diffuseColor.a < ALPHATEST ) discard;\n#endif\n',
10517    tc =
10518      '#ifdef USE_AOMAP\n\tfloat ambientOcclusion = ( texture2D( aoMap, vUv2 ).r - 1.0 ) * aoMapIntensity + 1.0;\n\treflectedLight.indirectDiffuse *= ambientOcclusion;\n\t#if defined( USE_ENVMAP ) && defined( PHYSICAL )\n\t\tfloat dotNV = saturate( dot
10518( geometry.normal, geometry.viewDir ) );\n\t\treflectedLight.indirectSpecular *= computeSpecularOcclusion( dotNV, ambientOcclusion, material.specularRoughness );\n\t#endif\n#endif\n',
10519    uc =
10520      '#ifdef USE_AOMAP\n\tuniform sampler2D aoMap;\n\tuniform float aoMapIntensity;\n#endif',
10521    vc = '\nvec3 transformed = vec3( position );\n',
10522    wc = '\nvec3 objectNormal = vec3( normal );\n',
10523    xc =
10524      'float punctualLightIntensityToIrradianceFactor( const in float lightDistance, const in float cutoffDistance, const in float decayExponent ) {\n\t\tif( decayExponent > 0.0 ) {\n#if defined ( PHYSICALLY_CORRECT_LIGHTS )\n\t\t\tfloat distanceFalloff = 1.0 / max( pow( lightDistance, decayExponent ), 0.01 );\n\t\t\tfloat maxDistanceCutoffFactor = pow2( saturate( 1.0 - pow4( lightDistance / cutoffDistance ) ) );\n\t\t\treturn distanceFalloff * maxDistanceCutoffFactor;\n#else\n\t\t\treturn pow( saturate( -lightDistance / cutoffDistance + 1.0 ), decayExponent );\n#endif\n\t\t}\n\t\treturn 1.0;\n}\nvec3 BRDF_Diffuse_Lambert( const in vec3 diffuseColor ) {\n\treturn RECIPROCAL_PI * diffuseColor;\n}\nvec3 F_Schlick( const in vec3 specularColor, const in float dotLH ) {\n\tfloat fresnel = exp2( ( -5.55473 * dotLH - 6.98316 ) * dotLH );\n\treturn ( 1.0 - specularColor ) * fresnel + specularColor;\n}\nfloat G_GGX_Smith( const in float alpha, const in float dotNL, const in float dotNV ) {\n\tfloat a2 = pow2( alpha );\n\tfloat gl = dotNL + sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) );\n\tfloat gv = dotNV + sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) );\n\treturn 1.0 / ( gl * gv );\n}\nfloat G_GGX_SmithCorrelated( const in float alpha, const in float dotNL, const in float dotNV ) {\n\tfloat a2 = pow2( alpha );\n\tfloat gv = dotNL * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) );\n\tfloat gl = dotNV * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) );\n\treturn 0.5 / max( gv + gl, EPSILON );\n}\nfloat D_GGX( const in float alpha, const in float dotNH ) {\n\tfloat a2 = pow2( alpha );\n\tfloat denom = pow2( dotNH ) * ( a2 - 1.0 ) + 1.0;\n\treturn RECIPROCAL_PI * a2 / pow2( denom );\n}\nvec3 BRDF_Specular_GGX( const in IncidentLight incidentLight, const in GeometricContext geometry, const in vec3 specularColor, const in float roughness ) {\n\tfloat alpha = pow2( roughness );\n\tvec3 halfDir = normalize( incidentLight.direction + geometry.viewDir );\n\tfloat dotNL = saturate( dot( geometry.normal, incidentLight.direction ) );\n\tfloat dotNV = saturate( dot( geometry.normal, geometry.viewDir ) );\n\tfloat dotNH = saturate( dot( geometry.normal, halfDir ) );\n\tfloat dotLH = saturate( dot( incidentLight.direction, halfDir ) );\n\tvec3 F = F_Schlick( specularColor, dotLH );
10524\n\tfloat G = G_GGX_SmithCorrelated( alpha, dotNL, dotNV );\n\tfloat D = D_GGX( alpha, dotNH );\n\treturn F * ( G * D );\n}\nvec2 ltcTextureCoords( const in GeometricContext geometry, const in float roughness ) {\n\tconst float LUT_SIZE  = 64.0;\n\tconst float LUT_SCALE = (LUT_SIZE - 1.0)/LUT_SIZE;\n\tconst float LUT_BIAS  = 0.5/LUT_SIZE;\n\tvec3 N = geometry.normal;\n\tvec3 V = geometry.viewDir;\n\tvec3 P = geometry.position;\n\tfloat theta = acos( dot( N, V ) );\n\tvec2 uv = vec2(\n\t\tsqrt( saturate( roughness ) ),\n\t\tsaturate( theta / ( 0.5 * PI ) ) );\n\tuv = uv * LUT_SCALE + LUT_BIAS;\n\treturn uv;\n}\nvoid clipQuadToHorizon( inout vec3 L[5], out int n ) {\n\tint config = 0;\n\tif ( L[0].z > 0.0 ) config += 1;\n\tif ( L[1].z > 0.0 ) config += 2;\n\tif ( L[2].z > 0.0 ) config += 4;\n\tif ( L[3].z > 0.0 ) config += 8;\n\tn = 0;\n\tif ( config == 0 ) {\n\t} else if ( config == 1 ) {\n\t\tn = 3;\n\t\tL[1] = -L[1].z * L[0] + L[0].z * L[1];\n\t\tL[2] = -L[3].z * L[0] + L[0].z * L[3];\n\t} else if ( config == 2 ) {\n\t\tn = 3;\n\t\tL[0] = -L[0].z * L[1] + L[1].z * L[0];\n\t\tL[2] = -L[2].z * L[1] + L[1].z * L[2];\n\t} else if ( config == 3 ) {\n\t\tn = 4;\n\t\tL[2] = -L[2].z * L[1] + L[1].z * L[2];\n\t\tL[3] = -L[3].z * L[0] + L[0].z * L[3];\n\t} else if ( config == 4 ) {\n\t\tn = 3;\n\t\tL[0] = -L[3].z * L[2] + L[2].z * L[3];\n\t\tL[1] = -L[1].z * L[2] + L[2].z * L[1];\n\t} else if ( config == 5 ) {\n\t\tn = 0;\n\t} else if ( config == 6 ) {\n\t\tn = 4;\n\t\tL[0] = -L[0].z * L[1] + L[1].z * L[0];\n\t\tL[3] = -L[3].z * L[2] + L[2].z * L[3];\n\t} else if ( config == 7 ) {\n\t\tn = 5;\n\t\tL[4] = -L[3].z * L[0] + L[0].z * L[3];\n\t\tL[3] = -L[3].z * L[2] + L[2].z * L[3];\n\t} else if ( config == 8 ) {\n\t\tn = 3;\n\t\tL[0] = -L[0].z * L[3] + L[3].z * L[0];\n\t\tL[1] = -L[2].z * L[3] + L[3].z * L[2];\n\t\tL[2] =  L[3];\n\t} else if ( config == 9 ) {\n\t\tn = 4;\n\t\tL[1] = -L[1].z * L[0] + L[0].z * L[1];\n\t\tL[2] = -L[2].z * L[3] + L[3].z * L[2];\n\t} else if ( config == 10 ) {\n\t\tn = 0;\n\t} else if ( config == 11 ) {\n\t\tn = 5;\n\t\tL[4] = L[3];\n\t\tL[3] = -L[2].z * L[3] + L[3].z * L[2];\n\t\tL[2] = -L[2].z * L[1] + L[1].z * L[2];\n\t} else if ( config == 12 ) {\n\t\tn = 4;\n\t\tL[1] = -L[1].z * L[2] + L[2].z * L[1];\n\t\tL[0] = -L[0].z * L[3] + L[3].z * L[0];\n\t} else if ( config == 13 ) {\n\t\tn = 5;\n\t\tL[4] = L[3];\n\t\tL[3] = L[2];\n\t\tL[2] = -L[1].z * L[2] + L[2].z * L[1];\n\t\tL[1] = -L[1].z * L[0] + L[0].z * L[1];\n\t} else if ( config == 14 ) {\n\t\tn = 5;\n\t\tL[4] = -L[0].z * L[3] + L[3].z * L[0];\n\t\tL[0] = -L[0].z * L[1] + L[1].z * L[0];\n\t} else if ( config == 15 ) {\n\t\tn = 4;\n\t}\n\tif ( n == 3 )\n\t\tL[3] = L[0];\n\tif ( n == 4 )\n\t\tL[4] = L[0];\n}\nfloat integrateLtcBrdfOverRectEdge( vec3 v1, vec3 v2 ) {\n\tfloat cosTheta = dot( v1, v2 );\n\tfloat theta = acos( cosTheta );\n\tfloat res = cross( v1, v2 ).z * ( ( theta > 0.001 ) ? theta / sin( theta ) : 1.0 );\n\treturn res;\n}\nvoid initRectPoints( const in vec3 pos, const in vec3 halfWidth, const in vec3 halfHeight, out vec3 rectPoints[4] ) {\n\trectPoints[0] = pos - halfWidth - halfHeight;\n\trectPoints[1] = pos + halfWidth - halfHeight;\n\trectPoints[2] = pos + halfWidth + halfHeight;\n\trectPoints[3] = pos - halfWidth + halfHeight;\n}\nvec3 integrateLtcBrdfOverRect( const in GeometricContext geometry, const in mat3 brdfMat, const in vec3 rectPoints[4] ) {\n\tvec3 N = geometry.normal;\n\tvec3 V = geometry.viewDir;\n\tvec3 P = geometry.position;\n\tvec3 T1, T2;\n\tT1 = normalize(V - N * dot( V, N ));\n\tT2 = - cross( N, T1 );\n\tmat3 brdfWrtSurface = brdfMat * transpose( mat3( T1, T2, N ) );\n\tvec3 clippedRect[5];\n\tclippedRect[0] = brdfWrtSurface * ( rectPoints[0] - P );\n\tclippedRect[1] = brdfWrtSurface * ( rectPoints[1] - P );\n\tclippedRect[2] = brdfWrtSurface * ( rectPoints[2] - P );\n\tclippedRect[3] = brdfWrtSurface * ( rectPoints[3] - P );\n\tint n;\n\tclipQuadToHorizon(clippedRect, n);\n\tif ( n == 0 )\n\t\treturn vec3( 0, 0, 0 );\n\tclippedRect[0] = normalize( clippedRect[0] );\n\tclippedRect[1] = normalize( clippedRect[1] );\n\tclippedRect[2] = normalize( clippedRect[2] );\n\tclippedRect[3] = normalize( clippedRect[3] );\n\tclippedRect[4] = normalize( clippedRect[4] );\n\tfloat sum = 0.0;\n\tsum += integrateLtcBrdfOverRectEdge( clippedRect[0], clippedRect[1] );\n\tsum += integrateLtcBrdfOverRectEdge( clippedRect[1], clippedRect[2] );\n\tsum += integrateLtcBrdfOverRectEdge( clippedRect[2], clippedRect[3] );\n\tif (n >
10524= 4)\n\t\tsum += integrateLtcBrdfOverRectEdge( clippedRect[3], clippedRect[4] );\n\tif (n == 5)\n\t\tsum += integrateLtcBrdfOverRectEdge( clippedRect[4], clippedRect[0] );\n\tsum = max( 0.0, sum );\n\tvec3 Lo_i = vec3( sum, sum, sum );\n\treturn Lo_i;\n}\nvec3 Rect_Area_Light_Specular_Reflectance(\n\t\tconst in GeometricContext geometry,\n\t\tconst in vec3 lightPos, const in vec3 lightHalfWidth, const in vec3 lightHalfHeight,\n\t\tconst in float roughness,\n\t\tconst in sampler2D ltcMat, const in sampler2D ltcMag ) {\n\tvec3 rectPoints[4];\n\tinitRectPoints( lightPos, lightHalfWidth, lightHalfHeight, rectPoints );\n\tvec2 uv = ltcTextureCoords( geometry, roughness );\n\tvec4 brdfLtcApproxParams, t;\n\tbrdfLtcApproxParams = texture2D( ltcMat, uv );\n\tt = texture2D( ltcMat, uv );\n\tfloat brdfLtcScalar = texture2D( ltcMag, uv ).a;\n\tmat3 brdfLtcApproxMat = mat3(\n\t\tvec3(   1,   0, t.y ),\n\t\tvec3(   0, t.z,   0 ),\n\t\tvec3( t.w,   0, t.x )\n\t);\n\tvec3 specularReflectance = integrateLtcBrdfOverRect( geometry, brdfLtcApproxMat, rectPoints );\n\tspecularReflectance *= brdfLtcScalar;\n\treturn specularReflectance;\n}\nvec3 Rect_Area_Light_Diffuse_Reflectance(\n\t\tconst in GeometricContext geometry,\n\t\tconst in vec3 lightPos, const in vec3 lightHalfWidth, const in vec3 lightHalfHeight ) {\n\tvec3 rectPoints[4];\n\tinitRectPoints( lightPos, lightHalfWidth, lightHalfHeight, rectPoints );\n\tmat3 diffuseBrdfMat = mat3(1);\n\tvec3 diffuseReflectance = integrateLtcBrdfOverRect( geometry, diffuseBrdfMat, rectPoints );\n\treturn diffuseReflectance;\n}\nvec3 BRDF_Specular_GGX_Environment( const in GeometricContext geometry, const in vec3 specularColor, const in float roughness ) {\n\tfloat dotNV = saturate( dot( geometry.normal, geometry.viewDir ) );\n\tconst vec4 c0 = vec4( - 1, - 0.0275, - 0.572, 0.022 );\n\tconst vec4 c1 = vec4( 1, 0.0425, 1.04, - 0.04 );\n\tvec4 r = roughness * c0 + c1;\n\tfloat a004 = min( r.x * r.x, exp2( - 9.28 * dotNV ) ) * r.x + r.y;\n\tvec2 AB = vec2( -1.04, 1.04 ) * a004 + r.zw;\n\treturn specularColor * AB.x + AB.y;\n}\nfloat G_BlinnPhong_Implicit( ) {\n\treturn 0.25;\n}\nfloat D_BlinnPhong( const in float shininess, const in float dotNH ) {\n\treturn RECIPROCAL_PI * ( shininess * 0.5 + 1.0 ) * pow( dotNH, shininess );\n}\nvec3 BRDF_Specular_BlinnPhong( const in IncidentLight incidentLight, const in GeometricContext geometry, const in vec3 specularColor, const in float shininess ) {\n\tvec3 halfDir = normalize( incidentLight.direction + geometry.viewDir );\n\tfloat dotNH = saturate( dot( geometry.normal, halfDir ) );\n\tfloat dotLH = saturate( dot( incidentLight.direction, halfDir ) );\n\tvec3 F = F_Schlick( specularColor, dotLH );\n\tfloat G = G_BlinnPhong_Implicit( );\n\tfloat D = D_BlinnPhong( shininess, dotNH );\n\treturn F * ( G * D );\n}\nfloat GGXRoughnessToBlinnExponent( const in float ggxRoughness ) {\n\treturn ( 2.0 / pow2( ggxRoughness + 0.0001 ) - 2.0 );\n}\nfloat BlinnExponentToGGXRoughness( const in float blinnExponent ) {\n\treturn sqrt( 2.0 / ( blinnExponent + 2.0 ) );\n}\n',
10525    yc =
10526      '#ifdef USE_BUMPMAP\n\tuniform sampler2D bumpMap;\n\tuniform float bumpScale;\n\tvec2 dHdxy_fwd() {\n\t\tvec2 dSTdx = dFdx( vUv );\n\t\tvec2 dSTdy = dFdy( vUv );\n\t\tfloat Hll = bumpScale * texture2D( bumpMap, vUv ).x;\n\t\tfloat dBx = bumpScale * texture2D( bumpMap, vUv + dSTdx ).x - Hll;\n\t\tfloat dBy = bumpScale * texture2D( bumpMap, vUv + dSTdy ).x - Hll;\n\t\treturn vec2( dBx, dBy );\n\t}\n\tvec3 perturbNormalArb( vec3 surf_pos, vec3 surf_norm, vec2 dHdxy ) {\n\t\tvec3 vSigmaX = dFdx( surf_pos );\n\t\tvec3 vSigmaY = dFdy( surf_pos );\n\t\tvec3 vN = surf_norm;\n\t\tvec3 R1 = cross( vSigmaY, vN );\n\t\tvec3 R2 = cross( vN, vSigmaX );\n\t\tfloat fDet = dot( vSigmaX, R1 );\n\t\tvec3 vGrad = sign( fDet ) * ( dHdxy.x * R1 + dHdxy.y * R2 );\n\t\treturn normalize( abs( fDet ) * surf_norm - vGrad );\n\t}\n#endif\n',
10527    zc =
10528      '#if NUM_CLIPPING_PLANES > 0\n\tfor ( int i = 0; i < UNION_CLIPPING_PLANES; ++ i ) {\n\t\tvec4 plane = clippingPlanes[ i ];\n\t\tif ( dot( vViewPosition, plane.xyz ) > plane.w ) discard;\n\t}\n\t\t\n\t#if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES\n\t\tbool clipped = true;\n\t\tfor ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; ++ i ) {\n\t\t\tvec4 plane = clippingPlanes[ i ];\n\t\t\tclipped = ( dot( vViewPosition, plane.xyz ) > plane.w ) && clipped;\n\t\t}\n\t\tif ( clipped ) discard;\n\t\n\t#endif\n#endif\n',
10529    Ac =
10530      '#if NUM_CLIPPING_PLANES > 0\n\t#if ! defined( PHYSICAL ) && ! defined( PHONG )\n\t\tvarying vec3 vViewPosition;\n\t#endif\n\tuniform vec4 clippingPlanes[ NUM_CLIPPING_PLANES ];\n#endif\n',
10531    Bc =
10532      '#if NUM_CLIPPING_PLANES > 0 && ! defined( PHYSICAL ) && ! defined( PHONG )\n\tvarying vec3 vViewPosition;\n#endif\n',
10533    Cc =
10534      '#if NUM_CLIPPING_PLANES > 0 && ! defined( PHYSICAL ) && ! defined( PHONG )\n\tvViewPosition = - mvPosition.xyz;\n#endif\n',
10535    Dc = '#ifdef USE_COLOR\n\tdiffuseColor.rgb *= vColor;\n#endif',
10536    Ec = '#ifdef USE_COLOR\n\tvarying vec3 vColor;\n#endif\n',
10537    Fc = '#ifdef USE_COLOR\n\tvarying vec3 vColor;\n#endif',
10538    Gc = '#ifdef USE_COLOR\n\tvColor.xyz = color.xyz;\n#endif',
10539    Hc =
10540      '#define PI 3.14159265359\n#define PI2 6.28318530718\n#define PI_HALF 1.5707963267949\n#define RECIPROCAL_PI 0.31830988618\n#define RECIPROCAL_PI2 0.15915494\n#define LOG2 1.442695\n#define EPSILON 1e-6\n#define saturate(a) clamp( a, 0.0, 1.0 )\n#define whiteCompliment(a) ( 1.0 - saturate( a ) )\nfloat pow2( const in float x ) { return x*x; }\nfloat pow3( const in float x ) { return x*x*x; }\nfloat pow4( const in float x ) { float x2 = x*x; return x2*x2; }\nfloat average( const in vec3 color ) { return dot( color, vec3( 0.3333 ) ); }\nhighp float rand( const in vec2 uv ) {\n\tconst highp float a = 12.9898, b = 78.233, c = 43758.5453;\n\thighp float dt = dot( uv.xy, vec2( a,b ) ), sn = mod( dt, PI );\n\treturn fract(sin(sn) * c);\n}\nstruct IncidentLight {\n\tvec3 color;\n\tvec3 direction;\n\tbool visible;\n};\nstruct ReflectedLight {\n\tvec3 directDiffuse;\n\tvec3 directSpecular;\n\tvec3 indirectDiffuse;\n\tvec3 indirectSpecular;\n};\nstruct GeometricContext {\n\tvec3 position;\n\tvec3 normal;\n\tvec3 viewDir;\n};\nvec3 transformDirection( in vec3 dir, in mat4 matrix ) {\n\treturn normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );\n}\nvec3 inverseTransformDirection( in vec3 dir, in mat4 matrix ) {\n\treturn normalize( ( vec4( dir, 0.0 ) * matrix ).xyz );\n}\nvec3 projectOnPlane(in vec3 point, in vec3 pointOnPlane, in vec3 planeNormal ) {\n\tfloat distance = dot( planeNormal, point - pointOnPlane );\n\treturn - distance * planeNormal + point;\n}\nfloat sideOfPlane( in vec3 point, in vec3 pointOnPlane, in vec3 planeNormal ) {\n\treturn sign( dot( point - pointOnPlane, planeNormal ) );\n}\nvec3 linePlaneIntersect( in vec3 pointOnLine, in vec3 lineDirection, in vec3 pointOnPlane, in vec3 planeNormal ) {\n\treturn lineDirection * ( dot( planeNormal, pointOnPlane - pointOnLine ) / dot( planeNormal, lineDirection ) ) + pointOnLine;\n}\nmat3 transpose( const in mat3 v ) {\n\tmat3 tmp;\n\ttmp[0] = vec3(v[0].x, v[1].x, v[2].x);\n\ttmp[1] = vec3(v[0].y, v[1].y, v[2].y);\n\ttmp[2] = vec3(v[0].z, v[1].z, v[2].z);\n\treturn tmp;\n}\n',
10541    Ic =
10542      '#ifdef ENVMAP_TYPE_CUBE_UV\n#define cubeUV_textureSize (1024.0)\nint getFaceFromDirection(vec3 direction) {\n\tvec3 absDirection = abs(direction);\n\tint face = -1;\n\tif( absDirection.x > absDirection.z ) {\n\t\tif(absDirection.x > absDirection.y )\n\t\t\tface = direction.x > 0.0 ? 0 : 3;\n\t\telse\n\t\t\tface = direction.y > 0.0 ? 1 : 4;\n\t}\n\telse {\n\t\tif(absDirection.z > absDirection.y )\n\t\t\tface = direction.z > 0.0 ? 2 : 5;\n\t\telse\n\t\t\tface = direction.y > 0.0 ? 1 : 4;\n\t}\n\treturn face;\n}\n#define cubeUV_maxLods1  (log2(cubeUV_textureSize*0.25) - 1.0)\n#define cubeUV_rangeClamp (exp2((6.0 - 1.0) * 2.0))\nvec2 MipLevelInfo( vec3 vec, float roughnessLevel, float roughness ) {\n\tfloat scale = exp2(cubeUV_maxLods1 - roughnessLevel);\n\tfloat dxRoughness = dFdx(roughness);\n\tfloat dyRoughness = dFdy(roughness);\n\tvec3 dx = dFdx( vec * scale * dxRoughness );\n\tvec3 dy = dFdy( vec * scale * dyRoughness );\n\tfloat d = max( dot( dx, dx ), dot( dy, dy ) );\n\td = clamp(d, 1.0, cubeUV_rangeClamp);
10542\n\tfloat mipLevel = 0.5 * log2(d);\n\treturn vec2(floor(mipLevel), fract(mipLevel));\n}\n#define cubeUV_maxLods2 (log2(cubeUV_textureSize*0.25) - 2.0)\n#define cubeUV_rcpTextureSize (1.0 / cubeUV_textureSize)\nvec2 getCubeUV(vec3 direction, float roughnessLevel, float mipLevel) {\n\tmipLevel = roughnessLevel > cubeUV_maxLods2 - 3.0 ? 0.0 : mipLevel;\n\tfloat a = 16.0 * cubeUV_rcpTextureSize;\n\tvec2 exp2_packed = exp2( vec2( roughnessLevel, mipLevel ) );\n\tvec2 rcp_exp2_packed = vec2( 1.0 ) / exp2_packed;\n\tfloat powScale = exp2_packed.x * exp2_packed.y;\n\tfloat scale = rcp_exp2_packed.x * rcp_exp2_packed.y * 0.25;\n\tfloat mipOffset = 0.75*(1.0 - rcp_exp2_packed.y) * rcp_exp2_packed.x;\n\tbool bRes = mipLevel == 0.0;\n\tscale =  bRes && (scale < a) ? a : scale;\n\tvec3 r;\n\tvec2 offset;\n\tint face = getFaceFromDirection(direction);\n\tfloat rcpPowScale = 1.0 / powScale;\n\tif( face == 0) {\n\t\tr = vec3(direction.x, -direction.z, direction.y);\n\t\toffset = vec2(0.0+mipOffset,0.75 * rcpPowScale);\n\t\toffset.y = bRes && (offset.y < 2.0*a) ? a : offset.y;\n\t}\n\telse if( face == 1) {\n\t\tr = vec3(direction.y, direction.x, direction.z);\n\t\toffset = vec2(scale+mipOffset, 0.75 * rcpPowScale);\n\t\toffset.y = bRes && (offset.y < 2.0*a) ? a : offset.y;\n\t}\n\telse if( face == 2) {\n\t\tr = vec3(direction.z, direction.x, direction.y);\n\t\toffset = vec2(2.0*scale+mipOffset, 0.75 * rcpPowScale);\n\t\toffset.y = bRes && (offset.y < 2.0*a) ? a : offset.y;\n\t}\n\telse if( face == 3) {\n\t\tr = vec3(direction.x, direction.z, direction.y);\n\t\toffset = vec2(0.0+mipOffset,0.5 * rcpPowScale);\n\t\toffset.y = bRes && (offset.y < 2.0*a) ? 0.0 : offset.y;\n\t}\n\telse if( face == 4) {\n\t\tr = vec3(direction.y, direction.x, -direction.z);\n\t\toffset = vec2(scale+mipOffset, 0.5 * rcpPowScale);\n\t\toffset.y = bRes && (offset.y < 2.0*a) ? 0.0 : offset.y;\n\t}\n\telse {\n\t\tr = vec3(direction.z, -direction.x, direction.y);\n\t\toffset = vec2(2.0*scale+mipOffset, 0.5 * rcpPowScale);\n\t\toffset.y = bRes && (offset.y < 2.0*a) ? 0.0 : offset.y;\n\t}\n\tr = normalize(r);\n\tfloat texelOffset = 0.5 * cubeUV_rcpTextureSize;\n\tvec2 s = ( r.yz / abs( r.x ) + vec2( 1.0 ) ) * 0.5;\n\tvec2 base = offset + vec2( texelOffset );\n\treturn base + s * ( scale - 2.0 * texelOffset );\n}\n#define cubeUV_maxLods3 (log2(cubeUV_textureSize*0.25) - 3.0)\nvec4 textureCubeUV(vec3 reflectedDirection, float roughness ) {\n\tfloat roughnessVal = roughness* cubeUV_maxLods3;\n\tfloat r1 = floor(roughnessVal);\n\tfloat r2 = r1 + 1.0;\n\tfloat t = fract(roughnessVal);\n\tvec2 mipInfo = MipLevelInfo(reflectedDirection, r1, roughness);\n\tfloat s = mipInfo.y;\n\tfloat level0 = mipInfo.x;\n\tfloat level1 = level0 + 1.0;\n\tlevel1 = level1 > 5.0 ? 5.0 : level1;\n\tlevel0 += min( floor( s + 0.5 ), 5.0 );\n\tvec2 uv_10 = getCubeUV(reflectedDirection, r1, level0);\n\tvec4 color10 = envMapTexelToLinear(texture2D(envMap, uv_10));\n\tvec2 uv_20 = getCubeUV(reflectedDirection, r2, level0);\n\tvec4 color20 = envMapTexelToLinear(texture2D(envMap, uv_20));\n\tvec4 result = mix(color10, color20, t);\n\treturn vec4(result.rgb, 1.0);\n}\n#endif\n',
10543    Jc =
10544      '#ifdef FLIP_SIDED\n\tobjectNormal = -objectNormal;\n#endif\nvec3 transformedNormal = normalMatrix * objectNormal;\n',
10545    Kc =
10546      '#ifdef USE_DISPLACEMENTMAP\n\tuniform sampler2D displacementMap;\n\tuniform float displacementScale;\n\tuniform float displacementBias;\n#endif\n',
10547    Lc =
10548      '#ifdef USE_DISPLACEMENTMAP\n\ttransformed += normal * ( texture2D( displacementMap, uv ).x * displacementScale + displacementBias );\n#endif\n',
10549    Mc =
10550      '#ifdef USE_EMISSIVEMAP\n\tvec4 emissiveColor = texture2D( emissiveMap, vUv );\n\temissiveColor.rgb = emissiveMapTexelToLinear( emissiveColor ).rgb;\n\ttotalEmissiveRadiance *= emissiveColor.rgb;\n#endif\n',
10551    Nc = '#ifdef USE_EMISSIVEMAP\n\tuniform sampler2D emissiveMap;\n#endif\n',
10552    Oc = '  gl_FragColor = linearToOutputTexel( gl_FragColor );\n',
10553    Pc =
10554      '\nvec4 LinearToLinear( in vec4 value ) {\n\treturn value;\n}\nvec4 GammaToLinear( in vec4 value, in float gammaFactor ) {\n\treturn vec4( pow( value.xyz, vec3( gammaFactor ) ), value.w );\n}\nvec4 LinearToGamma( in vec4 value, in float gammaFactor ) {\n\treturn vec4( pow( value.xyz, vec3( 1.0 / gammaFactor ) ), value.w );\n}\nvec4 sRGBToLinear( in vec4 value ) {\n\treturn vec4( mix( pow( value.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), value.rgb * 0.0773993808, vec3( lessThanEqual( value.rgb, vec3( 0.04045 ) ) ) ), value.w );\n}\nvec4 LinearTosRGB( in vec4 value ) {\n\treturn vec4( mix( pow( value.rgb, vec3( 0.41666 ) ) * 1.055 - vec3( 0.055 ), value.rgb * 12.92, vec3( lessThanEqual( value.rgb, vec3( 0.0031308 ) ) ) ), value.w );\n}\nvec4 RGBEToLinear( in vec4 value ) {\n\treturn vec4( value.rgb * exp2( value.a * 255.0 - 128.0 ), 1.0 );\n}
10554\nvec4 LinearToRGBE( in vec4 value ) {\n\tfloat maxComponent = max( max( value.r, value.g ), value.b );\n\tfloat fExp = clamp( ceil( log2( maxComponent ) ), -128.0, 127.0 );\n\treturn vec4( value.rgb / exp2( fExp ), ( fExp + 128.0 ) / 255.0 );\n}\nvec4 RGBMToLinear( in vec4 value, in float maxRange ) {\n\treturn vec4( value.xyz * value.w * maxRange, 1.0 );\n}\nvec4 LinearToRGBM( in vec4 value, in float maxRange ) {\n\tfloat maxRGB = max( value.x, max( value.g, value.b ) );\n\tfloat M      = clamp( maxRGB / maxRange, 0.0, 1.0 );\n\tM            = ceil( M * 255.0 ) / 255.0;\n\treturn vec4( value.rgb / ( M * maxRange ), M );\n}\nvec4 RGBDToLinear( in vec4 value, in float maxRange ) {\n\treturn vec4( value.rgb * ( ( maxRange / 255.0 ) / value.a ), 1.0 );\n}\nvec4 LinearToRGBD( in vec4 value, in float maxRange ) {\n\tfloat maxRGB = max( value.x, max( value.g, value.b ) );\n\tfloat D      = max( maxRange / maxRGB, 1.0 );\n\tD            = min( floor( D ) / 255.0, 1.0 );\n\treturn vec4( value.rgb * ( D * ( 255.0 / maxRange ) ), D );\n}\nconst mat3 cLogLuvM = mat3( 0.2209, 0.3390, 0.4184, 0.1138, 0.6780, 0.7319, 0.0102, 0.1130, 0.2969 );\nvec4 LinearToLogLuv( in vec4 value )  {\n\tvec3 Xp_Y_XYZp = value.rgb * cLogLuvM;\n\tXp_Y_XYZp = max(Xp_Y_XYZp, vec3(1e-6, 1e-6, 1e-6));\n\tvec4 vResult;\n\tvResult.xy = Xp_Y_XYZp.xy / Xp_Y_XYZp.z;\n\tfloat Le = 2.0 * log2(Xp_Y_XYZp.y) + 127.0;\n\tvResult.w = fract(Le);\n\tvResult.z = (Le - (floor(vResult.w*255.0))/255.0)/255.0;\n\treturn vResult;\n}\nconst mat3 cLogLuvInverseM = mat3( 6.0014, -2.7008, -1.7996, -1.3320, 3.1029, -5.7721, 0.3008, -1.0882, 5.6268 );\nvec4 LogLuvToLinear( in vec4 value ) {\n\tfloat Le = value.z * 255.0 + value.w;\n\tvec3 Xp_Y_XYZp;\n\tXp_Y_XYZp.y = exp2((Le - 127.0) / 2.0);\n\tXp_Y_XYZp.z = Xp_Y_XYZp.y / value.y;\n\tXp_Y_XYZp.x = value.x * Xp_Y_XYZp.z;\n\tvec3 vRGB = Xp_Y_XYZp.rgb * cLogLuvInverseM;\n\treturn vec4( max(vRGB, 0.0), 1.0 );\n}\n',
10555    Qc =
10556      '#ifdef USE_ENVMAP\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG )\n\t\tvec3 cameraToVertex = normalize( vWorldPosition - cameraPosition );\n\t\tvec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t\tvec3 reflectVec = reflect( cameraToVertex, worldNormal );\n\t\t#else\n\t\t\tvec3 reflectVec = refract( cameraToVertex, worldNormal, refractionRatio );\n\t\t#endif\n\t#else\n\t\tvec3 reflectVec = vReflect;\n\t#endif\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tvec4 envColor = textureCube( envMap, flipNormal * vec3( flipEnvMap * reflectVec.x, reflectVec.yz ) );\n\t#elif defined( ENVMAP_TYPE_EQUIREC )\n\t\tvec2 sampleUV;\n\t\tsampleUV.y = saturate( flipNormal * reflectVec.y * 0.5 + 0.5 );\n\t\tsampleUV.x = atan( flipNormal * reflectVec.z, flipNormal * reflectVec.x ) * RECIPROCAL_PI2 + 0.5;\n\t\tvec4 envColor = texture2D( envMap, sampleUV );\n\t#elif defined( ENVMAP_TYPE_SPHERE )\n\t\tvec3 reflectView = flipNormal * normalize( ( viewMatrix * vec4( reflectVec, 0.0 ) ).xyz + vec3( 0.0, 0.0, 1.0 ) );\n\t\tvec4 envColor = texture2D( envMap, reflectView.xy * 0.5 + 0.5 );\n\t#else\n\t\tvec4 envColor = vec4( 0.0 );\n\t#endif\n\tenvColor = envMapTexelToLinear( envColor );\n\t#ifdef ENVMAP_BLENDING_MULTIPLY\n\t\toutgoingLight = mix( outgoingLight, outgoingLight * envColor.xyz, specularStrength * reflectivity );\n\t#elif defined( ENVMAP_BLENDING_MIX )\n\t\toutgoingLight = mix( outgoingLight, envColor.xyz, specularStrength * reflectivity );\n\t#elif defined( ENVMAP_BLENDING_ADD )\n\t\toutgoingLight += envColor.xyz * specularStrength * reflectivity;\n\t#endif\n#endif\n',
10557    Rc =
10558      '#if defined( USE_ENVMAP ) || defined( PHYSICAL )\n\tuniform float reflectivity;\n\tuniform float envMapIntensity;\n#endif\n#ifdef USE_ENVMAP\n\t#if ! defined( PHYSICAL ) && ( defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) )\n\t\tvarying vec3 vWorldPosition;\n\t#endif\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tuniform samplerCube envMap;\n\t#else\n\t\tuniform sampler2D envMap;\n\t#endif\n\tuniform float flipEnvMap;\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( PHYSICAL )\n\t\tuniform float refractionRatio;\n\t#else\n\t\tvarying vec3 vReflect;\n\t#endif\n#endif\n',
10559    Sc =
10560      '#ifdef USE_ENVMAP\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG )\n\t\tvarying vec3 vWorldPosition;\n\t#else\n\t\tvarying vec3 vReflect;\n\t\tuniform float refractionRatio;\n\t#endif\n#endif\n',
10561    Tc =
10562      '#ifdef USE_ENVMAP\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG )\n\t\tvWorldPosition = worldPosition.xyz;
10562\n\t#else\n\t\tvec3 cameraToVertex = normalize( worldPosition.xyz - cameraPosition );\n\t\tvec3 worldNormal = inverseTransformDirection( transformedNormal, viewMatrix );\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t\tvReflect = reflect( cameraToVertex, worldNormal );\n\t\t#else\n\t\t\tvReflect = refract( cameraToVertex, worldNormal, refractionRatio );\n\t\t#endif\n\t#endif\n#endif\n',
10563    Uc = '\n#ifdef USE_FOG\nfogDepth = -mvPosition.z;\n#endif',
10564    Vc = '#ifdef USE_FOG\n  varying float fogDepth;\n#endif\n',
10565    Wc =
10566      '#ifdef USE_FOG\n\t#ifdef FOG_EXP2\n\t\tfloat fogFactor = whiteCompliment( exp2( - fogDensity * fogDensity * fogDepth * fogDepth * LOG2 ) );\n\t#else\n\t\tfloat fogFactor = smoothstep( fogNear, fogFar, fogDepth );\n\t#endif\n\tgl_FragColor.rgb = mix( gl_FragColor.rgb, fogColor, fogFactor );\n#endif\n',
10567    Xc =
10568      '#ifdef USE_FOG\n\tuniform vec3 fogColor;\n\tvarying float fogDepth;\n\t#ifdef FOG_EXP2\n\t\tuniform float fogDensity;\n\t#else\n\t\tuniform float fogNear;\n\t\tuniform float fogFar;\n\t#endif\n#endif\n',
10569    Yc =
10570      '#ifdef TOON\n\tuniform sampler2D gradientMap;\n\tvec3 getGradientIrradiance( vec3 normal, vec3 lightDirection ) {\n\t\tfloat dotNL = dot( normal, lightDirection );\n\t\tvec2 coord = vec2( dotNL * 0.5 + 0.5, 0.0 );\n\t\t#ifdef USE_GRADIENTMAP\n\t\t\treturn texture2D( gradientMap, coord ).rgb;\n\t\t#else\n\t\t\treturn ( coord.x < 0.7 ) ? vec3( 0.7 ) : vec3( 1.0 );\n\t\t#endif\n\t}\n#endif\n',
10571    Zc =
10572      '#ifdef USE_LIGHTMAP\n\treflectedLight.indirectDiffuse += PI * texture2D( lightMap, vUv2 ).xyz * lightMapIntensity;\n#endif\n',
10573    $c =
10574      '#ifdef USE_LIGHTMAP\n\tuniform sampler2D lightMap;\n\tuniform float lightMapIntensity;\n#endif',
10575    _c =
10576      'vec3 diffuse = vec3( 1.0 );\nGeometricContext geometry;\ngeometry.position = mvPosition.xyz;\ngeometry.normal = normalize( transformedNormal );\ngeometry.viewDir = normalize( -mvPosition.xyz );\nGeometricContext backGeometry;\nbackGeometry.position = geometry.position;\nbackGeometry.normal = -geometry.normal;\nbackGeometry.viewDir = geometry.viewDir;\nvLightFront = vec3( 0.0 );\n#ifdef DOUBLE_SIDED\n\tvLightBack = vec3( 0.0 );\n#endif\nIncidentLight directLight;\nfloat dotNL;\nvec3 directLightColor_Diffuse;\n#if NUM_POINT_LIGHTS > 0\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n\t\tgetPointDirectLightIrradiance( pointLights[ i ], geometry, directLight );\n\t\tdotNL = dot( geometry.normal, directLight.direction );\n\t\tdirectLightColor_Diffuse = PI * directLight.color;\n\t\tvLightFront += saturate( dotNL ) * directLightColor_Diffuse;\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvLightBack += saturate( -dotNL ) * directLightColor_Diffuse;\n\t\t#endif\n\t}\n#endif\n#if NUM_SPOT_LIGHTS > 0\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n\t\tgetSpotDirectLightIrradiance( spotLights[ i ], geometry, directLight );\n\t\tdotNL = dot( geometry.normal, directLight.direction );\n\t\tdirectLightColor_Diffuse = PI * directLight.color;\n\t\tvLightFront += saturate( dotNL ) * directLightColor_Diffuse;\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvLightBack += saturate( -dotNL ) * directLightColor_Diffuse;\n\t\t#endif\n\t}\n#endif\n#if NUM_DIR_LIGHTS > 0\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n\t\tgetDirectionalDirectLightIrradiance( directionalLights[ i ], geometry, directLight );\n\t\tdotNL = dot( geometry.normal, directLight.direction );\n\t\tdirectLightColor_Diffuse = PI * directLight.color;\n\t\tvLightFront += saturate( dotNL ) * directLightColor_Diffuse;\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvLightBack += saturate( -dotNL ) * directLightColor_Diffuse;\n\t\t#endif\n\t}\n#endif\n#if NUM_HEMI_LIGHTS > 0\n\tfor ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {\n\t\tvLightFront += getHemisphereLightIrradiance( hemisphereLights[ i ], geometry );\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvLightBack += getHemisphereLightIrradiance( hemisphereLights[ i ], backGeometry );\n\t\t#endif\n\t}\n#endif\n',
10577    ad =
10578      'uniform vec3 ambientLightColor;\nvec3 getAmbientLightIrradiance( const in vec3 ambientLightColor ) {\n\tvec3 irradiance = ambientLightColor;\n\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\tirradiance *= PI;\n\t#endif\n\treturn irradiance;\n}\n#if NUM_DIR_LIGHTS > 0\n\tstruct DirectionalLight {\n\t\tvec3 direction;\n\t\tvec3 color;\n\t\tint shadow;\n\t\tfloat shadowBias;\n\t\tfloat shadowRadius;\n\t\tvec2 shadowMapSize;\n\t};\n\tuniform DirectionalLight directionalLights[ NUM_DIR_LIGHTS ];\n\tvoid getDirectionalDirectLightIrradiance( const in DirectionalLight directionalLight, const in GeometricContext geometry, out IncidentLight directLight ) {\n\t\tdirectLight.color = directionalLight.color;\n\t\tdirectLight.direction = directionalLight.direction;\n\t\tdirectLight.visible = true;\n\t}\n#endif\n#if NUM_POINT_LIGHTS > 0\n\tstruct PointLight {\n\t\tvec3 position;\n\t\tvec3 color;\n\t\tfloat distance;\n\t\tfloat decay;\n\t\tint shadow;\n\t\tfloat shadowBias;\n\t\tfloat shadowRadius;\n\t\tvec2 shadowMapSize;\n\t};\n\tuniform PointLight pointLights[ NUM_POINT_LIGHTS ];\n\tvoid getPointDirectLightIrradiance( const in PointLight pointLight, const in GeometricContext geometry, out IncidentLight directLight ) {\n\t\tvec3 lVector = pointLight.position - geometry.position;\n\t\tdirectLight.direction = normalize( lVector );\n\t\tfloat lightDistance = length( lVector );\n\t\tdirectLight.color = pointLight.color;\n\t\tdirectLight.color *= punctualLightIntensityToIrradianceFactor( lightDistance, pointLight.distance, pointLight.decay );\n\t\tdirectLight.visible = ( directLight.color != vec3( 0.0 ) );\n\t}
10578\n#endif\n#if NUM_SPOT_LIGHTS > 0\n\tstruct SpotLight {\n\t\tvec3 position;\n\t\tvec3 direction;\n\t\tvec3 color;\n\t\tfloat distance;\n\t\tfloat decay;\n\t\tfloat coneCos;\n\t\tfloat penumbraCos;\n\t\tint shadow;\n\t\tfloat shadowBias;\n\t\tfloat shadowRadius;\n\t\tvec2 shadowMapSize;\n\t};\n\tuniform SpotLight spotLights[ NUM_SPOT_LIGHTS ];\n\tvoid getSpotDirectLightIrradiance( const in SpotLight spotLight, const in GeometricContext geometry, out IncidentLight directLight  ) {\n\t\tvec3 lVector = spotLight.position - geometry.position;\n\t\tdirectLight.direction = normalize( lVector );\n\t\tfloat lightDistance = length( lVector );\n\t\tfloat angleCos = dot( directLight.direction, spotLight.direction );\n\t\tif ( angleCos > spotLight.coneCos ) {\n\t\t\tfloat spotEffect = smoothstep( spotLight.coneCos, spotLight.penumbraCos, angleCos );\n\t\t\tdirectLight.color = spotLight.color;\n\t\t\tdirectLight.color *= spotEffect * punctualLightIntensityToIrradianceFactor( lightDistance, spotLight.distance, spotLight.decay );\n\t\t\tdirectLight.visible = true;\n\t\t} else {\n\t\t\tdirectLight.color = vec3( 0.0 );\n\t\t\tdirectLight.visible = false;\n\t\t}\n\t}\n#endif\n#if NUM_RECT_AREA_LIGHTS > 0\n\tstruct RectAreaLight {\n\t\tvec3 color;\n\t\tvec3 position;\n\t\tvec3 halfWidth;\n\t\tvec3 halfHeight;\n\t};\n\tuniform sampler2D ltcMat;\tuniform sampler2D ltcMag;\n\tuniform RectAreaLight rectAreaLights[ NUM_RECT_AREA_LIGHTS ];\n#endif\n#if NUM_HEMI_LIGHTS > 0\n\tstruct HemisphereLight {\n\t\tvec3 direction;\n\t\tvec3 skyColor;\n\t\tvec3 groundColor;\n\t};\n\tuniform HemisphereLight hemisphereLights[ NUM_HEMI_LIGHTS ];\n\tvec3 getHemisphereLightIrradiance( const in HemisphereLight hemiLight, const in GeometricContext geometry ) {\n\t\tfloat dotNL = dot( geometry.normal, hemiLight.direction );\n\t\tfloat hemiDiffuseWeight = 0.5 * dotNL + 0.5;\n\t\tvec3 irradiance = mix( hemiLight.groundColor, hemiLight.skyColor, hemiDiffuseWeight );\n\t\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\t\tirradiance *= PI;\n\t\t#endif\n\t\treturn irradiance;\n\t}\n#endif\n#if defined( USE_ENVMAP ) && defined( PHYSICAL )\n\tvec3 getLightProbeIndirectIrradiance( const in GeometricContext geometry, const in int maxMIPLevel ) {\n\t\tvec3 worldNormal = inverseTransformDirection( geometry.normal, viewMatrix );\n\t\t#ifdef ENVMAP_TYPE_CUBE\n\t\t\tvec3 queryVec = vec3( flipEnvMap * worldNormal.x, worldNormal.yz );\n\t\t\t#ifdef TEXTURE_LOD_EXT\n\t\t\t\tvec4 envMapColor = textureCubeLodEXT( envMap, queryVec, float( maxMIPLevel ) );\n\t\t\t#else\n\t\t\t\tvec4 envMapColor = textureCube( envMap, queryVec, float( maxMIPLevel ) );\n\t\t\t#endif\n\t\t\tenvMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb;\n\t\t#elif defined( ENVMAP_TYPE_CUBE_UV )\n\t\t\tvec3 queryVec = vec3( flipEnvMap * worldNormal.x, worldNormal.yz );\n\t\t\tvec4 envMapColor = textureCubeUV( queryVec, 1.0 );\n\t\t#else\n\t\t\tvec4 envMapColor = vec4( 0.0 );\n\t\t#endif\n\t\treturn PI * envMapColor.rgb * envMapIntensity;\n\t}\n\tfloat getSpecularMIPLevel( const in float blinnShininessExponent, const in int maxMIPLevel ) {\n\t\tfloat maxMIPLevelScalar = float( maxMIPLevel );\n\t\tfloat desiredMIPLevel = maxMIPLevelScalar - 0.79248 - 0.5 * log2( pow2( blinnShininessExponent ) + 1.0 );\n\t\treturn clamp( desiredMIPLevel, 0.0, maxMIPLevelScalar );\n\t}\n\tvec3 getLightProbeIndirectRadiance( const in GeometricContext geometry, const in float blinnShininessExponent, const in int maxMIPLevel ) {\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t\tvec3 reflectVec = reflect( -geometry.viewDir, geometry.normal );\n\t\t#else\n\t\t\tvec3 reflectVec = refract( -geometry.viewDir, geometry.normal, refractionRatio );\n\t\t#endif\n\t\treflectVec = inverseTransformDirection( reflectVec, viewMatrix );\n\t\tfloat specularMIPLevel = getSpecularMIPLevel( blinnShininessExponent, maxMIPLevel );\n\t\t#ifdef ENVMAP_TYPE_CUBE\n\t\t\tvec3 queryReflectVec = vec3( flipEnvMap * reflectVec.x, reflectVec.yz );\n\t\t\t#ifdef TEXTURE_LOD_EXT\n\t\t\t\tvec4 envMapColor = textureCubeLodEXT( envMap, queryReflectVec, specularMIPLevel );\n\t\t\t#else\n\t\t\t\tvec4 envMapColor = textureCube( envMap, queryReflectVec, specularMIPLevel );\n\t\t\t#endif\n\t\t\tenvMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb;\n\t\t#elif defined( ENVMAP_TYPE_CUBE_UV )\n\t\t\tvec3 queryReflectVec = vec3( flipEnvMap * reflectVec.x, reflectVec.yz );\n\t\t\tvec4 envMapColor = textureCubeUV(queryReflectVec, BlinnExponentToGGXRoughness(blinnShinine
10578ssExponent));\n\t\t#elif defined( ENVMAP_TYPE_EQUIREC )\n\t\t\tvec2 sampleUV;\n\t\t\tsampleUV.y = saturate( reflectVec.y * 0.5 + 0.5 );\n\t\t\tsampleUV.x = atan( reflectVec.z, reflectVec.x ) * RECIPROCAL_PI2 + 0.5;\n\t\t\t#ifdef TEXTURE_LOD_EXT\n\t\t\t\tvec4 envMapColor = texture2DLodEXT( envMap, sampleUV, specularMIPLevel );\n\t\t\t#else\n\t\t\t\tvec4 envMapColor = texture2D( envMap, sampleUV, specularMIPLevel );\n\t\t\t#endif\n\t\t\tenvMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb;\n\t\t#elif defined( ENVMAP_TYPE_SPHERE )\n\t\t\tvec3 reflectView = normalize( ( viewMatrix * vec4( reflectVec, 0.0 ) ).xyz + vec3( 0.0,0.0,1.0 ) );\n\t\t\t#ifdef TEXTURE_LOD_EXT\n\t\t\t\tvec4 envMapColor = texture2DLodEXT( envMap, reflectView.xy * 0.5 + 0.5, specularMIPLevel );\n\t\t\t#else\n\t\t\t\tvec4 envMapColor = texture2D( envMap, reflectView.xy * 0.5 + 0.5, specularMIPLevel );\n\t\t\t#endif\n\t\t\tenvMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb;\n\t\t#endif\n\t\treturn envMapColor.rgb * envMapIntensity;\n\t}\n#endif\n',
10579    bd =
10580      'BlinnPhongMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;\nmaterial.specularColor = specular;\nmaterial.specularShininess = shininess;\nmaterial.specularStrength = specularStrength;\n',
10581    cd =
10582      'varying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\nstruct BlinnPhongMaterial {\n\tvec3\tdiffuseColor;\n\tvec3\tspecularColor;\n\tfloat\tspecularShininess;\n\tfloat\tspecularStrength;\n};\n#if NUM_RECT_AREA_LIGHTS > 0\n\tvoid RE_Direct_RectArea_BlinnPhong( const in RectAreaLight rectAreaLight, const in GeometricContext geometry, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\n\t\tvec3 matDiffColor = material.diffuseColor;\n\t\tvec3 matSpecColor = material.specularColor;\n\t\tvec3 lightColor   = rectAreaLight.color;\n\t\tfloat roughness = BlinnExponentToGGXRoughness( material.specularShininess );\n\t\tvec3 spec = Rect_Area_Light_Specular_Reflectance(\n\t\t\t\tgeometry,\n\t\t\t\trectAreaLight.position, rectAreaLight.halfWidth, rectAreaLight.halfHeight,\n\t\t\t\troughness,\n\t\t\t\tltcMat, ltcMag );\n\t\tvec3 diff = Rect_Area_Light_Diffuse_Reflectance(\n\t\t\t\tgeometry,\n\t\t\t\trectAreaLight.position, rectAreaLight.halfWidth, rectAreaLight.halfHeight );\n\t\treflectedLight.directSpecular += lightColor * matSpecColor * spec / PI2;\n\t\treflectedLight.directDiffuse  += lightColor * matDiffColor * diff / PI2;\n\t}\n#endif\nvoid RE_Direct_BlinnPhong( const in IncidentLight directLight, const in GeometricContext geometry, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\n\t#ifdef TOON\n\t\tvec3 irradiance = getGradientIrradiance( geometry.normal, directLight.direction ) * directLight.color;\n\t#else\n\t\tfloat dotNL = saturate( dot( geometry.normal, directLight.direction ) );\n\t\tvec3 irradiance = dotNL * directLight.color;\n\t#endif\n\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\tirradiance *= PI;\n\t#endif\n\treflectedLight.directDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n\treflectedLight.directSpecular += irradiance * BRDF_Specular_BlinnPhong( directLight, geometry, material.specularColor, material.specularShininess ) * material.specularStrength;\n}\nvoid RE_IndirectDiffuse_BlinnPhong( const in vec3 irradiance, const in GeometricContext geometry, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n}\n#define RE_Direct\t\t\t\tRE_Direct_BlinnPhong\n#define RE_Direct_RectArea\t\tRE_Direct_RectArea_BlinnPhong\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_BlinnPhong\n#define Material_LightProbeLOD( material )\t(0)\n',
10583    dd =
10584      'PhysicalMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb * ( 1.0 - metalnessFactor );\nmaterial.specularRoughness = clamp( roughnessFactor, 0.04, 1.0 );\n#ifdef STANDARD\n\tmaterial.specularColor = mix( vec3( DEFAULT_SPECULAR_COEFFICIENT ), diffuseColor.rgb, metalnessFactor );\n#else\n\tmaterial.specularColor = mix( vec3( MAXIMUM_SPECULAR_COEFFICIENT * pow2( reflectivity ) ), diffuseColor.rgb, metalnessFactor );\n\tmaterial.clearCoat = saturate( clearCoat );\tmaterial.clearCoatRoughness = clamp( clearCoatRoughness, 0.04, 1.0 );\n#endif\n',
10585    ed =
10586      'struct PhysicalMaterial {\n\tvec3\tdiffuseColor;\n\tfloat\tspecularRoughness;\n\tvec3\tspecularColor;\n\t#ifndef STANDARD\n\t\tfloat clearCoat;\n\t\tfloat clearCoatRoughness;\n\t#endif\n};\n#define MAXIMUM_SPECULAR_COEFFICIENT 0.16\n#define DEFAULT_SPECULAR_COEFFICIENT 0.04\nfloat clearCoatDHRApprox( const in float roughness, const in float dotNL ) {\n\treturn DEFAULT_SPECULAR_COEFFICIENT + ( 1.0 - DEFAULT_SPECULAR_COEFFICIENT ) * ( pow( 1.0 - dotNL, 5.0 ) * pow( 1.0 - roughness, 2.0 ) );\n}\n#if NUM_RECT_AREA_LIGHTS > 0\n\tvoid RE_Direct_RectArea_Physical( const in RectAreaLight rectAreaLight, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\t\tvec3 matDiffColor = material.diffuseColor;\n\t\tvec3 matSpecColor = material.specularColor;\n\t\tvec3 lightColor   = rectAreaLight.color;\n\t\tfloat roughness = material.specularRoughness;\n\t\tvec3 spec = Rect_Area_Light_Specular_Reflectance(\n\t\t\t\tgeometry,\n\t\t\t\trectAreaLight.position, rectAreaLight.halfWidth, rectAreaLight.halfHeight,\n\t\t\t\troughness,\n\t\t\t\tltcMat, ltcMag );\n\t\tvec3 diff = Rect_Area_Light_Diffuse_Reflectance(\n\t\t\t\tgeometry,\n\t\t\t\trectAreaLight.position, rectAreaLight.halfWidth, rectAreaLight.halfHeight );\n\t\treflectedLight.directSpecular += lightColor * matSpecColor * spec;\n\t\treflectedLight.directDiffuse  += lightColor * matDiffColor * diff;\n\t}\n#endif\nvoid RE_Direct_Physical( const in IncidentLight directLight, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\tfloat dotNL = saturate( dot
10586( geometry.normal, directLight.direction ) );\n\tvec3 irradiance = dotNL * directLight.color;\n\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\tirradiance *= PI;\n\t#endif\n\t#ifndef STANDARD\n\t\tfloat clearCoatDHR = material.clearCoat * clearCoatDHRApprox( material.clearCoatRoughness, dotNL );\n\t#else\n\t\tfloat clearCoatDHR = 0.0;\n\t#endif\n\treflectedLight.directSpecular += ( 1.0 - clearCoatDHR ) * irradiance * BRDF_Specular_GGX( directLight, geometry, material.specularColor, material.specularRoughness );\n\treflectedLight.directDiffuse += ( 1.0 - clearCoatDHR ) * irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n\t#ifndef STANDARD\n\t\treflectedLight.directSpecular += irradiance * material.clearCoat * BRDF_Specular_GGX( directLight, geometry, vec3( DEFAULT_SPECULAR_COEFFICIENT ), material.clearCoatRoughness );\n\t#endif\n}\nvoid RE_IndirectDiffuse_Physical( const in vec3 irradiance, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectSpecular_Physical( const in vec3 radiance, const in vec3 clearCoatRadiance, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\t#ifndef STANDARD\n\t\tfloat dotNV = saturate( dot( geometry.normal, geometry.viewDir ) );\n\t\tfloat dotNL = dotNV;\n\t\tfloat clearCoatDHR = material.clearCoat * clearCoatDHRApprox( material.clearCoatRoughness, dotNL );\n\t#else\n\t\tfloat clearCoatDHR = 0.0;\n\t#endif\n\treflectedLight.indirectSpecular += ( 1.0 - clearCoatDHR ) * radiance * BRDF_Specular_GGX_Environment( geometry, material.specularColor, material.specularRoughness );\n\t#ifndef STANDARD\n\t\treflectedLight.indirectSpecular += clearCoatRadiance * material.clearCoat * BRDF_Specular_GGX_Environment( geometry, vec3( DEFAULT_SPECULAR_COEFFICIENT ), material.clearCoatRoughness );\n\t#endif\n}\n#define RE_Direct\t\t\t\tRE_Direct_Physical\n#define RE_Direct_RectArea\t\tRE_Direct_RectArea_Physical\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_Physical\n#define RE_IndirectSpecular\t\tRE_IndirectSpecular_Physical\n#define Material_BlinnShininessExponent( material )   GGXRoughnessToBlinnExponent( material.specularRoughness )\n#define Material_ClearCoat_BlinnShininessExponent( material )   GGXRoughnessToBlinnExponent( material.clearCoatRoughness )\nfloat computeSpecularOcclusion( const in float dotNV, const in float ambientOcclusion, const in float roughness ) {\n\treturn saturate( pow( dotNV + ambientOcclusion, exp2( - 16.0 * roughness - 1.0 ) ) - 1.0 + ambientOcclusion );\n}\n',
10587    fd =
10588      '\nGeometricContext geometry;\ngeometry.position = - vViewPosition;\ngeometry.normal = normal;\ngeometry.viewDir = normalize( vViewPosition );\nIncidentLight directLight;\n#if ( NUM_POINT_LIGHTS > 0 ) && defined( RE_Direct )\n\tPointLight pointLight;\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n\t\tpointLight = pointLights[ i ];\n\t\tgetPointDirectLightIrradiance( pointLight, geometry, directLight );\n\t\t#ifdef USE_SHADOWMAP\n\t\tdirectLight.color *= all( bvec2( pointLight.shadow, directLight.visible ) ) ? getPointShadow( pointShadowMap[ i ], pointLight.shadowMapSize, pointLight.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ] ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\t}\n#endif\n#if ( NUM_SPOT_LIGHTS > 0 ) && defined( RE_Direct )\n\tSpotLight spotLight;\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n\t\tspotLight = spotLights[ i ];\n\t\tgetSpotDirectLightIrradiance( spotLight, geometry, directLight );\n\t\t#ifdef USE_SHADOWMAP\n\t\tdirectLight.color *= all( bvec2( spotLight.shadow, directLight.visible ) ) ? getShadow( spotShadowMap[ i ], spotLight.shadowMapSize, spotLight.shadowBias, spotLight.shadowRadius, vSpotShadowCoord[ i ] ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\t}\n#endif\n#if ( NUM_DIR_LIGHTS > 0 ) && defined( RE_Direct )\n\tDirectionalLight directionalLight;\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n\t\tdirectionalLight = directionalLights[ i ];\n\t\tgetDirectionalDirectLightIrradiance( directionalLight, geometry, directLight );\n\t\t#ifdef USE_SHADOWMAP\n\t\tdirectLight.color *= all( bvec2( directionalLight.shadow, directLight.visible ) ) ? getShadow( directionalShadowMap[ i ], directionalLight.shadowMapSize, directionalLight.shadowBias, directionalLight.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\t}\n#endif\n#if ( NUM_RECT_AREA_LIGHTS > 0 ) && defined( RE_Direct_RectArea )\n\tRectAreaLight rectAreaLight;\n\tfor ( int i = 0; i < NUM_RECT_AREA_LIGHTS; i ++ ) {\n\t\trectAreaLight = rectAreaLights[ i ];\n\t\tRE_Direct_RectArea( rectAreaLight, geometry, material, reflectedLight );\n\t}\n#endif\n#if defined( RE_IndirectDiffuse )\n\tvec3 irradiance = getAmbientLightIrradiance( ambientLightColor );\n\t#ifdef USE_LIGHTMAP\n\t\tvec3 lightMapIrradiance = texture2D( lightMap, vUv2 ).xyz * lightMapIntensity;\n\t\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\t\tlightMapIrradiance *= PI;\n\t\t#endif\n\t\tirradiance += lightMapIrradiance;\n\t#endif\n\t#if ( NUM_HEMI_LIGHTS > 0 )\n\t\tfor ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {\n\t\t\tirradiance += getHemisphereLightIrradiance( hemisphereLights[ i ], geometry );\n\t\t}\n\t#endif\n\t#if defined( USE_ENVMAP ) && defined( PHYSICAL ) && defined( ENVMAP_TYPE_CUBE_UV )\n\t\tirradiance += getLightProbeIndirectIrradiance( geometry, 8 );\n\t#endif\n\tRE_IndirectDiffuse( irradiance, geometry, material, reflectedLight );\n#endif\n#if defined( USE_ENVMAP ) && defined( RE_IndirectSpecular )\n\tvec3 radiance = getLightProbeIndirectRadiance( geometry, Material_BlinnShinine
10588ssExponent( material ), 8 );\n\t#ifndef STANDARD\n\t\tvec3 clearCoatRadiance = getLightProbeIndirectRadiance( geometry, Material_ClearCoat_BlinnShininessExponent( material ), 8 );\n\t#else\n\t\tvec3 clearCoatRadiance = vec3( 0.0 );\n\t#endif\n\tRE_IndirectSpecular( radiance, clearCoatRadiance, geometry, material, reflectedLight );\n#endif\n',
10589    gd =
10590      '#if defined(USE_LOGDEPTHBUF) && defined(USE_LOGDEPTHBUF_EXT)\n\tgl_FragDepthEXT = log2(vFragDepth) * logDepthBufFC * 0.5;\n#endif',
10591    hd =
10592      '#ifdef USE_LOGDEPTHBUF\n\tuniform float logDepthBufFC;\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tvarying float vFragDepth;\n\t#endif\n#endif\n',
10593    id =
10594      '#ifdef USE_LOGDEPTHBUF\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tvarying float vFragDepth;\n\t#endif\n\tuniform float logDepthBufFC;\n#endif',
10595    jd =
10596      '#ifdef USE_LOGDEPTHBUF\n\tgl_Position.z = log2(max( EPSILON, gl_Position.w + 1.0 )) * logDepthBufFC;\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tvFragDepth = 1.0 + gl_Position.w;\n\t#else\n\t\tgl_Position.z = (gl_Position.z - 1.0) * gl_Position.w;\n\t#endif\n#endif\n',
10597    kd =
10598      '#ifdef USE_MAP\n\tvec4 texelColor = texture2D( map, vUv );\n\ttexelColor = mapTexelToLinear( texelColor );\n\tdiffuseColor *= texelColor;\n#endif\n',
10599    ld = '#ifdef USE_MAP\n\tuniform sampler2D map;\n#endif\n',
10600    md =
10601      '#ifdef USE_MAP\n\tvec4 mapTexel = texture2D( map, vec2( gl_PointCoord.x, 1.0 - gl_PointCoord.y ) * offsetRepeat.zw + offsetRepeat.xy );\n\tdiffuseColor *= mapTexelToLinear( mapTexel );\n#endif\n',
10602    nd =
10603      '#ifdef USE_MAP\n\tuniform vec4 offsetRepeat;\n\tuniform sampler2D map;\n#endif\n',
10604    od =
10605      'float metalnessFactor = metalness;\n#ifdef USE_METALNESSMAP\n\tvec4 texelMetalness = texture2D( metalnessMap, vUv );\n\tmetalnessFactor *= texelMetalness.r;\n#endif\n',
10606    pd = '#ifdef USE_METALNESSMAP\n\tuniform sampler2D metalnessMap;\n#endif',
10607    qd =
10608      '#ifdef USE_MORPHNORMALS\n\tobjectNormal += ( morphNormal0 - normal ) * morphTargetInfluences[ 0 ];\n\tobjectNormal += ( morphNormal1 - normal ) * morphTargetInfluences[ 1 ];\n\tobjectNormal += ( morphNormal2 - normal ) * morphTargetInfluences[ 2 ];\n\tobjectNormal += ( morphNormal3 - normal ) * morphTargetInfluences[ 3 ];\n#endif\n',
10609    rd =
10610      '#ifdef USE_MORPHTARGETS\n\t#ifndef USE_MORPHNORMALS\n\tuniform float morphTargetInfluences[ 8 ];\n\t#else\n\tuniform float morphTargetInfluences[ 4 ];\n\t#endif\n#endif',
10611    sd =
10612      '#ifdef USE_MORPHTARGETS\n\ttransformed += ( morphTarget0 - position ) * morphTargetInfluences[ 0 ];\n\ttransformed += ( morphTarget1 - position ) * morphTargetInfluences[ 1 ];\n\ttransformed += ( morphTarget2 - position ) * morphTargetInfluences[ 2 ];\n\ttransformed += ( morphTarget3 - position ) * morphTargetInfluences[ 3 ];\n\t#ifndef USE_MORPHNORMALS\n\ttransformed += ( morphTarget4 - position ) * morphTargetInfluences[ 4 ];\n\ttransformed += ( morphTarget5 - position ) * morphTargetInfluences[ 5 ];\n\ttransformed += ( morphTarget6 - position ) * morphTargetInfluences[ 6 ];\n\ttransformed += ( morphTarget7 - position ) * morphTargetInfluences[ 7 ];\n\t#endif\n#endif\n',
10613    td =
10614      '#ifdef DOUBLE_SIDED\n\tfloat flipNormal = ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n#else\n\tfloat flipNormal = 1.0;\n#endif\n',
10615    ud =
10616      '#ifdef FLAT_SHADED\n\tvec3 fdx = vec3( dFdx( vViewPosition.x ), dFdx( vViewPosition.y ), dFdx( vViewPosition.z ) );\n\tvec3 fdy = vec3( dFdy( vViewPosition.x ), dFdy( vViewPosition.y ), dFdy( vViewPosition.z ) );\n\tvec3 normal = normalize( cross( fdx, fdy ) );\n#else\n\tvec3 normal = normalize( vNormal ) * flipNormal;\n#endif\n#ifdef USE_NORMALMAP\n\tnormal = perturbNormal2Arb( -vViewPosition, normal );\n#elif defined( USE_BUMPMAP )\n\tnormal = perturbNormalArb( -vViewPosition, normal, dHdxy_fwd() );\n#endif\n',
10617    vd =
10618      '#ifdef USE_NORMALMAP\n\tuniform sampler2D normalMap;\n\tuniform vec2 normalScale;\n\tvec3 perturbNormal2Arb( vec3 eye_pos, vec3 surf_norm ) {\n\t\tvec3 q0 = dFdx( eye_pos.xyz );\n\t\tvec3 q1 = dFdy( eye_pos.xyz );\n\t\tvec2 st0 = dFdx( vUv.st );\n\t\tvec2 st1 = dFdy( vUv.st );\n\t\tvec3 S = normalize( q0 * st1.t - q1 * st0.t );\n\t\tvec3 T = normalize( -q0 * st1.s + q1 * st0.s );\n\t\tvec3 N = normalize( surf_norm );\n\t\tvec3 mapN = texture2D( normalMap, vUv ).xyz * 2.0 - 1.0;\n\t\tmapN.xy = normalScale * mapN.xy;\n\t\tmat3 tsn = mat3( S, T, N );\n\t\treturn normalize( tsn * mapN );\n\t}\n#endif\n',
10619    wd =
10620      'vec3 packNormalToRGB( const in vec3 normal ) {\n\treturn normalize( normal ) * 0.5 + 0.5;\n}\nvec3 unpackRGBToNormal( const in vec3 rgb ) {\n\treturn 1.0 - 2.0 * rgb.xyz;\n}\nconst float PackUpscale = 256. / 255.;const float UnpackDownscale = 255. / 256.;\nconst vec3 PackFactors = vec3( 256. * 256. * 256., 256. * 256.,  256. );\nconst vec4 UnpackFactors = UnpackDownscale / vec4( PackFactors, 1. );\nconst float ShiftRight8 = 1. / 256.;\nvec4 packDepthToRGBA( const in float v ) {\n\tvec4 r = vec4( fract( v * PackFactors ), v );\n\tr.yzw -= r.xyz * ShiftRight8;\treturn r * PackUpscale;\n}\nfloat unpackRGBAToDepth( const in vec4 v ) {\n\treturn dot( v, UnpackFactors );\n}\nfloat viewZToOrthographicDepth( const in float viewZ, const in float near, const in float far ) {\n\treturn ( viewZ + near ) / ( near - far );\n}\nfloat orthographicDepthToViewZ( const in float linearClipZ, const in float near, const in float far ) {\n\treturn linearClipZ * ( near - far ) - near;\n}\nfloat viewZToPerspectiveDepth( const in float viewZ, const in float near, const in float far ) {\n\treturn (( near + viewZ ) * far ) / (( far - near ) * viewZ );\n}\nfloat perspectiveDepthToViewZ( const in float invClipZ, const in float near, const in float far ) {\n\treturn ( near * far ) / ( ( far - near ) * invClipZ - far );\n}\n',
10621    xd =
10622      '#ifdef PREMULTIPLIED_ALPHA\n\tgl_FragColor.rgb *= gl_FragColor.a;\n#endif\n',
10623    yd =
10624      '#ifdef USE_SKINNING\n\tvec4 mvPosition = modelViewMatrix * skinned;\n#else\n\tvec4 mvPosition = modelViewMatrix * vec4( transformed, 1.0 );\n#endif\ngl_Position = projectionMatrix * mvPosition;\n',
10625    zd =
10626      'float roughnessFactor = roughness;\n#ifdef USE_ROUGHNESSMAP\n\tvec4 texelRoughness = texture2D( roughnessMap, vUv );\n\troughnessFactor *= texelRoughness.r;\n#endif\n',
10627    Ad = '#ifdef USE_ROUGHNESSMAP\n\tuniform sampler2D roughnessMap;\n#endif',
10628    Bd =
10629      '#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHTS > 0\n\t\tuniform sampler2D directionalShadowMap[ NUM_DIR_LIGHTS ];\n\t\tvarying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHTS ];
10629\n\t#endif\n\t#if NUM_SPOT_LIGHTS > 0\n\t\tuniform sampler2D spotShadowMap[ NUM_SPOT_LIGHTS ];\n\t\tvarying vec4 vSpotShadowCoord[ NUM_SPOT_LIGHTS ];\n\t#endif\n\t#if NUM_POINT_LIGHTS > 0\n\t\tuniform sampler2D pointShadowMap[ NUM_POINT_LIGHTS ];\n\t\tvarying vec4 vPointShadowCoord[ NUM_POINT_LIGHTS ];\n\t#endif\n\tfloat texture2DCompare( sampler2D depths, vec2 uv, float compare ) {\n\t\treturn step( compare, unpackRGBAToDepth( texture2D( depths, uv ) ) );\n\t}\n\tfloat texture2DShadowLerp( sampler2D depths, vec2 size, vec2 uv, float compare ) {\n\t\tconst vec2 offset = vec2( 0.0, 1.0 );\n\t\tvec2 texelSize = vec2( 1.0 ) / size;\n\t\tvec2 centroidUV = floor( uv * size + 0.5 ) / size;\n\t\tfloat lb = texture2DCompare( depths, centroidUV + texelSize * offset.xx, compare );\n\t\tfloat lt = texture2DCompare( depths, centroidUV + texelSize * offset.xy, compare );\n\t\tfloat rb = texture2DCompare( depths, centroidUV + texelSize * offset.yx, compare );\n\t\tfloat rt = texture2DCompare( depths, centroidUV + texelSize * offset.yy, compare );\n\t\tvec2 f = fract( uv * size + 0.5 );\n\t\tfloat a = mix( lb, lt, f.y );\n\t\tfloat b = mix( rb, rt, f.y );\n\t\tfloat c = mix( a, b, f.x );\n\t\treturn c;\n\t}\n\tfloat getShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord ) {\n\t\tshadowCoord.xyz /= shadowCoord.w;\n\t\tshadowCoord.z += shadowBias;\n\t\tbvec4 inFrustumVec = bvec4 ( shadowCoord.x >= 0.0, shadowCoord.x <= 1.0, shadowCoord.y >= 0.0, shadowCoord.y <= 1.0 );\n\t\tbool inFrustum = all( inFrustumVec );\n\t\tbvec2 frustumTestVec = bvec2( inFrustum, shadowCoord.z <= 1.0 );\n\t\tbool frustumTest = all( frustumTestVec );\n\t\tif ( frustumTest ) {\n\t\t#if defined( SHADOWMAP_TYPE_PCF )\n\t\t\tvec2 texelSize = vec2( 1.0 ) / shadowMapSize;\n\t\t\tfloat dx0 = - texelSize.x * shadowRadius;\n\t\t\tfloat dy0 = - texelSize.y * shadowRadius;\n\t\t\tfloat dx1 = + texelSize.x * shadowRadius;\n\t\t\tfloat dy1 = + texelSize.y * shadowRadius;\n\t\t\treturn (\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy1 ), shadowCoord.z )\n\t\t\t) * ( 1.0 / 9.0 );\n\t\t#elif defined( SHADOWMAP_TYPE_PCF_SOFT )\n\t\t\tvec2 texelSize = vec2( 1.0 ) / shadowMapSize;\n\t\t\tfloat dx0 = - texelSize.x * shadowRadius;\n\t\t\tfloat dy0 = - texelSize.y * shadowRadius;\n\t\t\tfloat dx1 = + texelSize.x * shadowRadius;\n\t\t\tfloat dy1 = + texelSize.y * shadowRadius;\n\t\t\treturn (\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( 0.0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx1, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx0, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy, shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx1, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( 0.0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx1, dy1 ), shadowCoord.z )\n\t\t\t) * ( 1.0 / 9.0 );\n\t\t#else\n\t\t\treturn texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z );\n\t\t#endif\n\t\t}\n\t\treturn 1.0;\n\t}\n\tvec2 cubeToUV( vec3 v, float texelSizeY ) {\n\t\tvec3 absV = abs( v );\n\t\tfloat scaleToCube = 1.0 / max( absV.x, max( absV.y, absV.z ) );\n\t\tabsV *= scaleToCube;\n\t\tv *= scaleToCube * ( 1.0 - 2.0 * texelSizeY );\n\t\tvec2 planar = v.xy;\n\t\tfloat almostATexel = 1.5 * texelSizeY;\n\t\tfloat almostOne = 1.0 - almostATexel;\n\t\tif ( absV.z >= almostOne ) {\n\t\t\tif ( v.z > 0.0 )\n\t\t\t\tplanar.x = 4.0 - v.x;\n\t\t} else if ( absV.x >= almostOne ) {\n\t\t\tfloat signX = sign( v.x );\n\t\t\tplanar.x = v.z * signX + 2.0 * signX;\n\t\t} else if ( absV.y >= almostOne ) {\n\t\t\tfloat signY = sign( v.y );\n\t\t\tplanar.x = v.x + 2.0 * signY + 2.0;\n\t\t\tplanar.y = v.z * signY - 2.0;\n\t\t}\n\t\treturn vec2( 0.125, 0.25 ) * planar + vec2( 0.375, 0.75 );\n\t}\n\tfloat getPointShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord ) {\n\t\tvec2 texelSize = vec2( 1.0 ) / ( shadowMapSize * vec2( 4.0, 2.0 ) );\n\t\tvec3 lightToPosition = shadowCoord.xyz;\n\t\tvec3 bd3D = normalize( lightToPosition );\n\t\tfloat dp = ( length( lightToPosition ) - shadowBias ) / 1000.0;\n\t\t#if defined( SHADOWMAP_TYPE_PCF ) || defined( SHADOWMAP_TYPE_PCF_SOFT )\n\t\t\tvec2 offset = vec2( - 1, 1 ) * shadowRadius * texelSize.y;\n\t\t\treturn (\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxx, texelSize.y ), dp )\n\t\t\t) * ( 1.0 / 9.0 );\n\t\t#else\n\t\t\treturn texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp );\n\t\t#endif\n\t}\n#endif\n',
10630    Cd =
10631      '#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHTS > 0\n\t\tuniform mat4 directionalShadowMatrix[ NUM_DIR_LIGHTS ];\n\t\tvarying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHTS ];
10631\n\t#endif\n\t#if NUM_SPOT_LIGHTS > 0\n\t\tuniform mat4 spotShadowMatrix[ NUM_SPOT_LIGHTS ];\n\t\tvarying vec4 vSpotShadowCoord[ NUM_SPOT_LIGHTS ];\n\t#endif\n\t#if NUM_POINT_LIGHTS > 0\n\t\tuniform mat4 pointShadowMatrix[ NUM_POINT_LIGHTS ];\n\t\tvarying vec4 vPointShadowCoord[ NUM_POINT_LIGHTS ];\n\t#endif\n#endif\n',
10632    Dd =
10633      '#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHTS > 0\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n\t\tvDirectionalShadowCoord[ i ] = directionalShadowMatrix[ i ] * worldPosition;\n\t}\n\t#endif\n\t#if NUM_SPOT_LIGHTS > 0\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n\t\tvSpotShadowCoord[ i ] = spotShadowMatrix[ i ] * worldPosition;\n\t}\n\t#endif\n\t#if NUM_POINT_LIGHTS > 0\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n\t\tvPointShadowCoord[ i ] = pointShadowMatrix[ i ] * worldPosition;\n\t}\n\t#endif\n#endif\n',
10634    Ed =
10635      'float getShadowMask() {\n\tfloat shadow = 1.0;\n\t#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHTS > 0\n\tDirectionalLight directionalLight;\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n\t\tdirectionalLight = directionalLights[ i ];\n\t\tshadow *= bool( directionalLight.shadow ) ? getShadow( directionalShadowMap[ i ], directionalLight.shadowMapSize, directionalLight.shadowBias, directionalLight.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n\t}\n\t#endif\n\t#if NUM_SPOT_LIGHTS > 0\n\tSpotLight spotLight;\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n\t\tspotLight = spotLights[ i ];\n\t\tshadow *= bool( spotLight.shadow ) ? getShadow( spotShadowMap[ i ], spotLight.shadowMapSize, spotLight.shadowBias, spotLight.shadowRadius, vSpotShadowCoord[ i ] ) : 1.0;\n\t}\n\t#endif\n\t#if NUM_POINT_LIGHTS > 0\n\tPointLight pointLight;\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n\t\tpointLight = pointLights[ i ];\n\t\tshadow *= bool( pointLight.shadow ) ? getPointShadow( pointShadowMap[ i ], pointLight.shadowMapSize, pointLight.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ] ) : 1.0;\n\t}\n\t#endif\n\t#endif\n\treturn shadow;\n}\n',
10636    Fd =
10637      '#ifdef USE_SKINNING\n\tmat4 boneMatX = getBoneMatrix( skinIndex.x );\n\tmat4 boneMatY = getBoneMatrix( skinIndex.y );\n\tmat4 boneMatZ = getBoneMatrix( skinIndex.z );\n\tmat4 boneMatW = getBoneMatrix( skinIndex.w );\n#endif',
10638    Gd =
10639      '#ifdef USE_SKINNING\n\tuniform mat4 bindMatrix;\n\tuniform mat4 bindMatrixInverse;\n\t#ifdef BONE_TEXTURE\n\t\tuniform sampler2D boneTexture;\n\t\tuniform int boneTextureWidth;\n\t\tuniform int boneTextureHeight;\n\t\tmat4 getBoneMatrix( const in float i ) {\n\t\t\tfloat j = i * 4.0;\n\t\t\tfloat x = mod( j, float( boneTextureWidth ) );\n\t\t\tfloat y = floor( j / float( boneTextureWidth ) );\n\t\t\tfloat dx = 1.0 / float( boneTextureWidth );\n\t\t\tfloat dy = 1.0 / float( boneTextureHeight );\n\t\t\ty = dy * ( y + 0.5 );\n\t\t\tvec4 v1 = texture2D( boneTexture, vec2( dx * ( x + 0.5 ), y ) );\n\t\t\tvec4 v2 = texture2D( boneTexture, vec2( dx * ( x + 1.5 ), y ) );\n\t\t\tvec4 v3 = texture2D( boneTexture, vec2( dx * ( x + 2.5 ), y ) );\n\t\t\tvec4 v4 = texture2D( boneTexture, vec2( dx * ( x + 3.5 ), y ) );\n\t\t\tmat4 bone = mat4( v1, v2, v3, v4 );\n\t\t\treturn bone;\n\t\t}\n\t#else\n\t\tuniform mat4 boneMatrices[ MAX_BONES ];\n\t\tmat4 getBoneMatrix( const in float i ) {\n\t\t\tmat4 bone = boneMatrices[ int(i) ];\n\t\t\treturn bone;\n\t\t}\n\t#endif\n#endif\n',
10640    Hd =
10641      '#ifdef USE_SKINNING\n\tvec4 skinVertex = bindMatrix * vec4( transformed, 1.0 );\n\tvec4 skinned = vec4( 0.0 );\n\tskinned += boneMatX * skinVertex * skinWeight.x;\n\tskinned += boneMatY * skinVertex * skinWeight.y;\n\tskinned += boneMatZ * skinVertex * skinWeight.z;\n\tskinned += boneMatW * skinVertex * skinWeight.w;\n\tskinned  = bindMatrixInverse * skinned;\n#endif\n',
10642    Id =
10643      '#ifdef USE_SKINNING\n\tmat4 skinMatrix = mat4( 0.0 );\n\tskinMatrix += skinWeight.x * boneMatX;\n\tskinMatrix += skinWeight.y * boneMatY;\n\tskinMatrix += skinWeight.z * boneMatZ;\n\tskinMatrix += skinWeight.w * boneMatW;\n\tskinMatrix  = bindMatrixInverse * skinMatrix * bindMatrix;\n\tobjectNormal = vec4( skinMatrix * vec4( objectNormal, 0.0 ) ).xyz;\n#endif\n',
10644    Jd =
10645      'float specularStrength;\n#ifdef USE_SPECULARMAP\n\tvec4 texelSpecular = texture2D( specularMap, vUv );\n\tspecularStrength = texelSpecular.r;\n#else\n\tspecularStrength = 1.0;\n#endif',
10646    Kd = '#ifdef USE_SPECULARMAP\n\tuniform sampler2D specularMap;\n#endif',
10647    Ld =
10648      '#if defined( TONE_MAPPING )\n  gl_FragColor.rgb = toneMapping( gl_FragColor.rgb );\n#endif\n',
10649    Md =
10650      '#define saturate(a) clamp( a, 0.0, 1.0 )\nuniform float toneMappingExposure;
10650\nuniform float toneMappingWhitePoint;\nvec3 LinearToneMapping( vec3 color ) {\n\treturn toneMappingExposure * color;\n}\nvec3 ReinhardToneMapping( vec3 color ) {\n\tcolor *= toneMappingExposure;\n\treturn saturate( color / ( vec3( 1.0 ) + color ) );\n}\n#define Uncharted2Helper( x ) max( ( ( x * ( 0.15 * x + 0.10 * 0.50 ) + 0.20 * 0.02 ) / ( x * ( 0.15 * x + 0.50 ) + 0.20 * 0.30 ) ) - 0.02 / 0.30, vec3( 0.0 ) )\nvec3 Uncharted2ToneMapping( vec3 color ) {\n\tcolor *= toneMappingExposure;\n\treturn saturate( Uncharted2Helper( color ) / Uncharted2Helper( vec3( toneMappingWhitePoint ) ) );\n}\nvec3 OptimizedCineonToneMapping( vec3 color ) {\n\tcolor *= toneMappingExposure;\n\tcolor = max( vec3( 0.0 ), color - 0.004 );\n\treturn pow( ( color * ( 6.2 * color + 0.5 ) ) / ( color * ( 6.2 * color + 1.7 ) + 0.06 ), vec3( 2.2 ) );\n}\n',
10651    Nd =
10652      '#if defined( USE_MAP ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( USE_SPECULARMAP ) || defined( USE_ALPHAMAP ) || defined( USE_EMISSIVEMAP ) || defined( USE_ROUGHNESSMAP ) || defined( USE_METALNESSMAP )\n\tvarying vec2 vUv;\n#endif',
10653    Od =
10654      '#if defined( USE_MAP ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( USE_SPECULARMAP ) || defined( USE_ALPHAMAP ) || defined( USE_EMISSIVEMAP ) || defined( USE_ROUGHNESSMAP ) || defined( USE_METALNESSMAP )\n\tvarying vec2 vUv;\n\tuniform vec4 offsetRepeat;\n#endif\n',
10655    Pd =
10656      '#if defined( USE_MAP ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( USE_SPECULARMAP ) || defined( USE_ALPHAMAP ) || defined( USE_EMISSIVEMAP ) || defined( USE_ROUGHNESSMAP ) || defined( USE_METALNESSMAP )\n\tvUv = uv * offsetRepeat.zw + offsetRepeat.xy;\n#endif',
10657    Qd =
10658      '#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tvarying vec2 vUv2;\n#endif',
10659    Rd =
10660      '#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tattribute vec2 uv2;\n\tvarying vec2 vUv2;\n#endif',
10661    Sd =
10662      '#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tvUv2 = uv2;\n#endif',
10663    Td =
10664      '#if defined( USE_ENVMAP ) || defined( PHONG ) || defined( PHYSICAL ) || defined( LAMBERT ) || defined ( USE_SHADOWMAP )\n\t#ifdef USE_SKINNING\n\t\tvec4 worldPosition = modelMatrix * skinned;\n\t#else\n\t\tvec4 worldPosition = modelMatrix * vec4( transformed, 1.0 );\n\t#endif\n#endif\n',
10665    Ud =
10666      'uniform samplerCube tCube;\nuniform float tFlip;\nuniform float opacity;\nvarying vec3 vWorldPosition;\n#include <common>\nvoid main() {\n\tgl_FragColor = textureCube( tCube, vec3( tFlip * vWorldPosition.x, vWorldPosition.yz ) );\n\tgl_FragColor.a *= opacity;\n}\n',
10667    Vd =
10668      'varying vec3 vWorldPosition;\n#include <common>\nvoid main() {\n\tvWorldPosition = transformDirection( position, modelMatrix );\n\t#include <begin_vertex>\n\t#include <project_vertex>\n}\n',
10669    Wd =
10670      '#if DEPTH_PACKING == 3200\n\tuniform float opacity;\n#endif\n#include <common>\n#include <packing>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( 1.0 );\n\t#if DEPTH_PACKING == 3200\n\t\tdiffuseColor.a = opacity;\n\t#endif\n\t#include <map_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <logdepthbuf_fragment>\n\t#if DEPTH_PACKING == 3200\n\t\tgl_FragColor = vec4( vec3( gl_FragCoord.z ), opacity );\n\t#elif DEPTH_PACKING == 3201\n\t\tgl_FragColor = packDepthToRGBA( gl_FragCoord.z );\n\t#endif\n}\n',
10671    Xd =
10672      '#include <common>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <skinbase_vertex>\n\t#include <begin_vertex>\n\t#include <displacementmap_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n}\n',
10673    Yd =
10674      'uniform vec3 lightPos;\nvarying vec4 vWorldPosition;\n#include <common>\n#include <packing>\n#include <clipping_planes_pars_fragment>\nvoid main () {\n\t#include <clipping_planes_fragment>\n\tgl_FragColor = packDepthToRGBA( length( vWorldPosition.xyz - lightPos.xyz ) / 1000.0 );\n}\n',
10675    Zd =
10676      'varying vec4 vWorldPosition;\n#include <common>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <skinbase_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <project_vertex>\n\t#include <worldpos_vertex>\n\t#include <clipping_planes_vertex>\n\tvWorldPosition = worldPosition;\n}\n',
10677    $d =
10678      'uniform sampler2D tEquirect;\nuniform float tFlip;\nvarying vec3 vWorldPosition;\n#include <common>\nvoid main() {\n\tvec3 direction = normalize( vWorldPosition );\n\tvec2 sampleUV;
10678\n\tsampleUV.y = saturate( tFlip * direction.y * -0.5 + 0.5 );\n\tsampleUV.x = atan( direction.z, direction.x ) * RECIPROCAL_PI2 + 0.5;\n\tgl_FragColor = texture2D( tEquirect, sampleUV );\n}\n',
10679    _d =
10680      'varying vec3 vWorldPosition;\n#include <common>\nvoid main() {\n\tvWorldPosition = transformDirection( position, modelMatrix );\n\t#include <begin_vertex>\n\t#include <project_vertex>\n}\n',
10681    ae =
10682      'uniform vec3 diffuse;\nuniform float opacity;\nuniform float dashSize;\nuniform float totalSize;\nvarying float vLineDistance;\n#include <common>\n#include <color_pars_fragment>\n#include <fog_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tif ( mod( vLineDistance, totalSize ) > dashSize ) {\n\t\tdiscard;\n\t}\n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <logdepthbuf_fragment>\n\t#include <color_fragment>\n\toutgoingLight = diffuseColor.rgb;\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <premultiplied_alpha_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n}\n',
10683    be =
10684      'uniform float scale;\nattribute float lineDistance;\nvarying float vLineDistance;\n#include <common>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <color_vertex>\n\tvLineDistance = scale * lineDistance;\n\tvec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );\n\tgl_Position = projectionMatrix * mvPosition;\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <fog_vertex>\n}\n',
10685    ce =
10686      'uniform vec3 diffuse;\nuniform float opacity;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include <common>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <uv2_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <envmap_pars_fragment>\n#include <fog_pars_fragment>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <specularmap_fragment>\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\t#ifdef USE_LIGHTMAP\n\t\treflectedLight.indirectDiffuse += texture2D( lightMap, vUv2 ).xyz * lightMapIntensity;\n\t#else\n\t\treflectedLight.indirectDiffuse += vec3( 1.0 );\n\t#endif\n\t#include <aomap_fragment>\n\treflectedLight.indirectDiffuse *= diffuseColor.rgb;\n\tvec3 outgoingLight = reflectedLight.indirectDiffuse;\n\t#include <normal_flip>\n\t#include <envmap_fragment>\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <premultiplied_alpha_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n}\n',
10687    de =
10688      '#include <common>\n#include <uv_pars_vertex>\n#include <uv2_pars_vertex>\n#include <envmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <uv2_vertex>\n\t#include <color_vertex>\n\t#include <skinbase_vertex>\n\t#ifdef USE_ENVMAP\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <worldpos_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <envmap_vertex>\n\t#include <fog_vertex>\n}\n',
10689    ee =
10690      'uniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float opacity;\nvarying vec3 vLightFront;\n#ifdef DOUBLE_SIDED\n\tvarying vec3 vLightBack;\n#endif\n#include <common>\n#include <packing>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <uv2_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <envmap_pars_fragment>\n#include <bsdfs>\n#include <lights_pars>\n#include <fog_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <shadowmask_pars_fragment>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <specularmap_fragment>\n\t#include <emissivemap_fragment>\n\treflectedLight.indirectDiffuse = getAmbientLightIrradiance( ambientLightColor );\n\t#include <lightmap_fragment>\n\treflectedLight.indirectDiffuse *= BRDF_Diffuse_Lambert( diffuseColor.rgb );\n\t#ifdef DOUBLE_SIDED\n\t\treflectedLight.directDiffuse = ( gl_FrontFacing ) ? vLightFront : vLightBack;\n\t#else\n\t\treflectedLight.directDiffuse = vLightFront;\n\t#endif\n\treflectedLight.directDiffuse *= BRDF_Diffuse_Lambert( diffuseColor.rgb ) * getShadowMask();\n\t#include <aomap_fragment>\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\n\t#include <normal_flip>\n\t#include <envmap_fragment>\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <premultiplied_alpha_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n}\n',
10691    fe =
10692      '#define LAMBERT\nvarying vec3 vLightFront;\n#ifdef DOUBLE_SIDED\n\tvarying vec3 vLightBack;\n#endif\n#include <common>\n#include <uv_pars_vertex>\n#include <uv2_pars_vertex>\n#include <envmap_pars_vertex>\n#include <bsdfs>\n#include <lights_pars>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <uv2_vertex>\n\t#include <color_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <worldpos_vertex>\n\t#include <envmap_vertex>\n\t#include <lights_lambert_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n}\n',
10693    ge =
10694      '#define PHONG\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform vec3 specular;\nuniform float shininess;\nuniform float opacity;\n#include <common>\n#include <packing>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <uv2_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <envmap_pars_fragment>\n#include <gradientmap_pars_fragment>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <lights_pars>\n#include <lights_phong_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <specularmap_fragment>\n\t#include <normal_flip>\n\t#include <normal_fragment>\n\t#include <emissivemap_fragment>\n\t#include <lights_phong_fragment>\n\t#include <lights_template>\n\t#include <aomap_fragment>\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;\n\t#include <envmap_fragment>\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <premultiplied_alpha_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n}\n',
10695    he =
10696      '#define PHONG\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include <common>\n#include <uv_pars_vertex>\n#include <uv2_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <envmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <uv2_vertex>\n\t#include <color_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n#ifndef FLAT_SHADED\n\tvNormal = normalize( transformedNormal );\n#endif\n\t#include <begin_vertex>\n\t#include <displacementmap_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\tvViewPosition = - mvPosition.xyz;\n\t#include <worldpos_vertex>\n\t#include <envmap_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n}\n',
10697    ie =
10698      '#define PHYSICAL\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float roughness;\nuniform float metalness;\nuniform float opacity;\n#ifndef STANDARD\n\tuniform float clearCoat;\n\tuniform float clearCoatRoughness;\n#endif\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include <common>\n#include <packing>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <uv2_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <envmap_pars_fragment>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <cube_uv_reflection_fragment>\n#include <lights_pars>\n#include <lights_physical_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <roughnessmap_pars_fragment>\n#include <metalnessmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <specularmap_fragment>\n\t#include <roughnessmap_fragment>\n\t#include <metalnessmap_fragment>\n\t#include <normal_flip>\n\t#include <normal_fragment>\n\t#include <emissivemap_fragment>\n\t#include <lights_physical_fragment>\n\t#include <lights_template>\n\t#include <aomap_fragment>\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <premultiplied_alpha_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n}\n',
10699    je =
10700      '#define PHYSICAL\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include <common>\n#include <uv_pars_vertex>\n#include <uv2_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <uv2_vertex>\n\t#include <color_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n#ifndef FLAT_SHADED\n\tvNormal = normalize( transformedNormal );\n#endif\n\t#include <begin_vertex>\n\t#include <displacementmap_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\tvViewPosition = - mvPosition.xyz;\n\t#include <worldpos_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n}\n',
10701    ke =
10702      '#define NORMAL\nuniform float opacity;\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP )\n\tvarying vec3 vViewPosition;\n#endif\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include <packing>\n#include <uv_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\nvoid main() {\n\t#include <logdepthbuf_fragment>\n\t#include <normal_flip>\n\t#include <normal_fragment>\n\tgl_FragColor = vec4( packNormalToRGB( normal ), opacity );\n}\n',
10703    le =
10704      '#define NORMAL\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP )\n\tvarying vec3 vViewPosition;\n#endif\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n#ifndef FLAT_SHADED\n\tvNormal = normalize( transformedNormal );\n#endif\n\t#include <begin_vertex>\n\t#include <displacementmap_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP )\n\tvViewPosition = - mvPosition.xyz;\n#endif\n}\n',
10705    me =
10706      'uniform vec3 diffuse;\nuniform float opacity;\n#include <common>\n#include <packing>\n#include <color_pars_fragment>\n#include <map_particle_pars_fragment>\n#include <fog_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <logdepthbuf_fragment>\n\t#include <map_particle_fragment>\n\t#include <color_fragment>\n\t#include <alphatest_fragment>\n\toutgoingLight = diffuseColor.rgb;\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <premultiplied_alpha_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n}\n',
10707    ne =
10708      'uniform float size;\nuniform float scale;\n#include <common>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <shadow
10708map_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <color_vertex>\n\t#include <begin_vertex>\n\t#include <project_vertex>\n\t#ifdef USE_SIZEATTENUATION\n\t\tgl_PointSize = size * ( scale / - mvPosition.z );\n\t#else\n\t\tgl_PointSize = size;\n\t#endif\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <worldpos_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n}\n',
10709    oe =
10710      'uniform float opacity;\n#include <common>\n#include <packing>\n#include <bsdfs>\n#include <lights_pars>\n#include <shadowmap_pars_fragment>\n#include <shadowmask_pars_fragment>\nvoid main() {\n\tgl_FragColor = vec4( 0.0, 0.0, 0.0, opacity * ( 1.0 - getShadowMask() ) );\n}\n',
10711    pe =
10712      '#include <shadowmap_pars_vertex>\nvoid main() {\n\t#include <begin_vertex>\n\t#include <project_vertex>\n\t#include <worldpos_vertex>\n\t#include <shadowmap_vertex>\n}\n',
10713    qe = {
10714      alphamap_fragment: qc,
10715      alphamap_pars_fragment: rc,
10716      alphatest_fragment: sc,
10717      aomap_fragment: tc,
10718      aomap_pars_fragment: uc,
10719      begin_vertex: vc,
10720      beginnormal_vertex: wc,
10721      bsdfs: xc,
10722      bumpmap_pars_fragment: yc,
10723      clipping_planes_fragment: zc,
10724      clipping_planes_pars_fragment: Ac,
10725      clipping_planes_pars_vertex: Bc,
10726      clipping_planes_vertex: Cc,
10727      color_fragment: Dc,
10728      color_pars_fragment: Ec,
10729      color_pars_vertex: Fc,
10730      color_vertex: Gc,
10731      common: Hc,
10732      cube_uv_reflection_fragment: Ic,
10733      defaultnormal_vertex: Jc,
10734      displacementmap_pars_vertex: Kc,
10735      displacementmap_vertex: Lc,
10736      emissivemap_fragment: Mc,
10737      emissivemap_pars_fragment: Nc,
10738      encodings_fragment: Oc,
10739      encodings_pars_fragment: Pc,
10740      envmap_fragment: Qc,
10741      envmap_pars_fragment: Rc,
10742      envmap_pars_vertex: Sc,
10743      envmap_vertex: Tc,
10744      fog_vertex: Uc,
10745      fog_pars_vertex: Vc,
10746      fog_fragment: Wc,
10747      fog_pars_fragment: Xc,
10748      gradientmap_pars_fragment: Yc,
10749      lightmap_fragment: Zc,
10750      lightmap_pars_fragment: $c,
10751      lights_lambert_vertex: _c,
10752      lights_pars: ad,
10753      lights_phong_fragment: bd,
10754      lights_phong_pars_fragment: cd,
10755      lights_physical_fragment: dd,
10756      lights_physical_pars_fragment: ed,
10757      lights_template: fd,
10758      logdepthbuf_fragment: gd,
10759      logdepthbuf_pars_fragment: hd,
10760      logdepthbuf_pars_vertex: id,
10761      logdepthbuf_vertex: jd,
10762      map_fragment: kd,
10763      map_pars_fragment: ld,
10764      map_particle_fragment: md,
10765      map_particle_pars_fragment: nd,
10766      metalnessmap_fragment: od,
10767      metalnessmap_pars_fragment: pd,
10768      morphnormal_vertex: qd,
10769      morphtarget_pars_vertex: rd,
10770      morphtarget_vertex: sd,
10771      normal_flip: td,
10772      normal_fragment: ud,
10773      normalmap_pars_fragment: vd,
10774      packing: wd,
10775      premultiplied_alpha_fragment: xd,
10776      project_vertex: yd,
10777      roughnessmap_fragment: zd,
10778      roughnessmap_pars_fragment: Ad,
10779      shadowmap_pars_fragment: Bd,
10780      shadowmap_pars_vertex: Cd,
10781      shadowmap_vertex: Dd,
10782      shadowmask_pars_fragment: Ed,
10783      skinbase_vertex: Fd,
10784      skinning_pars_vertex: Gd,
10785      skinning_vertex: Hd,
10786      skinnormal_vertex: Id,
10787      specularmap_fragment: Jd,
10788      specularmap_pars_fragment: Kd,
10789      tonemapping_fragment: Ld,
10790      tonemapping_pars_fragment: Md,
10791      uv_pars_fragment: Nd,
10792      uv_pars_vertex: Od,
10793      uv_vertex: Pd,
10794      uv2_pars_fragment: Qd,
10795      uv2_pars_vertex: Rd,
10796      uv2_vertex: Sd,
10797      worldpos_vertex: Td,
10798      cube_frag: Ud,
10799      cube_vert: Vd,
10800      depth_frag: Wd,
10801      depth_vert: Xd,
10802      distanceRGBA_frag: Yd,
10803      distanceRGBA_vert: Zd,
10804      equirect_frag: $d,
10805      equirect_vert: _d,
10806      linedashed_frag: ae,
10807      linedashed_vert: be,
10808      meshbasic_frag: ce,
10809      meshbasic_vert: de,
10810      meshlambert_frag: ee,
10811      meshlambert_vert: fe,
10812      meshphong_frag: ge,
10813      meshphong_vert: he,
10814      meshphysical_frag: ie,
10815      meshphysical_vert: je,
10816      normal_frag: ke,
10817      normal_vert: le,
10818      points_frag: me,
10819      points_vert: ne,
10820      shadow_frag: oe,
10821      shadow_vert: pe
10822    }
10823  re.prototype = {
10824    constructor: re,
10825    isColor: !0,
10826    r: 1,
10827    g: 1,
10828    b: 1,
10829    set: function (a) {
10830      return (
10831        a && a.isColor
10832          ? this.copy(a)
10833          : 'number' == typeof a
10834          ? this.setHex(a)
10835          : 'string' == typeof a && this.setStyle(a),
10836        this
10837      )
10838    },
10839    setScalar: function (a) {
10840      return (this.r = a), (this.g = a), (this.b = a), this
10841    },
10842    setHex: function (a) {
10843      return (
10844        (a = Math.floor(a)),
10845        (this.r = ((a >> 16) & 255) / 255),
10846        (this.g = ((a >> 8) & 255) / 255),
10847        (this.b = (255 & a) / 255),
10848        this
10849      )
10850    },
10851    setRGB: function (a, b, c) {
10852      return (this.r = a), (this.g = b), (this.b = c), this
10853    },
10854    setHSL: (function () {
10855      function a(a, b, c) {
10856        return (
10857          c < 0 && (c += 1),
10858          c > 1 && (c -= 1),
10859          c < 1 / 6
10860            ? a + 6 * (b - a) * c
10861            : c < 0.5
10862            ? b
10863            : c < 2 / 3
10864            ? a + 6 * (b - a) * (2 / 3 - c)
10865            : a
10866        )
10867      }
10868      return function (c, d, e) {
10869        if (
10870          ((c = tb.euclideanModulo(c, 1)),
10871          (d = tb.clamp(d, 0, 1)),
10872          (e = tb.clamp(e, 0, 1)),
10873          0 === d)
10874        )
10875          this.r = this.g = this.b = e
10876        else {
10877          var f = e <= 0.5 ? e * (1 + d) : e + d - e * d,
10878            g = 2 * e - f
10879          ;(this.r = a(g, f, c + 1 / 3)),
10880            (this.g = a(g, f, c)),
10881            (this.b = a(g, f, c - 1 / 3))
10882        }
10883        return this
10884      }
10885    })(),
10886    setStyle: function (a) {
10887      function b(b) {
10888        void 0 !== b &&
10889          parseFloat(b) < 1 &&
10890          console.warn(
10891            'THREE.Color: Alpha component of ' + a + ' will be ignored.'
10892          )
10893      }
10894      var c
10895      if ((c = /^((?:rgb|hsl)a?)\(\s*([^\)]*)\)/.exec(a))) {
10896        var d,
10897          e = c[1],
10898          f = c[2]
10899        switch (e) {
10900          case 'rgb':
10901          case 'rgba':
10902            if (
10903              (d =
10904                /^(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(
10905                  f
10906                ))
10907            )
10908              return (
10909                (this.r = Math.min(255, parseInt(d[1], 10)) / 255),
10910                (this.g = Math.min(255, parseInt(d[2], 10)) / 255),
10911                (this.b = Math.min(255, parseInt(d[3], 10)) / 255),
10912                b(d[5]),
10913                this
10914              )
10915            if (
10916              (d =
10917                /^(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(
10918                  f
10919                ))
10920            )
10921              return (
10922                (this.r = Math.min(100, parseInt(d[1], 10)) / 100),
10923                (this.g = Math.min(100, parseInt(d[2], 10)) / 100),
10924                (this.b = Math.min(100, parseInt(d[3], 10)) / 100),
10925                b(d[5]),
10926                this
10927              )
10928            break
10929          case 'hsl':
10930          case 'hsla':
10931            if (
10932              (d =
10933                /^([0-9]*\.?[0-9]+)\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(
10934                  f
10935                ))
10936            ) {
10937              var g = parseFloat(d[1]) / 360,
10938                h = parseInt(d[2], 10) / 100,
10939                i = parseInt(d[3], 10) / 100
10940              return b(d[5]), this.setHSL(g, h, i)
10941            }
10942        }
10943      } else if ((c = /^\#([A-Fa-f0-9]+)$/.exec(a))) {
10944        var j = c[1],
10945          k = j.length
10946        if (3 === k)
10947          return (
10948            (this.r = parseInt(j.charAt(0) + j.charAt(0), 16) / 25
109485),
10949            (this.g = parseInt(j.charAt(1) + j.charAt(1), 16) / 255),
10950            (this.b = parseInt(j.charAt(2) + j.charAt(2), 16) / 255),
10951            this
10952          )
10953        if (6 === k)
10954          return (
10955            (this.r = parseInt(j.charAt(0) + j.charAt(1), 16) / 255),
10956            (this.g = parseInt(j.charAt(2) + j.charAt(3), 16) / 255),
10957            (this.b = parseInt(j.charAt(4) + j.charAt(5), 16) / 255),
10958            this
10959          )
10960      }
10961      if (a && a.length > 0) {
10962        var j = se[a]
10963        void 0 !== j
10964          ? this.setHex(j)
10965          : console.warn('THREE.Color: Unknown color ' + a)
10966      }
10967      return this
10968    },
10969    clone: function () {
10970      return new this.constructor(this.r, this.g, this.b)
10971    },
10972    copy: function (a) {
10973      return (this.r = a.r), (this.g = a.g), (this.b = a.b), this
10974    },
10975    copyGammaToLinear: function (a, b) {
10976      return (
10977        void 0 === b && (b = 2),
10978        (this.r = Math.pow(a.r, b)),
10979        (this.g = Math.pow(a.g, b)),
10980        (this.b = Math.pow(a.b, b)),
10981        this
10982      )
10983    },
10984    copyLinearToGamma: function (a, b) {
10985      void 0 === b && (b = 2)
10986      var c = b > 0 ? 1 / b : 1
10987      return (
10988        (this.r = Math.pow(a.r, c)),
10989        (this.g = Math.pow(a.g, c)),
10990        (this.b = Math.pow(a.b, c)),
10991        this
10992      )
10993    },
10994    convertGammaToLinear: function () {
10995      var a = this.r,
10996        b = this.g,
10997        c = this.b
10998      return (this.r = a * a), (this.g = b * b), (this.b = c * c), this
10999    },
11000    convertLinearToGamma: function () {
11001      return (
11002        (this.r = Math.sqrt(this.r)),
11003        (this.g = Math.sqrt(this.g)),
11004        (this.b = Math.sqrt(this.b)),
11005        this
11006      )
11007    },
11008    getHex: function () {
11009      return (
11010        ((255 * this.r) << 16) ^ ((255 * this.g) << 8) ^ ((255 * this.b) << 0)
11011      )
11012    },
11013    getHexString: function () {
11014      return ('000000' + this.getHex().toString(16)).slice(-6)
11015    },
11016    getHSL: function (a) {
11017      var h,
11018        i,
11019        b = a || { h: 0, s: 0, l: 0 },
11020        c = this.r,
11021        d = this.g,
11022        e = this.b,
11023        f = Math.max(c, d, e),
11024        g = Math.min(c, d, e),
11025        j = (g + f) / 2
11026      if (g === f) (h = 0), (i = 0)
11027      else {
11028        var k = f - g
11029        switch (((i = j <= 0.5 ? k / (f + g) : k / (2 - f - g)), f)) {
11030          case c:
11031            h = (d - e) / k + (d < e ? 6 : 0)
11032            break
11033          case d:
11034            h = (e - c) / k + 2
11035            break
11036          case e:
11037            h = (c - d) / k + 4
11038        }
11039        h /= 6
11040      }
11041      return (b.h = h), (b.s = i), (b.l = j), b
11042    },
11043    getStyle: function () {
11044      return (
11045        'rgb(' +
11046        ((255 * this.r) | 0) +
11047        ',' +
11048        ((255 * this.g) | 0) +
11049        ',' +
11050        ((255 * this.b) | 0) +
11051        ')'
11052      )
11053    },
11054    offsetHSL: function (a, b, c) {
11055      var d = this.getHSL()
11056      return (
11057        (d.h += a), (d.s += b), (d.l += c), this.setHSL(d.h, d.s, d.l), this
11058      )
11059    },
11060    add: function (a) {
11061      return (this.r += a.r), (this.g += a.g), (this.b += a.b), this
11062    },
11063    addColors: function (a, b) {
11064      return (
11065        (this.r = a.r + b.r), (this.g = a.g + b.g), (this.b = a.b + b.b), this
11066      )
11067    },
11068    addScalar: function (a) {
11069      return (this.r += a), (this.g += a), (this.b += a), this
11070    },
11071    sub: function (a) {
11072      return (
11073        (this.r = Math.max(0, this.r - a.r)),
11074        (this.g = Math.max(0, this.g - a.g)),
11075        (this.b = Math.max(0, this.b - a.b)),
11076        this
11077      )
11078    },
11079    multiply: function (a) {
11080      return (this.r *= a.r), (this.g *= a.g), (this.b *= a.b), this
11081    },
11082    multiplyScalar: function (a) {
11083      return (this.r *= a), (this.g *= a), (this.b *= a), this
11084    },
11085    lerp: function (a, b) {
11086      return (
11087        (this.r += (a.r - this.r) * b),
11088        (this.g += (a.g - this.g) * b),
11089        (this.b += (a.b - this.b) * b),
11090        this
11091      )
11092    },
11093    equals: function (a) {
11094      return a.r === this.r && a.g === this.g && a.b === this.b
11095    },
11096    fromArray: function (a, b) {
11097      return (
11098        void 0 === b && (b = 0),
11099        (this.r = a[b]),
11100        (this.g = a[b + 1]),
11101        (this.b = a[b + 2]),
11102        this
11103      )
11104    },
11105    toArray: function (a, b) {
11106      return (
11107        void 0 === a && (a = []),
11108        void 0 === b && (b = 0),
11109        (a[b] = this.r),
11110        (a[b + 1] = this.g),
11111        (a[b + 2] = this.b),
11112        a
11113      )
11114    },
11115    toJSON: function () {
11116      return this.getHex()
11117    }
11118  }
11119  var se = {
11120    aliceblue: 15792383,
11121    antiquewhite: 16444375,
11122    aqua: 65535,
11123    aquamarine: 8388564,
11124    azure: 15794175,
11125    beige: 16119260,
11126    bisque: 16770244,
11127    black: 0,
11128    blanchedalmond: 16772045,
11129    blue: 255,
11130    blueviolet: 9055202,
11131    brown: 10824234,
11132    burlywood: 14596231,
11133    cadetblue: 6266528,
11134    chartreuse: 8388352,
11135    chocolate: 13789470,
11136    coral: 16744272,
11137    cornflowerblue: 6591981,
11138    cornsilk: 16775388,
11139    crimson: 14423100,
11140    cyan: 65535,
11141    darkblue: 139,
11142    darkcyan: 35723,
11143    darkgoldenrod: 12092939,
11144    darkgray: 11119017,
11145    darkgreen: 25600,
11146    darkgrey: 11119017,
11147    darkkhaki: 12433259,
11148    darkmagenta: 9109643,
11149    darkolivegreen: 5597999,
11150    darkorange: 16747520,
11151    darkorchid: 10040012,
11152    darkred: 9109504,
11153    darksalmon: 15308410,
11154    darkseagreen: 9419919,
11155    darkslateblue: 4734347,
11156    darkslategray: 3100495,
11157    darkslategrey: 3100495,
11158    darkturquoise: 52945,
11159    darkviolet: 9699539,
11160    deeppink: 16716947,
11161    deepskyblue: 49151,
11162    dimgray: 6908265,
11163    dimgrey: 6908265,
11164    dodgerblue: 2003199,
11165    firebrick: 11674146,
11166    floralwhite: 16775920,
11167    forestgreen: 2263842,
11168    fuchsia: 16711935,
11169    gainsboro: 14474460,
11170    ghostwhite: 16316671,
11171    gold: 16766720,
11172    goldenrod: 14329120,
11173    gray: 8421504,
11174    green: 32768,
11175    greenyellow: 11403055,
11176    grey: 8421504,
11177    honeydew: 15794160,
11178    hotpink: 16738740,
11179    indianred: 13458524,
11180    indigo: 4915330,
11181    ivory: 16777200,
11182    khaki: 15787660,
11183    lavender: 15132410,
11184    lavenderblush: 16773365,
11185    lawngreen: 8190976,
11186    lemonchiffon: 16775885,
11187    lightblue: 11393254,
11188    lightcoral: 15761536,
11189    lightcyan: 14745599,
11190    lightgoldenrodyellow: 16448210,
11191    lightgray: 13882323,
11192    lightgreen: 9498256,
11193    lightgrey: 13882323,
11194    lightpink: 16758465,
11195    lightsalmon: 16752762,
11196    lightseagreen: 2142890,
11197    lightskyblue: 8900346,
11198    lightslategray: 7833753,
11199    lightslategrey: 7833753,
11200    lightsteelblue: 11584734,
11201    lightyellow: 16777184,
11202    lime: 65280,
11203    limegreen: 3329330,
11204    linen: 16445670,
11205    magenta: 16711935,
11206    maroon: 8388608,
11207    mediumaquamarine: 6737322,
11208    mediumblue: 205,
11209    mediumorchid: 12211667,
11210    mediumpurple: 9662683,
11211    mediumseagreen: 3978097,
11212    mediumslateblue: 8087790,
11213    mediumspringgreen: 64154,
11214    mediumturquoise: 4772300,
11215    mediumvioletred: 13047173,
11216    midnightblue: 1644912,
11217    mintcream: 16121850,
11218    mistyrose: 16770273,
11219    moccasin: 16770229,
11220    navajowhite: 16768685,
11221    navy: 128,
11222    oldlace: 16643558,
11223    olive: 8421376,
11224    olivedrab: 7048739,
11225    orange: 16753920,
11226    orangered: 16729344,
11227    orchid: 14315734,
11228    palegoldenrod: 15657130,
11229    palegreen: 10025880,
11230    paleturquoise: 11529966,
11231    palevioletred: 14381203,
11232    papayawhip: 16773077,
11233    peachpuff: 16767673,
11234    peru: 13468991,
11235    pink: 16761035,
11236    plum: 14524637,
11237    powderblue: 11591910,
11238    purple: 8388736,
11239    red: 16711680,
11240    rosybrown: 12357519,
11241    royalblue: 4286945,
11242    saddlebrown: 9127187,
11243    salmon: 16416882,
11244    sandybrown: 16032864,
11245    seagreen: 3050327,
11246    seashell: 16774638,
11247    sienna: 10506797,
11248    silver: 12632256,
11249    skyblue: 8900331,
11250    slateblue: 6970061,
11251    slategray: 7372944,
11252    slategrey: 7372944,
11253    snow: 16775930,
11254    springgreen: 65407,
11255    steelblue: 4620980,
11256    tan: 13808780,
11257    teal: 32896,
11258    thistle: 14204888,
11259    tomato: 16737095,
11260    turquoise: 4251856,
11261    violet: 15631086,
11262    wheat: 16113331,
11263    white: 16777215,
11264    whitesmoke: 16119285,
11265    yellow: 16776960,
11266    yellowgreen: 10145074
11267  }
11268  ;(te.prototype = Object.create(wb.prototype)),
11269    (te.prototype.constructor = te),
11270    (te.prototype.isDataTexture = !0)
11271  var ue = {
11272      common: {
11273        diffuse: { value: new re(15658734) },
11274        opacity: { value: 1 },
11275        map: { value: null },
11276        offsetRepeat: { value: new xb(0, 0, 1, 1) },
11277        specularMap: { value: null },
11278        alphaMap: { value: null },
11279        envMap: { value: null },
11280        flipEnvMap: { value: -1 },
11281        reflectivity: { value: 1 },
11282        refractionRatio: { value: 0.98 }
11283      },
11284      aomap: { aoMap: { value: null }, aoMapIntensity: { value: 1 } },
11285      lightmap: { lightMap: { value: null }, lightMapIntensity: { value: 1 } },
11286      emissivemap: { emissiveMap: { value: null } },
11287      bumpmap: { bumpMap: { value: null }, bumpScale: { value: 1 } },
11288      normalmap: {
11289        normalMap: { value: null },
11290        normalScale: { value: new ub(1, 1) }
11291      },
11292      displacementmap: {
11293        displacementMap: { value: null },
11294        displacementScale: { value: 1 },
11295        displacementBias: { value: 0 }
11296      },
11297      roughnessmap: { roughnessMap: { value: null } },
11298      metalnessmap: { metalnessMap: { value: null } },
11299      gradientmap: { gradientMap: { value: null } },
11300      fog: {
11301        fogDensity: { value: 25e-5 },
11302        fogNear: { value: 1 },
11303        fogFar: { value: 2e3 },
11304        fogColor: { value: new re(16777215) }
11305      },
11306      lights: {
11307        ambientLightColor: { value: [] },
11308        directionalLights: {
11309          value: [],
11310          properties: {
11311            direction: {},
11312            color: {},
11313            shadow: {},
11314            shadowBias: {},
11315            shadowRadius: {},
11316            shadowMapSize: {}
11317          }
11318        },
11319        directionalShadowMap: { value: [] },
11320        directionalShadowMatrix: { value: [] },
11321        spotLights: {
11322          value: [],
11323          properties: {
11324            color: {},
11325            position: {},
11326            direction: {},
11327            distance: {},
11328            coneCos: {},
11329            penumbraCos: {},
11330            decay: {},
11331            shadow: {},
11332            shadowBias: {},
11333            shadowRadius: {},
11334            shadowMapSize: {}
11335          }
11336        },
11337        spotShadowMap: { value: [] },
11338        spotShadowMatrix: { value: [] },
11339        pointLights: {
11340          value: [],
11341          properties: {
11342            color: {},
11343            position: {},
11344            decay: {},
11345            distance: {},
11346            shadow: {},
11347            shadowBias: {},
11348            shadowRadius: {},
11349            shadowMapSize: {}
11350          }
11351        },
11352        pointShadowMap: { value: [] },
11353        pointShadowMatrix: { value: [] },
11354        hemisphereLights: {
11355          value: [],
11356          properties: { direction: {}, skyColor: {}, groundColor: {} }
11357        },
11358        rectAreaLights: {
11359          value: [],
11360          properties: { color: {}, position: {}, width: {}, height: {} }
11361        }
11362      },
11363      points: {
11364        diffuse: { value: new re(15658734) },
11365        opacity: { value: 1 },
11366        size: { value: 1 },
11367        scale: { value: 1 },
11368        map: { value: null },
11369        offsetRepeat: { value: new xb(0, 0, 1, 1) }
11370      }
11371    },
11372    ve = {
11373      basic: {
11374        uniforms: pc.merge([ue.common, ue.aomap, ue.lightmap, ue.fog]),
11375        vertexShader: qe.meshbasic_vert,
11376        fragmentShader: qe.meshbasic_frag
11377      },
11378      lambert: {
11379        uniforms: pc.merge([
11380          ue.common,
11381          ue.aomap,
11382          ue.lightmap,
11383          ue.emissivemap,
11384          ue.fog,
11385          ue.lights,
11386          { emissive: { value: new re(0) } }
11387        ]),
11388        vertexShader: qe.meshlambert_vert,
11389        fragmentShader: qe.meshlambert_frag
11390      },
11391      phong: {
11392        uniforms: pc.merge([
11393          ue.common,
11394          ue.aomap,
11395          ue.lightmap,
11396          ue.emissivemap,
11397          ue.bumpmap,
11398          ue.normalmap,
11399          ue.displacementmap,
11400          ue.gradientmap,
11401          ue.fog,
11402          ue.lights,
11403          {
11404            emissive: { value: new re(0) },
11405            specular: { value: new re(1118481) },
11406            shininess: { value: 30 }
11407          }
11408        ]),
11409        vertexShader: qe.meshphong_vert,
11410        fragmentShader: qe.meshphong_frag
11411      },
11412      standard: {
11413        uniforms: pc.merge([
11414          ue.common,
11415          ue.aomap,
11416          ue.lightmap,
11417          ue.emissivemap,
11418          ue.bumpmap,
11419          ue.normalmap,
11420          ue.displacementmap,
11421          ue.roughnessmap,
11422          ue.metalnessmap,
11423          ue.fog,
11424          ue.lights,
11425          {
11426            emissive: { value: new re(0) },
11427            roughness: { value: 0.5 },
11428            metalness: { value: 0 },
11429            envMapIntensity: { value: 1 }
11430          }
11431        ]),
11432        vertexShader: qe.meshphysical_vert,
11433        fragmentShader: qe.meshphysical_frag
11434      },
11435      points: {
11436        uniforms: pc.merge([ue.points, ue.fog]),
11437        vertexShader: qe.points_vert,
11438        fragmentShader: qe.points_frag
11439      },
11440      dashed: {
11441        uniforms: pc.merge([
11442          ue.common,
11443          ue.fog,
11444          {
11445            scale: { value: 1 },
11446            dashSize: { value: 1 },
11447            totalSize: { value: 2 }
11448          }
11449        ]),
11450        vertexShader: qe.linedashed_vert,
11451        fragmentShader: qe.linedashed_frag
11452      },
11453      depth: {
11454        uniforms: pc.merge([ue.common, ue.displacementmap]),
11455        vertexShader: qe.depth_vert,
11456        fragmentShader: qe.depth_frag
11457      },
11458      normal: {
11459        uniforms: pc.merge([
11460          ue.common,
11461          ue.bumpmap,
11462          ue.normalmap,
11463          ue.displacementmap,
11464          { opacity: { value: 1 } }
11465        ]),
11466        vertexShader: qe.normal_vert,
11467        fragmentShader: qe.normal_frag
11468      },
11469      cube: {
11470        uniforms: {
11471          tCube: { value: null },
11472          tFlip: { value: -1 },
11473          opacity: { value: 1 }
11474        },
11475        vertexShader: qe.cube_vert,
11476        fragmentShader: qe.cube_frag
11477      },
11478      equirect: {
11479        uniforms: { tEquirect: { value: null }, tFlip: { value: -1 } },
11480        vertexShader: qe.equirect_vert,
11481        fragmentShader: qe.equirect_frag
11482      },
11483      distanceRGBA: {
11484        uniforms: { lightPos: { value: new Bb() } },
11485        vertexShader: qe.distanceRGBA_vert,
11486        fragmentShader: qe.distanceRGBA_frag
11487      }
11488    }
11489  ;(ve.physical = {
11490    uniforms: pc.merge([
11491      ve.standard.uniforms,
11492      { clearCoat: { value: 0 }, clearCoatRoughness: { value: 0 } }
11493    ]),
11494    vertexShader: qe.meshphysical_vert,
11495    fragmentShader: qe.meshphysical_frag
11496  }),
11497    (we.prototype = {
11498      constructor: we,
11499      set: function (a, b) {
11500        return this.min.copy(a), this.max.copy(b), this
11501      },
11502      setFromPoints: function (a) {
11503        this.makeEmpty()
11504        for (var b = 0, c = a.length; b < c; b++) this.expandByPoint(a[b])
11505        return this
11506      },
11507      setFromCenterAndSize: (function () {
11508        var a = new ub()
11509        return function (c, d) {
11510          var e = a.copy(d).multiplyScalar(0.5)
11511          return this.min.copy(c).sub(e), this.max.copy(c).add(e), this
11512        }
11513      })(),
11514      clone: function () {
11515        return new this.constructor().copy(this)
11516      },
11517      copy: function (a) {
11518        return this.min.copy(a.min), this.max.copy(a.max), this
11519      },
11520      makeEmpty: function () {
11521        return (
11522          (this.min.x = this.min.y = +(1 / 0)),
11523          (this.max.x = this.max.y = -(1 / 0)),
11524          this
11525        )
11526      },
11527      isEmpty: function () {
11528        return this.max.x < this.min.x || this.max.y < this.min.y
11529      },
11530      getCenter: function (a) {
11531        var b = a || new ub()
11532        return this.isEmpty()
11533          ? b.set(0, 0)
11534          : b.addVectors(this.min, this.max).multiplyScalar(0.5)
11535      },
11536      getSize: function (a) {
11537        var b = a || new ub()
11538        return this.isEmpty() ? b.set(0, 0) : b.subVectors(this.max, this.min)
11539      },
11540      expandByPoint: function (a) {
11541        return this.min.min(a), this.max.max(a), this
11542      },
11543      expandByVector: function (a) {
11544        return this.min.sub(a), this.max.add(a), this
11545      },
11546      expandByScalar: function (a) {
11547        return this.min.addScalar(-a), this.max.addScalar(a), this
11548      },
11549      containsPoint: function (a) {
11550        return !(
11551          a.x < this.min.x ||
11552          a.x > this.max.x ||
11553          a.y < this.min.y ||
11554          a.y > this.max.y
11555        )
11556      },
11557      containsBox: function (a) {
11558        return (
11559          this.min.x <= a.min.x &&
11560          a.max.x <= this.max.x &&
11561          this.min.y <= a.min.y &&
11562          a.max.y <= this.max.y
11563        )
11564      },
11565      getParameter: function (a, b) {
11566        var c = b || new ub()
11567        return c.set(
11568          (a.x - this.min.x) / (this.max.x - this.min.x),
11569          (a.y - this.min.y) / (this.max.y - this.min.y)
11570        )
11571      },
11572      intersectsBox: function (a) {
11573        return !(
11574          a.max.x < this.min.x ||
11575          a.min.x > this.max.x ||
11576          a.max.y < this.min.y ||
11577          a.min.y > this.max.y
11578        )
11579      },
11580      clampPoint: function (a, b) {
11581        var c = b || new ub()
11582        return c.copy(a).clamp(this.min, this.max)
11583      },
11584      distanceToPoint: (function () {
11585        var a = new ub()
11586        return function (c) {
11587          var d = a.copy(c).clamp(this.min, this.max)
11588          return d.sub(c).length()
11589        }
11590      })(),
11591      intersect: function (a) {
11592        return this.min.max(a.min), this.max.min(a.max), this
11593      },
11594      union: function (a) {
11595        return this.min.min(a.min), this.max.max(a.max), this
11596      },
11597      translate: function (a) {
11598        return this.min.add(a), this.max.add(a), this
11599      },
11600      equals: function (a) {
11601        return a.min.equals(this.min) && a.max.equals(this.max)
11602      }
11603    })
11604  var ze = 0
11605  ;(Ae.prototype = {
11606    constructor: Ae,
11607    isMaterial: !0,
11608    get needsUpdate() {
11609      return this._needsUpdate
11610    },
11611    set needsUpdate(a) {
11612      a === !0 && this.update(), (this._needsUpdate = a)
11613    },
11614    setValues: function (a) {
11615      if (void 0 !== a)
11616        for (var b in a) {
11617          var c = a[b]
11618          if (void 0 !== c) {
11619            var d = this[b]
11620            void 0 !== d
11621              ? d && d.isColor
11622                ? d.set(c)
11623                : d && d.isVector3 && c && c.isVector3
11624                ? d.copy(c)
11625                : 'overdraw' === b
11626                ? (this[b] = Number(c))
11627                : (this[b] = c)
11628              : console.warn(
11629                  'THREE.' +
11630                    this.type +
11631                    ": '" +
11632                    b +
11633                    "' is not a property of this material."
11634                )
11635          } else
11636            console.warn("THREE.Material: '" + b + "' parameter is undefined.")
11637        }
11638    },
11639    toJSON: function (a) {
11640      function d(a) {
11641        var b = []
11642        for (var c in a) {
11643          var d = a[c]
11644          delete d.metadata, b.push(d)
11645        }
11646        return b
11647      }
11648      var b = void 0 === a
11649      b && (a = { textures: {}, images: {} })
11650      var c = {
11651        metadata: {
11652          version: 4.4,
11653          type: 'Material',
11654          generator: 'Material.toJSON'
11655        }
11656      }
11657      if (
11658        ((c.uuid = this.uuid),
11659        (c.type = this.type),
11660        '' !== this.name && (c.name = this.name),
11661        this.color && this.color.isColor && (c.color = this.color.getHex()),
11662        void 0 !== this.roughness && (c.roughness = this.roughness),
11663        void 0 !== this.metalness && (c.metalness = this.metalness),
11664        this.emissive &&
11665          this.emissive.isColor &&
11666          (c.emissive = this.emissive.getHex()),
11667        this.specular &&
11668          this.specular.isColor &&
11669          (c.specular = this.specular.getHex()),
11670        void 0 !== this.shininess && (c.shininess = this.shininess),
11671        void 0 !== this.clearCoat && (c.clearCoat = this.clearCoat),
11672        void 0 !== this.clearCoatRoughness &&
11673          (c.clearCoatRoughness = this.clearCoatRoughness),
11674        this.map && this.map.isTexture && (c.map = this.map.toJSON(a).uuid),
11675        this.alphaMap &&
11676          this.alphaMap.isTexture &&
11677          (c.alphaMap = this.alphaMap.toJSON(a).uuid),
11678        this.lightMap &&
11679          this.lightMap.isTexture &&
11680          (c.lightMap = this.lightMap.toJSON(a).uuid),
11681        this.bumpMap &&
11682          this.bumpMap.isTexture &&
11683          ((c.bumpMap = this.bumpMap.toJSON(a).uuid),
11684          (c.bumpScale = this.bumpScale)),
11685        this.normalMap &&
11686          this.normalMap.isTexture &&
11687          ((c.normalMap = this.normalMap.toJSON(a).uuid),
11688          (c.normalScale = this.normalScale.toArray())),
11689        this.displacementMap &&
11690          this.displacementMap.isTexture &&
11691          ((c.displacementMap = this.displacementMap.toJSON(a).uuid),
11692          (c.displacementScale = this.displacementScale),
11693          (c.displacementBias = this.displacementBias)),
11694        this.roughnessMap &&
11695          this.roughnessMap.isTexture &&
11696          (c.roughnessMap = this.roughnessMap.toJSON(a).uuid),
11697        this.metalnessMap &&
11698          this.metalnessMap.isTexture &&
11699          (c.metalnessMap = this.metalnessMap.toJSON(a).uuid),
11700        this.emissiveMap &&
11701          this.emissiveMap.isTexture &&
11702          (c.emissiveMap = this.emissiveMap.toJSON(a).uuid),
11703        this.specularMap &&
11704          this.specularMap.isTexture &&
11705          (c.specularMap = this.specularMap.toJSON(a).uuid),
11706        this.envMap &&
11707          this.envMap.isTexture &&
11708          ((c.envMap = this.envMap.toJSON(a).uuid),
11709          (c.reflectivity = this.reflectivity)),
11710        this.gradientMap &&
11711          this.gradientMap.isTexture &&
11712          (c.gradientMap = this.gradientMap.toJSON(a).uuid),
11713        void 0 !== this.size && (c.size = this.size),
11714        void 0 !== this.sizeAttenuation &&
11715          (c.sizeAttenuation = this.sizeAttenuation),
11716        this.blending !== w && (c.blending = this.blending),
11717        this.shading !== r && (c.shading = this.shading),
11718        this.side !== n && (c.side = this.side),
11719        this.vertexColors !== s && (c.vertexColors = this.vertexColors),
11720        this.opacity < 1 && (c.opacity = this.opacity),
11721        this.transparent === !0 && (c.transparent = this.transparent),
11722        (c.depthFunc = this.depthFunc),
11723        (c.depthTest = this.depthTest),
11724        (c.depthWrite = this.depthWrite),
11725        this.alphaTest > 0 && (c.alphaTest = this.alphaTest),
11726        this.premultipliedAlpha === !0 &&
11727          (c.premultipliedAlpha = this.premultipliedAlpha),
11728        this.wireframe === !0 && (c.wireframe = this.wireframe),
11729        this.wireframeLinewidth > 1 &&
11730          (c.wireframeLinewidth = this.wireframeLinewidth),
11731        'round' !== this.wireframeLinecap &&
11732          (c.wireframeLinecap = this.wireframeLinecap),
11733        'round' !== this.wireframeLinejoin &&
11734          (c.wireframeLinejoin = this.wireframeLinejoin),
11735        (c.skinning = this.skinning),
11736        (c.morphTargets = this.morphTargets),
11737        b)
11738      ) {
11739        var e = d(a.textures),
11740          f = d(a.images)
11741        e.length > 0 && (c.textures = e), f.length > 0 && (c.images = f)
11742      }
11743      return c
11744    },
11745    clone: function () {
11746      return new this.constructor().copy(this)
11747    },
11748    copy: function (a) {
11749      ;(this.name = a.name),
11750        (this.fog = a.fog),
11751        (this.lights = a.lights),
11752        (this.blending = a.blending),
11753        (this.side = a.side),
11754        (this.shading = a.shading),
11755        (this.vertexColors = a.vertexColors),
11756        (this.opacity = a.opacity),
11757        (this.transparent = a.transparent),
11758        (this.blendSrc = a.blendSrc),
11759        (this.blendDst = a.blendDst),
11760        (this.blendEquation = a.blendEquation),
11761        (this.blendSrcAlpha = a.blendSrcAlpha),
11762        (this.blendDstAlpha = a.blendDstAlpha),
11763        (this.blendEquationAlpha = a.blendEquationAlpha),
11764        (this.depthFunc = a.depthFunc),
11765        (this.depthTest = a.depthTest),
11766        (this.depthWrite = a.depthWrite),
11767        (this.colorWrite = a.colorWrite),
11768        (this.precision = a.precision),
11769        (this.polygonOffset = a.polygonOffset),
11770        (this.polygonOffsetFactor = a.polygonOffsetFactor),
11771        (this.polygonOffsetUnits = a.polygonOffsetUnits),
11772        (this.alphaTest = a.alphaTest),
11773        (this.premultipliedAlpha = a.premultipliedAlpha),
11774        (this.overdraw = a.overdraw),
11775        (this.visible = a.visible),
11776        (this.clipShadows = a.clipShadows),
11777        (this.clipIntersection = a.clipIntersection)
11778      var b = a.clippingPlanes,
11779        c = null
11780      if (null !== b) {
11781        var d = b.length
11782        c = new Array(d)
11783        for (var e = 0; e !== d; ++e) c[e] = b[e].clone()
11784      }
11785      return (this.clippingPlanes = c), this
11786    },
11787    update: function () {
11788      this.dispatchEvent({ type: 'update' })
11789    },
11790    dispose: function () {
11791      this.dispatchEvent({ type: 'dispose' })
11792    }
11793  }),
11794    Object.assign(Ae.prototype, b.prototype),
11795    (Be.prototype = Object.create(Ae.prototype)),
11796    (Be.prototype.constructor = Be),
11797    (Be.prototype.isShaderMaterial = !0),
11798    (Be.prototype.copy = function (a) {
11799      return (
11800        Ae.prototype.copy.call(this, a),
11801        (this.fragmentShader = a.fragmentShader),
11802        (this.vertexShader = a.vertexShader),
11803        (this.uniforms = pc.clone(a.uniforms)),
11804        (this.defines = a.defines),
11805        (this.wireframe = a.wireframe),
11806        (this.wireframeLinewidth = a.wireframeLinewidth),
11807        (this.lights = a.lights),
11808        (this.clipping = a.clipping),
11809        (this.skinning = a.skinning),
11810        (this.morphTargets = a.morphTargets),
11811        (this.morphNormals = a.morphNormals),
11812        (this.extensions = a.extensions),
11813        this
11814      )
11815    }),
11816    (Be.prototype.toJSON = function (a) {
11817      var b = Ae.prototype.toJSON.call(this, a)
11818      return (
11819        (b.uniforms = this.uniforms),
11820        (b.vertexShader = this.vertexShader),
11821        (b.fragmentShader = this.fragmentShader),
11822        b
11823      )
11824    }),
11825    (Ce.prototype = Object.create(Ae.prototype)),
11826    (Ce.prototype.constructor = Ce),
11827    (Ce.prototype.isMeshDepthMaterial = !0),
11828    (Ce.prototype.copy = function (a) {
11829      return (
11830        Ae.prototype.copy.call(this, a),
11831        (this.depthPacking = a.depthPacking),
11832        (this.skinning = a.skinning),
11833        (this.morphTargets = a.morphTargets),
11834        (this.map = a.map),
11835        (this.alphaMap = a.alphaMap),
11836        (this.displacementMap = a.displacementMap),
11837        (this.displacementScale = a.displacementScale),
11838        (this.displacementBias = a.displacementBias),
11839        (this.wireframe = a.wireframe),
11840        (this.wireframeLinewidth = a.wireframeLinewidth),
11841        this
11842      )
11843    }),
11844    (De.prototype = {
11845      constructor: De,
11846      isBox3: !0,
11847      set: function (a, b) {
11848        return this.min.copy(a), this.max.copy(b), this
11849      },
11850      setFromArray: function (a) {
11851        for (
11852          var b = +(1 / 0),
11853            c = +(1 / 0),
11854            d = +(1 / 0),
11855            e = -(1 / 0),
11856            f = -(1 / 0),
11857            g = -(1 / 0),
11858            h = 0,
11859            i = a.length;
11860          h < i;
11861          h += 3
11862        ) {
11863          var j = a[h],
11864            k = a[h + 1],
11865            l = a[h + 2]
11866          j < b && (b = j),
11867            k < c && (c = k),
11868            l < d && (d = l),
11869            j > e && (e = j),
11870            k > f && (f = k),
11871            l > g && (g = l)
11872        }
11873        return this.min.set(b, c, d), this.max.set(e, f, g), this
11874      },
11875      setFromBufferAttribute: function (a) {
11876        for (
11877          var b = +(1 / 0),
11878            c = +(1 / 0),
11879            d = +(1 / 0),
11880            e = -(1 / 0),
11881            f = -(1 / 0),
11882            g = -(1 / 0),
11883            h = 0,
11884            i = a.count;
11885          h < i;
11886          h++
11887        ) {
11888          var j = a.getX(h),
11889            k = a.getY(h),
11890            l = a.getZ(h)
11891          j < b && (b = j),
11892            k < c && (c = k),
11893            l < d && (d = l),
11894            j > e && (e = j),
11895            k > f && (f = k),
11896            l > g && (g = l)
11897        }
11898        return this.min.set(b, c, d), this.max.set(e, f, g), this
11899      },
11900      setFromPoints: function (a) {
11901        this.makeEmpty()
11902        for (var b = 0, c = a.length; b < c; b++) this.expandByPoint(a[b])
11903        return this
11904      },
11905      setFromCenterAndSize: (function () {
11906        var a = new Bb()
11907        return function (c, d) {
11908          var e = a.copy(d).multiplyScalar(0.5)
11909          return this.min.copy(c).sub(e), this.max.copy(c).add(e), this
11910        }
11911      })(),
11912      setFromObject: function (a) {
11913        return this.makeEmpty(), this.expandByObject(a)
11914      },
11915      clone: function () {
11916        return new this.constructor().copy(this)
11917      },
11918      copy: function (a) {
11919        return this.min.copy(a.min), this.max.copy(a.max), this
11920      },
11921      makeEmpty: function () {
11922        return (
11923          (this.min.x = this.min.y = this.min.z = +(1 / 0)),
11924          (this.max.x = this.max.y = this.max.z = -(1 / 0)),
11925          this
11926        )
11927      },
11928      isEmpty: function () {
11929        return (
11930          this.max.x < this.min.x ||
11931          this.max.y < this.min.y ||
11932          this.max.z < this.min.z
11933        )
11934      },
11935      getCenter: function (a) {
11936        var b = a || new Bb()
11937        return this.isEmpty()
11938          ? b.set(0, 0, 0)
11939          : b.addVectors(this.min, this.max).multiplyScalar(0.5)
11940      },
11941      getSize: function (a) {
11942        var b = a || new Bb()
11943        return this.isEmpty()
11944          ? b.set(0, 0, 0)
11945          : b.subVectors(this.max, this.min)
11946      },
11947      expandByPoint: function (a) {
11948        return this.min.min(a), this.max.max(a), this
11949      },
11950      expandByVector: function (a) {
11951        return this.min.sub(a), this.max.add(a), this
11952      },
11953      expandByScalar: function (a) {
11954        return this.min.addScalar(-a), this.max.addScalar(a), this
11955      },
11956      expandByObject: (function () {
11957        var a = new Bb()
11958        return function (c) {
11959          var d = this
11960          return (
11961            c.updateMatrixWorld(!0),
11962            c.traverse(function (b) {
11963              var c,
11964                e,
11965                f = b.geometry
11966              if (void 0 !== f)
11967                if (f.isGeometry) {
11968                  var g = f.vertices
11969                  for (c = 0, e = g.length; c < e; c++)
11970                    a.copy(g[c]),
11971                      a.applyMatrix4(b.matrixWorld),
11972                      d.expandByPoint(a)
11973                } else if (f.isBufferGeometry) {
11974                  var h = f.attributes.position
11975                  if (void 0 !== h)
11976                    for (c = 0, e = h.count; c < e; c++)
11977                      a.fromBufferAttribute(h, c).applyMatrix4(b.matrixWorld),
11978                        d.expandByPoint(a)
11979                }
11980            }),
11981            this
11982          )
11983        }
11984      })(),
11985      containsPoint: function (a) {
11986        return !(
11987          a.x < this.min.x ||
11988          a.x > this.max.x ||
11989          a.y < this.min.y ||
11990          a.y > this.max.y ||
11991          a.z < this.min.z ||
11992          a.z > this.max.z
11993        )
11994      },
11995      containsBox: function (a) {
11996        return (
11997          this.min.x <= a.min.x &&
11998          a.max.x <= this.max.x &&
11999          this.min.y <= a.min.y &&
12000          a.max.y <= this.max.y &&
12001          this.min.z <= a.min.z &&
12002          a.max.z <= this.max.z
12003        )
12004      },
12005      getParameter: function (a, b) {
12006        var c = b || new Bb()
12007        return c.set(
12008          (a.x - this.min.x) / (this.max.x - this.min.x),
12009          (a.y - this.min.y) / (this.max.y - this.min.y),
12010          (a.z - this.min.z) / (this.max.z - this.min.z)
12011        )
12012      },
12013      intersectsBox: function (a) {
12014        return !(
12015          a.max.x < this.min.x ||
12016          a.min.x > this.max.x ||
12017          a.max.y < this.min.y ||
12018          a.min.y > this.max.y ||
12019          a.max.z < this.min.z ||
12020          a.min.z > this.max.z
12021        )
12022      },
12023      intersectsSphere: (function () {
12024        var a
12025        return function (c) {
12026          return (
12027            void 0 === a && (a = new Bb()),
12028            this.clampPoint(c.center, a),
12029            a.distanceToSquared(c.center) <= c.radius * c.radius
12030          )
12031        }
12032      })(),
12033      intersectsPlane: function (a) {
12034        var b, c
12035        return (
12036          a.normal.x > 0
12037            ? ((b = a.normal.x * this.min.x), (c = a.normal.x * this.max.x))
12038            : ((b = a.normal.x * this.max.x), (c = a.normal.x * this.min.x)),
12039          a.normal.y > 0
12040            ? ((b += a.normal.y * this.min.y), (c += a.normal.y * this.max.y))
12041            : ((b += a.normal.y * this.max.y), (c += a.normal.y * this.min.y)),
12042          a.normal.z > 0
12043            ? ((b += a.normal.z * this.min.z), (c += a.normal.z * this.max.z))
12044            : ((b += a.normal.z * this.max.z), (c += a.normal.z * this.min.z)),
12045          b <= a.constant && c >= a.constant
12046        )
12047      },
12048      clampPoint: function (a, b) {
12049        var c = b || new Bb()
12050        return c.copy(a).clamp(this.min, this.max)
12051      },
12052      distanceToPoint: (function () {
12053        var a = new Bb()
12054        return function (c) {
12055          var d = a.copy(c).clamp(this.min, this.max)
12056          return d.sub(c).length()
12057        }
12058      })(),
12059      getBoundingSphere: (function () {
12060        var a = new Bb()
12061        return function (c) {
12062          var d = c || new Ee()
12063          return (
12064            this.getCenter(d.center),
12065            (d.radius = 0.5 * this.getSize(a).length()),
12066            d
12067          )
12068        }
12069      })(),
12070      intersect: function (a) {
12071        return (
12072          this.min.max(a.min),
12073          this.max.min(a.max),
12074          this.isEmpty() && this.makeEmpty(),
12075          this
12076        )
12077      },
12078      union: function (a) {
12079        return this.min.min(a.min), this.max.max(a.max), this
12080      },
12081      applyMatrix4: (function () {
12082        var a = [
12083          new Bb(),
12084          new Bb(),
12085          new Bb(),
12086          new Bb(),
12087          new Bb(),
12088          new Bb(),
12089          new Bb(),
12090          new Bb()
12091        ]
12092        return function (c) {
12093          return this.isEmpty()
12094            ? this
12095            : (a[0].set(this.min.x, this.min.y, this.min.z).applyMatrix4(c),
12096              a[1].set(this.min.x, this.min.y, this.max.z).applyMatrix4(c),
12097              a[2].set(this.min.x, this.max.y, this.min.z).applyMatrix4(c),
12098              a[3].set(this.min.x, this.max.y, this.max.z).applyMatrix4(c),
12099              a[4].set(this.max.x, this.min.y, this.min.z).applyMatrix4(c),
12100              a[5].set(this.max.x, this.min.y, this.max.z).applyMatrix4(c),
12101              a[6].set(this.max.x, this.max.y, this.min.z).applyMatrix4(c),
12102              a[7].set(this.max.x, this.max.y, this.max.z).applyMatrix4(c),
12103              this.setFromPoints(a),
12104              this)
12105        }
12106      })(),
12107      translate: function (a) {
12108        return this.min.add(a), this.max.add(a), this
12109      },
12110      equals: function (a) {
12111        return a.min.equals(this.min) && a.max.equals(this.max)
12112      }
12113    }),
12114    (Ee.prototype = {
12115      constructor: Ee,
12116      set: function (a, b) {
12117        return this.center.copy(a), (this.radius = b), this
12118      },
12119      setFromPoints: (function () {
12120        var a
12121        return function (c, d) {
12122          void 0 === a && (a = new De())
12123          var e = this.center
12124          void 0 !== d ? e.copy(d) : a.setFromPoints(c).getCenter(e)
12125          for (var f = 0, g = 0, h = c.length; g < h; g++)
12126            f = Math.max(f, e.distanceToSquared(c[g]))
12127          return (this.radius = Math.sqrt(f)), this
12128        }
12129      })(),
12130      clone: function () {
12131        return new this.constructor().copy(this)
12132      },
12133      copy: function (a) {
12134        return this.center.copy(a.center), (this.radius = a.radius), this
12135      },
12136      empty: function () {
12137        return this.radius <= 0
12138      },
12139      containsPoint: function (a) {
12140        return a.distanceToSquared(this.center) <= this.radius * this.radius
12141      },
12142      distanceToPoint: function (a) {
12143        return a.distanceTo(this.center) - this.radius
12144      },
12145      intersectsSphere: function (a) {
12146        var b = this.radius + a.radius
12147        return a.center.distanceToSquared(this.center) <= b * b
12148      },
12149      intersectsBox: function (a) {
12150        return a.intersectsSphere(this)
12151      },
12152      intersectsPlane: function (a) {
12153        return Math.abs(this.center.dot(a.normal) - a.constant) <= this.radius
12154      },
12155      clampPoint: function (a, b) {
12156        var c = this.center.distanceToSquared(a),
12157          d = b || new Bb()
12158        return (
12159          d.copy(a),
12160          c > this.radius * this.radius &&
12161            (d.sub(this.center).normalize(),
12162            d.multiplyScalar(this.radius).add(this.center)),
12163          d
12164        )
12165      },
12166      getBoundingBox: function (a) {
12167        var b = a || new De()
12168        return b.set(this.center, this.center), b.expandByScalar(this.radius), b
12169      },
12170      applyMatrix4: function (a) {
12171        return (
12172          this.center.applyMatrix4(a),
12173          (this.radius = this.radius * a.getMaxScaleOnAxis()),
12174          this
12175        )
12176      },
12177      translate: function (a) {
12178        return this.center.add(a), this
12179      },
12180      equals: function (a) {
12181        return a.center.equals(this.center) && a.radius === this.radius
12182      }
12183    }),
12184    (Fe.prototype = {
12185      constructor: Fe,
12186      isMatrix3: !0,
12187      set: function (a, b, c, d, e, f, g, h, i) {
12188        var j = this.elements
12189        return (
12190          (j[0] = a),
12191          (j[1] = d),
12192          (j[2] = g),
12193          (j[3] = b),
12194          (j[4] = e),
12195          (j[5] = h),
12196          (j[6] = c),
12197          (j[7] = f),
12198          (j[8] = i),
12199          this
12200        )
12201      },
12202      identity: function () {
12203        return this.set(1, 0, 0, 0, 1, 0, 0, 0, 1), this
12204      },
12205      clone: function () {
12206        return new this.constructor().fromArray(this.elements)
12207      },
12208      copy: function (a) {
12209        var b = a.elements
12210        return (
12211          this.set(b[0], b[3], b[6], b[1], b[4], b[7], b[2], b[5], b[8]), this
12212        )
12213      },
12214      setFromMatrix4: function (a) {
12215        var b = a.elements
12216        return (
12217          this.set(b[0], b[4], b[8], b[1], b[5], b[9], b[2], b[6], b[10]), this
12218        )
12219      },
12220      applyToBufferAttribute: (function () {
12221        var a
12222        return function (c) {
12223          void 0 === a && (a = new Bb())
12224          for (var d = 0, e = c.count; d < e; d++)
12225            (a.x = c.getX(d)),
12226              (a.y = c.getY(d)),
12227              (a.z = c.getZ(d)),
12228              a.applyMatrix3(this),
12229              c.setXYZ(d, a.x, a.y, a.z)
12230          return c
12231        }
12232      })(),
12233      multiplyScalar: function (a) {
12234        var b = this.elements
12235        return (
12236          (b[0] *= a),
12237          (b[3] *= a),
12238          (b[6] *= a),
12239          (b[1] *= a),
12240          (b[4] *= a),
12241          (b[7] *= a),
12242          (b[2] *= a),
12243          (b[5] *= a),
12244          (b[8] *= a),
12245          this
12246        )
12247      },
12248      determinant: function () {
12249        var a = this.elements,
12250          b = a[0],
12251          c = a[1],
12252          d = a[2],
12253          e = a[3],
12254          f = a[4],
12255          g = a[5],
12256          h = a[6],
12257          i = a[7],
12258          j = a[8]
12259        return (
12260          b * f * j - b * g * i - c * e * j + c * g * h + d * e * i - d * f * h
12261        )
12262      },
12263      getInverse: function (a, b) {
12264        a &&
12265          a.isMatrix4 &&
12266          console.error(
12267            'THREE.Matrix3.getInverse no longer takes a Matrix4 argument.'
12268          )
12269        var c = a.elements,
12270          d = this.elements,
12271          e = c[0],
12272          f = c[1],
12273          g = c[2],
12274          h = c[3],
12275          i = c[4],
12276          j = c[5],
12277          k = c[6],
12278          l = c[7],
12279          m = c[8],
12280          n = m * i - j * l,
12281          o = j * k - m * h,
12282          p = l * h - i * k,
12283          q = e * n + f * o + g * p
12284        if (0 === q) {
12285          var r =
12286            "THREE.Matrix3.getInverse(): can't invert matrix, determinant is 0"
12287          if (b === !0) throw new Error(r)
12288          return console.warn(r), this.identity()
12289        }
12290        var s = 1 / q
12291        return (
12292          (d[0] = n * s),
12293          (d[1] = (g * l - m * f) * s),
12294          (d[2] = (j * f - g * i) * s),
12295          (d[3] = o * s),
12296          (d[4] = (m * e - g * k) * s),
12297          (d[5] = (g * h - j * e) * s),
12298          (d[6] = p * s),
12299          (d[7] = (f * k - l * e) * s),
12300          (d[8] = (i * e - f * h) * s),
12301          this
12302        )
12303      },
12304      transpose: function () {
12305        var a,
12306          b = this.elements
12307        return (
12308          (a = b[1]),
12309          (b[1] = b[3]),
12310          (b[3] = a),
12311          (a = b[2]),
12312          (b[2] = b[6]),
12313          (b[6] = a),
12314          (a = b[5]),
12315          (b[5] = b[7]),
12316          (b[7] = a),
12317          this
12318        )
12319      },
12320      getNormalMatrix: function (a) {
12321        return this.setFromMatrix4(a).getInverse(this).transpose()
12322      },
12323      transposeIntoArray: function (a) {
12324        var b = this.elements
12325        return (
12326          (a[0] = b[0]),
12327          (a[1] = b[3]),
12328          (a[2] = b[6]),
12329          (a[3] = b[1]),
12330          (a[4] = b[4]),
12331          (a[5] = b[7]),
12332          (a[6] = b[2]),
12333          (a[7] = b[5]),
12334          (a[8] = b[8]),
12335          this
12336        )
12337      },
12338      fromArray: function (a, b) {
12339        void 0 === b && (b = 0)
12340        for (var c = 0; c < 9; c++) this.elements[c] = a[c + b]
12341        return this
12342      },
12343      toArray: function (a, b) {
12344        void 0 === a && (a = []), void 0 === b && (b = 0)
12345        var c = this.elements
12346        return (
12347          (a[b] = c[0]),
12348          (a[b + 1] = c[1]),
12349          (a[b + 2] = c[2]),
12350          (a[b + 3] = c[3]),
12351          (a[b + 4] = c[4]),
12352          (a[b + 5] = c[5]),
12353          (a[b + 6] = c[6]),
12354          (a[b + 7] = c[7]),
12355          (a[b + 8] = c[8]),
12356          a
12357        )
12358      }
12359    }),
12360    (Ge.prototype = {
12361      constructor: Ge,
12362      set: function (a, b) {
12363        return this.normal.copy(a), (this.constant = b), this
12364      },
12365      setComponents: function (a, b, c, d) {
12366        return this.normal.set(a, b, c), (this.constant = d), this
12367      },
12368      setFromNormalAndCoplanarPoint: function (a, b) {
12369        return this.normal.copy(a), (this.constant = -b.dot(this.normal)), this
12370      },
12371      setFromCoplanarPoints: (function () {
12372        var a = new Bb(),
12373          b = new Bb()
12374        return function (d, e, f) {
12375          var g = a.subVectors(f, e).cross(b.subVectors(d, e)).normalize()
12376          return this.setFromNormalAndCoplanarPoint(g, d), this
12377        }
12378      })(),
12379      clone: function () {
12380        return new this.constructor().copy(this)
12381      },
12382      copy: function (a) {
12383        return this.normal.copy(a.normal), (this.constant = a.constant), this
12384      },
12385      normalize: function () {
12386        var a = 1 / this.normal.length()
12387        return this.normal.multiplyScalar(a), (this.constant *= a), this
12388      },
12389      negate: function () {
12390        return (this.constant *= -1), this.normal.negate(), this
12391      },
12392      distanceToPoint: function (a) {
12393        return this.normal.dot(a) + this.constant
12394      },
12395      distanceToSphere: function (a) {
12396        return this.distanceToPoint(a.center) - a.radius
12397      },
12398      projectPoint: function (a, b) {
12399        return this.orthoPoint(a, b).sub(a).negate()
12400      },
12401      orthoPoint: function (a, b) {
12402        var c = this.distanceToPoint(a),
12403          d = b || new Bb()
12404        return d.copy(this.normal).multiplyScalar(c)
12405      },
12406      intersectLine: (function () {
12407        var a = new Bb()
12408        return function (c, d) {
12409          var e = d || new Bb(),
12410            f = c.delta(a),
12411            g = this.normal.dot(f)
12412          if (0 !== g) {
12413            var h = -(c.start.dot(this.normal) + this.constant) / g
12414            if (!(h < 0 || h > 1))
12415              return e.copy(f).multiplyScalar(h).add(c.start)
12416          } else if (0 === this.distanceToPoint(c.start)) return e.copy(c.start)
12417        }
12418      })(),
12419      intersectsLine: function (a) {
12420        var b = this.distanceToPoint(a.start),
12421          c = this.distanceToPoint(a.end)
12422        return (b < 0 && c > 0) || (c < 0 && b > 0)
12423      },
12424      intersectsBox: function (a) {
12425        return a.intersectsPlane(this)
12426      },
12427      intersectsSphere: function (a) {
12428        return a.intersectsPlane(this)
12429      },
12430      coplanarPoint: function (a) {
12431        var b = a || new Bb()
12432        return b.copy(this.normal).multiplyScalar(-this.constant)
12433      },
12434      applyMatrix4: (function () {
12435        var a = new Bb(),
12436          b = new Fe()
12437        return function (d, e) {
12438          var f = this.coplanarPoint(a).applyMatrix4(d),
12439            g = e || b.getNormalMatrix(d),
12440            h = this.normal.applyMatrix3(g).normalize()
12441          return (this.constant = -f.dot(h)), this
12442        }
12443      })(),
12444      translate: function (a) {
12445        return (this.constant = this.constant - a.dot(this.normal)), this
12446      },
12447      equals: function (a) {
12448        return a.normal.equals(this.normal) && a.constant === this.constant
12449      }
12450    }),
12451    (He.prototype = {
12452      constructor: He,
12453      set: function (a, b, c, d, e, f) {
12454        var g = this.planes
12455        return (
12456          g[0].copy(a),
12457          g[1].copy(b),
12458          g[2].copy(c),
12459          g[3].copy(d),
12460          g[4].copy(e),
12461          g[5].copy(f),
12462          this
12463        )
12464      },
12465      clone: function () {
12466        return new this.constructor().copy(this)
12467      },
12468      copy: function (a) {
12469        for (var b = this.planes, c = 0; c < 6; c++) b[c].copy(a.planes[c])
12470        return this
12471      },
12472      setFromMatrix: function (a) {
12473        var b = this.planes,
12474          c = a.elements,
12475          d = c[0],
12476          e = c[1],
12477          f = c[2],
12478          g = c[3],
12479          h = c[4],
12480          i = c[5],
12481          j = c[6],
12482          k = c[7],
12483          l = c[8],
12484          m = c[9],
12485          n = c[10],
12486          o = c[11],
12487          p = c[12],
12488          q = c[13],
12489          r = c[14],
12490          s = c[15]
12491        return (
12492          b[0].setComponents(g - d, k - h, o - l, s - p).normalize(),
12493          b[1].setComponents(g + d, k + h, o + l, s + p).normalize(),
12494          b[2].setComponents(g + e, k + i, o + m, s + q).normalize(),
12495          b[3].setComponents(g - e, k - i, o - m, s - q).normalize(),
12496          b[4].setComponents(g - f, k - j, o - n, s - r).normalize(),
12497          b[5].setComponents(g + f, k + j, o + n, s + r).normalize(),
12498          this
12499        )
12500      },
12501      intersectsObject: (function () {
12502        var a = new Ee()
12503        return function (c) {
12504          var d = c.geometry
12505          return (
12506            null === d.boundingSphere && d.computeBoundingSphere(),
12507            a.copy(d.boundingSphere).applyMatrix4(c.matrixWorld),
12508            this.intersectsSphere(a)
12509          )
12510        }
12511      })(),
12512      intersectsSprite: (function () {
12513        var a = new Ee()
12514        return function (c) {
12515          return (
12516            a.center.set(0, 0, 0),
12517            (a.radius = 0.7071067811865476),
12518            a.applyMatrix4(c.matrixWorld),
12519            this.intersectsSphere(a)
12520          )
12521        }
12522      })(),
12523      intersectsSphere: function (a) {
12524        for (
12525          var b = this.planes, c = a.center, d = -a.radius, e = 0;
12526          e < 6;
12527          e++
12528        ) {
12529          var f = b[e].distanceToPoint(c)
12530          if (f < d) return !1
12531        }
12532        return !0
12533      },
12534      intersectsBox: (function () {
12535        var a = new Bb(),
12536          b = new Bb()
12537        return function (d) {
12538          for (var e = this.planes, f = 0; f < 6; f++) {
12539            var g = e[f]
12540            ;(a.x = g.normal.x > 0 ? d.min.x : d.max.x),
12541              (b.x = g.normal.x > 0 ? d.max.x : d.min.x),
12542              (a.y = g.normal.y > 0 ? d.min.y : d.max.y),
12543              (b.y = g.normal.y > 0 ? d.max.y : d.min.y),
12544              (a.z = g.normal.z > 0 ? d.min.z : d.max.z),
12545              (b.z = g.normal.z > 0 ? d.max.z : d.min.z)
12546            var h = g.distanceToPoint(a),
12547              i = g.distanceToPoint(b)
12548            if (h < 0 && i < 0) return !1
12549          }
12550          return !0
12551        }
12552      })(),
12553      containsPoint: function (a) {
12554        for (var b = this.planes, c = 0; c < 6; c++)
12555          if (b[c].distanceToPoint(a) < 0) return !1
12556        return !0
12557      }
12558    }),
12559    (Je.prototype = {
12560      constructor: Je,
12561      set: function (a, b) {
12562        return this.origin.copy(a), this.direction.copy(b), this
12563      },
12564      clone: function () {
12565        return new this.constructor().copy(this)
12566      },
12567      copy: function (a) {
12568        return (
12569          this.origin.copy(a.origin), this.direction.copy(a.direction), this
12570        )
12571      },
12572      at: function (a, b) {
12573        var c = b || new Bb()
12574        return c.copy(this.direction).multiplyScalar(a).add(this.origin)
12575      },
12576      lookAt: function (a) {
12577        return this.direction.copy(a).sub(this.origin).normalize(), this
12578      },
12579      recast: (function () {
12580        var a = new Bb()
12581        return function (c) {
12582          return this.origin.copy(this.at(c, a)), this
12583        }
12584      })(),
12585      closestPointToPoint: function (a, b) {
12586        var c = b || new Bb()
12587        c.subVectors(a, this.origin)
12588        var d = c.dot(this.direction)
12589        return d < 0
12590          ? c.copy(this.origin)
12591          : c.copy(this.direction).multiplyScalar(d).add(this.origin)
12592      },
12593      distanceToPoint: function (a) {
12594        return Math.sqrt(this.distanceSqToPoint(a))
12595      },
12596      distanceSqToPoint: (function () {
12597        var a = new Bb()
12598        return function (c) {
12599          var d = a.subVectors(c, this.origin).dot(this.direction)
12600          return d < 0
12601            ? this.origin.distanceToSquared(c)
12602            : (a.copy(this.direction).multiplyScalar(d).add(this.origin),
12603              a.distanceToSquared(c))
12604        }
12605      })(),
12606      distanceSqToSegment: (function () {
12607        var a = new Bb(),
12608          b = new Bb(),
12609          c = new Bb()
12610        return function (e, f, g, h) {
12611          a.copy(e).add(f).multiplyScalar(0.5),
12612            b.copy(f).sub(e).normalize(),
12613            c.copy(this.origin).sub(a)
12614          var o,
12615            p,
12616            q,
12617            r,
12618            i = 0.5 * e.distanceTo(f),
12619            j = -this.direction.dot(b),
12620            k = c.dot(this.direction),
12621            l = -c.dot(b),
12622            m = c.lengthSq(),
12623            n = Math.abs(1 - j * j)
12624          if (n > 0)
12625            if (((o = j * l - k), (p = j * k - l), (r = i * n), o >= 0))
12626              if (p >= -r)
12627                if (p <= r) {
12628                  var s = 1 / n
12629                  ;
12629(o *= s),
12630                    (p *= s),
12631                    (q = o * (o + j * p + 2 * k) + p * (j * o + p + 2 * l) + m)
12632                } else
12633                  (p = i),
12634                    (o = Math.max(0, -(j * p + k))),
12635                    (q = -o * o + p * (p + 2 * l) + m)
12636              else
12637                (p = -i),
12638                  (o = Math.max(0, -(j * p + k))),
12639                  (q = -o * o + p * (p + 2 * l) + m)
12640            else
12641              p <= -r
12642                ? ((o = Math.max(0, -(-j * i + k))),
12643                  (p = o > 0 ? -i : Math.min(Math.max(-i, -l), i)),
12644                  (q = -o * o + p * (p + 2 * l) + m))
12645                : p <= r
12646                ? ((o = 0),
12647                  (p = Math.min(Math.max(-i, -l), i)),
12648                  (q = p * (p + 2 * l) + m))
12649                : ((o = Math.max(0, -(j * i + k))),
12650                  (p = o > 0 ? i : Math.min(Math.max(-i, -l), i)),
12651                  (q = -o * o + p * (p + 2 * l) + m))
12652          else
12653            (p = j > 0 ? -i : i),
12654              (o = Math.max(0, -(j * p + k))),
12655              (q = -o * o + p * (p + 2 * l) + m)
12656          return (
12657            g && g.copy(this.direction).multiplyScalar(o).add(this.origin),
12658            h && h.copy(b).multiplyScalar(p).add(a),
12659            q
12660          )
12661        }
12662      })(),
12663      intersectSphere: (function () {
12664        var a = new Bb()
12665        return function (c, d) {
12666          a.subVectors(c.center, this.origin)
12667          var e = a.dot(this.direction),
12668            f = a.dot(a) - e * e,
12669            g = c.radius * c.radius
12670          if (f > g) return null
12671          var h = Math.sqrt(g - f),
12672            i = e - h,
12673            j = e + h
12674          return i < 0 && j < 0 ? null : i < 0 ? this.at(j, d) : this.at(i, d)
12675        }
12676      })(),
12677      intersectsSphere: function (a) {
12678        return this.distanceToPoint(a.center) <= a.radius
12679      },
12680      distanceToPlane: function (a) {
12681        var b = a.normal.dot(this.direction)
12682        if (0 === b) return 0 === a.distanceToPoint(this.origin) ? 0 : null
12683        var c = -(this.origin.dot(a.normal) + a.constant) / b
12684        return c >= 0 ? c : null
12685      },
12686      intersectPlane: function (a, b) {
12687        var c = this.distanceToPlane(a)
12688        return null === c ? null : this.at(c, b)
12689      },
12690      intersectsPlane: function (a) {
12691        var b = a.distanceToPoint(this.origin)
12692        if (0 === b) return !0
12693        var c = a.normal.dot(this.direction)
12694        return c * b < 0
12695      },
12696      intersectBox: function (a, b) {
12697        var c,
12698          d,
12699          e,
12700          f,
12701          g,
12702          h,
12703          i = 1 / this.direction.x,
12704          j = 1 / this.direction.y,
12705          k = 1 / this.direction.z,
12706          l = this.origin
12707        return (
12708          i >= 0
12709            ? ((c = (a.min.x - l.x) * i), (d = (a.max.x - l.x) * i))
12710            : ((c = (a.max.x - l.x) * i), (d = (a.min.x - l.x) * i)),
12711          j >= 0
12712            ? ((e = (a.min.y - l.y) * j), (f = (a.max.y - l.y) * j))
12713            : ((e = (a.max.y - l.y) * j), (f = (a.min.y - l.y) * j)),
12714          c > f || e > d
12715            ? null
12716            : ((e > c || c !== c) && (c = e),
12717              (f < d || d !== d) && (d = f),
12718              k >= 0
12719                ? ((g = (a.min.z - l.z) * k), (h = (a.max.z - l.z) * k))
12720                : ((g = (a.max.z - l.z) * k), (h = (a.min.z - l.z) * k)),
12721              c > h || g > d
12722                ? null
12723                : ((g > c || c !== c) && (c = g),
12724                  (h < d || d !== d) && (d = h),
12725                  d < 0 ? null : this.at(c >= 0 ? c : d, b)))
12726        )
12727      },
12728      intersectsBox: (function () {
12729        var a = new Bb()
12730        return function (c) {
12731          return null !== this.intersectBox(c, a)
12732        }
12733      })(),
12734      intersectTriangle: (function () {
12735        var a = new Bb(),
12736          b = new Bb(),
12737          c = new Bb(),
12738          d = new Bb()
12739        return function (f, g, h, i, j) {
12740          b.subVectors(g, f), c.subVectors(h, f), d.crossVectors(b, c)
12741          var l,
12742            k = this.direction.dot(d)
12743          if (k > 0) {
12744            if (i) return null
12745            l = 1
12746          } else {
12747            if (!(k < 0)) return null
12748            ;(l = -1), (k = -k)
12749          }
12750          a.subVectors(this.origin, f)
12751          var m = l * this.direction.dot(c.crossVectors(a, c))
12752          if (m < 0) return null
12753          var n = l * this.direction.dot(b.cross(a))
12754          if (n < 0) return null
12755          if (m + n > k) return null
12756          var o = -l * a.dot(d)
12757          return o < 0 ? null : this.at(o / k, j)
12758        }
12759      })(),
12760      applyMatrix4: function (a) {
12761        return (
12762          this.direction.add(this.origin).applyMatrix4(a),
12763          this.origin.applyMatrix4(a),
12764          this.direction.sub(this.origin),
12765          this.direction.normalize(),
12766          this
12767        )
12768      },
12769      equals: function (a) {
12770        return (
12771          a.origin.equals(this.origin) && a.direction.equals(this.direction)
12772        )
12773      }
12774    }),
12775    (Ke.RotationOrders = ['XYZ', 'YZX', 'ZXY', 'XZY', 'YXZ', 'ZYX']),
12776    (Ke.DefaultOrder = 'XYZ'),
12777    (Ke.prototype = {
12778      constructor: Ke,
12779      isEuler: !0,
12780      get x() {
12781        return this._x
12782      },
12783      set x(a) {
12784        ;(this._x = a), this.onChangeCallback()
12785      },
12786      get y() {
12787        return this._y
12788      },
12789      set y(a) {
12790        ;(this._y = a), this.onChangeCallback()
12791      },
12792      get z() {
12793        return this._z
12794      },
12795      set z(a) {
12796        ;(this._z = a), this.onChangeCallback()
12797      },
12798      get order() {
12799        return this._order
12800      },
12801      set order(a) {
12802        ;(this._order = a), this.onChangeCallback()
12803      },
12804      set: function (a, b, c, d) {
12805        return (
12806          (this._x = a),
12807          (this._y = b),
12808          (this._z = c),
12809          (this._order = d || this._order),
12810          this.onChangeCallback(),
12811          this
12812        )
12813      },
12814      clone: function () {
12815        return new this.constructor(this._x, this._y, this._z, this._order)
12816      },
12817      copy: function (a) {
12818        return (
12819          (this._x = a._x),
12820          (this._y = a._y),
12821          (this._z = a._z),
12822          (this._order = a._order),
12823          this.onChangeCallback(),
12824          this
12825        )
12826      },
12827      setFromRotationMatrix: function (a, b, c) {
12828        var d = tb.clamp,
12829          e = a.elements,
12830          f = e[0],
12831          g = e[4],
12832          h = e[8],
12833          i = e[1],
12834          j = e[5],
12835          k = e[9],
12836          l = e[2],
12837          m = e[6],
12838          n = e[10]
12839        return (
12840          (b = b || this._order),
12841          'XYZ' === b
12842            ? ((this._y = Math.asin(d(h, -1, 1))),
12843              Math.abs(h) < 0.99999
12844                ? ((this._x = Math.atan2(-k, n)), (this._z = Math.atan2(-g, f)))
12845                : ((this._x = Math.atan2(m, j)), (this._z = 0)))
12846            : 'YXZ' === b
12847            ? ((this._x = Math.asin(-d(k, -1, 1))),
12848              Math.abs(k) < 0.99999
12849                ? ((this._y = Math.atan2(h, n)), (this._z = Math.atan2(i, j)))
12850                : ((this._y = Math.atan2(-l, f)), (this._z = 0)))
12851            : 'ZXY' === b
12852            ? ((this._x = Math.asin(d(m, -1, 1))),
12853              Math.abs(m) < 0.99999
12854                ? ((this._y = Math.atan2(-l, n)), (this._z = Math.atan2(-g, j)))
12855                : ((this._y = 0), (this._z = Math.atan2(i, f))))
12856            : 'ZYX' === b
12857            ? ((this._y = Math.asin(-d(l, -1, 1))),
12858              Math.abs(l) < 0.99999
12859                ? ((this._x = Math.atan2(m, n)), (this._z = Math.atan2(i, f)))
12860                : ((this._x = 0), (this._z = Math.atan2(-g, j))))
12861            : 'YZX' === b
12862            ? ((this._z = Math.asin(d(i, -1, 1))),
12863              Math.abs(i) < 0.99999
12864                ? ((this._x = Math.atan2(-k, j)), (this._y = Math.atan2(-l, f)))
12865                : ((this._x = 0), (this._y = Math.atan2(h, n))))
12866            : 'XZY' === b
12867            ? ((this._z = Math.asin(-d(g, -1, 1))),
12868              Math.abs(g) < 0.99999
12869                ? ((this._x = Math.atan2(m, j)), (this._y = Math.atan2(h, f)))
12870                : ((this._x = Math.atan2(-k, n)), (this._y = 0)))
12871            : console.warn(
12872                'THREE.Euler: .setFromRotationMatrix() given unsupported order: ' +
12873                  b
12874              ),
12875          (this._order = b),
12876          c !== !1 && this.onChangeCallback(),
12877          this
12878        )
12879      },
12880      setFromQuaternion: (function () {
12881        var a
12882        return function (c, d, e) {
12883          return (
12884            void 0 === a && (a = new Cb()),
12885            a.makeRotationFromQuaternion(c),
12886            this.setFromRotationMatrix(a, d, e)
12887          )
12888        }
12889      })(),
12890      setFromVector3: function (a, b) {
12891        return this.set(a.x, a.y, a.z, b || this._order)
12892      },
12893      reorder: (function () {
12894        var a = new Ab()
12895        return function (c) {
12896          return a.setFromEuler(this), this.setFromQuaternion(a, c)
12897        }
12898      })(),
12899      equals: function (a) {
12900        return (
12901          a._x === this._x &&
12902          a._y === this._y &&
12903          a._z === this._z &&
12904          a._order === this._order
12905        )
12906      },
12907      fromArray: function (a) {
12908        return (
12909          (this._x = a[0]),
12910          (this._y = a[1]),
12911          (this._z = a[2]),
12912          void 0 !== a[3] && (this._order = a[3]),
12913          this.onChangeCallback(),
12914          this
12915        )
12916      },
12917      toArray: function (a, b) {
12918        return (
12919          void 0 === a && (a = []),
12920          void 0 === b && (b = 0),
12921          (a[b] = this._x),
12922          (a[b + 1] = this._y),
12923          (a[b + 2] = this._z),
12924          (a[b + 3] = this._order),
12925          a
12926        )
12927      },
12928      toVector3: function (a) {
12929        return a
12930          ? a.set(this._x, this._y, this._z)
12931          : new Bb(this._x, this._y, this._z)
12932      },
12933      onChange: function (a) {
12934        return (this.onChangeCallback = a), this
12935      },
12936      onChangeCallback: function () {}
12937    }),
12938    (Le.prototype = {
12939      constructor: Le,
12940      set: function (a) {
12941        this.mask = 1 << a
12942      },
12943      enable: function (a) {
12944        this.mask |= 1 << a
12945      },
12946      toggle: function (a) {
12947        this.mask ^= 1 << a
12948      },
12949      disable: function (a) {
12950        this.mask &= ~(1 << a)
12951      },
12952      test: function (a) {
12953        return 0 !== (this.mask & a.mask)
12954      }
12955    })
12956  var Me = 0
12957  ;(Ne.DefaultUp = new Bb(0, 1, 0)),
12958    (Ne.DefaultMatrixAutoUpdate = !0),
12959    (Ne.prototype = {
12960      constructor: Ne,
12961      isObject3D: !0,
12962      applyMatrix: function (a) {
12963        this.matrix.multiplyMatrices(a, this.matrix),
12964          this.matrix.decompose(this.position, this.quaternion, this.scale)
12965      },
12966      setRotationFromAxisAngle: function (a, b) {
12967        this.quaternion.setFromAxisAngle(a, b)
12968      },
12969      setRotationFromEuler: function (a) {
12970        this.quaternion.setFromEuler(a, !0)
12971      },
12972      setRotationFromMatrix: function (a) {
12973        this.quaternion.setFromRotationMatrix(a)
12974      },
12975      setRotationFromQuaternion: function (a) {
12976        this.quaternion.copy(a)
12977      },
12978      rotateOnAxis: (function () {
12979        var a = new Ab()
12980        return function (c, d) {
12981          return a.setFromAxisAngle(c, d), this.quaternion.multiply(a), this
12982        }
12983      })(),
12984      rotateX: (function () {
12985        var a = new Bb(1, 0, 0)
12986        return function (c) {
12987          return this.rotateOnAxis(a, c)
12988        }
12989      })(),
12990      rotateY: (function () {
12991        var a = new Bb(0, 1, 0)
12992        return function (c) {
12993          return this.rotateOnAxis(a, c)
12994        }
12995      })(),
12996      rotateZ: (function () {
12997        var a = new Bb(0, 0, 1)
12998        return function (c) {
12999          return this.rotateOnAxis(a, c)
13000        }
13001      })(),
13002      translateOnAxis: (function () {
13003        var a = new Bb()
13004        return function (c, d) {
13005          return (
13006            a.copy(c).applyQuaternion(this.quaternion),
13007            this.position.add(a.multiplyScalar(d)),
13008            this
13009          )
13010        }
13011      })(),
13012      translateX: (function () {
13013        var a = new Bb(1, 0, 0)
13014        return function (c) {
13015          return this.translateOnAxis(a, c)
13016        }
13017      })(),
13018      translateY: (function () {
13019        var a = new Bb(0, 1, 0)
13020        return function (c) {
13021          return this.translateOnAxis(a, c)
13022        }
13023      })(),
13024      translateZ: (function () {
13025        var a = new Bb(0, 0, 1)
13026        return function (c) {
13027          return this.translateOnAxis(a, c)
13028        }
13029      })(),
13030      localToWorld: function (a) {
13031        return a.applyMatrix4(this.matrixWorld)
13032      },
13033      worldToLocal: (function () {
13034        var a = new Cb()
13035        return function (c) {
13036          return c.applyMatrix4(a.getInverse(this.matrixWorld))
13037        }
13038      })(),
13039      lookAt: (function () {
13040        var a = new Cb()
13041        return function (c) {
13042          a.lookAt(c, this.position, this.up),
13043            this.quaternion.setFromRotationMatrix(a)
13044        }
13045      })(),
13046      add: function (a) {
13047        if (arguments.length > 1) {
13048          for (var b = 0; b < arguments.length; b++) this.add(arguments[b])
13049          return this
13050        }
13051        return a === this
13052          ? (console.error(
13053              "THREE.Object3D.add: object can't be added as a child of itself.",
13054              a
13055            ),
13056            this)
13057          : (a && a.isObject3D
13058              ? (null !== a.parent && a.parent.remove(a),
13059                (a.parent = this),
13060                a.dispatchEvent({ type: 'added' }),
13061                this.children.push(a))
13062              : console.error(
13063                  'THREE.Object3D.add: object not an instance of THREE.Object3D.',
13064                  a
13065                ),
13066            this)
13067      },
13068      remove: function (a) {
13069        if (arguments.length > 1)
13070          for (var b = 0; b < arguments.length; b++) this.remove(arguments[b])
13071        var c = this.children.indexOf(a)
13072        c !== -1 &&
13073          ((a.parent = null),
13074          a.dispatchEvent({ type: 'removed' }),
13075          this.children.splice(c, 1))
13076      },
13077      getObjectById: function (a) {
13078        return this.getObjectByProperty('id', a)
13079      },
13080      getObjectByName: function (a) {
13081        return this.getObjectByProperty('name', a)
13082      },
13083      getObjectByProperty: function (a, b) {
13084        if (this[a] === b) return this
13085        for (var c = 0, d = this.children.length; c < d; c++) {
13086          var e = this.children[c],
13087            f = e.getObjectByProperty(a, b)
13088          if (void 0 !== f) return f
13089        }
13090      },
13091      getWorldPosition: function (a) {
13092        var b = a || new Bb()
13093        return (
13094          this.updateMatrixWorld(!0), b.setFromMatrixPosition(this.matrixWorld)
13095        )
13096      },
13097      getWorldQuaternion: (function () {
13098        var a = new Bb(),
13099          b = new Bb()
13100        return function (d) {
13101          var e = d || new Ab()
13102          return (
13103            this.updateMatrixWorld(!0), this.matrixWorld.decompose(a, e, b), e
13104          )
13105        }
13106      })(),
13107      getWorldRotation: (function () {
13108        var a = new Ab()
13109        return function (c) {
13110          var d = c || new Ke()
13111          return (
13112            this.getWorldQuaternion(a),
13113            d.setFromQuaternion(a, this.rotation.order, !1)
13114          )
13115        }
13116      })(),
13117      getWorldScale: (function () {
13118        var a = new Bb(),
13119          b = new Ab()
13120        return function (d) {
13121          var e = d || new Bb()
13122          return (
13123            this.updateMatrixWorld(!0), this.matrixWorld.decompose(a, b, e), e
13124          )
13125        }
13126      })(),
13127      getWorldDirection: (function () {
13128        var a = new Ab()
13129        return function (c) {
13130          var d = c || new Bb()
13131          return this.getWorldQuaternion(a), d.set(0, 0, 1).applyQuaternion(a)
13132        }
13133      })(),
13134      raycast: function () {},
13135      traverse: function (a) {
13136        a(this)
13137        for (var b = this.children, c = 0, d = b.length; c < d; c++)
13138          b[c].traverse(a)
13139      },
13140      traverseVisible: function (a) {
13141        if (this.visible !== !1) {
13142          a(this)
13143          for (var b = this.children, c = 0, d = b.length; c < d; c++)
13144            b[c].traverseVisible(a)
13145        }
13146      },
13147      traverseAncestors: function (a) {
13148        var b = this.parent
13149        null !== b && (a(b), b.traverseAncestors(a))
13150      },
13151      updateMatrix: function () {
13152        this.matrix.compose(this.position, this.quaternion, this.scale),
13153          (this.matrixWorldNeedsUpdate = !0)
13154      },
13155      updateMatrixWorld: function (a) {
13156        this.matrixAutoUpdate === !0 && this.updateMatrix(),
13157          (this.matrixWorldNeedsUpdate !== !0 && a !== !0) ||
13158            (null === this.parent
13159              ? this.matrixWorld.copy(this.matrix)
13160              : this.matrixWorld.multiplyMatrices(
13161                  this.parent.matrixWorld,
13162                  this.matrix
13163                ),
13164            (this.matrixWorldNeedsUpdate = !1),
13165            (a = !0))
13166        for (var b = this.children, c = 0, d = b.length; c < d; c++)
13167          b[c].updateMatrixWorld(a)
13168      },
13169      toJSON: function (a) {
13170        function j(a) {
13171          var b = []
13172          for (var c in a) {
13173            var d = a[c]
13174            delete d.metadata, b.push(d)
13175          }
13176          return b
13177        }
13178        var b = void 0 === a || '' === a,
13179          c = {}
13180        b &&
13181          ((a = { geometries: {}, materials: {}, textures: {}, images: {} }),
13182          (c.metadata = {
13183            version: 4.4,
13184            type: 'Object',
13185            generator: 'Object3D.toJSON'
13186          }))
13187        var d = {}
13188        if (
13189          ((d.uuid = this.uuid),
13190          (d.type = this.type),
13191          '' !== this.name && (d.name = this.name),
13192          '{}' !== JSON.stringify(this.userData) &&
13193            (d.userData = this.userData),
13194          this.castShadow === !0 && (d.castShadow = !0),
13195          this.receiveShadow === !0 && (d.receiveShadow = !0),
13196          this.visible === !1 && (d.visible = !1),
13197          (d.matrix = this.matrix.toArray()),
13198          void 0 !== this.geometry &&
13199            (void 0 === a.geometries[this.geometry.uuid] &&
13200              (a.geometries[this.geometry.uuid] = this.geometry.toJSON(a)),
13201            (d.geometry = this.geometry.uuid)),
13202          void 0 !== this.material &&
13203            (void 0 === a.materials[this.material.uuid] &&
13204              (a.materials[this.material.uuid] = this.material.toJSON(a)),
13205            (d.material = this.material.uuid)),
13206          this.children.length > 0)
13207        ) {
13208          d.children = []
13209          for (var e = 0; e < this.children.length; e++)
13210            d.children.push(this.children[e].toJSON(a).object)
13211        }
13212        if (b) {
13213          var f = j(a.geometries),
13214            g = j(a.materials),
13215            h = j(a.textures),
13216            i = j(a.images)
13217          f.length > 0 && (c.geometries = f),
13218            g.length > 0 && (c.materials = g),
13219            h.length > 0 && (c.textures = h),
13220            i.length > 0 && (c.images = i)
13221        }
13222        return (c.object = d), c
13223      },
13224      clone: function (a) {
13225        return new this.constructor().copy(this, a)
13226      },
13227      copy: function (a, b) {
13228        if (
13229          (void 0 === b && (b = !0),
13230          (this.name = a.name),
13231          this.up.copy(a.up),
13232          this.position.copy(a.position),
13233          this.quaternion.copy(a.quaternion),
13234          this.scale.copy(a.scale),
13235          this.matrix.copy(a.matrix),
13236          this.matrixWorld.copy(a.matrixWorld),
13237          (this.matrixAutoUpdate = a.matrixAutoUpdate),
13238          (this.matrixWorldNeedsUpdate = a.matrixWorldNeedsUpdate),
13239          (this.layers.mask = a.layers.mask),
13240          (this.visible = a.visible),
13241          (this.castShadow = a.castShadow),
13242          (this.receiveShadow = a.receiveShadow),
13243          (this.frustumCulled = a.frustumCulled),
13244          (this.renderOrder = a.renderOrder),
13245          (this.userData = JSON.parse(JSON.stringify(a.userData))),
13246          b === !0)
13247        )
13248          for (var c = 0; c < a.children.length; c++) {
13249            var d = a.children[c]
13250            this.add(d.clone())
13251          }
13252        return this
13253      }
13254    }),
13255    Object.assign(Ne.prototype, b.prototype),
13256    (Oe.prototype = {
13257      constructor: Oe,
13258      set: function (a, b) {
13259        return this.start.copy(a), this.end.copy(b), this
13260      },
13261      clone: function () {
13262        return new this.constructor().copy(this)
13263      },
13264      copy: function (a) {
13265        return this.start.copy(a.start), this.end.copy(a.end), this
13266      },
13267      getCenter: function (a) {
13268        var b = a || new Bb()
13269        return b.addVectors(this.start, this.end).multiplyScalar(0.5)
13270      },
13271      delta: function (a) {
13272        var b = a || new Bb()
13273        return b.subVectors(this.end, this.start)
13274      },
13275      distanceSq: function () {
13276        return this.start.distanceToSquared(this.end)
13277      },
13278      distance: function () {
13279        return this.start.distanceTo(this.end)
13280      },
13281      at: function (a, b) {
13282        var c = b || new Bb()
13283        return this.delta(c).multiplyScalar(a).add(this.start)
13284      },
13285      closestPointToPointParameter: (function () {
13286        var a = new Bb(),
13287          b = new Bb()
13288        return function (d, e) {
13289          a.subVectors(d, this.start), b.subVectors(this.end, this.start)
13290          var f = b.dot(b),
13291            g = b.dot(a),
13292            h = g / f
13293          return e && (h = tb.clamp(h, 0, 1)), h
13294        }
13295      })(),
13296      closestPointToPoint: function (a, b, c) {
13297        var d = this.closestPointToPointParameter(a, b),
13298          e = c || new Bb()
13299        return this.delta(e).multiplyScalar(d).add(this.start)
13300      },
13301      applyMatrix4: function (a) {
13302        return this.start.applyMatrix4(a), this.end.applyMatrix4(a), this
13303      },
13304      equals: function (a) {
13305        return a.start.equals(this.start) && a.end.equals(this.end)
13306      }
13307    }),
13308    (Pe.normal = (function () {
13309      var a = new Bb()
13310      return function (c, d, e, f) {
13311        var g = f || new Bb()
13312        g.subVectors(e, d), a.subVectors(c, d), g.cross(a)
13313        var h = g.lengthSq()
13314        return h > 0 ? g.multiplyScalar(1 / Math.sqrt(h)) : g.set(0, 0, 0)
13315      }
13316    })()),
13317    (Pe.barycoordFromPoint = (function () {
13318      var a = new Bb(),
13319        b = new Bb(),
13320        c = new Bb()
13321      return function (e, f, g, h, i) {
13322        a.subVectors(h, f), b.subVectors(g, f), c.subVectors(e, f)
13323        var j = a.dot(a),
13324          k = a.dot(b),
13325          l = a.dot(c),
13326          m = b.dot(b),
13327          n = b.dot(c),
13328          o = j * m - k * k,
13329          p = i || new Bb()
13330        if (0 === o) return p.set(-2, -1, -1)
13331        var q = 1 / o,
13332          r = (m * l - k * n) * q,
13333          s = (j * n - k * l) * q
13334        return p.set(1 - r - s, s, r)
13335      }
13336    })()),
13337    (Pe.containsPoint = (function () {
13338      var a = new Bb()
13339      return function (c, d, e, f) {
13340        var g = Pe.barycoordFromPoint(c, d, e, f, a)
13341        return g.x >= 0 && g.y >= 0 && g.x + g.y <= 1
13342      }
13343    })()),
13344    (Pe.prototype = {
13345      constructor: Pe,
13346      set: function (a, b, c) {
13347        return this.a.copy(a), this.b.copy(b), this.c.copy(c), this
13348      },
13349      setFromPointsAndIndices: function (a, b, c, d) {
13350        return this.a.copy(a[b]), this.b.copy(a[c]), this.c.copy(a[d]), this
13351      },
13352      clone: function () {
13353        return new this.constructor().copy(this)
13354      },
13355      copy: function (a) {
13356        return this.a.copy(a.a), this.b.copy(a.b), this.c.copy(a.c), this
13357      },
13358      area: (function () {
13359        var a = new Bb(),
13360          b = new Bb()
13361        return function () {
13362          return (
13363            a.subVectors(this.c, this.b),
13364            b.subVectors(this.a, this.b),
13365            0.5 * a.cross(b).length()
13366          )
13367        }
13368      })(),
13369      midpoint: function (a) {
13370        var b = a || new Bb()
13371        return b
13372          .addVectors(this.a, this.b)
13373          .add(this.c)
13374          .multiplyScalar(1 / 3)
13375      },
13376      normal: function (a) {
13377        return Pe.normal(this.a, this.b, this.c, a)
13378      },
13379      plane: function (a) {
13380        var b = a || new Ge()
13381        return b.setFromCoplanarPoints(this.a, this.b, this.c)
13382      },
13383      barycoordFromPoint: function (a, b) {
13384        return Pe.barycoordFromPoint(a, this.a, this.b, this.c, b)
13385      },
13386      containsPoint: function (a) {
13387        return Pe.containsPoint(a, this.a, this.b, this.c)
13388      },
13389      closestPointToPoint: (function () {
13390        var a, b, c, d
13391        return function (f, g) {
13392          void 0 === a &&
13393            ((a = new Ge()),
13394            (b = [new Oe(), new Oe(), new Oe()]),
13395            (c = new Bb()),
13396            (d = new Bb()))
13397          var h = g || new Bb(),
13398            i = 1 / 0
13399          if (
13400            (a.setFromCoplanarPoints(this.a, this.b, this.c),
13401            a.projectPoint(f, c),
13402            this.containsPoint(c) === !0)
13403          )
13404            h.copy(c)
13405          else {
13406            b[0].set(this.a, this.b),
13407              b[1].set(this.b, this.c),
13408              b[2].set(this.c, this.a)
13409            for (var j = 0; j < b.length; j++) {
13410              b[j].closestPointToPoint(c, !0, d)
13411              var k = c.distanceToSquared(d)
13412              k < i && ((i = k), h.copy(d))
13413            }
13414          }
13415          return h
13416        }
13417      })(),
13418      equals: function (a) {
13419        return a.a.equals(this.a) && a.b.equals(this.b) && a.c.equals(this.c)
13420      }
13421    }),
13422    (Qe.prototype = {
13423      constructor: Qe,
13424      clone: function () {
13425        return new this.constructor().copy(this)
13426      },
13427      copy: function (a) {
13428        ;(this.a = a.a),
13429          (this.b = a.b),
13430          (this.c = a.c),
13431          this.normal.copy(a.normal),
13432          this.color.copy(a.color),
13433          (this.materialIndex = a.materialIndex)
13434        for (var b = 0, c = a.vertexNormals.length; b < c; b++)
13435          this.vertexNormals[b] = a.vertexNormals[b].clone()
13436        for (var b = 0, c = a.vertexColors.length; b < c; b++)
13437          this.vertexColors[b] = a.vertexColors[b].clone()
13438        return this
13439      }
13440    }),
13441    (Re.prototype = Object.create(Ae.prototype)),
13442    (Re.prototype.constructor = Re),
13443    (Re.prototype.isMeshBasicMaterial = !0),
13444    (Re.prototype.copy = function (a) {
13445      return (
13446        Ae.prototype.copy.call(this, a),
13447        this.color.copy(a.color),
13448        (this.map = a.map),
13449        (this.lightMap = a.lightMap),
13450        (this.lightMapIntensity = a.lightMapIntensity),
13451        (this.aoMap = a.aoMap),
13452        (this.aoMapIntensity = a.aoMapIntensity),
13453        (this.specularMap = a.specularMap),
13454        (this.alphaMap = a.alphaMap),
13455        (this.envMap = a.envMap),
13456        (this.combine = a.combine),
13457        (this.reflectivity = a.reflectivity),
13458        (this.refractionRatio = a.refractionRatio),
13459        (this.wireframe = a.wireframe),
13460        (this.wireframeLinewidth = a.wireframeLinewidth),
13461        (this.wireframeLinecap = a.wireframeLinecap),
13462        (this.wireframeLinejoin = a.wireframeLinejoin),
13463        (this.skinning = a.skinning),
13464        (this.morphTargets = a.morphTargets),
13465        this
13466      )
13467    }),
13468    (Se.prototype = {
13469      constructor: Se,
13470      isBufferAttribute: !0,
13471      set needsUpdate(a) {
13472        a === !0 && this.version++
13473      },
13474      setArray: function (a) {
13475        if (Array.isArray(a))
13476          throw new TypeError(
13477            'THREE.BufferAttribute: array should be a Typed Array.'
13478          )
13479        ;(this.count = void 0 !== a ? a.length / this.itemSize : 0),
13480          (this.array = a)
13481      },
13482      setDynamic: function (a) {
13483        return (this.dynamic = a), this
13484      },
13485      copy: function (a) {
13486        return (
13487          (this.array = new a.array.constructor(a.array)),
13488          (this.itemSize = a.itemSize),
13489          (this.count = a.count),
13490          (this.normalized = a.normalized),
13491          (this.dynamic = a.dynamic),
13492          this
13493        )
13494      },
13495      copyAt: function (a, b, c) {
13496        ;(a *= this.itemSize), (c *= b.itemSize)
13497        for (var d = 0, e = this.itemSize; d < e; d++)
13498          this.array[a + d] = b.array[c + d]
13499        return this
13500      },
13501      copyArray: function (a) {
13502        return this.array.set(a), this
13503      },
13504      copyColorsArray: function (a) {
13505        for (var b = this.array, c = 0, d = 0, e = a.length; d < e; d++) {
13506          var f = a[d]
13507          void 0 === f &&
13508            (console.warn(
13509              'THREE.BufferAttribute.copyColorsArray(): color is undefined',
13510              d
13511            ),
13512            (f = new re())),
13513            (b[c++] = f.r),
13514            (b[c++] = f.g),
13515            (b[c++] = f.b)
13516        }
13517        return this
13518      },
13519      copyIndicesArray: function (a) {
13520        for (var b = this.array, c = 0, d = 0, e = a.length; d < e; d++) {
13521          var f = a[d]
13522          ;(b[c++] = f.a), (b[c++] = f.b), (b[c++] = f.c)
13523        }
13524        return this
13525      },
13526      copyVector2sArray: function (a) {
13527        for (var b = this.array, c = 0, d = 0, e = a.length; d < e; d++) {
13528          var f = a[d]
13529          void 0 === f &&
13530            (console.warn(
13531              'THREE.BufferAttribute.copyVector2sArray(): vector is undefined',
13532              d
13533            ),
13534            (f = new ub())),
13535            (b[c++] = f.x),
13536            (b[c++] = f.y)
13537        }
13538        return this
13539      },
13540      copyVector3sArray: function (a) {
13541        for (var b = this.array, c = 0, d = 0, e = a.length; d < e; d++) {
13542          var f = a[d]
13543          void 0 === f &&
13544            (console.warn(
13545              'THREE.BufferAttribute.copyVector3sArray(): vector is undefined',
13546              d
13547            ),
13548            (f = new Bb())),
13549            (b[c++] = f.x),
13550            (b[c++] = f.y),
13551            (b[c++] = f.z)
13552        }
13553        return this
13554      },
13555      copyVector4sArray: function (a) {
13556        for (var b = this.array, c = 0, d = 0, e = a.length; d < e; d++) {
13557          var f = a[d]
13558          void 0 === f &&
13559            (console.warn(
13560              'THREE.BufferAttribute.copyVector4sArray(): vector is undefined',
13561              d
13562            ),
13563            (f = new xb())),
13564            (b[c++] = f.x),
13565            (b[c++] = f.y),
13566            (b[c++] = f.z),
13567            (b[c++] = f.w)
13568        }
13569        return this
13570      },
13571      set: function (a, b) {
13572        return void 0 === b && (b = 0), this.array.set(a, b), this
13573      },
13574      getX: function (a) {
13575        return this.array[a * this.itemSize]
13576      },
13577      setX: function (a, b) {
13578        return (this.array[a * this.itemSize] = b), this
13579      },
13580      getY: function (a) {
13581        return this.array[a * this.itemSize + 1]
13582      },
13583      setY: function (a, b) {
13584        return (this.array[a * this.itemSize + 1] = b), this
13585      },
13586      getZ: function (a) {
13587        return this.array[a * this.itemSize + 2]
13588      },
13589      setZ: function (a, b) {
13590        return (this.array[a * this.itemSize + 2] = b), this
13591      },
13592      getW: function (a) {
13593        return this.array[a * this.itemSize + 3]
13594      },
13595      setW: function (a, b) {
13596        return (this.array[a * this.itemSize + 3] = b), this
13597      },
13598      setXY: function (a, b, c) {
13599        return (
13600          (a *= this.itemSize),
13601          (this.array[a + 0] = b),
13602          (this.array[a + 1] = c),
13603          this
13604        )
13605      },
13606      setXYZ: function (a, b, c, d) {
13607        return (
13608          (a *= this.itemSize),
13609          (this.array[a + 0] = b),
13610          (this.array[a + 1] = c),
13611          (this.array[a + 2] = d),
13612          this
13613        )
13614      },
13615      setXYZW: function (a, b, c, d, e) {
13616        return (
13617          (a *= this.itemSize),
13618          (this.array[a + 0] = b),
13619          (this.array[a + 1] = c),
13620          (this.array[a + 2] = d),
13621          (this.array[a + 3] = e),
13622          this
13623        )
13624      },
13625      onUpload: function (a) {
13626        return (this.onUploadCallback = a), this
13627      },
13628      clone: function () {
13629        return new this.constructor(this.array, this.itemSize).copy(this)
13630      }
13631    }),
13632    (Te.prototype = Object.create(Se.prototype)),
13633    (Te.prototype.constructor = Te),
13634    (Ue.prototype = Object.create(Se.prototype)),
13635    (Ue.prototype.constructor = Ue),
13636    (Ve.prototype = Object.create(Se.prototype)),
13637    (Ve.prototype.constructor = Ve),
13638    (We.prototype = Object.create(Se.prototype)),
13639    (We.prototype.constructor = We),
13640    (Xe.prototype = Object.create(Se.prototype)),
13641    (Xe.prototype.constructor = Xe),
13642    (Ye.prototype = Object.create(Se.prototype)),
13643    (Ye.prototype.constructor = Ye),
13644    (Ze.prototype = Object.create(Se.prototype)),
13645    (Ze.prototype.constructor = Ze),
13646    ($e.prototype = Object.create(Se.prototype)),
13647    ($e.prototype.constructor = $e),
13648    (_e.prototype = Object.create(Se.prototype)),
13649    (_e.prototype.constructor = _e),
13650    Object.assign(af.prototype, {
13651      computeGroups: function (a) {
13652        for (var b, c = [], d = void 0, e = a.faces, f = 0; f < e.length; f++) {
13653          var g = e[f]
13654          g.materialIndex !== d &&
13655            ((d = g.materialIndex),
13656            void 0 !== b && ((b.count = 3 * f - b.start), c.push(b)),
13657            (b = { start: 3 * f, materialIndex: d }))
13658        }
13659        void 0 !== b && ((b.count = 3 * f - b.start), c.push(b)),
13660          (this.groups = c)
13661      },
13662      fromGeometry: function (a) {
13663        var i,
13664          b = a.faces,
13665          c = a.vertices,
13666          d = a.faceVertexUvs,
13667          e = d[0] && d[0].length > 0,
13668          f = d[1] && d[1].length > 0,
13669          g = a.morphTargets,
13670          h = g.length
13671        if (h > 0) {
13672          i = []
13673          for (var j = 0; j < h; j++) i[j] = []
13674          this.morphTargets.position = i
13675        }
13676        var m,
13677          k = a.morphNormals,
13678          l = k.length
13679        if (l > 0) {
13680          m = []
13681          for (var j = 0; j < l; j++) m[j] = []
13682          this.morphTargets.normal = m
13683        }
13684        for (
13685          var n = a.skinIndices,
13686            o = a.skinWeights,
13687            p = n.length === c.length,
13688            q = o.length === c.length,
13689            j = 0;
13690          j < b.length;
13691          j++
13692        ) {
13693          var r = b[j]
13694          this.vertices.push(c[r.a], c[r.b], c[r.c])
13695          var s = r.vertexNormals
13696          if (3 === s.length) this.normals.push(s[0], s[1], s[2])
13697          else {
13698            var t = r.normal
13699            this.normals.push(t, t, t)
13700          }
13701          var u = r.vertexColors
13702          if (3 === u.length) this.colors.push(u[0], u[1], u[2])
13703          else {
13704            var v = r.color
13705            this.colors.push(v, v, v)
13706          }
13707          if (e === !0) {
13708            var w = d[0][j]
13709            void 0 !== w
13710              ? this.uvs.push(w[0], w[1], w[2])
13711              : (console.warn(
13712                  'THREE.DirectGeometry.fromGeometry(): Undefined vertexUv ',
13713                  j
13714                ),
13715                this.uvs.push(new ub(), new ub(), new ub()))
13716          }
13717          if (f === !0) {
13718            var w = d[1][j]
13719            void 0 !== w
13720              ? this.uvs2.push(w[0], w[1], w[2])
13721              : (console.warn(
13722                  'THREE.DirectGeometry.fromGeometry(): Undefined vertexUv2 ',
13723                  j
13724                ),
13725                this.uvs2.push(new ub(), new ub(), new ub()))
13726          }
13727          for (var x = 0; x < h; x++) {
13728            var y = g[x].vertices
13729            i[x].push(y[r.a], y[r.b], y[r.c])
13730          }
13731          for (var x = 0; x < l; x++) {
13732            var z = k[x].vertexNormals[j]
13733            m[x].push(z.a, z.b, z.c)
13734          }
13735          p && this.skinIndices.push(n[r.a], n[r.b], n[r.c]),
13736            q && this.skinWeights.push(o[r.a], o[r.b], o[r.c])
13737        }
13738        return (
13739          this.computeGroups(a),
13740          (this.verticesNeedUpdate = a.verticesNeedUpdate),
13741          (this.normalsNeedUpdate = a.normalsNeedUpdate),
13742          (this.colorsNeedUpdate = a.colorsNeedUpdate),
13743          (this.uvsNeedUpdate = a.uvsNeedUpdate),
13744          (this.groupsNeedUpdate = a.groupsNeedUpdate),
13745          this
13746        )
13747      }
13748    })
13749  var cf = 0
13750  ;(ef.prototype = {
13751    constructor: ef,
13752    isGeometry: !0,
13753    applyMatrix: function (a) {
13754      for (
13755        var b = new Fe().getNormalMatrix(a), c = 0, d = this.vertices.length;
13756        c < d;
13757        c++
13758      ) {
13759        var e = this.vertices[c]
13760        e.applyMatrix4(a)
13761      }
13762      for (var c = 0, d = this.faces.length; c < d; c++) {
13763        var f = this.faces[c]
13764        f.normal.applyMatrix3(b).normalize()
13765        for (var g = 0, h = f.vertexNormals.length; g < h; g++)
13766          f.vertexNormals[g].applyMatrix3(b).normalize()
13767      }
13768      return (
13769        null !== this.boundingBox && this.computeBoundingBox(),
13770        null !== this.boundingSphere && this.computeBoundingSphere(),
13771        (this.verticesNeedUpdate = !0),
13772        (this.normalsNeedUpdate = !0),
13773        this
13774      )
13775    },
13776    rotateX: (function () {
13777      var a
13778      return function (c) {
13779        return (
13780          void 0 === a && (a = new Cb()),
13781          a.makeRotationX(c),
13782          this.applyMatrix(a),
13783          this
13784        )
13785      }
13786    })(),
13787    rotateY: (function () {
13788      var a
13789      return function (c) {
13790        return (
13791          void 0 === a && (a = new Cb()),
13792          a.makeRotationY(c),
13793          this.applyMatrix(a),
13794          this
13795        )
13796      }
13797    })(),
13798    rotateZ: (function () {
13799      var a
13800      return function (c) {
13801        return (
13802          void 0 === a && (a = new Cb()),
13803          a.makeRotationZ(c),
13804          this.applyMatrix(a),
13805          this
13806        )
13807      }
13808    })(),
13809    translate: (function () {
13810      var a
13811      return function (c, d, e) {
13812        return (
13813          void 0 === a && (a = new Cb()),
13814          a.makeTranslation(c, d, e),
13815          this.applyMatrix(a),
13816          this
13817        )
13818      }
13819    })(),
13820    scale: (function () {
13821      var a
13822      return function (c, d, e) {
13823        return (
13824          void 0 === a && (a = new Cb()),
13825          a.makeScale(c, d, e),
13826          this.applyMatrix(a),
13827          this
13828        )
13829      }
13830    })(),
13831    lookAt: (function () {
13832      var a
13833      return function (c) {
13834        void 0 === a && (a = new Ne()),
13835          a.lookAt(c),
13836          a.updateMatrix(),
13837          this.applyMatrix(a.matrix)
13838      }
13839    })(),
13840    fromBufferGeometry: function (a) {
13841      function o(a, c, d, e) {
13842        var m = void 0 !== f ? [j[a].clone(), j[c].clone(), j[d].clone()] : [],
13843          n =
13844            void 0 !== g
13845              ? [b.colors[a].clone(), b.colors[c].clone(), b.colors[d].clone()]
13846              : [],
13847          o = new Qe(a, c, d, m, n, e)
13848        b.faces.push(o),
13849          void 0 !== h &&
13850            b.faceVertexUvs[0].push([k[a].clone(), k[c].clone(), k[d].clone()]),
13851          void 0 !== i &&
13852            b.faceVertexUvs[1].push([l[a].clone(), l[c].clone(), l[d].clone()])
13853      }
13854      var b = this,
13855        c = null !== a.index ? a.index.array : void 0,
13856        d = a.attributes,
13857        e = d.position.array,
13858        f = void 0 !== d.normal ? d.normal.array : void 0,
13859        g = void 0 !== d.color ? d.color.array : void 0,
13860        h = void 0 !== d.uv ? d.uv.array : void 0,
13861        i = void 0 !== d.uv2 ? d.uv2.array : void 0
13862      void 0 !== i && (this.faceVertexUvs[1] = [])
13863      for (
13864        var j = [], k = [], l = [], m = 0, n = 0;
13865        m < e.length;
13866        m += 3, n += 2
13867      )
13868        b.vertices.push(new Bb(e[m], e[m + 1], e[m + 2])),
13869          void 0 !== f && j.push(new Bb(f[m], f[m + 1], f[m + 2])),
13870          void 0 !== g && b.colors.push(new re(g[m], g[m + 1], g[m + 2])),
13871          void 0 !== h && k.push(new ub(h[n], h[n + 1])),
13872          void 0 !== i && l.push(new ub(i[n], i[n + 1]))
13873      if (void 0 !== c) {
13874        var p = a.groups
13875        if (p.length > 0)
13876          for (var m = 0; m < p.length; m++)
13877            for (
13878              var q = p[m], r = q.start, s = q.count, n = r, t = r + s;
13879              n < t;
13880              n += 3
13881            )
13882              o(c[n], c[n + 1], c[n + 2], q.materialIndex)
13883        else for (var m = 0; m < c.length; m += 3) o(c[m], c[m + 1], c[m + 2])
13884      } else for (var m = 0; m < e.length / 3; m += 3) o(m, m + 1, m + 2)
13885      return (
13886        this.computeFaceNormals(),
13887        null !== a.boundingBox && (this.boundingBox = a.boundingBox.clone()),
13888        null !== a.boundingSphere &&
13889          (this.boundingSphere = a.boundingSphere.clone()),
13890        this
13891      )
13892    },
13893    center: function () {
13894      this.computeBoundingBox()
13895      var a = this.boundingBox.getCenter().negate()
13896      return this.translate(a.x, a.y, a.z), a
13897    },
13898    normalize: function () {
13899      this.computeBoundingSphere()
13900      var a = this.boundingSphere.center,
13901        b = this.boundingSphere.radius,
13902        c = 0 === b ? 1 : 1 / b,
13903        d = new Cb()
13904      return (
13905        d.set(
13906          c,
13907          0,
13908          0,
13909          -c * a.x,
13910          0,
13911          c,
13912          0,
13913          -c * a.y,
13914          0,
13915          0,
13916          c,
13917          -c * a.z,
13918          0,
13919          0,
13920          0,
13921          1
13922        ),
13923        this.applyMatrix(d),
13924        this
13925      )
13926    },
13927    computeFaceNormals: function () {
13928      for (
13929        var a = new Bb(), b = new Bb(), c = 0, d = this.faces.length;
13930        c < d;
13931        c++
13932      ) {
13933        var e = this.faces[c],
13934          f = this.vertices[e.a],
13935          g = this.vertices[e.b],
13936          h = this.vertices[e.c]
13937        a.subVectors(h, g),
13938          b.subVectors(f, g),
13939          a.cross(b),
13940          a.normalize(),
13941          e.normal.copy(a)
13942      }
13943    },
13944    computeVertexNormals: function (a) {
13945      void 0 === a && (a = !0)
13946      var b, c, d, e, f, g
13947      for (
13948        g = new Array(this.vertices.length), b = 0, c = this.vertices.length;
13949        b < c;
13950        b++
13951      )
13952        g[b] = new Bb()
13953      if (a) {
13954        var h,
13955          i,
13956          j,
13957          k = new Bb(),
13958          l = new Bb()
13959        for (d = 0, e = this.faces.length; d < e; d++)
13960          (f = this.faces[d]),
13961            (h = this.vertices[f.a]),
13962            (i = this.vertices[f.b]),
13963            (j = this.vertices[f.c]),
13964            k.subVectors(j, i),
13965            l.subVectors(h, i),
13966            k.cross(l),
13967            g[f.a].add(k),
13968            g[f.b].add(k),
13969            g[f.c].add(k)
13970      } else
13971        for (
13972          this.computeFaceNormals(), d = 0, e = this.faces.length;
13973          d < e;
13974          d++
13975        )
13976          (f = this.faces[d]),
13977            g[f.a].add(f.normal),
13978            g[f.b].add(f.normal),
13979            g[f.c].add(f.normal)
13980      for (b = 0, c = this.vertices.length; b < c; b++) g[b].normalize()
13981      for (d = 0, e = this.faces.length; d < e; d++) {
13982        f = this.faces[d]
13983        var m = f.vertexNormals
13984        3 === m.length
13985          ? (m[0].copy(g[f.a]), m[1].copy(g[f.b]), m[2].copy(g[f.c]))
13986          : ((m[0] = g[f.a].clone()),
13987            (m[1] = g[f.b].clone()),
13988            (m[2] = g[f.c].clone()))
13989      }
13990      this.faces.length > 0 && (this.normalsNeedUpdate = !0)
13991    },
13992    computeFlatVertexNormals: function () {
13993      var a, b, c
13994      for (
13995        this.computeFaceNormals(), a = 0, b = this.faces.length;
13996        a < b;
13997        a++
13998      ) {
13999        c = this.faces[a]
14000        var d = c.vertexNormals
14001        3 === d.length
14002          ? (d[0].copy(c.normal), d[1].copy(c.normal), d[2].copy(c.normal))
14003          : ((d[0] = c.normal.clone()),
14004            (d[1] = c.normal.clone()),
14005            (d[2] = c.normal.clone()))
14006      }
14007      this.faces.length > 0 && (this.normalsNeedUpdate = !0)
14008    },
14009    computeMorphNormals: function () {
14010      var a, b, c, d, e
14011      for (c = 0, d = this.faces.length; c < d; c++)
14012        for (
14013          e = this.faces[c],
14014            e.__originalFaceNormal
14015              ? e.__originalFaceNormal.copy(e.normal)
14016              : (e.__originalFaceNormal = e.normal.clone()),
14017            e.__originalVertexNormals || (e.__originalVertexNormals = []),
14018            a = 0,
14019            b = e.vertexNormals.length;
14020          a < b;
14021          a++
14022        )
14023          e.__originalVertexNormals[a]
14024            ? e.__originalVertexNormals[a].copy(e.vertexNormals[a])
14025            : (e.__originalVertexNormals[a] = e.vertexNormals[a].clone())
14026      var f = new ef()
14027      for (
14028        f.faces = this.faces, a = 0, b = this.morphTargets.length;
14029        a < b;
14030        a++
14031      ) {
14032        if (!this.morphNormals[a]) {
14033          ;(this.morphNormals[a] = {}),
14034            (this.morphNormals[a].faceNormals = []),
14035            (this.morphNormals[a].vertexNormals = [])
14036          var i,
14037            j,
14038            g = this.morphNormals[a].faceNormals,
14039            h = this.morphNormals[a].vertexNormals
14040          for (c = 0, d = this.faces.length; c < d; c++)
14041            (i = new Bb()),
14042              (j = { a: new Bb(), b: new Bb(), c: new Bb() }),
14043              g.push(i),
14044              h.push(j)
14045        }
14046        var k = this.morphNormals[a]
14047        ;(f.vertices = this.morphTargets[a].vertices),
14048          f.computeFaceNormals(),
14049          f.computeVertexNormals()
14050        var i, j
14051        for (c = 0, d = this.faces.length; c < d; c++)
14052          (e = this.faces[c]),
14053            (i = k.faceNormals[c]),
14054            (j = k.vertexNormals[c]),
14055            i.copy(e.normal),
14056            j.a.copy(e.vertexNormals[0]),
14057            j.b.copy(e.vertexNormals[1]),
14058            j.c.copy(e.vertexNormals[2])
14059      }
14060      for (c = 0, d = this.faces.length; c < d; c++)
14061        (e = this.faces[c]),
14062          (e.normal = e.__originalFaceNormal),
14063          (e.vertexNormals = e.__originalVertexNormals)
14064    },
14065    computeLineDistances: function () {
14066      for (var a = 0, b = this.vertices, c = 0, d = b.length; c < d; c++)
14067        c > 0 && (a += b[c].distanceTo(b[c - 1])), (this.lineDistances[c] = a)
14068    },
14069    computeBoundingBox: function () {
14070      null === this.boundingBox && (this.boundingBox = new De()),
14071        this.boundingBox.setFromPoints(this.vertices)
14072    },
14073    computeBoundingSphere: function () {
14074      null === this.boundingSphere && (this.boundingSphere = new Ee()),
14075        this.boundingSphere.setFromPoints(this.vertices)
14076    },
14077    merge: function (a, b, c) {
14078      if ((a && a.isGeometry) === !1)
14079        return void console.error(
14080          'THREE.Geometry.merge(): geometry not an instance of THREE.Geometry.',
14081          a
14082        )
14083      var d,
14084        e = this.vertices.length,
14085        f = this.vertices,
14086        g = a.vertices,
14087        h = this.faces,
14088        i = a.faces,
14089        j = this.faceVertexUvs[0],
14090        k = a.faceVertexUvs[0],
14091        l = this.colors,
14092        m = a.colors
14093      void 0 === c && (c = 0), void 0 !== b && (d = new Fe().getNormalMatrix(b))
14094      for (var n = 0, o = g.length; n < o; n++) {
14095        var p = g[n],
14096          q = p.clone()
14097        void 0 !== b && q.applyMatrix4(b), f.push(q)
14098      }
14099      for (var n = 0, o = m.length; n < o; n++) l.push(m[n].clone())
14100      for (n = 0, o = i.length; n < o; n++) {
14101        var s,
14102          t,
14103          u,
14104          r = i[n],
14105          v = r.vertexNormals,
14106          w = r.vertexColors
14107        ;(s = new Qe(r.a + e, r.b + e, r.c + e)),
14108          s.normal.copy(r.normal),
14109          void 0 !== d && s.normal.applyMatrix3(d).normalize()
14110        for (var x = 0, y = v.length; x < y; x++)
14111          (t = v[x].clone()),
14112            void 0 !== d && t.applyMatrix3(d).normalize(),
14113            s.vertexNormals.push(t)
14114        s.color.copy(r.color)
14115        for (var x = 0, y = w.length; x < y; x++)
14116          (u = w[x]), s.vertexColors.push(u.clone())
14117        ;(s.materialIndex = r.materialIndex + c), h.push(s)
14118      }
14119      for (n = 0, o = k.length; n < o; n++) {
14120        var z = k[n],
14121          A = []
14122        if (void 0 !== z) {
14123          for (var x = 0, y = z.length; x < y; x++) A.push(z[x].clone())
14124          j.push(A)
14125        }
14126      }
14127    },
14128    mergeMesh: function (a) {
14129      return (a && a.isMesh) === !1
14130        ? void console.error(
14131            'THREE.Geometry.mergeMesh(): mesh not an instance of THREE.Mesh.',
14132            a
14133          )
14134        : (a.matrixAutoUpdate && a.updateMatrix(),
14135          void this.merge(a.geometry, a.matrix))
14136    },
14137    mergeVertices: function () {
14138      var d,
14139        e,
14140        h,
14141        i,
14142        j,
14143        k,
14144        l,
14145        m,
14146        a = {},
14147        b = [],
14148        c = [],
14149        f = 4,
14150        g = Math.pow(10, f)
14151      for (h = 0, i = this.vertices.length; h < i; h++)
14152        (d = this.vertices[h]),
14153          (e =
14154            Math.round(d.x * g) +
14155            '_' +
14156            Math.round(d.y * g) +
14157            '_' +
14158            Math.round(d.z * g)),
14159          void 0 === a[e]
14160            ? ((a[e] = h), b.push(this.vertices[h]), (c[h] = b.length - 1))
14161            : (c[h] = c[a[e]])
14162      var n = []
14163      for (h = 0, i = this.faces.length; h < i; h++) {
14164        ;(j = this.faces[h]),
14165          (j.a = c[j.a]),
14166          (j.b = c[j.b]),
14167          (j.c = c[j.c]),
14168          (k = [j.a, j.b, j.c])
14169        for (var o = 0; o < 3; o++)
14170          if (k[o] === k[(o + 1) % 3]) {
14171            n.push(h)
14172            break
14173          }
14174      }
14175      for (h = n.length - 1; h >= 0; h--) {
14176        var p = n[h]
14177        for (
14178          this.faces.splice(p, 1), l = 0, m = this.faceVertexUvs.length;
14179          l < m;
14180          l++
14181        )
14182          this.faceVertexUvs[l].splice(p, 1)
14183      }
14184      var q = this.vertices.length - b.length
14185      return (this.vertices = b), q
14186    },
14187    sortFacesByMaterialIndex: function () {
14188      function d(a, b) {
14189        return a.materialIndex - b.materialIndex
14190      }
14191      for (var a = this.faces, b = a.length, c = 0; c < b; c++) a[c]._id = c
14192      a.sort(d)
14193      var g,
14194        h,
14195        e = this.faceVertexUvs[0],
14196        f = this.faceVertexUvs[1]
14197      e && e.length === b && (g = []), f && f.length === b && (h = [])
14198      for (var c = 0; c < b; c++) {
14199        var i = a[c]._id
14200        g && g.push(e[i]), h && h.push(f[i])
14201      }
14202      g && (this.faceVertexUvs[0] = g), h && (this.faceVertexUvs[1] = h)
14203    },
14204    toJSON: function () {
14205      function z(a, b, c) {
14206        return c ? a | (1 << b) : a & ~(1 << b)
14207      }
14208      function A(a) {
14209        var b = a.x.toString() + a.y.toString() + a.z.toString()
14210        return void 0 !== i[b]
14211          ? i[b]
14212          : ((i[b] = h.length / 3), h.push(a.x, a.y, a.z), i[b])
14213      }
14214      function B(a) {
14215        var b = a.r.toString() + a.g.toString() + a.b.toString()
14216        return void 0 !== k[b]
14217          ? k[b]
14218          : ((k[b] = j.length), j.push(a.getHex()), k[b])
14219      }
14220      function C(a) {
14221        var b = a.x.toString() + a.y.toString()
14222        return void 0 !== m[b]
14223          ? m[b]
14224          : ((m[b] = l.length / 2), l.push(a.x, a.y), m[b])
14225      }
14226      var a = {
14227        metadata: {
14228          version: 4.4,
14229          type: 'Geometry',
14230          generator: 'Geometry.toJSON'
14231        }
14232      }
14233      if (
14234        ((a.uuid = this.uuid),
14235        (a.type = this.type),
14236        '' !== this.name && (a.name = this.name),
14237        void 0 !== this.parameters)
14238      ) {
14239        var b = this.parameters
14240        for (var c in b) void 0 !== b[c] && (a[c] = b[c])
14241        return a
14242      }
14243      for (var d = [], e = 0; e < this.vertices.length; e++) {
14244        var f = this.vertices[e]
14245        d.push(f.x, f.y, f.z)
14246      }
14247      for (
14248        var g = [], h = [], i = {}, j = [], k = {}, l = [], m = {}, e = 0;
14249        e < this.faces.length;
14250        e++
14251      ) {
14252        var n = this.faces[e],
14253          o = !0,
14254          p = !1,
14255          q = void 0 !== this.faceVertexUvs[0][e],
14256          r = n.normal.length() > 0,
14257          s = n.vertexNormals.length > 0,
14258          t = 1 !== n.color.r || 1 !== n.color.g || 1 !== n.color.b,
14259          u = n.vertexColors.length > 0,
14260          v = 0
14261        if (
14262          ((v = z(v, 0, 0)),
14263          (v = z(v, 1, o)),
14264          (v = z(v, 2, p)),
14265          (v = z(v, 3, q)),
14266          (v = z(v, 4, r)),
14267          (v = z(v, 5, s)),
14268          (v = z(v, 6, t)),
14269          (v = z(v, 7, u)),
14270          g.push(v),
14271          g.push(n.a, n.b, n.c),
14272          g.push(n.materialIndex),
14273          q)
14274        ) {
14275          var w = this.faceVertexUvs[0][e]
14276          g.push(C(w[0]), C(w[1]), C(w[2]))
14277        }
14278        if ((r && g.push(A(n.normal)), s)) {
14279          var x = n.vertexNormals
14280          g.push(A(x[0]), A(x[1]), A(x[2]))
14281        }
14282        if ((t && g.push(B(n.color)), u)) {
14283          var y = n.vertexColors
14284          g.push(B(y[0]), B(y[1]), B(y[2]))
14285        }
14286      }
14287      return (
14288        (a.data = {}),
14289        (a.data.vertices = d),
14290        (a.data.normals = h),
14291        j.length > 0 && (a.data.colors = j),
14292        l.length > 0 && (a.data.uvs = [l]),
14293        (a.data.faces = g),
14294        a
14295      )
14296    },
14297    clone: function () {
14298      return new ef().copy(this)
14299    },
14300    copy: function (a) {
14301      var b, c, d, e, f, g
14302      ;(this.vertices = []),
14303        (this.colors = []),
14304        (this.faces = []),
14305        (this.faceVertexUvs = [[]]),
14306        (this.morphTargets = []),
14307        (this.morphNormals = []),
14308        (this.skinWeights = []),
14309        (this.skinIndices = []),
14310        (this.lineDistances = []),
14311        (this.boundingBox = null),
14312        (this.boundingSphere = null),
14313        (this.name = a.name)
14314      var h = a.vertices
14315      for (b = 0, c = h.length; b < c; b++) this.vertices.push(h[b].clone())
14316      var i = a.colors
14317      for (b = 0, c = i.length; b < c; b++) this.colors.push(i[b].clone())
14318      var j = a.faces
14319      for (b = 0, c = j.length; b < c; b++) this.faces.push(j[b].clone())
14320      for (b = 0, c = a.faceVertexUvs.length; b < c; b++) {
14321        var k = a.faceVertexUvs[b]
14322        for (
14323          void 0 === this.faceVertexUvs[b] && (this.faceVertexUvs[b] = []),
14324            d = 0,
14325            e = k.length;
14326          d < e;
14327          d++
14328        ) {
14329          var l = k[d],
14330            m = []
14331          for (f = 0, g = l.length; f < g; f++) {
14332            var n = l[f]
14333            m.push(n.clone())
14334          }
14335          this.faceVertexUvs[b].push(m)
14336        }
14337      }
14338      var o = a.morphTargets
14339      for (b = 0, c = o.length; b < c; b++) {
14340        var p = {}
14341        if (((p.name = o[b].name), void 0 !== o[b].vertices))
14342          for (p.vertices = [], d = 0, e = o[b].vertices.length; d < e; d++)
14343            p.vertices.push(o[b].vertices[d].clone())
14344        if (void 0 !== o[b].normals)
14345          for (p.normals = [], d = 0, e = o[b].normals.length; d < e; d++)
14346            p.normals.push(o[b].normals[d].clone())
14347        this.morphTargets.push(p)
14348      }
14349      var q = a.morphNormals
14350      for (b = 0, c = q.length; b < c; b++) {
14351        var r = {}
14352        if (void 0 !== q[b].vertexNormals)
14353          for (
14354            r.vertexNormals = [], d = 0, e = q[b].vertexNormals.length;
14355            d < e;
14356            d++
14357          ) {
14358            var s = q[b].vertexNormals[d],
14359              t = {}
14360            ;(t.a = s.a.clone()),
14361              (t.b = s.b.clone()),
14362              (t.c = s.c.clone()),
14363              r.vertexNormals.push(t)
14364          }
14365        if (void 0 !== q[b].faceNormals)
14366          for (
14367            r.faceNormals = [], d = 0, e = q[b].faceNormals.length;
14368            d < e;
14369            d++
14370          )
14371            r.faceNormals.push(q[b].faceNormals[d].clone())
14372        this.morphNormals.push(r)
14373      }
14374      var u = a.skinWeights
14375      for (b = 0, c = u.length; b < c; b++) this.skinWeights.push(u[b].clone())
14376      var v = a.skinIndices
14377      for (b = 0, c = v.length; b < c; b++) this.skinIndices.push(v[b].clone())
14378      var w = a.lineDistances
14379      for (b = 0, c = w.length; b < c; b++) this.lineDistances.push(w[b])
14380      var x = a.boundingBox
14381      null !== x && (this.boundingBox = x.clone())
14382      var y = a.boundingSphere
14383      return (
14384        null !== y && (this.boundingSphere = y.clone()),
14385        (this.elementsNeedUpdate = a.elementsNeedUpdate),
14386        (this.verticesNeedUpdate = a.verticesNeedUpdate),
14387        (this.uvsNeedUpdate = a.uvsNeedUpdate),
14388        (this.normalsNeedUpdate = a.normalsNeedUpdate),
14389        (this.colorsNeedUpdate = a.colorsNeedUpdate),
14390        (this.lineDistancesNeedUpdate = a.lineDistancesNeedUpdate),
14391        (this.groupsNeedUpdate = a.groupsNeedUpdate),
14392        this
14393      )
14394    },
14395    dispose: function () {
14396      this.dispatchEvent({ type: 'dispose' })
14397    }
14398  }),
14399    Object.assign(ef.prototype, b.prototype),
14400    (ff.prototype = {
14401      constructor: ff,
14402      isBufferGeometry: !0,
14403      getIndex: function () {
14404        return this.index
14405      },
14406      setIndex: function (a) {
14407        Array.isArray(a)
14408          ? (this.index = new (bf(a) > 65535 ? Ze : Xe)(a, 1))
14409          : (this.index = a)
14410      },
14411      addAttribute: function (a, b) {
14412        return (b && b.isBufferAttribute) === !1 &&
14413          (b && b.isInterleavedBufferAttribute) === !1
14414          ? (console.warn(
14415              'THREE.BufferGeometry: .addAttribute() now expects ( name, attribute ).'
14416            ),
14417            void this.addAttribute(a, new Se(arguments[1], arguments[2])))
14418          : 'index' === a
14419          ? (console.warn(
14420              'THREE.BufferGeometry.addAttribute: Use .setIndex() for index attribute.'
14421            ),
14422            void this.setIndex(b))
14423          : ((this.attributes[a] = b), this)
14424      },
14425      getAttribute: function (a) {
14426        return this.attributes[a]
14427      },
14428      removeAttribute: function (a) {
14429        return delete this.attributes[a], this
14430      },
14431      addGroup: function (a, b, c) {
14432        this.groups.push({
14433          start: a,
14434          count: b,
14435          materialIndex: void 0 !== c ? c : 0
14436        })
14437      },
14438      clearGroups: function () {
14439        this.groups = []
14440      },
14441      setDrawRange: function (a, b) {
14442        ;(this.drawRange.start = a), (this.drawRange.count = b)
14443      },
14444      applyMatrix: function (a) {
14445        var b = this.attributes.position
14446        void 0 !== b && (a.applyToBufferAttribute(b), (b.needsUpdate = !0))
14447        var c = this.attributes.normal
14448        if (void 0 !== c) {
14449          var d = new Fe().getNormalMatrix(a)
14450          d.applyToBufferAttribute(c), (c.needsUpdate = !0)
14451        }
14452        return (
14453          null !== this.boundingBox && this.computeBoundingBox(),
14454          null !== this.boundingSphere && this.computeBoundingSphere(),
14455          this
14456        )
14457      },
14458      rotateX: (function () {
14459        var a
14460        return function (c) {
14461          return (
14462            void 0 === a && (a = new Cb()),
14463            a.makeRotationX(c),
14464            this.applyMatrix(a),
14465            this
14466          )
14467        }
14468      })(),
14469      rotateY: (function () {
14470        var a
14471        return function (c) {
14472          return (
14473            void 0 === a && (a = new Cb()),
14474            a.makeRotationY(c),
14475            this.applyMatrix(a),
14476            this
14477          )
14478        }
14479      })(),
14480      rotateZ: (function () {
14481        var a
14482        return function (c) {
14483          return (
14484            void 0 === a && (a = new Cb()),
14485            a.makeRotationZ(c),
14486            this.applyMatrix(a),
14487            this
14488          )
14489        }
14490      })(),
14491      translate: (function () {
14492        var a
14493        return function (c, d, e) {
14494          return (
14495            void 0 === a && (a = new Cb()),
14496            a.makeTranslation(c, d, e),
14497            this.applyMatrix(a),
14498            this
14499          )
14500        }
14501      })(),
14502      scale: (function () {
14503        var a
14504        return function (c, d, e) {
14505          return (
14506            void 0 === a && (a = new Cb()),
14507            a.makeScale(c, d, e),
14508            this.applyMatrix(a),
14509            this
14510          )
14511        }
14512      })(),
14513      lookAt: (function () {
14514        var a
14515        return function (c) {
14516          void 0 === a && (a = new Ne()),
14517            a.lookAt(c),
14518            a.updateMatrix(),
14519            this.applyMatrix(a.matrix)
14520        }
14521      })(),
14522      center: function () {
14523        this.computeBoundingBox()
14524        var a = this.boundingBox.getCenter().negate()
14525        return this.translate(a.x, a.y, a.z), a
14526      },
14527      setFromObject: function (a) {
14528        var b = a.geometry
14529        if (a.isPoints || a.isLine) {
14530          var c = new $e(3 * b.vertices.length, 3),
14531            d = new $e(3 * b.colors.length, 3)
14532          if (
14533            (this.addAttribute('position', c.copyVector3sArray(b.vertices)),
14534            this.addAttribute('color', d.copyColorsArray(b.colors)),
14535            b.lineDistances && b.lineDistances.length === b.vertices.length)
14536          ) {
14537            var e = new $e(b.lineDistances.length, 1)
14538            this.addAttribute('lineDistance', e.copyArray(b.lineDistances))
14539          }
14540          null !== b.boundingSphere &&
14541            (this.boundingSphere = b.boundingSphere.clone()),
14542            null !== b.boundingBox && (this.boundingBox = b.boundingBox.clone())
14543        } else a.isMesh && b && b.isGeometry && this.fromGeometry(b)
14544        return this
14545      },
14546      updateFromObject: function (a) {
14547        var b = a.geometry
14548        if (a.isMesh) {
14549          var c = b.__directGeometry
14550          if (
14551            (b.elementsNeedUpdate === !0 &&
14552              ((c = void 0), (b.elementsNeedUpdate = !1)),
14553            void 0 === c)
14554          )
14555            return this.fromGeometry(b)
14556          ;(c.verticesNeedUpdate = b.verticesNeedUpdate),
14557            (c.normalsNeedUpdate = b.normalsNeedUpdate),
14558            (c.colorsNeedUpdate = b.colorsNeedUpdate),
14559            (c.uvsNeedUpdate = b.uvsNeedUpdate),
14560            (c.groupsNeedUpdate = b.group
14560sNeedUpdate),
14561            (b.verticesNeedUpdate = !1),
14562            (b.normalsNeedUpdate = !1),
14563            (b.colorsNeedUpdate = !1),
14564            (b.uvsNeedUpdate = !1),
14565            (b.groupsNeedUpdate = !1),
14566            (b = c)
14567        }
14568        var d
14569        return (
14570          b.verticesNeedUpdate === !0 &&
14571            ((d = this.attributes.position),
14572            void 0 !== d &&
14573              (d.copyVector3sArray(b.vertices), (d.needsUpdate = !0)),
14574            (b.verticesNeedUpdate = !1)),
14575          b.normalsNeedUpdate === !0 &&
14576            ((d = this.attributes.normal),
14577            void 0 !== d &&
14578              (d.copyVector3sArray(b.normals), (d.needsUpdate = !0)),
14579            (b.normalsNeedUpdate = !1)),
14580          b.colorsNeedUpdate === !0 &&
14581            ((d = this.attributes.color),
14582            void 0 !== d && (d.copyColorsArray(b.colors), (d.needsUpdate = !0)),
14583            (b.colorsNeedUpdate = !1)),
14584          b.uvsNeedUpdate &&
14585            ((d = this.attributes.uv),
14586            void 0 !== d && (d.copyVector2sArray(b.uvs), (d.needsUpdate = !0)),
14587            (b.uvsNeedUpdate = !1)),
14588          b.lineDistancesNeedUpdate &&
14589            ((d = this.attributes.lineDistance),
14590            void 0 !== d &&
14591              (d.copyArray(b.lineDistances), (d.needsUpdate = !0)),
14592            (b.lineDistancesNeedUpdate = !1)),
14593          b.groupsNeedUpdate &&
14594            (b.computeGroups(a.geometry),
14595            (this.groups = b.groups),
14596            (b.groupsNeedUpdate = !1)),
14597          this
14598        )
14599      },
14600      fromGeometry: function (a) {
14601        return (
14602          (a.__directGeometry = new af().fromGeometry(a)),
14603          this.fromDirectGeometry(a.__directGeometry)
14604        )
14605      },
14606      fromDirectGeometry: function (a) {
14607        var b = new Float32Array(3 * a.vertices.length)
14608        if (
14609          (this.addAttribute(
14610            'position',
14611            new Se(b, 3).copyVector3sArray(a.vertices)
14612          ),
14613          a.normals.length > 0)
14614        ) {
14615          var c = new Float32Array(3 * a.normals.length)
14616          this.addAttribute('normal', new Se(c, 3).copyVector3sArray(a.normals))
14617        }
14618        if (a.colors.length > 0) {
14619          var d = new Float32Array(3 * a.colors.length)
14620          this.addAttribute('color', new Se(d, 3).copyColorsArray(a.colors))
14621        }
14622        if (a.uvs.length > 0) {
14623          var e = new Float32Array(2 * a.uvs.length)
14624          this.addAttribute('uv', new Se(e, 2).copyVector2sArray(a.uvs))
14625        }
14626        if (a.uvs2.length > 0) {
14627          var f = new Float32Array(2 * a.uvs2.length)
14628          this.addAttribute('uv2', new Se(f, 2).copyVector2sArray(a.uvs2))
14629        }
14630        if (a.indices.length > 0) {
14631          var g = bf(a.indices) > 65535 ? Uint32Array : Uint16Array,
14632            h = new g(3 * a.indices.length)
14633          this.setIndex(new Se(h, 1).copyIndicesArray(a.indices))
14634        }
14635        this.groups = a.groups
14636        for (var i in a.morphTargets) {
14637          for (
14638            var j = [], k = a.morphTargets[i], l = 0, m = k.length;
14639            l < m;
14640            l++
14641          ) {
14642            var n = k[l],
14643              o = new $e(3 * n.length, 3)
14644            j.push(o.copyVector3sArray(n))
14645          }
14646          this.morphAttributes[i] = j
14647        }
14648        if (a.skinIndices.length > 0) {
14649          var p = new $e(4 * a.skinIndices.length, 4)
14650          this.addAttribute('skinIndex', p.copyVector4sArray(a.skinIndices))
14651        }
14652        if (a.skinWeights.length > 0) {
14653          var q = new $e(4 * a.skinWeights.length, 4)
14654          this.addAttribute('skinWeight', q.copyVector4sArray(a.skinWeights))
14655        }
14656        return (
14657          null !== a.boundingSphere &&
14658            (this.boundingSphere = a.boundingSphere.clone()),
14659          null !== a.boundingBox && (this.boundingBox = a.boundingBox.clone()),
14660          this
14661        )
14662      },
14663      computeBoundingBox: function () {
14664        null === this.boundingBox && (this.boundingBox = new De())
14665        var a = this.attributes.position
14666        void 0 !== a
14667          ? this.boundingBox.setFromBufferAttribute(a)
14668          : this.boundingBox.makeEmpty(),
14669          (isNaN(this.boundingBox.min.x) ||
14670            isNaN(this.boundingBox.min.y) ||
14671            isNaN(this.boundingBox.min.z)) &&
14672            console.error(
14673              'THREE.BufferGeometry.computeBoundingBox: Computed min/max have NaN values. The "position" attribute is likely to have NaN values.',
14674              this
14675            )
14676      },
14677      computeBoundingSphere: (function () {
14678        var a = new De(),
14679          b = new Bb()
14680        return function () {
14681          null === this.boundingSphere && (this.boundingSphere = new Ee())
14682          var d = this.attributes.position
14683          if (d) {
14684            var e = this.boundingSphere.center
14685            a.setFromBufferAttribute(d), a.getCenter(e)
14686            for (var f = 0, g = 0, h = d.count; g < h; g++)
14687              (b.x = d.getX(g)),
14688                (b.y = d.getY(g)),
14689                (b.z = d.getZ(g)),
14690                (f = Math.max(f, e.distanceToSquared(b)))
14691            ;(this.boundingSphere.radius = Math.sqrt(f)),
14692              isNaN(this.boundingSphere.radius) &&
14693                console.error(
14694                  'THREE.BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The "position" attribute is likely to have NaN values.',
14695                  this
14696                )
14697          }
14698        }
14699      })(),
14700      computeFaceNormals: function () {},
14701      computeVertexNormals: function () {
14702        var a = this.index,
14703          b = this.attributes,
14704          c = this.groups
14705        if (b.position) {
14706          var d = b.position.array
14707          if (void 0 === b.normal)
14708            this.addAttribute('normal', new Se(new Float32Array(d.length), 3))
14709          else
14710            for (var e = b.normal.array, f = 0, g = e.length; f < g; f++)
14711              e[f] = 0
14712          var i,
14713            j,
14714            k,
14715            h = b.normal.array,
14716            l = new Bb(),
14717            m = new Bb(),
14718            n = new Bb(),
14719            o = new Bb(),
14720            p = new Bb()
14721          if (a) {
14722            var q = a.array
14723            0 === c.length && this.addGroup(0, q.length)
14724            for (var r = 0, s = c.length; r < s; ++r)
14725              for (
14726                var t = c[r], u = t.start, v = t.count, f = u, g = u + v;
14727                f < g;
14728                f += 3
14729              )
14730                (i = 3 * q[f + 0]),
14731                  (j = 3 * q[f + 1]),
14732                  (k = 3 * q[f + 2]),
14733                  l.fromArray(d, i),
14734                  m.fromArray(d, j),
14735                  n.fromArray(d, k),
14736                  o.subVectors(n, m),
14737                  p.subVectors(l, m),
14738                  o.cross(p),
14739                  (h[i] += o.x),
14740                  (h[i + 1] += o.y),
14741                  (h[i + 2] += o.z),
14742                  (h[j] += o.x),
14743                  (h[j + 1] += o.y),
14744                  (h[j + 2] += o.z),
14745                  (h[k] += o.x),
14746                  (h[k + 1] += o.y),
14747                  (h[k + 2] += o.z)
14748          } else
14749            for (var f = 0, g = d.length; f < g; f += 9)
14750              l.fromArray(d, f),
14751                m.fromArray(d, f + 3),
14752                n.fromArray(d, f + 6),
14753                o.subVectors(n, m),
14754                p.subVectors(l, m),
14755                o.cross(p),
14756                (h[f] = o.x),
14757                (h[f + 1] = o.y),
14758                (h[f + 2] = o.z),
14759                (h[f + 3] = o.x),
14760                (h[f + 4] = o.y),
14761                (h[f + 5] = o.z),
14762                (h[f + 6] = o.x),
14763                (h[f + 7] = o.y),
14764                (h[f + 8] = o.z)
14765          this.normalizeNormals(), (b.normal.needsUpdate = !0)
14766        }
14767      },
14768      merge: function (a, b) {
14769        if ((a && a.isBufferGeometry) === !1)
14770          return void console.error(
14771            'THREE.BufferGeometry.merge(): geometry not an instance of THREE.BufferGeometry.',
14772            a
14773          )
14774        void 0 === b && (b = 0)
14775        var c = this.attributes
14776        for (var d in c)
14777          if (void 0 !== a.attributes[d])
14778            for (
14779              var e = c[d],
14780                f = e.array,
14781                g = a.attributes[d],
14782                h = g.array,
14783                i = g.itemSize,
14784                j = 0,
14785                k = i * b;
14786              j < h.length;
14787              j++, k++
14788            )
14789              f[k] = h[j]
14790        return this
14791      },
14792      normalizeNormals: function () {
14793        for (
14794          var b, c, d, e, a = this.attributes.normal.array, f = 0, g = a.length;
14795          f < g;
14796          f += 3
14797        )
14798          (b = a[f]),
14799            (c = a[f + 1]),
14800            (d = a[f + 2]),
14801            (e = 1 / Math.sqrt(b * b + c * c + d * d)),
14802            (a[f] *= e),
14803            (a[f + 1] *= e),
14804            (a[f + 2] *= e)
14805      },
14806      toNonIndexed: function () {
14807        if (null === this.index)
14808          return (
14809            console.warn(
14810              'THREE.BufferGeometry.toNonIndexed(): Geometry is already non-indexed.'
14811            ),
14812            this
14813          )
14814        var a = new ff(),
14815          b = this.index.array,
14816          c = this.attributes
14817        for (var d in c) {
14818          for (
14819            var e = c[d],
14820              f = e.array,
14821              g = e.itemSize,
14822              h = new f.constructor(b.length * g),
14823              i = 0,
14824              j = 0,
14825              k = 0,
14826              l = b.length;
14827            k < l;
14828            k++
14829          ) {
14830            i = b[k] * g
14831            for (var m = 0; m < g; m++) h[j++] = f[i++]
14832          }
14833          a.addAttribute(d, new Se(h, g))
14834        }
14835        return a
14836      },
14837      toJSON: function () {
14838        var a = {
14839          metadata: {
14840            version: 4.4,
14841            type: 'BufferGeometry',
14842            generator: 'BufferGeometry.toJSON'
14843          }
14844        }
14845        if (
14846          ((a.uuid = this.uuid),
14847          (a.type = this.type),
14848          '' !== this.name && (a.name = this.name),
14849          void 0 !== this.parameters)
14850        ) {
14851          var b = this.parameters
14852          for (var c in b) void 0 !== b[c] && (a[c] = b[c])
14853          return a
14854        }
14855        a.data = { attributes: {} }
14856        var d = this.index
14857        if (null !== d) {
14858          var e = Array.prototype.slice.call(d.array)
14859          a.data.index = { type: d.array.constructor.name, array: e }
14860        }
14861        var f = this.attributes
14862        for (var c in f) {
14863          var g = f[c],
14864            e = Array.prototype.slice.call(g.array)
14865          a.data.attributes[c] = {
14866            itemSize: g.itemSize,
14867            type: g.array.constructor.name,
14868            array: e,
14869            normalized: g.normalized
14870          }
14871        }
14872        var h = this.groups
14873        h.length > 0 && (a.data.groups = JSON.parse(JSON.stringify(h)))
14874        var i = this.boundingSphere
14875        return (
14876          null !== i &&
14877            (a.data.boundingSphere = {
14878              center: i.center.toArray(),
14879              radius: i.radius
14880            }),
14881          a
14882        )
14883      },
14884      clone: function () {
14885        return new ff().copy(this)
14886      },
14887      copy: function (a) {
14888        var b, c, d
14889        ;(this.index = null),
14890          (this.attributes = {}),
14891          (this.morphAttributes = {}),
14892          (this.groups = []),
14893          (this.boundingBox = null),
14894          (this.boundingSphere = null),
14895          (this.name = a.name)
14896        var e = a.index
14897        null !== e && this.setIndex(e.clone())
14898        var f = a.attributes
14899        for (b in f) {
14900          var g = f[b]
14901          this.addAttribute(b, g.clone())
14902        }
14903        var h = a.morphAttributes
14904        for (b in h) {
14905          var i = [],
14906            j = h[b]
14907          for (c = 0, d = j.length; c < d; c++) i.push(j[c].clone())
14908          this.morphAttributes[b] = i
14909        }
14910        var k = a.groups
14911        for (c = 0, d = k.length; c < d; c++) {
14912          var l = k[c]
14913          this.addGroup(l.start, l.count, l.materialIndex)
14914        }
14915        var m = a.boundingBox
14916        null !== m && (this.boundingBox = m.clone())
14917        var n = a.boundingSphere
14918        return (
14919          null !== n && (this.boundingSphere = n.clone()),
14920          (this.drawRange.start = a.drawRange.start),
14921          (this.drawRange.count = a.drawRange.count),
14922          this
14923        )
14924      },
14925      dispose: function () {
14926        this.dispatchEvent({ type: 'dispose' })
14927      }
14928    }),
14929    (ff.MaxIndex = 65535),
14930    Object.assign(ff.prototype, b.prototype),
14931    (gf.prototype = Object.assign(Object.create(Ne.prototype), {
14932      constructor: gf,
14933      isMesh: !0,
14934      setDrawMode: function (a) {
14935        this.drawMode = a
14936      },
14937      copy: function (a) {
14938        return (
14939          Ne.prototype.copy.call(this, a), (this.drawMode = a.drawMode), this
14940        )
14941      },
14942      updateMorphTargets: function () {
14943        var a = this.geometry.morphTargets
14944        if (void 0 !== a && a.length > 0) {
14945          ;(this.morphTargetInfluences = []), (this.morphTargetDictionary = {})
14946          for (var b = 0, c = a.length; b < c; b++)
14947            this.morphTargetInfluences.push(0),
14948              (this.morphTargetDictionary[a[b].name] = b)
14949        }
14950      },
14951      raycast: (function () {
14952        function r(a, b, c, d, e, f, g) {
14953          return (
14954            Pe.barycoordFromPoint(a, b, c, d, m),
14955            e.multiplyScalar(m.x),
14956            f.multiplyScalar(m.y),
14957            g.multiplyScalar(m.z),
14958            e.add(f).add(g),
14959            e.clone()
14960          )
14961        }
14962        function s(a, b, c, d, e, f, g) {
14963          var h,
14964            i = a.material
14965          if (
14966            ((h =
14967              i.side === o
14968                ? c.intersectTriangle(f, e, d, !0, g)
14969                : c.intersectTriangle(d, e, f, i.side !== p, g)),
14970            null === h)
14971          )
14972            return null
14973          q.copy(g), q.applyMatrix4(a.matrixWorld)
14974          var j = b.ray.origin.distanceTo(q)
14975          return j < b.near || j > b.far
14976            ? null
14977            : { distance: j, point: q.clone(), object: a }
14978        }
14979        function t(a, b, c, g, h, i, m, o) {
14980          d.fromBufferAttribute(g, i),
14981            e.fromBufferAttribute(g, m),
14982            f.fromBufferAttribute(g, o)
14983          var p = s(a, b, c, d, e, f, n)
14984          return (
14985            p &&
14986              (h &&
14987                (j.fromBufferAttribute(h, i),
14988                k.fromBufferAttribute(h, m),
14989                l.fromBufferAttribute(h, o),
14990                (p.uv = r(n, d, e, f, j, k, l))),
14991              (p.face = new Qe(i, m, o, Pe.normal(d, e, f))),
14992              (p.faceIndex = i)),
14993            p
14994          )
14995        }
14996        var a = new Cb(),
14997          b = new Je(),
14998          c = new Ee(),
14999          d = new Bb(),
15000          e = new Bb(),
15001          f = new Bb(),
15002          g = new Bb(),
15003          h = new Bb(),
15004          i = new Bb(),
15005          j = new ub(),
15006          k = new ub(),
15007          l = new ub(),
15008          m = new Bb(),
15009          n = new Bb(),
15010          q = new Bb()
15011        return function (o, p) {
15012          var q = this.geometry,
15013            u = this.material,
15014            v = this.matrixWorld
15015          if (
15016            void 0 !== u &&
15017            (null === q.boundingSphere && q.computeBoundingSphere(),
15018            c.copy(q.boundingSphere),
15019            c.applyMatrix4(v),
15020            o.ray.intersectsSphere(c) !== !1 &&
15021              (a.getInverse(v),
15022              b.copy(o.ray).applyMatrix4(a),
15023              null === q.boundingBox || b.intersectsBox(q.boundingBox) !== !1))
15024          ) {
15025            var w
15026            if (q.isBufferGeometry) {
15027              var x,
15028                y,
15029                z,
15030                D,
15031                E,
15032                A = q.index,
15033                B = q.attributes.position,
15034                C = q.attributes.uv
15035              if (null !== A)
15036                for (D = 0, E = A.count; D < E; D += 3)
15037                  (x = A.getX(D)),
15038                    (y = 
15038A.getX(D + 1)),
15039                    (z = A.getX(D + 2)),
15040                    (w = t(this, o, b, B, C, x, y, z)),
15041                    w && ((w.faceIndex = Math.floor(D / 3)), p.push(w))
15042              else
15043                for (D = 0, E = B.count; D < E; D += 3)
15044                  (x = D),
15045                    (y = D + 1),
15046                    (z = D + 2),
15047                    (w = t(this, o, b, B, C, x, y, z)),
15048                    w && ((w.index = x), p.push(w))
15049            } else if (q.isGeometry) {
15050              var F,
15051                G,
15052                H,
15053                M,
15054                I = u && u.isMultiMaterial,
15055                J = I === !0 ? u.materials : null,
15056                K = q.vertices,
15057                L = q.faces,
15058                N = q.faceVertexUvs[0]
15059              N.length > 0 && (M = N)
15060              for (var O = 0, P = L.length; O < P; O++) {
15061                var Q = L[O],
15062                  R = I === !0 ? J[Q.materialIndex] : u
15063                if (void 0 !== R) {
15064                  if (
15065                    ((F = K[Q.a]),
15066                    (G = K[Q.b]),
15067                    (H = K[Q.c]),
15068                    R.morphTargets === !0)
15069                  ) {
15070                    var S = q.morphTargets,
15071                      T = this.morphTargetInfluences
15072                    d.set(0, 0, 0), e.set(0, 0, 0), f.set(0, 0, 0)
15073                    for (var U = 0, V = S.length; U < V; U++) {
15074                      var W = T[U]
15075                      if (0 !== W) {
15076                        var X = S[U].vertices
15077                        d.addScaledVector(g.subVectors(X[Q.a], F), W),
15078                          e.addScaledVector(h.subVectors(X[Q.b], G), W),
15079                          f.addScaledVector(i.subVectors(X[Q.c], H), W)
15080                      }
15081                    }
15082                    d.add(F), e.add(G), f.add(H), (F = d), (G = e), (H = f)
15083                  }
15084                  if ((w = s(this, o, b, F, G, H, n))) {
15085                    if (M) {
15086                      var Y = M[O]
15087                      j.copy(Y[0]),
15088                        k.copy(Y[1]),
15089                        l.copy(Y[2]),
15090                        (w.uv = r(n, F, G, H, j, k, l))
15091                    }
15092                    ;(w.face = Q), (w.faceIndex = O), p.push(w)
15093                  }
15094                }
15095              }
15096            }
15097          }
15098        }
15099      })(),
15100      clone: function () {
15101        return new this.constructor(this.geometry, this.material).copy(this)
15102      }
15103    })),
15104    (hf.prototype = Object.create(ef.prototype)),
15105    (hf.prototype.constructor = hf),
15106    (jf.prototype = Object.create(ff.prototype)),
15107    (jf.prototype.constructor = jf),
15108    (kf.prototype = Object.create(ef.prototype)),
15109    (kf.prototype.constructor = kf),
15110    (lf.prototype = Object.create(ff.prototype)),
15111    (lf.prototype.constructor = lf),
15112    (mf.prototype = Object.create(Ne.prototype)),
15113    (mf.prototype.constructor = mf),
15114    (mf.prototype.isCamera = !0),
15115    (mf.prototype.getWorldDirection = (function () {
15116      var a = new Ab()
15117      return function (c) {
15118        var d = c || new Bb()
15119        return this.getWorldQuaternion(a), d.set(0, 0, -1).applyQuaternion(a)
15120      }
15121    })()),
15122    (mf.prototype.lookAt = (function () {
15123      var a = new Cb()
15124      return function (c) {
15125        a.lookAt(this.position, c, this.up),
15126          this.quaternion.setFromRotationMatrix(a)
15127      }
15128    })()),
15129    (mf.prototype.clone = function () {
15130      return new this.constructor().copy(this)
15131    }),
15132    (mf.prototype.copy = function (a) {
15133      return (
15134        Ne.prototype.copy.call(this, a),
15135        this.matrixWorldInverse.copy(a.matrixWorldInverse),
15136        this.projectionMatrix.copy(a.projectionMatrix),
15137        this
15138      )
15139    }),
15140    (nf.prototype = Object.assign(Object.create(mf.prototype), {
15141      constructor: nf,
15142      isPerspectiveCamera: !0,
15143      copy: function (a) {
15144        return (
15145          mf.prototype.copy.call(this, a),
15146          (this.fov = a.fov),
15147          (this.zoom = a.zoom),
15148          (this.near = a.near),
15149          (this.far = a.far),
15150          (this.focus = a.focus),
15151          (this.aspect = a.aspect),
15152          (this.view = null === a.view ? null : Object.assign({}, a.view)),
15153          (this.filmGauge = a.filmGauge),
15154          (this.filmOffset = a.filmOffset),
15155          this
15156        )
15157      },
15158      setFocalLength: function (a) {
15159        var b = (0.5 * this.getFilmHeight()) / a
15160        ;(this.fov = 2 * tb.RAD2DEG * Math.atan(b)),
15161          this.updateProjectionMatrix()
15162      },
15163      getFocalLength: function () {
15164        var a = Math.tan(0.5 * tb.DEG2RAD * this.fov)
15165        return (0.5 * this.getFilmHeight()) / a
15166      },
15167      getEffectiveFOV: function () {
15168        return (
15169          2 *
15170          tb.RAD2DEG *
15171          Math.atan(Math.tan(0.5 * tb.DEG2RAD * this.fov) / this.zoom)
15172        )
15173      },
15174      getFilmWidth: function () {
15175        return this.filmGauge * Math.min(this.aspect, 1)
15176      },
15177      getFilmHeight: function () {
15178        return this.filmGauge / Math.max(this.aspect, 1)
15179      },
15180      setViewOffset: function (a, b, c, d, e, f) {
15181        ;(this.aspect = a / b),
15182          (this.view = {
15183            fullWidth: a,
15184            fullHeight: b,
15185            offsetX: c,
15186            offsetY: d,
15187            width: e,
15188            height: f
15189          }),
15190          this.updateProjectionMatrix()
15191      },
15192      clearViewOffset: function () {
15193        ;(this.view = null), this.updateProjectionMatrix()
15194      },
15195      updateProjectionMatrix: function () {
15196        var a = this.near,
15197          b = (a * Math.tan(0.5 * tb.DEG2RAD * this.fov)) / this.zoom,
15198          c = 2 * b,
15199          d = this.aspect * c,
15200          e = -0.5 * d,
15201          f = this.view
15202        if (null !== f) {
15203          var g = f.fullWidth,
15204            h = f.fullHeight
15205          ;(e += (f.offsetX * d) / g),
15206            (b -= (f.offsetY * c) / h),
15207            (d *= f.width / g),
15208            (c *= f.height / h)
15209        }
15210        var i = this.filmOffset
15211        0 !== i && (e += (a * i) / this.getFilmWidth()),
15212          this.projectionMatrix.makePerspective(e, e + d, b, b - c, a, this.far)
15213      },
15214      toJSON: function (a) {
15215        var b = Ne.prototype.toJSON.call(this, a)
15216        return (
15217          (b.object.fov = this.fov),
15218          (b.object.zoom = this.zoom),
15219          (b.object.near = this.near),
15220          (b.object.far = this.far),
15221          (b.object.focus = this.focus),
15222          (b.object.aspect = this.aspect),
15223          null !== this.view && (b.object.view = Object.assign({}, this.view)),
15224          (b.object.filmGauge = this.filmGauge),
15225          (b.object.filmOffset = this.filmOffset),
15226          b
15227        )
15228      }
15229    })),
15230    (of.prototype = Object.assign(Object.create(mf.prototype), {
15231      constructor: of,
15232      isOrthographicCamera: !0,
15233      copy: function (a) {
15234        return (
15235          mf.prototype.copy.call(this, a),
15236          (this.left = a.left),
15237          (this.right = a.right),
15238          (this.top = a.top),
15239          (this.bottom = a.bottom),
15240          (this.near = a.near),
15241          (this.far = a.far),
15242          (this.zoom = a.zoom),
15243          (this.view = null === a.view ? null : Object.assign({}, a.view)),
15244          this
15245        )
15246      },
15247      setViewOffset: function (a, b, c, d, e, f) {
15248        ;(this.view = {
15249          fullWidth: a,
15250          fullHeight: b,
15251          offsetX: c,
15252          offsetY: d,
15253          width: e,
15254          height: f
15255        }),
15256          this.updateProjectionMatrix()
15257      },
15258      clearViewOffset: function () {
15259        ;(this.view = null), this.updateProjectionMatrix()
15260      },
15261      updateProjectionMatrix: function () {
15262        var a = (this.right - this.left) / (2 * this.zoom),
15263          b = (this.top - this.bottom) / (2 * this.zoom),
15264          c = (this.right + this.left) / 2,
15265          d = (this.top + this.bottom) / 2,
15266          e = c - a,
15267          f = c + a,
15268          g = d + b,
15269          h = d - b
15270        if (null !== this.view) {
15271          var i = this.zoom / (this.view.width / this.view.fullWidth),
15272            j = this.zoom / (this.view.height / this.view.fullHeight),
15273            k = (this.right - this.left) / this.view.width,
15274            l = (this.top - this.bottom) / this.view.height
15275          ;(e += k * (this.view.offsetX / i)),
15276            (f = e + k * (this.view.width / i)),
15277            (g -= l * (this.view.offsetY / j)),
15278            (h = g - l * (this.view.height / j))
15279        }
15280        this.projectionMatrix.makeOrthographic(e, f, g, h, this.near, this.far)
15281      },
15282      toJSON: function (a) {
15283        var b = Ne.prototype.toJSON.call(this, a)
15284        return (
15285          (b.object.zoom = this.zoom),
15286          (b.object.left = this.left),
15287          (b.object.right = this.right),
15288          (b.object.top = this.top),
15289          (b.object.bottom = this.bottom),
15290          (b.object.near = this.near),
15291          (b.object.far = this.far),
15292          null !== this.view && (b.object.view = Object.assign({}, this.view)),
15293          b
15294        )
15295      }
15296    }))
15297  var uf = 0
15298  ;(Rf.prototype.isFogExp2 = !0),
15299    (Rf.prototype.clone = function () {
15300      return new Rf(this.color.getHex(), this.density)
15301    }),
15302    (Rf.prototype.toJSON = function (a) {
15303      return {
15304        type: 'FogExp2',
15305        color: this.color.getHex(),
15306        density: this.density
15307      }
15308    }),
15309    (Sf.prototype.isFog = !0),
15310    (Sf.prototype.clone = function () {
15311      return new Sf(this.color.getHex(), this.near, this.far)
15312    }),
15313    (Sf.prototype.toJSON = function (a) {
15314      return {
15315        type: 'Fog',
15316        color: this.color.getHex(),
15317        near: this.near,
15318        far: this.far
15319      }
15320    }),
15321    (Tf.prototype = Object.create(Ne.prototype)),
15322    (Tf.prototype.constructor = Tf),
15323    (Tf.prototype.copy = function (a, b) {
15324      return (
15325        Ne.prototype.copy.call(this, a, b),
15326        null !== a.background && (this.background = a.background.clone()),
15327        null !== a.fog && (this.fog = a.fog.clone()),
15328        null !== a.overrideMaterial &&
15329          (this.overrideMaterial = a.overrideMaterial.clone()),
15330        (this.autoUpdate = a.autoUpdate),
15331        (this.matrixAutoUpdate = a.matrixAutoUpdate),
15332        this
15333      )
15334    }),
15335    (Tf.prototype.toJSON = function (a) {
15336      var b = Ne.prototype.toJSON.call(this, a)
15337      return (
15338        null !== this.background &&
15339          (b.object.background = this.background.toJSON(a)),
15340        null !== this.fog && (b.object.fog = this.fog.toJSON()),
15341        b
15342      )
15343    }),
15344    (Uf.prototype = Object.assign(Object.create(Ne.prototype), {
15345      constructor: Uf,
15346      isLensFlare: !0,
15347      copy: function (a) {
15348        Ne.prototype.copy.call(this, a),
15349          this.positionScreen.copy(a.positionScreen),
15350          (this.customUpdateCallback = a.customUpdateCallback)
15351        for (var b = 0, c = a.lensFlares.length; b < c; b++)
15352          this.lensFlares.push(a.lensFlares[b])
15353        return this
15354      },
15355      add: function (a, b, c, d, e, f) {
15356        void 0 === b && (b = -1),
15357          void 0 === c && (c = 0),
15358          void 0 === f && (f = 1),
15359          void 0 === e && (e = new re(16777215)),
15360          void 0 === d && (d = w),
15361          (c = Math.min(c, Math.max(0, c))),
15362          this.lensFlares.push({
15363            texture: a,
15364            size: b,
15365            distance: c,
15366            x: 0,
15367            y: 0,
15368            z: 0,
15369            scale: 1,
15370            rotation: 0,
15371            opacity: f,
15372            color: e,
15373            blending: d
15374          })
15375      },
15376      updateLensFlares: function () {
15377        var a,
15378          c,
15379          b = this.lensFlares.length,
15380          d = 2 * -this.positionScreen.x,
15381          e = 2 * -this.positionScreen.y
15382        for (a = 0; a < b; a++)
15383          (c = this.lensFlares[a]),
15384            (c.x = this.positionScreen.x + d * c.distance),
15385            (c.y = this.positionScreen.y + e * c.distance),
15386            (c.wantedRotation = c.x * Math.PI * 0.25),
15387            (c.rotation += 0.25 * (c.wantedRotation - c.rotation))
15388      }
15389    })),
15390    (Vf.prototype = Object.create(Ae.prototype)),
15391    (Vf.prototype.constructor = Vf),
15392    (Vf.prototype.copy = function (a) {
15393      return (
15394        Ae.prototype.copy.call(this, a),
15395        this.color.copy(a.color),
15396        (this.map = a.map),
15397        (this.rotation = a.rotation),
15398        this
15399      )
15400    }),
15401    (Wf.prototype = Object.assign(Object.create(Ne.prototype), {
15402      constructor: Wf,
15403      isSprite: !0,
15404      raycast: (function () {
15405        var a = new Bb()
15406        return function (c, d) {
15407          a.setFromMatrixPosition(this.matrixWorld)
15408          var e = c.ray.distanceSqToPoint(a),
15409            f = (this.scale.x * this.scale.y) / 4
15410          e > f ||
15411            d.push({
15412              distance: Math.sqrt(e),
15413              point: this.position,
15414              face: null,
15415              object: this
15416            })
15417        }
15418      })(),
15419      clone: function () {
15420        return new this.constructor(this.material).copy(this)
15421      }
15422    })),
15423    (Xf.prototype = Object.assign(Object.create(Ne.prototype), {
15424      constructor: Xf,
15425      copy: function (a) {
15426        Ne.prototype.copy.call(this, a, !1)
15427        for (var b = a.levels, c = 0, d = b.length; c < d; c++) {
15428          var e = b[c]
15429          this.addLevel(e.object.clone(), e.distance)
15430        }
15431        return this
15432      },
15433      addLevel: function (a, b) {
15434        void 0 === b && (b = 0), (b = Math.abs(b))
15435        for (
15436          var c = this.levels, d = 0;
15437          d < c.length && !(b < c[d].distance);
15438          d++
15439        );
15440        c.splice(d, 0, { distance: b, object: a }), this.add(a)
15441      },
15442      getObjectForDistance: function (a) {
15443        for (
15444          var b = this.levels, c = 1, d = b.length;
15445          c < d && !(a < b[c].distance);
15446          c++
15447        );
15448        return b[c - 1].object
15449      },
15450      raycast: (function () {
15451        var a = new Bb()
15452        return function (c, d) {
15453          a.setFromMatrixPosition(this.matrixWorld)
15454          var e = c.ray.origin.distanceTo(a)
15455          this.getObjectForDistance(e).raycast(c, d)
15456        }
15457      })(),
15458      update: (function () {
15459        var a = new Bb(),
15460          b = new Bb()
15461        return function (d) {
15462          var e = this.levels
15463          if (e.length > 1) {
15464            a.setFromMatrixPosition(d.matrixWorld),
15465              b.setFromMatrixPosition(this.matrixWorld)
15466            var f = a.distanceTo(b)
15467            e[0].object.visible = !0
15468            for (var g = 1, h = e.length; g < h && f >= e[g].distance; g++)
15469              (e[g - 1].object.visible = !1), (e[g].object.visible = !0)
15470            for (; g < h; g++) e[g].object.visible = !1
15471          }
15472        }
15473      })(),
15474      toJSON: function (a) {
15475        var b = Ne.prototype.toJSON.call(this, a)
15476        b.object.levels = []
15477        for (var c = this.levels, d = 0, e = c.length; d < e; d++) {
15478          var f = c[d]
15479          b.object.levels.push({ object: f.object.uuid, distance: f.distance })
15480        }
15481        return b
15482      }
15483    })),
15484    Object.assign(Yf.prototype, {
15485      calculateInverses: function () {
15486        this.boneInverses = []
15487        for (var a = 0, b = this.bones.length; a < b; a++) {
15488          var c = new Cb()
15489          this.bones[a] && c.getInverse(this.bones[a].matrixWorld),
15490            this.boneInverses.push(c)
15491        }
15492      },
15493      pose: function () {
15494        for (var a, b = 0, c = this.bones.length; b < c; b++)
15495          (a = this.bones[b]),
15496            a && a.matrixWorld.getInverse(this.boneInverses[b])
15497        for (var b = 0, c = this.bones.length; b < c; b++)
15498          (a = this.bones[b]),
15499            a &&
15500              (a.parent && a.parent.isBone
15501                ? (a.matrix.getInverse(a.parent.matrixWorld),
15502                  a.matrix.multiply(a.matrixWorld))
15503                : a.matrix.copy(a.matrixWorld),
15504              a.matrix.decompose(a.position, a.quaternion, a.scale))
15505      },
15506      update: (function () {
15507        var a = new Cb()
15508        return function () {
15509          for (var c = 0, d = this.bones.length; c < d; c++) {
15510            var e = this.bones[c]
15511              ? this.bones[c].matrixWorld
15512              : this.identityMatrix
15513            a.multiplyMatrices(e, this.boneInverses[c]),
15514              a.toArray(this.boneMatrices, 16 * c)
15515          }
15516          this.useVertexTexture && (this.boneTexture.needsUpdate = !0)
15517        }
15518      })(),
15519      clone: function () {
15520        return new Yf(this.bones, this.boneInverses, this.useVertexTexture)
15521      }
15522    }),
15523    (Zf.prototype = Object.assign(Object.create(Ne.prototype), {
15524      constructor: Zf,
15525      isBone: !0
15526    })),
15527    ($f.prototype = Object.assign(Object.create(gf.prototype), {
15528      constructor: $f,
15529      isSkinnedMesh: !0,
15530      bind: function (a, b) {
15531        ;(this.skeleton = a),
15532          void 0 === b &&
15533            (this.updateMatrixWorld(!0),
15534            this.skeleton.calculateInverses(),
15535            (b = this.matrixWorld)),
15536          this.bindMatrix.copy(b),
15537          this.bindMatrixInverse.getInverse(b)
15538      },
15539      pose: function () {
15540        this.skeleton.pose()
15541      },
15542      normalizeSkinWeights: function () {
15543        if (this.geometry && this.geometry.isGeometry)
15544          for (var a = 0; a < this.geometry.skinWeights.length; a++) {
15545            var b = this.geometry.skinWeights[a],
15546              c = 1 / b.lengthManhattan()
15547            c !== 1 / 0 ? b.multiplyScalar(c) : b.set(1, 0, 0, 0)
15548          }
15549        else if (this.geometry && this.geometry.isBufferGeometry)
15550          for (
15551            var d = new xb(), e = this.geometry.attributes.skinWeight, a = 0;
15552            a < e.count;
15553            a++
15554          ) {
15555            ;(d.x = e.getX(a)),
15556              (d.y = e.getY(a)),
15557              (d.z = e.getZ(a)),
15558              (d.w = e.getW(a))
15559            var c = 1 / d.lengthManhattan()
15560            c !== 1 / 0 ? d.multiplyScalar(c) : d.set(1, 0, 0, 0),
15561              e.setXYZW(a, d.x, d.y, d.z, d.w)
15562          }
15563      },
15564      updateMatrixWorld: function (a) {
15565        gf.prototype.updateMatrixWorld.call(this, !0),
15566          'attached' === this.bindMode
15567            ? this.bindMatrixInverse.getInverse(this.matrixWorld)
15568            : 'detached' === this.bindMode
15569            ? this.bindMatrixInverse.getInverse(this.bindMatrix)
15570            : console.warn(
15571                'THREE.SkinnedMesh unrecognized bindMode: ' + this.bindMode
15572              )
15573      },
15574      clone: function () {
15575        return new this.constructor(
15576          this.geometry,
15577          this.material,
15578          this.skeleton.useVertexTexture
15579        ).copy(this)
15580      }
15581    })),
15582    (_f.prototype = Object.create(Ae.prototype)),
15583    (_f.prototype.constructor = _f),
15584    (_f.prototype.isLineBasicMaterial = !0),
15585    (_f.prototype.copy = function (a) {
15586      return (
15587        Ae.prototype.copy.call(this, a),
15588        this.color.copy(a.color),
15589        (this.linewidth = a.linewidth),
15590        (this.linecap = a.linecap),
15591        (this.linejoin = a.linejoin),
15592        this
15593      )
15594    }),
15595    (ag.prototype = Object.assign(Object.create(Ne.prototype), {
15596      constructor: ag,
15597      isLine: !0,
15598      raycast: (function () {
15599        var a = new Cb(),
15600          b = new Je(),
15601          c = new Ee()
15602        return function (e, f) {
15603          var g = e.linePrecision,
15604            h = g * g,
15605            i = this.geometry,
15606            j = this.matrixWorld
15607          if (
15608            (null === i.boundingSphere && i.computeBoundingSphere(),
15609            c.copy(i.boundingSphere),
15610            c.applyMatrix4(j),
15611            e.ray.intersectsSphere(c) !== !1)
15612          ) {
15613            a.getInverse(j), b.copy(e.ray).applyMatrix4(a)
15614            var k = new Bb(),
15615              l = new Bb(),
15616              m = new Bb(),
15617              n = new Bb(),
15618              o = this && this.isLineSegments ? 2 : 1
15619            if (i.isBufferGeometry) {
15620              var p = i.index,
15621                q = i.attributes,
15622                r = q.position.array
15623              if (null !== p)
15624                for (var s = p.array, t = 0, u = s.length - 1; t < u; t += o) {
15625                  var v = s[t],
15626                    w = s[t + 1]
15627                  k.fromArray(r, 3 * v), l.fromArray(r, 3 * w)
15628                  var x = b.distanceSqToSegment(k, l, n, m)
15629                  if (!(x > h)) {
15630                    n.applyMatrix4(this.matrixWorld)
15631                    var y = e.ray.origin.distanceTo(n)
15632                    y < e.near ||
15633                      y > e.far ||
15634                      f.push({
15635                        distance: y,
15636                        point: m.clone().applyMatrix4(this.matrixWorld),
15637                        index: t,
15638                        face: null,
15639                        faceIndex: null,
15640                        object: this
15641                      })
15642                  }
15643                }
15644              else
15645                for (var t = 0, u = r.length / 3 - 1; t < u; t += o) {
15646                  k.fromArray(r, 3 * t), l.fromArray(r, 3 * t + 3)
15647                  var x = b.distanceSqToSegment(k, l, n, m)
15648                  if (!(x > h)) {
15649                    n.applyMatrix4(this.matrixWorld)
15650                    var y = e.ray.origin.distanceTo(n)
15651                    y < e.near ||
15652                      y > e.far ||
15653                      f.push({
15654                        distance: y,
15655                        point: m.clone().applyMatrix4(this.matrixWorld),
15656                        index: t,
15657                        face: null,
15658                        faceIndex: null,
15659                        object: this
15660                      })
15661                  }
15662                }
15663            } else if (i.isGeometry)
15664              for (var z = i.vertices, A = z.length, t = 0; t < A - 1; t += o) {
15665                var x = b.distanceSqToSegment(z[t], z[t + 1], n, m)
15666                if (!(x > h)) {
15667                  n.applyMatrix4(this.matrixWorld)
15668                  var y = e.ray.origin.distanceTo(n)
15669                  y < e.near ||
15670                    y > e.far ||
15671                    f.push({
15672                      distance: y,
15673                      point: m.clone().applyMatrix4(this.matrixWorld),
15674                      index: t,
15675                      face: null,
15676                      faceIndex: null,
15677                      object: this
15678                    })
15679                }
15680              }
15681          }
15682        }
15683      })(),
15684      clone: function () {
15685        return new this.constructor(this.geometry, this.material).copy(this)
15686      }
15687    })),
15688    (bg.prototype = Object.assign(Object.create(ag.prototype), {
15689      constructor: bg,
15690      isLineSegments: !0
15691    })),
15692    (cg.prototype = Object.create(Ae.prototype)),
15693    (cg.prototype.constructor = cg),
15694    (cg.prototype.isPointsMaterial = !0),
15695    (cg.prototype.copy = function (a) {
15696      return (
15697        Ae.prototype.copy.call(this, a),
15698        this.color.copy(a.color),
15699        (this.map = a.map),
15700        (this.size = a.size),
15701        (this.sizeAttenuation = a.sizeAttenuation),
15702        this
15703      )
15704    }),
15705    (dg.prototype = Object.assign(Object.create(Ne.prototype), {
15706      constructor: dg,
15707      isPoints: !0,
15708      raycast: (function () {
15709        var a = new Cb(),
15710          b = new Je(),
15711          c = new Ee()
15712        return function (e, f) {
15713          function n(a, c) {
15714            var d = b.distanceSqToPoint(a)
15715            if (d < l) {
15716              var h = b.closestPointToPoint(a)
15717              h.applyMatrix4(i)
15718              var j = e.ray.origin.distanceTo(h)
15719              if (j < e.near || j > e.far) return
15720              f.push({
15721                distance: j,
15722                distanceToRay: Math.sqrt(d),
15723                point: h.clone(),
15724                index: c,
15725                face: null,
15726                object: g
15727              })
15728            }
15729          }
15730          var g = this,
15731            h = this.geometry,
15732            i = this.matrixWorld,
15733            j = e.params.Points.threshold
15734          if (
15735            (null === h.boundingSphere && h.computeBoundingSphere(),
15736            c.copy(h.boundingSphere),
15737            c.applyMatrix4(i),
15738            e.ray.intersectsSphere(c) !== !1)
15739          ) {
15740            a.getInverse(i), b.copy(e.ray).applyMatrix4(a)
15741            var k = j / ((this.scale.x + this.scale.y + this.scale.z) / 3),
15742              l = k * k,
15743              m = new Bb()
15744            if (h.isBufferGeometry) {
15745              var o = h.index,
15746                p = h.attributes,
15747                q = p.position.array
15748              if (null !== o)
15749                for (var r = o.array, s = 0, t = r.length; s < t; s++) {
15750                  var u = r[s]
15751                  m.fromArray(q, 3 * u), n(m, u)
15752                }
15753              else
15754                for (var s = 0, v = q.length / 3; s < v; s++)
15755                  m.fromArray(q, 3 * s), n(m, s)
15756            } else
15757              for (var w = h.vertices, s = 0, v = w.length; s < v; s++)
15758                n(w[s], s)
15759          }
15760        }
15761      })(),
15762      clone: function () {
15763        return new this.constructor(this.geometry, this.material).copy(this)
15764      }
15765    })),
15766    (eg.prototype = Object.assign(Object.create(Ne.prototype), {
15767      constructor: eg
15768    })),
15769    (fg.prototype = Object.create(wb.prototype)),
15770    (fg.prototype.constructor = fg),
15771    (gg.prototype = Object.create(wb.prototype)),
15772    (gg.prototype.constructor = gg),
15773    (gg.prototype.isCompressedTexture = !0),
15774    (hg.prototype = Object.create(wb.prototype)),
15775    (hg.prototype.constructor = hg),
15776    (ig.prototype = Object.create(wb.prototype)),
15777    (ig.prototype.constructor = ig),
15778    (ig.prototype.isDepthTexture = !0),
15779    (jg.prototype = Object.create(ff.prototype)),
15780    (jg.prototype.constructor = jg),
15781    (kg.prototype = Object.create(ef.prototype)),
15782    (kg.prototype.constructor = kg),
15783    (lg.prototype = Object.create(ff.prototype)),
15784    (lg.prototype.constructor = lg),
15785    (mg.prototype = Object.create(ef.prototype)),
15786    (mg.prototype.constructor = mg),
15787    (ng.prototype = Object.create(ff.prototype)),
15788    (ng.prototype.constructor = ng),
15789    (og.prototype = Object.create(ef.prototype)),
15790    (og.prototype.constructor = og),
15791    (pg.prototype = Object.create(ng.prototype)),
15792    (pg.prototype.constructor = pg),
15793    (qg.prototype = Object.create(ef.prototype)),
15794    (qg.prototype.constructor = qg),
15795    (rg.prototype = Object.create(ng.prototype)),
15796    (rg.prototype.constructor = rg),
15797    (sg.prototype = Object.create(ef.prototype)),
15798    (sg.prototype.constructor = sg),
15799    (tg.prototype =
15799 Object.create(ng.prototype)),
15800    (tg.prototype.constructor = tg),
15801    (ug.prototype = Object.create(ef.prototype)),
15802    (ug.prototype.constructor = ug),
15803    (vg.prototype = Object.create(ng.prototype)),
15804    (vg.prototype.constructor = vg),
15805    (wg.prototype = Object.create(ef.prototype)),
15806    (wg.prototype.constructor = wg),
15807    (xg.prototype = Object.create(ff.prototype)),
15808    (xg.prototype.constructor = xg),
15809    (yg.prototype = Object.create(ef.prototype)),
15810    (yg.prototype.constructor = yg),
15811    (zg.prototype = Object.create(ff.prototype)),
15812    (zg.prototype.constructor = zg),
15813    (Ag.prototype = Object.create(ef.prototype)),
15814    (Ag.prototype.constructor = Ag),
15815    (Bg.prototype = Object.create(ff.prototype)),
15816    (Bg.prototype.constructor = Bg)
15817  var Cg = {
15818    area: function (a) {
15819      for (var b = a.length, c = 0, d = b - 1, e = 0; e < b; d = e++)
15820        c += a[d].x * a[e].y - a[e].x * a[d].y
15821      return 0.5 * c
15822    },
15823    triangulate: (function () {
15824      function a(a, b, c, d, e, f) {
15825        var g, h, i, j, k, l, m, n, o
15826        if (
15827          ((h = a[f[b]].x),
15828          (i = a[f[b]].y),
15829          (j = a[f[c]].x),
15830          (k = a[f[c]].y),
15831          (l = a[f[d]].x),
15832          (m = a[f[d]].y),
15833          (j - h) * (m - i) - (k - i) * (l - h) <= 0)
15834        )
15835          return !1
15836        var p, q, r, s, t, u, v, w, x, y, z, A, B, C, D
15837        for (
15838          p = l - j,
15839            q = m - k,
15840            r = h - l,
15841            s = i - m,
15842            t = j - h,
15843            u = k - i,
15844            g = 0;
15845          g < e;
15846          g++
15847        )
15848          if (
15849            ((n = a[f[g]].x),
15850            (o = a[f[g]].y),
15851            !(
15852              (n === h && o === i) ||
15853              (n === j && o === k) ||
15854              (n === l && o === m)
15855            ) &&
15856              ((v = n - h),
15857              (w = o - i),
15858              (x = n - j),
15859              (y = o - k),
15860              (z = n - l),
15861              (A = o - m),
15862              (D = p * y - q * x),
15863              (B = t * w - u * v),
15864              (C = r * A - s * z),
15865              D >= -Number.EPSILON &&
15866                C >= -Number.EPSILON &&
15867                B >= -Number.EPSILON))
15868          )
15869            return !1
15870        return !0
15871      }
15872      return function (c, d) {
15873        var e = c.length
15874        if (e < 3) return null
15875        var i,
15876          j,
15877          k,
15878          f = [],
15879          g = [],
15880          h = []
15881        if (Cg.area(c) > 0) for (j = 0; j < e; j++) g[j] = j
15882        else for (j = 0; j < e; j++) g[j] = e - 1 - j
15883        var l = e,
15884          m = 2 * l
15885        for (j = l - 1; l > 2; ) {
15886          if (m-- <= 0)
15887            return (
15888              console.warn(
15889                'THREE.ShapeUtils: Unable to triangulate polygon! in triangulate()'
15890              ),
15891              d ? h : f
15892            )
15893          if (
15894            ((i = j),
15895            l <= i && (i = 0),
15896            (j = i + 1),
15897            l <= j && (j = 0),
15898            (k = j + 1),
15899            l <= k && (k = 0),
15900            a(c, i, j, k, l, g))
15901          ) {
15902            var n, o, p, q, r
15903            for (
15904              n = g[i],
15905                o = g[j],
15906                p = g[k],
15907                f.push([c[n], c[o], c[p]]),
15908                h.push([g[i], g[j], g[k]]),
15909                q = j,
15910                r = j + 1;
15911              r < l;
15912              q++, r++
15913            )
15914              g[q] = g[r]
15915            l--, (m = 2 * l)
15916          }
15917        }
15918        return d ? h : f
15919      }
15920    })(),
15921    triangulateShape: function (a, b) {
15922      function c(a) {
15923        var b = a.length
15924        b > 2 && a[b - 1].equals(a[0]) && a.pop()
15925      }
15926      function d(a, b, c) {
15927        return a.x !== b.x
15928          ? a.x < b.x
15929            ? a.x <= c.x && c.x <= b.x
15930            : b.x <= c.x && c.x <= a.x
15931          : a.y < b.y
15932          ? a.y <= c.y && c.y <= b.y
15933          : b.y <= c.y && c.y <= a.y
15934      }
15935      function e(a, b, c, e, f) {
15936        var g = b.x - a.x,
15937          h = b.y - a.y,
15938          i = e.x - c.x,
15939          j = e.y - c.y,
15940          k = a.x - c.x,
15941          l = a.y - c.y,
15942          m = h * i - g * j,
15943          n = h * k - g * l
15944        if (Math.abs(m) > Number.EPSILON) {
15945          var o
15946          if (m > 0) {
15947            if (n < 0 || n > m) return []
15948            if (((o = j * k - i * l), o < 0 || o > m)) return []
15949          } else {
15950            if (n > 0 || n < m) return []
15951            if (((o = j * k - i * l), o > 0 || o < m)) return []
15952          }
15953          if (0 === o) return !f || (0 !== n && n !== m) ? [a] : []
15954          if (o === m) return !f || (0 !== n && n !== m) ? [b] : []
15955          if (0 === n) return [c]
15956          if (n === m) return [e]
15957          var p = o / m
15958          return [{ x: a.x + p * g, y: a.y + p * h }]
15959        }
15960        if (0 !== n || j * k !== i * l) return []
15961        var q = 0 === g && 0 === h,
15962          r = 0 === i && 0 === j
15963        if (q && r) return a.x !== c.x || a.y !== c.y ? [] : [a]
15964        if (q) return d(c, e, a) ? [a] : []
15965        if (r) return d(a, b, c) ? [c] : []
15966        var s, t, u, v, w, x, y, z
15967        return (
15968          0 !== g
15969            ? (a.x < b.x
15970                ? ((s = a), (u = a.x), (t = b), (v = b.x))
15971                : ((s = b), (u = b.x), (t = a), (v = a.x)),
15972              c.x < e.x
15973                ? ((w = c), (y = c.x), (x = e), (z = e.x))
15974                : ((w = e), (y = e.x), (x = c), (z = c.x)))
15975            : (a.y < b.y
15976                ? ((s = a), (u = a.y), (t = b), (v = b.y))
15977                : ((s = b), (u = b.y), (t = a), (v = a.y)),
15978              c.y < e.y
15979                ? ((w = c), (y = c.y), (x = e), (z = e.y))
15980                : ((w = e), (y = e.y), (x = c), (z = c.y))),
15981          u <= y
15982            ? v < y
15983              ? []
15984              : v === y
15985              ? f
15986                ? []
15987                : [w]
15988              : v <= z
15989              ? [w, t]
15990              : [w, x]
15991            : u > z
15992            ? []
15993            : u === z
15994            ? f
15995              ? []
15996              : [s]
15997            : v <= z
15998            ? [s, t]
15999            : [s, x]
16000        )
16001      }
16002      function f(a, b, c, d) {
16003        var e = b.x - a.x,
16004          f = b.y - a.y,
16005          g = c.x - a.x,
16006          h = c.y - a.y,
16007          i = d.x - a.x,
16008          j = d.y - a.y,
16009          k = e * h - f * g,
16010          l = e * j - f * i
16011        if (Math.abs(k) > Number.EPSILON) {
16012          var m = i * h - j * g
16013          return k > 0 ? l >= 0 && m >= 0 : l >= 0 || m >= 0
16014        }
16015        return l > 0
16016      }
16017      function g(a, b) {
16018        function g(a, b) {
16019          var e = c.length - 1,
16020            g = a - 1
16021          g < 0 && (g = e)
16022          var h = a + 1
16023          h > e && (h = 0)
16024          var i = f(c[a], c[g], c[h], d[b])
16025          if (!i) return !1
16026          var j = d.length - 1,
16027            k = b - 1
16028          k < 0 && (k = j)
16029          var l = b + 1
16030          return l > j && (l = 0), (i = f(d[b], d[k], d[l], c[a])), !!i
16031        }
16032        function h(a, b) {
16033          var d, f, g
16034          for (d = 0; d < c.length; d++)
16035            if (
16036              ((f = d + 1),
16037              (f %= c.length),
16038              (g = e(a, b, c[d], c[f], !0)),
16039              g.length > 0)
16040            )
16041              return !0
16042          return !1
16043        }
16044        function j(a, c) {
16045          var d, f, g, h, j
16046          for (d = 0; d < i.length; d++)
16047            for (f = b[i[d]], g = 0; g < f.length; g++)
16048              if (
16049                ((h = g + 1),
16050                (h %= f.length),
16051                (j = e(a, c, f[g], f[h], !0)),
16052                j.length > 0)
16053              )
16054                return !0
16055          return !1
16056        }
16057        for (
16058          var d,
16059            k,
16060            l,
16061            m,
16062            n,
16063            o,
16064            p,
16065            r,
16066            s,
16067            t,
16068            u,
16069            c = a.concat(),
16070            i = [],
16071            q = [],
16072            v = 0,
16073            w = b.length;
16074          v < w;
16075          v++
16076        )
16077          i.push(v)
16078        for (var x = 0, y = 2 * i.length; i.length > 0; ) {
16079          if ((y--, y < 0)) {
16080            console.log(
16081              'Infinite Loop! Holes left:' +
16082                i.length +
16083                ', Probably Hole outside Shape!'
16084            )
16085            break
16086          }
16087          for (l = x; l < c.length; l++) {
16088            ;(m = c[l]), (k = -1)
16089            for (var v = 0; v < i.length; v++)
16090              if (
16091                ((o = i[v]), (p = m.x + ':' + m.y + ':' + o), void 0 === q[p])
16092              ) {
16093                d = b[o]
16094                for (var z = 0; z < d.length; z++)
16095                  if (((n = d[z]), g(l, z) && !h(m, n) && !j(m, n))) {
16096                    ;(k = z),
16097                      i.splice(v, 1),
16098                      (r = c.slice(0, l + 1)),
16099                      (s = c.slice(l)),
16100                      (t = d.slice(k)),
16101                      (u = d.slice(0, k + 1)),
16102                      (c = r.concat(t).concat(u).concat(s)),
16103                      (x = l)
16104                    break
16105                  }
16106                if (k >= 0) break
16107                q[p] = !0
16108              }
16109            if (k >= 0) break
16110          }
16111        }
16112        return c
16113      }
16114      c(a), b.forEach(c)
16115      for (
16116        var h, i, j, k, l, m, n = {}, o = a.concat(), p = 0, q = b.length;
16117        p < q;
16118        p++
16119      )
16120        Array.prototype.push.apply(o, b[p])
16121      for (h = 0, i = o.length; h < i; h++)
16122        (l = o[h].x + ':' + o[h].y),
16123          void 0 !== n[l] &&
16124            console.warn('THREE.ShapeUtils: Duplicate point', l, h),
16125          (n[l] = h)
16126      var r = g(a, b),
16127        s = Cg.triangulate(r, !1)
16128      for (h = 0, i = s.length; h < i; h++)
16129        for (k = s[h], j = 0; j < 3; j++)
16130          (l = k[j].x + ':' + k[j].y), (m = n[l]), void 0 !== m && (k[j] = m)
16131      return s.concat()
16132    },
16133    isClockWise: function (a) {
16134      return Cg.area(a) < 0
16135    }
16136  }
16137  ;(Dg.prototype = Object.create(ef.prototype)),
16138    (Dg.prototype.constructor = Dg),
16139    (Dg.prototype.addShapeList = function (a, b) {
16140      for (var c = a.length, d = 0; d < c; d++) {
16141        var e = a[d]
16142        this.addShape(e, b)
16143      }
16144    }),
16145    (Dg.prototype.addShape = function (a, b) {
16146      function C(a, b, c) {
16147        return (
16148          b || console.error('THREE.ExtrudeGeometry: vec does not exist'),
16149          b.clone().multiplyScalar(c).add(a)
16150        )
16151      }
16152      function L(a, b, c) {
16153        var d,
16154          e,
16155          f = 1,
16156          g = a.x - b.x,
16157          h = a.y - b.y,
16158          i = c.x - a.x,
16159          j = c.y - a.y,
16160          k = g * g + h * h,
16161          l = g * j - h * i
16162        if (Math.abs(l) > Number.EPSILON) {
16163          var m = Math.sqrt(k),
16164            n = Math.sqrt(i * i + j * j),
16165            o = b.x - h / m,
16166            p = b.y + g / m,
16167            q = c.x - j / n,
16168            r = c.y + i / n,
16169            s = ((q - o) * j - (r - p) * i) / (g * j - h * i)
16170          ;(d = o + g * s - a.x), (e = p + h * s - a.y)
16171          var t = d * d + e * e
16172          if (t <= 2) return new ub(d, e)
16173          f = Math.sqrt(t / 2)
16174        } else {
16175          var u = !1
16176          g > Number.EPSILON
16177            ? i > Number.EPSILON && (u = !0)
16178            : g < -Number.EPSILON
16179            ? i < -Number.EPSILON && (u = !0)
16180            : Math.sign(h) === Math.sign(j) && (u = !0),
16181            u
16182              ? ((d = -h), (e = g), (f = Math.sqrt(k)))
16183              : ((d = g), (e = h), (f = Math.sqrt(k / 2)))
16184        }
16185        return new ub(d / f, e / f)
16186      }
16187      function V() {
16188        if (g) {
16189          var a = 0,
16190            b = I * a
16191          for (N = 0; N < K; N++) (J = A[N]), Z(J[2] + b, J[1] + b, J[0] + b)
16192          for (a = i + 2 * f, b = I * a, N = 0; N < K; N++)
16193            (J = A[N]), Z(J[0] + b, J[1] + b, J[2] + b)
16194        } else {
16195          for (N = 0; N < K; N++) (J = A[N]), Z(J[2], J[1], J[0])
16196          for (N = 0; N < K; N++)
16197            (J = A[N]), Z(J[0] + I * i, J[1] + I * i, J[2] + I * i)
16198        }
16199      }
16200      function W() {
16201        var a = 0
16202        for (X(B, a), a += B.length, s = 0, t = y.length; s < t; s++)
16203          (r = y[s]), X(r, a), (a += r.length)
16204      }
16205      function X(a, b) {
16206        var c, d
16207        for (N = a.length; --N >= 0; ) {
16208          ;(c = N), (d = N - 1), d < 0 && (d = a.length - 1)
16209          var e = 0,
16210            g = i + 2 * f
16211          for (e = 0; e < g; e++) {
16212            var h = I * e,
16213              j = I * (e + 1),
16214              k = b + c + h,
16215              l = b + d + h,
16216              m = b + d + j,
16217              n = b + c + j
16218            $(k, l, m, n, a, e, g, c, d)
16219          }
16220        }
16221      }
16222      function Y(a, b, c) {
16223        u.vertices.push(new Bb(a, b, c))
16224      }
16225      function Z(a, b, c) {
16226        ;(a += v),
16227          (b += v),
16228          (c += v),
16229          u.faces.push(new Qe(a, b, c, null, null, 0))
16230        var d = m.generateTopUV(u, a, b, c)
16231        u.faceVertexUvs[0].push(d)
16232      }
16233      function $(a, b, c, d, e, f, g, h, i) {
16234        ;(a += v),
16235          (b += v),
16236          (c += v),
16237          (d += v),
16238          u.faces.push(new Qe(a, b, d, null, null, 1)),
16239          u.faces.push(new Qe(b, c, d, null, null, 1))
16240        var j = m.generateSideWallUV(u, a, b, c, d)
16241        u.faceVertexUvs[0].push([j[0], j[1], j[3]]),
16242          u.faceVertexUvs[0].push([j[1], j[2], j[3]])
16243      }
16244      var k,
16245        n,
16246        o,
16247        p,
16248        q,
16249        c = void 0 !== b.amount ? b.amount : 100,
16250        d = void 0 !== b.bevelThickness ? b.bevelThickness : 6,
16251        e = void 0 !== b.bevelSize ? b.bevelSize : d - 2,
16252        f = void 0 !== b.bevelSegments ? b.bevelSegments : 3,
16253        g = void 0 === b.bevelEnabled || b.bevelEnabled,
16254        h = void 0 !== b.curveSegments ? b.curveSegments : 12,
16255        i = void 0 !== b.steps ? b.steps : 1,
16256        j = b.extrudePath,
16257        l = !1,
16258        m = void 0 !== b.UVGenerator ? b.UVGenerator : Dg.WorldUVGenerator
16259      j &&
16260        ((k = j.getSpacedPoints(i)),
16261        (l = !0),
16262        (g = !1),
16263        (n = void 0 !== b.frames ? b.frames : j.computeFrenetFrames(i, !1)),
16264        (o = new Bb()),
16265        (p = new Bb()),
16266        (q = new Bb())),
16267        g || ((f = 0), (d = 0), (e = 0))
16268      var r,
16269        s,
16270        t,
16271        u = this,
16272        v = this.vertices.length,
16273        w = a.extractPoints(h),
16274        x = w.shape,
16275        y = w.holes,
16276        z = !Cg.isClockWise(x)
16277      if (z) {
16278        for (x = x.reverse(), s = 0, t = y.length; s < t; s++)
16279          (r = y[s]), Cg.isClockWise(r) && (y[s] = r.reverse())
16280        z = !1
16281      }
16282      var A = Cg.triangulateShape(x, y),
16283        B = x
16284      for (s = 0, t = y.length; s < t; s++) (r = y[s]), (x = x.concat(r))
16285      for (
16286        var D,
16287          E,
16288          F,
16289          G,
16290          H,
16291          J,
16292          I = x.length,
16293          K = A.length,
16294          M = [],
16295          N = 0,
16296          O = B.length,
16297          P = O - 1,
16298          Q = N + 1;
16299        N < O;
16300        N++, P++, Q++
16301      )
16302        P === O && (P = 0), Q === O && (Q = 0), (M[N] = L(B[N], B[P], B[Q]))
16303      var S,
16304        R = [],
16305        T = M.concat()
16306      for (s = 0, t = y.length; s < t; s++) {
16307        for (
16308          r = y[s], S = [], N = 0, O = r.length, P = O - 1, Q = N + 1;
16309          N < O;
16310          N++, P++, Q++
16311        )
16312          P === O && (P = 0), Q === O && (Q = 0), (S[N] = L(r[N], r[P], r[Q]))
16313        R.push(S), (T = T.concat(S))
16314      }
16315      for (D = 0; D < f; D++) {
16316        for (
16317          F = D / f,
16318            G = d * Math.cos((F * Math.PI) / 2),
16319            E = e * Math.sin((F * Math.PI) / 2),
16320            N = 0,
16321            O = B.length;
16322          N < O;
16323          N++
16324        )
16325          (H = C(B[N], M[N], E)), Y(H.x, H.y, -G)
16326        for (s = 0, t = y.length; s < t; s++)
16327          for (r = y[s], S = R[s], N = 0, O = r.length; N < O; N++)
16328            (H = C(r[N], S[N], E)), Y(H.x, H.y, -G)
16329      }
16330      for (E = e, N = 0; N < I; N++)
16331        (H = g ? C(x[N], T[N], E) : x[N]),
16332          l
16333            ? (p.copy(n.normals[0]).multiplyScalar(H.x),
16334              o.copy(n.binormals[0]).multiplyScalar(H.y),
16335              q.copy(k[0]).add(p).add(o),
16336              Y(q.x, q.y, q.z))
16337            : Y(H.x, H.y, 0)
16338      var U
16339      for (U = 1; U <= i; U++)
16340        for (N = 0; N < I; N++)
16341          (H = g ? C(x[N], T[N], E) : x[N]),
16342            l
16343              ? (p.copy(n.normals[U]).multiplyScalar(H.x),
16344                o.copy(n.binormals[U]).multiplyScalar(H.y),
16345                q.copy(k[U]).add(p).add(o),
16346                Y(q.x, q.y, q.z))
16347              : Y(H.x, H.y, (c / i) * U)
16348      for (D = f - 1; D >= 0; D--) {
16349        for (
16350          F = D / f,
16351            G = d * Math.cos((F * Math.PI) / 2),
16352            E = e * Math.sin((F * Math.PI) / 2),
16353            N = 0,
16354            O = B.length;
16355          N < O;
16356          N++
16357        )
16358          (H = C(B[N], M[N], E)), Y(H.x, H.y, c + G)
16359        for (s = 0, t = y.length; s < t; s++)
16360          for (r = y[s], S = R[s], N = 0, O = r.length; N < O; N++)
16361            (H = C(r[N], S[N], E)),
16362              l ? Y(H.x, H.y + k[i - 1].y, k[i - 1].x + G) : Y(H.x, H.y, c + G)
16363      }
16364      V(), W()
16365    }),
16366    (Dg.WorldUVGenerator = {
16367      generateTopUV: function (a, b, c, d) {
16368        var e = a.vertices,
16369          f = e[b],
16370          g = e[c],
16371          h = e[d]
16372        return [new ub(f.x, f.y), new ub(g.x, g.y), new ub(h.x, h.y)]
16373      },
16374      generateSideWallUV: function (a, b, c, d, e) {
16375        var f = a.vertices,
16376          g = f[b],
16377          h = f[c],
16378          i = f[d],
16379          j = f[e]
16380        return Math.abs(g.y - h.y) < 0.01
16381          ? [
16382              new ub(g.x, 1 - g.z),
16383              new ub(h.x, 1 - h.z),
16384              new ub(i.x, 1 - i.z),
16385              new ub(j.x, 1 - j.z)
16386            ]
16387          : [
16388              new ub(g.y, 1 - g.z),
16389              new ub(h.y, 1 - h.z),
16390              new ub(i.y, 1 - i.z),
16391              new ub(j.y, 1 - j.z)
16392            ]
16393      }
16394    }),
16395    (Eg.prototype = Object.create(Dg.prototype)),
16396    (Eg.prototype.constructor = Eg),
16397    (Fg.prototype = Object.create(ef.prototype)),
16398    (Fg.prototype.constructor = Fg),
16399    (Gg.prototype = Object.create(ff.prototype)),
16400    (Gg.prototype.constructor = Gg),
16401    (Hg.prototype = Object.create(ef.prototype)),
16402    (Hg.prototype.constructor = Hg),
16403    (Ig.prototype = Object.create(ff.prototype)),
16404    (Ig.prototype.constructor = Ig),
16405    (Jg.prototype = Object.create(ef.prototype)),
16406    (Jg.prototype.constructor = Jg),
16407    (Kg.prototype = Object.create(ff.prototype)),
16408    (Kg.prototype.constructor = Kg),
16409    (Lg.prototype = Object.create(ef.prototype)),
16410    (Lg.prototype.constructor = Lg),
16411    (Mg.prototype = Object.create(ff.prototype)),
16412    (Mg.prototype.constructor = Mg),
16413    (Ng.prototype = Object.create(ff.prototype)),
16414    (Ng.prototype.constructor = Ng),
16415    (Og.prototype = Object.create(ef.prototype)),
16416    (Og.prototype.constructor = Og),
16417    (Pg.prototype = Object.create(ff.prototype)),
16418    (Pg.prototype.constructor = Pg),
16419    (Qg.prototype = Object.create(Og.prototype)),
16420    (Qg.prototype.constructor = Qg),
16421    (Rg.prototype = Object.create(Pg.prototype)),
16422    (Rg.prototype.constructor = Rg),
16423    (Sg.prototype = Object.create(ef.prototype)),
16424    (Sg.prototype.constructor = Sg),
16425    (Tg.prototype = Object.create(ff.prototype)),
16426    (Tg.prototype.constructor = Tg)
16427  var Ug = Object.freeze({
16428    WireframeGeometry: jg,
16429    ParametricGeometry: kg,
16430    ParametricBufferGeometry: lg,
16431    TetrahedronGeometry: og,
16432    TetrahedronBufferGeometry: pg,
16433    OctahedronGeometry: qg,
16434    OctahedronBufferGeometry: rg,
16435    IcosahedronGeometry: sg,
16436    IcosahedronBufferGeometry: tg,
16437    DodecahedronGeometry: ug,
16438    DodecahedronBufferGeometry: vg,
16439    PolyhedronGeometry: mg,
16440    PolyhedronBufferGeometry: ng,
16441    TubeGeometry: wg,
16442    TubeBufferGeometry: xg,
16443    TorusKnotGeometry: yg,
16444    TorusKnotBufferGeometry: zg,
16445    TorusGeometry: Ag,
16446    TorusBufferGeometry: Bg,
16447    TextGeometry: Eg,
16448    SphereGeometry: Fg,
16449    SphereBufferGeometry: Gg,
16450    RingGeometry: Hg,
16451    RingBufferGeometry: Ig,
16452    PlaneGeometry: kf,
16453    PlaneBufferGeometry: lf,
16454    LatheGeometry: Jg,
16455    LatheBufferGeometry: Kg,
16456    ShapeGeometry: Lg,
16457    ShapeBufferGeometry: Mg,
16458    ExtrudeGeometry: Dg,
16459    EdgesGeometry: Ng,
16460    ConeGeometry: Qg,
16461    ConeBufferGeometry: Rg,
16462    CylinderGeometry: Og,
16463    CylinderBufferGeometry: Pg,
16464    CircleGeometry: Sg,
16465    CircleBufferGeometry: Tg,
16466    BoxGeometry: hf,
16467    BoxBufferGeometry: jf
16468  })
16469  ;(Vg.prototype = Object.create(Be.prototype)),
16470    (Vg.prototype.constructor = Vg),
16471    (Vg.prototype.isShadowMaterial = !0),
16472    (Wg.prototype = Object.create(Be.prototype)),
16473    (Wg.prototype.constructor = Wg),
16474    (Wg.prototype.isRawShaderMaterial = !0),
16475    (Xg.prototype = {
16476      constructor: Xg,
16477      isMultiMaterial: !0,
16478      toJSON: function (a) {
16479        for (
16480          var b = {
16481              metadata: {
16482                version: 4.2,
16483                type: 'material',
16484                generator: 'MaterialExporter'
16485              },
16486              uuid: this.uuid,
16487              type: this.type,
16488              materials: []
16489            },
16490            c = this.materials,
16491            d = 0,
16492            e = c.length;
16493          d < e;
16494          d++
16495        ) {
16496          var f = c[d].toJSON(a)
16497          delete f.metadata, b.materials.push(f)
16498        }
16499        return (b.visible = this.visible), b
16500      },
16501      clone: function () {
16502        for (
16503          var a = new this.constructor(), b = 0;
16504          b < this.materials.length;
16505          b++
16506        )
16507          a.materials.push(this.materials[b].clone())
16508        return (a.visible = this.visible), a
16509      }
16510    }),
16511    (Yg.prototype = Object.create(Ae.prototype)),
16512    (Yg.prototype.constructor = Yg),
16513    (Yg.prototype.isMeshStandardMaterial = !0),
16514    (Yg.prototype.copy = function (a) {
16515      return (
16516        Ae.prototype.copy.call(this, a),
16517        (this.defines = { STANDARD: '' }),
16518        this.color.copy(a.color),
16519        (this.roughness = a.roughness),
16520        (this.metalness = a.metalness),
16521        (this.map = a.map),
16522        (this.lightMap = a.lightMap),
16523        (this.lightMapIntensity = a.lightMapIntensity),
16524        (this.aoMap = a.aoMap),
16525        (this.aoMapIntensity = a.aoMapIntensity),
16526        this.emissive.copy(a.emissive),
16527        (this.emissiveMap = a.emissiveMap),
16528        (this.emissiveIntensity = a.emissiveIntensity),
16529        (this.bumpMap = a.bumpMap),
16530        (this.bumpScale = a.bumpScale),
16531        (this.normalMap = a.normalMap),
16532        this.normalScale.copy(a.normalScale),
16533        (this.displacementMap = a.displacementMap),
16534        (this.displacementScale = a.displacementScale),
16535        (this.displacementBias = a.displacementBias),
16536        (this.roughnessMap = a.roughnessMap),
16537        (this.metalnessMap = a.metalnessMap),
16538        (this.alphaMap = a.alphaMap),
16539        (this.envMap = a.envMap),
16540        (this.envMapIntensity = a.envMapIntensity),
16541        (this.refractionRatio = a.refractionRatio),
16542        (this.wireframe = a.wireframe),
16543        (this.wireframeLinewidth = a.wireframeLinewidth),
16544        (this.wireframeLinecap = a.wireframeLinecap),
16545        (this.wireframeLinejoin = a.wireframeLinejoin),
16546        (this.skinning = a.skinning),
16547        (this.morphTargets = a.morphTargets),
16548        (this.morphNormals = a.morphNormals),
16549        this
16550      )
16551    }),
16552    (Zg.prototype = Object.create(Yg.prototype)),
16553    (Zg.prototype.constructor = Zg),
16554    (Zg.prototype.isMeshPhysicalMaterial = !0),
16555    (Zg.prototype.copy = function (a) {
16556      return (
16557        Yg.prototype.copy.call(this, a),
16558        (this.defines = { PHYSICAL: '' }),
16559        (this.reflectivity = a.reflectivity),
16560        (this.clearCoat = a.clearCoat),
16561        (this.clearCoatRoughness = a.clearCoatRoughness),
16562        this
16563      )
16564    }),
16565    ($g.prototype = Object.create(Ae.prototype)),
16566    ($g.prototype.constructor = $g),
16567    ($g.prototype.isMeshPhongMaterial = !0),
16568    ($g.prototype.copy = function (a) {
16569      return (
16570        Ae.prototype.copy.call(this, a),
16571        this.color.copy(a.color),
16572        this.specular.copy(a.specular),
16573        (this.shininess = a.shininess),
16574        (this.map = a.map),
16575        (this.lightMap = a.lightMap),
16576        (this.lightMapIntensity = a.lightMapIntensity),
16577        (this.aoMap = a.aoMap),
16578        (this.aoMapIntensity = a.aoMapIntensity),
16579        this.emissive.copy(a.emissive),
16580        (this.emissiveMap = a.emissiveMap),
16581        (this.emissiveIntensity = a.emissiveIntensity),
16582        (this.bumpMap = a.bumpMap),
16583        (this.bumpScale = a.bumpScale),
16584        (this.normalMap = a.normalMap),
16585        this.normalScale.copy(a.normalScale),
16586        (this.displacementMap = a.displacementMap),
16587        (this.displacementScale = a.displacementScale),
16588        (this.displacementBias = a.displacementBias),
16589        (this.specularMap = a.specularMap),
16590        (this.alphaMap = a.alphaMap),
16591        (this.envMap = a.envMap),
16592        (this.combine = a.combine),
16593        (this.reflectivity = a.reflectivity),
16594        (this.refractionRatio = a.refractionRatio),
16595        (this.wireframe = a.wireframe),
16596        (this.wireframeLinewidth = a.wireframeLinewidth),
16597        (this.wireframeLinecap = a.wireframeLinecap),
16598        (this.wireframeLinejoin = a.wireframeLinejoin),
16599        (this.skinning = a.skinning),
16600        (this.morphTargets = a.morphTargets),
16601        (this.morphNormals = a.morphNormals),
16602        this
16603      )
16604    }),
16605    (_g.prototype = Object.create($g.prototype)),
16606    (_g.prototype.constructor = _g),
16607    (_g.prototype.isMeshToonMaterial = !0),
16608    (_g.prototype.copy = function (a) {
16609      return (
16610        $g.prototype.copy.call(this, a),
16611        (this.gradientMap = a.gradientMap),
16612        this
16613      )
16614    }),
16615    (ah.prototype = Object.create(Ae.prototype)),
16616    (ah.prototype.constructor = ah),
16617    (ah.prototype.isMeshNormalMaterial = !0),
16618    (ah.prototype.copy = function (a) {
16619      return (
16620        Ae.prototype.copy.call(this, a),
16621        (this.bumpMap = a.bumpMap),
16622        (this.bumpScale = a.bumpScale),
16623        (this.normalMap = a.normalMap),
16624        this.normalScale.copy(a.normalScale),
16625        (this.displacementMap = a.displacementMap),
16626        (this.displacementScale = a.displacementScale),
16627        (this.displacementBias = a.displacementBias),
16628        (this.wireframe = a.wireframe),
16629        (this.wireframeLinewidth = a.wireframeLinewidth),
16630        (this.skinning = a.skinning),
16631        (this.morphTargets = a.morphTargets),
16632        (this.morphNormals = a.morphNormals),
16633        this
16634      )
16635    }),
16636    (bh.prototype = Object.create(Ae.prototype)),
16637    (bh.prototype.constructor = bh),
16638    (bh.prototype.isMeshLambertMaterial = !0),
16639    (bh.prototype.copy = function (a) {
16640      return (
16641        Ae.prototype.copy.call(this, a),
16642        this.color.copy(a.color),
16643        (this.map = a.map),
16644        (this.lightMap = a.lightMap),
16645        (this.lightMapIntensity = a.lightMapIntensity),
16646        (this.aoMap = a.aoMap),
16647        (this.aoMapIntensity = a.aoMapIntensity),
16648        this.emissive.copy(a.emissive),
16649        (this.emissiveMap = a.emissiveMap),
16650        (this.emissiveIntensity = a.emissiveIntensity),
16651        (this.specularMap = a.specularMap),
16652        (this.alphaMap = a.alphaMap),
16653        (this.envMap = a.envMap),
16654        (this.combine = a.combine),
16655        (this.reflectivity = a.reflectivity),
16656        (this.refractionRatio = a.refractionRatio),
16657        (this.wireframe = a.wireframe),
16658        (this.wireframeLinewidth = a.wireframeLinewidth),
16659        (this.wireframeLinecap = a.wireframeLinecap),
16660        (this.wireframeLinejoin = a.wireframeLinejoin),
16661        (this.skinning = a.skinning),
16662        (this.morphTargets = a.morphTargets),
16663        (this.morphNormals = a.morphNormals),
16664        this
16665      )
16666    }),
16667    (ch.prototype = Object.create(Ae.prototype)),
16668    (ch.prototype.constructor = ch),
16669    (ch.prototype.isLineDashedMaterial = !0),
16670    (ch.prototype.copy = function (a) {
16671      return (
16672        Ae.prototype.copy.call(this, a),
16673        this.color.copy(a.color),
16674        (this.linewidth = a.linewidth),
16675        (this.scale = a.scale),
16676        (this.dashSize = a.dashSize),
16677        (this.gapSize = a.gapSize),
16678        this
16679      )
16680    })
16681  var dh = Object.freeze({
16682      ShadowMaterial: Vg,
16683      SpriteMaterial: Vf,
16684      RawShaderMaterial: Wg,
16685      ShaderMaterial: Be,
16686      PointsMaterial: cg,
16687      MultiMaterial: Xg,
16688      MeshPhysicalMaterial: Zg,
16689      MeshStandardMaterial: Yg,
16690      MeshPhongMaterial: $g,
16691      MeshToonMaterial: _g,
16692      MeshNormalMaterial: ah,
16693      MeshLambertMaterial: bh,
16694      MeshDepthMaterial: Ce,
16695      MeshBasicMaterial: Re,
16696      LineDashedMaterial: ch,
16697      LineBasicMaterial: _f,
16698      Material: Ae
16699    }),
16700    eh = {
16701      enabled: !1,
16702      files: {},
16703      add: function (a, b) {
16704        this.enabled !== !1 && (this.files[a] = b)
16705      },
16706      get: function (a) {
16707        if (this.enabled !== !1) return this.files[a]
16708      },
16709      remove: function (a) {
16710        delete this.files[a]
16711      },
16712      clear: function () {
16713        this.files = {}
16714      }
16715    },
16716    gh = new fh()
16717  Object.assign(hh.prototype, {
16718    load: function (a, b, c, d) {
16719      void 0 === a && (a = ''), void 0 !== this.path && (a = this.path + a)
16720      var e = this,
16721        f = eh.get(a)
16722      if (void 0 !== f)
16723        return (
16724          e.manager.itemStart(a),
16725          setTimeout(function () {
16726            b && b(f), e.manager.itemEnd(a)
16727          }, 0),
16728          f
16729        )
16730      var g = /^data:(.*?)(;base64)?,(.*)$/,
16731        h = a.match(g)
16732      if (h) {
16733        var i = h[1],
16734          j = !!h[2],
16735          k = h[3]
16736        ;(k = window.decodeURIComponent(k)), j && (k = window.atob(k))
16737        try {
16738          var l,
16739            m = (this.responseType || '').toLowerCase()
16740          switch (m) {
16741            case 'arraybuffer':
16742            case 'blob':
16743              l = new ArrayBuffer(k.length)
16744              for (var n = new Uint8Array(l), o = 0; o < k.length; o++)
16745                n[o] = k.charCodeAt(o)
16746              'blob' === m && (l = new Blob([l], { type: i }))
16747              break
16748            case 'document':
16749              var p = new DOMParser()
16750              l = p.parseFromString(k, i)
16751              break
16752            case 'json':
16753              l = JSON.parse(k)
16754              break
16755            default:
16756              l = k
16757          }
16758          window.setTimeout(function () {
16759            b && b(l), e.manager.itemEnd(a)
16760          }, 0)
16761        } catch (b) {
16762          window.setTimeout(function () {
16763            d && d(b), e.manager.itemError(a)
16764          }, 0)
16765        }
16766      } else {
16767        var q = new XMLHttpRequest()
16768        q.open('GET', a, !0),
16769          q.addEventListener(
16770            'load',
16771            function (c) {
16772              var f = c.target.response
16773              eh.add(a, f),
16774                200 === this.status
16775                  ? (b && b(f), e.manager.itemEnd(a))
16776                  : 0 === this.status
16777                  ? (console.warn('THREE.FileLoader: HTTP Status 0 received.'),
16778                    b && b(f),
16779                    e.manager.itemEnd(a))
16780                  : (d && d(c), e.manager.itemError(a))
16781            },
16782            !1
16783          ),
16784          void 0 !== c &&
16785            q.addEventListener(
16786              'progress',
16787              function (a) {
16788                c(a)
16789              },
16790              !1
16791            ),
16792          q.addEventListener(
16793            'error',
16794            function (b) {
16795              d && d(b), e.manager.itemError(a)
16796            },
16797            !1
16798          ),
16799          void 0 !== this.responseType && (q.responseType = this.responseType),
16800          void 0 !== this.withCredentials &&
16801            (q.withCredentials = this.withCredentials),
16802          q.overrideMimeType &&
16803            q.overrideMimeType(
16804              void 0 !== this.mimeType ? this.mimeType : 'text/plain'
16805            ),
16806          q.send(null)
16807      }
16808      return e.manager.itemStart(a), q
16809    },
16810    setPath: function (a) {
16811      return (this.path = a), this
16812    },
16813    setResponseType: function (a) {
16814      return (this.responseType = a), this
16815    },
16816    setWithCredentials: function (a) {
16817      return (this.withCredentials = a), this
16818    },
16819    setMimeType: function (a) {
16820      return (this.mimeType = a), this
16821    }
16822  }),
16823    Object.assign(ih.prototype, {
16824      load: function (a, b, c, d) {
16825        function i(i) {
16826          h.load(
16827            a[i],
16828            function (a) {
16829              var c = e._parser(a, !0)
16830              ;(f[i] = {
16831                width: c.width,
16832                height: c.height,
16833                format: c.format,
16834                mipmaps: c.mipmaps
16835              }),
16836                (j += 1),
16837                6 === j &&
16838                  (1 === c.mipmapCount && (g.minFilter = ta),
16839                  (g.format = c.format),
16840                  (g.needsUpdate = !0),
16841                  b && b(g))
16842            },
16843            c,
16844            d
16845          )
16846        }
16847        var e = this,
16848          f = [],
16849          g = new gg()
16850        g.image = f
16851        var h = new hh(this.manager)
16852        if (
16853          (h.setPath(this.path),
16854          h.setResponseType('arraybuffer'),
16855          Array.isArray(a))
16856        )
16857          for (var j = 0, k = 0, l = a.length; k < l; ++k) i(k)
16858        else
16859          h.load(
16860            a,
16861            function (a) {
16862              var c = e._parser(a, !0)
16863              if (c.isCubemap)
16864                for (
16865                  var d = c.mipmaps.length / c.mipmapCount, h = 0;
16866                  h < d;
16867                  h++
16868                ) {
16869                  f[h] = { mipmaps: [] }
16870                  for (var i = 0; i < c.mipmapCount; i++)
16871                    f[h].mipmaps.push(c.mipmaps[h * c.mipmapCount + i]),
16872                      (f[h].format = c.format),
16873                      (f[h].width = c.width),
16874                      (f[h].height = c.height)
16875                }
16876              else
16877                (g.image.width = c.width),
16878                  (g.image.height = c.height),
16879                  (g.mipmaps = c.mipmaps)
16880              1 === c.mipmapCount && (g.minFilter = ta),
16881                (g.format = c.format),
16882                (g.needsUpdate = !0),
16883                b && b(g)
16884            },
16885            c,
16886            d
16887          )
16888        return g
16889      },
16890      setPath: function (a) {
16891        return (this.path = a), this
16892      }
16893    }),
16894    Object.assign(jh.prototype, {
16895      load: function (a, b, c, d) {
16896        var e = this,
16897          f = new te(),
16898          g = new hh(this.manager)
16899        return (
16900          g.setResponseType('arraybuffer'),
16901          g.load(
16902            a,
16903            function (a) {
16904              var c = e._parser(a)
16905              c &&
16906                (void 0 !== c.image
16907                  ? (f.image = c.image)
16908                  : void 0 !== c.data &&
16909                    ((f.image.width = c.width),
16910                    (f.image.height = c.height),
16911                    (f.image.data = c.data)),
16912                (f.wrapS = void 0 !== c.wrapS ? c.wrapS : oa),
16913                (f.wrapT = void 0 !== c.wrapT ? c.wrapT : oa),
16914                (f.magFilter = void 0 !== c.magFilter ? c.magFilter : ta),
16915                (f.minFilter = void 0 !== c.minFilter ? c.minFilter : va),
16916                (f.anisotropy = void 0 !== c.anisotropy ? c.anisotropy : 1),
16917                void 0 !== c.format && (f.format = c.format),
16918                void 0 !== c.type && (f.type = c.type),
16919                void 0 !== c.mipmaps && (f.mipmaps = c.mipmaps),
16920                1 === c.mipmapCount && (f.minFilter = ta),
16921                (f.needsUpdate = !0),
16922                b && b(f, c))
16923            },
16924            c,
16925            d
16926          ),
16927          f
16928        )
16929      }
16930    }),
16931    Object.assign(kh.prototype, {
16932      load: function (a, b, c, d) {
16933        void 0 === a && (a = ''), void 0 !== this.path && (a = this.path + a)
16934        var e = this,
16935          f = eh.get(a)
16936        if (void 0 !== f)
16937          return (
16938            e.manager.itemStart(a),
16939            setTimeout(function () {
16940              b && b(f), e.manager.itemEnd(a)
16941            }, 0),
16942            f
16943          )
16944        var g = document.createElementNS('http://www.w3.org/1999/xhtml', 'img')
16945        return (
16946          g.addEventListener(
16947            'load',
16948            function () {
16949              eh.add(a, this), b && b(this), e.manager.itemEnd(a)
16950            },
16951            !1
16952          ),
16953          g.addEventListener(
16954            'error',
16955            function (b) {
16956              d && d(b), e.manager.itemError(a)
16957            },
16958            !1
16959          ),
16960          void 0 !== this.crossOrigin && (g.crossOrigin = this.crossOrigin),
16961          e.manager.itemStart(a),
16962          (g.src = a),
16963          g
16964        )
16965      },
16966      setCrossOrigin: function (a) {
16967        return (this.crossOrigin = a), this
16968      },
16969      setPath: function (a) {
16970        return (this.path = a), this
16971      }
16972    }),
16973    Object.assign(lh.prototype, {
16974      load: function (a, b, c, d) {
16975        function h(c) {
16976          f.load(
16977            a[c],
16978            function (a) {
16979              ;(e.images[c] = a),
16980                g++,
16981                6 === g && ((e.needsUpdate = !0), b && b(e))
16982            },
16983            void 0,
16984            d
16985          )
16986        }
16987        var e = new Db(),
16988          f = new kh(this.manager)
16989        f.setCrossOrigin(this.crossOrigin), f.setPath(this.path)
16990        for (var g = 0, i = 0; i < a.length; ++i) h(i)
16991        return e
16992      },
16993      setCrossOrigin: function (a) {
16994        return (this.crossOrigin = a), this
16995      },
16996      setPath: function (a) {
16997        return (this.path = a), this
16998      }
16999    }),
17000    Object.assign(mh.prototype, {
17001      load: function (a, b, c, d) {
17002        var e = new wb(),
17003          f = new kh(this.manager)
17004        return (
17005          f.setCrossOrigin(this.crossOrigin),
17006          f.setPath(this.path),
17007          f.load(
17008            a,
17009            function (c) {
17010              var d =
17011                a.search(/\.(jpg|jpeg)$/) > 0 ||
17012                0 === a.search(/^data\:image\/jpeg/)
17013              ;(e.format = d ? Ja : Ka),
17014                (e.image = c),
17015                (e.needsUpdate = !0),
17016                void 0 !== b && b(e)
17017            },
17018            c,
17019            d
17020          ),
17021          e
17022        )
17023      },
17024      setCrossOrigin: function (a) {
17025        return (this.crossOrigin = a), this
17026      },
17027      setPath: function (a) {
17028        return (this.path = a), this
17029      }
17030    }),
17031    (nh.prototype = Object.assign(Object.create(Ne.prototype), {
17032      constructor: nh,
17033      isLight: !0,
17034      copy: function (a) {
17035        return (
17036          Ne.prototype.copy.call(this, a),
17037          this.color.copy(a.color),
17038          (this.intensity = a.intensity),
17039          this
17040        )
17041      },
17042      toJSON: function (a) {
17043        var b = Ne.prototype.toJSON.call(this, a)
17044        return (
17045          (b.object.color = this.color.getHex()),
17046          (b.object.intensity = this.intensity),
17047          void 0 !== this.groundColor &&
17048            (b.object.groundColor = this.groundColor.getHex()),
17049          void 0 !== this.distance && (b.object.distance = this.distance),
17050          void 0 !== this.angle && (b.object.angle = this.angle),
17051          void 0 !== this.decay && (b.object.decay = this.decay),
17052          void 0 !== this.penumbra && (b.object.penumbra = this.penumbra),
17053          void 0 !== this.shadow && (b.object.shadow = this.shadow.toJSON()),
17054          b
17055        )
17056      }
17057    })),
17058    (oh.prototype = Object.assign(Object.create(nh.prototype), {
17059      constructor: oh,
17060      isHemisphereLight: !0,
17061      copy: function (a) {
17062        return (
17063          nh.prototype.copy.call(this, a),
17064          this.groundColor.copy(a.groundColor),
17065          this
17066        )
17067      }
17068    })),
17069    Object.assign(ph.prototype, {
17070      copy: function (a) {
17071        return (
17072          (this.camera = a.camera.clone()),
17073          (this.bias = a.bias),
17074          (this.radius = a.radius),
17075          this.mapSize.copy(a.mapSize),
17076          this
17077        )
17078      },
17079      clone: function () {
17080        return new this.constructor().copy(this)
17081      },
17082      toJSON: function () {
17083        var a = {}
17084        return (
17085          0 !== this.bias && (a.bias = this.bias),
17086          1 !== this.radius && (a.radius = this.radius),
17087          (512 === this.mapSize.x && 512 === this.mapSize.y) ||
17088            (a.mapSize = this.mapSize.toArray()),
17089          (a.camera = this.camera.toJSON(!1).object),
17090          delete a.camera.matrix,
17091          a
17092        )
17093      }
17094    }),
17095    (qh.prototype = Object.assign(Object.create(ph.prototype), {
17096      constructor: qh,
17097      isSpotLightShadow: !0,
17098      update: function (a) {
17099        var b = 2 * tb.RAD2DEG * a.angle,
17100          c = this.mapSize.width / this.mapSize.height,
17101          d = a.distance || 500,
17102          e = this.camera
17103        ;(b === e.fov && c === e.aspect && d === e.far) ||
17104          ((e.fov = b), (e.aspect = c), (e.far = d), e.updateProjectionMatrix())
17105      }
17106    })),
17107    (rh.prototype = Object.assign(Object.create(nh.prototype), {
17108      constructor: rh,
17109      isSpotLight: !0,
17110      copy: function (a) {
17111        return (
17112          nh.prototype.copy.call(this, a),
17113          (this.distance = a.distance),
17114          (this.angle = a.angle),
17115          (this.penumbra = a.penumbra),
17116          (this.decay = a.decay),
17117          (this.target = a.target.clone()),
17118          (this.shadow = a.shadow.clone()),
17119          this
17120        )
17121      }
17122    })),
17123    (sh.prototype = Object.assign(Object.create(nh.prototype), {
17124      constructor: sh,
17125      isPointLight: !0,
17126      copy: function (a) {
17127        return (
17128          nh.prototype.copy.call(this, a),
17129          (this.distance = a.distance),
17130          (this.decay = a.decay),
17131          (this.shadow = a.shadow.clone()),
17132          this
17133        )
17134      }
17135    })),
17136    (th.prototype = Object.assign(Object.create(ph.prototype), {
17137      constructor: th
17138    })),
17139    (uh.prototype = Object.assign(Object.create(nh.prototype), {
17140      constructor: uh,
17141      isDirectionalLight: !0,
17142      copy: function (a) {
17143        return (
17144          nh.prototype.copy.call(this, a),
17145          (this.target = a.target.clone()),
17146          (this.shadow = a.shadow.clone()),
17147          this
17148        )
17149      }
17150    })),
17151    (vh.prototype = Object.assign(Object.create(nh.prototype), {
17152      constructor: vh,
17153      isAmbientLight: !0
17154    }))
17155  var wh = {
17156    arraySlice: function (a, b, c) {
17157      return wh.isTypedArray(a)
17158        ? new a.constructor(a.subarray(b, c))
17159        : a.slice(b, c)
17160    },
17161    convertArray: function (a, b, c) {
17162      return !a || (!c && a.constructor === b)
17163        ? a
17164        : 'number' == typeof b.BYTES_PER_ELEMENT
17165        ? new b(a)
17166        : Array.prototype.slice.call(a)
17167    },
17168    isTypedArray: function (a) {
17169      return ArrayBuffer.isView(a) && !(a instanceof DataView)
17170    },
17171    getKeyframeOrder: function (a) {
17172      function b(b, c) {
17173        return a[b] - a[c]
17174      }
17175      for (var c = a.length, d = new Array(c), e = 0; e !== c; ++e) d[e] = e
17176      return d.sort(b), d
17177    },
17178    sortedArray: function (a, b, c) {
17179      for (
17180        var d = a.length, e = new a.constructor(d), f = 0, g = 0;
17181        g !== d;
17182        ++f
17183      )
17184        for (var h = c[f] * b, i = 0; i !== b; ++i) e[g++] = a[h + i]
17185      return e
17186    },
17187    flattenJSON: function (a, b, c, d) {
17188      for (var e = 1, f = a[0]; void 0 !== f && void 0 === f[d]; ) f = a[e++]
17189      if (void 0 !== f) {
17190        var g = f[d]
17191        if (void 0 !== g)
17192          if (Array.isArray(g)) {
17193            do
17194              (g = f[d]),
17195                void 0 !== g && (b.push(f.time), c.push.apply(c, g)),
17196                (f = a[e++])
17197            while (void 0 !== f)
17198          } else if (void 0 !== g.toArray) {
17199            do
17200              (g = f[d]),
17201                void 0 !== g && (b.push(f.time), g.toArray(c, c.length)),
17202                (f = a[e++])
17203            while (void 0 !== f)
17204          } else
17205            do
17206              (g = f[d]),
17207                void 0 !== g && (b.push(f.time), c.push(g)),
17208                (f = a[e++])
17209            while (void 0 !== f)
17210      }
17211    }
17212  }
17213  ;(xh.prototype = {
17214    constructor: xh,
17215    evaluate: function (a) {
17216      var b = this.parameterPositions,
17217        c = this._cachedIndex,
17218        d = b[c],
17219        e = b[c - 1]
17220      a: {
17221        b: {
17222          var f
17223          c: {
17224            d: if (!(a < d)) {
17225              for (var g = c + 2; ; ) {
17226                if (void 0 === d) {
17227                  if (a < e) break d
17228                  return (
17229                    (c = b.length),
17230                    (this._cachedIndex = c),
17231                    this.afterEnd_(c - 1, a, e)
17232                  )
17233                }
17234                if (c === g) break
17235                if (((e = d), (d = b[++c]), a < d)) break b
17236              }
17237              f = b.length
17238              break c
17239            }
17240            {
17241              if (a >= e) break a
17242              var h = b[1]
17243              a < h && ((c = 2), (e = h))
17244              for (var g = c - 2; ; ) {
17245                if (void 0 === e)
17246                  return (this._cachedIndex = 0), this.beforeStart_(0, a, d)
17247                if (c === g) break
17248                if (((d = e), (e = b[--c - 1]), a >= e)) break b
17249              }
17250              ;(f = c), (c = 0)
17251            }
17252          }
17253          for (; c < f; ) {
17254            var i = (c + f) >>> 1
17255            a < b[i] ? (f = i) : (c = i + 1)
17256          }
17257          if (((d = b[c]), (e = b[c - 1]), void 0 === e))
17258            return (this._cachedIndex = 0), this.beforeStart_(0, a, d)
17259          if (void 0 === d)
17260            return (
17261              (c = b.length),
17262              (this._cachedIndex = c),
17263              this.afterEnd_(c - 1, e, a)
17264            )
17265        }
17266        ;(this._cachedIndex = c), this.intervalChanged_(c, e, d)
17267      }
17268      return this.interpolate_(c, e, a, d)
17269    },
17270    settings: null,
17271    DefaultSettings_: {},
17272    getSettings_: function () {
17273      return this.settings || this.DefaultSettings_
17274    },
17275    copySampleValue_: function (a) {
17276      for (
17277        var b = this.resultBuffer,
17278          c = this.sampleValues,
17279          d = this.valueSize,
17280          e = a * d,
17281          f = 0;
17282        f !== d;
17283        ++f
17284      )
17285        b[f] = c[e + f]
17286      return b
17287    },
17288    interpolate_: function (a, b, c, d) {
17289      throw new Error('call to abstract method')
17290    },
17291    intervalChanged_: function (a, b, c) {}
17292  }),
17293    Object.assign(xh.prototype, {
17294      beforeStart_: xh.prototype.copySampleValue_,
17295      afterEnd_: xh.prototype.copySampleValue_
17296    }),
17297    (yh.prototype = Object.assign(Object.create(xh.prototype), {
17298      constructor: yh,
17299      DefaultSettings_: { endingStart: db, endingEnd: db },
17300      intervalChanged_: function (a, b, c) {
17301        var d = this.parameterPositions,
17302          e = a - 2,
17303          f = a + 1,
17304          g = d[e],
17305          h = d[f]
17306        if (void 0 === g)
17307          switch (this.getSettings_().endingStart) {
17308            case eb:
17309              ;(e = a), (g = 2 * b - c)
17310              break
17311            case fb:
17312              ;(e = d.length - 2), (g = b + d[e] - d[e + 1])
17313              break
17314            default:
17315              ;(e = a), (g = c)
17316          }
17317        if (void 0 === h)
17318          switch (this.getSettings_().endingEnd) {
17319            case eb:
17320              ;(f = a), (h = 2 * c - b)
17321              break
17322            case fb:
17323              ;(f = 1), (h = c + d[1] - d[0])
17324              break
17325            default:
17326              ;(f = a - 1), (h = b)
17327          }
17328        var i = 0.5 * (c - b),
17329          j = this.valueSize
17330        ;(this._weightPrev = i / (b - g)),
17331          (this._weightNext = i / (h - c)),
17332          (this._offsetPrev = e * j),
17333          (this._offsetNext = f * j)
17334      },
17335      interpolate_: function (a, b, c, d) {
17336        for (
17337          var e = this.resultBuffer,
17338            f = this.sampleValues,
17339            g = this.valueSize,
17340            h = a * g,
17341            i = h - g,
17342            j = this._offsetPrev,
17343            k = this._offsetNext,
17344            l = this._weightPrev,
17345            m = this._weightNext,
17346            n = (c - b) / (d - b),
17347            o = n * n,
17348            p = o * n,
17349            q = -l * p + 2 * l * o - l * n,
17350            r = (1 + l) * p + (-1.5 - 2 * l) * o + (-0.5 + l) * n + 1,
17351            s = (-1 - m) * p + (1.5 + m) * o + 0.5 * n,
17352            t = m * p - m * o,
17353            u = 0;
17354          u !== g;
17355          ++u
17356        )
17357          e[u] = q * f[j + u] + r * f[i + u] + s * f[h + u] + t * f[k + u]
17358        return e
17359      }
17360    })),
17361    (zh.prototype = Object.assign(Object.create(xh.prototype), {
17362      constructor: zh,
17363      interpolate_: function (a, b, c, d) {
17364        for (
17365          var e = this.resultBuffer,
17366            f = this.sampleValues,
17367            g = this.valueSize,
17368            h = a * g,
17369            i = h - g,
17370            j = (c - b) / (d - b),
17371            k = 1 - j,
17372            l = 0;
17373          l !== g;
17374          ++l
17375        )
17376          e[l] = f[i + l] * k + f[h + l] * j
17377        return e
17378      }
17379    })),
17380    (Ah.prototype = Object.assign(Object.create(xh.prototype), {
17381      constructor: Ah,
17382      interpolate_: function (a, b, c, d) {
17383        return this.copySampleValue_(a - 1)
17384      }
17385    }))
17386  var Bh
17387  ;(Bh = {
17388    TimeBufferType: Float32Array,
17389    ValueBufferType: Float32Array,
17390    DefaultInterpolation: bb,
17391    InterpolantFactoryMethodDiscrete: function (a) {
17392      return new Ah(this.times, this.values, this.getValueSize(), a)
17393    },
17394    InterpolantFactoryMethodLinear: function (a) {
17395      return new zh(this.times, this.values, this.getValueSize(), a)
17396    },
17397    InterpolantFactoryMethodSmooth: function (a) {
17398      return new yh(this.times, this.values, this.getValueSize(), a)
17399    },
17400    setInterpolation: function (a) {
17401      var b
17402      switch (a) {
17403        case ab:
17404          b = this.InterpolantFactoryMethodDiscrete
17405          break
17406        case bb:
17407          b = this.InterpolantFactoryMethodLinear
17408          break
17409        case cb:
17410          b = this.InterpolantFactoryMethodSmooth
17411      }
17412      if (void 0 === b) {
17413        var c =
17414          'unsupported interpolation for ' +
17415          this.ValueTypeName +
17416          ' keyframe track named ' +
17417          this.name
17418        if (void 0 === this.createInterpolant) {
17419          if (a === this.DefaultInterpolation) throw new Error(c)
17420          this.setInterpolation(this.DefaultInterpolation)
17421        }
17422        return void console.warn(c)
17423      }
17424      this.createInterpolant = b
17425    },
17426    getInterpolation: function () {
17427      switch (this.createInterpolant) {
17428        case this.InterpolantFactoryMethodDiscrete:
17429          return ab
17430        case this.InterpolantFactoryMethodLinear:
17431          return bb
17432        case this.InterpolantFactoryMethodSmooth:
17433          return cb
17434      }
17435    },
17436    getValueSize: function () {
17437      return this.values.length / this.times.length
17438    },
17439    shift: function (a) {
17440      if (0 !== a)
17441        for (var b = this.times, c = 0, d = b.length; c !== d; ++c) b[c] += a
17442      return this
17443    },
17444    scale: function (a) {
17445      if (1 !== a)
17446        for (var b = this.times, c = 0, d = b.length; c !== d; ++c) b[c] *= a
17447      return this
17448    },
17449    trim: function (a, b) {
17450      for (
17451        var c = this.times, d = c.length, e = 0, f = d - 1;
17452        e !== d && c[e] < a;
17453
17454      )
17455        ++e
17456      for (; f !== -1 && c[f] > b; ) --f
17457      if ((++f, 0 !== e || f !== d)) {
17458        e >= f && ((f = Math.max(f, 1)), (e = f - 1))
17459        var g = this.getValueSize()
17460        ;(this.times = wh.arraySlice(c, e, f)),
17461          (this.values = wh.arraySlice(this.values, e * g, f * g))
17462      }
17463      return this
17464    },
17465    validate: function () {
17466      var a = !0,
17467        b = this.getValueSize()
17468      b - Math.floor(b) !== 0 &&
17469        (console.error('invalid value size in track', this), (a = !1))
17470      var c = this.times,
17471        d = this.values,
17472        e = c.length
17473      0 === e && (console.error('track is empty', this), (a = !1))
17474      for (var f = null, g = 0; g !== e; g++) {
17475        var h = c[g]
17476        if ('number' == typeof h && isNaN(h)) {
17477          console.error('time is not a valid number', this, g, h), (a = !1)
17478          break
17479        }
17480        if (null !== f && f > h) {
17481          console.error('out of order keys', this, g, h, f), (a = !1)
17482          break
17483        }
17484        f = h
17485      }
17486      if (void 0 !== d && wh.isTypedArray(d))
17487        for (var g = 0, i = d.length; g !== i; ++g) {
17488          var j = d[g]
17489          if (isNaN(j)) {
17490            console.error('value is not a valid number', this, g, j), (a = !1)
17491            break
17492          }
17493        }
17494      return a
17495    },
17496    optimize: function () {
17497      for (
17498        var a = this.times,
17499          b = this.values,
17500          c = this.getValueSize(),
17501          d = this.getInterpolation() === cb,
17502          e = 1,
17503          f = a.length - 1,
17504          g = 1;
17505        g < f;
17506        ++g
17507      ) {
17508        var h = !1,
17509          i = a[g],
17510          j = a[g + 1]
17511        if (i !== j && (1 !== g || i !== i[0]))
17512          if (d) h = !0
17513          else
17514            for (var k = g * c, l = k - c, m = k + c, n = 0; n !== c; ++n) {
17515              var o = b[k + n]
17516              if (o !== b[l + n] || o !== b[m + n]) {
17517                h = !0
17518                break
17519              }
17520            }
17521        if (h) {
17522          if (g !== e) {
17523            a[e] = a[g]
17524            for (var p = g * c, q = e * c, n = 0; n !== c; ++n)
17525              b[q + n] = b[p + n]
17526          }
17527          ++e
17528        }
17529      }
17530      if (f > 0) {
17531        a[e] = a[f]
17532        for (var p = f * c, q = e * c, n = 0; n !== c; ++n) b[q + n] = b[p + n]
17533        ++e
17534      }
17535      return (
17536        e !== a.length &&
17537          ((this.times = wh.arraySlice(a, 0, e)),
17538          (this.values = wh.arraySlice(b, 0, e * c))),
17539        this
17540      )
17541    }
17542  }),
17543    (Dh.prototype = Object.assign(Object.create(Bh), {
17544      constructor: Dh,
17545      ValueTypeName: 'vector'
17546    })),
17547    (Eh.prototype = Object.assign(Object.create(xh.prototype), {
17548      constructor: Eh,
17549      interpolate_: function (a, b, c, d) {
17550        for (
17551          var e = this.resultBuffer,
17552            f = this.sampleValues,
17553            g = this.valueSize,
17554            h = a * g,
17555            i = (c - b) / (d - b),
17556            j = h + g;
17557          h !== j;
17558          h += 4
17559        )
17560          Ab.slerpFlat(e, 0, f, h - g, f, h, i)
17561        return e
17562      }
17563    })),
17564    (Fh.prototype = Object.assign(Object.create(Bh), {
17565      constructor: Fh,
17566      ValueTypeName: 'quaternion',
17567      DefaultInterpolation: bb,
17568      InterpolantFactoryMethodLinear: function (a) {
17569        return new Eh(this.times, this.values, this.getValueSize(), a)
17570      },
17571      InterpolantFactoryMethodSmooth: void 0
17572    })),
17573    (Gh.prototype = Object.assign(Object.create(Bh), {
17574      constructor: Gh,
17575      ValueTypeName: 'number'
17576    })),
17577    (Hh.prototype = Object.assign(Object.create(Bh), {
17578      constructor: Hh,
17579      ValueTypeName: 'string',
17580      ValueBufferType: Array,
17581      DefaultInterpolation: ab,
17582      InterpolantFactoryMethodLinear: void 0,
17583      InterpolantFactoryMethodSmooth: void 0
17584    })),
17585    (Ih.prototype = Object.assign(Object.create(Bh), {
17586      constructor: Ih,
17587      ValueTypeName: 'bool',
17588      ValueBufferType: Array,
17589      DefaultInterpolation: ab,
17590      InterpolantFactoryMethodLinear: void 0,
17591      InterpolantFactoryMethodSmooth: void 0
17592    })),
17593    (Jh.prototype = Object.assign(Object.create(Bh), {
17594      constructor: Jh,
17595      ValueTypeName: 'color'
17596    })),
17597    (Kh.prototype = Bh),
17598    (Bh.constructor = Kh),
17599    Object.assign(Kh, {
17600      parse: function (a) {
17601        if (void 0 === a.type)
17602          throw new Error('track type undefined, can not parse')
17603        var b = Kh._getTrackTypeForValueTypeName(a.type)
17604        if (void 0 === a.times) {
17605          var c = [],
17606            d = []
17607          wh.flattenJSON(a.keys, c, d, 'value'), (a.times = c), (a.values = d)
17608        }
17609        return void 0 !== b.parse
17610          ? b.parse(a)
17611          : new b(a.name, a.times, a.values, a.interpolation)
17612      },
17613      toJSON: function (a) {
17614        var c,
17615          b = a.constructor
17616        if (void 0 !== b.toJSON) c = b.toJSON(a)
17617        else {
17618          c = {
17619            name: a.name,
17620            times: wh.convertArray(a.times, Array),
17621            values: wh.convertArray(a.values, Array)
17622          }
17623          var d = a.getInterpolation()
17624          d !== a.DefaultInterpolation && (c.interpolation = d)
17625        }
17626        return (c.type = a.ValueTypeName), c
17627      },
17628      _getTrackTypeForValueTypeName: function (a) {
17629        switch (a.toLowerCase()) {
17630          case 'scalar':
17631          case 'double':
17632          case 'float':
17633          case 'number':
17634          case 'integer':
17635            return Gh
17636          case 'vector':
17637          case 'vector2':
17638          case 'vector3':
17639          case 'vector4':
17640            return Dh
17641          case 'color':
17642            return Jh
17643          case 'quaternion':
17644            return Fh
17645          case 'bool':
17646          case 'boolean':
17647            return Ih
17648          case 'string':
17649            return Hh
17650        }
17651        throw new Error('Unsupported typeName: ' + a)
17652      }
17653    }),
17654    (Lh.prototype = {
17655      constructor: Lh,
17656      resetDuration: function () {
17657        for (var a = this.tracks, b = 0, c = 0, d = a.length; c !== d; ++c) {
17658          var e = this.tracks[c]
17659          b = Math.max(b, e.times[e.times.length - 1])
17660        }
17661        this.duration = b
17662      },
17663      trim: function () {
17664        for (var a = 0; a < this.tracks.length; a++)
17665          this.tracks[a].trim(0, this.duration)
17666        return this
17667      },
17668      optimize: function () {
17669        for (var a = 0; a < this.tracks.length; a++) this.tracks[a].optimize()
17670        return this
17671      }
17672    }),
17673    Object.assign(Lh, {
17674      parse: function (a) {
17675        for (
17676          var b = [], c = a.tracks, d = 1 / (a.fps || 1), e = 0, f = c.length;
17677          e !== f;
17678          ++e
17679        )
17680          b.push(Kh.parse(c[e]).scale(d))
17681        return new Lh(a.name, a.duration, b)
17682      },
17683      toJSON: function (a) {
17684        for (
17685          var b = [],
17686            c = a.tracks,
17687            d = { name: a.name, duration: a.duration, tracks: b },
17688            e = 0,
17689            f = c.length;
17690          e !== f;
17691          ++e
17692        )
17693          b.push(Kh.toJSON(c[e]))
17694        return d
17695      },
17696      CreateFromMorphTargetSequence: function (a, b, c, d) {
17697        for (var e = b.length, f = [], g = 0; g < e; g++) {
17698          var h = [],
17699            i = []
17700          h.push((g + e - 1) % e, g, (g + 1) % e), i.push(0, 1, 0)
17701          var j = wh.getKeyframeOrder(h)
17702          ;(h = wh.sortedArray(h, 1, j)),
17703            (i = wh.sortedArray(i, 1, j)),
17704            d || 0 !== h[0] || (h.push(e), i.push(i[0])),
17705            f.push(
17706              new Gh('.morphTargetInfluences[' + b[g].name + ']', h, i).scale(
17707                1 / c
17708              )
17709            )
17710        }
17711        return new Lh(a, -1, f)
17712      },
17713      findByName: function (a, b) {
17714        var c = a
17715        if (!Array.isArray(a)) {
17716          var d = a
17717          c = (d.geometry && d.geometry.animations) || d.animations
17718        }
17719        for (var e = 0; e < c.length; e++) if (c[e].name === b) return c[e]
17720        return null
17721      },
17722      CreateClipsFromMorphTargetSequences: function (a, b, c) {
17723        for (
17724          var d = {}, e = /^([\w-]*?)([\d]+)$/, f = 0, g = a.length;
17725          f < g;
17726          f++
17727        ) {
17728          var h = a[f],
17729            i = h.name.match(e)
17730          if (i && i.length > 1) {
17731            var j = i[1],
17732              k = d[j]
17733            k || (d[j] = k = []), k.push(h)
17734          }
17735        }
17736        var l = []
17737        for (var j in d) l.push(Lh.CreateFromMorphTargetSequence(j, d[j], b, c))
17738        return l
17739      },
17740      parseAnimation: function (a, b) {
17741        if (!a) return console.error('  no animation in JSONLoader data'), null
17742        for (
17743          var c = function (a, b, c, d, e) {
17744              if (0 !== c.length) {
17745                var f = [],
17746                  g = []
17747                wh.flattenJSON(c, f, g, d),
17748                  0 !== f.length && e.push(new a(b, f, g))
17749              }
17750            },
17751            d = [],
17752            e = a.name || 'default',
17753            f = a.length || -1,
17754            g = a.fps || 30,
17755            h = a.hierarchy || [],
17756            i = 0;
17757          i < h.length;
17758          i++
17759        ) {
17760          var j = h[i].keys
17761          if (j && 0 !== j.length)
17762            if (j[0].morphTargets) {
17763              for (var k = {}, l = 0; l < j.length; l++)
17764                if (j[l].morphTargets)
17765                  for (var m = 0; m < j[l].morphTargets.length; m++)
17766                    k[j[l].morphTargets[m]] = -1
17767              for (var n in k) {
17768                for (
17769                  var o = [], p = [], m = 0;
17770                  m !== j[l].morphTargets.length;
17771                  ++m
17772                ) {
17773                  var q = j[l]
17774                  o.push(q.time), p.push(q.morphTarget === n ? 1 : 0)
17775                }
17776                d.push(new Gh('.morphTargetInfluence[' + n + ']', o, p))
17777              }
17778              f = k.length * (g || 1)
17779            } else {
17780              var r = '.bones[' + b[i].name + ']'
17781              c(Dh, r + '.position', j, 'pos', d),
17782                c(Fh, r + '.quaternion', j, 'rot', d),
17783                c(Dh, r + '.scale', j, 'scl', d)
17784            }
17785        }
17786        if (0 === d.length) return null
17787        var s = new Lh(e, f, d)
17788        return s
17789      }
17790    }),
17791    Object.assign(Mh.prototype, {
17792      load: function (a, b, c, d) {
17793        var e = this,
17794          f = new hh(e.manager)
17795        f.load(
17796          a,
17797          function (a) {
17798            b(e.parse(JSON.parse(a)))
17799          },
17800          c,
17801          d
17802        )
17803      },
17804      setTextures: function (a) {
17805        this.textures = a
17806      },
17807      parse: function (a) {
17808        function c(a) {
17809          return (
17810            void 0 === b[a] &&
17811              console.warn('THREE.MaterialLoader: Undefined texture', a),
17812            b[a]
17813          )
17814        }
17815        var b = this.textures,
17816          d = new dh[a.type]()
17817        if (
17818          (void 0 !== a.uuid && (d.uuid = a.uuid),
17819          void 0 !== a.name && (d.name = a.name),
17820          void 0 !== a.color && d.color.setHex(a.color),
17821          void 0 !== a.roughness && (d.roughness = a.roughness),
17822          void 0 !== a.metalness && (d.metalness = a.metalness),
17823          void 0 !== a.emissive && d.emissive.setHex(a.emissive),
17824          void 0 !== a.specular && d.specular.setHex(a.specular),
17825          void 0 !== a.shininess && (d.shininess = a.shininess),
17826          void 0 !== a.clearCoat && (d.clearCoat = a.clearCoat),
17827          void 0 !== a.clearCoatRoughness &&
17828            (d.clearCoatRoughness = a.clearCoatRoughness),
17829          void 0 !== a.uniforms && (d.uniforms = a.uniforms),
17830          void 0 !== a.vertexShader && (d.vertexShader = a.vertexShader),
17831          void 0 !== a.fragmentShader && (d.fragmentShader = a.fragmentShader),
17832          void 0 !== a.vertexColors && (d.vertexColors = a.vertexColors),
17833          void 0 !== a.fog && (d.fog = a.fog),
17834          void 0 !== a.shading && (d.shading = a.shading),
17835          void 0 !== a.blending && (d.blending = a.blending),
17836          void 0 !== a.side && (d.side = a.side),
17837          void 0 !== a.opacity && (d.opacity = a.opacity),
17838          void 0 !== a.transparent && (d.transparent = a.transparent),
17839          void 0 !== a.alphaTest && (d.alphaTest = a.alphaTest),
17840          void 0 !== a.depthTest && (d.depthTest = a.depthTest),
17841          void 0 !== a.depthWrite && (d.depthWrite = a.depthWrite),
17842          void 0 !== a.colorWrite && (d.colorWrite = a.colorWrite),
17843          void 0 !== a.wireframe && (d.wireframe = a.wireframe),
17844          void 0 !== a.wireframeLinewidth &&
17845            (d.wireframeLinewidth = a.wireframeLinewidth),
17846          void 0 !== a.wireframeLinecap &&
17847            (d.wireframeLinecap = a.wireframeLinecap),
17848          void 0 !== a.wireframeLinejoin &&
17849            (d.wireframeLinejoin = a.wireframeLinejoin),
17850          void 0 !== a.skinning && (d.skinning = a.skinning),
17851          void 0 !== a.morphTargets && (d.morphTargets = a.morphTargets),
17852          void 0 !== a.size && (d.size = a.size),
17853          void 0 !== a.sizeAttenuation &&
17854            (d.sizeAttenuation = a.sizeAttenuation),
17855          void 0 !== a.map && (d.map = c(a.map)),
17856          void 0 !== a.alphaMap &&
17857            ((d.alphaMap = c(a.alphaMap)), (d.transparent = !0)),
17858          void 0 !== a.bumpMap && (d.bumpMap = c(a.bumpMap)),
17859          void 0 !== a.bumpScale && (d.bumpScale = a.bumpScale),
17860          void 0 !== a.normalMap && (d.normalMap = c(a.normalMap)),
17861          void 0 !== a.normalScale)
17862        ) {
17863          var e = a.normalScale
17864          Array.isArray(e) === !1 && (e = [e, e]),
17865            (d.normalScale = new ub().fromArray(e))
17866        }
17867        if (
17868          (void 0 !== a.displacementMap &&
17869            (d.displacementMap = c(a.displacementMap)),
17870          void 0 !== a.displacementScale &&
17871            (d.displacementScale = a.displacementScale),
17872          void 0 !== a.displacementBias &&
17873            (d.displacementBias = a.displacementBias),
17874          void 0 !== a.roughnessMap && (d.roughnessMap = c(a.roughnessMap)),
17875          void 0 !== a.metalnessMap && (d.metalnessMap = c(a.metalnessMap)),
17876          void 0 !== a.emissiveMap && (d.emissiveMap = c(a.emissiveMap)),
17877          void 0 !== a.emissiveIntensity &&
17878            (d.emissiveIntensity = a.emissiveIntensity),
17879          void 0 !== a.specularMap && (d.specularMap = c(a.specularMap)),
17880          void 0 !== a.envMap && (d.envMap = c(a.envMap)),
17881          void 0 !== a.reflectivity && (d.reflectivity = a.reflectivity),
17882          void 0 !== a.lightMap && (d.lightMap = c(a.lightMap)),
17883          void 0 !== a.lightMapIntensity &&
17884            (d.lightMapIntensity = a.lightMapIntensity),
17885          void 0 !== a.aoMap && (d.aoMap = c(a.aoMap)),
17886          void 0 !== a.aoMapIntensity && (d.aoMapIntensity = a.aoMapIntensity),
17887          void 0 !== a.gradientMap && (d.gradientMap = c(a.gradientMap)),
17888          void 0 !== a.materials)
17889        )
17890          for (var f = 0, g = a.materials.length; f < g; f++)
17891            d.materials.push(this.parse(a.materials[f]))
17892        return d
17893      }
17894    }),
17895    Object.assign(Nh.prototype, {
17896      load: function (a, b, c, d) {
17897        var e = this,
17898          f = new hh(e.manager)
17899        f.load(
17900          a,
17901          function (a) {
17902            b(e.parse(JSON.parse(a)))
17903          },
17904          c,
17905          d
17906        )
17907      },
17908      parse: function (a) {
17909        var b = new ff(),
17910          c = a.data.index,
17911          d = {
17912            Int8Array: Int8Array,
17913            Uint8Array: Uint8Array,
17914            Uint8ClampedArray: Uint8ClampedArray,
17915            Int16Array: Int16Array,
17916            Uint16Array: Uint16Array,
17917            Int32Array: Int32Array,
17918            Uint32Array: Uint32Array,
17919            Float32Array: Float32Array,
17920            Float64Array: Float64Array
17921          }
17922        if (void 0 !== c) {
17923          var e = new d[c.type](c.array)
17924          b.setIndex(new Se(e, 1))
17925        }
17926        var f = a.data.attributes
17927        for (var g in f) {
17928          var h = f[g],
17929            e = new d[h.type](h.array)
17930          b.addAttribute(g, new Se(e, h.itemSize, h.normalized))
17931        }
17932        var i = a.data.groups || a.data.drawcalls || a.data.offsets
17933        if (void 0 !== i)
17934          for (var j = 0, k = i.length; j !== k; ++j) {
17935            var l = i[j]
17936            b.addGroup(l.start, l.count, l.materialIndex)
17937          }
17938        var m = a.data.boundingSphere
17939        if (void 0 !== m) {
17940          var n = new Bb()
17941          void 0 !== m.center && n.fromArray(m.center),
17942            (b.boundingSphere = new Ee(n, m.radius))
17943        }
17944        return b
17945      }
17946    }),
17947    (Oh.prototype = {
17948      constructor: Oh,
17949      crossOrigin: void 0,
17950      extractUrlBase: function (a) {
17951        var b = a.split('/')
17952        return 1 === b.length ? './' : (b.pop(), b.join('/') + '/')
17953      },
17954      initMaterials: function (a, b, c) {
17955        for (var d = [], e = 0; e < a.length; ++e)
17956          d[e] = this.createMaterial(a[e], b, c)
17957        return d
17958      },
17959      createMaterial: (function () {
17960        var b,
17961          c,
17962          d,
17963          a = {
17964            NoBlending: v,
17965            NormalBlending: w,
17966            AdditiveBlending: x,
17967            SubtractiveBlending: y,
17968            MultiplyBlending: z,
17969            CustomBlending: A
17970          }
17971        return function (f, g, h) {
17972          function j(a, b, d, e, f) {
17973            var l,
17974              j = g + a,
17975              k = Oh.Handlers.get(j)
17976            null !== k
17977              ? (l = k.load(j))
17978              : (c.setCrossOrigin(h), (l = c.load(j))),
17979              void 0 !== b &&
17980                (l.repeat.fromArray(b),
17981                1 !== b[0] && (l.wrapS = na),
17982                1 !== b[1] && (l.wrapT = na)),
17983              void 0 !== d && l.offset.fromArray(d),
17984              void 0 !== e &&
17985                ('repeat' === e[0] && (l.wrapS = na),
17986                'mirror' === e[0] && (l.wrapS = pa),
17987                'repeat' === e[1] && (l.wrapT = na),
17988                'mirror' === e[1] && (l.wrapT = pa)),
17989              void 0 !== f && (l.anisotropy = f)
17990            var m = tb.generateUUID()
17991            return (i[m] = l), m
17992          }
17993          void 0 === b && (b = new re()),
17994            void 0 === c && (c = new mh()),
17995            void 0 === d && (d = new Mh())
17996          var i = {},
17997            k = { uuid: tb.generateUUID(), type: 'MeshLambertMaterial' }
17998          for (var l in f) {
17999            var m = f[l]
18000            switch (l) {
18001              case 'DbgColor':
18002              case 'DbgIndex':
18003              case 'opticalDensity':
18004              case 'illumination':
18005                break
18006              case 'DbgName':
18007                k.name = m
18008                break
18009              case 'blending':
18010                k.blending = a[m]
18011                break
18012              case 'colorAmbient':
18013              case 'mapAmbient':
18014                console.warn(
18015                  'THREE.Loader.createMaterial:',
18016                  l,
18017                  'is no longer supported.'
18018                )
18019                break
18020              case 'colorDiffuse':
18021                k.color = b.fromArray(m).getHex()
18022                break
18023              case 'colorSpecular':
18024                k.specular = b.fromArray(m).getHex()
18025                break
18026              case 'colorEmissive':
18027                k.emissive = b.fromArray(m).getHex()
18028                break
18029              case 'specularCoef':
18030                k.shininess = m
18031                break
18032              case 'shading':
18033                'basic' === m.toLowerCase() && (k.type = 'MeshBasicMaterial'),
18034                  'phong' === m.toLowerCase() && (k.type = 'MeshPhongMaterial'),
18035                  'standard' === m.toLowerCase() &&
18036                    (k.type = 'MeshStandardMaterial')
18037                break
18038              case 'mapDiffuse':
18039                k.map = j(
18040                  m,
18041                  f.mapDiffuseRepeat,
18042                  f.mapDiffuseOffset,
18043                  f.mapDiffuseWrap,
18044                  f.mapDiffuseAnisotropy
18045                )
18046                break
18047              case 'mapDiffuseRepeat':
18048              case 'mapDiffuseOffset':
18049              case 'mapDiffuseWrap':
18050              case 'mapDiffuseAnisotropy':
18051                break
18052              case 'mapEmissive':
18053                k.emissiveMap = j(
18054                  m,
18055                  f.mapEmissiveRepeat,
18056                  f.mapEmissiveOffset,
18057                  f.mapEmissiveWrap,
18058                  f.mapEmissiveAnisotropy
18059                )
18060                break
18061              case 'mapEmissiveRepeat':
18062              case 'mapEmissiveOffset':
18063              case 'mapEmissiveWrap':
18064              case 'mapEmissiveAnisotropy':
18065                break
18066              case 'mapLight':
18067                k.lightMap = j(
18068                  m,
18069                  f.mapLightRepeat,
18070                  f.mapLightOffset,
18071                  f.mapLightWrap,
18072                  f.mapLightAnisotropy
18073                )
18074                break
18075              case 'mapLightRepeat':
18076              case 'mapLightOffset':
18077              case 'mapLightWrap':
18078              case 'mapLightAnisotropy':
18079                break
18080              case 'mapAO':
18081                k.aoMap = j(
18082                  m,
18083                  f.mapAORepeat,
18084                  f.mapAOOffset,
18085                  f.mapAOWrap,
18086                  f.mapAOAnisotropy
18087                )
18088                break
18089              case 'mapAORepeat':
18090              case 'mapAOOffset':
18091              case 'mapAOWrap':
18092              case 'mapAOAnisotropy':
18093                break
18094              case 'mapBump':
18095                k.bumpMap = j(
18096                  m,
18097                  f.mapBumpRepeat,
18098                  f.mapBumpOffset,
18099                  f.mapBumpWrap,
18100                  f.mapBumpAnisotropy
18101                )
18102                break
18103              case 'mapBumpScale':
18104                k.bumpScale = m
18105                break
18106              case 'mapBumpRepeat':
18107              case 'mapBumpOffset':
18108              case 'mapBumpWrap':
18109              case 'mapBumpAnisotropy':
18110                break
18111              case 'mapNormal':
18112                k.normalMap = j(
18113                  m,
18114                  f.mapNormalRepeat,
18115                  f.mapNormalOffset,
18116                  f.mapNormalWrap,
18117                  f.mapNormalAnisotropy
18118                )
18119                break
18120              case 'mapNormalFactor':
18121                k.normalScale = [m, m]
18122                break
18123              case 'mapNormalRepeat':
18124              case 'mapNormalOffset':
18125              case 'mapNormalWrap':
18126              case 'mapNormalAnisotropy':
18127                break
18128              case 'mapSpecular':
18129                k.specularMap = j(
18130                  m,
18131                  f.mapSpecularRepeat,
18132                  f.mapSpecularOffset,
18133                  f.mapSpecularWrap,
18134                  f.mapSpecularAnisotropy
18135                )
18136                break
18137              case 'mapSpecularRepeat':
18138              case 'mapSpecularOffset':
18139              case 'mapSpecularWrap':
18140              case 'mapSpecularAnisotropy':
18141                break
18142              case 'mapMetalness':
18143                k.metalnessMap = j(
18144                  m,
18145                  f.mapMetalnessRepeat,
18146                  f.mapMetalnessOffset,
18147                  f.mapMetalnessWrap,
18148                  f.mapMetalnessAnisotropy
18149                )
18150                break
18151              case 'mapMetalnessRepeat':
18152              case 'mapMetalnessOffset':
18153              case 'mapMetalnessWrap':
18154              case 'mapMetalnessAnisotropy':
18155                break
18156              case 'mapRoughness':
18157                k.roughnessMap = j(
18158                  m,
18159                  f.mapRoughnessRepeat,
18160                  f.mapRoughnessOffset,
18161                  f.mapRoughnessWrap,
18162                  f.mapRoughnessAnisotropy
18163                )
18164                break
18165              case 'mapRoughnessRepeat':
18166              case 'mapRoughnessOffset':
18167              case 'mapRoughnessWrap':
18168              case 'mapRoughnessAnisotropy':
18169                break
18170              case 'mapAlpha':
18171                k.alphaMap = j(
18172                  m,
18173                  f.mapAlphaRepeat,
18174                  f.mapAlphaOffset,
18175                  f.mapAlphaWrap,
18176                  f.mapAlphaAnisotropy
18177                )
18178                break
18179              case 'mapAlphaRepeat':
18180              case 'mapAlphaOffset':
18181              case 'mapAlphaWrap':
18182              case 'mapAlphaAnisotropy':
18183                break
18184              case 'flipSided':
18185                k.side = o
18186                break
18187              case 'doubleSided':
18188                k.side = p
18189                break
18190              case 'transparency':
18191                console.warn(
18192                  'THREE.Loader.createMaterial: transparency has been renamed to opacity'
18193                ),
18194                  (k.opacity = m)
18195                break
18196              case 'depthTest':
18197              case 'depthWrite':
18198              case 'colorWrite':
18199              case 'opacity':
18200              case 'reflectivity':
18201              case 'transparent':
18202              case 'visible':
18203              case 'wireframe':
18204                k[l] = m
18205                break
18206              case 'vertexColors':
18207                m === !0 && (k.vertexColors = u),
18208                  'face' === m && (k.vertexColors = t)
18209                break
18210              default:
18211                console.error('THREE.Loader.createMaterial: Unsupported', l, m)
18212            }
18213          }
18214          return (
18215            'MeshBasicMaterial' === k.type && delete k.emissive,
18216            'MeshPhongMaterial' !== k.type && delete k.specular,
18217            k.opacity < 1 && (k.transparent = !0),
18218            d.setTextures(i),
18219            d.parse(k)
18220          )
18221        }
18222      })()
18223    }),
18224    (Oh.Handlers = {
18225      handlers: [],
18226      add: function (a, b) {
18227        this.handlers.push(a, b)
18228      },
18229      get: function (a) {
18230        for (var b = this.handlers, c = 0, d = b.length; c < d; c += 2) {
18231          var e = b[c],
18232            f = b[c + 1]
18233          if (e.test(a)) return f
18234        }
18235        return null
18236      }
18237    }),
18238    Object.assign(Ph.prototype, {
18239      load: function (a, b, c, d) {
18240        var e = this,
18241          f =
18242            this.texturePath && 'string' == typeof this.texturePath
18243              ? this.texturePath
18244              : Oh.prototype.extractUrlBase(a),
18245          g = new hh(this.manager)
18246        g.setWithCredentials(this.withCredentials),
18247          g.load(
18248            a,
18249            function (c) {
18250              var d = JSON.parse(c),
18251                g = d.metadata
18252              if (void 0 !== g) {
18253                var h = g.type
18254                if (void 0 !== h) {
18255                  if ('object' === h.toLowerCase())
18256                    return void console.error(
18257                      'THREE.JSONLoader: ' +
18258                        a +
18259                        ' should be loaded with THREE.ObjectLoader instead.'
18260                    )
18261                  if ('scene' === h.toLowerCase())
18262                    return void console.error(
18263                      'THREE.JSONLoader: ' +
18264                        a +
18265                        ' should be loaded with THREE.SceneLoader instead.'
18266                    )
18267                }
18268              }
18269              var i = e.parse(d, f)
18270              b(i.geometry, i.materials)
18271            },
18272            c,
18273            d
18274          )
18275      },
18276      setTexturePath: function (a) {
18277        this.texturePath = a
18278      },
18279      parse: function (a, b) {
18280        function e(b) {
18281          function d(a, b) {
18282            return a & (1 << b)
18283          }
18284          var e,
18285            f,
18286            g,
18287            h,
18288            i,
18289            j,
18290            k,
18291            l,
18292            m,
18293            n,
18294            o,
18295            p,
18296            q,
18297            r,
18298            s,
18299            t,
18300            u,
18301            v,
18302            w,
18303            x,
18304            y,
18305            z,
18306            A,
18307            B,
18308            C,
18309            D,
18310            E,
18311            F = a.faces,
18312            G = a.vertices,
18313            H = a.normals,
18314            I = a.colors,
18315            J = 0
18316          if (void 0 !== a.uvs) {
18317            for (e = 0; e < a.uvs.length; e++) a.uvs[e].length && J++
18318            for (e = 0; e < J;
18318 e++) c.faceVertexUvs[e] = []
18319          }
18320          for (h = 0, i = G.length; h < i; )
18321            (v = new Bb()),
18322              (v.x = G[h++] * b),
18323              (v.y = G[h++] * b),
18324              (v.z = G[h++] * b),
18325              c.vertices.push(v)
18326          for (h = 0, i = F.length; h < i; )
18327            if (
18328              ((n = F[h++]),
18329              (o = d(n, 0)),
18330              (p = d(n, 1)),
18331              (q = d(n, 3)),
18332              (r = d(n, 4)),
18333              (s = d(n, 5)),
18334              (t = d(n, 6)),
18335              (u = d(n, 7)),
18336              o)
18337            ) {
18338              if (
18339                ((x = new Qe()),
18340                (x.a = F[h]),
18341                (x.b = F[h + 1]),
18342                (x.c = F[h + 3]),
18343                (y = new Qe()),
18344                (y.a = F[h + 1]),
18345                (y.b = F[h + 2]),
18346                (y.c = F[h + 3]),
18347                (h += 4),
18348                p &&
18349                  ((m = F[h++]), (x.materialIndex = m), (y.materialIndex = m)),
18350                (g = c.faces.length),
18351                q)
18352              )
18353                for (e = 0; e < J; e++)
18354                  for (
18355                    B = a.uvs[e],
18356                      c.faceVertexUvs[e][g] = [],
18357                      c.faceVertexUvs[e][g + 1] = [],
18358                      f = 0;
18359                    f < 4;
18360                    f++
18361                  )
18362                    (l = F[h++]),
18363                      (D = B[2 * l]),
18364                      (E = B[2 * l + 1]),
18365                      (C = new ub(D, E)),
18366                      2 !== f && c.faceVertexUvs[e][g].push(C),
18367                      0 !== f && c.faceVertexUvs[e][g + 1].push(C)
18368              if (
18369                (r &&
18370                  ((k = 3 * F[h++]),
18371                  x.normal.set(H[k++], H[k++], H[k]),
18372                  y.normal.copy(x.normal)),
18373                s)
18374              )
18375                for (e = 0; e < 4; e++)
18376                  (k = 3 * F[h++]),
18377                    (A = new Bb(H[k++], H[k++], H[k])),
18378                    2 !== e && x.vertexNormals.push(A),
18379                    0 !== e && y.vertexNormals.push(A)
18380              if (
18381                (t &&
18382                  ((j = F[h++]),
18383                  (z = I[j]),
18384                  x.color.setHex(z),
18385                  y.color.setHex(z)),
18386                u)
18387              )
18388                for (e = 0; e < 4; e++)
18389                  (j = F[h++]),
18390                    (z = I[j]),
18391                    2 !== e && x.vertexColors.push(new re(z)),
18392                    0 !== e && y.vertexColors.push(new re(z))
18393              c.faces.push(x), c.faces.push(y)
18394            } else {
18395              if (
18396                ((w = new Qe()),
18397                (w.a = F[h++]),
18398                (w.b = F[h++]),
18399                (w.c = F[h++]),
18400                p && ((m = F[h++]), (w.materialIndex = m)),
18401                (g = c.faces.length),
18402                q)
18403              )
18404                for (e = 0; e < J; e++)
18405                  for (
18406                    B = a.uvs[e], c.faceVertexUvs[e][g] = [], f = 0;
18407                    f < 3;
18408                    f++
18409                  )
18410                    (l = F[h++]),
18411                      (D = B[2 * l]),
18412                      (E = B[2 * l + 1]),
18413                      (C = new ub(D, E)),
18414                      c.faceVertexUvs[e][g].push(C)
18415              if (
18416                (r && ((k = 3 * F[h++]), w.normal.set(H[k++], H[k++], H[k])), s)
18417              )
18418                for (e = 0; e < 3; e++)
18419                  (k = 3 * F[h++]),
18420                    (A = new Bb(H[k++], H[k++], H[k])),
18421                    w.vertexNormals.push(A)
18422              if ((t && ((j = F[h++]), w.color.setHex(I[j])), u))
18423                for (e = 0; e < 3; e++)
18424                  (j = F[h++]), w.vertexColors.push(new re(I[j]))
18425              c.faces.push(w)
18426            }
18427        }
18428        function f() {
18429          var b = void 0 !== a.influencesPerVertex ? a.influencesPerVertex : 2
18430          if (a.skinWeights)
18431            for (var d = 0, e = a.skinWeights.length; d < e; d += b) {
18432              var f = a.skinWeights[d],
18433                g = b > 1 ? a.skinWeights[d + 1] : 0,
18434                h = b > 2 ? a.skinWeights[d + 2] : 0,
18435                i = b > 3 ? a.skinWeights[d + 3] : 0
18436              c.skinWeights.push(new xb(f, g, h, i))
18437            }
18438          if (a.skinIndices)
18439            for (var d = 0, e = a.skinIndices.length; d < e; d += b) {
18440              var j = a.skinIndices[d],
18441                k = b > 1 ? a.skinIndices[d + 1] : 0,
18442                l = b > 2 ? a.skinIndices[d + 2] : 0,
18443                m = b > 3 ? a.skinIndices[d + 3] : 0
18444              c.skinIndices.push(new xb(j, k, l, m))
18445            }
18446          ;(c.bones = a.bones),
18447            c.bones &&
18448              c.bones.length > 0 &&
18449              (c.skinWeights.length !== c.skinIndices.length ||
18450                c.skinIndices.length !== c.vertices.length) &&
18451              console.warn(
18452                'When skinning, number of vertices (' +
18453                  c.vertices.length +
18454                  '), skinIndices (' +
18455                  c.skinIndices.length +
18456                  '), and skinWeights (' +
18457                  c.skinWeights.length +
18458                  ') should match.'
18459              )
18460        }
18461        function g(b) {
18462          if (void 0 !== a.morphTargets)
18463            for (var d = 0, e = a.morphTargets.length; d < e; d++) {
18464              ;(c.morphTargets[d] = {}),
18465                (c.morphTargets[d].name = a.morphTargets[d].name),
18466                (c.morphTargets[d].vertices = [])
18467              for (
18468                var f = c.morphTargets[d].vertices,
18469                  g = a.morphTargets[d].vertices,
18470                  h = 0,
18471                  i = g.length;
18472                h < i;
18473                h += 3
18474              ) {
18475                var j = new Bb()
18476                ;(j.x = g[h] * b),
18477                  (j.y = g[h + 1] * b),
18478                  (j.z = g[h + 2] * b),
18479                  f.push(j)
18480              }
18481            }
18482          if (void 0 !== a.morphColors && a.morphColors.length > 0) {
18483            console.warn(
18484              'THREE.JSONLoader: "morphColors" no longer supported. Using them as face colors.'
18485            )
18486            for (
18487              var k = c.faces, l = a.morphColors[0].colors, d = 0, e = k.length;
18488              d < e;
18489              d++
18490            )
18491              k[d].color.fromArray(l, 3 * d)
18492          }
18493        }
18494        function h() {
18495          var b = [],
18496            d = []
18497          void 0 !== a.animation && d.push(a.animation),
18498            void 0 !== a.animations &&
18499              (a.animations.length
18500                ? (d = d.concat(a.animations))
18501                : d.push(a.animations))
18502          for (var e = 0; e < d.length; e++) {
18503            var f = Lh.parseAnimation(d[e], c.bones)
18504            f && b.push(f)
18505          }
18506          if (c.morphTargets) {
18507            var g = Lh.CreateClipsFromMorphTargetSequences(c.morphTargets, 10)
18508            b = b.concat(g)
18509          }
18510          b.length > 0 && (c.animations = b)
18511        }
18512        var c = new ef(),
18513          d = void 0 !== a.scale ? 1 / a.scale : 1
18514        if (
18515          (e(d),
18516          f(),
18517          g(d),
18518          h(),
18519          c.computeFaceNormals(),
18520          c.computeBoundingSphere(),
18521          void 0 === a.materials || 0 === a.materials.length)
18522        )
18523          return { geometry: c }
18524        var i = Oh.prototype.initMaterials(a.materials, b, this.crossOrigin)
18525        return { geometry: c, materials: i }
18526      }
18527    }),
18528    Object.assign(Qh.prototype, {
18529      load: function (a, b, c, d) {
18530        '' === this.texturePath &&
18531          (this.texturePath = a.substring(0, a.lastIndexOf('/') + 1))
18532        var e = this,
18533          f = new hh(e.manager)
18534        f.load(
18535          a,
18536          function (c) {
18537            var f = null
18538            try {
18539              f = JSON.parse(c)
18540            } catch (b) {
18541              return (
18542                void 0 !== d && d(b),
18543                void console.error(
18544                  "THREE:ObjectLoader: Can't parse " + a + '.',
18545                  b.message
18546                )
18547              )
18548            }
18549            var g = f.metadata
18550            return void 0 === g ||
18551              void 0 === g.type ||
18552              'geometry' === g.type.toLowerCase()
18553              ? void console.error(
18554                  "THREE.ObjectLoader: Can't load " +
18555                    a +
18556                    '. Use THREE.JSONLoader instead.'
18557                )
18558              : void e.parse(f, b)
18559          },
18560          c,
18561          d
18562        )
18563      },
18564      setTexturePath: function (a) {
18565        this.texturePath = a
18566      },
18567      setCrossOrigin: function (a) {
18568        this.crossOrigin = a
18569      },
18570      parse: function (a, b) {
18571        var c = this.parseGeometries(a.geometries),
18572          d = this.parseImages(a.images, function () {
18573            void 0 !== b && b(g)
18574          }),
18575          e = this.parseTextures(a.textures, d),
18576          f = this.parseMaterials(a.materials, e),
18577          g = this.parseObject(a.object, c, f)
18578        return (
18579          a.animations && (g.animations = this.parseAnimations(a.animations)),
18580          (void 0 !== a.images && 0 !== a.images.length) ||
18581            (void 0 !== b && b(g)),
18582          g
18583        )
18584      },
18585      parseGeometries: function (a) {
18586        var b = {}
18587        if (void 0 !== a)
18588          for (
18589            var c = new Ph(), d = new Nh(), e = 0, f = a.length;
18590            e < f;
18591            e++
18592          ) {
18593            var g,
18594              h = a[e]
18595            switch (h.type) {
18596              case 'PlaneGeometry':
18597              case 'PlaneBufferGeometry':
18598                g = new Ug[h.type](
18599                  h.width,
18600                  h.height,
18601                  h.widthSegments,
18602                  h.heightSegments
18603                )
18604                break
18605              case 'BoxGeometry':
18606              case 'BoxBufferGeometry':
18607              case 'CubeGeometry':
18608                g = new Ug[h.type](
18609                  h.width,
18610                  h.height,
18611                  h.depth,
18612                  h.widthSegments,
18613                  h.heightSegments,
18614                  h.depthSegments
18615                )
18616                break
18617              case 'CircleGeometry':
18618              case 'CircleBufferGeometry':
18619                g = new Ug[h.type](
18620                  h.radius,
18621                  h.segments,
18622                  h.thetaStart,
18623                  h.thetaLength
18624                )
18625                break
18626              case 'CylinderGeometry':
18627              case 'CylinderBufferGeometry':
18628                g = new Ug[h.type](
18629                  h.radiusTop,
18630                  h.radiusBottom,
18631                  h.height,
18632                  h.radialSegments,
18633                  h.heightSegments,
18634                  h.openEnded,
18635                  h.thetaStart,
18636                  h.thetaLength
18637                )
18638                break
18639              case 'ConeGeometry':
18640              case 'ConeBufferGeometry':
18641                g = new Ug[h.type](
18642                  h.radius,
18643                  h.height,
18644                  h.radialSegments,
18645                  h.heightSegments,
18646                  h.openEnded,
18647                  h.thetaStart,
18648                  h.thetaLength
18649                )
18650                break
18651              case 'SphereGeometry':
18652              case 'SphereBufferGeometry':
18653                g = new Ug[h.type](
18654                  h.radius,
18655                  h.widthSegments,
18656                  h.heightSegments,
18657                  h.phiStart,
18658                  h.phiLength,
18659                  h.thetaStart,
18660                  h.thetaLength
18661                )
18662                break
18663              case 'DodecahedronGeometry':
18664              case 'IcosahedronGeometry':
18665              case 'OctahedronGeometry':
18666              case 'TetrahedronGeometry':
18667                g = new Ug[h.type](h.radius, h.detail)
18668                break
18669              case 'RingGeometry':
18670              case 'RingBufferGeometry':
18671                g = new Ug[h.type](
18672                  h.innerRadius,
18673                  h.outerRadius,
18674                  h.thetaSegments,
18675                  h.phiSegments,
18676                  h.thetaStart,
18677                  h.thetaLength
18678                )
18679                break
18680              case 'TorusGeometry':
18681              case 'TorusBufferGeometry':
18682                g = new Ug[h.type](
18683                  h.radius,
18684                  h.tube,
18685                  h.radialSegments,
18686                  h.tubularSegments,
18687                  h.arc
18688                )
18689                break
18690              case 'TorusKnotGeometry':
18691              case 'TorusKnotBufferGeometry':
18692                g = new Ug[h.type](
18693                  h.radius,
18694                  h.tube,
18695                  h.tubularSegments,
18696                  h.radialSegments,
18697                  h.p,
18698                  h.q
18699                )
18700                break
18701              case 'LatheGeometry':
18702              case 'LatheBufferGeometry':
18703                g = new Ug[h.type](
18704                  h.points,
18705                  h.segments,
18706                  h.phiStart,
18707                  h.phiLength
18708                )
18709                break
18710              case 'BufferGeometry':
18711                g = d.parse(h)
18712                break
18713              case 'Geometry':
18714                g = c.parse(h.data, this.texturePath).geometry
18715                break
18716              default:
18717                console.warn(
18718                  'THREE.ObjectLoader: Unsupported geometry type "' +
18719                    h.type +
18720                    '"'
18721                )
18722                continue
18723            }
18724            ;(g.uuid = h.uuid),
18725              void 0 !== h.name && (g.name = h.name),
18726              (b[h.uuid] = g)
18727          }
18728        return b
18729      },
18730      parseMaterials: function (a, b) {
18731        var c = {}
18732        if (void 0 !== a) {
18733          var d = new Mh()
18734          d.setTextures(b)
18735          for (var e = 0, f = a.length; e < f; e++) {
18736            var g = d.parse(a[e])
18737            c[g.uuid] = g
18738          }
18739        }
18740        return c
18741      },
18742      parseAnimations: function (a) {
18743        for (var b = [], c = 0; c < a.length; c++) {
18744          var d = Lh.parse(a[c])
18745          b.push(d)
18746        }
18747        return b
18748      },
18749      parseImages: function (a, b) {
18750        function e(a) {
18751          return (
18752            c.manager.itemStart(a),
18753            g.load(
18754              a,
18755              function () {
18756                c.manager.itemEnd(a)
18757              },
18758              void 0,
18759              function () {
18760                c.manager.itemError(a)
18761              }
18762            )
18763          )
18764        }
18765        var c = this,
18766          d = {}
18767        if (void 0 !== a && a.length > 0) {
18768          var f = new fh(b),
18769            g = new kh(f)
18770          g.setCrossOrigin(this.crossOrigin)
18771          for (var h = 0, i = a.length; h < i; h++) {
18772            var j = a[h],
18773              k = /^(\/\/)|([a-z]+:(\/\/)?)/i.test(j.url)
18774                ? j.url
18775                : c.texturePath + j.url
18776            d[j.uuid] = e(k)
18777          }
18778        }
18779        return d
18780      },
18781      parseTextures: function (a, b) {
18782        function f(a, b) {
18783          return 'number' == typeof a
18784            ? a
18785            : (console.warn(
18786                'THREE.ObjectLoader.parseTexture: Constant should be in numeric form.',
18787                a
18788              ),
18789              b[a])
18790        }
18791        var c = {
18792            UVMapping: fa,
18793            CubeReflectionMapping: ga,
18794            CubeRefractionMapping: ha,
18795            EquirectangularReflectionMapping: ia,
18796            EquirectangularRefractionMapping: ja,
18797            SphericalReflectionMapping: ka,
18798            CubeUVReflectionMapping: la,
18799            CubeUVRefractionMapping: ma
18800          },
18801          d = {
18802            RepeatWrapping: na,
18803            ClampToEdgeWrapping: oa,
18804            MirroredRepeatWrapping: pa
18805          },
18806          e = {
18807            NearestFilter: qa,
18808            NearestMipMapNearestFilter: ra,
18809            NearestMipMapLinearFilter: sa,
18810            LinearFilter: ta,
18811            LinearMipMapNearestFilter: ua,
18812            LinearMipMapLinearFilter: va
18813          },
18814          g = {}
18815        if (void 0 !== a)
18816          for (var h = 0, i = a.length; h < i; h++) {
18817            var j = a[h]
18818            void 0 === j.image &&
18819              console.warn(
18820                'THREE.ObjectLoader: No "image" specified for',
18821                j.uuid
18822              ),
18823              void 0 === b[j.image] &&
18824                console.warn('THREE.ObjectLoader: Undefined image', j.image)
18825            var k = new wb(b[j.image])
18826            ;(k.needsUpdate = !0),
18827              (k.uuid = j.uuid),
18828              void 0 !== j.name && (k.name = j.name),
18829              void 0 !== j.mapping && (k.mapping = f(j.mapping, c)),
18830              void 0 !== j.offset && k.offset.fromArray(j.offset),
18831              void 0 !== j.repeat && k.repeat.fromArray(j.repeat),
18832              void 0 !== j.wrap &&
18833                ((k.wrapS = f(j.wrap[0], d)), (k.wrapT = f(j.wrap[1], d))),
18834              void 0 !== j.minFilter && (k.minFilter = f(j.minFilter, e)),
18835              void 0 !== j.magFilter && (k.magFilter = f(j.magFilter, e)),
18836              void 0 !== j.anisotropy && (k.anisotropy = j.anisotropy),
18837              void 0 !== j.flipY && (k.flipY = j.flipY),
18838              (g[j.uuid] = k)
18839          }
18840        return g
18841      },
18842      parseObject: (function () {
18843        var a = new Cb()
18844        return function (c, d, e) {
18845          function g(a) {
18846            return (
18847              void 0 === d[a] &&
18848                console.warn('THREE.ObjectLoader: Undefined geometry', a),
18849              d[a]
18850            )
18851          }
18852          function h(a) {
18853            if (void 0 !== a)
18854              return (
18855                void 0 === e[a] &&
18856                  console.warn('THREE.ObjectLoader: Undefined material', a),
18857                e[a]
18858              )
18859          }
18860          var f
18861          switch (c.type) {
18862            case 'Scene':
18863              ;(f = new Tf()),
18864                void 0 !== c.background &&
18865                  Number.isInteger(c.background) &&
18866                  (f.background = new re(c.background)),
18867                void 0 !== c.fog &&
18868                  ('Fog' === c.fog.type
18869                    ? (f.fog = new Sf(c.fog.color, c.fog.near, c.fog.far))
18870                    : 'FogExp2' === c.fog.type &&
18871                      (f.fog = new Rf(c.fog.color, c.fog.density)))
18872              break
18873            case 'PerspectiveCamera':
18874              ;(f = new nf(c.fov, c.aspect, c.near, c.far)),
18875                void 0 !== c.focus && (f.focus = c.focus),
18876                void 0 !== c.zoom && (f.zoom = c.zoom),
18877                void 0 !== c.filmGauge && (f.filmGauge = c.filmGauge),
18878                void 0 !== c.filmOffset && (f.filmOffset = c.filmOffset),
18879                void 0 !== c.view && (f.view = Object.assign({}, c.view))
18880              break
18881            case 'OrthographicCamera':
18882              f = new of(c.left, c.right, c.top, c.bottom, c.near, c.far)
18883              break
18884            case 'AmbientLight':
18885              f = new vh(c.color, c.intensity)
18886              break
18887            case 'DirectionalLight':
18888              f = new uh(c.color, c.intensity)
18889              break
18890            case 'PointLight':
18891              f = new sh(c.color, c.intensity, c.distance, c.decay)
18892              break
18893            case 'SpotLight':
18894              f = new rh(
18895                c.color,
18896                c.intensity,
18897                c.distance,
18898                c.angle,
18899                c.penumbra,
18900                c.decay
18901              )
18902              break
18903            case 'HemisphereLight':
18904              f = new oh(c.color, c.groundColor, c.intensity)
18905              break
18906            case 'Mesh':
18907              var i = g(c.geometry),
18908                j = h(c.material)
18909              f = i.bones && i.bones.length > 0 ? new $f(i, j) : new gf(i, j)
18910              break
18911            case 'LOD':
18912              f = new Xf()
18913              break
18914            case 'Line':
18915              f = new ag(g(c.geometry), h(c.material), c.mode)
18916              break
18917            case 'LineSegments':
18918              f = new bg(g(c.geometry), h(c.material))
18919              break
18920            case 'PointCloud':
18921            case 'Points':
18922              f = new dg(g(c.geometry), h(c.material))
18923              break
18924            case 'Sprite':
18925              f = new Wf(h(c.material))
18926              break
18927            case 'Group':
18928              f = new eg()
18929              break
18930            case 'SkinnedMesh':
18931              console.warn(
18932                'THREE.ObjectLoader.parseObject() does not support SkinnedMesh type. Instantiates Object3D instead.'
18933              )
18934            default:
18935              f = new Ne()
18936          }
18937          if (
18938            ((f.uuid = c.uuid),
18939            void 0 !== c.name && (f.name = c.name),
18940            void 0 !== c.matrix
18941              ? (a.fromArray(c.matrix),
18942                a.decompose(f.position, f.quaternion, f.scale))
18943              : (void 0 !== c.position && f.position.fromArray(c.position),
18944                void 0 !== c.rotation && f.rotation.fromArray(c.rotation),
18945                void 0 !== c.quaternion && f.quaternion.fromArray(c.quaternion),
18946                void 0 !== c.scale && f.scale.fromArray(c.scale)),
18947            void 0 !== c.castShadow && (f.castShadow = c.castShadow),
18948            void 0 !== c.receiveShadow && (f.receiveShadow = c.receiveShadow),
18949            c.shadow &&
18950              (void 0 !== c.shadow.bias && (f.shadow.bias = c.shadow.bias),
18951              void 0 !== c.shadow.radius && (f.shadow.radius = c.shadow.radius),
18952              void 0 !== c.shadow.mapSize &&
18953                f.shadow.mapSize.fromArray(c.shadow.mapSize),
18954              void 0 !== c.shadow.camera &&
18955                (f.shadow.camera = this.parseObject(c.shadow.camera))),
18956            void 0 !== c.visible && (f.visible = c.visible),
18957            void 0 !== c.userData && (f.userData = c.userData),
18958            void 0 !== c.children)
18959          )
18960            for (var k in c.children)
18961              f.add(this.parseObject(c.children[k], d, e))
18962          if ('LOD' === c.type)
18963            for (var l = c.levels, m = 0; m < l.length; m++) {
18964              var n = l[m],
18965                k = f.getObjectByProperty('uuid', n.object)
18966              void 0 !== k && f.addLevel(k, n.distance)
18967            }
18968          return f
18969        }
18970      })()
18971    }),
18972    (_h.prototype = {
18973      constructor: _h,
18974      getPoint: function (a) {
18975        return (
18976          console.warn('THREE.Curve: Warning, getPoint() not implemented!'),
18977          null
18978        )
18979      },
18980      getPointAt: function (a) {
18981        var b = this.getUtoTmapping(a)
18982        return this.getPoint(b)
18983      },
18984      getPoints: function (a) {
18985        isNaN(a) && (a = 5)
18986        for (var b = [], c = 0; c <= a; c++) b.push(this.getPoint(c / a))
18987        return b
18988      },
18989      getSpacedPoints: function (a) {
18990        isNaN(a) && (a = 5)
18991        for (var b = [], c = 0; c <= a; c++) b.push(this.getPointAt(c / a))
18992        return b
18993      },
18994      getLength: function () {
18995        var a = this.getLengths()
18996        return a[a.length - 1]
18997      },
18998      getLengths: function (a) {
18999        if (
19000          (isNaN(a) &&
19001            (a = this.__arcLengthDivisions ? this.__arcLengthDivisions : 200),
19002          this.cacheArcLengths &&
19003            this.cacheArcLengths.length === a + 1 &&
19004            !this.needsUpdate)
19005        )
19006          return this.cacheArcLengths
19007        this.needsUpdate = !1
19008        var c,
19009          e,
19010          b = [],
19011          d = this.getPoint(0),
19012          f = 0
19013        for (b.push(0), e = 1; e <= a; e++)
19014          (c = this.getPoint(e / a)), (f += c.distanceTo(d)), b.push(f), (d = c)
19015        return (this.cacheArcLengths = b), b
19016      },
19017      updateArcLengths: function () {
19018        ;(this.needsUpdate = !0), this.getLengths()
19019      },
19020      getUtoTmapping: function (a, b) {
19021        var f,
19022          c = this.getLengths(),
19023          d = 0,
19024          e = c.length
19025        f = b ? b : a * c[e - 1]
19026        for (var i, g = 0, h = e - 1; g <= h; )
19027          if (((d = Math.floor(g + (h - g) / 2)), (i = c[d] - f), i < 0))
19028            g = d + 1
19029          else {
19030            if (!(i > 0)) {
19031              h = d
19032              break
19033            }
19034            h = d - 1
19035          }
19036        if (((d = h), c[d] === f)) {
19037          var j = d / (e - 1)
19038          return j
19039        }
19040        var k = c[d],
19041          l = c[d + 1],
19042          m = l - k,
19043          n = (f - k) / m,
19044          j = (d + n) / (e - 1)
19045        return j
19046      },
19047      getTangent: function (a) {
19048        var b = 1e-4,
19049          c = a - b,
19050          d = a + b
19051        c < 0 && (c = 0), d > 1 && (d = 1)
19052        var e = this.getPoint(c),
19053          f = this.getPoint(d),
19054          g = f.clone().sub(e)
19055        return g.normalize()
19056      },
19057      getTangentAt: function (a) {
19058        var b = this.getUtoTmapping(a)
19059        return this.getTangent(b)
19060      },
19061      computeFrenetFrames: function (a, b) {
19062        var i,
19063          j,
19064          k,
19065          c = new Bb(),
19066          d = [],
19067          e = [],
19068          f = [],
19069          g = new Bb(),
19070          h = new Cb()
19071        for (i = 0; i <= a; i++)
19072          (j = i / a), (d[i] = this.getTangentAt(j)), d[i].normalize()
19073        ;(e[0] = new Bb()), (f[0] = new Bb())
19074        var l = Number.MAX_VALUE,
19075          m = Math.abs(d[0].x),
19076          n = Math.abs(d[0].y),
19077          o = Math.abs(d[0].z)
19078        for (
19079          m <= l && ((l = m), c.set(1, 0, 0)),
19080            n <= l && ((l = n), c.set(0, 1, 0)),
19081            o <= l && c.set(0, 0, 1),
19082            g.crossVectors(d[0], c).normalize(),
19083            e[0].crossVectors(d[0], g),
19084            f[0].crossVectors(d[0], e[0]),
19085            i = 1;
19086          i <= a;
19087          i++
19088        )
19089          (e[i] = e[i - 1].clone()),
19090            (f[i] = f[i - 1].clone()),
19091            g.crossVectors(d[i - 1], d[i]),
19092            g.length() > Number.EPSILON &&
19093              (g.normalize(),
19094              (k = Math.acos(tb.clamp(d[i - 1].dot(d[i]), -1, 1))),
19095              e[i].applyMatrix4(h.makeRotationAxis(g, k))),
19096            f[i].crossVectors(d[i], e[i])
19097        if (b === !0)
19098          for (
19099            k = Math.acos(tb.clamp(e[0].dot(e[a]), -1, 1)),
19100              k /= a,
19101              d[0].dot(g.crossVectors(e[0], e[a])) > 0 && (k = -k),
19102              i = 1;
19103            i <= a;
19104            i++
19105          )
19106            e[i].applyMatrix4(h.makeRotationAxis(d[i], k * i)),
19107              f[i].crossVectors(d[i], e[i])
19108        return { tangents: d, normals: e, binormals: f }
19109      }
19110    }),
19111    (ai.prototype = Object.create(_h.prototype)),
19112    (ai.prototype.constructor = ai),
19113    (ai.prototype.isLineCurve = !0),
19114    (ai.prototype.getPoint = function (a) {
19115      if (1 === a) return this.v2.clone()
19116      var b = this.v2.clone().sub(this.v1)
19117      return b.multiplyScalar(a).add(this.v1), b
19118    }),
19119    (ai.prototype.getPointAt = function (a) {
19120      return this.getPoint(a)
19121    }),
19122    (ai.prototype.getTangent = function (a) {
19123      var b = this.v2.clone().sub(this.v1)
19124      return b.normalize()
19125    }),
19126    (bi.prototype = Object.assign(Object.create(_h.prototype), {
19127      constructor: bi,
19128      add: function (a) {
19129        this.curves.push(a)
19130      },
19131      closePath: function () {
19132        var a = this.curves[0].getPoint(0),
19133          b = this.curves[this.curves.length - 1].getPoint(1)
19134        a.equals(b) || this.curves.push(new ai(b, a))
19135      },
19136      getPoint: function (a) {
19137        for (
19138          var b = a * this.getLength(), c = this.getCurveLengths(), d = 0;
19139          d < c.length;
19140
19141        ) {
19142          if (c[d] >= b) {
19143            var e = c[d] - b,
19144              f = this.curves[d],
19145              g = f.getLength(),
19146              h = 0 === g ? 0 : 1 - e / g
19147            return f.getPointAt(h)
19148          }
19149          d++
19150        }
19151        return null
19152      },
19153      getLength: function () {
19154        var a = this.getCurveLengths()
19155        return a[a.length - 1]
19156      },
19157      updateArcLengths: function () {
19158        ;(this.needsUpdate = !0), (this.cacheLengths = null), this.getLengths()
19159      },
19160      getCurveLengths: function () {
19161        if (
19162          this.cacheLengths &&
19163          this.cacheLengths.length === this.curves.length
19164        )
19165          return this.cacheLengths
19166        for (var a = [], b = 0, c = 0, d = this.curves.length; c < d; c++)
19167          (b += this.curves[c].getLength()), a.push(b)
19168        return (this.cacheLengths = a), a
19169      },
19170      getSpacedPoints: function (a) {
19171        isNaN(a) && (a = 40)
19172        for (var b = [], c = 0; c <= a; c++) b.push(this.getPoint(c / a))
19173        return this.autoClose && b.push(b[0]), b
19174      },
19175      getPoints: function (a) {
19176        a = a || 12
19177        for (var c, b = [], d = 0, e = this.curves; d < e.length; d++)
19178          for (
19179            var f = e[d],
19180              g =
19181                f && f.isEllipseCurve
19182                  ? 2 * a
19183                  : f && f.isLineCurve
19184                  ? 1
19185                  : f && f.isSplineCurve
19186                  ? a * f.points.length
19187                  : a,
19188              h = f.getPoints(g),
19189              i = 0;
19190            i < h.length;
19191            i++
19192          ) {
19193            var j = h[i]
19194            ;(c && c.equals(j)) || (b.push(j), (c = j))
19195          }
19196        return (
19197          this.autoClose &&
19198            b.length > 1 &&
19199            !b[b.length - 1].equals(b[0]) &&
19200            b.push(b[0]),
19201          b
19202        )
19203      },
19204      createPointsGeometry: function (a) {
19205        var b = this.getPoints(a)
19206        return this.createGeometry(b)
19207      },
19208      createSpacedPointsGeometry: function (a) {
19209        var b = this.getSpacedPoints(a)
19210        return this.createGeometry(b)
19211      },
19212      createGeometry: function (a) {
19213        for (var b = new ef(), c = 0, d = a.length; c < d; c++) {
19214          var e = a[c]
19215          b.vertices.push(new Bb(e.x, e.y, e.z || 0))
19216        }
19217        return b
19218      }
19219    })),
19220    (ci.prototype = Object.create(_h.prototype)),
19221    (ci.prototype.constructor = ci),
19222    (ci.prototype.isEllipseCurve = !0),
19223    (ci.prototype.getPoint = function (a) {
19224      for (
19225        var b = 2 * Math.PI,
19226          c = this.aEndAngle - this.aStartAngle,
19227          d = Math.abs(c) < Number.EPSILON;
19228        c < 0;
19229
19230      )
19231        c += b
19232      for (; c > b; ) c -= b
19233      c < Number.EPSILON && (c = d ? 0 : b),
19234        this.aClockwise !== !0 || d || (c === b ? (c = -b) : (c -= b))
19235      var e = this.aStartAngle + a * c,
19236        f = this.aX + this.xRadius * Math.cos(e),
19237        g = this.aY + this.yRadius * Math.sin(e)
19238      if (0 !== this.aRotation) {
19239        var h = Math.cos(this.aRotation),
19240          i = Math.sin(this.aRotation),
19241          j = f - this.aX,
19242          k = g - this.aY
19243        ;(f = j * h - k * i + this.aX), (g = j * i + k * h + this.aY)
19244      }
19245      return new ub(f, g)
19246    }),
19247    (di.prototype = Object.create(_h.prototype)),
19248    (di.prototype.constructor = di),
19249    (di.prototype.isSplineCurve = !0),
19250    (di.prototype.getPoint = function (a) {
19251      var b = this.points,
19252        c = (b.length - 1) * a,
19253        d = Math.floor(c),
19254        e = c - d,
19255        f = b[0 === d ? d : d - 1],
19256        g = b[d],
19257        h = b[d > b.length - 2 ? b.length - 1 : d + 1],
19258        i = b[d > b.length - 3 ? b.length - 1 : d + 2]
19259      return new ub(Rh(e, f.x, g.x, h.x, i.x), Rh(e, f.y, g.y, h.y, i.y))
19260    }),
19261    (ei.prototype = Object.create(_h.prototype)),
19262    (ei.prototype.constructor = ei),
19263    (ei.prototype.getPoint = function (a) {
19264      var b = this.v0,
19265        c = this.v1,
19266        d = this.v2,
19267        e = this.v3
19268      return new ub($h(a, b.x, c.x, d.x, e.x), $h(a, b.y, c.y, d.y, e.y))
19269    }),
19270    (fi.prototype = Object.create(_h.prototype)),
19271    (fi.prototype.constructor = fi),
19272    (fi.prototype.getPoint = function (a) {
19273      var b = this.v0,
19274        c = this.v1,
19275        d = this.v2
19276      return new ub(Vh(a, b.x, c.x, d.x), Vh(a, b.y, c.y, d.y))
19277    })
19278  var gi = Object.assign(Object.create(bi.prototype), {
19279    fromPoints: function (a) {
19280      this.moveTo(a[0].x, a[0].y)
19281      for (var b = 1, c = a.length; b < c; b++) this.lineTo(a[b].x, a[b].y)
19282    },
19283    moveTo: function (a, b) {
19284      this.currentPoint.set(a, b)
19285    },
19286    lineTo: function (a, b) {
19287      var c = new ai(this.currentPoint.clone(), new ub(a, b))
19288      this.curves.push(c), this.currentPoint.set(a, b)
19289    },
19290    quadraticCurveTo: function (a, b, c, d) {
19291      var e = new fi(this.currentPoint.clone(), new ub(a, b), new ub(c, d))
19292      this.curves.push(e), this.currentPoint.set(c, d)
19293    },
19294    bezierCurveTo: function (a, b, c, d, e, f) {
19295      var g = new ei(
19296        this.currentPoint.clone(),
19297        new ub(a, b),
19298        new ub(c, d),
19299        new ub(e, f)
19300      )
19301      this.curves.push(g), this.currentPoint.set(e, f)
19302    },
19303    splineThru: function (a) {
19304      var b = [this.currentPoint.clone()].concat(a),
19305        c = new di(b)
19306      this.curves.push(c), this.currentPoint.copy(a[a.length - 1])
19307    },
19308    arc: function (a, b, c, d, e, f) {
19309      var g = this.currentPoint.x,
19310        h = this.currentPoint.y
19311      this.absarc(a + g, b + h, c, d, e, f)
19312    },
19313    absarc: function (a, b, c, d, e, f) {
19314      this.absellipse(a, b, c, c, d, e, f)
19315    },
19316    ellipse: function (a, b, c, d, e, f, g, h) {
19317      var i = this.currentPoint.x,
19318        j = this.currentPoint.y
19319      this.absellipse(a + i, b + j, c, d, e, f, g, h)
19320    },
19321    absellipse: function (a, b, c, d, e, f, g, h) {
19322      var i = new ci(a, b, c, d, e, f, g, h)
19323      if (this.curves.length > 0) {
19324        var j = i.getPoint(0)
19325        j.equals(this.currentPoint) || this.lineTo(j.x, j.y)
19326      }
19327      this.curves.push(i)
19328      var k = i.getPoint(1)
19329      this.currentPoint.copy(k)
19330    }
19331  })
19332  ;(hi.prototype = gi),
19333    (gi.constructor = hi),
19334    (ii.prototype = Object.assign(Object.create(gi), {
19335      constructor: ii,
19336      getPointsHoles: function (a) {
19337        for (var b = [], c = 0, d = this.holes.length; c < d; c++)
19338          b[c] = this.holes[c].getPoints(a)
19339        return b
19340      },
19341      extractAllPoints: function (a) {
19342        return { shape: this.getPoints(a), holes: this.getPointsHoles(a) }
19343      },
19344      extractPoints: function (a) {
19345        return this.extractAllPoints(a)
19346      }
19347    })),
19348    (ji.prototype = {
19349      moveTo: function (a, b) {
19350        ;(this.currentPath = new hi()),
19351          this.subPaths.push(this.currentPath),
19352          this.currentPath.moveTo(a, b)
19353      },
19354      lineTo: function (a, b) {
19355        this.currentPath.lineTo(a, b)
19356      },
19357      quadraticCurveTo: function (a, b, c, d) {
19358        this.currentPath.quadraticCurveTo(a, b, c, d)
19359      },
19360      bezierCurveTo: function (a, b, c, d, e, f) {
19361        this.currentPath.bezierCurveTo(a, b, c, d, e, f)
19362      },
19363      splineThru: function (a) {
19364        this.currentPath.splineThru(a)
19365      },
19366      toShapes: function (a, b) {
19367        function c(a) {
19368          for (var b = [], c = 0, d = a.length; c < d; c++) {
19369            var e = a[c],
19370              f = new ii()
19371            ;(f.curves = e.curves), b.push(f)
19372          }
19373          return b
19374        }
19375        function d(a, b) {
19376          for (var c = b.length, d = !1, e = c - 1, f = 0; f < c; e = f++) {
19377            var g = b[e],
19378              h = b[f],
19379              i = h.x - g.x,
19380              j = h.y - g.y
19381            if (Math.abs(j) > Number.EPSILON) {
19382              if (
19383                (j < 0 && ((g = b[f]), (i = -i), (h = b[e]), (j = -j)),
19384                a.y < g.y || a.y > h.y)
19385              )
19386                continue
19387              if (a.y === g.y) {
19388                if (a.x === g.x) return !0
19389              } else {
19390                var k = j * (a.x - g.x) - i * (a.y - g.y)
19391                if (0 === k) return !0
19392                if (k < 0) continue
19393                d = !d
19394              }
19395            } else {
19396              if (a.y !== g.y) continue
19397              if ((h.x <= a.x && a.x <= g.x) || (g.x <= a.x && a.x <= h.x))
19398                return !0
19399            }
19400          }
19401          return d
19402        }
19403        var e = Cg.isClockWise,
19404          f = this.subPaths
19405        if (0 === f.length) return []
19406        if (b === !0) return c(f)
19407        var g,
19408          h,
19409          i,
19410          j = []
19411        if (1 === f.length)
19412          return (h = f[0]), (i = new ii()), (i.curves = h.curves), j.push(i), j
19413        var k = !e(f[0].getPoints())
19414        k = a ? !k : k
19415        var p,
19416          l = [],
19417          m = [],
19418          n = [],
19419          o = 0
19420        ;(m[o] = void 0), (n[o] = [])
19421        for (var q = 0, r = f.length; q < r; q++)
19422          (h = f[q]),
19423            (p = h.getPoints()),
19424            (g = e(p)),
19425            (g = a ? !g : g),
19426            g
19427              ? (!k && m[o] && o++,
19428                (m[o] = { s: new ii(), p: p }),
19429                (m[o].s.curves = h.curves),
19430                k && o++,
19431                (n[o] = []))
19432              : n[o].push({ h: h, p: p[0] })
19433        if (!m[0]) return c(f)
19434        if (m.length > 1) {
19435          for (var s = !1, t = [], u = 0, v = m.length; u < v; u++) l[u] = []
19436          for (var u = 0, v = m.length; u < v; u++)
19437            for (var w = n[u], x = 0; x < w.length; x++) {
19438              for (var y = w[x], z = !0, A = 0; A < m.length; A++)
19439                d(y.p, m[A].p) &&
19440                  (u !== A && t.push({ froms: u, tos: A, hole: x }),
19441                  z ? ((z = !1), l[A].push(y)) : (s = !0))
19442              z && l[u].push(y)
19443            }
19444          t.length > 0 && (s || (n = l))
19445        }
19446        for (var B, q = 0, C = m.length; q < C; q++) {
19447          ;(i = m[q].s), j.push(i), (B = n[q])
19448          for (var D = 0, E = B.length; D < E; D++) i.holes.push(B[D].h)
19449        }
19450        return j
19451      }
19452    }),
19453    Object.assign(ki.prototype, {
19454      isFont: !0,
19455      generateShapes: function (a, b, c) {
19456        function d(a) {
19457          for (
19458            var c = String(a).split(''),
19459              d = b / f.resolution,
19460              g =
19461                (f.boundingBox.yMax -
19462                  f.boundingBox.yMin +
19463                  f.underlineThickness) *
19464                d,
19465              h = 0,
19466              i = 0,
19467              j = [],
19468              k = 0;
19469            k < c.length;
19470            k++
19471          ) {
19472            var l = c[k]
19473            if ('\n' === l) (h = 0), (i -= g)
19474            else {
19475              var m = e(l, d, h, i)
19476              ;(h += m.offsetX), j.push(m.path)
19477            }
19478          }
19479          return j
19480        }
19481        function e(a, b, d, e) {
19482          var g = f.glyphs[a] || f.glyphs['?']
19483          if (g) {
19484            var j,
19485              k,
19486              l,
19487              m,
19488              n,
19489              o,
19490              p,
19491              q,
19492              r,
19493              s,
19494              t,
19495              h = new ji(),
19496              i = []
19497            if (g.o)
19498              for (
19499                var u = g._cachedOutline || (g._cachedOutline = g.o.split(' ')),
19500                  v = 0,
19501                  w = u.length;
19502                v < w;
19503
19504              ) {
19505                var x = u[v++]
19506                switch (x) {
19507                  case 'm':
19508                    ;(j = u[v++] * b + d), (k = u[v++] * b + e), h.moveTo(j, k)
19509                    break
19510                  case 'l':
19511                    ;(j = u[v++] * b + d), (k = u[v++] * b + e), h.lineTo(j, k)
19512                    break
19513                  case 'q':
19514                    if (
19515                      ((l = u[v++] * b + d),
19516                      (m = u[v++] * b + e),
19517                      (p = u[v++] * b + d),
19518                      (q = u[v++] * b + e),
19519                      h.quadraticCurveTo(p, q, l, m),
19520                      (t = i[i.length - 1]))
19521                    ) {
19522                      ;(n = t.x), (o = t.y)
19523                      for (var y = 1; y <= c; y++) {
19524                        var z = y / c
19525                        Vh(z, n, p, l), Vh(z, o, q, m)
19526                      }
19527                    }
19528                    break
19529                  case 'b':
19530                    if (
19531                      ((l = u[v++] * b + d),
19532                      (m = u[v++] * b + e),
19533                      (p = u[v++] * b + d),
19534                      (q = u[v++] * b + e),
19535                      (r = u[v++] * b + d),
19536                      (s = u[v++] * b + e),
19537                      h.bezierCurveTo(p, q, r, s, l, m),
19538                      (t = i[i.length - 1]))
19539                    ) {
19540                      ;(n = t.x), (o = t.y)
19541                      for (var y = 1; y <= c; y++) {
19542                        var z = y / c
19543                        $h(z, n, p, r, l), $h(z, o, q, s, m)
19544                      }
19545                    }
19546                }
19547              }
19548            return { offsetX: g.ha * b, path: h }
19549          }
19550        }
19551        void 0 === b && (b = 100), void 0 === c && (c = 4)
19552        for (
19553          var f = this.data, g = d(a), h = [], i = 0, j = g.length;
19554          i < j;
19555          i++
19556        )
19557          Array.prototype.push.apply(h, g[i].toShapes())
19558        return h
19559      }
19560    }),
19561    Object.assign(li.prototype, {
19562      load: function (a, b, c, d) {
19563        var e = this,
19564          f = new hh(this.manager)
19565        f.load(
19566          a,
19567          function (a) {
19568            var c
19569            try {
19570              c = JSON.parse(a)
19571            } catch (b) {
19572              console.warn(
19573                'THREE.FontLoader: typeface.js support is being deprecated. Use typeface.json instead.'
19574              ),
19575                (c = JSON.parse(a.substring(65, a.length - 2)))
19576            }
19577            var d = e.parse(c)
19578            b && b(d)
19579          },
19580          c,
19581          d
19582        )
19583      },
19584      parse: function (a) {
19585        return new ki(a)
19586      }
19587    })
19588  var mi,
19589    ni = {
19590      getContext: function () {
19591        return (
19592          void 0 === mi &&
19593            (mi = new (window.AudioContext || window.webkitAudioContext)()),
19594          mi
19595        )
19596      },
19597      setContext: function (a) {
19598        mi = a
19599      }
19600    }
19601  Object.assign(oi.prototype, {
19602    load: function (a, b, c, d) {
19603      var e = new hh(this.manager)
19604      e.setResponseType('arraybuffer'),
19605        e.load(
19606          a,
19607          function (a) {
19608            var c = ni.getContext()
19609            c.decodeAudioData(a, function (a) {
19610              b(a)
19611            })
19612          },
19613          c,
19614          d
19615        )
19616    }
19617  }),
19618    (pi.prototype = Object.assign(Object.create(nh.prototype), {
19619      constructor: pi,
19620      isRectAreaLight: !0,
19621      copy: function (a) {
19622        return (
19623          nh.prototype.copy.call(this, a),
19624          (this.width = a.width),
19625          (this.height = a.height),
19626          this
19627        )
19628      }
19629    })),
19630    Object.assign(qi.prototype, {
19631      update: (function () {
19632        var a,
19633          b,
19634          c,
19635          d,
19636          e,
19637          f,
19638          g,
19639          h = new Cb(),
19640          i = new Cb()
19641        return function (k) {
19642          var l =
19643            a !== this ||
19644            b !== k.focus ||
19645            c !== k.fov ||
19646            d !== k.aspect * this.aspect ||
19647            e !== k.near ||
19648            f !== k.far ||
19649            g !== k.zoom
19650          if (l) {
19651            ;(a = this),
19652              (b = k.focus),
19653              (c = k.fov),
19654              (d = k.aspect * this.aspect),
19655              (e = k.near),
19656              (f = k.far),
19657              (g = k.zoom)
19658            var q,
19659              r,
19660              m = k.projectionMatrix.clone(),
19661              n = this.eyeSep / 2,
19662              o = (n * e) / b,
19663              p = (e * Math.tan(tb.DEG2RAD * c * 0.5)) / g
19664            ;(i.elements[12] = -n),
19665              (h.elements[12] = n),
19666              (q = -p * d + o),
19667              (r = p * d + o),
19668              (m.elements[0] = (2 * e) / (r - q)),
19669              (m.elements[8] = (r + q) / (r - q)),
19670              this.cameraL.projectionMatrix.copy(m),
19671              (q = -p * d - o),
19672              (r = p * d - o),
19673              (m.elements[0] = (2 * e) / (r - q)),
19674              (m.elements[8] = (r + q) / (r - q)),
19675              this.cameraR.projectionMatrix.copy(m)
19676          }
19677          this.cameraL.matrixWorld.copy(k.matrixWorld).multiply(i),
19678            this.cameraR.matrixWorld.copy(k.matrixWorld).multiply(h)
19679        }
19680      })()
19681    }),
19682    (ri.prototype = Object.create(Ne.prototype)),
19683    (ri.prototype.constructor = ri),
19684    (si.prototype = Object.assign(Object.create(Ne.prototype), {
19685      constructor: si,
19686      getInput: function () {
19687        return this.gain
19688      },
19689      removeFilter: function () {
19690        null !== this.filter &&
19691          (this.gain.disconnect(this.filter),
19692          this.filter.disconnect(this.context.destination),
19693          this.gain.connect(this.context.destination),
19694          (this.filter = null))
19695      },
19696      getFilter: function () {
19697        return this.filter
19698      },
19699      setFilter: function (a) {
19700        null !== this.filter
19701          ? (this.gain.disconnect(this.filter),
19702            this.filter.disconnect(this.context.destination))
19703          : this.gain.disconnect(this.context.destination),
19704          (this.filter = a),
19705          this.gain.connect(this.filter),
19706          this.filter.connect(this.context.destination)
19707      },
19708      getMasterVolume: function () {
19709        return this.gain.gain.value
19710      },
19711      setMasterVolume: function (a) {
19712        this.gain.gain.value = a
19713      },
19714      updateMatrixWorld: (function () {
19715        var a = new Bb(),
19716          b = new Ab(),
19717          c = new Bb(),
19718          d = new Bb()
19719        return function (f) {
19720          Ne.prototype.updateMatrixWorld.call(this, f)
19721          var g = this.context.listener,
19722            h = this.up
19723          this.matrixWorld.decompose(a, b, c),
19724            d.set(0, 0, -1).applyQuaternion(b),
19725            g.positionX
19726              ? (g.positionX.setValueAtTime(a.x, this.context.currentTime),
19727                g.positionY.setValueAtTime(a.y, this.context.currentTime),
19728                g.positionZ.setValueAtTime(a.z, this.context.currentTime),
19729                g.forwardX.setValueAtTime(d.x, this.context.currentTime),
19730                g.forwardY.setValueAtTime(d.y, this.context.currentTime),
19731                g.forwardZ.setValueAtTime(d.z, this.context.currentTime),
19732                g.upX.setValueAtTime(h.x, this.context.currentTime),
19733                g.upY.setValueAtTime(h.y, this.context.currentTime),
19734                g.upZ.setValueAtTime(h.z, this.context.currentTime))
19735              : (g.setPosition(a.x, a.y, a.z),
19736                g.setOrientation(d.x, d.y, d.z, h.x, h.y, h.z))
19737        }
19738      })()
19739    })),
19740    (ti.prototype = Object.assign(Object.create(Ne.prototype), {
19741      constructor: ti,
19742      getOutput: function () {
19743        return this.gain
19744      },
19745      setNodeSource: function (a) {
19746        return (
19747          (this.hasPlaybackControl = !1),
19748          (this.sourceType = 'audioNode'),
19749          (this.source = a),
19750          this.connect(),
19751          this
19752        )
19753      },
19754      setBuffer: function (a) {
19755        return (
19756          (this.buffer = a),
19757          (this.sourceType = 'buffer'),
19758          this.autoplay && this.play(),
19759          this
19760        )
19761      },
19762      play: function () {
19763        if (this.isPlaying === !0)
19764          return void console.warn('THREE.Audio: Audio is already playing.')
19765        if (this.hasPlaybackControl === !1)
19766          return void console.warn(
19767            'THREE.Audio: this Audio has no playback control.'
19768          )
19769        var a = this.context.createBufferSource()
19770        return (
19771          (a.buffer = this.buffer),
19772          (a.loop = this.loop),
19773          (a.onended = this.onEnded.bind(this)),
19774          a.playbackRate.setValueAtTime(this.playbackRate, this.startTime),
19775          a.start(0, this.startTime),
19776          (this.isPlaying = !0),
19777          (this.source = a),
19778          this.connect()
19779        )
19780      },
19781      pause: function () {
19782        return this.hasPlaybackControl === !1
19783          ? void console.warn(
19784              'THREE.Audio: this Audio has no playback control.'
19785            )
19786          : (this.source.stop(),
19787            (this.startTime = this.context.currentTime),
19788            (this.isPlaying = !1),
19789            this)
19790      },
19791      stop: function () {
19792        return this.hasPlaybackControl === !1
19793          ? void console.warn(
19794              'THREE.Audio: this Audio has no playback control.'
19795            )
19796          : (this.source.stop(),
19797            (this.startTime = 0),
19798            (this.isPlaying = !1),
19799            this)
19800      },
19801      connect: function () {
19802        if (this.filters.length > 0) {
19803          this.source.connect(this.filters[0])
19804          for (var a = 1, b = this.filters.length; a < b; a++)
19805            this.filters[a - 1].connect(this.filters[a])
19806          this.filters[this.filters.length - 1].connect(this.getOutput())
19807        } else this.source.connect(this.getOutput())
19808        return this
19809      },
19810      disconnect: function () {
19811        if (this.filters.length > 0) {
19812          this.source.disconnect(this.filters[0])
19813          for (var a = 1, b = this.filters.length; a < b; a++)
19814            this.filters[a - 1].disconnect(this.filters[a])
19815          this.filters[this.filters.length - 1].disconnect(this.getOutput())
19816        } else this.source.disconnect(this.getOutput())
19817        return this
19818      },
19819      getFilters: function () {
19820        return this.filters
19821      },
19822      setFilters: function (a) {
19823        return (
19824          a || (a = []),
19825          this.isPlaying === !0
19826            ? (this.disconnect(), (this.filters = a), this.connect())
19827            : (this.filters = a),
19828          this
19829        )
19830      },
19831      getFilter: function () {
19832        return this.getFilters()[0]
19833      },
19834      setFilter: function (a) {
19835        return this.setFilters(a ? [a] : [])
19836      },
19837      setPlaybackRate: function (a) {
19838        return this.hasPlaybackControl === !1
19839          ? void console.warn(
19840              'THREE.Audio: this Audio has no playback control.'
19841            )
19842          : ((this.playbackRate = a),
19843            this.isPlaying === !0 &&
19844              this.source.playbackRate.setValueAtTime(
19845                this.playbackRate,
19846                this.context.currentTime
19847              ),
19848            this)
19849      },
19850      getPlaybackRate: function () {
19851        return this.playbackRate
19852      },
19853      onEnded: function () {
19854        this.isPlaying = !1
19855      },
19856      getLoop: function () {
19857        return this.hasPlaybackControl === !1
19858          ? (console.warn('THREE.Audio: this Audio has no playback control.'),
19859            !1)
19860          : this.loop
19861      },
19862      setLoop: function (a) {
19863        return this.hasPlaybackControl === !1
19864          ? void console.warn(
19865              'THREE.Audio: this Audio has no playback control.'
19866            )
19867          : ((this.loop = a),
19868            this.isPlaying === !0 && (this.source.loop = this.loop),
19869            this)
19870      },
19871      getVolume: function () {
19872        return this.gain.gain.value
19873      },
19874      setVolume: function (a) {
19875        return (this.gain.gain.value = a), this
19876      }
19877    })),
19878    (ui.prototype = Object.assign(Object.create(ti.prototype), {
19879      constructor: ui,
19880      getOutput: function () {
19881        return this.panner
19882      },
19883      getRefDistance: function () {
19884        return this.panner.refDistance
19885      },
19886      setRefDistance: function (a) {
19887        this.panner.refDistance = a
19888      },
19889      getRolloffFactor: function () {
19890        return this.panner.rolloffFactor
19891      },
19892      setRolloffFactor: function (a) {
19893        this.panner.rolloffFactor = a
19894      },
19895      getDistanceModel: function () {
19896        return this.panner.distanceModel
19897      },
19898      setDistanceModel: function (a) {
19899        this.panner.distanceModel = a
19900      },
19901      getMaxDistance: function () {
19902        return this.panner.maxDistance
19903      },
19904      setMaxDistance: function (a) {
19905        this.panner.maxDistance = a
19906      },
19907      updateMatrixWorld: (function () {
19908        var a = new Bb()
19909        return function (c) {
19910          Ne.prototype.updateMatrixWorld.call(this, c),
19911            a.setFromMatrixPosition(this.matrixWorld),
19912            this.panner.setPosition(a.x, a.y, a.z)
19913        }
19914      })()
19915    })),
19916    Object.assign(vi.prototype, {
19917      getFrequencyData: function () {
19918        return this.analyser.getByteFrequencyData(this.data), this.data
19919      },
19920      getAverageFrequency: function () {
19921        for (var a = 0, b = this.getFrequencyData(), c = 0; c < b.length; c++)
19922          a += b[c]
19923        return a / b.length
19924      }
19925    }),
19926    (wi.prototype = {
19927      constructor: wi,
19928      accumulate: function (a, b) {
19929        var c = this.buffer,
19930          d = this.valueSize,
19931          e = a * d + d,
19932          f = this.cumulativeWeight
19933        if (0 === f) {
19934          for (var g = 0; g !== d; ++g) c[e + g] = c[g]
19935          f = b
19936        } else {
19937          f += b
19938          var h = b / f
19939          this._mixBufferRegion(c, e, 0, h, d)
19940        }
19941        this.cumulativeWeight = f
19942      },
19943      apply: function (a) {
19944        var b = this.valueSize,
19945          c = this.buffer,
19946          d = a * b + b,
19947          e = this.cumulativeWeight,
19948          f = this.binding
19949        if (((this.cumulativeWeight = 0), e < 1)) {
19950          var g = 3 * b
19951          this._mixBufferRegion(c, d, g, 1 - e, b)
19952        }
19953        for (var h = b, i = b + b; h !== i; ++h)
19954          if (c[h] !== c[h + b]) {
19955            f.setValue(c, d)
19956            break
19957          }
19958      },
19959      saveOriginalState: function () {
19960        var a = this.binding,
19961          b = this.buffer,
19962          c = this.valueSize,
19963          d = 3 * c
19964        a.getValue(b, d)
19965        for (var e = c, f = d; e !== f; ++e) b[e] = b[d + (e % c)]
19966        this.cumulativeWeight = 0
19967      },
19968      restoreOriginalState: function () {
19969        var a = 3 * this.valueSize
19970        this.binding.setValue(this.buffer, a)
19971      },
19972      _select: function (a, b, c, d, e) {
19973        if (d >= 0.5) for (var f = 0; f !== e; ++f) a[b + f] = a[c + f]
19974      },
19975      _slerp: function (a, b, c, d, e) {
19976        Ab.slerpFlat(a, b, a, b, a, c, d)
19977      },
19978      _lerp: function (a, b, c, d, e) {
19979        for (var f = 1 - d, g = 0; g !== e; ++g) {
19980          var h = b + g
19981          a[h] = a[h] * f + a[c + g] * d
19982        }
19983      }
19984    }),
19985    (xi.prototype = {
19986      constructor: xi,
19987      getValue: function (b, c) {
19988        this.bind(), this.getValue(b, c)
19989      },
19990      setValue: function (b, c) {
19991        this.bind(), this.setValue(b, c)
19992      },
19993      bind: function () {
19994        var a = this.node,
19995          b = this.parsedPath,
19996          c = b.objectName,
19997          d = b.propertyName,
19998          e = b.propertyIndex
19999        if (
20000          (a ||
20001            ((a = xi.findNode(this.rootNode, b.nodeName) || this.rootNode),
20002            (this.node = a)),
20003          (this.getValue = this._getValue_unavailable),
20004          (this.setValue = this._setValue_unavailable),
20005          !a)
20006        )
20007          return void console.error(
20008            '  trying to update node for track: ' +
20009              this.path +
20010              " but it wasn't found."
20011          )
20012        if (c) {
20013          var f = b.objectIndex
20014          switch (c) {
20015            case 'materials':
20016              if (!a.material)
20017                return void console.error(
20018                  '  can not bind to material as node does not have a material',
20019                  this
20020                )
20021              if (!a.material.materials)
20022                return void console.error(
20023                  '  can not bind to material.materials as node.material does not have a materials array',
20024                  this
20025                )
20026              a = a.material.materials
20027              break
20028            case 'bones':
20029              if (!a.skeleton)
20030                return void console.error(
20031                  '  can not bind to bones as node does not have a skeleton',
20032                  this
20033                )
20034              a = a.skeleton.bones
20035              for (var g = 0; g < a.length; g++)
20036                if (a[g].name === f) {
20037                  f = g
20038                  break
20039                }
20040              break
20041            default:
20042              if (void 0 === a[c])
20043                return void console.error(
20044                  '  can not bind to objectName of node, undefined',
20045                  this
20046                )
20047              a = a[c]
20048          }
20049          if (void 0 !== f) {
20050            if (void 0 === a[f])
20051              return void console.error(
20052                '  trying to bind to objectIndex of objectName, but is undefined:',
20053                this,
20054                a
20055              )
20056            a = a[f]
20057          }
20058        }
20059        var h = a[d]
20060        if (void 0 === h) {
20061          var i = b.nodeName
20062          return void console.error(
20063            '  trying to update property for track: ' +
20064              i +
20065              '.' +
20066              d +
20067              " but it wasn't found.",
20068            a
20069          )
20070        }
20071        var j = this.Versioning.None
20072        void 0 !== a.needsUpdate
20073          ? ((j = this.Versioning.NeedsUpdate), (this.targetObject = a))
20074          : void 0 !== a.matrixWorldNeedsUpdate &&
20075            ((j = this.Versioning.MatrixWorldNeedsUpdate),
20076            (this.targetObject = a))
20077        var k = this.BindingType.Direct
20078        if (void 0 !== e) {
20079          if ('morphTargetInfluences' === d) {
20080            if (!a.geometry)
20081              return void console.error(
20082                '  can not bind to morphTargetInfluences becasuse node does not have a geometry',
20083                this
20084              )
20085            if (!a.geometry.morphTargets)
20086              return void console.error(
20087                '  can not bind to morphTargetInfluences becasuse node does not have a geometry.morphTargets',
20088                this
20089              )
20090            for (var g = 0; g < this.node.geometry.morphTargets.length; g++)
20091              if (a.geometry.morphTargets[g].name === e) {
20092                e = g
20093                break
20094              }
20095          }
20096          ;(k = this.BindingType.ArrayElement),
20097            (this.resolvedProperty = h),
20098            (this.propertyIndex = e)
20099        } else
20100          void 0 !== h.fromArray && void 0 !== h.toArray
20101            ? ((k = this.BindingType.HasFromToArray),
20102              (this.resolvedProperty = h))
20103            : void 0 !== h.length
20104            ? ((k = this.BindingType.EntireArray), (this.resolvedProperty = h))
20105            : (this.propertyName = d)
20106        ;(this.getValue = this.GetterByBindingType[k]),
20107          (this.setValue = this.SetterByBindingTypeAndVersioning[k][j])
20108      },
20109      unbind: function () {
20110        ;(this.node = null),
20111          (this.getValue = this._getValue_unbound),
20112          (this.setValue = this._setValue_unbound)
20113      }
20114    }),
20115    Object.assign(xi.prototype, {
20116      _getValue_unavailable: function () {},
20117      _setValue_unavailable: function () {},
20118      _getValue_unbound: xi.prototype.getValue,
20119      _setValue_unbound: xi.prototype.setValue,
20120      BindingType: {
20121        Direct: 0,
20122        EntireArray: 1,
20123        ArrayElement: 2,
20124        HasFromToArray: 3
20125      },
20126      Versioning: { None: 0, NeedsUpdate: 1, MatrixWorldNeedsUpdate: 2 },
20127      GetterByBindingType: [
20128        function (b, c) {
20129          b[c] = this.node[this.propertyName]
20130        },
20131        function (b, c) {
20132          for (var d = this.resolvedProperty, e = 0, f = d.length; e !== f; ++e)
20133            b[c++] = d[e]
20134        },
20135        function (b, c) {
20136          b[c] = this.resolvedProperty[this.propertyIndex]
20137        },
20138        function (b, c) {
20139          this.resolvedProperty.toArray(b, c)
20140        }
20141      ],
20142      SetterByBindingTypeAndVersioning: [
20143        [
20144          function (b, c) {
20145            this.node[this.propertyName] = b[c]
20146          },
20147          function (b, c) {
20148            ;(this.node[this.propertyName] = b[c]),
20149              (this.targetObject.needsUpdate = !0)
20150          },
20151          function (b, c) {
20152            ;(this.node[this.propertyName] = b[c]),
20153              (this.targetObject.matrixWorldNeedsUpdate = !0)
20154          }
20155        ],
20156        [
20157          function (b, c) {
20158            for (
20159              var d = this.resolvedProperty, e = 0, f = d.length;
20160              e !== f;
20161              ++e
20162            )
20163              d[e] = b[c++]
20164          },
20165          function (b, c) {
20166            for (
20167              var d = this.resolvedProperty, e = 0, f = d.length;
20168              e !== f;
20169              ++e
20170            )
20171              d[e] = b[c++]
20172            this.targetObject.needsUpdate = !0
20173          },
20174          function (b, c) {
20175            for (
20176              var d = this.resolvedProperty, e = 0, f = d.length;
20177              e !== f;
20178              ++e
20179            )
20180              d[e] = b[c++]
20181            this.targetObject.matrixWorldNeedsUpdate = !0
20182          }
20183        ],
20184        [
20185          function (b, c) {
20186            this.resolvedProperty[this.propertyIndex] = b[c]
20187          },
20188          function (b, c) {
20189            ;(this.resolvedProperty[this.propertyIndex] = b[c]),
20190              (this.targetObject.needsUpdate = !0)
20191          },
20192          function (b, c) {
20193            ;(this.resolvedProperty[this.propertyIndex] = b[c]),
20194              (this.targetObject.matrixWorldNeedsUpdate = !0)
20195          }
20196        ],
20197        [
20198          function (b, c) {
20199            this.resolvedProperty.fromArray(b, c)
20200          },
20201          function (b, c) {
20202            this.resolvedProperty.fromArray(b, c),
20203              (this.targetObject.needsUpdate = !0)
20204          },
20205          function (b, c) {
20206            this.resolvedProperty.fromArray(b, c),
20207              (this.targetObject.matrixWorldNeedsUpdate = !0)
20208          }
20209        ]
20210      ]
20211    }),
20212    (xi.Composite = function (a, b, c) {
20213      var d = c || xi.parseTrackName(b)
20214      ;(this._targetGroup = a), (this._bindings = a.subscribe_(b, d))
20215    }),
20216    (xi.Composite.prototype = {
20217      constructor: xi.Composite,
20218      getValue: function (a, b) {
20219        this.bind()
20220        var c = this._targetGroup.nCachedObjects_,
20221          d = this._bindings[c]
20222        void 0 !== d && d.getValue(a, b)
20223      },
20224      setValue: function (a, b) {
20225        for (
20226          var c = this._bindings,
20227            d = this._targetGroup.nCachedObjects_,
20228            e = c.length;
20229          d !== e;
20230          ++d
20231        )
20232          c[d].setValue(a, b)
20233      },
20234      bind: function () {
20235        for (
20236          var a = this._bindings,
20237            b = this._targetGroup.nCachedObjects_,
20238            c = a.length;
20239          b !== c;
20240          ++b
20241        )
20242          a[b].bind()
20243      },
20244      unbind: function () {
20245        for (
20246          var a = this._bindings,
20247            b = this._targetGroup.nCachedObjects_,
20248            c = a.length;
20249          b !== c;
20250          ++b
20251        )
20252          a[b].unbind()
20253      }
20254    }),
20255    (xi.create = function (a, b, c) {
20256      return a && a.isAnimationObjectGroup
20257        ? new xi.Composite(a, b, c)
20258        : new xi(a, b, c)
20259    }),
20260    (xi.parseTrackName = function (a) {
20261      var b =
20262          /^((?:[\w-]+[\/:])*)([\w-]+)?(?:\.([\w-]+)(?:\[(.+)\])?)?\.([\w-]+)(?:\[(.+)\])?$/,
20263        c = b.exec(a)
20264      if (!c) throw new Error('cannot parse trackName at all: ' + a)
20265      var d = {
20266        nodeName: c[2],
20267        objectName: c[3],
20268        objectIndex: c[4],
20269        propertyName: c[5],
20270        propertyIndex: c[6]
20271      }
20272      if (null === d.propertyName || 0 === d.propertyName.length)
20273        throw new Error('can not parse propertyName from trackName: ' + a)
20274      return d
20275    }),
20276    (xi.findNode = function (a, b) {
20277      if (
20278        !b ||
20279        '' === b ||
20280        'root' === b ||
20281        '.' === b ||
20282        b === -1 ||
20283        b === a.name ||
20284        b === a.uuid
20285      )
20286        return a
20287      if (a.skeleton) {
20288        var c = function (a) {
20289            for (var c = 0; c < a.bones.length; c++) {
20290              var d = a.bones[c]
20291              if (d.name === b) return d
20292            }
20293            return null
20294          },
20295          d = c(a.skeleton)
20296        if (d) return d
20297      }
20298      if (a.children) {
20299        var e = function (a) {
20300            for (var c = 0; c < a.length; c++) {
20301              var d = a[c]
20302              if (d.name === b || d.uuid === b) return d
20303              var f = e(d.children)
20304              if (f) return f
20305            }
20306            return null
20307          },
20308          f = e(a.children)
20309        if (f) return f
20310      }
20311      return null
20312    }),
20313    (yi.prototype = {
20314      constructor: yi,
20315      isAnimationObjectGroup: !0,
20316      add: function (a) {
20317        for (
20318          var b = this._objects,
20319            c = b.length,
20320            d = this.nCachedObjects_,
20321            e = this._indicesByUUID,
20322            f = this._paths,
20323            g = this._parsedPaths,
20324            h = this._bindings,
20325            i = h.length,
20326            j = 0,
20327            k = arguments.length;
20328          j !== k;
20329          ++j
20330        ) {
20331          var l = arguments[j],
20332            m = l.uuid,
20333            n = e[m],
20334            o = void 0
20335          if (void 0 === n) {
20336            ;(n = c++), (e[m] = n), b.push(l)
20337            for (var p = 0, q = i; p !== q; ++p)
20338              h[p].push(new xi(l, f[p], g[p]))
20339          } else if (n < d) {
20340            o = b[n]
20341            var r = --d,
20342              s = b[r]
20343            ;(e[s.uuid] = n), (b[n] = s), (e[m] = r), (b[r] = l)
20344            for (var p = 0, q = i; p !== q; ++p) {
20345              var t = h[p],
20346                u = t[r],
20347                v = t[n]
20348              ;(t[n] = u),
20349                void 0 === v && (v = new xi(l, f[p], g[p])),
20350                (t[r] = v)
20351            }
20352          } else
20353            b[n] !== o &&
20354              console.error(
20355                'Different objects with the same UUID detected. Clean the caches or recreate your infrastru
20355cture when reloading scenes...'
20356              )
20357        }
20358        this.nCachedObjects_ = d
20359      },
20360      remove: function (a) {
20361        for (
20362          var b = this._objects,
20363            c = this.nCachedObjects_,
20364            d = this._indicesByUUID,
20365            e = this._bindings,
20366            f = e.length,
20367            g = 0,
20368            h = arguments.length;
20369          g !== h;
20370          ++g
20371        ) {
20372          var i = arguments[g],
20373            j = i.uuid,
20374            k = d[j]
20375          if (void 0 !== k && k >= c) {
20376            var l = c++,
20377              m = b[l]
20378            ;(d[m.uuid] = k), (b[k] = m), (d[j] = l), (b[l] = i)
20379            for (var n = 0, o = f; n !== o; ++n) {
20380              var p = e[n],
20381                q = p[l],
20382                r = p[k]
20383              ;(p[k] = q), (p[l] = r)
20384            }
20385          }
20386        }
20387        this.nCachedObjects_ = c
20388      },
20389      uncache: function (a) {
20390        for (
20391          var b = this._objects,
20392            c = b.length,
20393            d = this.nCachedObjects_,
20394            e = this._indicesByUUID,
20395            f = this._bindings,
20396            g = f.length,
20397            h = 0,
20398            i = arguments.length;
20399          h !== i;
20400          ++h
20401        ) {
20402          var j = arguments[h],
20403            k = j.uuid,
20404            l = e[k]
20405          if (void 0 !== l)
20406            if ((delete e[k], l < d)) {
20407              var m = --d,
20408                n = b[m],
20409                o = --c,
20410                p = b[o]
20411              ;(e[n.uuid] = l), (b[l] = n), (e[p.uuid] = m), (b[m] = p), b.pop()
20412              for (var q = 0, r = g; q !== r; ++q) {
20413                var s = f[q],
20414                  t = s[m],
20415                  u = s[o]
20416                ;(s[l] = t), (s[m] = u), s.pop()
20417              }
20418            } else {
20419              var o = --c,
20420                p = b[o]
20421              ;(e[p.uuid] = l), (b[l] = p), b.pop()
20422              for (var q = 0, r = g; q !== r; ++q) {
20423                var s = f[q]
20424                ;(s[l] = s[o]), s.pop()
20425              }
20426            }
20427        }
20428        this.nCachedObjects_ = d
20429      },
20430      subscribe_: function (a, b) {
20431        var c = this._bindingsIndicesByPath,
20432          d = c[a],
20433          e = this._bindings
20434        if (void 0 !== d) return e[d]
20435        var f = this._paths,
20436          g = this._parsedPaths,
20437          h = this._objects,
20438          i = h.length,
20439          j = this.nCachedObjects_,
20440          k = new Array(i)
20441        ;(d = e.length), (c[a] = d), f.push(a), g.push(b), e.push(k)
20442        for (var l = j, m = h.length; l !== m; ++l) {
20443          var n = h[l]
20444          k[l] = new xi(n, a, b)
20445        }
20446        return k
20447      },
20448      unsubscribe_: function (a) {
20449        var b = this._bindingsIndicesByPath,
20450          c = b[a]
20451        if (void 0 !== c) {
20452          var d = this._paths,
20453            e = this._parsedPaths,
20454            f = this._bindings,
20455            g = f.length - 1,
20456            h = f[g],
20457            i = a[g]
20458          ;(b[i] = c),
20459            (f[c] = h),
20460            f.pop(),
20461            (e[c] = e[g]),
20462            e.pop(),
20463            (d[c] = d[g]),
20464            d.pop()
20465        }
20466      }
20467    }),
20468    (zi.prototype = {
20469      constructor: zi,
20470      play: function () {
20471        return this._mixer._activateAction(this), this
20472      },
20473      stop: function () {
20474        return this._mixer._deactivateAction(this), this.reset()
20475      },
20476      reset: function () {
20477        return (
20478          (this.paused = !1),
20479          (this.enabled = !0),
20480          (this.time = 0),
20481          (this._loopCount = -1),
20482          (this._startTime = null),
20483          this.stopFading().stopWarping()
20484        )
20485      },
20486      isRunning: function () {
20487        return (
20488          this.enabled &&
20489          !this.paused &&
20490          0 !== this.timeScale &&
20491          null === this._startTime &&
20492          this._mixer._isActiveAction(this)
20493        )
20494      },
20495      isScheduled: function () {
20496        return this._mixer._isActiveAction(this)
20497      },
20498      startAt: function (a) {
20499        return (this._startTime = a), this
20500      },
20501      setLoop: function (a, b) {
20502        return (this.loop = a), (this.repetitions = b), this
20503      },
20504      setEffectiveWeight: function (a) {
20505        return (
20506          (this.weight = a),
20507          (this._effectiveWeight = this.enabled ? a : 0),
20508          this.stopFading()
20509        )
20510      },
20511      getEffectiveWeight: function () {
20512        return this._effectiveWeight
20513      },
20514      fadeIn: function (a) {
20515        return this._scheduleFading(a, 0, 1)
20516      },
20517      fadeOut: function (a) {
20518        return this._scheduleFading(a, 1, 0)
20519      },
20520      crossFadeFrom: function (a, b, c) {
20521        if ((a.fadeOut(b), this.fadeIn(b), c)) {
20522          var d = this._clip.duration,
20523            e = a._clip.duration,
20524            f = e / d,
20525            g = d / e
20526          a.warp(1, f, b), this.warp(g, 1, b)
20527        }
20528        return this
20529      },
20530      crossFadeTo: function (a, b, c) {
20531        return a.crossFadeFrom(this, b, c)
20532      },
20533      stopFading: function () {
20534        var a = this._weightInterpolant
20535        return (
20536          null !== a &&
20537            ((this._weightInterpolant = null),
20538            this._mixer._takeBackControlInterpolant(a)),
20539          this
20540        )
20541      },
20542      setEffectiveTimeScale: function (a) {
20543        return (
20544          (this.timeScale = a),
20545          (this._effectiveTimeScale = this.paused ? 0 : a),
20546          this.stopWarping()
20547        )
20548      },
20549      getEffectiveTimeScale: function () {
20550        return this._effectiveTimeScale
20551      },
20552      setDuration: function (a) {
20553        return (this.timeScale = this._clip.duration / a), this.stopWarping()
20554      },
20555      syncWith: function (a) {
20556        return (
20557          (this.time = a.time),
20558          (this.timeScale = a.timeScale),
20559          this.stopWarping()
20560        )
20561      },
20562      halt: function (a) {
20563        return this.warp(this._effectiveTimeScale, 0, a)
20564      },
20565      warp: function (a, b, c) {
20566        var d = this._mixer,
20567          e = d.time,
20568          f = this._timeScaleInterpolant,
20569          g = this.timeScale
20570        null === f &&
20571          ((f = d._lendControlInterpolant()), (this._timeScaleInterpolant = f))
20572        var h = f.parameterPositions,
20573          i = f.sampleValues
20574        return (h[0] = e), (h[1] = e + c), (i[0] = a / g), (i[1] = b / g), this
20575      },
20576      stopWarping: function () {
20577        var a = this._timeScaleInterpolant
20578        return (
20579          null !== a &&
20580            ((this._timeScaleInterpolant = null),
20581            this._mixer._takeBackControlInterpolant(a)),
20582          this
20583        )
20584      },
20585      getMixer: function () {
20586        return this._mixer
20587      },
20588      getClip: function () {
20589        return this._clip
20590      },
20591      getRoot: function () {
20592        return this._localRoot || this._mixer._root
20593      },
20594      _update: function (a, b, c, d) {
20595        var e = this._startTime
20596        if (null !== e) {
20597          var f = (a - e) * c
20598          if (f < 0 || 0 === c) return
20599          ;(this._startTime = null), (b = c * f)
20600        }
20601        b *= this._updateTimeScale(a)
20602        var g = this._updateTime(b),
20603          h = this._updateWeight(a)
20604        if (h > 0)
20605          for (
20606            var i = this._interpolants,
20607              j = this._propertyBindings,
20608              k = 0,
20609              l = i.length;
20610            k !== l;
20611            ++k
20612          )
20613            i[k].evaluate(g), j[k].accumulate(d, h)
20614      },
20615      _updateWeight: function (a) {
20616        var b = 0
20617        if (this.enabled) {
20618          b = this.weight
20619          var c = this._weightInterpolant
20620          if (null !== c) {
20621            var d = c.evaluate(a)[0]
20622            ;(b *= d),
20623              a > c.parameterPositions[1] &&
20624                (this.stopFading(), 0 === d && (this.enabled = !1))
20625          }
20626        }
20627        return (this._effectiveWeight = b), b
20628      },
20629      _updateTimeScale: function (a) {
20630        var b = 0
20631        if (!this.paused) {
20632          b = this.timeScale
20633          var c = this._timeScaleInterpolant
20634          if (null !== c) {
20635            var d = c.evaluate(a)[0]
20636            ;(b *= d),
20637              a > c.parameterPositions[1] &&
20638                (this.stopWarping(),
20639                0 === b ? (this.paused = !0) : (this.timeScale = b))
20640          }
20641        }
20642        return (this._effectiveTimeScale = b), b
20643      },
20644      _updateTime: function (a) {
20645        var b = this.time + a
20646        if (0 === a) return b
20647        var c = this._clip.duration,
20648          d = this.loop,
20649          e = this._loopCount
20650        if (d === Za) {
20651          e === -1 && ((this._loopCount = 0), this._setEndings(!0, !0, !1))
20652          a: {
20653            if (b >= c) b = c
20654            else {
20655              if (!(b < 0)) break a
20656              b = 0
20657            }
20658            this.clampWhenFinished ? (this.paused = !0) : (this.enabled = !1),
20659              this._mixer.dispatchEvent({
20660                type: 'finished',
20661                action: this,
20662                direction: a < 0 ? -1 : 1
20663              })
20664          }
20665        } else {
20666          var f = d === _a
20667          if (
20668            (e === -1 &&
20669              (a >= 0
20670                ? ((e = 0), this._setEndings(!0, 0 === this.repetitions, f))
20671                : this._setEndings(0 === this.repetitions, !0, f)),
20672            b >= c || b < 0)
20673          ) {
20674            var g = Math.floor(b / c)
20675            ;(b -= c * g), (e += Math.abs(g))
20676            var h = this.repetitions - e
20677            if (h < 0)
20678              this.clampWhenFinished ? (this.paused = !0) : (this.enabled = !1),
20679                (b = a > 0 ? c : 0),
20680                this._mixer.dispatchEvent({
20681                  type: 'finished',
20682                  action: this,
20683                  direction: a > 0 ? 1 : -1
20684                })
20685            else {
20686              if (0 === h) {
20687                var i = a < 0
20688                this._setEndings(i, !i, f)
20689              } else this._setEndings(!1, !1, f)
20690              ;(this._loopCount = e),
20691                this._mixer.dispatchEvent({
20692                  type: 'loop',
20693                  action: this,
20694                  loopDelta: g
20695                })
20696            }
20697          }
20698          if (f && 1 === (1 & e)) return (this.time = b), c - b
20699        }
20700        return (this.time = b), b
20701      },
20702      _setEndings: function (a, b, c) {
20703        var d = this._interpolantSettings
20704        c
20705          ? ((d.endingStart = eb), (d.endingEnd = eb))
20706          : (a
20707              ? (d.endingStart = this.zeroSlopeAtStart ? eb : db)
20708              : (d.endingStart = fb),
20709            b
20710              ? (d.endingEnd = this.zeroSlopeAtEnd ? eb : db)
20711              : (d.endingEnd = fb))
20712      },
20713      _scheduleFading: function (a, b, c) {
20714        var d = this._mixer,
20715          e = d.time,
20716          f = this._weightInterpolant
20717        null === f &&
20718          ((f = d._lendControlInterpolant()), (this._weightInterpolant = f))
20719        var g = f.parameterPositions,
20720          h = f.sampleValues
20721        return (g[0] = e), (h[0] = b), (g[1] = e + a), (h[1] = c), this
20722      }
20723    }),
20724    (Ai.prototype = {
20725      constructor: Ai,
20726      clipAction: function (a, b) {
20727        var c = b || this._root,
20728          d = c.uuid,
20729          e = 'string' == typeof a ? Lh.findByName(c, a) : a,
20730          f = null !== e ? e.uuid : a,
20731          g = this._actionsByClip[f],
20732          h = null
20733        if (void 0 !== g) {
20734          var i = g.actionByRoot[d]
20735          if (void 0 !== i) return i
20736          ;(h = g.knownActions[0]), null === e && (e = h._clip)
20737        }
20738        if (null === e) return null
20739        var j = new zi(this, e, b)
20740        return this._bindAction(j, h), this._addInactiveAction(j, f, d), j
20741      },
20742      existingAction: function (a, b) {
20743        var c = b || this._root,
20744          d = c.uuid,
20745          e = 'string' == typeof a ? Lh.findByName(c, a) : a,
20746          f = e ? e.uuid : a,
20747          g = this._actionsByClip[f]
20748        return void 0 !== g ? g.actionByRoot[d] || null : null
20749      },
20750      stopAllAction: function () {
20751        var a = this._actions,
20752          b = this._nActiveActions,
20753          c = this._bindings,
20754          d = this._nActiveBindings
20755        ;(this._nActiveActions = 0), (this._nActiveBindings = 0)
20756        for (var e = 0; e !== b; ++e) a[e].reset()
20757        for (var e = 0; e !== d; ++e) c[e].useCount = 0
20758        return this
20759      },
20760      update: function (a) {
20761        a *= this.timeScale
20762        for (
20763          var b = this._actions,
20764            c = this._nActiveActions,
20765            d = (this.time += a),
20766            e = Math.sign(a),
20767            f = (this._accuIndex ^= 1),
20768            g = 0;
20769          g !== c;
20770          ++g
20771        ) {
20772          var h = b[g]
20773          h.enabled && h._update(d, a, e, f)
20774        }
20775        for (
20776          var i = this._bindings, j = this._nActiveBindings, g = 0;
20777          g !== j;
20778          ++g
20779        )
20780          i[g].apply(f)
20781        return this
20782      },
20783      getRoot: function () {
20784        return this._root
20785      },
20786      uncacheClip: function (a) {
20787        var b = this._actions,
20788          c = a.uuid,
20789          d = this._actionsByClip,
20790          e = d[c]
20791        if (void 0 !== e) {
20792          for (var f = e.knownActions, g = 0, h = f.length; g !== h; ++g) {
20793            var i = f[g]
20794            this._deactivateAction(i)
20795            var j = i._cacheIndex,
20796              k = b[b.length - 1]
20797            ;(i._cacheIndex = null),
20798              (i._byClipCacheIndex = null),
20799              (k._cacheIndex = j),
20800              (b[j] = k),
20801              b.pop(),
20802              this._removeInactiveBindingsForAction(i)
20803          }
20804          delete d[c]
20805        }
20806      },
20807      uncacheRoot: function (a) {
20808        var b = a.uuid,
20809          c = this._actionsByClip
20810        for (var d in c) {
20811          var e = c[d].actionByRoot,
20812            f = e[b]
20813          void 0 !== f &&
20814            (this._deactivateAction(f), this._removeInactiveAction(f))
20815        }
20816        var g = this._bindingsByRootAndName,
20817          h = g[b]
20818        if (void 0 !== h)
20819          for (var i in h) {
20820            var j = h[i]
20821            j.restoreOriginalState(), this._removeInactiveBinding(j)
20822          }
20823      },
20824      uncacheAction: function (a, b) {
20825        var c = this.existingAction(a, b)
20826        null !== c && (this._deactivateAction(c), this._removeInactiveAction(c))
20827      }
20828    }),
20829    Object.assign(Ai.prototype, {
20830      _bindAction: function (a, b) {
20831        var c = a._localRoot || this._root,
20832          d = a._clip.tracks,
20833          e = d.length,
20834          f = a._propertyBindings,
20835          g = a._interpolants,
20836          h = c.uuid,
20837          i = this._bindingsByRootAndName,
20838          j = i[h]
20839        void 0 === j && ((j = {}), (i[h] = j))
20840        for (var k = 0; k !== e; ++k) {
20841          var l = d[k],
20842            m = l.name,
20843            n = j[m]
20844          if (void 0 !== n) f[k] = n
20845          else {
20846            if (((n = f[k]), void 0 !== n)) {
20847              null === n._cacheIndex &&
20848                (++n.referenceCount, this._addInactiveBinding(n, h, m))
20849              continue
20850            }
20851            var o = b && b._propertyBindings[k].binding.parsedPath
20852            ;(n = new wi(
20853              xi.create(c, m, o),
20854              l.ValueTypeName,
20855              l.getValueSize()
20856            )),
20857              ++n.referenceCount,
20858              this._addInactiveBinding(n, h, m),
20859              (f[k] = n)
20860          }
20861          g[k].resultBuffer = n.buffer
20862        }
20863      },
20864      _activateAction: function (a) {
20865        if (!this._isActiveAction(a)) {
20866          if (null === a._cacheIndex) {
20867            var b = (a._localRoot || this._root).uuid,
20868              c = a._clip.uuid,
20869              d = this._actionsByClip[c]
20870            this._bindAction(a, d && d.knownActions[0]),
20871              this._addInactiveAction(a, c, b)
20872          }
20873          for (var e = a._propertyBindings, f = 0, g = e.length; f !== g; ++f) {
20874            var h = e[f]
20875            0 === h.useCount++ && (this._lendBinding(h), h.saveOriginalState())
20876          }
20877          this._lendAction(a)
20878        }
20879      },
20880      _deactivateAction: function (a) {
20881        if (this._isActiveAction(a)) {
20882          for (var b = a._propertyBindings, c = 0, d = b.length; c !== d; ++c) {
20883            var e = b[c]
20884            0 === --e.useCount &&
20885              (e.restoreOriginalState(), this._takeBackBinding(e))
20886          }
20887          this._takeBackAction(a)
20888        }
20889      },
20890      _initMemoryManager: function () {
20891        ;(this._actions = []),
20892          (this._nActiveActions = 0),
20893          (this._actionsByClip = {}),
20894          (this._bindings = []),
20895          (this._nActiveBindings = 0),
20896          (this._bindingsByRootAndName = {}),
20897          (this._controlInterpolants = []),
20898          (this._nActiveControlInterpolants = 0)
20899        var a = this
20900        this.stats = {
20901          actions: {
20902            get total() {
20903              return a._actions.length
20904            },
20905            get inUse() {
20906              return a._nActiveActions
20907            }
20908          },
20909          bindings: {
20910            get total() {
20911              return a._bindings.length
20912            },
20913            get inUse() {
20914              return a._nActiveBindings
20915            }
20916          },
20917          controlInterpolants: {
20918            get total() {
20919              return a._controlInterpolants.length
20920            },
20921            get inUse() {
20922              return a._nActiveControlInterpolants
20923            }
20924          }
20925        }
20926      },
20927      _isActiveAction: function (a) {
20928        var b = a._cacheIndex
20929        return null !== b && b < this._nActiveActions
20930      },
20931      _addInactiveAction: function (a, b, c) {
20932        var d = this._actions,
20933          e = this._actionsByClip,
20934          f = e[b]
20935        if (void 0 === f)
20936          (f = { knownActions: [a], actionByRoot: {} }),
20937            (a._byClipCacheIndex = 0),
20938            (e[b] = f)
20939        else {
20940          var g = f.knownActions
20941          ;(a._byClipCacheIndex = g.length), g.push(a)
20942        }
20943        ;(a._cacheIndex = d.length), d.push(a), (f.actionByRoot[c] = a)
20944      },
20945      _removeInactiveAction: function (a) {
20946        var b = this._actions,
20947          c = b[b.length - 1],
20948          d = a._cacheIndex
20949        ;(c._cacheIndex = d), (b[d] = c), b.pop(), (a._cacheIndex = null)
20950        var e = a._clip.uuid,
20951          f = this._actionsByClip,
20952          g = f[e],
20953          h = g.knownActions,
20954          i = h[h.length - 1],
20955          j = a._byClipCacheIndex
20956        ;(i._byClipCacheIndex = j),
20957          (h[j] = i),
20958          h.pop(),
20959          (a._byClipCacheIndex = null)
20960        var k = g.actionByRoot,
20961          l = (b._localRoot || this._root).uuid
20962        delete k[l],
20963          0 === h.length && delete f[e],
20964          this._removeInactiveBindingsForAction(a)
20965      },
20966      _removeInactiveBindingsForAction: function (a) {
20967        for (var b = a._propertyBindings, c = 0, d = b.length; c !== d; ++c) {
20968          var e = b[c]
20969          0 === --e.referenceCount && this._removeInactiveBinding(e)
20970        }
20971      },
20972      _lendAction: function (a) {
20973        var b = this._actions,
20974          c = a._cacheIndex,
20975          d = this._nActiveActions++,
20976          e = b[d]
20977        ;(a._cacheIndex = d), (b[d] = a), (e._cacheIndex = c), (b[c] = e)
20978      },
20979      _takeBackAction: function (a) {
20980        var b = this._actions,
20981          c = a._cacheIndex,
20982          d = --this._nActiveActions,
20983          e = b[d]
20984        ;(a._cacheIndex = d), (b[d] = a), (e._cacheIndex = c), (b[c] = e)
20985      },
20986      _addInactiveBinding: function (a, b, c) {
20987        var d = this._bindingsByRootAndName,
20988          e = d[b],
20989          f = this._bindings
20990        void 0 === e && ((e = {}), (d[b] = e)),
20991          (e[c] = a),
20992          (a._cacheIndex = f.length),
20993          f.push(a)
20994      },
20995      _removeInactiveBinding: function (a) {
20996        var b = this._bindings,
20997          c = a.binding,
20998          d = c.rootNode.uuid,
20999          e = c.path,
21000          f = this._bindingsByRootAndName,
21001          g = f[d],
21002          h = b[b.length - 1],
21003          i = a._cacheIndex
21004        ;(h._cacheIndex = i), (b[i] = h), b.pop(), delete g[e]
21005        a: {
21006          for (var j in g) break a
21007          delete f[d]
21008        }
21009      },
21010      _lendBinding: function (a) {
21011        var b = this._bindings,
21012          c = a._cacheIndex,
21013          d = this._nActiveBindings++,
21014          e = b[d]
21015        ;(a._cacheIndex = d), (b[d] = a), (e._cacheIndex = c), (b[c] = e)
21016      },
21017      _takeBackBinding: function (a) {
21018        var b = this._bindings,
21019          c = a._cacheIndex,
21020          d = --this._nActiveBindings,
21021          e = b[d]
21022        ;(a._cacheIndex = d), (b[d] = a), (e._cacheIndex = c), (b[c] = e)
21023      },
21024      _lendControlInterpolant: function () {
21025        var a = this._controlInterpolants,
21026          b = this._nActiveControlInterpolants++,
21027          c = a[b]
21028        return (
21029          void 0 === c &&
21030            ((c = new zh(
21031              new Float32Array(2),
21032              new Float32Array(2),
21033              1,
21034              this._controlInterpolantsResultBuffer
21035            )),
21036            (c.__cacheIndex = b),
21037            (a[b] = c)),
21038          c
21039        )
21040      },
21041      _takeBackControlInterpolant: function (a) {
21042        var b = this._controlInterpolants,
21043          c = a.__cacheIndex,
21044          d = --this._nActiveControlInterpolants,
21045          e = b[d]
21046        ;
21046(a.__cacheIndex = d), (b[d] = a), (e.__cacheIndex = c), (b[c] = e)
21047      },
21048      _controlInterpolantsResultBuffer: new Float32Array(1)
21049    }),
21050    Object.assign(Ai.prototype, b.prototype),
21051    (Bi.prototype.clone = function () {
21052      return new Bi(
21053        void 0 === this.value.clone ? this.value : this.value.clone()
21054      )
21055    }),
21056    (Ci.prototype = Object.create(ff.prototype)),
21057    (Ci.prototype.constructor = Ci),
21058    (Ci.prototype.isInstancedBufferGeometry = !0),
21059    (Ci.prototype.addGroup = function (a, b, c) {
21060      this.groups.push({ start: a, count: b, materialIndex: c })
21061    }),
21062    (Ci.prototype.copy = function (a) {
21063      var b = a.index
21064      null !== b && this.setIndex(b.clone())
21065      var c = a.attributes
21066      for (var d in c) {
21067        var e = c[d]
21068        this.addAttribute(d, e.clone())
21069      }
21070      for (var f = a.groups, g = 0, h = f.length; g < h; g++) {
21071        var i = f[g]
21072        this.addGroup(i.start, i.count, i.materialIndex)
21073      }
21074      return this
21075    }),
21076    (Di.prototype = {
21077      constructor: Di,
21078      isInterleavedBufferAttribute: !0,
21079      get count() {
21080        return this.data.count
21081      },
21082      get array() {
21083        return this.data.array
21084      },
21085      setX: function (a, b) {
21086        return (this.data.array[a * this.data.stride + this.offset] = b), this
21087      },
21088      setY: function (a, b) {
21089        return (
21090          (this.data.array[a * this.data.stride + this.offset + 1] = b), this
21091        )
21092      },
21093      setZ: function (a, b) {
21094        return (
21095          (this.data.array[a * this.data.stride + this.offset + 2] = b), this
21096        )
21097      },
21098      setW: function (a, b) {
21099        return (
21100          (this.data.array[a * this.data.stride + this.offset + 3] = b), this
21101        )
21102      },
21103      getX: function (a) {
21104        return this.data.array[a * this.data.stride + this.offset]
21105      },
21106      getY: function (a) {
21107        return this.data.array[a * this.data.stride + this.offset + 1]
21108      },
21109      getZ: function (a) {
21110        return this.data.array[a * this.data.stride + this.offset + 2]
21111      },
21112      getW: function (a) {
21113        return this.data.array[a * this.data.stride + this.offset + 3]
21114      },
21115      setXY: function (a, b, c) {
21116        return (
21117          (a = a * this.data.stride + this.offset),
21118          (this.data.array[a + 0] = b),
21119          (this.data.array[a + 1] = c),
21120          this
21121        )
21122      },
21123      setXYZ: function (a, b, c, d) {
21124        return (
21125          (a = a * this.data.stride + this.offset),
21126          (this.data.array[a + 0] = b),
21127          (this.data.array[a + 1] = c),
21128          (this.data.array[a + 2] = d),
21129          this
21130        )
21131      },
21132      setXYZW: function (a, b, c, d, e) {
21133        return (
21134          (a = a * this.data.stride + this.offset),
21135          (this.data.array[a + 0] = b),
21136          (this.data.array[a + 1] = c),
21137          (this.data.array[a + 2] = d),
21138          (this.data.array[a + 3] = e),
21139          this
21140        )
21141      }
21142    }),
21143    (Ei.prototype = {
21144      constructor: Ei,
21145      isInterleavedBuffer: !0,
21146      set needsUpdate(a) {
21147        a === !0 && this.version++
21148      },
21149      setArray: function (a) {
21150        if (Array.isArray(a))
21151          throw new TypeError(
21152            'THREE.BufferAttribute: array should be a Typed Array.'
21153          )
21154        ;(this.count = void 0 !== a ? a.length / this.stride : 0),
21155          (this.array = a)
21156      },
21157      setDynamic: function (a) {
21158        return (this.dynamic = a), this
21159      },
21160      copy: function (a) {
21161        return (
21162          (this.array = new a.array.constructor(a.array)),
21163          (this.count = a.count),
21164          (this.stride = a.stride),
21165          (this.dynamic = a.dynamic),
21166          this
21167        )
21168      },
21169      copyAt: function (a, b, c) {
21170        ;(a *= this.stride), (c *= b.stride)
21171        for (var d = 0, e = this.stride; d < e; d++)
21172          this.array[a + d] = b.array[c + d]
21173        return this
21174      },
21175      set: function (a, b) {
21176        return void 0 === b && (b = 0), this.array.set(a, b), this
21177      },
21178      clone: function () {
21179        return new this.constructor().copy(this)
21180      },
21181      onUpload: function (a) {
21182        return (this.onUploadCallback = a), this
21183      }
21184    }),
21185    (Fi.prototype = Object.create(Ei.prototype)),
21186    (Fi.prototype.constructor = Fi),
21187    (Fi.prototype.isInstancedInterleavedBuffer = !0),
21188    (Fi.prototype.copy = function (a) {
21189      return (
21190        Ei.prototype.copy.call(this, a),
21191        (this.meshPerAttribute = a.meshPerAttribute),
21192        this
21193      )
21194    }),
21195    (Gi.prototype = Object.create(Se.prototype)),
21196    (Gi.prototype.constructor = Gi),
21197    (Gi.prototype.isInstancedBufferAttribute = !0),
21198    (Gi.prototype.copy = function (a) {
21199      return (
21200        Se.prototype.copy.call(this, a),
21201        (this.meshPerAttribute = a.meshPerAttribute),
21202        this
21203      )
21204    }),
21205    (Hi.prototype = {
21206      constructor: Hi,
21207      linePrecision: 1,
21208      set: function (a, b) {
21209        this.ray.set(a, b)
21210      },
21211      setFromCamera: function (a, b) {
21212        b && b.isPerspectiveCamera
21213          ? (this.ray.origin.setFromMatrixPosition(b.matrixWorld),
21214            this.ray.direction
21215              .set(a.x, a.y, 0.5)
21216              .unproject(b)
21217              .sub(this.ray.origin)
21218              .normalize())
21219          : b && b.isOrthographicCamera
21220          ? (this.ray.origin
21221              .set(a.x, a.y, (b.near + b.far) / (b.near - b.far))
21222              .unproject(b),
21223            this.ray.direction.set(0, 0, -1).transformDirection(b.matrixWorld))
21224          : console.error('THREE.Raycaster: Unsupported camera type.')
21225      },
21226      intersectObject: function (a, b) {
21227        var c = []
21228        return Ji(a, this, c, b), c.sort(Ii), c
21229      },
21230      intersectObjects: function (a, b) {
21231        var c = []
21232        if (Array.isArray(a) === !1)
21233          return (
21234            console.warn(
21235              'THREE.Raycaster.intersectObjects: objects is not an Array.'
21236            ),
21237            c
21238          )
21239        for (var d = 0, e = a.length; d < e; d++) Ji(a[d], this, c, b)
21240        return c.sort(Ii), c
21241      }
21242    }),
21243    (Ki.prototype = {
21244      constructor: Ki,
21245      start: function () {
21246        ;(this.startTime = (performance || Date).now()),
21247          (this.oldTime = this.startTime),
21248          (this.elapsedTime = 0),
21249          (this.running = !0)
21250      },
21251      stop: function () {
21252        this.getElapsedTime(), (this.running = !1)
21253      },
21254      getElapsedTime: function () {
21255        return this.getDelta(), this.elapsedTime
21256      },
21257      getDelta: function () {
21258        var a = 0
21259        if ((this.autoStart && !this.running && this.start(), this.running)) {
21260          var b = (performance || Date).now()
21261          ;(a = (b - this.oldTime) / 1e3),
21262            (this.oldTime = b),
21263            (this.elapsedTime += a)
21264        }
21265        return a
21266      }
21267    }),
21268    (Li.prototype = {
21269      constructor: Li,
21270      set: function (a, b, c) {
21271        return (this.radius = a), (this.phi = b), (this.theta = c), this
21272      },
21273      clone: function () {
21274        return new this.constructor().copy(this)
21275      },
21276      copy: function (a) {
21277        return (
21278          (this.radius = a.radius),
21279          (this.phi = a.phi),
21280          (this.theta = a.theta),
21281          this
21282        )
21283      },
21284      makeSafe: function () {
21285        var a = 1e-6
21286        return (this.phi = Math.max(a, Math.min(Math.PI - a, this.phi))), this
21287      },
21288      setFromVector3: function (a) {
21289        return (
21290          (this.radius = a.length()),
21291          0 === this.radius
21292            ? ((this.theta = 0), (this.phi = 0))
21293            : ((this.theta = Math.atan2(a.x, a.z)),
21294              (this.phi = Math.acos(tb.clamp(a.y / this.radius, -1, 1)))),
21295          this
21296        )
21297      }
21298    }),
21299    (Mi.prototype = {
21300      constructor: Mi,
21301      set: function (a, b, c) {
21302        return (this.radius = a), (this.theta = b), (this.y = c), this
21303      },
21304      clone: function () {
21305        return new this.constructor().copy(this)
21306      },
21307      copy: function (a) {
21308        return (
21309          (this.radius = a.radius), (this.theta = a.theta), (this.y = a.y), this
21310        )
21311      },
21312      setFromVector3: function (a) {
21313        return (
21314          (this.radius = Math.sqrt(a.x * a.x + a.z * a.z)),
21315          (this.theta = Math.atan2(a.x, a.z)),
21316          (this.y = a.y),
21317          this
21318        )
21319      }
21320    }),
21321    (Ni.prototype = Object.create(gf.prototype)),
21322    (Ni.prototype.constructor = Ni),
21323    (Ni.prototype.createAnimation = function (a, b, c, d) {
21324      var e = {
21325        start: b,
21326        end: c,
21327        length: c - b + 1,
21328        fps: d,
21329        duration: (c - b) / d,
21330        lastFrame: 0,
21331        currentFrame: 0,
21332        active: !1,
21333        time: 0,
21334        direction: 1,
21335        weight: 1,
21336        directionBackwards: !1,
21337        mirroredLoop: !1
21338      }
21339      ;(this.animationsMap[a] = e), this.animationsList.push(e)
21340    }),
21341    (Ni.prototype.autoCreateAnimations = function (a) {
21342      for (
21343        var c,
21344          b = /([a-z]+)_?(\d+)/i,
21345          d = {},
21346          e = this.geometry,
21347          f = 0,
21348          g = e.morphTargets.length;
21349        f < g;
21350        f++
21351      ) {
21352        var h = e.morphTargets[f],
21353          i = h.name.match(b)
21354        if (i && i.length > 1) {
21355          var j = i[1]
21356          d[j] || (d[j] = { start: 1 / 0, end: -(1 / 0) })
21357          var k = d[j]
21358          f < k.start && (k.start = f), f > k.end && (k.end = f), c || (c = j)
21359        }
21360      }
21361      for (var j in d) {
21362        var k = d[j]
21363        this.createAnimation(j, k.start, k.end, a)
21364      }
21365      this.firstAnimation = c
21366    }),
21367    (Ni.prototype.setAnimationDirectionForward = function (a) {
21368      var b = this.animationsMap[a]
21369      b && ((b.direction = 1), (b.directionBackwards = !1))
21370    }),
21371    (Ni.prototype.setAnimationDirectionBackward = function (a) {
21372      var b = this.animationsMap[a]
21373      b && ((b.direction = -1), (b.directionBackwards = !0))
21374    }),
21375    (Ni.prototype.setAnimationFPS = function (a, b) {
21376      var c = this.animationsMap[a]
21377      c && ((c.fps = b), (c.duration = (c.end - c.start) / c.fps))
21378    }),
21379    (Ni.prototype.setAnimationDuration = function (a, b) {
21380      var c = this.animationsMap[a]
21381      c && ((c.duration = b), (c.fps = (c.end - c.start) / c.duration))
21382    }),
21383    (Ni.prototype.setAnimationWeight = function (a, b) {
21384      var c = this.animationsMap[a]
21385      c && (c.weight = b)
21386    }),
21387    (Ni.prototype.setAnimationTime = function (a, b) {
21388      var c = this.animationsMap[a]
21389      c && (c.time = b)
21390    }),
21391    (Ni.prototype.getAnimationTime = function (a) {
21392      var b = 0,
21393        c = this.animationsMap[a]
21394      return c && (b = c.time), b
21395    }),
21396    (Ni.prototype.getAnimationDuration = function (a) {
21397      var b = -1,
21398        c = this.animationsMap[a]
21399      return c && (b = c.duration), b
21400    }),
21401    (Ni.prototype.playAnimation = function (a) {
21402      var b = this.animationsMap[a]
21403      b
21404        ? ((b.time = 0), (b.active = !0))
21405        : console.warn(
21406            'THREE.MorphBlendMesh: animation[' +
21407              a +
21408              '] undefined in .playAnimation()'
21409          )
21410    }),
21411    (Ni.prototype.stopAnimation = function (a) {
21412      var b = this.animationsMap[a]
21413      b && (b.active = !1)
21414    }),
21415    (Ni.prototype.update = function (a) {
21416      for (var b = 0, c = this.animationsList.length; b < c; b++) {
21417        var d = this.animationsList[b]
21418        if (d.active) {
21419          var e = d.duration / d.length
21420          ;(d.time += d.direction * a),
21421            d.mirroredLoop
21422              ? (d.time > d.duration || d.time < 0) &&
21423                ((d.direction *= -1),
21424                d.time > d.duration &&
21425                  ((d.time = d.duration), (d.directionBackwards = !0)),
21426                d.time < 0 && ((d.time = 0), (d.directionBackwards = !1)))
21427              : ((d.time = d.time % d.duration),
21428                d.time < 0 && (d.time += d.duration))
21429          var f = d.start + tb.clamp(Math.floor(d.time / e), 0, d.length - 1),
21430            g = d.weight
21431          f !== d.currentFrame &&
21432            ((this.morphTargetInfluences[d.lastFrame] = 0),
21433            (this.morphTargetInfluences[d.currentFrame] = 1 * g),
21434            (this.morphTargetInfluences[f] = 0),
21435            (d.lastFrame = d.currentFrame),
21436            (d.currentFrame = f))
21437          var h = (d.time % e) / e
21438          d.directionBackwards && (h = 1 - h),
21439            d.currentFrame !== d.lastFrame
21440              ? ((this.morphTargetInfluences[d.currentFrame] = h * g),
21441                (this.morphTargetInfluences[d.lastFrame] = (1 - h) * g))
21442              : (this.morphTargetInfluences[d.currentFrame] = g)
21443        }
21444      }
21445    }),
21446    (Oi.prototype = Object.create(Ne.prototype)),
21447    (Oi.prototype.constructor = Oi),
21448    (Oi.prototype.isImmediateRenderObject = !0),
21449    (Pi.prototype = Object.create(bg.prototype)),
21450    (Pi.prototype.constructor = Pi),
21451    (Pi.prototype.update = (function () {
21452      var a = new Bb(),
21453        b = new Bb(),
21454        c = new Fe()
21455      return function () {
21456        var e = ['a', 'b', 'c']
21457        this.object.updateMatrixWorld(!0),
21458          c.getNormalMatrix(this.object.matrixWorld)
21459        var f = this.object.matrixWorld,
21460          g = this.geometry.attributes.position,
21461          h = this.object.geometry
21462        if (h && h.isGeometry)
21463          for (
21464            var i = h.vertices, j = h.faces, k = 0, l = 0, m = j.length;
21465            l < m;
21466            l++
21467          )
21468            for (var n = j[l], o = 0, p = n.vertexNormals.length; o < p; o++) {
21469              var q = i[n[e[o]]],
21470                r = n.vertexNormals[o]
21471              a.copy(q).applyMatrix4(f),
21472                b
21473                  .copy(r)
21474                  .applyMatrix3(c)
21475                  .normalize()
21476                  .multiplyScalar(this.size)
21477                  .add(a),
21478                g.setXYZ(k, a.x, a.y, a.z),
21479                (k += 1),
21480                g.setXYZ(k, b.x, b.y, b.z),
21481                (k += 1)
21482            }
21483        else if (h && h.isBufferGeometry)
21484          for (
21485            var s = h.attributes.position,
21486              t = h.attributes.normal,
21487              k = 0,
21488              o = 0,
21489              p = s.count;
21490            o < p;
21491            o++
21492          )
21493            a.set(s.getX(o), s.getY(o), s.getZ(o)).applyMatrix4(f),
21494              b.set(t.getX(o), t.getY(o), t.getZ(o)),
21495              b.applyMatrix3(c).normalize().multiplyScalar(this.size).add(a),
21496              g.setXYZ(k, a.x, a.y, a.z),
21497              (k += 1),
21498              g.setXYZ(k, b.x, b.y, b.z),
21499              (k += 1)
21500        return (g.needsUpdate = !0), this
21501      }
21502    })()),
21503    (Qi.prototype = Object.create(Ne.prototype)),
21504    (Qi.prototype.constructor = Qi),
21505    (Qi.prototype.dispose = function () {
21506      this.cone.geometry.dispose(), this.cone.material.dispose()
21507    }),
21508    (Qi.prototype.update = (function () {
21509      var a = new Bb(),
21510        b = new Bb()
21511      return function () {
21512        var d = this.light.distance ? this.light.distance : 1e3,
21513          e = d * Math.tan(this.light.angle)
21514        this.cone.scale.set(e, e, d),
21515          a.setFromMatrixPosition(this.light.matrixWorld),
21516          b.setFromMatrixPosition(this.light.target.matrixWorld),
21517          this.cone.lookAt(b.sub(a)),
21518          this.cone.material.color
21519            .copy(this.light.color)
21520            .multiplyScalar(this.light.intensity)
21521      }
21522    })()),
21523    (Ri.prototype = Object.create(bg.prototype)),
21524    (Ri.prototype.constructor = Ri),
21525    (Ri.prototype.getBoneList = function (a) {
21526      var b = []
21527      a && a.isBone && b.push(a)
21528      for (var c = 0; c < a.children.length; c++)
21529        b.push.apply(b, this.getBoneList(a.children[c]))
21530      return b
21531    }),
21532    (Ri.prototype.update = (function () {
21533      var a = new Bb(),
21534        b = new Cb(),
21535        c = new Cb()
21536      return function () {
21537        var e = this.geometry,
21538          f = e.getAttribute('position')
21539        c.getInverse(this.root.matrixWorld)
21540        for (var g = 0, h = 0; g < this.bones.length; g++) {
21541          var i = this.bones[g]
21542          i.parent &&
21543            i.parent.isBone &&
21544            (b.multiplyMatrices(c, i.matrixWorld),
21545            a.setFromMatrixPosition(b),
21546            f.setXYZ(h, a.x, a.y, a.z),
21547            b.multiplyMatrices(c, i.parent.matrixWorld),
21548            a.setFromMatrixPosition(b),
21549            f.setXYZ(h + 1, a.x, a.y, a.z),
21550            (h += 2))
21551        }
21552        e.getAttribute('position').needsUpdate = !0
21553      }
21554    })()),
21555    (Si.prototype = Object.create(gf.prototype)),
21556    (Si.prototype.constructor = Si),
21557    (Si.prototype.dispose = function () {
21558      this.geometry.dispose(), this.material.dispose()
21559    }),
21560    (Si.prototype.update = function () {
21561      this.material.color
21562        .copy(this.light.color)
21563        .multiplyScalar(this.light.intensity)
21564    }),
21565    (Ti.prototype = Object.create(Ne.prototype)),
21566    (Ti.prototype.constructor = Ti),
21567    (Ti.prototype.dispose = function () {
21568      this.children[0].geometry.dispose(),
21569        this.children[0].material.dispose(),
21570        this.children[1].geometry.dispose(),
21571        this.children[1].material.dispose()
21572    }),
21573    (Ti.prototype.update = (function () {
21574      var a = new Bb(),
21575        b = new Bb()
21576      return function () {
21577        var d = this.children[0],
21578          e = this.children[1]
21579        if (this.light.target) {
21580          a.setFromMatrixPosition(this.light.matrixWorld),
21581            b.setFromMatrixPosition(this.light.target.matrixWorld)
21582          var f = b.clone().sub(a)
21583          d.lookAt(f), e.lookAt(f)
21584        }
21585        d.material.color
21586          .copy(this.light.color)
21587          .multiplyScalar(this.light.intensity),
21588          e.material.color
21589            .copy(this.light.color)
21590            .multiplyScalar(this.light.intensity)
21591        var g = 0.5 * this.light.width,
21592          h = 0.5 * this.light.height,
21593          i = d.geometry.getAttribute('position'),
21594          j = i.array
21595        ;(j[0] = g),
21596          (j[1] = -h),
21597          (j[2] = 0),
21598          (j[3] = g),
21599          (j[4] = h),
21600          (j[5] = 0),
21601          (j[6] = -g),
21602          (j[7] = h),
21603          (j[8] = 0),
21604          (j[9] = -g),
21605          (j[10] = h),
21606          (j[11] = 0),
21607          (j[12] = -g),
21608          (j[13] = -h),
21609          (j[14] = 0),
21610          (j[15] = g),
21611          (j[16] = -h),
21612          (j[17] = 0),
21613          (i.needsUpdate = !0)
21614      }
21615    })()),
21616    (Ui.prototype = Object.create(Ne.prototype)),
21617    (Ui.prototype.constructor = Ui),
21618    (Ui.prototype.dispose = function () {
21619      this.children[0].geometry.dispose(), this.children[0].material.dispose()
21620    }),
21621    (Ui.prototype.update = (function () {
21622      var a = new Bb(),
21623        b = new re(),
21624        c = new re()
21625      return function () {
21626        var e = this.children[0],
21627          f = e.geometry.getAttribute('color')
21628        b.copy(this.light.color).multiplyScalar(this.light.intensity),
21629          c.copy(this.light.groundColor).multiplyScalar(this.light.intensity)
21630        for (var g = 0, h = f.count; g < h; g++) {
21631          var i = g < h / 2 ? b : c
21632          f.setXYZ(g, i.r, i.g, i.b)
21633        }
21634        e.lookAt(a.setFromMatrixPosition(this.light.matrixWorld).negate()),
21635          (f.needsUpdate = !0)
21636      }
21637    })()),
21638    (Vi.prototype = Object.create(bg.prototype)),
21639    (Vi.prototype.constructor = Vi),
21640    (Wi.prototype = Object.create(bg.prototype)),
21641    (Wi.prototype.constructor = Wi),
21642    (Xi.prototype = Object.create(bg.prototype)),
21643    (Xi.prototype.constructor = Xi),
21644    (Xi.prototype.update = (function () {
21645      var a = new Bb(),
21646        b = new Bb(),
21647        c = new Fe()
21648      return function () {
21649        this.object.updateMatrixWorld(!0),
21650          c.getNormalMatrix(this.object.matrixWorld)
21651        for (
21652          var e = this.object.matrixWorld,
21653            f = this.geometry.attributes.position,
21654            g = this.object.geometry,
21655            h = g.vertices,
21656            i = g.faces,
21657            j = 0,
21658            k = 0,
21659            l = i.length;
21660          k < l;
21661          k++
21662        ) {
21663          var m = i[k],
21664            n = m.normal
21665          a
21666            .copy(h[m.a])
21667            .add(h[m.b])
21668            .add(h[m.c])
21669            .divideScalar(3)
21670            .applyMatrix4(e),
21671            b
21672              .copy(n)
21673              .applyMatrix3(c)
21674              .normalize()
21675              .multiplyScalar(this.size)
21676              .add(a),
21677            f.setXYZ(j, a.x, a.y, a.z),
21678            (j += 1),
21679            f.setXYZ(j, b.x, b.y, b.z),
21680            (j += 1)
21681        }
21682        return (f.needsUpdate = !0), this
21683      }
21684    })()),
21685    (Yi.prototype = Object.create(Ne.prototype)),
21686    (Yi.prototype.constructor = Yi),
21687    (Yi.prototype.dispose = function () {
21688      var a = this.children[0],
21689        b = this.children[1]
21690      a.geometry.dispose(),
21691        a.material.dispose(),
21692        b.geometry.dispose(),
21693        b.material.dispose()
21694    }),
21695    (Yi.prototype.update = (function () {
21696      var a = new Bb(),
21697        b = new Bb(),
21698        c = new Bb()
21699      return function () {
21700        a.setFromMatrixPosition(this.light.matrixWorld),
21701          b.setFromMatrixPosition(this.light.target.matrixWorld),
21702          c.subVectors(b, a)
21703        var e = this.children[0],
21704          f = this.children[1]
21705        e.lookAt(c),
21706          e.material.color
21707            .copy(this.light.color)
21708            .multiplyScalar(this.light.intensity),
21709          f.lookAt(c),
21710          (f.scale.z = c.length())
21711      }
21712    })()),
21713    (Zi.prototype = Object.create(bg.prototype)),
21714    (Zi.prototype.constructor = Zi),
21715    (Zi.prototype.update = (function () {
21716      function e(e, f, g, h) {
21717        c.set(f, g, h).unproject(d)
21718        var i = b[e]
21719        if (void 0 !== i)
21720          for (
21721            var j = a.getAttribute('position'), k = 0, l = i.length;
21722            k < l;
21723            k++
21724          )
21725            j.setXYZ(i[k], c.x, c.y, c.z)
21726      }
21727      var a,
21728        b,
21729        c = new Bb(),
21730        d = new mf()
21731      return function () {
21732        ;(a = this.geometry), (b = this.pointMap)
21733        var f = 1,
21734          g = 1
21735        d.projectionMatrix.copy(this.camera.projectionMatrix),
21736          e('c', 0, 0, -1),
21737          e('t', 0, 0, 1),
21738          e('n1', -f, -g, -1),
21739          e('n2', f, -g, -1),
21740          e('n3', -f, g, -1),
21741          e('n4', f, g, -1),
21742          e('f1', -f, -g, 1),
21743          e('f2', f, -g, 1),
21744          e('f3', -f, g, 1),
21745          e('f4', f, g, 1),
21746          e('u1', 0.7 * f, 1.1 * g, -1),
21747          e('u2', 0.7 * -f, 1.1 * g, -1),
21748          e('u3', 0, 2 * g, -1),
21749          e('cf1', -f, 0, 1),
21750          e('cf2', f, 0, 1),
21751          e('cf3', 0, -g, 1),
21752          e('cf4', 0, g, 1),
21753          e('cn1', -f, 0, -1),
21754          e('cn2', f, 0, -1),
21755          e('cn3', 0, -g, -1),
21756          e('cn4', 0, g, -1),
21757          (a.getAttribute('position').needsUpdate = !0)
21758      }
21759    })()),
21760    ($i.prototype = Object.create(bg.prototype)),
21761    ($i.prototype.constructor = $i),
21762    ($i.prototype.update = (function () {
21763      var a = new De()
21764      return function (c) {
21765        if ((c && c.isBox3 ? a.copy(c) : a.setFromObject(c), !a.isEmpty())) {
21766          var d = a.min,
21767            e = a.max,
21768            f = this.geometry.attributes.position,
21769            g = f.array
21770          ;(g[0] = e.x),
21771            (g[1] = e.y),
21772            (g[2] = e.z),
21773            (g[3] = d.x),
21774            (g[4] = e.y),
21775            (g[5] = e.z),
21776            (g[6] = d.x),
21777            (g[7] = d.y),
21778            (g[8] = e.z),
21779            (g[9] = e.x),
21780            (g[10] = d.y),
21781            (g[11] = e.z),
21782            (g[12] = e.x),
21783            (g[13] = e.y),
21784            (g[14] = d.z),
21785            (g[15] = d.x),
21786            (g[16] = e.y),
21787            (g[17] = d.z),
21788            (g[18] = d.x),
21789            (g[19] = d.y),
21790            (g[20] = d.z),
21791            (g[21] = e.x),
21792            (g[22] = d.y),
21793            (g[23] = d.z),
21794            (f.needsUpdate = !0),
21795            this.geometry.computeBoundingSphere()
21796        }
21797      }
21798    })())
21799  var _i, aj
21800  ;(bj.prototype = Object.create(Ne.prototype)),
21801    (bj.prototype.constructor = bj),
21802    (bj.prototype.setDirection = (function () {
21803      var b,
21804        a = new Bb()
21805      return function (d) {
21806        d.y > 0.99999
21807          ? this.quaternion.set(0, 0, 0, 1)
21808          : d.y < -0.99999
21809          ? this.quaternion.set(1, 0, 0, 0)
21810          : (a.set(d.z, 0, -d.x).normalize(),
21811            (b = Math.acos(d.y)),
21812            this.quaternion.setFromAxisAngle(a, b))
21813      }
21814    })()),
21815    (bj.prototype.setLength = function (a, b, c) {
21816      void 0 === b && (b = 0.2 * a),
21817        void 0 === c && (c = 0.2 * b),
21818        this.line.scale.set(1, Math.max(0, a - b), 1),
21819        this.line.updateMatrix(),
21820        this.cone.scale.set(c, b, c),
21821        (this.cone.position.y = a),
21822        this.cone.updateMatrix()
21823    }),
21824    (bj.prototype.setColor = function (a) {
21825      this.line.material.color.copy(a), this.cone.material.color.copy(a)
21826    }),
21827    (cj.prototype = Object.create(bg.prototype)),
21828    (cj.prototype.constructor = cj)
21829  var ej = new Bb(),
21830    fj = new dj(),
21831    gj = new dj(),
21832    hj = new dj()
21833  ;(ij.prototype = Object.create(_h.prototype)),
21834    (ij.prototype.constructor = ij),
21835    (ij.prototype.getPoint = function (a) {
21836      var b = this.points,
21837        c = b.length
21838      c < 2 && console.log('duh, you need at least 2 points')
21839      var d = (c - (this.closed ? 0 : 1)) * a,
21840        e = Math.floor(d),
21841        f = d - e
21842      this.closed
21843        ? (e += e > 0 ? 0 : (Math.floor(Math.abs(e) / b.length) + 1) * b.length)
21844        : 0 === f && e === c - 1 && ((e = c - 2), (f = 1))
21845      var g, h, i, j
21846      if (
21847        (this.closed || e > 0
21848          ? (g = b[(e - 1) % c])
21849          : (ej.subVectors(b[0], b[1]).add(b[0]), (g = ej)),
21850        (h = b[e % c]),
21851        (i = b[(e + 1) % c]),
21852        this.closed || e + 2 < c
21853          ? (j = b[(e + 2) % c])
21854          : (ej.subVectors(b[c - 1], b[c - 2]).add(b[c - 1]), (j = ej)),
21855        void 0 === this.type ||
21856          'centripetal' === this.type ||
21857          'chordal' === this.type)
21858      ) {
21859        var k = 'chordal' === this.type ? 0.5 : 0.25,
21860          l = Math.pow(g.distanceToSquared(h), k),
21861          m = Math.pow(h.distanceToSquared(i), k),
21862          n = Math.pow(i.distanceToSquared(j), k)
21863        m < 1e-4 && (m = 1),
21864          l < 1e-4 && (l = m),
21865          n < 1e-4 && (n = m),
21866          fj.initNonuniformCatmullRom(g.x, h.x, i.x, j.x, l, m, n),
21867          gj.initNonuniformCatmullRom(g.y, h.y, i.y, j.y, l, m, n),
21868          hj.initNonuniformCatmullRom(g.z, h.z, i.z, j.z, l, m, n)
21869      } else if ('catmullrom' === this.type) {
21870        var o = void 0 !== this.tension ? this.tension : 0.5
21871        fj.initCatmullRom(g.x, h.x, i.x, j.x, o),
21872          gj.initCatmullRom(g.y, h.y, i.y, j.y, o),
21873          hj.initCatmullRom(g.z, h.z, i.z, j.z, o)
21874      }
21875      return new Bb(fj.calc(f), gj.calc(f), hj.calc(f))
21876    }),
21877    (jj.prototype = Object.create(_h.prototype)),
21878    (jj.prototype.constructor = jj),
21879    (jj.prototype.getPoint = function (a) {
21880      var b = this.v0,
21881        c = this.v1,
21882        d = this.v2,
21883        e = this.v3
21884      return new Bb(
21885        $h(a, b.x, c.x, d.x, e.x),
21886        $h(a, b.y, c.y, d.y, e.y),
21887        $h(a, b.z, c.z, d.z, e.z)
21888      )
21889    }),
21890    (kj.prototype = Object.create(_h.prototype)),
21891    (kj.prototype.constructor = kj),
21892    (kj.prototype.getPoint = function (a) {
21893      var b = this.v0,
21894        c = this.v1,
21895        d = this.v2
21896      return new Bb(
21897        Vh(a, b.x, c.x, d.x),
21898        Vh(a, b.y, c.y, d.y),
21899        Vh(a, b.z, c.z, d.z)
21900      )
21901    }),
21902    (lj.prototype = Object.create(_h.prototype)),
21903    (lj.prototype.constructor = lj),
21904    (lj.prototype.getPoint = function (a) {
21905      if (1 === a) return this.v2.clone()
21906      var b = new Bb()
21907      return (
21908        b.subVectors(this.v2, this.v1), b.multiplyScalar(a), b.add(this.v1), b
21909      )
21910    }),
21911    (mj.prototype = Object.create(ci.prototype)),
21912    (mj.prototype.constructor = mj)
21913  var nj = {
21914      createMultiMaterialObject: function (a, b) {
21915        for (var c = new eg(), d = 0, e = b.length; d < e; d++)
21916          c.add(new gf(a, b[d]))
21917        return c
21918      },
21919      detach: function (a, b, c) {
21920        a.applyMatrix(b.matrixWorld), b.remove(a), c.add(a)
21921      },
21922      attach: function (a, b, c) {
21923        var d = new Cb()
21924        d.getInverse(c.matrixWorld), a.applyMatrix(d), b.remove(a), c.add(a)
21925      }
21926    },
21927    pj = 0,
21928    qj = 1
21929  ;(_h.create = function (a, b) {
21930    return (
21931      console.log('THREE.Curve.create() has been deprecated'),
21932      (a.prototype = Object.create(_h.prototype)),
21933      (a.prototype.constructor = a),
21934      (a.prototype.getPoint = b),
21935      a
21936    )
21937  }),
21938    (Jj.prototype = Object.create(ij.prototype)),
21939    (Kj.prototype = Object.create(ij.prototype)),
21940    (Lj.prototype = Object.create(ij.prototype)),
21941    Object.assign(Lj.prototype, {
21942      initFromArray: function (a) {
21943        console.error('THREE.Spline: .initFromArray() has been removed.')
21944      },
21945      getControlPointsArray: function (a) {
21946        console.error(
21947          'THREE.Spline: .getControlPointsArray() has been removed.'
21948        )
21949      },
21950      reparametrizeByArcLength: function (a) {
21951        console.error(
21952          'THREE.Spline: .reparametrizeByArcLength() has been removed.'
21953        )
21954      }
21955    }),
21956    (Vi.prototype.setColors = function () {
21957      console.error(
21958        'THREE.GridHelper: setColors() has been deprecated, pass them in the constructor instead.'
21959      )
21960    }),
21961    Object.assign(we.prototype, {
21962      center: function (a) {
21963        return (
21964          console.warn(
21965            'THREE.Box2: .center() has been renamed to .getCenter().'
21966          ),
21967          this.getCenter(a)
21968        )
21969      },
21970      empty: function () {
21971        return (
21972          console.warn('THREE.Box2: .empty() has been renamed to .isEmpty().'),
21973          this.isEmpty()
21974        )
21975      },
21976      isIntersectionBox: function (a) {
21977        return (
21978          console.warn(
21979            'THREE.Box2: .isIntersectionBox() has been renamed to .intersectsBox().'
21980          ),
21981          this.intersectsBox(a)
21982        )
21983      },
21984      size: function (a) {
21985        return (
21986          console.warn('THREE.Box2: .size() has been renamed to .getSize().'),
21987          this.getSize(a)
21988        )
21989      }
21990    }),
21991    Object.assign(De.prototype, {
21992      center: function (a) {
21993        return (
21994          console.warn(
21995            'THREE.Box3: .center() has been renamed to .getCenter().'
21996          ),
21997          this.getCenter(a)
21998        )
21999      },
22000      empty: function () {
22001        return (
22002          console.warn('THREE.Box3: .empty() has been renamed to .isEmpty().'),
22003          this.isEmpty()
22004        )
22005      },
22006      isIntersectionBox: function (a) {
22007        return (
22008          console.warn(
22009            'THREE.Box3: .isIntersectionBox() has been renamed to .intersectsBox().'
22010          ),
22011          this.intersectsBox(a)
22012        )
22013      },
22014      isIntersectionSphere: function (a) {
22015        return (
22016          console.warn(
22017            'THREE.Box3: .isIntersectionSphere() has been renamed to .intersectsSphere().'
22018          ),
22019          this.intersectsSphere(a)
22020        )
22021      },
22022      size: function (a) {
22023        return (
22024          console.warn('THREE.Box3: .size() has been renamed to .getSize().'),
22025          this.getSize(a)
22026        )
22027      }
22028    }),
22029    (Oe.prototype.center = function (a) {
22030      return (
22031        console.warn(
22032          'THREE.Line3: .center() has been renamed to .getCenter().'
22033        ),
22034        this.getCenter(a)
22035      )
22036    }),
22037    (tb.random16 = function () {
22038      return (
22039        console.warn(
22040          'THREE.Math.random16() has been deprecated. Use Math.random() instead.'
22041        ),
22042        Math.random()
22043      )
22044    }),
22045    Object.assign(Fe.prototype, {
22046      flattenToArrayOffset: function (a, b) {
22047        return (
22048          console.warn(
22049            'THREE.Matrix3: .flattenToArrayOffset() has been deprecated. Use .toArray() instead.'
22050          ),
22051          this.toArray(a, b)
22052        )
22053      },
22054      multiplyVector3: function (a) {
22055        return (
22056          console.warn(
22057            'THREE.Matrix3: .multiplyVector3() has been removed. Use vector.applyMatrix3( matrix ) instead.'
22058          ),
22059          a.applyMatrix3(this)
22060        )
22061      },
22062      multiplyVector3Array: function (a) {
22063        return (
22064          console.warn(
22065            'THREE.Matrix3: .multiplyVector3Array() has been renamed. Use matrix.applyToVector3Array( array ) instead.'
22066          ),
22067          this.applyToVector3Array(a)
22068        )
22069      },
22070      applyToBuffer: function (a, b, c) {
22071        return (
22072          console.warn(
22073            'THREE.Matrix3: .applyToBuffer() has been removed. Use matrix.applyToBufferAttribute( attribute ) instead.'
22074          ),
22075          this.applyToBufferAttribute(a)
22076        )
22077      },
22078      applyToVector3Array: function (a, b, c) {
22079        console.error('THREE.Matrix3: .applyToVector3Array() has been removed.')
22080      }
22081    }),
22082    Object.assign(Cb.prototype, {
22083      extractPosition: function (a) {
22084        return (
22085          console.warn(
22086            'THREE.Matrix4: .extractPosition() has been renamed to .copyPosition().'
22087          ),
22088          this.copyPosition(a)
22089        )
22090      },
22091      flattenToArrayOffset: function (a, b) {
22092        return (
22093          console.warn(
22094            'THREE.Matrix4: .flattenToArrayOffset() has been deprecated. Use .toArray() instead.'
22095          ),
22096          this.toArray(a, b)
22097        )
22098      },
22099      getPosition: (function () {
22100        var a
22101        return function () {
22102          return (
22103            void 0 === a && (a = new Bb()),
22104            console.warn(
22105              'THREE.Matrix4: .getPosition() has been removed. Use Vector3.setFromMatrixPosition( matrix ) instead.'
22106            ),
22107            a.setFromMatrixColumn(this, 3)
22108          )
22109        }
22110      })(),
22111      setRotationFromQuaternion: function (a) {
22112        return (
22113          console.warn(
22114            'THREE.Matrix4: .setRotationFromQuaternion() has been renamed to .makeRotationFromQuaternion().'
22115          ),
22116          this.makeRotationFromQuaternion(a)
22117        )
22118      },
22119      multiplyVector3: function (a) {
22120        return (
22121          console.warn(
22122            'THREE.Matrix4: .multiplyVector3() has been removed. Use vector.applyMatrix4( matrix ) instead.'
22123          ),
22124          a.applyMatrix4(this)
22125        )
22126      },
22127      multiplyVector4: function (a) {
22128        return (
22129          console.warn(
22130            'THREE.Matrix4: .multiplyVector4() has been removed. Use vector.applyMatrix4( matrix ) instead.'
22131          ),
22132          a.applyMatrix4(this)
22133        )
22134      },
22135      multiplyVector3Array: function (a) {
22136        return (
22137          console.warn(
22138            'THREE.Matrix4: .multiplyVector3Array() has been renamed. Use matrix.applyToVector3Array( array ) instead.'
22139          ),
22140          this.applyToVector3Array(a)
22141        )
22142      },
22143      rotateAxis: function (a) {
22144        console.warn(
22145          'THREE.Matrix4: .rotateAxis() has been removed. Use Vector3.transformDirection( matrix ) instead.'
22146        ),
22147          a.transformDirection(this)
22148      },
22149      crossVector: function (a) {
22150        return (
22151          console.warn(
22152            'THREE.Matrix4: .crossVector() has been removed. Use vector.applyMatrix4( matrix ) instead.'
22153          ),
22154          a.applyMatrix4(this)
22155        )
22156      },
22157      translate: function () {
22158        console.error('THREE.Matrix4: .translate() has been removed.')
22159      },
22160      rotateX: function () {
22161        console.error('THREE.Matrix4: .rotateX() has been removed.')
22162      },
22163      rotateY: function () {
22164        console.error('THREE.Matrix4: .rotateY() has been removed.')
22165      },
22166      rotateZ: function () {
22167        console.error('THREE.Matrix4: .rotateZ() has been removed.')
22168      },
22169      rotateByAxis: function () {
22170        console.error('THREE.Matrix4: .rotateByAxis() has been removed.')
22171      },
22172      applyToBuffer: function (a, b, c) {
22173        return (
22174          console.warn(
22175            'THREE.Matrix4: .applyToBuffer() has been removed. Use matrix.applyToBufferAttribute( attribute ) instead.'
22176          ),
22177          this.applyToBufferAttribute(a)
22178        )
22179      },
22180      applyToVector3Array: function (a, b, c) {
22181        console.error('THREE.Matrix4: .applyToVector3Array() has been removed.')
22182      },
22183      makeFrustum: function (a, b, c, d, e, f) {
22184        return (
22185          console.warn(
22186            'THREE.Matrix4: .makeFrustum() has been removed. Use .makePerspective( left, right, top, bottom, near, far ) instead.'
22187          ),
22188          this.makePerspective(a, b, d, c, e, f)
22189        )
22190      }
22191    }),
22192    (Ge.prototype.isIntersectionLine = function (a) {
22193      return (
22194        console.warn(
22195          'THREE.Plane: .isIntersectionLine() has been renamed to .intersectsLine().'
22196        ),
22197        this.intersectsLine(a)
22198      )
22199    }),
22200    (Ab.prototype.multiplyVector3 = function (a) {
22201      return (
22202        console.warn(
22203          'THREE.Quaternion: .multiplyVector3() has been removed. Use is now vector.applyQuaternion( quaternion ) instead.'
22204        ),
22205        a.applyQuaternion(this)
22206      )
22207    }),
22208    Object.assign(Je.prototype, {
22209      isIntersectionBox: function (a) {
22210        return (
22211          console.warn(
22212            'THREE.Ray: .isIntersectionBox() has been renamed to .intersectsBox().'
22213          ),
22214          this.intersectsBox(a)
22215        )
22216      },
22217      isIntersectionPlane: function (a) {
22218        return (
22219          console.warn(
22220            'THREE.Ray: .isIntersectionPlane() has been renamed to .intersectsPlane().'
22221          ),
22222          this.intersectsPlane(a)
22223        )
22224      },
22225      isIntersectionSphere: function (a) {
22226        return (
22227          console.warn(
22228            'THREE.Ray: .isIntersectionSphere() has been renamed to .intersectsSphere().'
22229          ),
22230          this.intersectsSphere(a)
22231        )
22232      }
22233    }),
22234    Object.assign(ii.prototype, {
22235      extrude: function (a) {
22236        return (
22237          console.warn(
22238            'THREE.Shape: .extrude() has been removed. Use ExtrudeGeometry() instead.'
22239          ),
22240          new Dg(this, a)
22241        )
22242      },
22243      makeGeometry: function (a) {
22244        return (
22245          console.warn(
22246            'THREE.Shape: .makeGeometry() has been removed. Use ShapeGeometry() instead.'
22247          ),
22248          new Lg(this, a)
22249        )
22250      }
22251    }),
22252    Object.assign(ub.prototype, {
22253      fromAttribute: function (a, b, c) {
22254        return (
22255          console.error(
22256            'THREE.Vector2: .fromAttribute() has been renamed to .fromBufferAttribute().'
22257          ),
22258          this.fromBufferAttribute(a, b, c)
22259        )
22260      }
22261    }),
22262    Object.assign(Bb.prototype, {
22263      setEulerFromRotationMatrix: function () {
22264        console.error(
22265          'THREE.Vector3: .setEulerFromRotationMatrix() has been removed. Use Euler.setFromRotationMatrix() instead.'
22266        )
22267      },
22268      setEulerFromQuaternion: function () {
22269        console.error(
22270          'THREE.Vector3: .setEulerFromQuaternion() has been removed. Use Euler.setFromQuaternion() instead.'
22271        )
22272      },
22273      getPositionFromMatrix: function (a) {
22274        return (
22275          console.warn(
22276            'THREE.Vector3: .getPositionFromMatrix() has been renamed to .setFromMatrixPosition().'
22277          ),
22278          this.setFromMatrixPosition(a)
22279        )
22280      },
22281      getScaleFromMatrix: function (a) {
22282        return (
22283          console.warn(
22284            'THREE.Vector3: .getScaleFromMatrix() has been renamed to .setFromMatrixScale().'
22285          ),
22286          this.setFromMatrixScale(a)
22287        )
22288      },
22289      getColumnFromMatrix: function (a, b) {
22290        return (
22291          console.warn(
22292            'THREE.Vector3: .getColumnFromMatrix() has been renamed to .setFromMatrixColumn().'
22293          ),
22294          this.setFromMatrixColumn(b, a)
22295        )
22296      },
22297      applyProjection: function (a) {
22298        return (
22299          console.warn(
22300            'THREE.Vector3: .applyProjection() has been removed. Use .applyMatrix4( m ) instead.'
22301          ),
22302          this.applyMatrix4(a)
22303        )
22304      },
22305      fromAttribute: function (a, b, c) {
22306        return (
22307          console.error(
22308            'THREE.Vector3: .fromAttribute() has been renamed to .fromBufferAttribute().'
22309          ),
22310          this.fromBufferAttribute(a, b, c)
22311        )
22312      }
22313    }),
22314    Object.assign(xb.prototype, {
22315      fromAttribute: function (a, b, c) {
22316        return (
22317          console.error(
22318            'THREE.Vector4: .fromAttribute() has been renamed to .fromBufferAttribute().'
22319          ),
22320          this.fromBufferAttribute(a, b, c)
22321        )
22322      }
22323    }),
22324    (ef.prototype.computeTangents = function () {
22325      console.warn('THREE.Geometry: .computeTangents() has been removed.')
22326    }),
22327    Object.assign(Ne.prototype, {
22328      getChildByName: function (a) {
22329        return (
22330          console.warn(
22331            'THREE.Object3D: .getChildByName() has been renamed to .getObjectByName().'
22332          ),
22333          this.getObjectByName(a)
22334        )
22335      },
22336      renderDepth: function () {
22337        console.warn(
22338          'THREE.Object3D: .renderDepth has been removed. Use .renderOrder, instead.'
22339        )
22340      },
22341      translate: function (a, b) {
22342        return (
22343          console.warn(
22344            'THREE.Object3D: .translate() has been removed. Use .translateOnAxis( axis, distance ) instead.'
22345          ),
22346          this.translateOnAxis(b, a)
22347        )
22348      }
22349    }),
22350    Object.defineProperties(Ne.prototype, {
22351      eulerOrder: {
22352        get: function () {
22353          return (
22354            console.warn('THREE.Object3D: .eulerOrder is now .rotation.order.'),
22355            this.rotation.order
22356          )
22357        },
22358        set: function (a) {
22359          console.warn('THREE.Object3D: .eulerOrder is now .rotation.order.'),
22360            (this.rotation.order = a)
22361        }
22362      },
22363      useQuaternion: {
22364        get: function () {
22365          console.warn(
22366            'THREE.Object3D: .useQuaternion has been removed. The library n
22366ow uses quaternions by default.'
22367          )
22368        },
22369        set: function () {
22370          console.warn(
22371            'THREE.Object3D: .useQuaternion has been removed. The library now uses quaternions by default.'
22372          )
22373        }
22374      }
22375    }),
22376    Object.defineProperties(Xf.prototype, {
22377      objects: {
22378        get: function () {
22379          return (
22380            console.warn('THREE.LOD: .objects has been renamed to .levels.'),
22381            this.levels
22382          )
22383        }
22384      }
22385    }),
22386    (nf.prototype.setLens = function (a, b) {
22387      console.warn(
22388        'THREE.PerspectiveCamera.setLens is deprecated. Use .setFocalLength and .filmGauge for a photographic setup.'
22389      ),
22390        void 0 !== b && (this.filmGauge = b),
22391        this.setFocalLength(a)
22392    }),
22393    Object.defineProperties(nh.prototype, {
22394      onlyShadow: {
22395        set: function () {
22396          console.warn('THREE.Light: .onlyShadow has been removed.')
22397        }
22398      },
22399      shadowCameraFov: {
22400        set: function (a) {
22401          console.warn(
22402            'THREE.Light: .shadowCameraFov is now .shadow.camera.fov.'
22403          ),
22404            (this.shadow.camera.fov = a)
22405        }
22406      },
22407      shadowCameraLeft: {
22408        set: function (a) {
22409          console.warn(
22410            'THREE.Light: .shadowCameraLeft is now .shadow.camera.left.'
22411          ),
22412            (this.shadow.camera.left = a)
22413        }
22414      },
22415      shadowCameraRight: {
22416        set: function (a) {
22417          console.warn(
22418            'THREE.Light: .shadowCameraRight is now .shadow.camera.right.'
22419          ),
22420            (this.shadow.camera.right = a)
22421        }
22422      },
22423      shadowCameraTop: {
22424        set: function (a) {
22425          console.warn(
22426            'THREE.Light: .shadowCameraTop is now .shadow.camera.top.'
22427          ),
22428            (this.shadow.camera.top = a)
22429        }
22430      },
22431      shadowCameraBottom: {
22432        set: function (a) {
22433          console.warn(
22434            'THREE.Light: .shadowCameraBottom is now .shadow.camera.bottom.'
22435          ),
22436            (this.shadow.camera.bottom = a)
22437        }
22438      },
22439      shadowCameraNear: {
22440        set: function (a) {
22441          console.warn(
22442            'THREE.Light: .shadowCameraNear is now .shadow.camera.near.'
22443          ),
22444            (this.shadow.camera.near = a)
22445        }
22446      },
22447      shadowCameraFar: {
22448        set: function (a) {
22449          console.warn(
22450            'THREE.Light: .shadowCameraFar is now .shadow.camera.far.'
22451          ),
22452            (this.shadow.camera.far = a)
22453        }
22454      },
22455      shadowCameraVisible: {
22456        set: function () {
22457          console.warn(
22458            'THREE.Light: .shadowCameraVisible has been removed. Use new THREE.CameraHelper( light.shadow.camera ) instead.'
22459          )
22460        }
22461      },
22462      shadowBias: {
22463        set: function (a) {
22464          console.warn('THREE.Light: .shadowBias is now .shadow.bias.'),
22465            (this.shadow.bias = a)
22466        }
22467      },
22468      shadowDarkness: {
22469        set: function () {
22470          console.warn('THREE.Light: .shadowDarkness has been removed.')
22471        }
22472      },
22473      shadowMapWidth: {
22474        set: function (a) {
22475          console.warn(
22476            'THREE.Light: .shadowMapWidth is now .shadow.mapSize.width.'
22477          ),
22478            (this.shadow.mapSize.width = a)
22479        }
22480      },
22481      shadowMapHeight: {
22482        set: function (a) {
22483          console.warn(
22484            'THREE.Light: .shadowMapHeight is now .shadow.mapSize.height.'
22485          ),
22486            (this.shadow.mapSize.height = a)
22487        }
22488      }
22489    }),
22490    Object.defineProperties(Se.prototype, {
22491      length: {
22492        get: function () {
22493          return (
22494            console.warn(
22495              'THREE.BufferAttribute: .length has been deprecated. Use .count instead.'
22496            ),
22497            this.array.length
22498          )
22499        }
22500      }
22501    }),
22502    Object.assign(ff.prototype, {
22503      addIndex: function (a) {
22504        console.warn(
22505          'THREE.BufferGeometry: .addIndex() has been renamed to .setIndex().'
22506        ),
22507          this.setIndex(a)
22508      },
22509      addDrawCall: function (a, b, c) {
22510        void 0 !== c &&
22511          console.warn(
22512            'THREE.BufferGeometry: .addDrawCall() no longer supports indexOffset.'
22513          ),
22514          console.warn(
22515            'THREE.BufferGeometry: .addDrawCall() is now .addGroup().'
22516          ),
22517          this.addGroup(a, b)
22518      },
22519      clearDrawCalls: function () {
22520        console.warn(
22521          'THREE.BufferGeometry: .clearDrawCalls() is now .clearGroups().'
22522        ),
22523          this.clearGroups()
22524      },
22525      computeTangents: function () {
22526        console.warn(
22527          'THREE.BufferGeometry: .computeTangents() has been removed.'
22528        )
22529      },
22530      computeOffsets: function () {
22531        console.warn(
22532          'THREE.BufferGeometry: .computeOffsets() has been removed.'
22533        )
22534      }
22535    }),
22536    Object.defineProperties(ff.prototype, {
22537      drawcalls: {
22538        get: function () {
22539          return (
22540            console.error(
22541              'THREE.BufferGeometry: .drawcalls has been renamed to .groups.'
22542            ),
22543            this.groups
22544          )
22545        }
22546      },
22547      offsets: {
22548        get: function () {
22549          return (
22550            console.warn(
22551              'THREE.BufferGeometry: .offsets has been renamed to .groups.'
22552            ),
22553            this.groups
22554          )
22555        }
22556      }
22557    }),
22558    Object.defineProperties(Bi.prototype, {
22559      dynamic: {
22560        set: function () {
22561          console.warn(
22562            'THREE.Uniform: .dynamic has been removed. Use object.onBeforeRender() instead.'
22563          )
22564        }
22565      },
22566      onUpdate: {
22567        value: function () {
22568          return (
22569            console.warn(
22570              'THREE.Uniform: .onUpdate() has been removed. Use object.onBeforeRender() instead.'
22571            ),
22572            this
22573          )
22574        }
22575      }
22576    }),
22577    Object.defineProperties(Ae.prototype, {
22578      wrapAround: {
22579        get: function () {
22580          console.warn('THREE.' + this.type + ': .wrapAround has been removed.')
22581        },
22582        set: function () {
22583          console.warn('THREE.' + this.type + ': .wrapAround has been removed.')
22584        }
22585      },
22586      wrapRGB: {
22587        get: function () {
22588          return (
22589            console.warn('THREE.' + this.type + ': .wrapRGB has been removed.'),
22590            new re()
22591          )
22592        }
22593      }
22594    }),
22595    Object.defineProperties($g.prototype, {
22596      metal: {
22597        get: function () {
22598          return (
22599            console.warn(
22600              'THREE.MeshPhongMaterial: .metal has been removed. Use THREE.MeshStandardMaterial instead.'
22601            ),
22602            !1
22603          )
22604        },
22605        set: function () {
22606          console.warn(
22607            'THREE.MeshPhongMaterial: .metal has been removed. Use THREE.MeshStandardMaterial instead'
22608          )
22609        }
22610      }
22611    }),
22612    Object.defineProperties(Be.prototype, {
22613      derivatives: {
22614        get: function () {
22615          return (
22616            console.warn(
22617              'THREE.ShaderMaterial: .derivatives has been moved to .extensions.derivatives.'
22618            ),
22619            this.extensions.derivatives
22620          )
22621        },
22622        set: function (a) {
22623          console.warn(
22624            'THREE. ShaderMaterial: .derivatives has been moved to .extensions.derivatives.'
22625          ),
22626            (this.extensions.derivatives = a)
22627        }
22628      }
22629    }),
22630    Object.assign(Qf.prototype, {
22631      supportsFloatTextures: function () {
22632        return (
22633          console.warn(
22634            "THREE.WebGLRenderer: .supportsFloatTextures() is now .extensions.get( 'OES_texture_float' )."
22635          ),
22636          this.extensions.get('OES_texture_float')
22637        )
22638      },
22639      supportsHalfFloatTextures: function () {
22640        return (
22641          console.warn(
22642            "THREE.WebGLRenderer: .supportsHalfFloatTextures() is now .extensions.get( 'OES_texture_half_float' )."
22643          ),
22644          this.extensions.get('OES_texture_half_float')
22645        )
22646      },
22647      supportsStandardDerivatives: function () {
22648        return (
22649          console.warn(
22650            "THREE.WebGLRenderer: .supportsStandardDerivatives() is now .extensions.get( 'OES_standard_derivatives' )."
22651          ),
22652          this.extensions.get('OES_standard_derivatives')
22653        )
22654      },
22655      supportsCompressedTextureS3TC: function () {
22656        return (
22657          console.warn(
22658            "THREE.WebGLRenderer: .supportsCompressedTextureS3TC() is now .extensions.get( 'WEBGL_compressed_texture_s3tc' )."
22659          ),
22660          this.extensions.get('WEBGL_compressed_texture_s3tc')
22661        )
22662      },
22663      supportsCompressedTexturePVRTC: function () {
22664        return (
22665          console.warn(
22666            "THREE.WebGLRenderer: .supportsCompressedTexturePVRTC() is now .extensions.get( 'WEBGL_compressed_texture_pvrtc' )."
22667          ),
22668          this.extensions.get('WEBGL_compressed_texture_pvrtc')
22669        )
22670      },
22671      supportsBlendMinMax: function () {
22672        return (
22673          console.warn(
22674            "THREE.WebGLRenderer: .supportsBlendMinMax() is now .extensions.get( 'EXT_blend_minmax' )."
22675          ),
22676          this.extensions.get('EXT_blend_minmax')
22677        )
22678      },
22679      supportsVertexTextures: function () {
22680        return (
22681          console.warn(
22682            'THREE.WebGLRenderer: .supportsVertexTextures() is now .capabilities.vertexTextures.'
22683          ),
22684          this.capabilities.vertexTextures
22685        )
22686      },
22687      supportsInstancedArrays: function () {
22688        return (
22689          console.warn(
22690            "THREE.WebGLRenderer: .supportsInstancedArrays() is now .extensions.get( 'ANGLE_
22690instanced_arrays' )."
22691          ),
22692          this.extensions.get('ANGLE_instanced_arrays')
22693        )
22694      },
22695      enableScissorTest: function (a) {
22696        console.warn(
22697          'THREE.WebGLRenderer: .enableScissorTest() is now .setScissorTest().'
22698        ),
22699          this.setScissorTest(a)
22700      },
22701      initMaterial: function () {
22702        console.warn('THREE.WebGLRenderer: .initMaterial() has been removed.')
22703      },
22704      addPrePlugin: function () {
22705        console.warn('THREE.WebGLRenderer: .addPrePlugin() has been removed.')
22706      },
22707      addPostPlugin: function () {
22708        console.warn('THREE.WebGLRenderer: .addPostPlugin() has been removed.')
22709      },
22710      updateShadowMap: function () {
22711        console.warn(
22712          'THREE.WebGLRenderer: .updateShadowMap() has been removed.'
22713        )
22714      }
22715    }),
22716    Object.defineProperties(Qf.prototype, {
22717      shadowMapEnabled: {
22718        get: function () {
22719          return this.shadowMap.enabled
22720        },
22721        set: function (a) {
22722          console.warn(
22723            'THREE.WebGLRenderer: .shadowMapEnabled is now .shadowMap.enabled.'
22724          ),
22725            (this.shadowMap.enabled = a)
22726        }
22727      },
22728      shadowMapType: {
22729        get: function () {
22730          return this.shadowMap.type
22731        },
22732        set: function (a) {
22733          console.warn(
22734            'THREE.WebGLRenderer: .shadowMapType is now .shadowMap.type.'
22735          ),
22736            (this.shadowMap.type = a)
22737        }
22738      },
22739      shadowMapCullFace: {
22740        get: function () {
22741          return this.shadowMap.cullFace
22742        },
22743        set: function (a) {
22744          console.warn(
22745            'THREE.WebGLRenderer: .shadowMapCullFace is now .shadowMap.cullFace.'
22746          ),
22747            (this.shadowMap.cullFace = a)
22748        }
22749      }
22750    }),
22751    Object.defineProperties(Ie.prototype, {
22752      cullFace: {
22753        get: function () {
22754          return this.renderReverseSided ? g : f
22755        },
22756        set: function (a) {
22757          var b = a !== f
22758          console.warn(
22759            'WebGLRenderer: .shadowMap.cullFace is deprecated. Set .shadowMap.renderReverseSided to ' +
22760              b +
22761              '.'
22762          ),
22763            (this.renderReverseSided = b)
22764        }
22765      }
22766    }),
22767    Object.defineProperties(yb.prototype, {
22768      wrapS: {
22769        get: function () {
22770          return (
22771            console.warn(
22772              'THREE.WebGLRenderTarget: .wrapS is now .texture.wrapS.'
22773            ),
22774            this.texture.wrapS
22775          )
22776        },
22777        set: function (a) {
22778          console.warn(
22779            'THREE.WebGLRenderTarget: .wrapS is now .texture.wrapS.'
22780          ),
22781            (this.texture.wrapS = a)
22782        }
22783      },
22784      wrapT: {
22785        get: function () {
22786          return (
22787            console.warn(
22788              'THREE.WebGLRenderTarget: .wrapT is now .texture.wrapT.'
22789            ),
22790            this.texture.wrapT
22791          )
22792        },
22793        set: function (a) {
22794          console.warn(
22795            'THREE.WebGLRenderTarget: .wrapT is now .texture.wrapT.'
22796          ),
22797            (this.texture.wrapT = a)
22798        }
22799      },
22800      magFilter: {
22801        get: function () {
22802          return (
22803            console.warn(
22804              'THREE.WebGLRenderTarget: .magFilter is now .texture.magFilter.'
22805            ),
22806            this.texture.magFilter
22807          )
22808        },
22809        set: function (a) {
22810          console.warn(
22811            'THREE.WebGLRenderTarget: .magFilter is now .texture.magFilter.'
22812          ),
22813            (this.texture.magFilter = a)
22814        }
22815      },
22816      minFilter: {
22817        get: function () {
22818          return (
22819            console.warn(
22820              'THREE.WebGLRenderTarget: .minFilter is now .texture.minFilter.'
22821            ),
22822            this.texture.minFilter
22823          )
22824        },
22825        set: function (a) {
22826          console.warn(
22827            'THREE.WebGLRenderTarget: .minFilter is now .texture.minFilter.'
22828          ),
22829            (this.texture.minFilter = a)
22830        }
22831      },
22832      anisotropy: {
22833        get: function () {
22834          return (
22835            console.warn(
22836              'THREE.WebGLRenderTarget: .anisotropy is now .texture.anisotropy.'
22837            ),
22838            this.texture.anisotropy
22839          )
22840        },
22841        set: function (a) {
22842          console.warn(
22843            'THREE.WebGLRenderTarget: .anisotropy is now .texture.anisotropy.'
22844          ),
22845            (this.texture.anisotropy = a)
22846        }
22847      },
22848      offset: {
22849        get: function () {
22850          return (
22851            console.warn(
22852              'THREE.WebGLRenderTarget: .offset is now .texture.offset.'
22853            ),
22854            this.texture.offset
22855          )
22856        },
22857        set: function (a) {
22858          console.warn(
22859            'THREE.WebGLRenderTarget: .offset is now .texture.offset.'
22860          ),
22861            (this.texture.offset = a)
22862        }
22863      },
22864      repeat: {
22865        get: function () {
22866          return (
22867            console.warn(
22868              'THREE.WebGLRenderTarget: .repeat is now .texture.repeat.'
22869            ),
22870            this.texture.repeat
22871          )
22872        },
22873        set: function (a) {
22874          console.warn(
22875            'THREE.WebGLRenderTarget: .repeat is now .texture.repeat.'
22876          ),
22877            (this.texture.repeat = a)
22878        }
22879      },
22880      format: {
22881        get: function () {
22882          return (
22883            console.warn(
22884              'THREE.WebGLRenderTarget: .format is now .texture.format.'
22885            ),
22886            this.texture.format
22887          )
22888        },
22889        set: function (a) {
22890          console.warn(
22891            'THREE.WebGLRenderTarget: .format is now .texture.format.'
22892          ),
22893            (this.texture.format = a)
22894        }
22895      },
22896      type: {
22897        get: function () {
22898          return (
22899            console.warn(
22900              'THREE.WebGLRenderTarget: .type is now .texture.type.'
22901            ),
22902            this.texture.type
22903          )
22904        },
22905        set: function (a) {
22906          console.warn('THREE.WebGLRenderTarget: .type is now .texture.type.'),
22907            (this.texture.type = a)
22908        }
22909      },
22910      generateMipmaps: {
22911        get: function () {
22912          return (
22913            console.warn(
22914              'THREE.WebGLRenderTarget: .generateMipmaps is now .texture.generateMipmaps.'
22915            ),
22916            this.texture.generateMipmaps
22917          )
22918        },
22919        set: function (a) {
22920          console.warn(
22921            'THREE.WebGLRenderTarget: .generateMipmaps is now .texture.generateMipmaps.'
22922          ),
22923            (this.texture.generateMipmaps = a)
22924        }
22925      }
22926    }),
22927    (ti.prototype.load = function (a) {
22928      console.warn(
22929        'THREE.Audio: .load has been deprecated. Use THREE.AudioLoader instead.'
22930      )
22931      var b = this,
22932        c = new oi()
22933      return (
22934        c.load(a, function (a) {
22935          b.setBuffer(a)
22936        }),
22937        this
22938      )
22939    }),
22940    (vi.prototype.getData = function () {
22941      return (
22942        console.warn(
22943          'THREE.AudioAnalyser: .getData() is now .getFrequencyData().'
22944        ),
22945        this.getFrequencyData()
22946      )
22947    })
22948  var Rj = {
22949      merge: function (a, b, c) {
22950        console.warn(
22951          'THREE.GeometryUtils: .merge() has been moved to Geometry. Use geometry.merge( geometry2, matrix, materialIndexOffset ) instead.'
22952        )
22953        var d
22954        b.isMesh &&
22955          (b.matrixAutoUpdate && b.updateMatrix(),
22956          (d = b.matrix),
22957          (b = b.geometry)),
22958          a.merge(b, d, c)
22959      },
22960      center: function (a) {
22961        return (
22962          console.warn(
22963            'THREE.GeometryUtils: .center() has been moved to Geometry. Use geometry.center() instead.'
22964          ),
22965          a.center()
22966        )
22967      }
22968    },
22969    Sj = {
22970      crossOrigin: void 0,
22971      loadTexture: function (a, b, c, d) {
22972        console.warn(
22973          'THREE.ImageUtils.loadTexture has been deprecated. Use THREE.TextureLoader() instead.'
22974        )
22975        var e = new mh()
22976        e.setCrossOrigin(this.crossOrigin)
22977        var f = e.load(a, c, void 0, d)
22978        return b && (f.mapping = b), f
22979      },
22980      loadTextureCube: function (a, b, c, d) {
22981        console.warn(
22982          'THREE.ImageUtils.loadTextureCube has been deprecated. Use THREE.CubeTextureLoader() instead.'
22983        )
22984        var e = new lh()
22985        e.setCrossOrigin(this.crossOrigin)
22986        var f = e.load(a, c, void 0, d)
22987        return b && (f.mapping = b), f
22988      },
22989      loadCompressedTexture: function () {
22990        console.error(
22991          'THREE.ImageUtils.loadCompressedTexture has been removed. Use THREE.DDSLoader instead.'
22992        )
22993      },
22994      loadCompressedTextureCube: function () {
22995        console.error(
22996          'THREE.ImageUtils.loadCompressedTextureCube has been removed. Use THREE.DDSLoader instead.'
22997        )
22998      }
22999    }
23000  ;
23000(a.WebGLRenderTargetCube = zb),
23001    (a.WebGLRenderTarget = yb),
23002    (a.WebGLRenderer = Qf),
23003    (a.ShaderLib = ve),
23004    (a.UniformsLib = ue),
23005    (a.UniformsUtils = pc),
23006    (a.ShaderChunk = qe),
23007    (a.FogExp2 = Rf),
23008    (a.Fog = Sf),
23009    (a.Scene = Tf),
23010    (a.LensFlare = Uf),
23011    (a.Sprite = Wf),
23012    (a.LOD = Xf),
23013    (a.SkinnedMesh = $f),
23014    (a.Skeleton = Yf),
23015    (a.Bone = Zf),
23016    (a.Mesh = gf),
23017    (a.LineSegments = bg),
23018    (a.Line = ag),
23019    (a.Points = dg),
23020    (a.Group = eg),
23021    (a.VideoTexture = fg),
23022    (a.DataTexture = te),
23023    (a.CompressedTexture = gg),
23024    (a.CubeTexture = Db),
23025    (a.CanvasTexture = hg),
23026    (a.DepthTexture = ig),
23027    (a.Texture = wb),
23028    (a.CompressedTextureLoader = ih),
23029    (a.DataTextureLoader = jh),
23030    (a.CubeTextureLoader = lh),
23031    (a.TextureLoader = mh),
23032    (a.ObjectLoader = Qh),
23033    (a.MaterialLoader = Mh),
23034    (a.BufferGeometryLoader = Nh),
23035    (a.DefaultLoadingManager = gh),
23036    (a.LoadingManager = fh),
23037    (a.JSONLoader = Ph),
23038    (a.ImageLoader = kh),
23039    (a.FontLoader = li),
23040    (a.FileLoader = hh),
23041    (a.Loader = Oh),
23042    (a.Cache = eh),
23043    (a.AudioLoader = oi),
23044    (a.SpotLightShadow = qh),
23045    (a.SpotLight = rh),
23046    (a.PointLight = sh),
23047    (a.RectAreaLight = pi),
23048    (a.HemisphereLight = oh),
23049    (a.DirectionalLightShadow = th),
23050    (a.DirectionalLight = uh),
23051    (a.AmbientLight = vh),
23052    (a.LightShadow = ph),
23053    (a.Light = nh),
23054    (a.StereoCamera = qi),
23055    (a.PerspectiveCamera = nf),
23056    (a.OrthographicCamera = of),
23057    (a.CubeCamera = ri),
23058    (a.Camera = mf),
23059    (a.AudioListener = si),
23060    (a.PositionalAudio = ui),
23061    (a.AudioContext = ni),
23062    (a.AudioAnalyser = vi),
23063    (a.Audio = ti),
23064    (a.VectorKeyframeTrack = Dh),
23065    (a.StringKeyframeTrack = Hh),
23066    (a.QuaternionKeyframeTrack = Fh),
23067    (a.NumberKeyframeTrack = Gh),
23068    (a.ColorKeyframeTrack = Jh),
23069    (a.BooleanKeyframeTrack = Ih),
23070    (a.PropertyMixer = wi),
23071    (a.PropertyBinding = xi),
23072    (a.KeyframeTrack = Kh),
23073    (a.AnimationUtils = wh),
23074    (a.AnimationObjectGroup = yi),
23075    (a.AnimationMixer = Ai),
23076    (a.AnimationClip = Lh),
23077    (a.Uniform = Bi),
23078    (a.InstancedBufferGeometry = Ci),
23079    (a.BufferGeometry = ff),
23080    (a.GeometryIdCount = df),
23081    (a.Geometry = ef),
23082    (a.InterleavedBufferAttribute = Di),
23083    (a.InstancedInterleavedBuffer = Fi),
23084    (a.InterleavedBuffer = Ei),
23085    (a.InstancedBufferAttribute = Gi),
23086    (a.Face3 = Qe),
23087    (a.Object3D = Ne),
23088    (a.Raycaster = Hi),
23089    (a.Layers = Le),
23090    (a.EventDispatcher = b),
23091    (a.Clock = Ki),
23092    (a.QuaternionLinearInterpolant = Eh),
23093    (a.LinearInterpolant = zh),
23094    (a.DiscreteInterpolant = Ah),
23095    (a.CubicInterpolant = yh),
23096    (a.Interpolant = xh),
23097    (a.Triangle = Pe),
23098    (a.Math = tb),
23099    (a.Spherical = Li),
23100    (a.Cylindrical = Mi),
23101    (a.Plane = Ge),
23102    (a.Frustum = He),
23103    (a.Sphere = Ee),
23104    (a.Ray = Je),
23105    (a.Matrix4 = Cb),
23106    (a.Matrix3 = Fe),
23107    (a.Box3 = De),
23108    (a.Box2 = we),
23109    (a.Line3 = Oe),
23110    (a.Euler = Ke),
23111    (a.Vector4 = xb),
23112    (a.Vector3 = Bb),
23113    (a.Vector2 = ub),
23114    (a.Quaternion = Ab),
23115    (a.Color = re),
23116    (a.MorphBlendMesh = Ni),
23117    (a.ImmediateRenderObject = Oi),
23118    (a.VertexNormalsHelper = Pi),
23119    (a.SpotLightHelper = Qi),
23120    (a.SkeletonHelper = Ri),
23121    (a.PointLightHelper = Si),
23122    (a.RectAreaLightHelper = Ti),
23123    (a.HemisphereLightHelper = Ui),
23124    (a.GridHelper = Vi),
23125    (a.PolarGridHelper = Wi),
23126    (a.FaceNormalsHelper = Xi),
23127    (a.DirectionalLightHelper = Yi),
23128    (a.CameraHelper = Zi),
23129    (a.BoxHelper = $i),
23130    (a.ArrowHelper = bj),
23131    (a.AxisHelper = cj),
23132    (a.CatmullRomCurve3 = ij),
23133    (a.CubicBezierCurve3 = jj),
23134    (a.QuadraticBezierCurve3 = kj),
23135    (a.LineCurve3 = lj),
23136    (a.ArcCurve = mj),
23137    (a.EllipseCurve = ci),
23138    (a.SplineCurve = di),
23139    (a.CubicBezierCurve = ei),
23140    (a.QuadraticBezierCurve = fi),
23141    (a.LineCurve = ai),
23142    (a.Shape = ii),
23143    (a.Path = hi),
23144    (a.ShapePath = ji),
23145    (a.Font = ki),
23146    (a.CurvePath = bi),
23147    (a.Curve = _h),
23148    (a.ShapeUtils = Cg),
23149    (a.SceneUtils = nj),
23150    (a.WireframeGeometry = jg),
23151    (a.ParametricGeometry = kg),
23152    (a.ParametricBufferGeometry = lg),
23153    (a.TetrahedronGeometry = og),
23154    (a.TetrahedronBufferGeometry = pg),
23155    (a.OctahedronGeometry = qg),
23156    (a.OctahedronBufferGeometry = rg),
23157    (a.IcosahedronGeometry = sg),
23158    (a.IcosahedronBufferGeometry = tg),
23159    (a.DodecahedronGeometry = ug),
23160    (a.DodecahedronBufferGeometry = vg),
23161    (a.PolyhedronGeometry = mg),
23162    (a.PolyhedronBufferGeometry = ng),
23163    (a.TubeGeometry = wg),
23164    (a.TubeBufferGeometry = xg),
23165    (a.TorusKnotGeometry = yg),
23166    (a.TorusKnotBufferGeometry = zg),
23167    (a.TorusGeometry = Ag),
23168    (a.TorusBufferGeometry = Bg),
23169    (a.TextGeometry = Eg),
23170    (a.SphereGeometry = Fg),
23171    (a.SphereBufferGeometry = Gg),
23172    (a.RingGeometry = Hg),
23173    (a.RingBufferGeometry = Ig),
23174    (a.PlaneGeometry = kf),
23175    (a.PlaneBufferGeometry = lf),
23176    (a.LatheGeometry = Jg),
23177    (a.LatheBufferGeometry = Kg),
23178    (a.ShapeGeometry = Lg),
23179    (a.ShapeBufferGeometry = Mg),
23180    (a.ExtrudeGeometry = Dg),
23181    (a.EdgesGeometry = Ng),
23182    (a.ConeGeometry = Qg),
23183    (a.ConeBufferGeometry = Rg),
23184    (a.CylinderGeometry = Og),
23185    (a.CylinderBufferGeometry = Pg),
23186    (a.CircleGeometry = Sg),
23187    (a.CircleBufferGeometry = Tg),
23188    (a.BoxGeometry = hf),
23189    (a.BoxBufferGeometry = jf),
23190    (a.ShadowMaterial = Vg),
23191    (a.SpriteMaterial = Vf),
23192    (a.RawShaderMaterial = Wg),
23193    (a.ShaderMaterial = Be),
23194    (a.PointsMaterial = cg),
23195    (a.MultiMaterial = Xg),
23196    (a.MeshPhysicalMaterial = Zg),
23197    (a.MeshStandardMaterial = Yg),
23198    (a.MeshPhongMaterial = $g),
23199    (a.MeshToonMaterial = _g)
23200  a.MeshNormalMaterial = ah
23201  ;(a.MeshLambertMaterial = bh),
23202    (a.MeshDepthMaterial = Ce),
23203    (a.MeshBasicMaterial = Re),
23204    (a.LineDashedMaterial = ch),
23205    (a.LineBasicMaterial = _f),
23206    (a.Material = Ae),
23207    (a.Float64BufferAttribute = _e),
23208    (a.Float32BufferAttribute = $e),
23209    (a.Uint32BufferAttribute = Ze),
23210    (a.Int32BufferAttribute = Ye),
23211    (a.Uint16BufferAttribute = Xe),
23212    (a.Int16BufferAttribute = We),
23213    (a.Uint8ClampedBufferAttribute = Ve),
23214    (a.Uint8BufferAttribute = Ue),
23215    (a.Int8BufferAttribute = Te),
23216    (a.BufferAttribute = Se),
23217    (a.REVISION = c),
23218    (a.MOUSE = d),
23219    (a.CullFaceNone = e),
23220    (a.CullFaceBack = f),
23221    (a.CullFaceFront = g),
23222    (a.CullFaceFrontBack = h),
23223    (a.FrontFaceDirectionCW = i),
23224    (a.FrontFaceDirectionCCW = j),
23225    (a.BasicShadowMap = k),
23226    (a.PCFShadowMap = l),
23227    (a.PCFSoftShadowMap = m),
23228    (a.FrontSide = n),
23229    (a.BackSide = o),
23230    (a.DoubleSide = p),
23231    (a.FlatShading = q),
23232    (a.SmoothShading = r),
23233    (a.NoColors = s),
23234    (a.FaceColors = t),
23235    (a.VertexColors = u),
23236    (a.NoBlending = v),
23237    (a.NormalBlending = w),
23238    (a.AdditiveBlending = x),
23239    (a.SubtractiveBlending = y),
23240    (a.MultiplyBlending = z),
23241    (a.CustomBlending = A),
23242    (a.AddEquation = B),
23243    (a.SubtractEquation = C),
23244    (a.ReverseSubtractEquation = D),
23245    (a.MinEquation = E),
23246    (a.MaxEquation = F),
23247    (a.ZeroFactor = G),
23248    (a.OneFactor = H),
23249    (a.SrcColorFactor = I),
23250    (a.OneMinusSrcColorFactor = J),
23251    (a.SrcAlphaFactor = K),
23252    (a.OneMinusSrcAlphaFactor = L),
23253    (a.DstAlphaFactor = M),
23254    (a.OneMinusDstAlphaFactor = N),
23255    (a.DstColorFactor = O),
23256    (a.OneMinusDstColorFactor = P),
23257    (a.SrcAlphaSaturateFactor = Q),
23258    (a.NeverDepth = R),
23259    (a.AlwaysDepth = S),
23260    (a.LessDepth = T),
23261    (a.LessEqualDepth = U),
23262    (a.EqualDepth = V),
23263    (a.GreaterEqualDepth = W),
23264    (a.GreaterDepth = X),
23265    (a.NotEqualDepth = Y),
23266    (a.MultiplyOperation = Z),
23267    (a.MixOperation = $),
23268    (a.AddOperation = _),
23269    (a.NoToneMapping = aa),
23270    (a.LinearToneMapping = ba),
23271    (a.ReinhardToneMapping = ca),
23272    (a.Uncharted2ToneMapping = da),
23273    (a.CineonToneMapping = ea),
23274    (a.UVMapping = fa),
23275    (a.CubeReflectionMapping = ga),
23276    (a.CubeRefractionMapping = ha),
23277    (a.EquirectangularReflectionMapping = ia),
23278    (a.EquirectangularRefractionMapping = ja),
23279    (a.SphericalReflectionMapping = ka),
23280    (a.CubeUVReflectionMapping = la),
23281    (a.CubeUVRefractionMapping = ma),
23282    (a.RepeatWrapping = na),
23283    (a.ClampToEdgeWrapping = oa),
23284    (a.MirroredRepeatWrapping = pa),
23285    (a.NearestFilter = qa),
23286    (a.NearestMipMapNearestFilter = ra),
23287    (a.NearestMipMapLinearFilter = sa),
23288    (a.LinearFilter = ta),
23289    (a.LinearMipMapNearestFilter = ua),
23290    (a.LinearMipMapLinearFilter = va),
23291    (a.UnsignedByteType = wa),
23292    (a.ByteType = xa),
23293    (a.ShortType = ya),
23294    (a.UnsignedShortType = za),
23295    (a.IntType = Aa),
23296    (a.UnsignedIntType = Ba),
23297    (a.FloatType = Ca),
23298    (a.HalfFloatType = Da),
23299    (a.UnsignedShort4444Type = Ea),
23300    (a.UnsignedShort5551Type = Fa),
23301    (a.UnsignedShort565Type = Ga),
23302    (a.UnsignedInt248Type = Ha),
23303    (a.AlphaFormat = Ia),
23304    (a.RGBFormat = Ja),
23305    (a.RGBAFormat = Ka),
23306    (a.LuminanceFormat = La),
23307    (a.LuminanceAlphaFormat = Ma),
23308    (a.RGBEFormat = Na),
23309    (a.DepthFormat = Oa),
23310    (a.DepthStencilFormat = Pa),
23311    (a.RGB_S3TC_DXT1_Format = Qa),
23312    (a.RGBA_S3TC_DXT1_Format = Ra),
23313    (a.RGBA_S3TC_DXT3_Format = Sa),
23314    (a.RGBA_S3TC_DXT5_Format = Ta),
23315    (a.RGB_PVRTC_4BPPV1_Format = Ua),
23316    (a.RGB_PVRTC_2BPPV1_Format = Va),
23317    (a.RGBA_PVRTC_4BPPV1_Format = Wa),
23318    (a.RGBA_PVRTC_2BPPV1_Format = Xa),
23319    (a.RGB_ETC1_Format = Ya),
23320    (a.LoopOnce = Za),
23321    (a.LoopRepeat = $a),
23322    (a.LoopPingPong = _a),
23323    (a.InterpolateDiscrete = ab),
23324    (a.InterpolateLinear = bb),
23325    (a.InterpolateSmooth = cb),
23326    (a.ZeroCurvatureEnding = db),
23327    (a.ZeroSlopeEnding = eb),
23328    (a.WrapAroundEnding = fb),
23329    (a.TrianglesDrawMode = gb),
23330    (a.TriangleStripDrawMode = hb),
23331    (a.TriangleFanDrawMode = ib),
23332    (a.LinearEncoding = jb),
23333    (a.sRGBEncoding = kb),
23334    (a.GammaEncoding = lb),
23335    (a.RGBEEncoding = mb),
23336    (a.LogLuvEncoding = nb),
23337    (a.RGBM7Encoding = ob),
23338    (a.RGBM16Encoding = pb),
23339    (a.RGBDEncoding = qb),
23340    (a.BasicDepthPacking = rb),
23341    (a.RGBADepthPacking = sb),
23342    (a.CubeGeometry = hf),
23343    (a.Face4 = oj),
23344    (a.LineStrip = pj),
23345    (a.LinePieces = qj),
23346    (a.MeshFaceMaterial = rj),
23347    (a.PointCloud = sj),
23348    (a.Particle = tj),
23349    (a.ParticleSystem = uj),
23350    (a.PointCloudMaterial = vj),
23351    (a.ParticleBasicMaterial = wj),
23352    (a.ParticleSystemMaterial = xj),
23353    (a.Vertex = yj),
23354    (a.DynamicBufferAttribute = zj),
23355    (a.Int8Attribute = Aj),
23356    (a.Uint8Attribute = Bj),
23357    (a.Uint8ClampedAttribute = Cj),
23358    (a.Int16Attribute = Dj),
23359    (a.Uint16Attribute = Ej),
23360    (a.Int32Attribute = Fj),
23361    (a.Uint32Attribute = Gj),
23362    (a.Float32Attribute = Hj),
23363    (a.Float64Attribute = Ij),
23364    (a.ClosedSplineCurve3 = Jj),
23365    (a.SplineCurve3 = Kj),
23366    (a.Spline = Lj),
23367    (a.BoundingBoxHelper = Mj),
23368    (a.EdgesHelper = Nj),
23369    (a.WireframeHelper = Oj),
23370    (a.XHRLoader = Pj),
23371    (a.BinaryTextureLoader = Qj),
23372    (a.GeometryUtils = Rj),
23373    (a.ImageUtils = Sj),
23374    (a.Projector = Tj),
23375    (a.CanvasRenderer = Uj),
23376    Object.defineProperty(a, '__esModule', { value: !0 })
23377}),
23378  (THREE.RenderableObject = function () {
23379    ;(this.id = 0), (this.object = null), (this.z = 0), (this.renderOrder = 0)
23380  }),
23381  (THREE.RenderableFace = function () {
23382    ;(this.id = 0),
23383      (this.v1 = new THREE.RenderableVertex()),
23384      (this.v2 = new THREE.RenderableVertex()),
23385      (this.v3 = new THREE.RenderableVertex()),
23386      (this.normalModel = new THREE.Vector3()),
23387      (this.vertexNormalsModel = [
23388        new THREE.Vector3(),
23389        new THREE.Vector3(),
23390        new THREE.Vector3()
23391      ]),
23392      (this.vertexNormalsLength = 0),
23393      (this.color = new THREE.Color()),
23394      (this.material = null),
23395      (this.uvs = [
23396        new THREE.Vector2(),
23397        new THREE.Vector2(),
23398        new THREE.Vector2()
23399      ]),
23400      (this.z = 0),
23401      (this.renderOrder = 0)
23402  }),
23403  (THREE.RenderableVertex = function () {
23404    ;(this.position = new THREE.Vector3()),
23405      (this.positionWorld = new THREE.Vector3()),
23406      (this.positionScreen = new THREE.Vector4()),
23407      (this.visible = !0)
23408  }),
23409  (THREE.RenderableVertex.prototype.copy = function (a) {
23410    this.positionWorld.copy(a.positionWorld),
23411      this.positionScreen.copy(a.positionScreen)
23412  }),
23413  (THREE.RenderableLine = function () {
23414    ;(this.id = 0),
23415      (this.v1 = new THREE.RenderableVertex()),
23416      (this.v2 = new THREE.RenderableVertex()),
23417      (this.vertexColors = [new THREE.Color(), new THREE.Color()]),
23418      (this.material = null),
23419      (this.z = 0),
23420      (this.renderOrder = 0)
23421  }),
23422  (THREE.RenderableSprite = function () {
23423    ;(this.id = 0),
23424      (this.object = null),
23425      (this.x = 0),
23426      (this.y = 0),
23427      (this.z = 0),
23428      (this.rotation = 0),
23429      (this.scale = new THREE.Vector2()),
23430      (this.material = null),
23431      (this.renderOrder = 0)
23432  }),
23433  (THREE.Projector = function () {
23434    function L() {
23435      if (b === d) {
23436        var a = new THREE.RenderableObject()
23437        return c.push(a), d++, b++, a
23438      }
23439      return c[b++]
23440    }
23441    function M() {
23442      if (f === h) {
23443        var a = new THREE.RenderableVertex()
23444        return g.push(a), h++, f++, a
23445      }
23446      return g[f++]
23447    }
23448    function N() {
23449      if (j === l) {
23450        var a = new THREE.RenderableFace()
23451        return k.push(a), l++, j++, a
23452      }
23453      return k[j++]
23454    }
23455    function O() {
23456      if (n === p) {
23457        var a = new THREE.RenderableLine()
23458        return o.push(a), p++, n++, a
23459      }
23460      return o[n++]
23461    }
23462    function P() {
23463      if (r === t) {
23464        var a = new THREE.RenderableSprite()
23465        return s.push(a), t++, r++, a
23466      }
23467      return s[r++]
23468    }
23469    function Q(a, b) {
23470      return a.renderOrder !== b.renderOrder
23471        ? a.renderOrder - b.renderOrder
23472        : a.z !== b.z
23473        ? b.z - a.z
23474        : a.id !== b.id
23475        ? a.id - b.id
23476        : 0
23477    }
23478    function R(a, b) {
23479      var c = 0,
23480        d = 1,
23481        e = a.z + a.w,
23482        f = b.z + b.w,
23483        g = -a.z + a.w,
23484        h = -b.z + b.w
23485      return (
23486        (e >= 0 && f >= 0 && g >= 0 && h >= 0) ||
23487        (!((e < 0 && f < 0) || (g < 0 && h < 0)) &&
23488          (e < 0
23489            ? (c = Math.max(c, e / (e - f)))
23490            : f < 0 && (d = Math.min(d, e / (e - f))),
23491          g < 0
23492            ? (c = Math.max(c, g / (g - h)))
23493            : h < 0 && (d = Math.min(d, g / (g - h))),
23494          !(d < c) && (a.lerp(b, c), b.lerp(a, 1 - d), !0)))
23495      )
23496    }
23497    var a,
23498      b,
23499      e,
23500      f,
23501      i,
23502      j,
23503      m,
23504      n,
23505      q,
23506      r,
23507      D,
23508      c = [],
23509      d = 0,
23510      g = [],
23511      h = 0,
23512      k = [],
23513      l = 0,
23514      o = [],
23515      p = 0,
23516      s = [],
23517      t = 0,
23518      u = { objects: [], lights: [], elements: [] },
23519      v = new THREE.Vector3(),
23520      w = new THREE.Vector4(),
23521      x = new THREE.Box3(
23522        new THREE.Vector3(-1, -1, -1),
23523        new THREE.Vector3(1, 1, 1)
23524      ),
23525      y = new THREE.Box3(),
23526      z = new Array(3),
23527      B = (new Array(4), new THREE.Matrix4()),
23528      C = new THREE.Matrix4(),
23529      E = new THREE.Matrix4(),
23530      F = new THREE.Matrix3(),
23531      G = new THREE.Frustum(),
23532      H = new THREE.Vector4(),
23533      I = new THREE.Vector4()
23534    ;
23534(this.projectVector = function (a, b) {
23535      console.warn(
23536        'THREE.Projector: .projectVector() is now vector.project().'
23537      ),
23538        a.project(b)
23539    }),
23540      (this.unprojectVector = function (a, b) {
23541        console.warn(
23542          'THREE.Projector: .unprojectVector() is now vector.unproject().'
23543        ),
23544          a.unproject(b)
23545      }),
23546      (this.pickingRay = function (a, b) {
23547        console.error(
23548          'THREE.Projector: .pickingRay() is now raycaster.setFromCamera().'
23549        )
23550      })
23551    var J = function () {
23552        function h(e) {
23553          ;(c = e),
23554            (d = c.material),
23555            f.getNormalMatrix(c.matrixWorld),
23556            (a.length = 0),
23557            (b.length = 0)
23558        }
23559        function j(a) {
23560          var b = a.position,
23561            c = a.positionWorld,
23562            d = a.positionScreen
23563          c.copy(b).applyMatrix4(D), d.copy(c).applyMatrix4(C)
23564          var e = 1 / d.w
23565          ;(d.x *= e),
23566            (d.y *= e),
23567            (d.z *= e),
23568            (a.visible =
23569              d.x >= -1 &&
23570              d.x <= 1 &&
23571              d.y >= -1 &&
23572              d.y <= 1 &&
23573              d.z >= -1 &&
23574              d.z <= 1)
23575        }
23576        function k(a, b, c) {
23577          ;(e = M()), e.position.set(a, b, c), j(e)
23578        }
23579        function l(b, c, d) {
23580          a.push(b, c, d)
23581        }
23582        function n(a, c) {
23583          b.push(a, c)
23584        }
23585        function o(a, b, c) {
23586          return (
23587            a.visible === !0 ||
23588            b.visible === !0 ||
23589            c.visible === !0 ||
23590            ((z[0] = a.positionScreen),
23591            (z[1] = b.positionScreen),
23592            (z[2] = c.positionScreen),
23593            x.intersectsBox(y.setFromPoints(z)))
23594          )
23595        }
23596        function p(a, b, c) {
23597          return (
23598            (c.positionScreen.x - a.positionScreen.x) *
23599              (b.positionScreen.y - a.positionScreen.y) -
23600              (c.positionScreen.y - a.positionScreen.y) *
23601                (b.positionScreen.x - a.positionScreen.x) <
23602            0
23603          )
23604        }
23605        function q(a, b) {
23606          var d = g[a],
23607            e = g[b]
23608          ;(m = O()),
23609            (m.id = c.id),
23610            m.v1.copy(d),
23611            m.v2.copy(e),
23612            (m.z = (d.positionScreen.z + e.positionScreen.z) / 2),
23613            (m.renderOrder = c.renderOrder),
23614            (m.material = c.material),
23615            u.elements.push(m)
23616        }
23617        function r(e, h, j) {
23618          var k = g[e],
23619            l = g[h],
23620            m = g[j]
23621          if (
23622            o(k, l, m) !== !1 &&
23623            (d.side === THREE.DoubleSide || p(k, l, m) === !0)
23624          ) {
23625            ;(i = N()),
23626              (i.id = c.id),
23627              i.v1.copy(k),
23628              i.v2.copy(l),
23629              i.v3.copy(m),
23630              (i.z =
23631                (k.positionScreen.z + l.positionScreen.z + m.positionScreen.z) /
23632                3),
23633              (i.renderOrder = c.renderOrder),
23634              i.normalModel.fromArray(a, 3 * e),
23635              i.normalModel.applyMatrix3(f).normalize()
23636            for (var n = 0; n < 3; n++) {
23637              var q = i.vertexNormalsModel[n]
23638              q.fromArray(a, 3 * arguments[n]), q.applyMatrix3(f).normalize()
23639              var r = i.uvs[n]
23640              r.fromArray(b, 2 * arguments[n])
23641            }
23642            ;(i.vertexNormalsLength = 3),
23643              (i.material = c.material),
23644              u.elements.push(i)
23645          }
23646        }
23647        var a = [],
23648          b = [],
23649          c = null,
23650          d = null,
23651          f = new THREE.Matrix3()
23652        return {
23653          setObject: h,
23654          projectVertex: j,
23655          checkTriangleVisibility: o,
23656          checkBackfaceCulling: p,
23657          pushVertex: k,
23658          pushNormal: l,
23659          pushUv: n,
23660          pushLine: q,
23661          pushTriangle: r
23662        }
23663      },
23664      K = new J()
23665    this.projectScene = function (c, d, e, h) {
23666      function k(b) {
23667        ;(a = L()),
23668          (a.id = b.id),
23669          (a.object = b),
23670          v.setFromMatrixPosition(b.matrixWorld),
23671          v.applyMatrix4(C),
23672          (a.z = v.z),
23673          (a.renderOrder = b.renderOrder),
23674          u.objects.push(a)
23675      }
23676      ;(j = 0),
23677        (n = 0),
23678        (r = 0),
23679        (u.elements.length = 0),
23680        c.autoUpdate === !0 && c.updateMatrixWorld(),
23681        null === d.parent && d.updateMatrixWorld(),
23682        B.copy(d.matrixWorldInverse.getInverse(d.matrixWorld)),
23683        C.multiplyMatrices(d.projectionMatrix, B),
23684        G.setFromMatrix(C),
23685        (b = 0),
23686        (u.objects.length = 0),
23687        (u.lights.length = 0),
23688        c.traverseVisible(function (a) {
23689          if (a instanceof THREE.Light) u.lights.push(a)
23690          else if (a instanceof THREE.Mesh || a instanceof THREE.Line) {
23691            if (a.material.visible === !1) return
23692            if (a.frustumCulled === !0 && G.intersectsObject(a) === !1) return
23693            k(a)
23694          } else if (a instanceof THREE.Sprite) {
23695            if (a.material.visible === !1) return
23696            if (a.frustumCulled === !0 && G.intersectsSprite(a) === !1) return
23697            k(a)
23698          }
23699        }),
23700        e === !0 && u.objects.sort(Q)
23701      for (var l = 0, o = u.objects.length; l < o; l++) {
23702        var p = u.objects[l].object,
23703          s = p.geometry
23704        if (
23705          (K.setObject(p),
23706          (D = p.matrixWorld),
23707          (f = 0),
23708          p instanceof THREE.Mesh)
23709        ) {
23710          if (s instanceof THREE.BufferGeometry) {
23711            var t = s.attributes,
23712              x = s.groups
23713            if (void 0 === t.position) continue
23714            for (var y = t.position.array, z = 0, A = y.length; z < A; z += 3)
23715              K.pushVertex(y[z], y[z + 1], y[z + 2])
23716            if (void 0 !== t.normal)
23717              for (var J = t.normal.array, z = 0, A = J.length; z < A; z += 3)
23718                K.pushNormal(J[z], J[z + 1], J[z + 2])
23719            if (void 0 !== t.uv)
23720              for (var S = t.uv.array, z = 0, A = S.length; z < A; z += 2)
23721                K.pushUv(S[z], S[z + 1])
23722            if (null !== s.index) {
23723              var T = s.index.array
23724              if (x.length > 0)
23725                for (var U = 0; U < x.length; U++)
23726                  for (
23727                    var V = x[U], z = V.start, A = V.start + V.count;
23728                    z < A;
23729                    z += 3
23730                  )
23731                    K.pushTriangle(T[z], T[z + 1], T[z + 2])
23732              else
23733                for (var z = 0, A = T.length; z < A; z += 3)
23734                  K.pushTriangle(T[z], T[z + 1], T[z + 2])
23735            } else
23736              for (var z = 0, A = y.length / 3; z < A; z += 3)
23737                K.pushTriangle(z, z + 1, z + 2)
23738          } else if (s instanceof THREE.Geometry) {
23739            var W = s.vertices,
23740              X = s.faces,
23741              Y = s.faceVertexUvs[0]
23742            F.getNormalMatrix(D)
23743            for (
23744              var Z = p.material,
23745                $ = Z instanceof THREE.MultiMaterial,
23746                _ = $ === !0 ? p.material : null,
23747                aa = 0,
23748                ba = W.length;
23749              aa < ba;
23750              aa++
23751            ) {
23752              var ca = W[aa]
23753              if ((v.copy(ca), Z.morphTargets === !0))
23754                for (
23755                  var da = s.morphTargets,
23756                    ea = p.morphTargetInfluences,
23757                    fa = 0,
23758                    ga = da.length;
23759                  fa < ga;
23760                  fa++
23761                ) {
23762                  var ha = ea[fa]
23763                  if (0 !== ha) {
23764                    var ia = da[fa],
23765                      ja = ia.vertices[aa]
23766                    ;(v.x += (ja.x - ca.x) * ha),
23767                      (v.y += (ja.y - ca.y) * ha),
23768                      (v.z += (ja.z - ca.z) * ha)
23769                  }
23770                }
23771              K.pushVertex(v.x, v.y, v.z)
23772            }
23773            for (var ka = 0, la = X.length; ka < la; ka++) {
23774              var ma = X[ka]
23775              if (
23776                ((Z = $ === !0 ? _.materials[ma.materialIndex] : p.material),
23777                void 0 !== Z)
23778              ) {
23779                var na = Z.side,
23780                  oa = g[ma.a],
23781                  pa = g[ma.b],
23782                  qa = g[ma.c]
23783                if (K.checkTriangleVisibility(oa, pa, qa) !== !1) {
23784                  var ra = K.checkBackfaceCulling(oa, pa, qa)
23785                  if (na !== THREE.DoubleSide) {
23786                    if (na === THREE.FrontSide && ra === !1) continue
23787                    if (na === THREE.BackSide && ra === !0) continue
23788                  }
23789                  ;(i = N()),
23790                    (i.id = p.id),
23791                    i.v1.copy(oa),
23792                    i.v2.copy(pa),
23793                    i.v3.copy(qa),
23794                    i.normalModel.copy(ma.normal),
23795                    ra !== !1 ||
23796                      (na !== THREE.BackSide && na !== THREE.DoubleSide) ||
23797                      i.normalModel.negate(),
23798                    i.normalModel.applyMatrix3(F).normalize()
23799                  for (
23800                    var sa = ma.vertexNormals,
23801                      ta = 0,
23802                      ua = Math.min(sa.length, 3);
23803                    ta < ua;
23804                    ta++
23805                  ) {
23806                    var va = i.vertexNormalsModel[ta]
23807                    va.copy(sa[ta]),
23808                      ra !== !1 ||
23809                        (na !== THREE.BackSide && na !== THREE.DoubleSide) ||
23810                        va.negate(),
23811                      va.applyMatrix3(F).normalize()
23812                  }
23813                  i.vertexNormalsLength = sa.length
23814                  var wa = Y[ka]
23815                  if (void 0 !== wa)
23816                    for (var xa = 0; xa < 3; xa++) i.uvs[xa].copy(wa[xa])
23817                  ;(i.color = ma.color),
23818                    (i.material = Z),
23819                    (i.z =
23820                      (oa.positionScreen.z +
23821                        pa.positionScreen.z +
23822                        qa.positionScreen.z) /
23823                      3),
23824                    (i.renderOrder = p.renderOrder),
23825                    u.elements.push(i)
23826                }
23827              }
23828            }
23829          }
23830        } else if (p instanceof THREE.Line) {
23831          if (s instanceof THREE.BufferGeometry) {
23832            var t = s.attributes
23833            if (void 0 !== t.position) {
23834              for (var y = t.position.array, z = 0, A = y.length; z < A; z += 3)
23835                K.pushVertex(y[z], y[z + 1], y[z + 2])
23836              if (null !== s.index)
23837                for (var T = s.index.array, z = 0, A = T.length; z < A; z += 2)
23838                  K.pushLine(T[z], T[z + 1])
23839              else
23840                for (
23841                  var ya = p instanceof THREE.LineSegments ? 2 : 1,
23842                    z = 0,
23843                    A = y.length / 3 - 1;
23844                  z < A;
23845                  z += ya
23846                )
23847                  K.pushLine(z, z + 1)
23848            }
23849          } else if (s instanceof THREE.Geometry) {
23850            E.multiplyMatrices(C, D)
23851            var W = p.geometry.vertices
23852            if (0 === W.length) continue
23853            ;
23853(oa = M()), oa.positionScreen.copy(W[0]).applyMatrix4(E)
23854            for (
23855              var ya = p instanceof THREE.LineSegments ? 2 : 1,
23856                aa = 1,
23857                ba = W.length;
23858              aa < ba;
23859              aa++
23860            )
23861              (oa = M()),
23862                oa.positionScreen.copy(W[aa]).applyMatrix4(E),
23863                (aa + 1) % ya > 0 ||
23864                  ((pa = g[f - 2]),
23865                  H.copy(oa.positionScreen),
23866                  I.copy(pa.positionScreen),
23867                  R(H, I) === !0 &&
23868                    (H.multiplyScalar(1 / H.w),
23869                    I.multiplyScalar(1 / I.w),
23870                    (m = O()),
23871                    (m.id = p.id),
23872                    m.v1.positionScreen.copy(H),
23873                    m.v2.positionScreen.copy(I),
23874                    (m.z = Math.max(H.z, I.z)),
23875                    (m.renderOrder = p.renderOrder),
23876                    (m.material = p.material),
23877                    p.material.vertexColors === THREE.VertexColors &&
23878                      (m.vertexColors[0].copy(p.geometry.colors[aa]),
23879                      m.vertexColors[1].copy(p.geometry.colors[aa - 1])),
23880                    u.elements.push(m)))
23881          }
23882        } else if (p instanceof THREE.Sprite) {
23883          w.set(D.elements[12], D.elements[13], D.elements[14], 1),
23884            w.applyMatrix4(C)
23885          var za = 1 / w.w
23886          ;(w.z *= za),
23887            w.z >= -1 &&
23888              w.z <= 1 &&
23889              ((q = P()),
23890              (q.id = p.id),
23891              (q.x = w.x * za),
23892              (q.y = w.y * za),
23893              (q.z = w.z),
23894              (q.renderOrder = p.renderOrder),
23895              (q.object = p),
23896              (q.rotation = p.rotation),
23897              (q.scale.x =
23898                p.scale.x *
23899                Math.abs(
23900                  q.x -
23901                    (w.x + d.projectionMatrix.elements[0]) /
23902                      (w.w + d.projectionMatrix.elements[12])
23903                )),
23904              (q.scale.y =
23905                p.scale.y *
23906                Math.abs(
23907                  q.y -
23908                    (w.y + d.projectionMatrix.elements[5]) /
23909                      (w.w + d.projectionMatrix.elements[13])
23910                )),
23911              (q.material = p.material),
23912              u.elements.push(q))
23913        }
23914      }
23915      return h === !0 && u.elements.sort(Q), u
23916    }
23917  }),
23918  (THREE.SpriteCanvasMaterial = function (a) {
23919    THREE.Material.call(this),
23920      (this.type = 'SpriteCanvasMaterial'),
23921      (this.color = new THREE.Color(16777215)),
23922      (this.program = function (a, b) {}),
23923      this.setValues(a)
23924  }),
23925  (THREE.SpriteCanvasMaterial.prototype = Object.create(
23926    THREE.Material.prototype
23927  )),
23928  (THREE.SpriteCanvasMaterial.prototype.constructor =
23929    THREE.SpriteCanvasMaterial),
23930  (THREE.SpriteCanvasMaterial.prototype.clone = function () {
23931    var a = new THREE.SpriteCanvasMaterial()
23932    return a.copy(this), a.color.copy(this.color), (a.program = this.program), a
23933  }),
23934  (THREE.CanvasRenderer = function (a) {
23935    function ta() {
23936      ma.setRGB(0, 0, 0), na.setRGB(0, 0, 0), oa.setRGB(0, 0, 0)
23937      for (var a = 0, b = e.length; a < b; a++) {
23938        var c = e[a],
23939          d = c.color
23940        c instanceof THREE.AmbientLight
23941          ? ma.add(d)
23942          : c instanceof THREE.DirectionalLight
23943          ? na.add(d)
23944          : c instanceof THREE.PointLight && oa.add(d)
23945      }
23946    }
23947    function ua(a, b, c) {
23948      for (var d = 0, f = e.length; d < f; d++) {
23949        var g = e[d]
23950        if ((_.copy(g.color), g instanceof THREE.DirectionalLight)) {
23951          var h = pa.setFromMatrixPosition(g.matrixWorld).normalize(),
23952            i = b.dot(h)
23953          if (i <= 0) continue
23954          ;(i *= g.intensity), c.add(_.multiplyScalar(i))
23955        } else if (g instanceof THREE.PointLight) {
23956          var h = pa.setFromMatrixPosition(g.matrixWorld),
23957            i = b.dot(pa.subVectors(h, a).normalize())
23958          if (i <= 0) continue
23959          if (
23960            ((i *=
23961              0 == g.distance
23962                ? 1
23963                : 1 - Math.min(a.distanceTo(h) / g.distance, 1)),
23964            0 == i)
23965          )
23966            continue
23967          ;(i *= g.intensity), c.add(_.multiplyScalar(i))
23968        }
23969      }
23970    }
23971    function va(a, b, c) {
23972      Fa(c.opacity), Ga(c.blending)
23973      var d = b.scale.x * j,
23974        e = b.scale.y * k,
23975        f = 0.5 * Math.sqrt(d * d + e * e)
23976      if (
23977        (la.min.set(a.x - f, a.y - f),
23978        la.max.set(a.x + f, a.y + f),
23979        c instanceof THREE.SpriteMaterial)
23980      ) {
23981        var g = c.map
23982        if (null !== g) {
23983          var h = aa[g.id]
23984          if (
23985            ((void 0 !== h && h.version === g.version) ||
23986              ((h = Ba(g)), (aa[g.id] = h)),
23987            void 0 !== h.canvas)
23988          ) {
23989            La(h.canvas)
23990            var i = g.image,
23991              l = i.width * g.offset.x,
23992              m = i.height * g.offset.y,
23993              n = i.width * g.repeat.x,
23994              o = i.height * g.repeat.y,
23995              p = d / n,
23996              r = e / o
23997            q.save(),
23998              q.translate(a.x, a.y),
23999              0 !== c.rotation && q.rotate(c.rotation),
24000              q.translate(-d / 2, -e / 2),
24001              q.scale(p, r),
24002              q.translate(-l, -m),
24003              q.fillRect(l, m, n, o),
24004              q.restore()
24005          }
24006        } else
24007          La(c.color.getStyle()),
24008            q.save(),
24009            q.translate(a.x, a.y),
24010            0 !== c.rotation && q.rotate(c.rotation),
24011            q.scale(d, -e),
24012            q.fillRect(-0.5, -0.5, 1, 1),
24013            q.restore()
24014      } else
24015        c instanceof THREE.SpriteCanvasMaterial &&
24016          (Ka(c.color.getStyle()),
24017          La(c.color.getStyle()),
24018          q.save(),
24019          q.translate(a.x, a.y),
24020          0 !== c.rotation && q.rotate(c.rotation),
24021          q.scale(d, e),
24022          c.program(q),
24023          q.restore())
24024    }
24025    function wa(a, b, c, d) {
24026      if (
24027        (Fa(d.opacity),
24028        Ga(d.blending),
24029        q.beginPath(),
24030        q.moveTo(a.positionScreen.x, a.positionScreen.y),
24031        q.lineTo(b.positionScreen.x, b.positionScreen.y),
24032        d instanceof THREE.LineBasicMaterial)
24033      ) {
24034        if (
24035          (Ha(d.linewidth),
24036          Ia(d.linecap),
24037          Ja(d.linejoin),
24038          d.vertexColors !== THREE.VertexColors)
24039        )
24040          Ka(d.color.getStyle())
24041        else {
24042          var e = c.vertexColors[0].getStyle(),
24043            f = c.vertexColors[1].getStyle()
24044          if (e === f) Ka(e)
24045          else {
24046            try {
24047              var g = q.createLinearGradient(
24048                a.positionScreen.x,
24049                a.positionScreen.y,
24050                b.positionScreen.x,
24051                b.positionScreen.y
24052              )
24053              g.addColorStop(0, e), g.addColorStop(1, f)
24054            } catch (a) {
24055              g = e
24056            }
24057            Ka(g)
24058          }
24059        }
24060        q.stroke(), la.expandByScalar(2 * d.linewidth)
24061      } else
24062        d instanceof THREE.LineDashedMaterial &&
24063          (Ha(d.linewidth),
24064          Ia(d.linecap),
24065          Ja(d.linejoin),
24066          Ka(d.color.getStyle()),
24067          Ma([d.dashSize, d.gapSize]),
24068          q.stroke(),
24069          la.expandByScalar(2 * d.linewidth),
24070          Ma([]))
24071    }
24072    function xa(a, c, d, e, f, g, h, i) {
24073      if (
24074        ((b.info.render.vertices += 3),
24075        b.info.render.faces++,
24076        Fa(i.opacity),
24077        Ga(i.blending),
24078        (I = a.positionScreen.x),
24079        (J = a.positionScreen.y),
24080        (K = c.positionScreen.x),
24081        (L = c.positionScreen.y),
24082        (M = d.positionScreen.x),
24083        (N = d.positionScreen.y),
24084        ya(I, J, K, L, M, N),
24085        (i instanceof THREE.MeshLambertMaterial ||
24086          i instanceof THREE.MeshPhongMaterial) &&
24087          null === i.map)
24088      )
24089        Z.copy(i.color),
24090          $.copy(i.emissive),
24091          i.vertexColors === THREE.FaceColors && Z.multiply(h.color),
24092          U.copy(ma),
24093          qa
24094            .copy(a.positionWorld)
24095            .add(c.positionWorld)
24096            .add(d.positionWorld)
24097            .divideScalar(3),
24098          ua(qa, h.normalModel, U),
24099          U.multiply(Z).add($),
24100          i.wireframe === !0
24101            ? za(
24102                U,
24103                i.wireframeLinewidth,
24104                i.wireframeLinecap,
24105                i.wireframeLinejoin
24106              )
24107            : Aa(U)
24108      else if (
24109        i instanceof THREE.MeshBasicMaterial ||
24110        i instanceof THREE.MeshLambertMaterial ||
24111        i instanceof THREE.MeshPhongMaterial
24112      )
24113        if (null !== i.map) {
24114          var j = i.map.mapping
24115          j === THREE.UVMapping &&
24116            ((ca = h.uvs),
24117            Ca(
24118              I,
24119              J,
24120              K,
24121              L,
24122              M,
24123              N,
24124              ca[e].x,
24125              ca[e].y,
24126              ca[f].x,
24127              ca[f].y,
24128              ca[g].x,
24129              ca[g].y,
24130              i.map
24131            ))
24132        } else
24133          null !== i.envMap
24134            ? i.envMap.mapping === THREE.SphericalReflectionMapping &&
24135              (ra.copy(h.vertexNormalsModel[e]).applyMatrix3(sa),
24136              (da = 0.5 * ra.x + 0.5),
24137              (ea = 0.5 * ra.y + 0.5),
24138              ra.copy(h.vertexNormalsModel[f]).applyMatrix3(sa),
24139              (fa = 0.5 * ra.x + 0.5),
24140              (ga = 0.5 * ra.y + 0.5),
24141              ra.copy(h.vertexNormalsModel[g]).applyMatrix3(sa),
24142              (ha = 0.5 * ra.x + 0.5),
24143              (ia = 0.5 * ra.y + 0.5),
24144              Ca(I, J, K, L, M, N, da, ea, fa, ga, ha, ia, i.envMap))
24145            : (U.copy(i.color),
24146              i.vertexColors === THREE.FaceColors && U.multiply(h.color),
24147              i.wireframe === !0
24148                ? za(
24149                    U,
24150                    i.wireframeLinewidth,
24151                    i.wireframeLinecap,
24152                    i.wireframeLinejoin
24153                  )
24154                : Aa(U))
24155      else
24156        i instanceof THREE.MeshNormalMaterial
24157          ? (ra.copy(h.normalModel).applyMatrix3(sa),
24158            U.setRGB(ra.x, ra.y, ra.z).multiplyScalar(0.5).addScalar(0.5),
24159            i.wireframe === !0
24160              ? za(
24161                  U,
24162                  i.wireframeLinewidth,
24163                  i.wireframeLinecap,
24164                  i.wireframeLinejoin
24165                )
24166              : Aa(U))
24167          : (U.setRGB(1, 1, 1),
24168            i.wireframe === !0
24169              ? za(
24170                  U,
24171                  i.wireframeLinewidth,
24172                  i.wireframeLinecap,
24173                  i.wireframeLinejoin
24174                )
24175              : Aa(U))
24176    }
24177    function ya(a, b, c, d, e, f) {
24178      q.beginPath(),
24179        q.moveTo(a, b),
24180        q.lineTo(c, d),
24181        q.lineTo(e, f),
24182        q.closePath()
24183    }
24184    function za(a, b, c, d) {
24185      Ha(b),
24186        Ia(c),
24187        Ja(d),
24188        Ka(a.getStyle()),
24189        q.stroke(),
24190        la.expandByScalar(2 * b)
24191    }
24192    function Aa(a) {
24193      La(a.getStyle()), q.fill()
24194    }
24195    function Ba(a) {
24196      if (
24197        0 === a.version ||
24198        a instanceof THREE.CompressedTexture ||
24199        a instanceof THREE.DataTexture
24200      )
24201        return { canvas: void 0, version: a.version }
24202      var b = a.image
24203      if (b.complete === !1) return { canvas: void 0, version: 0 }
24204      var c =
24205          a.wrapS === THREE.RepeatWrapping ||
24206          a.wrapS === THREE.MirroredRepeatWrapping,
24207        d =
24208          a.wrapT === THREE.RepeatWrapping ||
24209          a.wrapT === THREE.MirroredRepeatWrapping,
24210        e = a.wrapS === THREE.MirroredRepeatWrapping,
24211        f = a.wrapT === THREE.MirroredRepeatWrapping,
24212        g = document.createElement('canvas')
24213      ;(g.width = b.width * (e ? 2 : 1)), (g.height = b.height * (f ? 2 : 1))
24214      var h = g.getContext('2d')
24215      h.setTransform(1, 0, 0, -1, 0, b.height),
24216        h.drawImage(b, 0, 0),
24217        e === !0 &&
24218          (h.setTransform(-1, 0, 0, -1, b.width, b.height),
24219          h.drawImage(b, -b.width, 0)),
24220        f === !0 &&
24221          (h.setTransform(1, 0, 0, 1, 0, 0), h.drawImage(b, 0, b.height)),
24222        e === !0 &&
24223          f === !0 &&
24224          (h.setTransform(-1, 0, 0, 1, b.width, 0),
24225          h.drawImage(b, -b.width, b.height))
24226      var i = 'no-repeat'
24227      c === !0 && d === !0
24228        ? (i = 'repeat')
24229        : c === !0
24230        ? (i = 'repeat-x')
24231        : d === !0 && (i = 'repeat-y')
24232      var j = q.createPattern(g, i)
24233      return a.onUpdate && a.onUpdate(a), { canvas: j, version: a.version }
24234    }
24235    function Ca(a, b, c, d, e, f, g, h, i, j, k, l, m) {
24236      var n = aa[m.id]
24237      if (
24238        ((void 0 !== n && n.version === m.version) ||
24239          ((n = Ba(m)), (aa[m.id] = n)),
24240        void 0 === n.canvas)
24241      )
24242        return La('rgba( 0, 0, 0, 1)'), void q.fill()
24243      La(n.canvas)
24244      var o,
24245        p,
24246        r,
24247        s,
24248        t,
24249        u,
24250        v,
24251        w,
24252        x = m.offset.x / m.repeat.x,
24253        y = m.offset.y / m.repeat.y,
24254        z = m.image.width * m.repeat.x,
24255        A = m.image.height * m.repeat.y
24256      ;(g = (g + x) * z),
24257        (h = (h + y) * A),
24258        (i = (i + x) * z),
24259        (j = (j + y) * A),
24260        (k = (k + x) * z),
24261        (l = (l + y) * A),
24262        (c -= a),
24263        (d -= b),
24264        (e -= a),
24265        (f -= b),
24266        (i -= g),
24267        (j -= h),
24268        (k -= g),
24269        (l -= h),
24270        (v = i * l - k * j),
24271        0 !== v &&
24272          ((w = 1 / v),
24273          (o = (l * c - j * e) * w),
24274          (p = (l * d - j * f) * w),
24275          (r = (i * e - k * c) * w),
24276          (s = (i * f - k * d) * w),
24277          (t = a - o * g - r * h),
24278          (u = b - p * g - s * h),
24279          q.save(),
24280          q.transform(o, p, r, s, t, u),
24281          q.fill(),
24282          q.restore())
24283    }
24284    function Ea(a, b, c) {
24285      var g,
24286        d = b.x - a.x,
24287        e = b.y - a.y,
24288        f = d * d + e * e
24289      0 !== f &&
24290        ((g = c / Math.sqrt(f)),
24291        (d *= g),
24292        (e *= g),
24293        (b.x += d),
24294        (b.y += e),
24295        (a.x -= d),
24296        (a.y -= e))
24297    }
24298    function Fa(a) {
24299      t !== a && ((q.globalAlpha = a), (t = a))
24300    }
24301    function Ga(a) {
24302      u !== a &&
24303        (a === THREE.NormalBlending
24304          ? (q.globalCompositeOperation = 'source-over')
24305          : a === THREE.AdditiveBlending
24306          ? (q.globalCompositeOperation = 'lighter')
24307          : a === THREE.SubtractiveBlending
24308          ? (q.globalCompositeOperation = 'darker')
24309          : a === THREE.MultiplyBlending &&
24310            (q.globalCompositeOperation = 'multiply'),
24311        (u = a))
24312    }
24313    function Ha(a) {
24314      x !== a && ((q.lineWidth = a), (x = a))
24315    }
24316    function Ia(a) {
24317      y !== a && ((q.lineCap = a), (y = a))
24318    }
24319    function Ja(a) {
24320      z !== a && ((q.lineJoin = a), (z = a))
24321    }
24322    function Ka(a) {
24323      v !== a && ((q.strokeStyle = a), (v = a))
24324    }
24325    function La(a) {
24326      w !== a && ((q.fillStyle = a), (w = a))
24327    }
24328    function Ma(a) {
24329      A.length !== a.length && (q.setLineDash(a), (A = a))
24330    }
24331    console.log('THREE.CanvasRenderer', THREE.REVISION), (a = a || {})
24332    var c,
24333      d,
24334      e,
24335      B,
24336      C,
24337      D,
24338      E,
24339      I,
24340      J,
24341      K,
24342      L,
24343      M,
24344      N,
24345      ca,
24346      da,
24347      ea,
24348      fa,
24349      ga,
24350      ha,
24351      ia,
24352      b = this,
24353      f = new THREE.Projector(),
24354      g = void 0 !== a.canvas ? a.canvas : document.createElement('canvas'),
24355      h = g.width,
24356      i = g.height,
24357      j = Math.floor(h / 2),
24358      k = Math.floor(i / 2),
24359      l = 0,
24360      m = 0,
24361      n = h,
24362      o = i,
24363      p = 1,
24364      q = g.getContext('2d', { alpha: a.alpha === !0 }),
24365      r = new THREE.Color(0),
24366      s = a.alpha === !0 ? 0 : 1,
24367      t = 1,
24368      u = 0,
24369      v = null,
24370      w = null,
24371      x = null,
24372      y = null,
24373      z = null,
24374      A = [],
24375      U =
24376        (new THREE.RenderableVertex(),
24377        new THREE.RenderableVertex(),
24378        new THREE.Color()),
24379      Z =
24380        (new THREE.Color(),
24381        new THREE.Color(),
24382        new THREE.Color(),
24383        new THREE.Color(),
24384        new THREE.Color()),
24385      $ = new THREE.Color(),
24386      _ = new THREE.Color(),
24387      aa = {},
24388      ja = new THREE.Box2(),
24389      ka = new THREE.Box2(),
24390      la = new THREE.Box2(),
24391      ma = new THREE.Color(),
24392      na = new THREE.Color(),
24393      oa = new THREE.Color(),
24394      pa = new THREE.Vector3(),
24395      qa = new THREE.Vector3(),
24396      ra = new THREE.Vector3(),
24397      sa = new THREE.Matrix3()
24398    void 0 === q.setLineDash && (q.setLineDash = function () {}),
24399      (this.domElement = g),
24400      (this.autoClear = !0),
24401      (this.sortObjects = !0),
24402      (this.sortElements = !0),
24403      (this.info = { render: { vertices: 0, faces: 0 } }),
24404      (this.supportsVertexTextures = function () {}),
24405      (this.setFaceCulling = function () {}),
24406      (this.getContext = function () {
24407        return q
24408      }),
24409      (this.getContextAttributes = function () {
24410        return q.getContextAttributes()
24411      }),
24412      (this.getPixelRatio = function () {
24413        return p
24414      }),
24415      (this.setPixelRatio = function (a) {
24416        void 0 !== a && (p = a)
24417      }),
24418      (this.setSize = function (a, b, c) {
24419        ;(h = a * p),
24420          (i = b * p),
24421          (g.width = h),
24422          (g.height = i),
24423          (j = Math.floor(h / 2)),
24424          (k = Math.floor(i / 2)),
24425          c !== !1 && ((g.style.width = a + 'px'), (g.style.height = b + 'px')),
24426          ja.min.set(-j, -k),
24427          ja.max.set(j, k),
24428          ka.min.set(-j, -k),
24429          ka.max.set(j, k),
24430          (t = 1),
24431          (u = 0),
24432          (v = null),
24433          (w = null),
24434          (x = null),
24435          (y = null),
24436          (z = null),
24437          this.setViewport(0, 0, a, b)
24438      }),
24439      (this.setViewport = function (a, b, c, d) {
24440        ;(l = a * p), (m = b * p), (n = c * p), (o = d * p)
24441      }),
24442      (this.setScissor = function () {}),
24443      (this.setScissorTest = function () {}),
24444      (this.setClearColor = function (a, b) {
24445        r.set(a),
24446          (s = void 0 !== b ? b : 1),
24447          ka.min.set(-j, -k),
24448          ka.max.set(j, k)
24449      }),
24450      (this.setClearColorHex = function (a, b) {
24451        console.warn(
24452          'THREE.CanvasRenderer: .setClearColorHex() is being removed. Use .setClearColor() instead.'
24453        ),
24454          this.setClearColor(a, b)
24455      }),
24456      (this.getClearColor = function () {
24457        return r
24458      }),
24459      (this.getClearAlpha = function () {
24460        return s
24461      }),
24462      (this.getMaxAnisotropy = function () {
24463        return 0
24464      }),
24465      (this.clear = function () {
24466        ka.isEmpty() === !1 &&
24467          (ka.intersect(ja),
24468          ka.expandByScalar(2),
24469          (ka.min.x = ka.min.x + j),
24470          (ka.min.y = -ka.min.y + k),
24471          (ka.max.x = ka.max.x + j),
24472          (ka.max.y = -ka.max.y + k),
24473          s < 1 &&
24474            q.clearRect(
24475              0 | ka.min.x,
24476              0 | ka.max.y,
24477              (ka.max.x - ka.min.x) | 0,
24478              (ka.min.y - ka.max.y) | 0
24479            ),
24480          s > 0 &&
24481            (Ga(THREE.NormalBlending),
24482            Fa(1),
24483            La(
24484              'rgba(' +
24485                Math.floor(255 * r.r) +
24486                ',' +
24487                Math.floor(255 * r.g) +
24488                ',' +
24489                Math.floor(255 * r.b) +
24490                ',' +
24491                s +
24492                ')'
24493            ),
24494            q.fillRect(
24495              0 | ka.min.x,
24496              0 | ka.max.y,
24497              (ka.max.x - ka.min.x) | 0,
24498              (ka.min.y - ka.max.y) | 0
24499            )),
24500          ka.makeEmpty())
24501      }),
24502      (this.clearColor = function () {}),
24503      (this.clearDepth = function () {}),
24504      (this.clearStencil = function () {}),
24505      (this.render = function (a, g) {
24506        if (g instanceof THREE.Camera == !1)
24507          return void console.error(
24508            'THREE.CanvasRenderer.render: camera is not an instance of THREE.Camera.'
24509          )
24510        var p = a.background
24511        p && p.isColor
24512          ? (La(
24513              'rgb(' +
24514                Math.floor(255 * p.r) +
24515                ',' +
24516                Math.floor(255 * p.g) +
24517                ',' +
24518                Math.floor(255 * p.b) +
24519                ')'
24520            ),
24521            q.fillRect(0, 0, h, i))
24522          : this.autoClear === !0 && this.clear(),
24523          (b.info.render.vertices = 0),
24524          (b.info.render.faces = 0),
24525          q.setTransform(n / h, 0, 0, -o / i, l, i - m),
24526          q.translate(j, k),
24527          (c = f.projectScene(a, g, this.sortObjects, this.sortElements)),
24528          (d = c.elements),
24529          (e = c.lights),
24530          (B = g),
24531          sa.getNormalMatrix(g.matrixWorldInverse),
24532          ta()
24533        for (var r = 0, s = d.length; r < s; r++) {
24534          var t = d[r],
24535            u = t.material
24536          if (void 0 !== u && 0 !== u.opacity) {
24537            if ((la.makeEmpty(), t instanceof THREE.RenderableSprite))
24538              (C = t), (C.x *= j), (C.y *= k), va(C, t, u)
24539            else if (t instanceof THREE.RenderableLine)
24540              (C = t.v1),
24541                (D = t.v2),
24542                (C.positionScreen.x *= j),
24543                (C.positionScreen.y *= k),
24544                (D.positionScreen.x *= j),
24545                (D.positionScreen.y *= k),
24546                la.setFromPoints([C.positionScreen, D.positionScreen]),
24547                ja.intersectsBox(la) === !0 && wa(C, D, t, u)
24548            else if (t instanceof THREE.RenderableFace) {
24549              if (
24550                ((C = t.v1),
24551                (D = t.v2),
24552                (E = t.v3),
24553                C.positionScreen.z < -1 || C.positionScreen.z > 1)
24554              )
24555                continue
24556              if (D.positionScreen.z < -1 || D.positionScreen.z > 1) continue
24557              if (E.positionScreen.z < -1 || E.positionScreen.z > 1) continue
24558              ;(C.positionScreen.x *= j),
24559                (C.positionScreen.y *= k),
24560                (D.positionScreen.x *= j),
24561                (D.positionScreen.y *= k),
24562                (E.positionScreen.x *= j),
24563                (E.positionScreen.y *= k),
24564                u.overdraw > 0 &&
24565                  (Ea(C.positionScreen, D.positionScreen, u.overdraw),
24566                  Ea(D.positionScreen, E.positionScreen, u.overdraw),
24567                  Ea(E.positionScreen, C.positionScreen, u.overdraw)),
24568                la.setFromPoints([
24569                  C.positionScreen,
24570                  D.positionScreen,
24571                  E.positionScreen
24572                ]),
24573                ja.intersectsBox(la) === !0 && xa(C, D, E, 0, 1, 2, t, u)
24574            }
24575            ka.union(la)
24576          }
24577        }
24578        q.setTransform(1, 0, 0, 1, 0, 0)
24579      })
24580  })
24581
24582var SEPARATION = 100,
24583  AMOUNTX = 50,
24584  AMOUNTY = 50
24585var container
24586var camera, scene, renderer
24587var particles,
24588  particle,
24589  count = 0
24590var mouseX = 0,
24591  mouseY = 0
24592
24593/*让canvas的宽高从父容器取到*/
24594var canvasBox = $('.canvas-box')
24595var canW = canvasBox.width()
24596var canH = canvasBox.height()
24597
24598var windowHalfX = canW / 2
24599var windowHalfY = canH / 2
24600// $(window).width() > 800 &&
24601if (canvasBox.length > 0) {
24602  init()
24603  animate()
24604}
24605
24606function init() {
24607  container = document.createElement('div')
24608  canvasBox.append(container)
24609  camera = new THREE.PerspectiveCamera(
24610    100,
24611    window.innerWidth / window.innerHeight,
24612    1,
24613    10000
24614  )
24615  camera.position.z = 1000
24616  scene = new THREE.Scene()
24617  scene.background = new THREE.Color(0xffffff)
24618  particles = new Array()
24619  var PI2 = Math.PI * 2
24620  var color = new THREE.Color('rgb(183, 183, 183)') //var color = new THREE.Color("rgb(183, 183, 183)");
24621  var material = new THREE.SpriteCanvasMaterial({
24622    color: color,
24623    program: function (context) {
24624      context.beginPath()
24625      context.arc(0, 0, 0.5, 0, PI2, true)
24626      context.fill()
24627    }
24628  })
24629  var i = 0
24630  for (var ix = 0; ix < AMOUNTX; ix++) {
24631    for (var iy = 0; iy < AMOUNTY; iy++) {
24632      particle = particles[i++] = new THREE.Sprite(material)
24633      particle.position.x = ix * SEPARATION - (AMOUNTX * SEPARATION) / 2
24634      particle.position.z = iy * SEPARATION - (AMOUNTY * SEPARATION) / 2
24635      scene.add(particle)
24636    }
24637  }
24638  renderer = new THREE.CanvasRenderer()
24639  renderer.setPixelRatio(window.devicePixelRatio)
24640  renderer.setSize(canW, canH)
24641  container.appendChild(renderer.domElement)
24642  document.addEventListener('mousemove', onDocumentMouseMove, false)
24643
24644  //document.addEventListener( 'touchstart', onDocumentTouchStart, false );
24645  //document.addEventListener( 'touchmove', onDocumentTouchMove, false );
24646  //
24647
24648  window.addEventListener('resize', onWindowResize, false)
24649}
24650
24651function onWindowResize() {
24652  windowHalfX = window.innerWidth / 2
24653  windowHalfY = window.innerHeight / 2
24654
24655  var canW = canvasBox.width()
24656  var canH = canvasBox.height()
24657
24658  camera.aspect = canW / canH
24659  camera.updateProjectionMatrix()
24660  renderer.setSize(canW, canH)
24661}
24662//
24663function onDocumentMouseMove(event) {
24664  mouseX = event.clientX - windowHalfX
24665  mouseY = event.clientY - windowHalfY
24666}
24667
24668function onDocumentTouchStart(event) {
24669  if (event.touches.length === 1) {
24670    event.preventDefault()
24671    mouseX = event.touches[0].pageX - windowHalfX
24672    mouseY = event.touches[0].pageY - windowHalfY
24673  }
24674}
24675
24676function onDocumentTouchMove(event) {
24677  if (event.touches.length === 1) {
24678    event.preventDefault()
24679    mouseX = event.touches[0].pageX - windowHalfX
24680    mouseY = event.touches[0].pageY - windowHalfY
24681  }
24682}
24683//
24684function animate() {
24685  requestAnimationFrame(animate)
24686  render()
24687}
24688
24689function render() {
24690  camera.position.x += (900 - camera.position.x) * 0.05
24691  camera.position.y += (500 - camera.position.y) * 0.1
24692  camera.lookAt(scene.position)
24693
24694  var i = 0
24695  for (var ix = 0; ix < AMOUNTX; ix++) {
24696    for (var iy = 0; iy < AMOUNTY; iy++) {
24697      particle = particles[i++]
24698      particle.position.y =
24699        Math.sin((ix + count) * 0.3) * 50 + Math.sin((iy + count) * 0.5) * 50
24700      particle.scale.x = particle.scale.y =
24701        (Math.sin((ix + count) * 0.3) + 1) * 4 +
24702        (Math.sin((iy + count) * 0.5) + 1) * 4
24703    }
24704  }
24705  renderer.render(scene, camera)
24706  count += 0.1
24707}

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.